ENH: Updated thermo trackData to better handle Cp

This commit is contained in:
andy
2010-10-20 13:28:07 +01:00
parent 45df2f5fa4
commit e2294e539b
9 changed files with 30 additions and 36 deletions

View File

@ -67,15 +67,7 @@ void Foam::ReactingCloud<ParcelType>::preEvolve()
template<class ParcelType> template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::evolveCloud() void Foam::ReactingCloud<ParcelType>::evolveCloud()
{ {
const volScalarField Cp = this->thermo().thermo().Cp(); typename ParcelType::trackData td(*this);
autoPtr<interpolation<scalar> > CpInterp = interpolation<scalar>::New
(
this->solution().interpolationSchemes(),
Cp
);
typename ParcelType::trackData td(*this, CpInterp());
label preInjectionSize = this->size(); label preInjectionSize = this->size();

View File

@ -40,15 +40,7 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
template<class ParcelType> template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud() void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
{ {
const volScalarField Cp = this->thermo().thermo().Cp(); typename ParcelType::trackData td(*this);
autoPtr<interpolation<scalar> > CpInterp = interpolation<scalar>::New
(
this->solution().interpolationSchemes(),
Cp
);
typename ParcelType::trackData td(*this, CpInterp());
label preInjectionSize = this->size(); label preInjectionSize = this->size();

View File

@ -41,15 +41,7 @@ void Foam::ThermoCloud<ParcelType>::preEvolve()
template<class ParcelType> template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::evolveCloud() void Foam::ThermoCloud<ParcelType>::evolveCloud()
{ {
const volScalarField Cp = thermo_.thermo().Cp(); typename ParcelType::trackData td(*this);
autoPtr<interpolation<scalar> > CpInterp = interpolation<scalar>::New
(
this->solution().interpolationSchemes(),
Cp
);
typename ParcelType::trackData td(*this, CpInterp());
label preInjectionSize = this->size(); label preInjectionSize = this->size();

View File

@ -127,7 +127,6 @@ public:
inline trackData inline trackData
( (
ReactingMultiphaseCloud<ParcelType>& cloud, ReactingMultiphaseCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename ReactingParcel<ParcelType>::trackData::trackPart typename ReactingParcel<ParcelType>::trackData::trackPart
part = ReactingParcel<ParcelType>::trackData::tpLinearTrack part = ReactingParcel<ParcelType>::trackData::tpLinearTrack
); );

View File

@ -54,11 +54,10 @@ template<class ParcelType>
inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData
( (
ReactingMultiphaseCloud<ParcelType>& cloud, ReactingMultiphaseCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename ReactingParcel<ParcelType>::trackData::trackPart part typename ReactingParcel<ParcelType>::trackData::trackPart part
) )
: :
ReactingParcel<ParcelType>::trackData(cloud, CpInterp, part), ReactingParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud), cloud_(cloud),
constProps_(cloud.constProps()) constProps_(cloud.constProps())
{} {}

View File

@ -139,7 +139,6 @@ public:
inline trackData inline trackData
( (
ReactingCloud<ParcelType>& cloud, ReactingCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename ThermoParcel<ParcelType>::trackData::trackPart typename ThermoParcel<ParcelType>::trackData::trackPart
part = ThermoParcel<ParcelType>::trackData::tpLinearTrack part = ThermoParcel<ParcelType>::trackData::tpLinearTrack
); );

View File

@ -43,11 +43,10 @@ template<class ParcelType>
inline Foam::ReactingParcel<ParcelType>::trackData::trackData inline Foam::ReactingParcel<ParcelType>::trackData::trackData
( (
ReactingCloud<ParcelType>& cloud, ReactingCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename ThermoParcel<ParcelType>::trackData::trackPart part typename ThermoParcel<ParcelType>::trackData::trackPart part
) )
: :
ThermoParcel<ParcelType>::trackData(cloud, CpInterp, part), ThermoParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud), cloud_(cloud),
constProps_(cloud.constProps()), constProps_(cloud.constProps()),
pInterp_ pInterp_

View File

@ -141,6 +141,11 @@ public:
//- Particle constant properties //- Particle constant properties
const constantProperties& constProps_; const constantProperties& constProps_;
//- Local copy of specific heat field
// Cp not stored on acrrier thermo, but returned as tmp<...>
const volScalarField Cp_;
// Interpolators for continuous phase fields // Interpolators for continuous phase fields
//- Temperature field interpolator //- Temperature field interpolator
@ -158,7 +163,6 @@ public:
inline trackData inline trackData
( (
ThermoCloud<ParcelType>& cloud, ThermoCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename KinematicParcel<ParcelType>::trackData::trackPart typename KinematicParcel<ParcelType>::trackData::trackPart
part = KinematicParcel<ParcelType>::trackData::tpLinearTrack part = KinematicParcel<ParcelType>::trackData::tpLinearTrack
); );

View File

@ -45,13 +45,24 @@ template<class ParcelType>
inline Foam::ThermoParcel<ParcelType>::trackData::trackData inline Foam::ThermoParcel<ParcelType>::trackData::trackData
( (
ThermoCloud<ParcelType>& cloud, ThermoCloud<ParcelType>& cloud,
const interpolation<scalar>& CpInterp,
typename KinematicParcel<ParcelType>::trackData::trackPart part typename KinematicParcel<ParcelType>::trackData::trackPart part
) )
: :
KinematicParcel<ParcelType>::trackData(cloud, part), KinematicParcel<ParcelType>::trackData(cloud, part),
cloud_(cloud), cloud_(cloud),
constProps_(cloud.constProps()), constProps_(cloud.constProps()),
Cp_
(
IOobject
(
"Cp",
cloud.db().time().timeName(),
cloud.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
cloud.thermo().thermo().Cp()
),
TInterp_ TInterp_
( (
interpolation<scalar>::New interpolation<scalar>::New
@ -60,7 +71,14 @@ inline Foam::ThermoParcel<ParcelType>::trackData::trackData
cloud.T() cloud.T()
) )
), ),
CpInterp_(CpInterp) CpInterp_
(
interpolation<scalar>::New
(
cloud.solution().interpolationSchemes(),
Cp_
)
)
{} {}