mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Reverting ddtPhiCorr back to standard (not good for moving meshes)
This commit is contained in:
@ -56,6 +56,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
# include "readControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
# include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
@ -63,10 +64,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// Make the fluxes absolute
|
||||
if (mesh.changing())
|
||||
{
|
||||
phi = fvc::interpolate(U) & mesh.Sf();
|
||||
}
|
||||
fvc::makeAbsolute(phi, U);
|
||||
|
||||
mesh.update();
|
||||
|
||||
@ -75,14 +73,8 @@ int main(int argc, char *argv[])
|
||||
# include "correctPhi.H"
|
||||
}
|
||||
|
||||
// Keep the absolute fluxes for use in ddtPhiCorr
|
||||
surfaceScalarField phiAbs0("phiAbs0", phi);
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
if (mesh.changing())
|
||||
{
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
@ -106,49 +98,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (ddtPhiCorr)
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
dimensionedScalar rDeltaT = 1.0/mesh.time().deltaT();
|
||||
|
||||
volScalarField V0byV
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"V0byV",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("V0byV", dimless, 1),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
V0byV.dimensionedInternalField() = mesh.V0()/mesh.V();
|
||||
V0byV.correctBoundaryConditions();
|
||||
|
||||
phi += rDeltaT*
|
||||
(
|
||||
fvc::interpolate(rAU*V0byV)*phiAbs0
|
||||
- (fvc::interpolate(rAU*V0byV*U.oldTime()) & mesh.Sf())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
phi += fvc::ddtPhiCorr(rAU, U, phiAbs0);
|
||||
}
|
||||
phi += fvc::ddtPhiCorr(rAU, U, phi);
|
||||
}
|
||||
|
||||
if (p.needReference())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
fvc::makeRelative(phi, U);
|
||||
adjustPhi(phi, U, p);
|
||||
fvc::makeAbsolute(phi, U);
|
||||
}
|
||||
else
|
||||
{
|
||||
adjustPhi(phi, U, p);
|
||||
}
|
||||
fvc::makeRelative(phi, U);
|
||||
adjustPhi(phi, U, p);
|
||||
fvc::makeAbsolute(phi, U);
|
||||
}
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
@ -183,11 +140,11 @@ int main(int argc, char *argv[])
|
||||
p.relax();
|
||||
}
|
||||
|
||||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -74,10 +74,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// Make the fluxes absolute
|
||||
if (mesh.changing())
|
||||
{
|
||||
phi = fvc::interpolate(U) & mesh.Sf();
|
||||
}
|
||||
fvc::makeAbsolute(phi, U);
|
||||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
@ -103,10 +100,7 @@ int main(int argc, char *argv[])
|
||||
surfaceScalarField phiAbs0("phiAbs0", phi);
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
if (mesh.changing())
|
||||
{
|
||||
fvc::makeRelative(phi, U);
|
||||
}
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
{
|
||||
|
||||
@ -7,30 +7,7 @@
|
||||
|
||||
if (ddtPhiCorr)
|
||||
{
|
||||
//phiU += fvc::ddtPhiCorr(rAU, rho, U, phiAbs0);
|
||||
|
||||
dimensionedScalar rDeltaT = 1.0/mesh.time().deltaT();
|
||||
|
||||
volScalarField V0byV
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"V0byV",
|
||||
mesh.time().timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("V0byV", dimless, 1),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
V0byV.dimensionedInternalField() = mesh.V0()/mesh.V();
|
||||
V0byV.correctBoundaryConditions();
|
||||
|
||||
phiU += rDeltaT*
|
||||
(
|
||||
fvc::interpolate(rAU*rho.oldTime()*V0byV)*phiAbs0
|
||||
- (fvc::interpolate(rAU*rho.oldTime()*V0byV*U.oldTime()) & mesh.Sf())
|
||||
);
|
||||
phiU += fvc::ddtPhiCorr(rAU, rho, U, phiAbs0);
|
||||
}
|
||||
|
||||
phi = phiU +
|
||||
@ -41,16 +18,9 @@
|
||||
|
||||
if (pd.needReference())
|
||||
{
|
||||
if (mesh.changing())
|
||||
{
|
||||
fvc::makeRelative(phi, U);
|
||||
adjustPhi(phi, U, pd);
|
||||
fvc::makeAbsolute(phi, U);
|
||||
}
|
||||
else
|
||||
{
|
||||
adjustPhi(phi, U, pd);
|
||||
}
|
||||
fvc::makeRelative(phi, U);
|
||||
adjustPhi(phi, U, pd);
|
||||
fvc::makeAbsolute(phi, U);
|
||||
}
|
||||
|
||||
for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
|
||||
Reference in New Issue
Block a user