rhoPimpleDyMFoam: New version of rhoPimpleFoam for moving-mesh cases

This commit is contained in:
Henry
2013-04-29 14:34:15 +01:00
parent c205857f0b
commit 042354a88e
17 changed files with 411 additions and 88 deletions

View File

@ -1,25 +1,24 @@
EXE_INC = \
-I.. \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
EXE_LIBS = \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh \
-lmeshTools \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume \
-lfvOptions \
-lsampling
-lsampling \
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh \
-lmeshTools

View File

@ -1,23 +0,0 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
fvOptions(U)
);
UEqn().relax();
fvOptions.constrain(UEqn());
rAU = 1.0/UEqn().A();
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
fvOptions.correct(U);
}

View File

@ -22,20 +22,6 @@
}
}
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
forAll(p.boundaryField(), patchI)
{
if (p.boundaryField()[patchI].fixesValue())
{
pcorrTypes[patchI] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
@ -51,11 +37,13 @@
pcorrTypes
);
dimensionedScalar Dp("Dp", dimTime, 1.0);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pcorrEqn
(
fvm::laplacian(rAU, pcorr) == fvc::div(phi)
fvm::laplacian(Dp, pcorr) == fvc::div(phi)
);
pcorrEqn.setReference(pRefCell, pRefValue);
@ -68,6 +56,4 @@
}
}
phi.oldTime() = phi;
#include "continuityErrs.H"

View File

@ -40,19 +40,3 @@
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
Info<< "Reading field rAU if present\n" << endl;
volScalarField rAU
(
IOobject
(
"rAU",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
runTime.deltaT(),
zeroGradientFvPatchScalarField::typeName
);

View File

@ -0,0 +1,13 @@
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
for (label i=0; i<p.boundaryField().size(); i++)
{
if (p.boundaryField()[i].fixesValue())
{
pcorrTypes[i] = fixedValueFvPatchScalarField::typeName;
}
}

View File

@ -10,13 +10,9 @@ surfaceScalarField phiHbyA
(
"phiHbyA",
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, U, phiAbs)
);
if (ddtPhiCorr)
{
phiHbyA += fvc::ddtPhiCorr(rAU, U, phi);
}
if (p.needReference())
{
fvc::makeRelative(phiHbyA, U);

View File

@ -33,9 +33,9 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H"
#include "turbulenceModel.H"
#include "dynamicFvMesh.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
@ -44,15 +44,21 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createFvOptions.H"
#include "readTimeControls.H"
#include "createPcorrTypes.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
pimpleControl pimple(mesh);
// Create old-time absolute flux for ddtPhiCorr
surfaceScalarField phiAbs("phiAbs", phi);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,6 +72,9 @@ int main(int argc, char *argv[])
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
// Update absolute flux for ddtPhiCorr
phiAbs = phi;
#include "setDeltaT.H"
runTime++;

View File

@ -1,12 +1,7 @@
#include "readTimeControls.H"
const dictionary& pimpleDict = pimple.dict();
const bool correctPhi =
pimpleDict.lookupOrDefault("correctPhi", false);
pimple.dict().lookupOrDefault("correctPhi", false);
const bool checkMeshCourantNo =
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
const bool ddtPhiCorr =
pimpleDict.lookupOrDefault("ddtPhiCorr", true);
pimple.dict().lookupOrDefault("checkMeshCourantNo", false);