This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H

64 lines
1.4 KiB
C
Raw Normal View History

2010-09-22 18:13:13 +00:00
{
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] =
U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
}
}
}
#include "continuityErrs.H"
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("pcorr", p.dimensions(), 0.0),
pcorrTypes
);
dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
adjustPhi(phi, U, pcorr);
2016-04-12 07:31:33 +00:00
mesh.schemesDict().setFluxRequired(pcorr.name());
while (pimple.correctNonOrthogonal())
2010-09-22 18:13:13 +00:00
{
fvScalarMatrix pcorrEqn
(
fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divU
);
pcorrEqn.solve();
if (pimple.finalNonOrthogonalIter())
2010-09-22 18:13:13 +00:00
{
phi -= pcorrEqn.flux();
}
}
# include "continuityErrs.H"
2010-09-22 18:13:13 +00:00
}