Simple dynamic mesh solver

This commit is contained in:
Hrvoje Jasak 2010-10-13 12:39:00 +01:00
parent 93effde8e9
commit 713c27c5c0
3 changed files with 24 additions and 9 deletions

View file

@ -24,12 +24,6 @@
pcorrTypes pcorrTypes
); );
# include "continuityErrs.H"
// Flux predictor
phi = (fvc::interpolate(U) & mesh.Sf());
rAU == runTime.deltaT();
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pcorrEqn fvScalarMatrix pcorrEqn
@ -50,4 +44,4 @@
} }
} }
#include "continuityErrs.H"

View file

@ -54,17 +54,37 @@
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
scalar totalVolume = sum(mesh.V()).value();
Info<< "Reading field rAU if present\n" << endl;
volScalarField rAU volScalarField rAU
( (
IOobject IOobject
( (
"rAU", "rAU",
runTime.timeName(), runTime.timeName(),
mesh mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
), ),
mesh, mesh,
runTime.deltaT(), runTime.deltaT(),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
{
const dictionary& piso = mesh.solutionDict().subDict("PISO");
bool momentumPredictor = true;
if (piso.found("momentumPredictor"))
{
momentumPredictor = Switch(piso.lookup("momentumPredictor"));
}
bool momentumPredictorSave = momentumPredictor;
momentumPredictor = false;
# include "UEqn.H"
momentumPredictor = momentumPredictorSave;
rAU = 1.0/UEqn.A();
}

View file

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
# include "createTime.H" # include "createTime.H"
# include "createDynamicFvMesh.H" # include "createDynamicFvMesh.H"
# include "initContinuityErrs.H" # include "initContinuityErrs.H"
# include "initTotalVolume.H"
# include "createFields.H" # include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //