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,24 +74,26 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
|
||||||
|
|
||||||
// Do any mesh changes
|
|
||||||
mesh.update();
|
|
||||||
|
|
||||||
if (mesh.changing())
|
|
||||||
{
|
{
|
||||||
Info<< "Execution time for mesh.update() = "
|
// Store divU from the previous mesh for the correctPhi
|
||||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
volScalarField divU = fvc::div(phi);
|
||||||
<< " s" << endl;
|
|
||||||
|
|
||||||
gh = g & mesh.C();
|
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||||
ghf = g & mesh.Cf();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mesh.changing() && correctPhi)
|
// Do any mesh changes
|
||||||
{
|
mesh.update();
|
||||||
//***HGW#include "correctPhi.H"
|
|
||||||
|
if (mesh.changing())
|
||||||
|
{
|
||||||
|
Info<< "Execution time for mesh.update() = "
|
||||||
|
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||||
|
<< " s" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mesh.changing() && correctPhi)
|
||||||
|
{
|
||||||
|
#include "correctPhi.H"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
@ -102,6 +104,12 @@ int main(int argc, char *argv[])
|
|||||||
#include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mesh.changing())
|
||||||
|
{
|
||||||
|
gh = g & mesh.C();
|
||||||
|
ghf = g & mesh.Cf();
|
||||||
|
}
|
||||||
|
|
||||||
turbulence->correct();
|
turbulence->correct();
|
||||||
|
|
||||||
// --- Outer-corrector loop
|
// --- 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)
|
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