Simplification of the pimple IB solver: mesh update and flux correction
This commit is contained in:
parent
b8b7ba6eee
commit
f9c325021f
3 changed files with 53 additions and 25 deletions
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
// Make the fluxes absolute (using the ddt(U) scheme)
|
||||
fvc::makeAbsolute(phi, U);
|
||||
|
||||
// Motion inside PIMPLE loop: simple IB update
|
||||
bool meshChanged = mesh.update();
|
||||
|
||||
# include "updateIbPatchFields.H"
|
||||
# include "updateIbMasks.H"
|
||||
# include "volContinuity.H"
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
volScalarField divMeshPhi
|
||||
(
|
||||
"divMeshPhi",
|
||||
-fvc::div(mesh.phi())
|
||||
);
|
||||
|
||||
divMeshPhi.internalField() +=
|
||||
(1.0 - mesh.V0()/mesh.V())/runTime.deltaT().value();
|
||||
|
||||
divMeshPhi = mag(divMeshPhi);
|
||||
divMeshPhi.write();
|
||||
|
||||
U.write();
|
||||
mesh.phi().write();
|
||||
}
|
||||
|
||||
// Fluxes will be corrected to absolute velocity
|
||||
// HJ, 6/Feb/2009
|
||||
# include "correctPhi.H"
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
# include "immersedBoundaryCourantNo.H"
|
||||
}
|
||||
|
||||
// Correct velocity boundary conditions after mesh motion, with relative
|
||||
// fluxes
|
||||
U.correctBoundaryConditions();
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
volScalarField pcorr("pcorr", p);
|
||||
pcorr *= 0;
|
||||
|
||||
// Initialise flux with interpolated velocity
|
||||
phi = fvc::interpolate(U) & mesh.Sf();
|
||||
|
@ -8,11 +9,13 @@
|
|||
|
||||
mesh.schemesDict().setFluxRequired(pcorr.name());
|
||||
|
||||
dimensionedScalar rUAf("(1|A(U))", dimTime, 1.0);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pcorrEqn
|
||||
(
|
||||
fvm::laplacian(1/aU, pcorr) == fvc::div(phi)
|
||||
fvm::laplacian(rUAf, pcorr) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pcorrEqn.setReference(pRefCell, pRefValue);
|
||||
|
@ -26,6 +29,6 @@
|
|||
// Fluxes are corrected to absolute velocity and further corrected
|
||||
// later. HJ, 6/Feb/2009
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
}
|
||||
|
||||
|
|
|
@ -72,34 +72,14 @@ int main(int argc, char *argv[])
|
|||
while (runTime.run())
|
||||
{
|
||||
# include "readControls.H"
|
||||
# include "CourantNo.H"
|
||||
# include "immersedBoundaryCourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
// Make the fluxes absolute
|
||||
fvc::makeAbsolute(phi, U);
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
# include "updateIbPatchFields.H"
|
||||
# include "updateIbMasks.H"
|
||||
# include "volContinuity.H"
|
||||
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
# include "meshCourantNo.H"
|
||||
}
|
||||
|
||||
// Fluxes will be corrected to absolute velocity
|
||||
// HJ, 6/Feb/2009
|
||||
# include "correctPhi.H"
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
# include "correctMeshMotion.H"
|
||||
|
||||
// --- PIMPLE loop
|
||||
while (pimple.loop())
|
||||
|
|
Reference in a new issue