diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C index e19084dd3d4f561138d1755407a9aa6c3ee6f4fc..65143f5d27db6a8d30eafa25fbfdab3d2749d3ed 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C @@ -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")), diff --git a/src/regionModels/thermoBaffleModels/thermoBaffle2D/thermoBaffle2D.C b/src/regionModels/thermoBaffleModels/thermoBaffle2D/thermoBaffle2D.C index a0495d2d06f74b189967e69d90f4f05aff70ead2..97faec40cb520cfb2932a4f029d0e251d52e293c 100644 --- a/src/regionModels/thermoBaffleModels/thermoBaffle2D/thermoBaffle2D.C +++ b/src/regionModels/thermoBaffleModels/thermoBaffle2D/thermoBaffle2D.C @@ -359,7 +359,7 @@ void thermoBaffle2D::info() const ( mag(regionMesh().Sf().boundaryField()[patchI]) * ph.snGrad() - * thermo_->alpha(patchI) + * thermo_->alpha().boundaryField()[patchI] ) << endl; } } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index aa90283d519c75f8395bea785e9cbc753b226f7f..1390c214a2b19da841e4b78d0ca1fdf79a992bc6 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -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 * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C index 8cafa9454c973102dc4c93b8e8940d5be2883db8..33c7905fee0423e71317290fb68047da28d0aa78 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C @@ -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() diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.H index 098e2ec0f15966752d2a8069c21d82e081bbeb83..77a4c4fd12a9e0e4e4931be807ef43f7ee90020f 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.H @@ -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&); diff --git a/src/thermophysicalModels/basicSolidThermo/heSolidThermo/heSolidThermo.H b/src/thermophysicalModels/basicSolidThermo/heSolidThermo/heSolidThermo.H index fac27226ff8b8dcdb2ebc44bcccc271116d191fc..88a8d8aab6147731c2eab0b75508a6c9238f9f94 100644 --- a/src/thermophysicalModels/basicSolidThermo/heSolidThermo/heSolidThermo.H +++ b/src/thermophysicalModels/basicSolidThermo/heSolidThermo/heSolidThermo.H @@ -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; diff --git a/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.C b/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.C index 24220ee9bb7be592efa58bab4a0b14038e97f580..7a791b59cc75fa67043253a244d78bfd58ae54e9 100644 --- a/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.C +++ b/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.C @@ -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(); diff --git a/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.H index 79741f466fe06cd060f99188a5b87e16c39f6cfe..08b9f82ab431a48b76e194cd3e318c9ffd4e98f5 100644 --- a/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/basicSolidThermo/solidThermo/solidThermo.H @@ -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;