Commit fda01c74 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Remove duplicate constProps() from parcel trackData

parent 9570cd55
......@@ -40,7 +40,7 @@ void Foam::KinematicParcel<ParcelType>::setCellValues
rhoc_ = td.rhoInterp().interpolate(this->position(), tetIs);
if (rhoc_ < td.constProps().rhoMin())
if (rhoc_ < td.cloud().constProps().rhoMin())
{
WarningIn
(
......@@ -51,9 +51,9 @@ void Foam::KinematicParcel<ParcelType>::setCellValues
"const label"
")"
) << "Limiting observed density in cell " << cellI << " to "
<< td.constProps().rhoMin() << nl << endl;
<< td.cloud().constProps().rhoMin() << nl << endl;
rhoc_ = td.constProps().rhoMin();
rhoc_ = td.cloud().constProps().rhoMin();
}
Uc_ = td.UInterp().interpolate(this->position(), tetIs);
......
......@@ -168,9 +168,6 @@ public:
//- Reference to the cloud containing this particle
KinematicCloud<ParcelType>& cloud_;
//- Particle constant properties
const constantProperties& constProps_;
// Interpolators for continuous phase fields
......@@ -209,9 +206,6 @@ public:
//- Return access to the owner cloud
inline KinematicCloud<ParcelType>& cloud();
//- Return const access to the constant properties
inline const constantProperties& constProps() const;
//- Return conat access to the interpolator for continuous
// phase density field
inline const interpolation<scalar>& rhoInterp() const;
......
......@@ -54,7 +54,6 @@ inline Foam::KinematicParcel<ParcelType>::trackData::trackData
:
Particle<ParcelType>::trackData(cloud),
cloud_(cloud),
constProps_(cloud.constProps()),
rhoInterp_
(
interpolation<scalar>::New
......@@ -223,14 +222,6 @@ Foam::KinematicParcel<ParcelType>::trackData::cloud()
}
template <class ParcelType>
inline const typename Foam::KinematicParcel<ParcelType>::constantProperties&
Foam::KinematicParcel<ParcelType>::trackData::constProps() const
{
return constProps_;
}
template<class ParcelType>
inline const Foam::interpolation<Foam::scalar>&
Foam::KinematicParcel<ParcelType>::trackData::rhoInterp() const
......
......@@ -422,7 +422,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
// Remove the particle when mass falls below minimum threshold
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (mass1 < td.constProps().minParticleMass())
if (mass1 < td.cloud().constProps().minParticleMass())
{
td.keepParticle = false;
......@@ -469,7 +469,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
this->U_ = U1;
// Update particle density or diameter
if (td.constProps().constantVolume())
if (td.cloud().constProps().constantVolume())
{
this->rho_ = mass1/this->volume();
}
......@@ -541,8 +541,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
const scalar beta = sqr(cbrt(15.0) + cbrt(15.0));
const label id =
td.cloud().composition().localToGlobalCarrierId(GAS, i);
const scalar Cp = td.cloud().mcCarrierThermo().speciesData()[id].Cp(Ts);
const scalar W = td.cloud().mcCarrierThermo().speciesData()[id].W();
const scalar Cp = td.cloud().thermo().carrier().Cp(id, Ts);
const scalar W = td.cloud().thermo().carrier().W(id);
const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);
// Dab calc'd using API vapour mass diffusivity function
......@@ -615,12 +615,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
);
const scalar xsi = min(T/5000.0, 1.0);
const scalar hRetentionCoeffMod =
(1.0 - xsi*xsi)*td.constProps().hRetentionCoeff();
const scalar coeff =
(1.0 - xsi*xsi)*td.cloud().constProps().hRetentionCoeff();
Sh += hRetentionCoeffMod*hReaction/dt;
Sh += coeff*hReaction/dt;
dhsTrans += (1.0 - hRetentionCoeffMod)*hReaction;
dhsTrans += (1.0 - coeff)*hReaction;
}
......
......@@ -115,9 +115,6 @@ public:
//- Reference to the cloud containing this particle
ReactingMultiphaseCloud<ParcelType>& cloud_;
//- Particle constant properties
const constantProperties& constProps_;
public:
......@@ -136,9 +133,6 @@ public:
//- Return access to the owner cloud
inline ReactingMultiphaseCloud<ParcelType>& cloud();
//- Return const access to the constant properties
inline const constantProperties& constProps() const;
};
......
......@@ -58,8 +58,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData
)
:
ReactingParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud),
constProps_(cloud.constProps())
cloud_(cloud)
{}
......@@ -158,15 +157,6 @@ Foam::ReactingMultiphaseParcel<ParcelType>::trackData::cloud()
}
template<class ParcelType>
inline const typename Foam::ReactingMultiphaseParcel<ParcelType>::
constantProperties&
Foam::ReactingMultiphaseParcel<ParcelType>::trackData::constProps() const
{
return constProps_;
}
// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
template<class ParcelType>
......
......@@ -48,7 +48,7 @@ void Foam::ReactingParcel<ParcelType>::setCellValues
this->currentTetIndices()
);
if (pc_ < td.constProps().pMin())
if (pc_ < td.cloud().constProps().pMin())
{
WarningIn
(
......@@ -59,9 +59,9 @@ void Foam::ReactingParcel<ParcelType>::setCellValues
"const label"
")"
) << "Limiting observed pressure in cell " << cellI << " to "
<< td.constProps().pMin() << nl << endl;
<< td.cloud().constProps().pMin() << nl << endl;
pc_ = td.constProps().pMin();
pc_ = td.cloud().constProps().pMin();
}
}
......@@ -352,7 +352,7 @@ void Foam::ReactingParcel<ParcelType>::calc
// Remove the particle when mass falls below minimum threshold
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (mass1 < td.constProps().minParticleMass())
if (mass1 < td.cloud().constProps().minParticleMass())
{
td.keepParticle = false;
......@@ -382,7 +382,7 @@ void Foam::ReactingParcel<ParcelType>::calc
this->U_ = U1;
// Update particle density or diameter
if (td.constProps().constantVolume())
if (td.cloud().constProps().constantVolume())
{
this->rho_ = mass1/this->volume();
}
......@@ -425,7 +425,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
if
(
!td.cloud().phaseChange().active()
|| T < td.constProps().Tvap()
|| T < td.cloud().constProps().Tvap()
|| YPhase < SMALL
)
{
......
......@@ -121,9 +121,6 @@ public:
//- Reference to the cloud containing this particle
ReactingCloud<ParcelType>& cloud_;
//- Particle constant properties
const constantProperties& constProps_;
//- Interpolator for continuous phase pressure field
const interpolation<scalar>& pInterp_;
......@@ -149,9 +146,6 @@ public:
//- Return access to the owner cloud
inline ReactingCloud<ParcelType>& cloud();
//- Return const access to the constant properties
inline const constantProperties& constProps() const;
//- Return const access to the interpolator for continuous
// phase pressure field
inline const interpolation<scalar>& pInterp() const;
......
......@@ -48,7 +48,6 @@ inline Foam::ReactingParcel<ParcelType>::trackData::trackData
:
ThermoParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud),
constProps_(cloud.constProps()),
pInterp_
(
interpolation<scalar>::New
......@@ -167,14 +166,6 @@ Foam::ReactingParcel<ParcelType>::trackData::cloud()
}
template<class ParcelType>
inline const typename Foam::ReactingParcel<ParcelType>::constantProperties&
Foam::ReactingParcel<ParcelType>::trackData::constProps() const
{
return constProps_;
}
template<class ParcelType>
inline const Foam::interpolation<Foam::scalar>&
Foam::ReactingParcel<ParcelType>::trackData::pInterp() const
......
......@@ -47,7 +47,7 @@ void Foam::ThermoParcel<ParcelType>::setCellValues
Tc_ = td.TInterp().interpolate(this->position(), tetIs);
if (Tc_ < td.constProps().TMin())
if (Tc_ < td.cloud().constProps().TMin())
{
WarningIn
(
......@@ -58,9 +58,9 @@ void Foam::ThermoParcel<ParcelType>::setCellValues
"const label"
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.constProps().TMin() << nl << endl;
<< td.cloud().constProps().TMin() << nl << endl;
Tc_ = td.constProps().TMin();
Tc_ = td.cloud().constProps().TMin();
}
}
......@@ -107,7 +107,7 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
mus = td.muInterp().interpolate (this->position(), tetIs)/factor;
Pr = td.constProps().Pr();
Pr = td.cloud().constProps().Pr();
kappa = Cpc_*mus/Pr;
}
......@@ -238,7 +238,12 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
{
return max(T + dt*Sh/(this->volume(d)*rho*Cp), td.constProps().TMin());
return
max
(
T + dt*Sh/(this->volume(d)*rho*Cp),
td.cloud().constProps().TMin()
);
}
const scalar As = this->areaS(d);
......@@ -250,7 +255,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G");
const scalar Gc = G[cellI];
const scalar sigma = physicoChemical::sigma.value();
const scalar epsilon = td.constProps().epsilon0();
const scalar epsilon = td.cloud().constProps().epsilon0();
ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc);
bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T)));
......@@ -261,7 +266,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
IntegrationScheme<scalar>::integrationResult Tres =
td.cloud().TIntegrator().integrate(T, dt, ap, bp);
scalar Tnew = max(Tres.value(), td.constProps().TMin());
scalar Tnew = max(Tres.value(), td.cloud().constProps().TMin());
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
......
......@@ -138,9 +138,6 @@ public:
//- Reference to the cloud containing this particle
ThermoCloud<ParcelType>& cloud_;
//- Particle constant properties
const constantProperties& constProps_;
//- Local copy of specific heat field
// Cp not stored on acrrier thermo, but returned as tmp<...>
const volScalarField Cp_;
......@@ -173,9 +170,6 @@ public:
//- Return access to the owner cloud
inline ThermoCloud<ParcelType>& cloud();
//- Return const access to the owner cloud
inline const constantProperties& constProps() const;
//- Return const access to the interpolator for continuous
// phase temperature field
inline const interpolation<scalar>& TInterp() const;
......
......@@ -50,7 +50,6 @@ inline Foam::ThermoParcel<ParcelType>::trackData::trackData
:
KinematicParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud),
constProps_(cloud.constProps()),
Cp_
(
IOobject
......@@ -203,14 +202,6 @@ Foam::ThermoParcel<ParcelType>::trackData::cloud()
}
template <class ParcelType>
inline const typename Foam::ThermoParcel<ParcelType>::constantProperties&
Foam::ThermoParcel<ParcelType>::trackData::constProps() const
{
return constProps_;
}
template<class ParcelType>
inline const Foam::interpolation<Foam::scalar>&
Foam::ThermoParcel<ParcelType>::trackData::TInterp() const
......
Supports Markdown
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