mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
pd => p
This commit is contained in:
@ -24,10 +24,10 @@
|
|||||||
==
|
==
|
||||||
fvc::reconstruct
|
fvc::reconstruct
|
||||||
(
|
(
|
||||||
(
|
fvc::interpolate(rho)*(g & mesh.Sf())
|
||||||
|
+ (
|
||||||
mixture.surfaceTensionForce()
|
mixture.surfaceTensionForce()
|
||||||
- ghf*fvc::snGrad(rho)
|
- fvc::snGrad(p)
|
||||||
- fvc::snGrad(pd)
|
|
||||||
) * mesh.magSf()
|
) * mesh.magSf()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Info<< "Reading field pd\n" << endl;
|
Info<< "Reading field p\n" << endl;
|
||||||
volScalarField pd
|
volScalarField p
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"pd",
|
"p",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
@ -45,45 +45,9 @@
|
|||||||
rho.oldTime();
|
rho.oldTime();
|
||||||
|
|
||||||
|
|
||||||
Info<< "Calculating field g.h\n" << endl;
|
label pRefCell = 0;
|
||||||
volScalarField gh("gh", g & mesh.C());
|
|
||||||
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
|
||||||
|
|
||||||
|
|
||||||
volScalarField p
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
),
|
|
||||||
pd + rho*gh
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
label pdRefCell = 0;
|
|
||||||
scalar pdRefValue = 0.0;
|
|
||||||
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
|
|
||||||
|
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
|
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||||
if (pd.needReference())
|
|
||||||
{
|
|
||||||
pRefValue = readScalar
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("PISO").lookup("pRefValue")
|
|
||||||
);
|
|
||||||
|
|
||||||
p += dimensionedScalar
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
p.dimensions(),
|
|
||||||
pRefValue - getRefCellValue(p, pdRefCell)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Construct incompressible turbulence model
|
// Construct incompressible turbulence model
|
||||||
|
|||||||
@ -81,18 +81,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
p = pd + rho*gh;
|
|
||||||
|
|
||||||
if (pd.needReference())
|
|
||||||
{
|
|
||||||
p += dimensionedScalar
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
p.dimensions(),
|
|
||||||
pRefValue - getRefCellValue(p, pdRefCell)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
turbulence->correct();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|||||||
@ -13,32 +13,32 @@
|
|||||||
phi = phiU +
|
phi = phiU +
|
||||||
(
|
(
|
||||||
mixture.surfaceTensionForce()
|
mixture.surfaceTensionForce()
|
||||||
- ghf*fvc::snGrad(rho)
|
+ fvc::interpolate(rho)*(g & mesh.Sf())
|
||||||
)*rUAf*mesh.magSf();
|
)*rUAf*mesh.magSf();
|
||||||
|
|
||||||
adjustPhi(phi, U, pd);
|
adjustPhi(phi, U, p);
|
||||||
|
|
||||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pdEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::laplacian(rUAf, pd) == fvc::div(phi)
|
fvm::laplacian(rUAf, p) == fvc::div(phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
pdEqn.setReference(pdRefCell, pdRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
if (corr == nCorr-1)
|
if (corr == nCorr-1)
|
||||||
{
|
{
|
||||||
pdEqn.solve(mesh.solver(pd.name() + "Final"));
|
pEqn.solve(mesh.solver(p.name() + "Final"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pdEqn.solve(mesh.solver(pd.name()));
|
pEqn.solve(mesh.solver(p.name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi -= pdEqn.flux();
|
phi -= pEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user