mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Solvers: Rationalized correctPhi
This commit is contained in:
@ -1,63 +1,11 @@
|
||||
if (mesh.changing())
|
||||
{
|
||||
forAll(U.boundaryField(), patchi)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchi].initEvaluate();
|
||||
}
|
||||
}
|
||||
|
||||
forAll(U.boundaryField(), patchi)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
U.boundaryField()[patchi].evaluate();
|
||||
|
||||
phi.boundaryField()[patchi] =
|
||||
rho.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::ddt(psi, pcorr)
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rAUf, pcorr)
|
||||
==
|
||||
divrhoU
|
||||
);
|
||||
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi += pcorrEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
CorrectPhi
|
||||
(
|
||||
U,
|
||||
phi,
|
||||
p,
|
||||
rho,
|
||||
psi,
|
||||
dimensionedScalar("rAUf", dimTime, 1),
|
||||
divrhoU,
|
||||
pimple
|
||||
);
|
||||
|
||||
@ -42,6 +42,7 @@ Description
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvIOoptionList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -58,7 +59,6 @@ int main(int argc, char *argv[])
|
||||
#include "readControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createPcorrTypes.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
@ -38,6 +38,7 @@ Description
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "CorrectPhi.H"
|
||||
#include "fvIOoptionList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -54,7 +55,6 @@ int main(int argc, char *argv[])
|
||||
#include "readControls.H"
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createPcorrTypes.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "CourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
Reference in New Issue
Block a user