These new names are more consistent and logical because:
primitiveField():
primitiveFieldRef():
Provides low-level access to the Field<Type> (primitive field)
without dimension or mesh-consistency checking. This should only be
used in the low-level functions where dimensional consistency is
ensured by careful programming and computational efficiency is
paramount.
internalField():
internalFieldRef():
Provides access to the DimensionedField<Type, GeoMesh> of values on
the internal mesh-type for which the GeometricField is defined and
supports dimension and checking and mesh-consistency checking.
41 lines
853 B
C
41 lines
853 B
C
if (nAlphaSubCycles > 1)
|
|
{
|
|
dimensionedScalar totalDeltaT = runTime.deltaT();
|
|
surfaceScalarField rhoPhiSum
|
|
(
|
|
IOobject
|
|
(
|
|
"rhoPhiSum",
|
|
runTime.timeName(),
|
|
mesh
|
|
),
|
|
mesh,
|
|
dimensionedScalar("0", rhoPhi.dimensions(), 0)
|
|
);
|
|
|
|
for
|
|
(
|
|
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
|
|
!(++alphaSubCycle).end();
|
|
)
|
|
{
|
|
#include "alphaEqns.H"
|
|
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
|
|
}
|
|
|
|
rhoPhi = rhoPhiSum;
|
|
}
|
|
else
|
|
{
|
|
#include "alphaEqns.H"
|
|
}
|
|
|
|
{
|
|
volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3);
|
|
|
|
//solve(fvm::ddt(rho) + fvc::div(rhoPhi));
|
|
//Info<< "density error = "
|
|
// << max((mag(rho - rhoNew)/mag(rhoNew))().primitiveField()) << endl;
|
|
|
|
rho == rhoNew;
|
|
}
|