Commit 3c053c2f authored by Henry Weller's avatar Henry Weller

GeometricField: Renamed internalField() -> primitiveField() and...

GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()

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.
parent ccd958a8
......@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
force.internalFieldRef() = ReImSum
force.primitiveFieldRef() = ReImSum
(
fft::reverseTransform
(
......
......@@ -105,7 +105,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0)
);
N.internalFieldRef() = Nv.internalField()*Cw;
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
volSymmTensorField ns
(
......@@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
Zero
)
);
ns.internalFieldRef() = nsv.internalField()*Cw;
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
......
......@@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
volScalarField& Gtot = tGtot.ref();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
scalarField N(Nv.internalField()*Cw);
scalarField N(Nv.primitiveField()*Cw);
forAll(N, celli)
{
......
......@@ -36,8 +36,8 @@ Description
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phiSt))().internalField()
/ rho.internalField()
fvc::surfaceSum(mag(phiSt))().primitiveField()
/ rho.primitiveField()
);
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
if (subGridSchelkin_)
{
up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
......
......@@ -82,7 +82,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)
{
up.internalFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
......
......@@ -114,7 +114,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
)
);
volScalarField& N = tN.ref();
N.internalFieldRef() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
volSymmTensorField ns
(
......@@ -134,7 +134,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
Zero
)
);
ns.internalFieldRef() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
......@@ -150,7 +150,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
// Re use tN
N.internalFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}
......
......@@ -68,8 +68,8 @@ License
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.internalField()) << ", "
<< gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
......@@ -120,8 +120,8 @@ License
rDeltaT.correctBoundaryConditions();
Info<< " Overall = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
......
......@@ -31,7 +31,7 @@ Description
if (mesh.nInternalFaces())
{
scalarField sumAmaxSf(fvc::surfaceSum(amaxSf)().internalField());
scalarField sumAmaxSf(fvc::surfaceSum(amaxSf)().primitiveField());
CoNum = 0.5*gMax(sumAmaxSf/mesh.V().field())*runTime.deltaTValue();
......
......@@ -13,7 +13,7 @@ const volScalarField& psi = thermo.psi();
const volScalarField& mu = thermo.mu();
bool inviscid(true);
if (max(mu.internalField()) > 0.0)
if (max(mu.primitiveField()) > 0.0)
{
inviscid = false;
}
......
......@@ -24,6 +24,6 @@
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
......@@ -53,8 +53,8 @@
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
if (rDeltaTSmoothingCoeff < 1.0)
{
......@@ -62,8 +62,8 @@
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
// Limit rate of change of time scale
// - reduce as much as required
......@@ -79,7 +79,7 @@
*max(rDeltaT/rDeltaT0, scalar(1) - rDeltaTDampingCoeff);
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
}
......@@ -36,8 +36,8 @@ Foam::scalar Foam::compressibleCourantNo
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().internalField()
/ rho.internalField()
fvc::surfaceSum(mag(phi))().primitiveField()
/ rho.primitiveField()
);
scalar CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -61,7 +61,7 @@
)
);
aniAlphas[i].internalFieldRef() =
aniAlphas[i].primitiveFieldRef() =
coordinates[i].R().transformVector(tkappaByCp());
aniAlphas[i].correctBoundaryConditions();
......
......@@ -14,7 +14,7 @@ if (!thermo.isotropic())
tmp<volVectorField> tkappaByCp = thermo.Kappa()/cp;
const coordinateSystem& coodSys = coordinates[i];
aniAlpha.internalFieldRef() =
aniAlpha.primitiveFieldRef() =
coodSys.R().transformVector(tkappaByCp());
aniAlpha.correctBoundaryConditions();
......
......@@ -46,7 +46,7 @@ Foam::scalar Foam::solidRegionDiffNo
/ fvc::interpolate(Cprho)
);
DiNum = gMax(kapparhoCpbyDelta.internalField())*runTime.deltaT().value();
DiNum = gMax(kapparhoCpbyDelta.primitiveField())*runTime.deltaT().value();
meanDiNum = (average(kapparhoCpbyDelta)).value()*runTime.deltaT().value();
......
......@@ -70,7 +70,7 @@ label cellId = patches[patchId].faceCells()[faceId];
scalarField y
(
wallNormal
& (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId])
& (mesh.C().primitiveField() - mesh.C().boundaryField()[patchId][faceId])
);
Info<< " Height to first cell centre y0 = " << y[cellId] << endl;
......@@ -38,8 +38,8 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().internalField()
/ h.internalField()
fvc::surfaceSum(mag(phi))().primitiveField()
/ h.primitiveField()
);
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......@@ -53,7 +53,7 @@ if (mesh.nInternalFaces())
fvc::surfaceSum
(
fvc::interpolate(sqrt(h))*mesh.magSf()
)().internalField()/mesh.V().field()
)().primitiveField()/mesh.V().field()
)*sqrt(magg).value()*runTime.deltaTValue();
}
......
......@@ -36,7 +36,7 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phic))().internalField()
fvc::surfaceSum(mag(phic))().primitiveField()
);
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.internalFieldRef() = -cloudSU.source()/mesh.V();
cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
cloudVolSUSu.correctBoundaryConditions();
cloudSU.source() = Zero;
......
......@@ -68,8 +68,8 @@ License
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.internalField()) << ", "
<< gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
......@@ -127,8 +127,8 @@ License
}
Info<< " Overall = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
......
......@@ -68,8 +68,8 @@ License
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.internalField()) << ", "
<< gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
......@@ -126,8 +126,8 @@ License
}
Info<< " Overall = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
......
......@@ -37,7 +37,7 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().internalField()
fvc::surfaceSum(mag(phi))().primitiveField()
);
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......@@ -50,7 +50,7 @@ if (mesh.nInternalFaces())
fvc::surfaceSum
(
fvc::interpolate(scalar(1)/sqrt(psi))*mesh.magSf()
)().internalField()/mesh.V().field()
)().primitiveField()/mesh.V().field()
)*runTime.deltaTValue();
}
......
......@@ -41,8 +41,8 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
mixture.nearInterface()().internalField()
*fvc::surfaceSum(mag(phi))().internalField()
mixture.nearInterface()().primitiveField()
*fvc::surfaceSum(mag(phi))().primitiveField()
);
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -35,7 +35,7 @@ else
//solve(fvm::ddt(rho) + fvc::div(rhoPhi));
//Info<< "density error = "
// << max((mag(rho - rhoNew)/mag(rhoNew))().internalField()) << endl;
// << max((mag(rho - rhoNew)/mag(rhoNew))().primitiveField()) << endl;
rho == rhoNew;
}
......@@ -84,8 +84,8 @@
rDeltaT.correctBoundaryConditions();
Info<< "Flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
if (rDeltaTSmoothingCoeff < 1.0)
{
......@@ -111,8 +111,8 @@
}
Info<< "Smoothed flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
// Limit rate of change of time scale
// - reduce as much as required
......@@ -130,7 +130,7 @@
);
Info<< "Damped flow time scale min/max = "
<< gMin(1/rDeltaT.internalField())
<< ", " << gMax(1/rDeltaT.internalField()) << endl;
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
}
}
......@@ -36,7 +36,7 @@ if (mesh.nInternalFaces())
{
scalarField sumPhi
(
fvc::surfaceSum(mag(phi))().internalField()
fvc::surfaceSum(mag(phi))().primitiveField()
);
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
......@@ -44,7 +44,7 @@ if (mesh.nInternalFaces())
sumPhi = max
(
sumPhi,
fvc::surfaceSum(mag(iter().phi()))().internalField()
fvc::surfaceSum(mag(iter().phi()))().primitiveField()
);
}
......
......@@ -104,7 +104,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
dimensionedScalar("L", dimLength, 0),
zeroGradientFvPatchField<scalar>::typeName
);
L.internalFieldRef() = cbrt(mesh.V());
L.primitiveFieldRef() = cbrt(mesh.V());
L.correctBoundaryConditions();
volScalarField I
......
......@@ -292,9 +292,9 @@ correctThermo()
Tf.correctBoundaryConditions();
Info<< "Tf." << pair.name()
<< ": min = " << min(Tf.internalField())
<< ", mean = " << average(Tf.internalField())
<< ", max = " << max(Tf.internalField())
<< ": min = " << min(Tf.primitiveField())
<< ", mean = " << average(Tf.primitiveField())
<< ", max = " << max(Tf.primitiveField())
<< endl;
// Update the interface compositions
......
......@@ -337,9 +337,9 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
);
Info<< "iDmdt." << pair.name()
<< ": min = " << min(iDmdt.internalField())
<< ", mean = " << average(iDmdt.internalField())
<< ", max = " << max(iDmdt.internalField())
<< ": min = " << min(iDmdt.primitiveField())
<< ", mean = " << average(iDmdt.primitiveField())
<< ", max = " << max(iDmdt.primitiveField())
<< ", integral = " << fvc::domainIntegrate(iDmdt).value()
<< endl;
}
......@@ -370,9 +370,9 @@ void Foam::ThermalPhaseChangePhaseSystem<BasePhaseSystem>::correctThermo()
Tf = (H1*T1 + H2*T2 + mDotL)/(H1 + H2);
Info<< "Tf." << pair.name()
<< ": min = " << min(Tf.internalField())
<< ", mean = " << average(Tf.internalField())
<< ", max = " << max(Tf.internalField())
<< ": min = " << min(Tf.primitiveField())