Commit 68fb9a2b authored by Henry Weller's avatar Henry Weller
Browse files

GeometricField::dimensionedInteralFieldRef() -> GeometricField::ref()

In order to simplify expressions involving dimensioned internal field it
is preferable to use a simpler access convention.  Given that
GeometricField is derived from DimensionedField it is simply a matter of
de-referencing this underlying type unlike the boundary field which is
peripheral information.  For consistency with the new convention in
"tmp"  "dimensionedInteralFieldRef()" has been renamed "ref()".
parent bd911f60
......@@ -58,10 +58,10 @@ License
// Flow time scale
{
rDeltaT.dimensionedInternalFieldRef() =
rDeltaT.ref() =
(
fvc::surfaceSum(mag(phi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
......@@ -84,9 +84,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
rDeltaT.dimensionedInternalField(),
rDeltaT(),
rDeltaTT
);
}
......
......@@ -185,9 +185,9 @@ int main(int argc, char *argv[])
// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
U.dimensionedInternalFieldRef() =
rhoU.dimensionedInternalField()
/rho.dimensionedInternalField();
U.ref() =
rhoU()
/rho();
U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
......@@ -240,9 +240,9 @@ int main(int argc, char *argv[])
rhoE = rho*(e + 0.5*magSqr(U));
}
p.dimensionedInternalFieldRef() =
rho.dimensionedInternalField()
/psi.dimensionedInternalField();
p.ref() =
rho()
/psi();
p.correctBoundaryConditions();
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
......
......@@ -178,9 +178,9 @@ int main(int argc, char *argv[])
// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));
U.dimensionedInternalFieldRef() =
rhoU.dimensionedInternalField()
/rho.dimensionedInternalField();
U.ref() =
rhoU()
/rho();
U.correctBoundaryConditions();
rhoU.boundaryFieldRef() == rho.boundaryField()*U.boundaryField();
......@@ -233,9 +233,9 @@ int main(int argc, char *argv[])
rhoE = rho*(e + 0.5*magSqr(U));
}
p.dimensionedInternalFieldRef() =
rho.dimensionedInternalField()
/psi.dimensionedInternalField();
p.ref() =
rho()
/psi();
p.correctBoundaryConditions();
rho.boundaryFieldRef() == psi.boundaryField()*p.boundaryField();
......
......@@ -11,10 +11,10 @@
);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(amaxSf)().dimensionedInternalField()
fvc::surfaceSum(amaxSf)()()
/((2*maxCo)*mesh.V())
);
......
......@@ -26,11 +26,11 @@
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(phi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
if (pimple.transonic())
......@@ -41,11 +41,11 @@
fvc::interpolate(psi)*fvc::flux(U)
);
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
rDeltaT.dimensionedInternalField(),
fvc::surfaceSum(mag(phid))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*psi.dimensionedInternalField())
rDeltaT(),
fvc::surfaceSum(mag(phid))()()
/((2*maxCo)*mesh.V()*psi())
);
}
......
......@@ -6,7 +6,7 @@
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho.dimensionedInternalField()*g
rho()*g
+ coalParcels.SU(U)
+ limestoneParcels.SU(U)
+ fvOptions(rho, U)
......
......@@ -58,10 +58,10 @@ License
// Flow time scale
{
rDeltaT.dimensionedInternalFieldRef() =
rDeltaT.ref() =
(
fvc::surfaceSum(mag(phi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
......@@ -84,9 +84,9 @@ License
)
/(
alphaTemp
*rho.dimensionedInternalField()
*thermo.Cp()().dimensionedInternalField()
*T.dimensionedInternalField()
*rho()
*thermo.Cp()()()
*T()
)
);
......@@ -94,9 +94,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
rDeltaT.dimensionedInternalField(),
rDeltaT(),
rDeltaTT
);
}
......
......@@ -6,7 +6,7 @@
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho.dimensionedInternalField()*g
rho()*g
+ parcels.SU(U)
+ fvOptions(rho, U)
);
......
......@@ -58,10 +58,10 @@ License
// Flow time scale
{
rDeltaT.dimensionedInternalFieldRef() =
rDeltaT.ref() =
(
fvc::surfaceSum(mag(phi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
fvc::surfaceSum(mag(phi))()()
/((2*maxCo)*mesh.V()*rho())
);
// Limit the largest time scale
......@@ -83,9 +83,9 @@ License
)
/(
alphaTemp
*rho.dimensionedInternalField()
*thermo.Cp()().dimensionedInternalField()
*T.dimensionedInternalField()
*rho()
*thermo.Cp()()()
*T()
)
);
......@@ -93,9 +93,9 @@ License
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
rDeltaT.dimensionedInternalField(),
rDeltaT(),
rDeltaTT
);
}
......
......@@ -6,7 +6,7 @@
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho.dimensionedInternalField()*g
rho()*g
+ parcels.SU(U)
+ fvOptions(rho, U)
);
......
......@@ -8,7 +8,7 @@ tmp<fvVectorMatrix> tUEqn
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho.dimensionedInternalField()*g
rho()*g
+ parcels.SU(U)
+ fvOptions(rho, U)
);
......
......@@ -56,11 +56,11 @@
volScalarField rDeltaT0("rDeltaT0", rDeltaT);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(rhoPhi))().dimensionedInternalField()
/((2*maxCo)*mesh.V()*rho.dimensionedInternalField())
fvc::surfaceSum(mag(rhoPhi))()()
/((2*maxCo)*mesh.V()*rho())
);
if (maxAlphaCo < maxCo)
......@@ -70,12 +70,12 @@
volScalarField alpha1Bar(fvc::average(alpha1));
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
rDeltaT.dimensionedInternalField(),
pos(alpha1Bar.dimensionedInternalField() - alphaSpreadMin)
*pos(alphaSpreadMax - alpha1Bar.dimensionedInternalField())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField()
rDeltaT(),
pos(alpha1Bar() - alphaSpreadMin)
*pos(alphaSpreadMax - alpha1Bar())
*fvc::surfaceSum(mag(phi))()()
/((2*maxAlphaCo)*mesh.V())
);
}
......
......@@ -43,7 +43,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
slamDampCoeff
*max
(
mag(U.dimensionedInternalField()) - maxSlamVelocity,
mag(U()) - maxSlamVelocity,
dimensionedScalar("U0", dimVelocity, 0)
)
/pow(mesh.V(), 1.0/3.0),
......
......@@ -26,10 +26,10 @@
}
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(maxPhi)().dimensionedInternalField()
fvc::surfaceSum(maxPhi)()()
/((2*maxCo)*mesh.V())
);
......
......@@ -19,10 +19,10 @@
);
// Set the reciprocal time-step from the local Courant number
rDeltaT.dimensionedInternalFieldRef() = max
rDeltaT.ref() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(max(mag(phi1), mag(phi2)))().dimensionedInternalField()
fvc::surfaceSum(max(mag(phi1), mag(phi2)))()()
/((2*maxCo)*mesh.V())
);
......
......@@ -212,26 +212,26 @@ void Foam::twoPhaseSystem::solve()
{
tdgdt =
(
alpha2.dimensionedInternalField()
*phase1_.divU()().dimensionedInternalField()
- alpha1.dimensionedInternalField()
*phase2_.divU()().dimensionedInternalField()
alpha2()
*phase1_.divU()()()
- alpha1()
*phase2_.divU()()()
);
}
else if (phase1_.divU().valid())
{
tdgdt =
(
alpha2.dimensionedInternalField()
*phase1_.divU()().dimensionedInternalField()
alpha2()
*phase1_.divU()()()
);
}
else if (phase2_.divU().valid())
{
tdgdt =
(
- alpha1.dimensionedInternalField()
*phase2_.divU()().dimensionedInternalField()
- alpha1()
*phase2_.divU()()()
);
}
......
......@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
calculatedFvPatchField<scalar>::typeName
);
V.dimensionedInternalFieldRef() = mesh.V();
V.ref() = mesh.V();
volScalarField::Boundary& Vbf = V.boundaryFieldRef();
......
......@@ -87,9 +87,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
mesh
);
Co.dimensionedInternalFieldRef() =
Co.ref() =
(0.5*runTime.deltaT())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField()
*fvc::surfaceSum(mag(phi))()()
/(rho*mesh.V());
Co.correctBoundaryConditions();
}
......@@ -97,9 +97,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
Info<< " Calculating incompressible Co" << endl;
Co.dimensionedInternalFieldRef() =
Co.ref() =
(0.5*runTime.deltaT())
*fvc::surfaceSum(mag(phi))().dimensionedInternalField()
*fvc::surfaceSum(mag(phi))()()
/mesh.V();
Co.correctBoundaryConditions();
}
......
......@@ -714,7 +714,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::~GeometricField()
template<class Type, template<class> class PatchField, class GeoMesh>
typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::dimensionedInternalFieldRef()
Foam::GeometricField<Type, PatchField, GeoMesh>::ref()
{
this->setUpToDate();
storeOldTimes();
......@@ -1138,7 +1138,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
// Only assign field contents not ID
dimensionedInternalFieldRef() = gf.dimensionedInternalField();
ref() = gf();
boundaryFieldRef() = gf.boundaryField();
}
......@@ -1182,7 +1182,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
const dimensioned<Type>& dt
)
{
dimensionedInternalFieldRef() = dt;
ref() = dt;
boundaryFieldRef() = dt.value();
}
......@@ -1199,7 +1199,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator==
// Only assign field contents not ID
dimensionedInternalFieldRef() = gf.dimensionedInternalField();
ref() = gf();
boundaryFieldRef() == gf.boundaryField();
tgf.clear();
......@@ -1212,7 +1212,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator==
const dimensioned<Type>& dt
)
{
dimensionedInternalFieldRef() = dt;
ref() = dt;
boundaryFieldRef() == dt.value();
}
......@@ -1227,7 +1227,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
{ \
checkField(*this, gf, #op); \
\
dimensionedInternalFieldRef() op gf.dimensionedInternalField(); \
ref() op gf(); \
boundaryFieldRef() op gf.boundaryField(); \
} \
\
......@@ -1247,7 +1247,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator op \
const dimensioned<TYPE>& dt \
) \
{ \
dimensionedInternalFieldRef() op dt; \
ref() op dt; \
boundaryFieldRef() op dt.value(); \
}
......@@ -1268,7 +1268,7 @@ Foam::Ostream& Foam::operator<<
const GeometricField<Type, PatchField, GeoMesh>& gf
)
{
gf.dimensionedInternalField().writeData(os, "internalField");
gf().writeData(os, "internalField");
os << nl;
gf.boundaryField().writeEntry("boundaryField", os);
......
......@@ -447,7 +447,7 @@ public:
//- Return a reference to the dimensioned internal field
// Note: this increments the event counter and checks the
// old-time fields; avoid in loops.
Internal& dimensionedInternalFieldRef();
Internal& ref();
//- Return a const-reference to the dimensioned internal field
inline const Internal& dimensionedInternalField() const;
......
......@@ -33,17 +33,6 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::null()
}
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator()() const
{
return *this;
}
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
......@@ -90,4 +79,17 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::timeIndex()
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class Type, template<class> class PatchField, class GeoMesh>
inline
const typename
Foam::GeometricField<Type, PatchField, GeoMesh>::Internal&
Foam::GeometricField<Type, PatchField, GeoMesh>::
operator()() const
{
return *this;
}
// ************************************************************************* //
......@@ -695,7 +695,7 @@ void kkLOmega::correct()
- fvm::Sp(Cw2_*sqr(fw)*omega_, omega_)
+ (
Cw3_*fOmega(lambdaEff, lambdaT)*alphaTEff*sqr(fw)*sqrt(kt_)
)().dimensionedInternalField()/pow3(y_.dimensionedInternalField())
)()()/pow3(y_())
);
omegaEqn.ref().relax();
......
......@@ -57,7 +57,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, scalar widthCoeff)
calculatedFvPatchScalarField::typeName
)
{
coeff_.dimensionedInternalFieldRef() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
coeff_.ref() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
}
......@@ -78,7 +78,7 @@ Foam::laplaceFilter::laplaceFilter(const fvMesh& mesh, const dictionary& bd)
calculatedFvPatchScalarField::typeName
)
{
coeff_.dimensionedInternalFieldRef() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
coeff_.ref() = pow(mesh.V(), 2.0/3.0)/widthCoeff_;
}
......
......@@ -158,7 +158,7 @@ tmp<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::dTilda
) const
{
tmp<volScalarField> tdTilda(CDES_*this->delta());
min(tdTilda.ref().dimensionedInternalFieldRef(), tdTilda(), y_);
min(tdTilda.ref().ref(), tdTilda(), y_);
return tdTilda;
}
......
......@@ -161,7 +161,7 @@ singleStepCombustion<CombThermoType, ThermoType>::dQ() const
if (this->active())
{
volScalarField& dQ = tdQ.ref();
dQ.dimensionedInternalFieldRef() = this->mesh().V()*Sh()();
dQ.ref() = this->mesh().V()*Sh()();
}
return tdQ;
}
......
......@@ -157,7 +157,7 @@ void Foam::fvMeshAdder::MapVolField
(
bfld[newPatchi], // old field
mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new internal field
fld(), // new internal field
patchMapper // mapper (new to old)
)
);
......@@ -211,7 +211,7 @@ void Foam::fvMeshAdder::MapVolField
(
fldToAdd.boundaryField()[patchi], // added field
mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new int. field
fld(), // new int. field
patchMapper // mapper
)
);
......@@ -464,7 +464,7 @@ void Foam::fvMeshAdder::MapSurfaceField
(
bfld[newPatchi], // old field
mesh.boundary()[newPatchi], // new fvPatch
fld.dimensionedInternalField(), // new internal field
fld(), // new internal field