Commit fe43b805 authored by Henry Weller's avatar Henry Weller
Browse files

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 68fb9a2b
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment