mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added correctPhi to compressibleInterDyMFoam.
This commit is contained in:
@ -74,6 +74,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
{
|
||||
// Store divU from the previous mesh for the correctPhi
|
||||
volScalarField divU = fvc::div(phi);
|
||||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
// Do any mesh changes
|
||||
@ -84,14 +88,12 @@ int main(int argc, char *argv[])
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
|
||||
gh = g & mesh.C();
|
||||
ghf = g & mesh.Cf();
|
||||
}
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
{
|
||||
//***HGW#include "correctPhi.H"
|
||||
#include "correctPhi.H"
|
||||
}
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
@ -102,6 +104,12 @@ int main(int argc, char *argv[])
|
||||
#include "meshCourantNo.H"
|
||||
}
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
gh = g & mesh.C();
|
||||
ghf = g & mesh.Cf();
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
// --- Outer-corrector loop
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
{
|
||||
#include "continuityErrs.H"
|
||||
|
||||
volScalarField pcorr
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pcorr",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("pcorr", pd.dimensions(), 0.0),
|
||||
pcorrTypes
|
||||
);
|
||||
|
||||
dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
|
||||
|
||||
adjustPhi(phi, U, pcorr);
|
||||
|
||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pcorrEqn
|
||||
(
|
||||
fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divU
|
||||
);
|
||||
|
||||
pcorrEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi -= pcorrEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
#include "continuityErrs.H"
|
||||
}
|
||||
@ -150,3 +150,14 @@
|
||||
(
|
||||
incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
|
||||
);
|
||||
|
||||
|
||||
wordList pcorrTypes(pd.boundaryField().types());
|
||||
|
||||
for (label i=0; i<pd.boundaryField().size(); i++)
|
||||
{
|
||||
if (pd.boundaryField()[i].fixesValue())
|
||||
{
|
||||
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user