mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Re-arrenging the solidThermo interface
This commit is contained in:
@ -349,7 +349,7 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
|
||||
pyrolysisModel(modelType, mesh),
|
||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||
solidThermo_(solidChemistry_->solid()),
|
||||
rho_(solidThermo_.rhos()),
|
||||
rho_(solidThermo_.rho()),
|
||||
Ys_(solidThermo_.composition().Y()),
|
||||
h_(solidThermo_.he()),
|
||||
primaryRadFluxName_(coeffs().lookupOrDefault<word>("radFluxName", "Qr")),
|
||||
@ -449,7 +449,7 @@ reactingOneDim::reactingOneDim
|
||||
pyrolysisModel(modelType, mesh, dict),
|
||||
solidChemistry_(solidChemistryModel::New(regionMesh())),
|
||||
solidThermo_(solidChemistry_->solid()),
|
||||
rho_(solidThermo_.rhos()),
|
||||
rho_(solidThermo_.rho()),
|
||||
Ys_(solidThermo_.composition().Y()),
|
||||
h_(solidThermo_.he()),
|
||||
primaryRadFluxName_(dict.lookupOrDefault<word>("radFluxName", "Qr")),
|
||||
|
||||
@ -359,7 +359,7 @@ void thermoBaffle2D::info() const
|
||||
(
|
||||
mag(regionMesh().Sf().boundaryField()[patchI])
|
||||
* ph.snGrad()
|
||||
* thermo_->alpha(patchI)
|
||||
* thermo_->alpha().boundaryField()[patchI]
|
||||
) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,62 +40,7 @@ namespace Foam
|
||||
defineTypeNameAndDebug(basicThermo, 0);
|
||||
defineRunTimeSelectionTable(basicThermo, fvMesh);
|
||||
}
|
||||
/*
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::basicThermo::heBoundaryTypes()
|
||||
{
|
||||
const volScalarField::GeometricBoundaryField& tbf = 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<temperatureJumpFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
}
|
||||
|
||||
|
||||
void Foam::basicThermo::heBoundaryCorrection(volScalarField& h)
|
||||
{
|
||||
volScalarField::GeometricBoundaryField& hbf = h.boundaryField();
|
||||
|
||||
forAll(hbf, patchi)
|
||||
{
|
||||
if (isA<gradientEnergyFvPatchScalarField>(hbf[patchi]))
|
||||
{
|
||||
refCast<gradientEnergyFvPatchScalarField>(hbf[patchi]).gradient()
|
||||
= hbf[patchi].fvPatchField::snGrad();
|
||||
}
|
||||
else if (isA<mixedEnergyFvPatchScalarField>(hbf[patchi]))
|
||||
{
|
||||
refCast<mixedEnergyFvPatchScalarField>(hbf[patchi]).refGrad()
|
||||
= hbf[patchi].fvPatchField::snGrad();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -55,6 +55,25 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh)
|
||||
{}
|
||||
|
||||
|
||||
Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dicy)
|
||||
:
|
||||
basicThermo(mesh, dict),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoThermo",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimDensity
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rhoThermo::~rhoThermo()
|
||||
|
||||
@ -90,6 +90,9 @@ public:
|
||||
//- Construct from mesh
|
||||
rhoThermo(const fvMesh&);
|
||||
|
||||
//- Construct from mesh
|
||||
rhoThermo(const fvMesh&, const dictionary&);
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<rhoThermo> New(const fvMesh&);
|
||||
|
||||
@ -89,9 +89,6 @@ public:
|
||||
|
||||
// Derived thermal properties
|
||||
|
||||
//- Isotropic thermal conductivity [W/m/K]
|
||||
//virtual tmp<volScalarField> kappa() const;
|
||||
|
||||
//- Anisotropic thermal conductivity [W/m/K]
|
||||
virtual tmp<volVectorField> Kappa() const;
|
||||
|
||||
|
||||
@ -42,20 +42,7 @@ namespace Foam
|
||||
|
||||
Foam::solidThermo::solidThermo(const fvMesh& mesh)
|
||||
:
|
||||
basicThermo(mesh),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimMass/dimVolume
|
||||
)
|
||||
rhoThermo(mesh)
|
||||
{}
|
||||
|
||||
|
||||
@ -65,20 +52,7 @@ Foam::solidThermo::solidThermo
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
basicThermo(mesh, dict),
|
||||
rho_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimMass/dimVolume
|
||||
)
|
||||
rhoThermo(mesh, dict)
|
||||
{}
|
||||
|
||||
|
||||
@ -90,54 +64,6 @@ Foam::solidThermo::~solidThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::volScalarField& Foam::solidThermo::T()
|
||||
{
|
||||
return this->T_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::solidThermo::T() const
|
||||
{
|
||||
return this->T_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::solidThermo::rhos() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::solidThermo::rhos()
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::solidThermo::p() const
|
||||
{
|
||||
return this->p_;
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::solidThermo::p()
|
||||
{
|
||||
return this->p_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField& Foam::solidThermo::alpha() const
|
||||
{
|
||||
return this->alpha_;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::solidThermo::rho() const
|
||||
{
|
||||
return tmp<volScalarField>(rho_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::solidThermo::read()
|
||||
{
|
||||
return regIOobject::read();
|
||||
|
||||
@ -41,7 +41,7 @@ SourceFiles
|
||||
#include "IOdictionary.H"
|
||||
#include "autoPtr.H"
|
||||
#include "basicSolidMixture.H"
|
||||
#include "basicThermo.H"
|
||||
#include "rhoThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -54,18 +54,9 @@ namespace Foam
|
||||
|
||||
class solidThermo
|
||||
:
|
||||
public basicThermo
|
||||
public rhoThermo
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
//- Density [kg/m3]
|
||||
volScalarField rho_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -116,50 +107,9 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Update properties
|
||||
virtual void correct() = 0;
|
||||
|
||||
|
||||
// Access to thermodynamic state variables
|
||||
|
||||
//- Constant access to temperature [K]
|
||||
virtual const volScalarField& T() const;
|
||||
|
||||
//- Non constant access to temperature [K]
|
||||
virtual volScalarField& T();
|
||||
|
||||
//- Solid density [kg/m3]
|
||||
virtual const volScalarField& rhos() const;
|
||||
|
||||
//- Non-const access for solid density [kg/m3]
|
||||
virtual volScalarField& rhos();
|
||||
|
||||
|
||||
//- Constant access to p [Pa]
|
||||
virtual const volScalarField& p() const;
|
||||
|
||||
//- Non-constant access to p [Pa]
|
||||
virtual volScalarField& p();
|
||||
|
||||
|
||||
// Access to transport state variables
|
||||
|
||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
||||
virtual const volScalarField& alpha() const;
|
||||
|
||||
|
||||
// Derived thermal properties
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual const volScalarField& he() const = 0;
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
// Non-const access allowed for transport equations
|
||||
virtual volScalarField& he() = 0;
|
||||
|
||||
//- Thermal conductivity [W/m/K]
|
||||
virtual tmp<volScalarField> kappa() const = 0;
|
||||
|
||||
//- Thermal conductivity [W/m/K]
|
||||
virtual tmp<volVectorField> Kappa() const = 0;
|
||||
|
||||
@ -172,50 +122,12 @@ public:
|
||||
//- Emissivity coefficient [1/m]
|
||||
virtual tmp<volScalarField> emissivity() const = 0;
|
||||
|
||||
//- Specific heat capacity [J/kg/K]
|
||||
virtual tmp<volScalarField> Cp() const = 0;
|
||||
|
||||
//- Heat of formation [J/kg]
|
||||
virtual tmp<volScalarField> hc() const = 0;
|
||||
|
||||
//- Density [kg/m^3]
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
|
||||
// Per patch calculation
|
||||
|
||||
//- Enthalpy/Internal energy [J/kg]
|
||||
virtual tmp<scalarField> he
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchi
|
||||
) const = 0;
|
||||
|
||||
|
||||
//- Specific heat capacity [J/kg/K)]
|
||||
virtual tmp<scalarField> Cp
|
||||
(
|
||||
const scalarField& p,
|
||||
const scalarField& T,
|
||||
const label patchI
|
||||
) const = 0;
|
||||
|
||||
|
||||
//- Isotropic thermal conductivity [W//m/K]
|
||||
virtual tmp<scalarField> kappa
|
||||
(
|
||||
const label patchI
|
||||
) const = 0;
|
||||
|
||||
//- Anisotropic thermal conductivity [W/m/K]
|
||||
virtual tmp<vectorField> Kappa
|
||||
(
|
||||
const label patchI
|
||||
) const = 0;
|
||||
|
||||
//- Thermal diffusivity for enthalpy of mixture [kg/m/s]
|
||||
virtual tmp<scalarField> alpha
|
||||
(
|
||||
const label patchI
|
||||
) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user