Fixed dynamic refinement tutorials: direct topo change does not deal with face mapping correctly

This commit is contained in:
Hrvoje Jasak 2010-11-17 12:50:34 +00:00
parent 8a4cca0d96
commit cc22953ac4
2 changed files with 31 additions and 20 deletions

View file

@ -38,7 +38,14 @@
pcorrTypes
);
dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
dimensionedScalar rAUf
(
"(1|A(U))",
dimTime/rho.dimensions(),
runTime.deltaT().value()
);
phi = (fvc::interpolate(U) & mesh.Sf());
adjustPhi(phi, U, pcorr);
@ -59,4 +66,8 @@
}
# include "continuityErrs.H"
# include "CourantNo.H"
// Recalculate rhoPhi from rho
rhoPhi = fvc::interpolate(rho)*phi;
}

View file

@ -45,17 +45,17 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readGravitationalAcceleration.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readGravitationalAcceleration.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"
# include "correctPhi.H"
# include "CourantNo.H"
# include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,13 +63,13 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "CourantNo.H"
# include "readControls.H"
# include "CourantNo.H"
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
#include "setDeltaT.H"
# include "setDeltaT.H"
runTime++;
@ -92,7 +92,7 @@ int main(int argc, char *argv[])
if (mesh.changing() && correctPhi)
{
#include "correctPhi.H"
# include "correctPhi.H"
}
// Make the fluxes relative to the mesh motion
@ -100,19 +100,19 @@ int main(int argc, char *argv[])
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
# include "meshCourantNo.H"
}
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
# include "alphaEqnSubCycle.H"
#include "UEqn.H"
# include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
# include "pEqn.H"
}
p = pd + rho*gh;