Skip to content
Snippets Groups Projects
Commit 898742e6 authored by henry's avatar henry
Browse files

Corrected the update of pd from p in closed-volume cases.

parent 1bc9eea3
No related branches found
No related tags found
No related merge requests found
...@@ -55,5 +55,6 @@ if (closedVolume) ...@@ -55,5 +55,6 @@ if (closedVolume)
{ {
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
/fvc::domainIntegrate(thermo->psi()); /fvc::domainIntegrate(thermo->psi());
pd == p - (rho*gh + pRef);
rho = thermo->rho(); rho = thermo->rho();
} }
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
U = rUA*UEqn().H(); U = rUA*UEqn().H();
UEqn.clear(); UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p); bool closedVolume = adjustPhi(phi, U, p);
phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf(); phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf();
...@@ -46,6 +47,7 @@ if (closedVolume) ...@@ -46,6 +47,7 @@ if (closedVolume)
{ {
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
/fvc::domainIntegrate(thermo->psi()); /fvc::domainIntegrate(thermo->psi());
pd == p - (rho*gh + pRef);
} }
rho = thermo->rho(); rho = thermo->rho();
......
...@@ -46,6 +46,7 @@ if (closedVolume) ...@@ -46,6 +46,7 @@ if (closedVolume)
{ {
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
/fvc::domainIntegrate(thermo->psi()); /fvc::domainIntegrate(thermo->psi());
pd == p - (rho*gh + pRef);
} }
rho = thermo->rho(); rho = thermo->rho();
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
) )
- fvc::domainIntegrate(thermof[i].psi()*thermof[i].p()) - fvc::domainIntegrate(thermof[i].psi()*thermof[i].p())
)/fvc::domainIntegrate(thermof[i].psi()); )/fvc::domainIntegrate(thermof[i].psi());
pdf[i] == thermof[i].p() - (rhof[i]*ghf[i] + pRef);
rhof[i] = thermof[i].rho(); rhof[i] = thermof[i].rho();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment