mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
Solvers: Rationalized correctPhi
This commit is contained in:
@ -1,59 +1,11 @@
|
||||
if (mesh.changing())
|
||||
{
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchI].initEvaluate();
|
||||
}
|
||||
}
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
p,
|
||||
dimensionedScalar("rAUf", dimTime, 1),
|
||||
geometricZeroField(),
|
||||
pimple
|
||||
);
|
||||
|
||||
forAll(U.boundaryField(), patchI)
|
||||
{
|
||||
if (U.boundaryField()[patchI].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchI].evaluate();
|
||||
|
||||
phi.boundaryField()[patchI] =
|
||||
U.boundaryField()[patchI]
|
||||
& mesh.Sf().boundaryField()[patchI];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
volScalarField pcorr
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pcorr",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("pcorr", p.dimensions(), 0.0),
|
||||
pcorrTypes
|
||||
);
|
||||
|
||||
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pcorrEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pcorrEqn.setReference(pRefCell, pRefValue);
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= pcorrEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
}
|
||||
#include "continuityErrs.H"
|
||||
|
||||
@ -37,6 +37,7 @@ Description
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvIOoptionList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -54,7 +55,6 @@ int main(int argc, char *argv[])
|
||||
#include "createUf.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "createPcorrTypes.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user