Thermodynamics: Added phaseName option to the constructors and selectors of all thermo packages

This commit is contained in:
Henry
2012-11-05 15:17:02 +00:00
parent d0d6ef505e
commit 9ef3301748
38 changed files with 515 additions and 227 deletions

View File

@ -13,5 +13,5 @@ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lsolidThermo \ /*-lsolidThermo*/ \
-lcompressibleTurbulenceModel -lcompressibleTurbulenceModel

View File

@ -34,16 +34,56 @@ namespace Foam
defineRunTimeSelectionTable(basicThermo, fvMesh); defineRunTimeSelectionTable(basicThermo, fvMesh);
} }
const Foam::word Foam::basicThermo::dictName("thermophysicalProperties");
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicThermo::basicThermo(const fvMesh& mesh) Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
(
const fvMesh& mesh,
const char* name
) const
{
if (!mesh.objectRegistry::foundObject<volScalarField>(name))
{
volScalarField* fPtr
(
new volScalarField
(
IOobject
(
name,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
// Transfer ownership of this object to the objectRegistry
fPtr->store(fPtr);
}
return const_cast<volScalarField&>
(
mesh.objectRegistry::lookupObject<volScalarField>(name)
);
}
Foam::basicThermo::basicThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
IOdictionary IOdictionary
( (
IOobject IOobject
( (
"thermophysicalProperties", phasePropertyName(dictName, phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -51,24 +91,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
) )
), ),
p_ phaseName_(phaseName),
(
IOobject p_(lookupOrConstruct(mesh, "p")),
(
"p",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
),
T_ T_
( (
IOobject IOobject
( (
"T", phasePropertyName("T"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -81,7 +112,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
( (
IOobject IOobject
( (
"alpha", phasePropertyName("alpha"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -98,14 +129,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
Foam::basicThermo::basicThermo Foam::basicThermo::basicThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
: :
IOdictionary IOdictionary
( (
IOobject IOobject
( (
"thermophysicalProperties", phasePropertyName(dictName, phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -114,24 +146,15 @@ Foam::basicThermo::basicThermo
dict dict
), ),
p_ phaseName_(phaseName),
(
IOobject p_(lookupOrConstruct(mesh, "p")),
(
"p",
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
),
T_ T_
( (
IOobject IOobject
( (
"T", phasePropertyName("T"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
@ -144,7 +167,7 @@ Foam::basicThermo::basicThermo
( (
IOobject IOobject
( (
"alpha", phasePropertyName("alpha"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -160,10 +183,11 @@ Foam::basicThermo::basicThermo
Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return New<basicThermo>(mesh); return New<basicThermo>(mesh, phaseName);
} }
@ -175,16 +199,52 @@ Foam::basicThermo::~basicThermo()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::basicThermo& Foam::basicThermo::lookupThermo
(
const fvPatchScalarField& pf
)
{
if (pf.db().foundObject<basicThermo>(dictName))
{
return pf.db().lookupObject<basicThermo>(dictName);
}
else
{
HashTable<const basicThermo*> thermos =
pf.db().lookupClass<basicThermo>();
for
(
HashTable<const basicThermo*>::iterator iter = thermos.begin();
iter != thermos.end();
++iter
)
{
if
(
&(iter()->he().dimensionedInternalField())
== &(pf.dimensionedInternalField())
)
{
return *iter();
}
}
}
return pf.db().lookupObject<basicThermo>(dictName);
}
void Foam::basicThermo::validate void Foam::basicThermo::validate
( (
const word& app, const word& app,
const word& a const word& a
) const ) const
{ {
if (!(he().name() == a)) if (!(he().name() == phasePropertyName(a)))
{ {
FatalErrorIn(app) FatalErrorIn(app)
<< "Supported energy type is " << a << "Supported energy type is " << phasePropertyName(a)
<< ", thermodynamics package provides " << he().name() << ", thermodynamics package provides " << he().name()
<< exit(FatalError); << exit(FatalError);
} }
@ -197,10 +257,17 @@ void Foam::basicThermo::validate
const word& b const word& b
) const ) const
{ {
if (!(he().name() == a || he().name() == b)) if
(
!(
he().name() == phasePropertyName(a)
|| he().name() == phasePropertyName(b)
)
)
{ {
FatalErrorIn(app) FatalErrorIn(app)
<< "Supported energy types are " << a << " and " << b << "Supported energy types are " << phasePropertyName(a)
<< " and " << phasePropertyName(b)
<< ", thermodynamics package provides " << he().name() << ", thermodynamics package provides " << he().name()
<< exit(FatalError); << exit(FatalError);
} }
@ -217,14 +284,16 @@ void Foam::basicThermo::validate
if if
( (
!( !(
he().name() == a he().name() == phasePropertyName(a)
|| he().name() == b || he().name() == phasePropertyName(b)
|| he().name() == c || he().name() == phasePropertyName(c)
) )
) )
{ {
FatalErrorIn(app) FatalErrorIn(app)
<< "Supported energy types are " << a << ", " << b << " and " << c << "Supported energy types are " << phasePropertyName(a)
<< ", " << phasePropertyName(b)
<< " and " << phasePropertyName(c)
<< ", thermodynamics package provides " << he().name() << ", thermodynamics package provides " << he().name()
<< exit(FatalError); << exit(FatalError);
} }
@ -242,16 +311,18 @@ void Foam::basicThermo::validate
if if
( (
!( !(
he().name() == a he().name() == phasePropertyName(a)
|| he().name() == b || he().name() == phasePropertyName(b)
|| he().name() == c || he().name() == phasePropertyName(c)
|| he().name() == d || he().name() == phasePropertyName(d)
) )
) )
{ {
FatalErrorIn(app) FatalErrorIn(app)
<< "Supported energy types are " << a << ", " << b << "Supported energy types are " << phasePropertyName(a)
<< ", " << c << " and " << d << ", " << phasePropertyName(b)
<< ", " << phasePropertyName(c)
<< " and " << phasePropertyName(d)
<< ", thermodynamics package provides " << he().name() << ", thermodynamics package provides " << he().name()
<< exit(FatalError); << exit(FatalError);
} }

View File

@ -59,10 +59,14 @@ protected:
// Protected data // Protected data
//- Phase-name
const word& phaseName_;
// Fields // Fields
//- Pressure [Pa] //- Pressure [Pa]
volScalarField p_; volScalarField& p_;
//- Temperature [K] //- Temperature [K]
volScalarField T_; volScalarField T_;
@ -76,6 +80,12 @@ protected:
//- Construct as copy (not implemented) //- Construct as copy (not implemented)
basicThermo(const basicThermo&); basicThermo(const basicThermo&);
volScalarField& lookupOrConstruct
(
const fvMesh& mesh,
const char* name
) const;
public: public:
@ -89,18 +99,27 @@ public:
autoPtr, autoPtr,
basicThermo, basicThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
basicThermo(const fvMesh&); basicThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh //- Construct from mesh, dictionary and phase name
basicThermo(const fvMesh&, const dictionary&); basicThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
// Selectors // Selectors
@ -115,14 +134,27 @@ public:
//- Generic New for each of the related thermodynamics packages //- Generic New for each of the related thermodynamics packages
template<class Thermo> template<class Thermo>
static autoPtr<Thermo> New(const fvMesh&); static autoPtr<Thermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Generic New for each of the related thermodynamics packages //- Generic New for each of the related thermodynamics packages
template<class Thermo> template<class Thermo>
static autoPtr<Thermo> New(const fvMesh&, const dictionary&); static autoPtr<Thermo> New
(
const fvMesh&,
const dictionary&,
const word& phaseName=word::null
);
//- Specialisation of the Generic New for basicThermo //- Specialisation of the Generic New for basicThermo
static autoPtr<basicThermo> New(const fvMesh&); static autoPtr<basicThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor
@ -131,6 +163,24 @@ public:
// Member functions // Member functions
static const word dictName;
static word phasePropertyName
(
const word& name,
const word& phaseName
)
{
return name + phaseName;
}
word phasePropertyName(const word& name) const
{
return basicThermo::phasePropertyName(name, phaseName_);
}
static const basicThermo& lookupThermo(const fvPatchScalarField& pf);
//- Check that the thermodynamics package is consistent //- Check that the thermodynamics package is consistent
// with energy forms supported by the application // with energy forms supported by the application
void validate void validate
@ -356,7 +406,7 @@ public:
) const = 0; ) const = 0;
//- Read thermophysicalProperties dictionary //- Read thermophysical properties dictionary
virtual bool read(); virtual bool read();
}; };

View File

@ -136,14 +136,15 @@ typename Table::iterator Foam::basicThermo::lookupThermo
template<class Thermo> template<class Thermo>
Foam::autoPtr<Thermo> Foam::basicThermo::New Foam::autoPtr<Thermo> Foam::basicThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
IOdictionary thermoDict IOdictionary thermoDict
( (
IOobject IOobject
( (
"thermophysicalProperties", phasePropertyName(dictName, phaseName),
mesh.time().constant(), mesh.time().constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -159,7 +160,7 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New
Thermo::fvMeshConstructorTablePtr_ Thermo::fvMeshConstructorTablePtr_
); );
return autoPtr<Thermo>(cstrIter()(mesh)); return autoPtr<Thermo>(cstrIter()(mesh, phaseName));
} }
@ -167,7 +168,8 @@ template<class Thermo>
Foam::autoPtr<Thermo> Foam::basicThermo::New Foam::autoPtr<Thermo> Foam::basicThermo::New
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
{ {
typename Thermo::dictionaryConstructorTable::iterator cstrIter = typename Thermo::dictionaryConstructorTable::iterator cstrIter =
@ -177,7 +179,7 @@ Foam::autoPtr<Thermo> Foam::basicThermo::New
Thermo::dictionaryConstructorTablePtr_ Thermo::dictionaryConstructorTablePtr_
); );
return autoPtr<Thermo>(cstrIter()(mesh, dict)); return autoPtr<Thermo>(cstrIter()(mesh, dict, phaseName));
} }

View File

@ -101,9 +101,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
if (this->cyclicPatch().owner()) if (this->cyclicPatch().owner())
{ {
const basicThermo& thermo = const basicThermo& thermo = basicThermo::lookupThermo(*this);
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index(); label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID]; const scalarField& pp = thermo.p().boundaryField()[patchID];

View File

@ -101,9 +101,7 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs()
if (this->cyclicAMIPatch().owner()) if (this->cyclicAMIPatch().owner())
{ {
const basicThermo& thermo = const basicThermo& thermo = basicThermo::lookupThermo(*this);
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index(); label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID]; const scalarField& pp = thermo.p().boundaryField()[patchID];

View File

@ -97,12 +97,7 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs()
return; return;
} }
const basicThermo& thermo = db().lookupObject<basicThermo> const basicThermo& thermo = basicThermo::lookupThermo(*this);
(
"thermophysicalProperties"
);
const label patchi = patch().index(); const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi]; const scalarField& pw = thermo.p().boundaryField()[patchi];

View File

@ -97,9 +97,7 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs()
return; return;
} }
const basicThermo& thermo = const basicThermo& thermo = basicThermo::lookupThermo(*this);
db().lookupObject<basicThermo>("thermophysicalProperties");
const label patchi = patch().index(); const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi]; const scalarField& pw = thermo.p().boundaryField()[patchi];

View File

@ -102,11 +102,7 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs()
return; return;
} }
const basicThermo& thermo = db().lookupObject<basicThermo> const basicThermo& thermo = basicThermo::lookupThermo(*this);
(
"thermophysicalProperties"
);
const label patchi = patch().index(); const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi]; const scalarField& pw = thermo.p().boundaryField()[patchi];

View File

@ -149,11 +149,7 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs()
return; return;
} }
const basicThermo& thermo = db().lookupObject<basicThermo> const basicThermo& thermo = basicThermo::lookupThermo(*this);
(
"thermophysicalProperties"
);
const label patchi = patch().index(); const label patchi = patch().index();
const scalarField& pw = thermo.p().boundaryField()[patchi]; const scalarField& pw = thermo.p().boundaryField()[patchi];

View File

@ -36,16 +36,21 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fluidThermo::fluidThermo(const fvMesh& mesh) Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const word& phaseName)
: :
basicThermo(mesh) basicThermo(mesh, phaseName)
{} {}
Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict) Foam::fluidThermo::fluidThermo
(
const fvMesh& mesh,
const dictionary& dict,
const word& phaseName
)
: :
basicThermo(mesh, dict) basicThermo(mesh, dict, phaseName)
{} {}
@ -53,10 +58,11 @@ Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict)
Foam::autoPtr<Foam::fluidThermo> Foam::fluidThermo::New Foam::autoPtr<Foam::fluidThermo> Foam::fluidThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<fluidThermo>(mesh); return basicThermo::New<fluidThermo>(mesh, phaseName);
} }

View File

@ -63,21 +63,34 @@ public:
autoPtr, autoPtr,
fluidThermo, fluidThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
fluidThermo(const fvMesh&); fluidThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh //- Construct from mesh and phase name
fluidThermo(const fvMesh&, const dictionary&); fluidThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
//- Selector //- Selector
static autoPtr<fluidThermo> New(const fvMesh&); static autoPtr<fluidThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -128,16 +128,20 @@ void Foam::heThermo<BasicThermo, MixtureType>::init()
template<class BasicThermo, class MixtureType> template<class BasicThermo, class MixtureType>
Foam::heThermo<BasicThermo, MixtureType>::heThermo(const fvMesh& mesh) Foam::heThermo<BasicThermo, MixtureType>::heThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
BasicThermo(mesh), BasicThermo(mesh, phaseName),
MixtureType(*this, mesh), MixtureType(*this, mesh),
he_ he_
( (
IOobject IOobject
( (
MixtureType::thermoType::heName(), BasicThermo::phasePropertyName(MixtureType::thermoType::heName()),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -156,17 +160,18 @@ template<class BasicThermo, class MixtureType>
Foam::heThermo<BasicThermo, MixtureType>::heThermo Foam::heThermo<BasicThermo, MixtureType>::heThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
: :
BasicThermo(mesh, dict), BasicThermo(mesh, dict, phaseName),
MixtureType(*this, mesh), MixtureType(*this, mesh),
he_ he_
( (
IOobject IOobject
( (
MixtureType::thermoType::heName(), BasicThermo::phasePropertyName(MixtureType::thermoType::heName()),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -89,10 +89,19 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh
heThermo(const fvMesh&); heThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh and dictionary //- Construct from mesh and dictionary
heThermo(const fvMesh&, const dictionary&); heThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
//- Destructor //- Destructor
@ -284,7 +293,7 @@ public:
) const; ) const;
//- Read thermophysicalProperties dictionary //- Read thermophysical properties dictionary
virtual bool read(); virtual bool read();
}; };

View File

@ -102,9 +102,13 @@ void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicPsiThermo, class MixtureType> template<class BasicPsiThermo, class MixtureType>
Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo(const fvMesh& mesh) Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
heThermo<BasicPsiThermo, MixtureType>(mesh) heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName)
{ {
calculate(); calculate();

View File

@ -68,8 +68,12 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
hePsiThermo(const fvMesh&); hePsiThermo
(
const fvMesh&,
const word& phaseName
);
//- Destructor //- Destructor

View File

@ -36,15 +36,15 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::psiThermo::psiThermo(const fvMesh& mesh) Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
: :
fluidThermo(mesh), fluidThermo(mesh, phaseName),
psi_ psi_
( (
IOobject IOobject
( (
"psi", phasePropertyName("psi"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -58,7 +58,7 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh)
( (
IOobject IOobject
( (
"mu", phasePropertyName("mu"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -74,10 +74,11 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh)
Foam::autoPtr<Foam::psiThermo> Foam::psiThermo::New Foam::autoPtr<Foam::psiThermo> Foam::psiThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<psiThermo>(mesh); return basicThermo::New<psiThermo>(mesh, phaseName);
} }

View File

@ -81,19 +81,27 @@ public:
autoPtr, autoPtr,
psiThermo, psiThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
psiThermo(const fvMesh&); psiThermo
(
const fvMesh&,
const word& phaseName
);
//- Selector //- Selector
static autoPtr<psiThermo> New(const fvMesh&); static autoPtr<psiThermo> New
(
const fvMesh& mesh,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -107,9 +107,13 @@ void Foam::heRhoThermo<BasicPsiThermo, MixtureType>::calculate()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicPsiThermo, class MixtureType> template<class BasicPsiThermo, class MixtureType>
Foam::heRhoThermo<BasicPsiThermo, MixtureType>::heRhoThermo(const fvMesh& mesh) Foam::heRhoThermo<BasicPsiThermo, MixtureType>::heRhoThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
heThermo<BasicPsiThermo, MixtureType>(mesh) heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName)
{ {
calculate(); calculate();
} }

View File

@ -69,8 +69,12 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
heRhoThermo(const fvMesh&); heRhoThermo
(
const fvMesh&,
const word& phaseName
);
//- Destructor //- Destructor

View File

@ -36,14 +36,14 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rhoThermo::rhoThermo(const fvMesh& mesh) Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
: :
fluidThermo(mesh), fluidThermo(mesh, phaseName),
rho_ rho_
( (
IOobject IOobject
( (
"rhoThermo", phasePropertyName("rhoThermo"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -57,7 +57,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
( (
IOobject IOobject
( (
"psi", phasePropertyName("psi"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -71,7 +71,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
( (
IOobject IOobject
( (
"mu", phasePropertyName("mu"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -83,14 +83,19 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
{} {}
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) Foam::rhoThermo::rhoThermo
(
const fvMesh& mesh,
const dictionary& dict,
const word& phaseName
)
: :
fluidThermo(mesh, dict), fluidThermo(mesh, dict, phaseName),
rho_ rho_
( (
IOobject IOobject
( (
"rhoThermo", phasePropertyName("rhoThermo"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -104,7 +109,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
( (
IOobject IOobject
( (
"psi", phasePropertyName("psi"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -118,7 +123,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
( (
IOobject IOobject
( (
"mu", phasePropertyName("mu"),
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -134,10 +139,11 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict)
Foam::autoPtr<Foam::rhoThermo> Foam::rhoThermo::New Foam::autoPtr<Foam::rhoThermo> Foam::rhoThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<rhoThermo>(mesh); return basicThermo::New<rhoThermo>(mesh, phaseName);
} }

View File

@ -85,22 +85,35 @@ public:
autoPtr, autoPtr,
rhoThermo, rhoThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
rhoThermo(const fvMesh&); rhoThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh //- Construct from mesh, dictionary and phase name
rhoThermo(const fvMesh&, const dictionary&); rhoThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
//- Selector //- Selector
static autoPtr<rhoThermo> New(const fvMesh&); static autoPtr<rhoThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -36,9 +36,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh) Foam::psiReactionThermo::psiReactionThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
psiThermo(mesh) psiThermo(mesh, phaseName)
{} {}
@ -46,10 +50,11 @@ Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh)
Foam::autoPtr<Foam::psiReactionThermo> Foam::psiReactionThermo::New Foam::autoPtr<Foam::psiReactionThermo> Foam::psiReactionThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<psiReactionThermo>(mesh); return basicThermo::New<psiReactionThermo>(mesh, phaseName);
} }

View File

@ -66,21 +66,29 @@ public:
autoPtr, autoPtr,
psiReactionThermo, psiReactionThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from mesh and phase name
psiReactionThermo(const fvMesh&); psiReactionThermo
(
const fvMesh&,
const word& phaseName
);
// Selectors // Selectors
//- Standard selection based on fvMesh //- Standard selection based on fvMesh
static autoPtr<psiReactionThermo> New(const fvMesh&); static autoPtr<psiReactionThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -121,10 +121,11 @@ void Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::calculate()
template<class BasicPsiThermo, class MixtureType> template<class BasicPsiThermo, class MixtureType>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heheuPsiThermo Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heheuPsiThermo
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
: :
heThermo<psiuReactionThermo, MixtureType>(mesh), heThermo<psiuReactionThermo, MixtureType>(mesh, phaseName),
Tu_ Tu_
( (
IOobject IOobject

View File

@ -76,8 +76,12 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
heheuPsiThermo(const fvMesh&); heheuPsiThermo
(
const fvMesh&,
const word& phaseName
);
//- Destructor //- Destructor

View File

@ -100,9 +100,13 @@ void psiuReactionThermo::heuBoundaryCorrection(volScalarField& heu)
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh) psiuReactionThermo::psiuReactionThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
psiReactionThermo(mesh) psiReactionThermo(mesh, phaseName)
{} {}
@ -110,10 +114,11 @@ psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh)
Foam::autoPtr<Foam::psiuReactionThermo> Foam::psiuReactionThermo::New Foam::autoPtr<Foam::psiuReactionThermo> Foam::psiuReactionThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<psiuReactionThermo>(mesh); return basicThermo::New<psiuReactionThermo>(mesh, phaseName);
} }

View File

@ -73,20 +73,28 @@ public:
autoPtr, autoPtr,
psiuReactionThermo, psiuReactionThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from mesh and phase name
psiuReactionThermo(const fvMesh&); psiuReactionThermo
(
const fvMesh&,
const word& phaseName
);
// Selectors // Selectors
static autoPtr<psiuReactionThermo> New(const fvMesh&); static autoPtr<psiuReactionThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -36,9 +36,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh) Foam::rhoReactionThermo::rhoReactionThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
rhoThermo(mesh) rhoThermo(mesh, phaseName)
{} {}
@ -46,10 +50,11 @@ Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh)
Foam::autoPtr<Foam::rhoReactionThermo> Foam::rhoReactionThermo::New Foam::autoPtr<Foam::rhoReactionThermo> Foam::rhoReactionThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<rhoReactionThermo>(mesh); return basicThermo::New<rhoReactionThermo>(mesh, phaseName);
} }

View File

@ -66,21 +66,29 @@ public:
autoPtr, autoPtr,
rhoReactionThermo, rhoReactionThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Constructors // Constructors
//- Construct from dictionary and mesh //- Construct from mesh and phase name
rhoReactionThermo(const fvMesh&); rhoReactionThermo
(
const fvMesh&,
const word& phaseName
);
// Selectors // Selectors
//- Standard selection based on fvMesh //- Standard selection based on fvMesh
static autoPtr<rhoReactionThermo> New(const fvMesh&); static autoPtr<rhoReactionThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -38,19 +38,24 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh) Foam::solidReactionThermo::solidReactionThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
solidThermo(mesh) solidThermo(mesh, phaseName)
{} {}
Foam::solidReactionThermo::solidReactionThermo Foam::solidReactionThermo::solidReactionThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
: :
solidThermo(mesh, dict) solidThermo(mesh, dict, phaseName)
{} {}
@ -58,20 +63,22 @@ Foam::solidReactionThermo::solidReactionThermo
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<solidReactionThermo>(mesh); return basicThermo::New<solidReactionThermo>(mesh, phaseName);
} }
Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New Foam::autoPtr<Foam::solidReactionThermo> Foam::solidReactionThermo::New
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
{ {
return basicThermo::New<solidReactionThermo>(mesh, dict); return basicThermo::New<solidReactionThermo>(mesh, dict, phaseName);
} }

View File

@ -67,8 +67,8 @@ public:
autoPtr, autoPtr,
solidReactionThermo, solidReactionThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Declare run-time constructor selection tables // Declare run-time constructor selection tables
@ -77,31 +77,46 @@ public:
autoPtr, autoPtr,
solidReactionThermo, solidReactionThermo,
dictionary, dictionary,
(const fvMesh& mesh, const dictionary& dict), (const fvMesh& mesh, const dictionary& dict, const word& phaseName),
(mesh, dict) (mesh, dict, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
solidReactionThermo(const fvMesh&); solidReactionThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from dictionary and mesh //- Construct from mesh, dictionary and phase name
solidReactionThermo(const fvMesh&, const dictionary&); solidReactionThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
// Selectors // Selectors
//- Standard selection based on fvMesh //- Standard selection based on fvMesh
static autoPtr<solidReactionThermo> New(const fvMesh&); static autoPtr<solidReactionThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Standard selection based on fvMesh amd dictionary //- Standard selection based on fvMesh amd dictionary
static autoPtr<solidReactionThermo> New static autoPtr<solidReactionThermo> New
( (
const fvMesh&, const fvMesh&,
const dictionary& const dictionary&,
const word& phaseName=word::null
); );
//- Destructor //- Destructor
virtual ~solidReactionThermo(); virtual ~solidReactionThermo();

View File

@ -124,9 +124,13 @@ void Foam::heSolidThermo<BasicSolidThermo, MixtureType>::calculate()
template<class BasicSolidThermo, class MixtureType> template<class BasicSolidThermo, class MixtureType>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>:: Foam::heSolidThermo<BasicSolidThermo, MixtureType>::
heSolidThermo(const fvMesh& mesh) heSolidThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
heThermo<BasicSolidThermo, MixtureType>(mesh) heThermo<BasicSolidThermo, MixtureType>(mesh, phaseName)
{ {
calculate(); calculate();
} }
@ -134,9 +138,14 @@ heSolidThermo(const fvMesh& mesh)
template<class BasicSolidThermo, class MixtureType> template<class BasicSolidThermo, class MixtureType>
Foam::heSolidThermo<BasicSolidThermo, MixtureType>:: Foam::heSolidThermo<BasicSolidThermo, MixtureType>::
heSolidThermo(const fvMesh& mesh, const dictionary& dict) heSolidThermo
(
const fvMesh& mesh,
const dictionary& dict,
const word& phaseName
)
: :
heThermo<BasicSolidThermo, MixtureType>(mesh, dict) heThermo<BasicSolidThermo, MixtureType>(mesh, dict, phaseName)
{ {
calculate(); calculate();
} }

View File

@ -68,11 +68,20 @@ public:
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
heSolidThermo(const fvMesh&); heSolidThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh and dictionary //- Construct from mesh, dictionary and phase name
heSolidThermo(const fvMesh&, const dictionary&); heSolidThermo
(
const fvMesh&,
const dictionary&,
const word& phaseName
);
//- Destructor //- Destructor

View File

@ -39,9 +39,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidThermo::solidThermo(const fvMesh& mesh) Foam::solidThermo::solidThermo
(
const fvMesh& mesh,
const word& phaseName
)
: :
basicThermo(mesh), basicThermo(mesh, phaseName),
rho_ rho_
( (
IOobject IOobject
@ -61,10 +65,11 @@ Foam::solidThermo::solidThermo(const fvMesh& mesh)
Foam::solidThermo::solidThermo Foam::solidThermo::solidThermo
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
: :
basicThermo(mesh, dict), basicThermo(mesh, dict, phaseName),
rho_ rho_
( (
IOobject IOobject
@ -85,20 +90,22 @@ Foam::solidThermo::solidThermo
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
( (
const fvMesh& mesh const fvMesh& mesh,
const word& phaseName
) )
{ {
return basicThermo::New<solidThermo>(mesh); return basicThermo::New<solidThermo>(mesh, phaseName);
} }
Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
( (
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const word& phaseName
) )
{ {
return basicThermo::New<solidThermo>(mesh, dict); return basicThermo::New<solidThermo>(mesh, dict, phaseName);
} }

View File

@ -78,8 +78,8 @@ public:
autoPtr, autoPtr,
solidThermo, solidThermo,
fvMesh, fvMesh,
(const fvMesh& mesh), (const fvMesh& mesh, const word& phaseName),
(mesh) (mesh, phaseName)
); );
// Declare run-time constructor selection tables // Declare run-time constructor selection tables
@ -88,26 +88,44 @@ public:
autoPtr, autoPtr,
solidThermo, solidThermo,
dictionary, dictionary,
(const fvMesh& mesh, const dictionary& dict), (const fvMesh& mesh, const dictionary& dict, const word& phaseName),
(mesh, dict) (mesh, dict, phaseName)
); );
// Constructors // Constructors
//- Construct from mesh //- Construct from mesh and phase name
solidThermo(const fvMesh&); solidThermo
(
const fvMesh&,
const word& phaseName
);
//- Construct from mesh and dict //- Construct from mesh, dictionary and phase name
solidThermo(const fvMesh&, const dictionary& dict); solidThermo
(
const fvMesh&,
const dictionary& dict,
const word& phaseName
);
//- Return a pointer to a new solidThermo created from //- Return a pointer to a new solidThermo created from
// the solidThermophysicalProperties dictionary // the solidThermophysicalProperties dictionary
static autoPtr<solidThermo> New(const fvMesh&); static autoPtr<solidThermo> New
(
const fvMesh&,
const word& phaseName=word::null
);
//- Return a pointer to a new solidThermo created from //- Return a pointer to a new solidThermo created from
// local dictionary // local dictionary
static autoPtr<solidThermo> New(const fvMesh&, const dictionary&); static autoPtr<solidThermo> New
(
const fvMesh&,
const dictionary&,
const word& phaseName=word::null
);
//- Destructor //- Destructor

View File

@ -15,4 +15,3 @@ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
-lsolidSpecie \ -lsolidSpecie \
-lradiationModels -lradiationModels

View File

@ -48,7 +48,6 @@ laplacianSchemes
interpolationSchemes interpolationSchemes
{ {
default linear; default linear;
UD upwind phid;
} }
snGradSchemes snGradSchemes