From 898742e6eb6d7e56f7803ee4cabb3a957b0f1611 Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 24 Jul 2008 12:39:44 +0100 Subject: [PATCH] Corrected the update of pd from p in closed-volume cases. --- applications/solvers/heatTransfer/buoyantFoam/pEqn.H | 1 + applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H | 2 ++ .../solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H | 1 + .../solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/applications/solvers/heatTransfer/buoyantFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantFoam/pEqn.H index 2a1929eb72..36378f7f6f 100644 --- a/applications/solvers/heatTransfer/buoyantFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantFoam/pEqn.H @@ -55,5 +55,6 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); rho = thermo->rho(); } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 4c8d0939a8..8c3621205b 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -1,6 +1,7 @@ volScalarField rUA = 1.0/UEqn().A(); U = rUA*UEqn().H(); UEqn.clear(); + phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); bool closedVolume = adjustPhi(phi, U, p); phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf(); @@ -46,6 +47,7 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); } rho = thermo->rho(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H index 4c8d0939a8..2a713bac62 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/pEqn.H @@ -46,6 +46,7 @@ if (closedVolume) { p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) /fvc::domainIntegrate(thermo->psi()); + pd == p - (rho*gh + pRef); } rho = thermo->rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 3e071ce8ba..fd018d7096 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -51,7 +51,7 @@ ) - fvc::domainIntegrate(thermof[i].psi()*thermof[i].p()) )/fvc::domainIntegrate(thermof[i].psi()); - + pdf[i] == thermof[i].p() - (rhof[i]*ghf[i] + pRef); rhof[i] = thermof[i].rho(); }