Thermo: move the he BC set functions into basicThermo
This commit is contained in:
@ -24,6 +24,14 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "basicThermo.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "fixedEnergyFvPatchScalarField.H"
|
||||
#include "gradientEnergyFvPatchScalarField.H"
|
||||
#include "mixedEnergyFvPatchScalarField.H"
|
||||
#include "fixedJumpFvPatchFields.H"
|
||||
#include "fixedJumpAMIFvPatchFields.H"
|
||||
#include "energyJumpFvPatchScalarField.H"
|
||||
#include "energyJumpAMIFvPatchScalarField.H"
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||
@ -36,6 +44,84 @@ namespace Foam
|
||||
|
||||
const Foam::word Foam::basicThermo::dictName("thermophysicalProperties");
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::basicThermo::heBoundaryBaseTypes()
|
||||
{
|
||||
const volScalarField::GeometricBoundaryField& tbf =
|
||||
this->T_.boundaryField();
|
||||
|
||||
wordList hbt(tbf.size(), word::null);
|
||||
|
||||
forAll(tbf, patchi)
|
||||
{
|
||||
if (isA<fixedJumpFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
const fixedJumpFvPatchScalarField& pf =
|
||||
dynamic_cast<const fixedJumpFvPatchScalarField&>(tbf[patchi]);
|
||||
|
||||
hbt[patchi] = pf.interfaceFieldType();
|
||||
}
|
||||
else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
const fixedJumpAMIFvPatchScalarField& pf =
|
||||
dynamic_cast<const fixedJumpAMIFvPatchScalarField&>
|
||||
(
|
||||
tbf[patchi]
|
||||
);
|
||||
|
||||
hbt[patchi] = pf.interfaceFieldType();
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
}
|
||||
|
||||
|
||||
Foam::wordList Foam::basicThermo::heBoundaryTypes()
|
||||
{
|
||||
const volScalarField::GeometricBoundaryField& tbf =
|
||||
this->T_.boundaryField();
|
||||
|
||||
wordList hbt = tbf.types();
|
||||
|
||||
forAll(tbf, patchi)
|
||||
{
|
||||
if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = fixedEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if
|
||||
(
|
||||
isA<zeroGradientFvPatchScalarField>(tbf[patchi])
|
||||
|| isA<fixedGradientFvPatchScalarField>(tbf[patchi])
|
||||
)
|
||||
{
|
||||
hbt[patchi] = gradientEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<mixedFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<fixedJumpFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (tbf[patchi].type() == "energyRegionCoupledFvPatchScalarField")
|
||||
{
|
||||
hbt[patchi] = "energyRegionCoupledFvPatchScalarField";
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
|
||||
@ -395,6 +481,12 @@ const Foam::volScalarField& Foam::basicThermo::T() const
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::basicThermo::T()
|
||||
{
|
||||
return T_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::basicThermo::alpha() const
|
||||
{
|
||||
return alpha_;
|
||||
|
||||
@ -77,6 +77,9 @@ protected:
|
||||
//- Should the dpdt term be included in the enthalpy equation
|
||||
Switch dpdt_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Construct as copy (not implemented)
|
||||
basicThermo(const basicThermo&);
|
||||
|
||||
@ -86,6 +89,14 @@ protected:
|
||||
const char* name
|
||||
) const;
|
||||
|
||||
//- Return the enthalpy/internal energy field boundary types
|
||||
// by interrogating the temperature field boundary types
|
||||
wordList heBoundaryTypes();
|
||||
|
||||
//- Return the enthalpy/internal energy field boundary base types
|
||||
// by interrogating the temperature field boundary types
|
||||
wordList heBoundaryBaseTypes();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -314,6 +325,10 @@ public:
|
||||
//- Temperature [K]
|
||||
virtual const volScalarField& T() const;
|
||||
|
||||
//- Temperature [K]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& T();
|
||||
|
||||
//- Heat capacity at constant pressure [J/kg/K]
|
||||
virtual tmp<volScalarField> Cp() const = 0;
|
||||
|
||||
|
||||
@ -24,94 +24,11 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "heThermo.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "fixedEnergyFvPatchScalarField.H"
|
||||
#include "gradientEnergyFvPatchScalarField.H"
|
||||
#include "mixedEnergyFvPatchScalarField.H"
|
||||
#include "fixedJumpFvPatchFields.H"
|
||||
#include "fixedJumpAMIFvPatchFields.H"
|
||||
#include "energyJumpFvPatchScalarField.H"
|
||||
#include "energyJumpAMIFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryBaseTypes()
|
||||
{
|
||||
const volScalarField::GeometricBoundaryField& tbf =
|
||||
this->T_.boundaryField();
|
||||
|
||||
wordList hbt(tbf.size(), word::null);
|
||||
|
||||
forAll(tbf, patchi)
|
||||
{
|
||||
if (isA<fixedJumpFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
const fixedJumpFvPatchScalarField& pf =
|
||||
dynamic_cast<const fixedJumpFvPatchScalarField&>(tbf[patchi]);
|
||||
|
||||
hbt[patchi] = pf.interfaceFieldType();
|
||||
}
|
||||
else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
const fixedJumpAMIFvPatchScalarField& pf =
|
||||
dynamic_cast<const fixedJumpAMIFvPatchScalarField&>
|
||||
(
|
||||
tbf[patchi]
|
||||
);
|
||||
|
||||
hbt[patchi] = pf.interfaceFieldType();
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
}
|
||||
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes()
|
||||
{
|
||||
const volScalarField::GeometricBoundaryField& tbf =
|
||||
this->T_.boundaryField();
|
||||
|
||||
wordList hbt = tbf.types();
|
||||
|
||||
forAll(tbf, patchi)
|
||||
{
|
||||
if (isA<fixedValueFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = fixedEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if
|
||||
(
|
||||
isA<zeroGradientFvPatchScalarField>(tbf[patchi])
|
||||
|| isA<fixedGradientFvPatchScalarField>(tbf[patchi])
|
||||
)
|
||||
{
|
||||
hbt[patchi] = gradientEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<mixedFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<fixedJumpFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (tbf[patchi].type() == "energyRegionCoupledFvPatchScalarField")
|
||||
{
|
||||
hbt[patchi] = "energyRegionCoupledFvPatchScalarField";
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
}
|
||||
|
||||
|
||||
template<class BasicThermo, class MixtureType>
|
||||
void Foam::heThermo<BasicThermo, MixtureType>::
|
||||
heBoundaryCorrection(volScalarField& h)
|
||||
|
||||
@ -64,14 +64,6 @@ protected:
|
||||
|
||||
// Enthalpy/Internal energy
|
||||
|
||||
//- Return the enthalpy/internal energy field boundary types
|
||||
// by interrogating the temperature field boundary types
|
||||
wordList heBoundaryTypes();
|
||||
|
||||
//- Return the enthalpy/internal energy field boundary base types
|
||||
// by interrogating the temperature field boundary types
|
||||
wordList heBoundaryBaseTypes();
|
||||
|
||||
//- Correct the enthalpy/internal energy field boundaries
|
||||
void heBoundaryCorrection(volScalarField& he);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user