Lots of changes from Mark and my changes to ddtPhiCorr all mixed together

because I failed to work out how to merge Mark's stuff -- HELP!!!
This commit is contained in:
henry
2008-05-25 21:46:37 +01:00
parent a016fa314e
commit 4a2a23a710
60 changed files with 938 additions and 410 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
set -x
(cd solvers ; wmake all)
(cd utilities ; wmake all)
( cd solvers && wmake all )
( cd utilities && wmake all )

View File

@ -56,32 +56,35 @@ int main(int argc, char *argv[])
{
# include "readControls.H"
# include "CourantNo.H"
p.storePrevIter();
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
bool meshChanged = mesh.update();
// Make the fluxes absolute
if (mesh.changing())
{
phi = fvc::interpolate(U) & mesh.Sf();
}
if (correctPhi && meshChanged)
mesh.update();
if (mesh.changing() && correctPhi)
{
# include "correctPhi.H"
}
// Keep the absolute fluxes for use in ddtPhiCorr
surfaceScalarField phiAbs("phiAbs", phi);
surfaceScalarField phiAbs0("phiAbs0", phi);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
if (mesh.changing())
{
fvc::makeRelative(phi, U);
}
if (meshChanged && checkMeshCourantNo)
if (mesh.changing() && checkMeshCourantNo)
{
# include "meshCourantNo.H"
}
@ -89,6 +92,8 @@ int main(int argc, char *argv[])
// --- PIMPLE loop
for (int ocorr=0; ocorr<nOuterCorr; ocorr++)
{
p.storePrevIter();
# include "UEqn.H"
// --- PISO loop
@ -101,10 +106,50 @@ int main(int argc, char *argv[])
if (ddtPhiCorr)
{
phi += fvc::ddtPhiCorr(rAU, U, phiAbs);
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);
}
}
adjustPhi(phi, U, p);
if (p.needReference())
{
if (mesh.changing())
{
fvc::makeRelative(phi, U);
adjustPhi(phi, U, p);
fvc::makeAbsolute(phi, U);
}
else
{
adjustPhi(phi, U, p);
}
}
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
@ -138,11 +183,11 @@ int main(int argc, char *argv[])
p.relax();
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
}
}

View File

@ -41,6 +41,7 @@ Description
#include "twoPhaseMixture.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "probes.H"
#include "EulerDdtScheme.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,7 +67,6 @@ int main(int argc, char *argv[])
{
#include "readControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
// Make the fluxes absolute
if (mesh.changing())
{
fvc::makeAbsolute(phi, U);
phi = fvc::interpolate(U) & mesh.Sf();
}
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
@ -100,7 +100,7 @@ int main(int argc, char *argv[])
}
// Keep the absolute fluxes for use in ddtPhiCorr
surfaceScalarField phiAbs("phiAbs", phi);
surfaceScalarField phiAbs0("phiAbs0", phi);
// Make the fluxes relative to the mesh motion
if (mesh.changing())
@ -125,8 +125,6 @@ int main(int argc, char *argv[])
#include "pEqn.H"
}
#include "continuityErrs.H"
p = pd + rho*gh;
if (pd.needReference())

View File

@ -2,21 +2,42 @@
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);
volVectorField HU = UEqn.H();
U = rAU*HU;
U = rAU*UEqn.H();
surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
if (ddtPhiCorr)
{
phiU += fvc::ddtPhiCorr(rAU, rho, U, phiAbs);
//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())
);
}
phi = phiU +
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
if (pd.needReference())
{
@ -59,6 +80,8 @@
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
U.correctBoundaryConditions();
#include "continuityErrs.H"
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
}

View File

@ -1,9 +1,9 @@
#!/bin/sh
set -x
# Some fun: prostar uses ccmio2.3, Star-ccm+ uses ccmio2.4
# compile cd-adapco's CCM library
wmake libso libccmio/libadf
wmake libso libccmio/libccmio
wmake libso libccmio/libcgns
(cd libccmio; wmake libso libadf)
(cd libccmio; wmake libso libccmio)
(cd libccmio; wmake libso libcgns)
(cd ccm26ToFoam; wmake)
wmake ccm26ToFoam