mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: new basicSolidThermo, solid -> pointSolid and solidMixture ->
pointSolidMixture. chtMultiRegion tutorials and solvers
This commit is contained in:
@ -5,6 +5,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
tmp<volScalarField> trho = thermo.rho();
|
tmp<volScalarField> trho = thermo.rho();
|
||||||
const volScalarField& rho = trho();
|
const volScalarField& rho = trho();
|
||||||
|
|
||||||
tmp<volScalarField> tcp = thermo.cp();
|
tmp<volScalarField> tcp = thermo.Cp();
|
||||||
const volScalarField& cp = tcp();
|
const volScalarField& cp = tcp();
|
||||||
|
|
||||||
tmp<volScalarField> tK = thermo.K();
|
tmp<volScalarField> tK = thermo.K();
|
||||||
|
|||||||
@ -4,11 +4,12 @@
|
|||||||
tmp<volScalarField> trho = thermo.rho();
|
tmp<volScalarField> trho = thermo.rho();
|
||||||
const volScalarField& rho = trho();
|
const volScalarField& rho = trho();
|
||||||
|
|
||||||
tmp<volScalarField> tcp = thermo.cp();
|
tmp<volScalarField> tcp = thermo.Cp();
|
||||||
const volScalarField& cp = tcp();
|
const volScalarField& cp = tcp();
|
||||||
|
|
||||||
tmp<volScalarField> tK = thermo.K();
|
tmp<volScalarField> tK = thermo.K();
|
||||||
//tmp<volSymmTensorField> tK = thermo.directionalK();
|
//tmp<volSymmTensorField> tK = thermo.directionalK();
|
||||||
const volScalarField& K = tK();
|
const volScalarField& K = tK();
|
||||||
|
//const volSymmTensorField& K = tK();
|
||||||
|
|
||||||
volScalarField& T = thermo.T();
|
volScalarField& T = thermo.T();
|
||||||
|
|||||||
@ -55,4 +55,35 @@ Foam::scalar Foam::solidRegionDiffNo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::solidRegionDiffNo
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const Time& runTime,
|
||||||
|
const volScalarField& Cprho,
|
||||||
|
const volSymmTensorField& Kdirectional
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar DiNum = 0.0;
|
||||||
|
scalar meanDiNum = 0.0;
|
||||||
|
|
||||||
|
volScalarField K = mag(Kdirectional);
|
||||||
|
|
||||||
|
//- Take care: can have fluid domains with 0 cells so do not test for
|
||||||
|
// zero internal faces.
|
||||||
|
surfaceScalarField KrhoCpbyDelta =
|
||||||
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
|
* fvc::interpolate(K)
|
||||||
|
/ fvc::interpolate(Cprho);
|
||||||
|
|
||||||
|
DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value();
|
||||||
|
|
||||||
|
meanDiNum = (average(KrhoCpbyDelta)).value()*runTime.deltaT().value();
|
||||||
|
|
||||||
|
Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
|
||||||
|
<< " max: " << DiNum << endl;
|
||||||
|
|
||||||
|
return DiNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -41,6 +41,15 @@ namespace Foam
|
|||||||
const volScalarField& Cprho,
|
const volScalarField& Cprho,
|
||||||
const volScalarField& K
|
const volScalarField& K
|
||||||
);
|
);
|
||||||
|
|
||||||
|
scalar solidRegionDiffNo
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const Time& runTime,
|
||||||
|
const volScalarField& Cprho,
|
||||||
|
const volSymmTensorField& K
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -18,6 +18,8 @@ if (finalIter)
|
|||||||
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
|
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
|
||||||
if (finalIter)
|
if (finalIter)
|
||||||
{
|
{
|
||||||
mesh.data::remove("finalIteration");
|
mesh.data::remove("finalIteration");
|
||||||
|
|||||||
@ -10,8 +10,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
@ -33,8 +33,8 @@ EXE_LIBS = \
|
|||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
|
|||||||
@ -10,8 +10,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
@ -32,8 +32,8 @@ EXE_LIBS = \
|
|||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
|
|||||||
@ -5,8 +5,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
@ -26,8 +26,8 @@ EXE_LIBS = \
|
|||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
|
|||||||
@ -9,8 +9,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
@ -31,8 +31,8 @@ EXE_LIBS = \
|
|||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
|
|||||||
@ -10,8 +10,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
@ -32,8 +32,8 @@ EXE_LIBS = \
|
|||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
|
|||||||
@ -47,9 +47,9 @@ EXE_LIBS = \
|
|||||||
-lrandomProcesses \
|
-lrandomProcesses \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lsolidParticle \
|
-lsolidParticle \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lsurfMesh \
|
-lsurfMesh \
|
||||||
-lsystemCall \
|
-lsystemCall \
|
||||||
|
|||||||
@ -8,8 +8,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
@ -30,8 +30,8 @@ LIB_LIBS = \
|
|||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lSLGThermo \
|
-lSLGThermo \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
|
|||||||
@ -7,8 +7,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
@ -27,8 +27,8 @@ LIB_LIBS = \
|
|||||||
-lpdf \
|
-lpdf \
|
||||||
-lliquids \
|
-lliquids \
|
||||||
-lliquidMixture \
|
-lliquidMixture \
|
||||||
-lsolids \
|
-lpointSolids \
|
||||||
-lsolidMixture \
|
-lpointSolidMixture \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
|
|||||||
@ -100,7 +100,7 @@ const Foam::liquidMixture& Foam::CompositionModel<CloudType>::liquids() const
|
|||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
const Foam::solidMixture& Foam::CompositionModel<CloudType>::solids() const
|
const Foam::pointSolidMixture& Foam::CompositionModel<CloudType>::solids() const
|
||||||
{
|
{
|
||||||
return thermo_.solids();
|
return thermo_.solids();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -143,7 +143,7 @@ public:
|
|||||||
const liquidMixture& liquids() const;
|
const liquidMixture& liquids() const;
|
||||||
|
|
||||||
//- Return the global (additional) solids
|
//- Return the global (additional) solids
|
||||||
const solidMixture& solids() const;
|
const pointSolidMixture& solids() const;
|
||||||
|
|
||||||
//- Return the list of phase properties
|
//- Return the list of phase properties
|
||||||
const phasePropertiesList& phaseProps() const;
|
const phasePropertiesList& phaseProps() const;
|
||||||
|
|||||||
@ -5,8 +5,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
|
||||||
|
|||||||
@ -3,11 +3,12 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake libso specie
|
wmake libso specie
|
||||||
|
wmake libso solid
|
||||||
wmake libso thermophysicalFunctions
|
wmake libso thermophysicalFunctions
|
||||||
wmake libso liquids
|
wmake libso liquids
|
||||||
wmake libso liquidMixture
|
wmake libso liquidMixture
|
||||||
wmake libso solids
|
wmake libso pointSolids
|
||||||
wmake libso solidMixture
|
wmake libso pointSolidMixture
|
||||||
|
|
||||||
wmake libso basic
|
wmake libso basic
|
||||||
wmake libso reactionThermo
|
wmake libso reactionThermo
|
||||||
|
|||||||
@ -4,8 +4,8 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
|
|||||||
@ -72,7 +72,7 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo)
|
|||||||
|
|
||||||
if (thermo.found("solids"))
|
if (thermo.found("solids"))
|
||||||
{
|
{
|
||||||
solids_ = solidMixture::New(thermo.subDict("solids"));
|
solids_ = pointSolidMixture::New(thermo.subDict("solids"));
|
||||||
Info<< " solids - " << solids_->components().size()
|
Info<< " solids - " << solids_->components().size()
|
||||||
<< " components" << endl;
|
<< " components" << endl;
|
||||||
}
|
}
|
||||||
@ -128,13 +128,13 @@ const Foam::liquidMixture& Foam::SLGThermo::liquids() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::solidMixture& Foam::SLGThermo::solids() const
|
const Foam::pointSolidMixture& Foam::SLGThermo::solids() const
|
||||||
{
|
{
|
||||||
if (!solids_.valid())
|
if (!solids_.valid())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"const Foam::solidMixture& Foam::SLGThermo::solids() const"
|
"const Foam::pointSolidtMixture& Foam::SLGThermo::solids() const"
|
||||||
) << "solids requested, but object is not allocated"
|
) << "solids requested, but object is not allocated"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,7 @@ SourceFiles
|
|||||||
#include "basicThermo.H"
|
#include "basicThermo.H"
|
||||||
#include "basicMultiComponentMixture.H"
|
#include "basicMultiComponentMixture.H"
|
||||||
#include "liquidMixture.H"
|
#include "liquidMixture.H"
|
||||||
#include "solidMixture.H"
|
#include "pointSolidMixture.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class SLGThermo
|
|||||||
autoPtr<liquidMixture> liquids_;
|
autoPtr<liquidMixture> liquids_;
|
||||||
|
|
||||||
//- Additional solid properties data
|
//- Additional solid properties data
|
||||||
autoPtr<solidMixture> solids_;
|
autoPtr<pointSolidMixture> solids_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
const liquidMixture& liquids() const;
|
const liquidMixture& liquids() const;
|
||||||
|
|
||||||
//- Return reference to the global (additional) solids
|
//- Return reference to the global (additional) solids
|
||||||
const solidMixture& solids() const;
|
const pointSolidMixture& solids() const;
|
||||||
|
|
||||||
|
|
||||||
// Index retrieval
|
// Index retrieval
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
constSolidThermo/constSolidThermo.C
|
|
||||||
directionalSolidThermo/directionalSolidThermo.C
|
|
||||||
basicSolidThermo/basicSolidThermo.C
|
basicSolidThermo/basicSolidThermo.C
|
||||||
basicSolidThermo/basicSolidThermoNew.C
|
basicSolidThermo/newBasicSolidThermo.C
|
||||||
|
|
||||||
|
constSolidThermo/constSolidThermo.C
|
||||||
|
directionalKSolidThermo/directionalKSolidThermo.C
|
||||||
interpolatedSolidThermo/interpolatedSolidThermo.C
|
interpolatedSolidThermo/interpolatedSolidThermo.C
|
||||||
|
interpolatedSolidThermo/interpolateSolid/interpolateSolid.C
|
||||||
|
isotropicKSolidThermo/isotropicKSolidThermo.C
|
||||||
|
|
||||||
|
solidMixtureThermo/mixtures/basicSolidMixture/basicSolidMixture.C
|
||||||
|
solidMixtureThermo/solidMixtureThermo/solidMixtureThermos.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libbasicSolidThermo
|
LIB = $(FOAM_LIBBIN)/libbasicSolidThermo
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/solid/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfiniteVolume
|
-lfiniteVolume \
|
||||||
|
-lsolid
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -23,10 +23,11 @@ License
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
#include "basicSolidThermo.H"
|
#include "basicSolidThermo.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "HashTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
@ -34,6 +35,7 @@ namespace Foam
|
|||||||
defineRunTimeSelectionTable(basicSolidThermo, mesh);
|
defineRunTimeSelectionTable(basicSolidThermo, mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
|
Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
|
||||||
@ -45,7 +47,7 @@ Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
|
|||||||
"solidThermophysicalProperties",
|
"solidThermophysicalProperties",
|
||||||
mesh.time().constant(),
|
mesh.time().constant(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -61,7 +63,60 @@ Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh
|
mesh
|
||||||
|
),
|
||||||
|
rho_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimMass/dimVolume
|
||||||
|
),
|
||||||
|
kappa_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"kappa",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless/dimLength
|
||||||
|
),
|
||||||
|
sigmaS_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"sigmaS",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless/dimLength
|
||||||
|
),
|
||||||
|
emissivity_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"emissivity",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless
|
||||||
)
|
)
|
||||||
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -73,6 +128,117 @@ Foam::basicSolidThermo::~basicSolidThermo()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::volScalarField& Foam::basicSolidThermo::T()
|
||||||
|
{
|
||||||
|
return T_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::T() const
|
||||||
|
{
|
||||||
|
return T_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::rho() const
|
||||||
|
{
|
||||||
|
return rho_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::volScalarField& Foam::basicSolidThermo::rho()
|
||||||
|
{
|
||||||
|
return rho_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::kappa() const
|
||||||
|
{
|
||||||
|
return kappa_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::sigmaS() const
|
||||||
|
{
|
||||||
|
return sigmaS_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::emissivity() const
|
||||||
|
{
|
||||||
|
return emissivity_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::basicSolidThermo::K() const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::K()");
|
||||||
|
return volScalarField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volSymmTensorField& Foam::basicSolidThermo::directionalK() const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::directionalK()");
|
||||||
|
return const_cast<volSymmTensorField&>(volSymmTensorField::null());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::basicSolidMixture& Foam::basicSolidThermo::composition()
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::composition()");
|
||||||
|
return *reinterpret_cast<basicSolidMixture*>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::basicSolidMixture& Foam::basicSolidThermo::composition() const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::composition() const");
|
||||||
|
return *reinterpret_cast<const basicSolidMixture*>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::volScalarField> Foam::basicSolidThermo::hs() const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::hs()");
|
||||||
|
return volScalarField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::basicSolidThermo::hs(const label patchI)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::hs(const label)");
|
||||||
|
return scalarField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::basicSolidThermo::K
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
)const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::K(const label)");
|
||||||
|
return scalarField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::symmTensorField> Foam::basicSolidThermo::directionalK
|
||||||
|
(
|
||||||
|
const label
|
||||||
|
)const
|
||||||
|
{
|
||||||
|
notImplemented("basicSolidThermo::directionalK(const label)");
|
||||||
|
return symmTensorField::null();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::basicSolidThermo::read()
|
||||||
|
{
|
||||||
|
return regIOobject::read();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::basicSolidThermo::writeData(Ostream& os) const
|
bool Foam::basicSolidThermo::writeData(Ostream& os) const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,20 +25,24 @@ Class
|
|||||||
Foam::basicSolidThermo
|
Foam::basicSolidThermo
|
||||||
|
|
||||||
Description
|
Description
|
||||||
The thermophysical properties of a basicSolidThermo
|
|
||||||
|
Basic solid thermodynamic properties
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
basicSolidThermo.C
|
basicSolidThermo.C
|
||||||
newBasicSolidThermo.C
|
newBasicThermo.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef basicSolidThermo_H
|
#ifndef basicSolidThermo_H
|
||||||
#define basicSolidThermo_H
|
#define basicSolidThermo_H
|
||||||
|
|
||||||
#include "runTimeSelectionTables.H"
|
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
|
#include "IOdictionary.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "basicSolidMixture.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -46,21 +50,36 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class basicSolidThermo Declaration
|
Class basicSolidThermo Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class basicSolidThermo
|
class basicSolidThermo
|
||||||
:
|
:
|
||||||
public IOdictionary
|
public IOdictionary
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
const fvMesh& mesh_;
|
const fvMesh& mesh_;
|
||||||
|
|
||||||
//- Temperature [K]
|
// Fields
|
||||||
volScalarField T_;
|
|
||||||
|
//- Temperature [K]
|
||||||
|
volScalarField T_;
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
volScalarField rho_;
|
||||||
|
|
||||||
|
//- Absorption coefficient [1/m]
|
||||||
|
volScalarField kappa_;
|
||||||
|
|
||||||
|
//- Scatter coeffcient [1/m]
|
||||||
|
volScalarField sigmaS_;
|
||||||
|
|
||||||
|
//- Emissivity coeffcient []
|
||||||
|
volScalarField emissivity_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -68,8 +87,7 @@ public:
|
|||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("basicSolidThermo");
|
TypeName("basicSolidThermo");
|
||||||
|
|
||||||
|
// Declare run-time constructor selection tables
|
||||||
//- Declare run-time constructor selection tables
|
|
||||||
declareRunTimeSelectionTable
|
declareRunTimeSelectionTable
|
||||||
(
|
(
|
||||||
autoPtr,
|
autoPtr,
|
||||||
@ -91,100 +109,106 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~basicSolidThermo();
|
|
||||||
|
virtual ~basicSolidThermo();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member functions
|
||||||
|
|
||||||
//- Update properties
|
//- Update properties
|
||||||
virtual void correct() = 0;
|
virtual void correct() = 0;
|
||||||
|
|
||||||
|
//- Return the composition of the solid mixture
|
||||||
|
virtual basicSolidMixture& composition();
|
||||||
|
|
||||||
// Physical constants which define the basicSolidThermo
|
//- Return the composition of the solid mixture
|
||||||
|
virtual const basicSolidMixture& composition() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Access to thermodynamic state variables
|
||||||
|
|
||||||
|
//- Density [kg/m^3]
|
||||||
|
const volScalarField& rho() const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/m/K]
|
||||||
|
virtual const volScalarField& K() const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/m/K]
|
||||||
|
virtual const volSymmTensorField& directionalK() const;
|
||||||
|
|
||||||
|
//- Absorption coefficient [1/m]
|
||||||
|
const volScalarField& kappa() const;
|
||||||
|
|
||||||
|
//- Emissivity coefficient
|
||||||
|
const volScalarField& sigmaS() const;
|
||||||
|
|
||||||
|
//- Emissivity coefficient [1/m]
|
||||||
|
const volScalarField& emissivity() const;
|
||||||
|
|
||||||
//- Temperature [K]
|
//- Temperature [K]
|
||||||
inline const volScalarField& T() const;
|
const volScalarField& T() const;
|
||||||
|
|
||||||
//- Temperature [K]
|
//- non-const access for T
|
||||||
inline volScalarField& T();
|
volScalarField& T();
|
||||||
|
|
||||||
//- Density [kg/m3]
|
//- non-const access for rho
|
||||||
virtual tmp<volScalarField> rho() const = 0;
|
volScalarField& rho();
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
|
||||||
virtual tmp<volScalarField> cp() const = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
// Derived thermal properties
|
||||||
virtual tmp<volScalarField> K() const = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Specific heat capacity [J/kg/K]
|
||||||
virtual tmp<volSymmTensorField> directionalK() const = 0;
|
virtual tmp<volScalarField> Cp() const = 0;
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
//- Sensible enthalpy [J/kg]
|
||||||
|
virtual tmp<volScalarField> hs() const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
virtual tmp<volScalarField> Hf() const = 0;
|
virtual tmp<volScalarField> Hf() const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Per patch calculation
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
virtual tmp<scalarField> rho(const label patchI) const = 0;
|
||||||
|
|
||||||
|
//- Specific heat capacity [J/kg/K)]
|
||||||
|
virtual tmp<scalarField> Cp(const label patchI) const = 0;
|
||||||
|
|
||||||
|
//- Sensible enthalpy [J/kg]
|
||||||
|
virtual tmp<scalarField> hs(const label patchI) const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W//m/K]
|
||||||
|
virtual tmp<scalarField> K(const label patchI) const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W//m/K]
|
||||||
|
virtual tmp<symmTensorField> directionalK(const label) const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
virtual tmp<scalarField> Hf(const label patchI) const = 0;
|
||||||
|
|
||||||
|
//- Scatter coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> sigmaS(const label) const = 0;
|
||||||
|
|
||||||
|
//- Absorption coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> kappa(const label) const = 0;
|
||||||
|
|
||||||
//- Emissivity []
|
//- Emissivity []
|
||||||
virtual tmp<volScalarField> emissivity() const = 0;
|
virtual tmp<scalarField> emissivity(const label) const = 0;
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
// Per patch calculation
|
//- Write the basicSolidThermo properties
|
||||||
|
virtual bool writeData(Ostream& os) const = 0;
|
||||||
//- Density [kg/m3]
|
|
||||||
virtual tmp<scalarField> rho(const label patchI) const = 0;
|
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
|
||||||
virtual tmp<scalarField> cp(const label patchI) const = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
virtual tmp<scalarField> K(const label patchI) const = 0;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
virtual tmp<symmTensorField> directionalK(const label) const =0;
|
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
|
||||||
virtual tmp<scalarField> Hf(const label patchI) const = 0;
|
|
||||||
|
|
||||||
//- Emissivity []
|
|
||||||
virtual tmp<scalarField> emissivity(const label) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// // Point wise properties
|
|
||||||
//
|
|
||||||
// //- Density [kg/m3]
|
|
||||||
// virtual scalar rho(const scalar T) const = 0;
|
|
||||||
//
|
|
||||||
// //- Specific heat capacity [J/(kg.K)]
|
|
||||||
// virtual scalar cp(const scalar T) const = 0;
|
|
||||||
//
|
|
||||||
// //- Thermal conductivity [W/(m.K)]
|
|
||||||
// virtual scalar K(const scalar T) const = 0;
|
|
||||||
//
|
|
||||||
// //- Heat of formation [J/kg]
|
|
||||||
// virtual scalar Hf(const scalar T) const = 0;
|
|
||||||
//
|
|
||||||
// //- Emissivity []
|
|
||||||
// virtual scalar emissivity(const scalar T) const = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write the basicSolidThermo properties
|
|
||||||
virtual bool writeData(Ostream& os) const = 0;
|
|
||||||
|
|
||||||
//- Read solidThermophysicalProperties dictionary
|
|
||||||
virtual bool read() = 0;
|
|
||||||
|
|
||||||
|
//- Read thermophysicalProperties dictionary
|
||||||
|
virtual bool read() = 0;
|
||||||
|
|
||||||
// Ostream Operator
|
// Ostream Operator
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream& os, const basicSolidThermo& s);
|
friend Ostream& operator<<(Ostream& os, const basicSolidThermo& s);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#include "basicSolidThermoI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|||||||
@ -0,0 +1,77 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "basicSolidThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::basicSolidThermo> Foam::basicSolidThermo::New
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "basicSolidThermo::New(const fvMesh&): "
|
||||||
|
<< "constructing basicSolidThermo"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word thermoType
|
||||||
|
(
|
||||||
|
IOdictionary
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"solidThermophysicalProperties",
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
).lookup("thermoType")
|
||||||
|
);
|
||||||
|
|
||||||
|
meshConstructorTable::iterator cstrIter =
|
||||||
|
meshConstructorTablePtr_->find(thermoType);
|
||||||
|
|
||||||
|
if (cstrIter == meshConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"basicSolidThermo::New(const fvMesh&, const word&)"
|
||||||
|
) << "Unknown solidThermo type " << thermoType
|
||||||
|
<< endl << endl
|
||||||
|
<< "Valid solidThermo types are :" << endl
|
||||||
|
<< meshConstructorTablePtr_->toc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<basicSolidThermo>(cstrIter()(mesh));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,14 +40,39 @@ namespace Foam
|
|||||||
Foam::constSolidThermo::constSolidThermo(const fvMesh& mesh)
|
Foam::constSolidThermo::constSolidThermo(const fvMesh& mesh)
|
||||||
:
|
:
|
||||||
basicSolidThermo(mesh),
|
basicSolidThermo(mesh),
|
||||||
constRho_("zero", dimDensity, 0.0),
|
dict_(subDict(typeName + "Coeffs")),
|
||||||
constCp_("zero", dimEnergy/(dimMass*dimTemperature), 0.0),
|
constK_(dimensionedScalar(dict_.lookup("K"))),
|
||||||
constK_("zero", dimEnergy/dimTime/(dimLength*dimTemperature), 0.0),
|
K_
|
||||||
constHf_("zero", dimEnergy/dimMass, 0.0),
|
(
|
||||||
constEmissivity_("zero", dimless, 0.0)
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
constK_
|
||||||
|
),
|
||||||
|
constRho_(dimensionedScalar(dict_.lookup("rho"))),
|
||||||
|
constCp_(dimensionedScalar(dict_.lookup("Cp"))),
|
||||||
|
constHf_(dimensionedScalar(dict_.lookup("Hf"))),
|
||||||
|
constEmissivity_(dimensionedScalar(dict_.lookup("emissivity"))),
|
||||||
|
constKappa_(dimensionedScalar(dict_.lookup("kappa"))),
|
||||||
|
constSigmaS_(dimensionedScalar(dict_.lookup("sigmaS")))
|
||||||
{
|
{
|
||||||
read();
|
read();
|
||||||
correct();
|
|
||||||
|
K_ = constK_;
|
||||||
|
|
||||||
|
rho_ = constRho_;
|
||||||
|
|
||||||
|
emissivity_ = constEmissivity_;
|
||||||
|
|
||||||
|
kappa_ = constKappa_;
|
||||||
|
|
||||||
|
sigmaS_ = constSigmaS_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +88,7 @@ void Foam::constSolidThermo::correct()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::rho() const
|
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::Cp() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
@ -71,28 +96,7 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::rho() const
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"rho",
|
"Cp",
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
constRho_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::cp() const
|
|
||||||
{
|
|
||||||
return tmp<volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"cp",
|
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -105,79 +109,13 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::cp() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::K() const
|
const Foam::volScalarField& Foam::constSolidThermo::K() const
|
||||||
//{
|
|
||||||
// vector v(eigenValues(constK_.value()));
|
|
||||||
//
|
|
||||||
// if (mag(v.x() - v.z()) > SMALL)
|
|
||||||
// {
|
|
||||||
// FatalErrorIn("directionalSolidThermo::K() const")
|
|
||||||
// << "Supplied K " << constK_
|
|
||||||
// << " are not isotropic. Eigenvalues are "
|
|
||||||
// << v << exit(FatalError);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return tmp<volScalarField>
|
|
||||||
// (
|
|
||||||
// new volScalarField
|
|
||||||
// (
|
|
||||||
// IOobject
|
|
||||||
// (
|
|
||||||
// "K",
|
|
||||||
// mesh_.time().timeName(),
|
|
||||||
// mesh_,
|
|
||||||
// IOobject::NO_READ,
|
|
||||||
// IOobject::NO_WRITE
|
|
||||||
// ),
|
|
||||||
// mesh_,
|
|
||||||
// v.x()
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::K() const
|
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return K_;
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"K",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
constK_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Foam::tmp<Foam::volSymmTensorField> Foam::constSolidThermo::directionalK()
|
const Foam::volSymmTensorField& Foam::constSolidThermo::directionalK() const
|
||||||
//const
|
|
||||||
//{
|
|
||||||
// return tmp<volSymmTensorField>
|
|
||||||
// (
|
|
||||||
// new volSymmTensorField
|
|
||||||
// (
|
|
||||||
// IOobject
|
|
||||||
// (
|
|
||||||
// "K",
|
|
||||||
// mesh_.time().timeName(),
|
|
||||||
// mesh_,
|
|
||||||
// IOobject::NO_READ,
|
|
||||||
// IOobject::NO_WRITE
|
|
||||||
// ),
|
|
||||||
// mesh_,
|
|
||||||
// constK_
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
//}
|
|
||||||
Foam::tmp<Foam::volSymmTensorField> Foam::constSolidThermo::directionalK() const
|
|
||||||
{
|
{
|
||||||
dimensionedSymmTensor t
|
dimensionedSymmTensor t
|
||||||
(
|
(
|
||||||
@ -233,27 +171,6 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::Hf() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::emissivity() const
|
|
||||||
{
|
|
||||||
return tmp<volScalarField>
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"emissivity",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
constEmissivity_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::rho
|
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::rho
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
@ -270,7 +187,7 @@ Foam::tmp<Foam::scalarField> Foam::constSolidThermo::rho
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::cp
|
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::Cp
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
) const
|
) const
|
||||||
@ -359,6 +276,38 @@ Foam::tmp<Foam::scalarField> Foam::constSolidThermo::emissivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::kappa
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI].size(),
|
||||||
|
constKappa_.value()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::sigmaS
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI].size(),
|
||||||
|
constSigmaS_.value()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::constSolidThermo::read()
|
bool Foam::constSolidThermo::read()
|
||||||
{
|
{
|
||||||
return read(subDict(typeName + "Coeffs"));
|
return read(subDict(typeName + "Coeffs"));
|
||||||
@ -368,17 +317,21 @@ bool Foam::constSolidThermo::read()
|
|||||||
bool Foam::constSolidThermo::read(const dictionary& dict)
|
bool Foam::constSolidThermo::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
constRho_ = dimensionedScalar(dict.lookup("rho"));
|
constRho_ = dimensionedScalar(dict.lookup("rho"));
|
||||||
constCp_ = dimensionedScalar(dict.lookup("cp"));
|
constCp_ = dimensionedScalar(dict.lookup("Cp"));
|
||||||
constK_ = dimensionedScalar(dict.lookup("K"));
|
constK_ = dimensionedScalar(dict.lookup("K"));
|
||||||
constHf_ = dimensionedScalar(dict.lookup("Hf"));
|
constHf_ = dimensionedScalar(dict.lookup("Hf"));
|
||||||
constEmissivity_ = dimensionedScalar(dict.lookup("emissivity"));
|
constEmissivity_ = dimensionedScalar(dict.lookup("emissivity"));
|
||||||
|
constKappa_ = dimensionedScalar(dict_.lookup("kappa"));
|
||||||
|
constSigmaS_ = dimensionedScalar(dict_.lookup("sigmaS"));
|
||||||
|
|
||||||
Info<< "Constructed constSolidThermo with" << nl
|
Info<< "Constructed constSolidThermo with" << nl
|
||||||
<< " rho : " << constRho_ << nl
|
<< " rho : " << constRho_ << nl
|
||||||
<< " cp : " << constCp_ << nl
|
<< " Cp : " << constCp_ << nl
|
||||||
<< " K : " << constK_ << nl
|
<< " K : " << constK_ << nl
|
||||||
<< " Hf : " << constHf_ << nl
|
<< " Hf : " << constHf_ << nl
|
||||||
<< " emissivity : " << constEmissivity_ << nl
|
<< " emissivity : " << constEmissivity_ << nl
|
||||||
|
<< " kappa : " << constKappa_ << nl
|
||||||
|
<< " sigmaS : " << constSigmaS_ << nl
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -389,9 +342,11 @@ bool Foam::constSolidThermo::writeData(Ostream& os) const
|
|||||||
{
|
{
|
||||||
bool ok = basicSolidThermo::writeData(os);
|
bool ok = basicSolidThermo::writeData(os);
|
||||||
os.writeKeyword("rho") << constRho_ << token::END_STATEMENT << nl;
|
os.writeKeyword("rho") << constRho_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("cp") << constCp_ << token::END_STATEMENT << nl;
|
os.writeKeyword("Cp") << constCp_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("K") << constK_ << token::END_STATEMENT << nl;
|
os.writeKeyword("K") << constK_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("Hf") << constHf_ << token::END_STATEMENT << nl;
|
os.writeKeyword("Hf") << constHf_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("kappa") << constKappa_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("sigmaS") << constSigmaS_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("emissivity") << constEmissivity_ << token::END_STATEMENT
|
os.writeKeyword("emissivity") << constEmissivity_ << token::END_STATEMENT
|
||||||
<< nl;
|
<< nl;
|
||||||
return ok && os.good();
|
return ok && os.good();
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -50,22 +50,38 @@ class constSolidThermo
|
|||||||
:
|
:
|
||||||
public basicSolidThermo
|
public basicSolidThermo
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Dictionary
|
||||||
|
dictionary dict_;
|
||||||
|
|
||||||
|
//- Constant thermal conductivity [W/(m.K)]
|
||||||
|
dimensionedScalar constK_;
|
||||||
|
|
||||||
|
//- Thermal conductivity field[W/(m.K)]
|
||||||
|
volScalarField K_;
|
||||||
|
|
||||||
//- Density [kg/m3]
|
//- Density [kg/m3]
|
||||||
dimensionedScalar constRho_;
|
dimensionedScalar constRho_;
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
dimensionedScalar constCp_;
|
dimensionedScalar constCp_;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
//dimensionedSymmTensor constK_;
|
|
||||||
dimensionedScalar constK_;
|
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
//- Heat of formation [J/kg]
|
||||||
dimensionedScalar constHf_;
|
dimensionedScalar constHf_;
|
||||||
|
|
||||||
//- Emissivity
|
//- Emissivity
|
||||||
dimensionedScalar constEmissivity_;
|
dimensionedScalar constEmissivity_;
|
||||||
|
|
||||||
|
//- Absorptivity [1/m]
|
||||||
|
dimensionedScalar constKappa_;
|
||||||
|
|
||||||
|
//- Scatter [1/m]
|
||||||
|
dimensionedScalar constSigmaS_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -77,9 +93,8 @@ public:
|
|||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
constSolidThermo(const fvMesh& mesh);
|
constSolidThermo(const fvMesh& mesh);
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
virtual ~constSolidThermo();
|
||||||
virtual ~constSolidThermo();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -87,24 +102,23 @@ public:
|
|||||||
//- Update properties
|
//- Update properties
|
||||||
virtual void correct();
|
virtual void correct();
|
||||||
|
|
||||||
//- Density [kg/m3]
|
|
||||||
virtual tmp<volScalarField> rho() const;
|
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
// Acces functions
|
||||||
virtual tmp<volScalarField> cp() const;
|
|
||||||
|
//- Constant access to K
|
||||||
|
virtual const volScalarField& K() const;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Thermal conductivity [W/(m.K)]
|
||||||
// Note: needs supplied K to be isotropic
|
virtual const volSymmTensorField& directionalK() const;
|
||||||
virtual tmp<volScalarField> K() const;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
virtual tmp<volSymmTensorField> directionalK() const;
|
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
// Derived properties
|
||||||
virtual tmp<volScalarField> Hf() const;
|
|
||||||
|
|
||||||
//- Emissivity []
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
virtual tmp<volScalarField> emissivity() const;
|
virtual tmp<volScalarField> Cp() const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
virtual tmp<volScalarField> Hf() const;
|
||||||
|
|
||||||
|
|
||||||
// Per patch calculation
|
// Per patch calculation
|
||||||
@ -112,19 +126,25 @@ public:
|
|||||||
//- Density [kg/m3]
|
//- Density [kg/m3]
|
||||||
virtual tmp<scalarField> rho(const label patchI) const;
|
virtual tmp<scalarField> rho(const label patchI) const;
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
//- Specific heat capacity [J/kg/K)]
|
||||||
virtual tmp<scalarField> cp(const label patchI) const;
|
virtual tmp<scalarField> Cp(const label patchI) const;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Thermal conductivity [W//m/K]
|
||||||
virtual tmp<scalarField> K(const label patchI) const;
|
virtual tmp<scalarField> K(const label patchI) const;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Thermal conductivity [W//m/K]
|
||||||
virtual tmp<symmTensorField> directionalK(const label patchI) const;
|
virtual tmp<symmTensorField>directionalK(const label) const;
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
//- Heat of formation [J/kg]
|
||||||
virtual tmp<scalarField> Hf(const label patchI) const;
|
virtual tmp<scalarField> Hf(const label patchI) const;
|
||||||
|
|
||||||
//- Emissivity []
|
//- Scatter coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> sigmaS(const label) const;
|
||||||
|
|
||||||
|
//- Absorption coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> kappa(const label) const;
|
||||||
|
|
||||||
|
//- Emissivity []
|
||||||
virtual tmp<scalarField> emissivity(const label) const;
|
virtual tmp<scalarField> emissivity(const label) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,493 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "directionalKSolidThermo.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "transform.H"
|
||||||
|
#include "transformField.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(directionalKSolidThermo, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
directionalKSolidThermo,
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::directionalKSolidThermo::directionalKSolidThermo(const fvMesh& mesh)
|
||||||
|
:
|
||||||
|
interpolatedSolidThermo(mesh, typeName + "Coeffs"),
|
||||||
|
directionalK_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimEnergy/dimTime/(dimLength*dimTemperature)
|
||||||
|
),
|
||||||
|
ccTransforms_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"ccTransforms",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimLength
|
||||||
|
)
|
||||||
|
{
|
||||||
|
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues"));
|
||||||
|
|
||||||
|
// Determine transforms for cell centres
|
||||||
|
forAll(mesh.C(), cellI)
|
||||||
|
{
|
||||||
|
vector dir = mesh.C()[cellI] - coordSys_.origin();
|
||||||
|
dir /= mag(dir);
|
||||||
|
|
||||||
|
// Define local coordinate system with
|
||||||
|
// - e1 : axis from cc to centre
|
||||||
|
// - e3 : rotation axis
|
||||||
|
coordinateSystem cs
|
||||||
|
(
|
||||||
|
"cc",
|
||||||
|
coordSys_.origin(),
|
||||||
|
coordSys_.e3(), //z',e3
|
||||||
|
dir //x',e1
|
||||||
|
);
|
||||||
|
|
||||||
|
ccTransforms_[cellI] = cs.R();
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(mesh.C().boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvPatchVectorField& patchC = mesh.C().boundaryField()[patchI];
|
||||||
|
fvPatchTensorField& patchT = ccTransforms_.boundaryField()[patchI];
|
||||||
|
|
||||||
|
tensorField tc(patchT.size());
|
||||||
|
forAll(tc, i)
|
||||||
|
{
|
||||||
|
vector dir = patchC[i] - coordSys_.origin();
|
||||||
|
dir /= mag(dir);
|
||||||
|
|
||||||
|
coordinateSystem cs
|
||||||
|
(
|
||||||
|
"cc",
|
||||||
|
coordSys_.origin(),
|
||||||
|
coordSys_.e3(), //z',e3
|
||||||
|
dir //x',e1
|
||||||
|
);
|
||||||
|
|
||||||
|
tc[i] = cs.R();
|
||||||
|
}
|
||||||
|
patchT = tc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "directionalKSolidThermo : dumping converted Kxx, Kyy, Kzz"
|
||||||
|
<< endl;
|
||||||
|
{
|
||||||
|
volVectorField Kxx
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Kxx",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless
|
||||||
|
);
|
||||||
|
Kxx.internalField() = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField(),
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField().size(),
|
||||||
|
point(1, 0, 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
forAll(Kxx.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
Kxx.boundaryField()[patchI] = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI],
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI].size(),
|
||||||
|
point(1, 0, 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Kxx.write();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
volVectorField Kyy
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Kyy",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless
|
||||||
|
);
|
||||||
|
Kyy.internalField() = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField(),
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField().size(),
|
||||||
|
point(0, 1, 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
forAll(Kyy.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
Kyy.boundaryField()[patchI] = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI],
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI].size(),
|
||||||
|
point(0, 1, 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Kyy.write();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
volVectorField Kzz
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Kzz",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimless
|
||||||
|
);
|
||||||
|
Kzz.internalField() = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField(),
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.internalField().size(),
|
||||||
|
point(0, 0, 1)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
forAll(Kzz.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
Kzz.boundaryField()[patchI] = transform
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI],
|
||||||
|
vectorField
|
||||||
|
(
|
||||||
|
ccTransforms_.boundaryField()[patchI].size(),
|
||||||
|
point(0, 0, 1)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Kzz.write();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
correct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::directionalKSolidThermo::~directionalKSolidThermo()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::symmTensor Foam::directionalKSolidThermo::transformPrincipal
|
||||||
|
(
|
||||||
|
const tensor& tt,
|
||||||
|
const vector& st
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return symmTensor
|
||||||
|
(
|
||||||
|
tt.xx()*st.x()*tt.xx()
|
||||||
|
+ tt.xy()*st.y()*tt.xy()
|
||||||
|
+ tt.xz()*st.z()*tt.xz(),
|
||||||
|
|
||||||
|
tt.xx()*st.x()*tt.yx()
|
||||||
|
+ tt.xy()*st.y()*tt.yy()
|
||||||
|
+ tt.xz()*st.z()*tt.yz(),
|
||||||
|
|
||||||
|
tt.xx()*st.x()*tt.zx()
|
||||||
|
+ tt.xy()*st.y()*tt.zy()
|
||||||
|
+ tt.xz()*st.z()*tt.zz(),
|
||||||
|
|
||||||
|
tt.yx()*st.x()*tt.yx()
|
||||||
|
+ tt.yy()*st.y()*tt.yy()
|
||||||
|
+ tt.yz()*st.z()*tt.yz(),
|
||||||
|
|
||||||
|
tt.yx()*st.x()*tt.zx()
|
||||||
|
+ tt.yy()*st.y()*tt.zy()
|
||||||
|
+ tt.yz()*st.z()*tt.zz(),
|
||||||
|
|
||||||
|
tt.zx()*st.x()*tt.zx()
|
||||||
|
+ tt.zy()*st.y()*tt.zy()
|
||||||
|
+ tt.zz()*st.z()*tt.zz()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::directionalKSolidThermo::transformField
|
||||||
|
(
|
||||||
|
symmTensorField& fld,
|
||||||
|
const tensorField& tt,
|
||||||
|
const vectorField& st
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
fld.setSize(tt.size());
|
||||||
|
forAll(fld, i)
|
||||||
|
{
|
||||||
|
fld[i] = transformPrincipal(tt[i], st[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::directionalKSolidThermo::correct()
|
||||||
|
{
|
||||||
|
calculate();
|
||||||
|
interpolatedSolidThermo::calculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volSymmTensorField& Foam::directionalKSolidThermo::
|
||||||
|
directionalK() const
|
||||||
|
{
|
||||||
|
return directionalK_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::directionalKSolidThermo::calculate()
|
||||||
|
{
|
||||||
|
// Correct directionalK
|
||||||
|
Field<vector> localK
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
KValues_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Transform into global coordinate system
|
||||||
|
transformField
|
||||||
|
(
|
||||||
|
directionalK_.internalField(),
|
||||||
|
ccTransforms_.internalField(),
|
||||||
|
localK
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(directionalK_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
directionalK_.boundaryField()[patchI] == this->directionalK(patchI)();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::volScalarField& Foam::directionalKSolidThermo::K() const
|
||||||
|
{
|
||||||
|
forAll(KValues_, i)
|
||||||
|
{
|
||||||
|
const vector& v = KValues_[i];
|
||||||
|
if
|
||||||
|
(
|
||||||
|
v.x() != v.y()
|
||||||
|
|| v.x() != v.z()
|
||||||
|
|| v.y() != v.z()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn("directionalKSolidThermo::K() const")
|
||||||
|
<< "Supplied K values " << KValues_
|
||||||
|
<< " are not isotropic." << exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get temperature interpolated properties (principal directions)
|
||||||
|
Field<vector> localK
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
KValues_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
tmp<volScalarField> tK
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimEnergy/dimTime/(dimLength*dimTemperature)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
volScalarField& K = tK();
|
||||||
|
|
||||||
|
K.internalField() = interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
KValues_.component(0)()
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(K.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
K.boundaryField()[patchI] == this->K(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
return tK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::directionalKSolidThermo::K
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
forAll(KValues_, i)
|
||||||
|
{
|
||||||
|
const vector& v = KValues_[i];
|
||||||
|
if
|
||||||
|
(
|
||||||
|
v.x() != v.y()
|
||||||
|
|| v.x() != v.z()
|
||||||
|
|| v.y() != v.z()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalErrorIn("directionalKSolidThermo::K() const")
|
||||||
|
<< "Supplied K values " << KValues_
|
||||||
|
<< " are not isotropic." << exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI],
|
||||||
|
TValues_,
|
||||||
|
KValues_.component(0)()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::symmTensorField> Foam::directionalKSolidThermo::directionalK
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const fvPatchScalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
|
||||||
|
Field<vector> localK(interpolateXY(patchT, TValues_, KValues_));
|
||||||
|
|
||||||
|
tmp<symmTensorField> tglobalK(new symmTensorField(localK.size()));
|
||||||
|
transformField(tglobalK(), ccTransforms_.boundaryField()[patchI], localK);
|
||||||
|
|
||||||
|
return tglobalK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::directionalKSolidThermo::read()
|
||||||
|
{
|
||||||
|
return read(subDict(typeName + "Coeffs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::directionalKSolidThermo::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
coordSys_ = coordinateSystem(dict, mesh_);
|
||||||
|
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::directionalKSolidThermo::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
bool ok = interpolatedSolidThermo::writeData(os);
|
||||||
|
os.writeKeyword("KValues") << KValues_ << token::END_STATEMENT << nl;
|
||||||
|
return ok && os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const directionalKSolidThermo& s)
|
||||||
|
{
|
||||||
|
s.writeData(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,158 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::directionalKSolidThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Directional conductivity + table interpolation.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
directionalKSolidThermo.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef directionalKSolidThermo_H
|
||||||
|
#define directionalKSolidThermo_H
|
||||||
|
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
#include "interpolatedSolidThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class directionalKSolidThermo Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class directionalKSolidThermo
|
||||||
|
:
|
||||||
|
public interpolatedSolidThermo
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
volSymmTensorField directionalK_;
|
||||||
|
|
||||||
|
//- Thermal conductivity vector
|
||||||
|
Field<vector> KValues_;
|
||||||
|
|
||||||
|
//- Coordinate system used for the directional properties
|
||||||
|
coordinateSystem coordSys_;
|
||||||
|
|
||||||
|
//- Transformation for cell centres
|
||||||
|
volTensorField ccTransforms_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Transform principal values of symmTensor
|
||||||
|
symmTensor transformPrincipal
|
||||||
|
(
|
||||||
|
const tensor& tt,
|
||||||
|
const vector& st
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Transform principal values of symmTensor
|
||||||
|
void transformField
|
||||||
|
(
|
||||||
|
symmTensorField& fld,
|
||||||
|
const tensorField& tt,
|
||||||
|
const vectorField& st
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Calculate properties
|
||||||
|
void calculate();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("directionalKSolidThermo");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
directionalKSolidThermo(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
virtual ~directionalKSolidThermo();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Update properties
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
|
//- Access functions
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
virtual const volSymmTensorField& directionalK() const;
|
||||||
|
|
||||||
|
//- Iostropic thermal conductivity [W/(m.K)]
|
||||||
|
virtual const volScalarField& K() const;
|
||||||
|
|
||||||
|
// Per patch calculation
|
||||||
|
|
||||||
|
//- Thermal conductivity [W//m/K]
|
||||||
|
virtual tmp<scalarField> K(const label patchI) const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W//m/K]
|
||||||
|
virtual tmp<symmTensorField> directionalK(const label) const;
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the directionalKSolidThermo properties
|
||||||
|
virtual bool writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
//- Read the directionalKSolidThermo properties
|
||||||
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Read the directionalKSolidThermo properties
|
||||||
|
bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const directionalKSolidThermo& s
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "interpolateSolid.H"
|
||||||
|
#include "interpolateXY.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::interpolateSolid::interpolateSolid(const dictionary& dict)
|
||||||
|
{
|
||||||
|
|
||||||
|
read(dict);
|
||||||
|
|
||||||
|
Info<< "Constructed directionalKSolidThermo with samples" << nl
|
||||||
|
<< " T : " << TValues_ << nl
|
||||||
|
<< " rho : " << rhoValues_ << nl
|
||||||
|
<< " cp : " << cpValues_ << nl
|
||||||
|
<< " Hf : " << HfValues_ << nl
|
||||||
|
<< " emissivity : " << emissivityValues_ << nl
|
||||||
|
<< " kappa : " << kappaValues_ << nl
|
||||||
|
<< " sigmaS : " << sigmaSValues_ << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(TValues_.size() != rhoValues_.size())
|
||||||
|
&& (TValues_.size() != cpValues_.size())
|
||||||
|
&& (TValues_.size() != rhoValues_.size())
|
||||||
|
&& (TValues_.size() != HfValues_.size())
|
||||||
|
&& (TValues_.size() != emissivityValues_.size())
|
||||||
|
)
|
||||||
|
{
|
||||||
|
FatalIOErrorIn("interpolateSolid::read()", dict)
|
||||||
|
<< "Size of property tables should be equal to size of Temperature"
|
||||||
|
<< " values " << TValues_.size()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (label i = 1; i < TValues_.size(); i++)
|
||||||
|
{
|
||||||
|
if (TValues_[i] <= TValues_[i-1])
|
||||||
|
{
|
||||||
|
FatalIOErrorIn("interpolateSolid::read()", dict)
|
||||||
|
<< "Temperature values are not in increasing order "
|
||||||
|
<< TValues_ << exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::interpolateSolid::~interpolateSolid()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::interpolateSolid::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
|
||||||
|
os.writeKeyword("TValues") << TValues_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("rhoValues") << rhoValues_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("cpValues") << cpValues_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("emissivityValues") << emissivityValues_ << nl;
|
||||||
|
os.writeKeyword("kappaValues") << kappaValues_ << nl;
|
||||||
|
os.writeKeyword("sigmaSValues") << sigmaSValues_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
return os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::interpolateSolid::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
TValues_ = Field<scalar>(dict.lookup("TValues"));
|
||||||
|
rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
|
||||||
|
cpValues_ = Field<scalar>(dict.lookup("cpValues"));
|
||||||
|
kappaValues_ = Field<scalar>(dict.lookup("kappaValues"));
|
||||||
|
sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues"));
|
||||||
|
HfValues_ = Field<scalar>(dict.lookup("HfValues"));
|
||||||
|
emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues"));
|
||||||
|
sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::interpolateSolid
|
||||||
|
|
||||||
|
Description
|
||||||
|
Helping class for T-interpolated solid thermo.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
interpolateSolid.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef interpolateSolid_H
|
||||||
|
#define interpolateSolid_H
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "interpolateXY.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class interpolateSolid Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class interpolateSolid
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
Field<scalar> TValues_;
|
||||||
|
|
||||||
|
Field<scalar> rhoValues_;
|
||||||
|
|
||||||
|
Field<scalar> cpValues_;
|
||||||
|
|
||||||
|
Field<scalar> HfValues_;
|
||||||
|
|
||||||
|
Field<scalar> emissivityValues_;
|
||||||
|
|
||||||
|
Field<scalar> kappaValues_;
|
||||||
|
|
||||||
|
Field<scalar> sigmaSValues_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
interpolateSolid(const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
|
||||||
|
virtual ~interpolateSolid();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Read the interpolateSolid properties
|
||||||
|
bool read(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Write the interpolateSolid properties
|
||||||
|
bool writeData(Ostream& os) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,28 +27,20 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "interpolateXY.H"
|
#include "interpolateXY.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
defineTypeNameAndDebug(interpolatedSolidThermo, 0);
|
|
||||||
addToRunTimeSelectionTable
|
|
||||||
(
|
|
||||||
basicSolidThermo,
|
|
||||||
interpolatedSolidThermo,
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::interpolatedSolidThermo::interpolatedSolidThermo(const fvMesh& mesh)
|
Foam::interpolatedSolidThermo::interpolatedSolidThermo
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const word dictName
|
||||||
|
)
|
||||||
:
|
:
|
||||||
basicSolidThermo(mesh)
|
basicSolidThermo(mesh),
|
||||||
|
interpolateSolid(subDict(dictName)),
|
||||||
|
dict_(subDict(dictName))
|
||||||
{
|
{
|
||||||
read();
|
calculate();
|
||||||
correct();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -60,55 +52,73 @@ Foam::interpolatedSolidThermo::~interpolatedSolidThermo()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::interpolatedSolidThermo::correct()
|
void Foam::interpolatedSolidThermo::calculate()
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::rho() const
|
|
||||||
{
|
{
|
||||||
tmp<volScalarField> trho
|
// Correct rho
|
||||||
(
|
rho_.internalField() = interpolateXY
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimDensity
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField& rho = trho();
|
|
||||||
|
|
||||||
rho.internalField() = interpolateXY
|
|
||||||
(
|
(
|
||||||
T_.internalField(),
|
T_.internalField(),
|
||||||
TValues_,
|
TValues_,
|
||||||
rhoValues_
|
rhoValues_
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(rho.boundaryField(), patchI)
|
forAll(rho_.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
rho.boundaryField()[patchI] == this->rho(patchI)();
|
rho_.boundaryField()[patchI] == this->rho(patchI)();
|
||||||
}
|
}
|
||||||
|
|
||||||
return trho;
|
// Correct emissivity
|
||||||
|
emissivity_.internalField() = interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
emissivityValues_
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(emissivity_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
emissivity_.boundaryField()[patchI] == this->emissivity(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Correct absorptivity
|
||||||
|
kappa_.internalField() = interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
kappaValues_
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(kappa_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
kappa_.boundaryField()[patchI] == this->kappa(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Correct scatter
|
||||||
|
sigmaS_.internalField() = interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
sigmaSValues_
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(sigmaS_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
sigmaS_.boundaryField()[patchI] == this->sigmaS(patchI)();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::cp() const
|
Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::Cp() const
|
||||||
{
|
{
|
||||||
tmp<volScalarField> tcp
|
tmp<volScalarField> tCp
|
||||||
(
|
(
|
||||||
new volScalarField
|
new volScalarField
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"cp",
|
"Cp",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -118,107 +128,21 @@ Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::cp() const
|
|||||||
dimEnergy/(dimMass*dimTemperature)
|
dimEnergy/(dimMass*dimTemperature)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
volScalarField& cp = tcp();
|
volScalarField& Cp = tCp();
|
||||||
|
|
||||||
cp.internalField() = interpolateXY
|
Cp.internalField() = interpolateXY
|
||||||
(
|
(
|
||||||
T_.internalField(),
|
T_.internalField(),
|
||||||
TValues_,
|
TValues_,
|
||||||
cpValues_
|
cpValues_
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(cp.boundaryField(), patchI)
|
forAll(Cp.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
cp.boundaryField()[patchI] == this->cp(patchI)();
|
Cp.boundaryField()[patchI] == this->Cp(patchI)();
|
||||||
}
|
}
|
||||||
|
|
||||||
return tcp;
|
return tCp;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::K() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> tK
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"K",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimEnergy/dimTime/(dimLength*dimTemperature)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField& K = tK();
|
|
||||||
|
|
||||||
K.internalField() = interpolateXY
|
|
||||||
(
|
|
||||||
T_.internalField(),
|
|
||||||
TValues_,
|
|
||||||
KValues_
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(K.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
K.boundaryField()[patchI] == this->K(patchI)();
|
|
||||||
}
|
|
||||||
|
|
||||||
return tK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volSymmTensorField>
|
|
||||||
Foam::interpolatedSolidThermo::directionalK()
|
|
||||||
const
|
|
||||||
{
|
|
||||||
tmp<volSymmTensorField> tK
|
|
||||||
(
|
|
||||||
new volSymmTensorField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"K",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimensionedSymmTensor
|
|
||||||
(
|
|
||||||
"zero",
|
|
||||||
dimEnergy/dimTime/(dimLength*dimTemperature),
|
|
||||||
symmTensor::zero
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volSymmTensorField& K = tK();
|
|
||||||
|
|
||||||
Field<scalar> scalarK
|
|
||||||
(
|
|
||||||
interpolateXY
|
|
||||||
(
|
|
||||||
T_.internalField(),
|
|
||||||
TValues_,
|
|
||||||
KValues_
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
K.internalField().replace(symmTensor::XX, scalarK);
|
|
||||||
K.internalField().replace(symmTensor::YY, scalarK);
|
|
||||||
K.internalField().replace(symmTensor::ZZ, scalarK);
|
|
||||||
|
|
||||||
forAll(K.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
K.boundaryField()[patchI] == this->directionalK(patchI)();
|
|
||||||
}
|
|
||||||
|
|
||||||
return tK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -258,43 +182,6 @@ Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::Hf() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::volScalarField>
|
|
||||||
Foam::interpolatedSolidThermo::emissivity() const
|
|
||||||
{
|
|
||||||
tmp<volScalarField> temissivity
|
|
||||||
(
|
|
||||||
new volScalarField
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"emissivity",
|
|
||||||
mesh_.time().timeName(),
|
|
||||||
mesh_,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
mesh_,
|
|
||||||
dimless
|
|
||||||
)
|
|
||||||
);
|
|
||||||
volScalarField& emissivity = temissivity();
|
|
||||||
|
|
||||||
emissivity.internalField() = interpolateXY
|
|
||||||
(
|
|
||||||
T_.internalField(),
|
|
||||||
TValues_,
|
|
||||||
emissivityValues_
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(emissivity.boundaryField(), patchI)
|
|
||||||
{
|
|
||||||
emissivity.boundaryField()[patchI] == this->emissivity(patchI)();
|
|
||||||
}
|
|
||||||
|
|
||||||
return temissivity;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::rho
|
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::rho
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
@ -315,7 +202,7 @@ Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::rho
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::cp
|
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::Cp
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
) const
|
) const
|
||||||
@ -335,53 +222,6 @@ Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::cp
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::K
|
|
||||||
(
|
|
||||||
const label patchI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<scalarField>
|
|
||||||
(
|
|
||||||
new scalarField
|
|
||||||
(
|
|
||||||
interpolateXY
|
|
||||||
(
|
|
||||||
T_.boundaryField()[patchI],
|
|
||||||
TValues_,
|
|
||||||
KValues_
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::symmTensorField> Foam::interpolatedSolidThermo::directionalK
|
|
||||||
(
|
|
||||||
const label patchI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
const fvPatchScalarField& patchT = T_.boundaryField()[patchI];
|
|
||||||
|
|
||||||
Field<scalar> scalarK(interpolateXY(patchT, TValues_, KValues_));
|
|
||||||
|
|
||||||
tmp<symmTensorField> tfld
|
|
||||||
(
|
|
||||||
new symmTensorField
|
|
||||||
(
|
|
||||||
scalarK.size(),
|
|
||||||
symmTensor::zero
|
|
||||||
)
|
|
||||||
);
|
|
||||||
symmTensorField& fld = tfld();
|
|
||||||
|
|
||||||
fld.replace(symmTensor::XX, scalarK);
|
|
||||||
fld.replace(symmTensor::YY, scalarK);
|
|
||||||
fld.replace(symmTensor::ZZ, scalarK);
|
|
||||||
|
|
||||||
return tfld;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::Hf
|
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::Hf
|
||||||
(
|
(
|
||||||
const label patchI
|
const label patchI
|
||||||
@ -422,69 +262,63 @@ Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::emissivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::kappa
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI],
|
||||||
|
TValues_,
|
||||||
|
kappaValues_
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::sigmaS
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI],
|
||||||
|
TValues_,
|
||||||
|
sigmaSValues_
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::interpolatedSolidThermo::read()
|
bool Foam::interpolatedSolidThermo::read()
|
||||||
{
|
{
|
||||||
return read(subDict(typeName + "Coeffs"));
|
return read(dict_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::interpolatedSolidThermo::read(const dictionary& dict)
|
bool Foam::interpolatedSolidThermo::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
TValues_ = Field<scalar>(dict.lookup("TValues"));
|
bool ok = interpolateSolid::read(dict);
|
||||||
rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
|
return ok;
|
||||||
cpValues_ = Field<scalar>(dict.lookup("cpValues"));
|
|
||||||
KValues_ = Field<scalar>(dict.lookup("KValues"));
|
|
||||||
HfValues_ = Field<scalar>(dict.lookup("HfValues"));
|
|
||||||
emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues"));
|
|
||||||
|
|
||||||
Info<< "Constructed interpolatedSolidThermo with samples" << nl
|
|
||||||
<< " T : " << TValues_ << nl
|
|
||||||
<< " rho : " << rhoValues_ << nl
|
|
||||||
<< " cp : " << cpValues_ << nl
|
|
||||||
<< " K : " << KValues_ << nl
|
|
||||||
<< " Hf : " << HfValues_ << nl
|
|
||||||
<< " emissivity : " << emissivityValues_ << nl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
(TValues_.size() != rhoValues_.size())
|
|
||||||
&& (TValues_.size() != cpValues_.size())
|
|
||||||
&& (TValues_.size() != rhoValues_.size())
|
|
||||||
&& (TValues_.size() != KValues_.size())
|
|
||||||
&& (TValues_.size() != HfValues_.size())
|
|
||||||
&& (TValues_.size() != emissivityValues_.size())
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalIOErrorIn("interpolatedSolidThermo::read()", dict)
|
|
||||||
<< "Size of property tables should be equal to size of Temperature"
|
|
||||||
<< " values " << TValues_.size()
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (label i = 1; i < TValues_.size(); i++)
|
|
||||||
{
|
|
||||||
if (TValues_[i] <= TValues_[i-1])
|
|
||||||
{
|
|
||||||
FatalIOErrorIn("interpolatedSolidThermo::read()", dict)
|
|
||||||
<< "Temperature values are not in increasing order "
|
|
||||||
<< TValues_ << exit(FatalIOError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::interpolatedSolidThermo::writeData(Ostream& os) const
|
bool Foam::interpolatedSolidThermo::writeData(Ostream& os) const
|
||||||
{
|
{
|
||||||
bool ok = basicSolidThermo::writeData(os);
|
bool ok = basicSolidThermo::writeData(os);
|
||||||
os.writeKeyword("TValues") << TValues_ << token::END_STATEMENT << nl;
|
ok = interpolateSolid::writeData(os);
|
||||||
os.writeKeyword("rhoValues") << rhoValues_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("cpValues") << cpValues_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("KValues") << KValues_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("emissivityValues") << emissivityValues_
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
|
|
||||||
return ok && os.good();
|
return ok && os.good();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,7 +25,7 @@ Class
|
|||||||
Foam::interpolatedSolidThermo
|
Foam::interpolatedSolidThermo
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Table interpolated solid thermo.
|
Table interpolated solid thermo
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
interpolatedSolidThermo.C
|
interpolatedSolidThermo.C
|
||||||
@ -36,6 +36,7 @@ SourceFiles
|
|||||||
#define interpolatedSolidThermo_H
|
#define interpolatedSolidThermo_H
|
||||||
|
|
||||||
#include "basicSolidThermo.H"
|
#include "basicSolidThermo.H"
|
||||||
|
#include "interpolateSolid.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -43,67 +44,47 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class interpolatedSolidThermo Declaration
|
Class interpolatedSolidThermo Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class interpolatedSolidThermo
|
class interpolatedSolidThermo
|
||||||
:
|
:
|
||||||
public basicSolidThermo
|
public basicSolidThermo,
|
||||||
|
public interpolateSolid
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Temperature samples
|
//- Dictionary
|
||||||
Field<scalar> TValues_;
|
const dictionary dict_;
|
||||||
|
|
||||||
//- Density at given temperatures
|
|
||||||
Field<scalar> rhoValues_;
|
|
||||||
|
|
||||||
Field<scalar> cpValues_;
|
|
||||||
|
|
||||||
Field<scalar> KValues_;
|
|
||||||
|
|
||||||
Field<scalar> HfValues_;
|
|
||||||
|
|
||||||
Field<scalar> emissivityValues_;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("interpolatedSolidThermo");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from mesh
|
//- Construct from mesh
|
||||||
interpolatedSolidThermo(const fvMesh& mesh);
|
interpolatedSolidThermo(const fvMesh& mesh, const word);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~interpolatedSolidThermo();
|
//- Destructor
|
||||||
|
virtual ~interpolatedSolidThermo();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Update properties
|
//- Calculate properties
|
||||||
virtual void correct();
|
void calculate();
|
||||||
|
|
||||||
//- Density [kg/m3]
|
|
||||||
virtual tmp<volScalarField> rho() const;
|
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
// Derived properties
|
||||||
virtual tmp<volScalarField> cp() const;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
virtual tmp<volScalarField> K() const;
|
virtual tmp<volScalarField> Cp() const;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
//- Heat of formation [J/kg]
|
||||||
virtual tmp<volSymmTensorField> directionalK() const;
|
virtual tmp<volScalarField> Hf() const;
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
|
||||||
virtual tmp<volScalarField> Hf() const;
|
|
||||||
|
|
||||||
//- Emissivity []
|
|
||||||
virtual tmp<volScalarField> emissivity() const;
|
|
||||||
|
|
||||||
|
|
||||||
// Per patch calculation
|
// Per patch calculation
|
||||||
@ -111,20 +92,19 @@ public:
|
|||||||
//- Density [kg/m3]
|
//- Density [kg/m3]
|
||||||
virtual tmp<scalarField> rho(const label patchI) const;
|
virtual tmp<scalarField> rho(const label patchI) const;
|
||||||
|
|
||||||
//- Specific heat capacity [J/(kg.K)]
|
//- Specific heat capacity [J/kg/K)]
|
||||||
virtual tmp<scalarField> cp(const label patchI) const;
|
virtual tmp<scalarField> Cp(const label patchI) const;
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
// Note: needs Kvalues to be isotropic
|
|
||||||
virtual tmp<scalarField> K(const label patchI) const;
|
|
||||||
|
|
||||||
//- Thermal conductivity [W/(m.K)]
|
|
||||||
virtual tmp<symmTensorField> directionalK(const label patchI) const;
|
|
||||||
|
|
||||||
//- Heat of formation [J/kg]
|
//- Heat of formation [J/kg]
|
||||||
virtual tmp<scalarField> Hf(const label patchI) const;
|
virtual tmp<scalarField> Hf(const label patchI) const;
|
||||||
|
|
||||||
//- Emissivity []
|
//- Scatter coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> sigmaS(const label) const;
|
||||||
|
|
||||||
|
//- Absorption coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> kappa(const label) const;
|
||||||
|
|
||||||
|
//- Emissivity []
|
||||||
virtual tmp<scalarField> emissivity(const label) const;
|
virtual tmp<scalarField> emissivity(const label) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,129 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "isotropicKSolidThermo.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(isotropicKSolidThermo, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
isotropicKSolidThermo,
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::isotropicKSolidThermo::isotropicKSolidThermo(const fvMesh& mesh)
|
||||||
|
:
|
||||||
|
interpolatedSolidThermo(mesh, typeName + "Coeffs"),
|
||||||
|
K_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimEnergy/dimTime/(dimLength*dimTemperature)
|
||||||
|
),
|
||||||
|
KValues_ (Field<scalar>(subDict(typeName + "Coeffs").lookup("KValues")))
|
||||||
|
{
|
||||||
|
correct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::isotropicKSolidThermo::correct()
|
||||||
|
{
|
||||||
|
|
||||||
|
// Correct K
|
||||||
|
K_.internalField() = interpolateXY
|
||||||
|
(
|
||||||
|
T_.internalField(),
|
||||||
|
TValues_,
|
||||||
|
KValues_
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(K_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
K_.boundaryField()[patchI] == this->K(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolatedSolidThermo::calculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::scalarField> Foam::isotropicKSolidThermo::K
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
|
||||||
|
return tmp<scalarField>
|
||||||
|
(
|
||||||
|
new scalarField
|
||||||
|
(
|
||||||
|
interpolateXY
|
||||||
|
(
|
||||||
|
T_.boundaryField()[patchI],
|
||||||
|
TValues_,
|
||||||
|
KValues_
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::isotropicKSolidThermo::read()
|
||||||
|
{
|
||||||
|
KValues_ = Field<scalar>(subDict(typeName + "Coeffs").lookup("KValues"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::isotropicKSolidThermo::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
os.writeKeyword("KValues") << KValues_ << token::END_STATEMENT << nl;
|
||||||
|
bool ok = interpolatedSolidThermo::writeData(os);
|
||||||
|
|
||||||
|
return ok && os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::isotropicKSolidThermo::~isotropicKSolidThermo()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,124 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::isotropicKSolidThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Directional conductivity + table interpolation.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
isotropicKSolidThermo.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef directionalSolidThermo_H
|
||||||
|
#define directionalSolidThermo_H
|
||||||
|
|
||||||
|
#include "interpolatedSolidThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class isotropicKSolidThermo Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class isotropicKSolidThermo
|
||||||
|
:
|
||||||
|
public interpolatedSolidThermo
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
volScalarField K_;
|
||||||
|
|
||||||
|
//- Thermal conductivity vector
|
||||||
|
Field<scalar> KValues_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("isotropicKSolidThermo");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
isotropicKSolidThermo(const fvMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
virtual ~isotropicKSolidThermo();
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Update properties
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
|
// Access functions
|
||||||
|
|
||||||
|
//- Constant access to K
|
||||||
|
virtual const volScalarField& K() const
|
||||||
|
{
|
||||||
|
return K_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Per patch calculation
|
||||||
|
|
||||||
|
//- Thermal conductivity [W//m/K]
|
||||||
|
virtual tmp<scalarField> K(const label patchI) const;
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Read solidThermophysicalProperties dictionary
|
||||||
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Write properties
|
||||||
|
virtual bool writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const isotropicKSolidThermo& s
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "basicSolidMixture.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::basicSolidMixture::basicSolidMixture
|
||||||
|
(
|
||||||
|
const wordList& solidNames,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(solidNames),
|
||||||
|
Y_(components_.size())
|
||||||
|
{
|
||||||
|
forAll(components_, i)
|
||||||
|
{
|
||||||
|
IOobject header
|
||||||
|
(
|
||||||
|
"Y" + components_[i],
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ
|
||||||
|
);
|
||||||
|
|
||||||
|
// check if field exists and can be read
|
||||||
|
if (header.headerOk())
|
||||||
|
{
|
||||||
|
Y_.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Y" + components_[i],
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
volScalarField Ydefault
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Ydefault",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Y_.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Y" + components_[i],
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
Ydefault
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::basicSolidMixture
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::basicSolidMixture
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef basicSolidMixture_H
|
||||||
|
#define basicSolidMixture_H
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "speciesTable.H"
|
||||||
|
#include "PtrList.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class basicSolidMixture Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class basicSolidMixture
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
typedef speciesTable solidsTable;
|
||||||
|
|
||||||
|
//- The names of the solids
|
||||||
|
solidsTable components_;
|
||||||
|
|
||||||
|
//- Solid mass fractions
|
||||||
|
PtrList<volScalarField> Y_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from word list and mesh
|
||||||
|
basicSolidMixture
|
||||||
|
(
|
||||||
|
const wordList& solidNames,
|
||||||
|
const fvMesh&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~basicSolidMixture()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the solid table
|
||||||
|
const solidsTable& components() const
|
||||||
|
{
|
||||||
|
return components_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the mass-fraction fields
|
||||||
|
inline PtrList<volScalarField>& Y();
|
||||||
|
|
||||||
|
//- Return the const mass-fraction fields
|
||||||
|
inline const PtrList<volScalarField>& Y() const;
|
||||||
|
|
||||||
|
//- Return the mass-fraction field for a specie given by index
|
||||||
|
inline volScalarField& Y(const label i);
|
||||||
|
|
||||||
|
//- Return the const mass-fraction field for a specie given by index
|
||||||
|
inline const volScalarField& Y(const label i) const;
|
||||||
|
|
||||||
|
//- Return the mass-fraction field for a specie given by name
|
||||||
|
inline volScalarField& Y(const word& specieName);
|
||||||
|
|
||||||
|
//- Return the const mass-fraction field for a specie given by name
|
||||||
|
inline const volScalarField& Y(const word& specieName) const;
|
||||||
|
|
||||||
|
//- Does the mixture include this specie?
|
||||||
|
inline bool contains(const word& specieName) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Derived cell based properties.
|
||||||
|
|
||||||
|
//- Density
|
||||||
|
virtual scalar rho(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Absorption coefficient
|
||||||
|
virtual scalar kappa(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Scatter coefficient
|
||||||
|
virtual scalar sigmaS(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Thermal conductivity
|
||||||
|
virtual scalar K(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Emissivity coefficient
|
||||||
|
virtual scalar emissivity(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Formation enthalpy
|
||||||
|
virtual scalar hf(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Sensible enthalpy
|
||||||
|
virtual scalar hs(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Total enthalpy
|
||||||
|
virtual scalar h(scalar T, label celli) const = 0;
|
||||||
|
|
||||||
|
//- Specific heat capacity
|
||||||
|
virtual scalar Cp(scalar T, label celli) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
# include "basicSolidMixtureI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y()
|
||||||
|
{
|
||||||
|
return Y_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::PtrList<Foam::volScalarField>& Foam::basicSolidMixture::Y() const
|
||||||
|
{
|
||||||
|
return Y_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const label i)
|
||||||
|
{
|
||||||
|
return Y_[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
|
||||||
|
(
|
||||||
|
const label i
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Y_[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::volScalarField& Foam::basicSolidMixture::Y(const word& specieName)
|
||||||
|
{
|
||||||
|
return Y_[components_[specieName]];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::volScalarField& Foam::basicSolidMixture::Y
|
||||||
|
(
|
||||||
|
const word& specieName
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Y_[components_[specieName]];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::basicSolidMixture::contains(const word& specieName) const
|
||||||
|
{
|
||||||
|
return components_.contains(specieName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,250 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "multiComponentSolidMixture.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
void Foam::multiComponentSolidMixture<ThermoSolidType>::correctMassFractions()
|
||||||
|
{
|
||||||
|
volScalarField Yt = Y_[0];
|
||||||
|
|
||||||
|
for (label n=1; n<Y_.size(); n++)
|
||||||
|
{
|
||||||
|
Yt += Y_[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(Y_, n)
|
||||||
|
{
|
||||||
|
Y_[n] /= Yt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::X
|
||||||
|
(
|
||||||
|
label iComp, label celli, scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar rhoInv = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
rhoInv += Y_[i][celli]/solidData_[i].rho(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar X = Y_[iComp][celli]/solidData_[iComp].rho(T);
|
||||||
|
|
||||||
|
return (X/rhoInv);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::multiComponentSolidMixture<ThermoSolidType>::multiComponentSolidMixture
|
||||||
|
(
|
||||||
|
const dictionary& thermoSolidDict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
basicSolidMixture
|
||||||
|
(
|
||||||
|
thermoSolidDict.lookup("solidComponents"),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
solidData_(components_.size())
|
||||||
|
{
|
||||||
|
|
||||||
|
forAll(components_, i)
|
||||||
|
{
|
||||||
|
solidData_.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new ThermoSolidType
|
||||||
|
(
|
||||||
|
thermoSolidDict.subDict(components_[i] + "Coeffs")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
correctMassFractions();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::rho
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].rho(T)*X(i, celli, T);
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::hf
|
||||||
|
(
|
||||||
|
scalar, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].hf()*Y_[i][celli];
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::hs
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].hs(T)*Y_[i][celli];
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::h
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].h(T)*Y_[i][celli];
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappa
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].kappa(T)*X(i, celli, T);
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::sigmaS
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].sigmaS(T)*X(i, celli, T);
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::K
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].K(T)*X(i, celli, T);
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::emissivity
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].emissivity(T)*Y_[i][celli];
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::Cp
|
||||||
|
(
|
||||||
|
scalar T, label celli
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar tmp = 0.0;
|
||||||
|
forAll(solidData_, i)
|
||||||
|
{
|
||||||
|
tmp += solidData_[i].Cp(T)*Y_[i][celli];
|
||||||
|
}
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
void Foam::multiComponentSolidMixture<ThermoSolidType>::read
|
||||||
|
(
|
||||||
|
const dictionary& thermoDict
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(components_, i)
|
||||||
|
{
|
||||||
|
solidData_[i] =
|
||||||
|
ThermoSolidType(thermoDict.subDict(components_[i] + "Coeffs"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::multiComponentSolidMixture
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::multiComponentSolidMixture
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef multiComponentSolidMixture_H
|
||||||
|
#define multiComponentSolidMixture_H
|
||||||
|
|
||||||
|
#include "PtrList.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "basicSolidMixture.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class multiComponentSolidMixture Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
class multiComponentSolidMixture
|
||||||
|
:
|
||||||
|
public basicSolidMixture
|
||||||
|
{
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Solid data
|
||||||
|
PtrList<ThermoSolidType> solidData_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Correct the mass fractions to sum to 1
|
||||||
|
void correctMassFractions();
|
||||||
|
|
||||||
|
//- Return molar fraction for component i in celli and at T
|
||||||
|
scalar X(label i, label celli, scalar T) const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary and mesh
|
||||||
|
multiComponentSolidMixture(const dictionary&, const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
|
||||||
|
virtual ~multiComponentSolidMixture()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the raw solid data
|
||||||
|
const PtrList<ThermoSolidType>& solidData() const
|
||||||
|
{
|
||||||
|
return solidData_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
void read(const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
|
// Cell based properties.
|
||||||
|
|
||||||
|
//- Density
|
||||||
|
virtual scalar rho(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Absorption coefficient
|
||||||
|
virtual scalar kappa(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Scatter coefficient
|
||||||
|
virtual scalar sigmaS(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Thermal conductivity
|
||||||
|
virtual scalar K(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Emissivity coefficient
|
||||||
|
virtual scalar emissivity(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Formation enthalpy
|
||||||
|
virtual scalar hf(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy
|
||||||
|
virtual scalar hs(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Total enthalpy
|
||||||
|
virtual scalar h(scalar T, label celli) const;
|
||||||
|
|
||||||
|
//- Cp
|
||||||
|
virtual scalar Cp(scalar T, label celli) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "multiComponentSolidMixture.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "reactingSolidMixture.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
Foam::reactingSolidMixture<ThermoSolidType>::reactingSolidMixture
|
||||||
|
(
|
||||||
|
const dictionary& thermoDict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
multiComponentSolidMixture<ThermoSolidType>
|
||||||
|
(
|
||||||
|
thermoDict,
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
PtrList<solidReaction>
|
||||||
|
(
|
||||||
|
mesh.lookupObject<dictionary>
|
||||||
|
("chemistryProperties").lookup("reactions"),
|
||||||
|
solidReaction::iNew
|
||||||
|
(
|
||||||
|
this->components_,
|
||||||
|
mesh.lookupObject<dictionary>
|
||||||
|
("chemistryProperties").lookup("species")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
void Foam::reactingSolidMixture<ThermoSolidType>::read(const dictionary& thermoDict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::reactingSolidMixture
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::reactingSolidMixture
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
reactingSolidMixture.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef reactingSolidMixture_H
|
||||||
|
#define reactingSolidMixture_H
|
||||||
|
|
||||||
|
#include "multiComponentSolidMixture.H"
|
||||||
|
#include "solidReaction.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class reactingSolidMixture Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class ThermoSolidType>
|
||||||
|
class reactingSolidMixture
|
||||||
|
:
|
||||||
|
public multiComponentSolidMixture<ThermoSolidType>,
|
||||||
|
public PtrList<solidReaction>
|
||||||
|
{
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
reactingSolidMixture(const reactingSolidMixture&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const reactingSolidMixture&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- The type of thermo package this mixture is instantiated for
|
||||||
|
typedef ThermoSolidType thermoType;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary and mesh
|
||||||
|
reactingSolidMixture(const dictionary&, const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~reactingSolidMixture()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
void read(const dictionary&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "reactingSolidMixture.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
InClass
|
||||||
|
Foam::solidMixtureThermo
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef makeSolidMixtureThermo_H
|
||||||
|
#define makeSolidMixtureThermo_H
|
||||||
|
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "solidMixtureThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#define makeSolidMixtureThermo(CThermo,MixtureThermo,Mixture,Transport,Radiation,Thermo,Rho)\
|
||||||
|
\
|
||||||
|
typedef MixtureThermo<Mixture<Transport<Radiation<Thermo<Rho> > > > > \
|
||||||
|
MixtureThermo##Mixture##Transport##Radiation##Thermo##Rho; \
|
||||||
|
\
|
||||||
|
defineTemplateTypeNameAndDebugWithName \
|
||||||
|
( \
|
||||||
|
MixtureThermo##Mixture##Transport##Radiation##Thermo##Rho, \
|
||||||
|
#MixtureThermo \
|
||||||
|
"<"#Mixture"<"#Transport"<"#Radiation"<"#Thermo"<"#Rho">>>>>", \
|
||||||
|
0 \
|
||||||
|
); \
|
||||||
|
\
|
||||||
|
addToRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
CThermo, \
|
||||||
|
MixtureThermo##Mixture##Transport##Radiation##Thermo##Rho, \
|
||||||
|
mesh \
|
||||||
|
); \
|
||||||
|
\
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,431 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidMixtureThermo.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
void Foam::solidMixtureThermo<MixtureType>::calculate()
|
||||||
|
{
|
||||||
|
|
||||||
|
scalarField& rhoCells = rho_.internalField();
|
||||||
|
scalarField& KCells = K_.internalField();
|
||||||
|
scalarField& kappaCells = kappa_.internalField();
|
||||||
|
scalarField& sigmaSCells = sigmaS_.internalField();
|
||||||
|
scalarField& emissivityCells = emissivity_.internalField();
|
||||||
|
|
||||||
|
forAll(T_.internalField(), celli)
|
||||||
|
{
|
||||||
|
rhoCells[celli] = MixtureType::rho(T_[celli], celli);
|
||||||
|
kappaCells[celli] = MixtureType::kappa(T_[celli], celli);
|
||||||
|
sigmaSCells[celli] = MixtureType::sigmaS(T_[celli], celli);
|
||||||
|
KCells[celli] = MixtureType::K(T_[celli], celli);
|
||||||
|
emissivityCells[celli] = MixtureType::emissivity(T_[celli], celli);
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(T_.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
rho_.boundaryField()[patchI] == this->rho(patchI)();
|
||||||
|
K_.boundaryField()[patchI] == this->K(patchI)();
|
||||||
|
kappa_.boundaryField()[patchI] == this->kappa(patchI)();
|
||||||
|
sigmaS_.boundaryField()[patchI] == this->sigmaS(patchI)();
|
||||||
|
emissivity_.boundaryField()[patchI] == this->emissivity(patchI)();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::solidMixtureThermo
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
basicSolidThermo(mesh),
|
||||||
|
MixtureType(*this, mesh),
|
||||||
|
K_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"K",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimEnergy/dimTime/(dimLength*dimTemperature)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
calculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::~solidMixtureThermo()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
void Foam::solidMixtureThermo<MixtureType>::correct()
|
||||||
|
{
|
||||||
|
calculate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
const Foam::volScalarField&
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::K() const
|
||||||
|
{
|
||||||
|
return K_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::Cp() const
|
||||||
|
{
|
||||||
|
tmp<volScalarField> tCp
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Cp",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimEnergy/(dimMass*dimTemperature)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
volScalarField& Cp = tCp();
|
||||||
|
|
||||||
|
forAll(T_.internalField(), celli)
|
||||||
|
{
|
||||||
|
Cp[celli] = MixtureType::Cp(T_[celli], celli);
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(Cp.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
Cp.boundaryField()[patchI] == this->Cp(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
return tCp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::hs() const
|
||||||
|
{
|
||||||
|
tmp<volScalarField> ths
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"Hs",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimEnergy/(dimMass*dimTemperature)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
volScalarField& hs = ths();
|
||||||
|
|
||||||
|
forAll(T_.internalField(), celli)
|
||||||
|
{
|
||||||
|
hs[celli] = MixtureType::hs(T_[celli], celli);
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(hs.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
hs.boundaryField()[patchI] == this->hs(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ths;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::volScalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::Hf() const
|
||||||
|
{
|
||||||
|
tmp<volScalarField> thF
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"hF",
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimEnergy/(dimMass*dimTemperature)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
volScalarField& hf = thF();
|
||||||
|
|
||||||
|
forAll(T_.internalField(), celli)
|
||||||
|
{
|
||||||
|
hf[celli] = MixtureType::hf(T_[celli], celli);
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(hf.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
hf.boundaryField()[patchI] == this->Hf(patchI)();
|
||||||
|
}
|
||||||
|
|
||||||
|
return thF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::rho
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tRho(new scalarField(patchT.size()));
|
||||||
|
scalarField& Rho = tRho();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
Rho[celli] = MixtureType::rho(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tRho;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::Cp
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tCp(new scalarField(patchT.size()));
|
||||||
|
scalarField& Cp = tCp();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
Cp[celli] = MixtureType::Cp(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tCp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::hs
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> ths(new scalarField(patchT.size()));
|
||||||
|
scalarField& hs = ths();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
hs[celli] = MixtureType::hs(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ths;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::K
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tK(new scalarField(patchT.size()));
|
||||||
|
scalarField& K = tK();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
K[celli] = MixtureType::K(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::Hf
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tHf(new scalarField(patchT.size()));
|
||||||
|
scalarField& Hf = tHf();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
Hf[celli] = MixtureType::hf(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tHf;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::sigmaS
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tsigmaS(new scalarField(patchT.size()));
|
||||||
|
scalarField& sigmaS = tsigmaS();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
sigmaS[celli] =
|
||||||
|
MixtureType::sigmaS(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tsigmaS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::kappa
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> tKappa(new scalarField(patchT.size()));
|
||||||
|
scalarField& kappa = tKappa();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
kappa[celli] =
|
||||||
|
MixtureType::kappa(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return tKappa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
Foam::tmp<Foam::scalarField>
|
||||||
|
Foam::solidMixtureThermo<MixtureType>::emissivity
|
||||||
|
(
|
||||||
|
const label patchI
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField& patchT = T_.boundaryField()[patchI];
|
||||||
|
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||||
|
const unallocLabelList& cells = pp.faceCells();
|
||||||
|
|
||||||
|
tmp<scalarField> te(new scalarField(patchT.size()));
|
||||||
|
scalarField& e = te();
|
||||||
|
|
||||||
|
forAll(patchT, celli)
|
||||||
|
{
|
||||||
|
e[celli] = MixtureType::emissivity(patchT[celli], cells[celli]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return te;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
bool Foam::solidMixtureThermo<MixtureType>::read()
|
||||||
|
{
|
||||||
|
if (basicSolidThermo::read())
|
||||||
|
{
|
||||||
|
MixtureType::read(*this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
bool Foam::solidMixtureThermo<MixtureType>::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
bool ok = basicSolidThermo::writeData(os);
|
||||||
|
return ok && os.good();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::solidMixtureThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Foam::solidMixtureThermo
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
solidMixtureThermo.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidMixtureThermo_H
|
||||||
|
#define solidMixtureThermo_H
|
||||||
|
|
||||||
|
#include "basicSolidThermo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidMixtureThermo Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class MixtureType>
|
||||||
|
class solidMixtureThermo
|
||||||
|
:
|
||||||
|
public basicSolidThermo,
|
||||||
|
public MixtureType
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/m/K]
|
||||||
|
volScalarField K_;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Calculate K
|
||||||
|
void calculate();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("solidMixtureThermo");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from mesh
|
||||||
|
solidMixtureThermo(const fvMesh&);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
|
||||||
|
virtual ~solidMixtureThermo();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Return the compostion of the solid mixture
|
||||||
|
virtual MixtureType& composition()
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the compostion of the solid mixture
|
||||||
|
virtual const MixtureType& composition() const
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Update properties
|
||||||
|
virtual void correct();
|
||||||
|
|
||||||
|
// Access functions
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/m/K]
|
||||||
|
virtual const volScalarField& K() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Derived properties
|
||||||
|
|
||||||
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
|
virtual tmp<volScalarField> Cp() const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
virtual tmp<volScalarField> Hf() const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy [J/(kg.K)]
|
||||||
|
virtual tmp<volScalarField> hs() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Patches variables
|
||||||
|
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
virtual tmp<scalarField> rho(const label patchI) const;
|
||||||
|
|
||||||
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
|
virtual tmp<scalarField> Cp(const label patchI) const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy [J/(kg.K)]
|
||||||
|
virtual tmp<scalarField> hs(const label patchI) const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
virtual tmp<scalarField> K(const label patchI) const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
virtual tmp<scalarField> Hf(const label patchI) const;
|
||||||
|
|
||||||
|
//- Scatter coefficient [1/m]
|
||||||
|
virtual tmp<scalarField> sigmaS(const label patchI) const;
|
||||||
|
|
||||||
|
//- Absorptivity [1/m]
|
||||||
|
virtual tmp<scalarField> kappa(const label patchI) const;
|
||||||
|
|
||||||
|
//- Emissivity []
|
||||||
|
virtual tmp<scalarField> emissivity(const label patchI) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//- Read thermophysicalProperties dictionary
|
||||||
|
virtual bool read();
|
||||||
|
|
||||||
|
//- Write the basicSolidThermo properties
|
||||||
|
virtual bool writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "solidMixtureThermo.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "makeSolidMixtureThermo.H"
|
||||||
|
|
||||||
|
#include "constRho.H"
|
||||||
|
|
||||||
|
#include "constSolidThermo.H"
|
||||||
|
#include "exponentialSolidThermo.H"
|
||||||
|
|
||||||
|
#include "constSolidTransport.H"
|
||||||
|
#include "exponentialSolidTransport.H"
|
||||||
|
|
||||||
|
#include "constSolidRad.H"
|
||||||
|
|
||||||
|
#include "basicSolidThermo.H"
|
||||||
|
|
||||||
|
#include "multiComponentSolidMixture.H"
|
||||||
|
#include "reactingSolidMixture.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
makeSolidMixtureThermo
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
solidMixtureThermo,
|
||||||
|
multiComponentSolidMixture,
|
||||||
|
constSolidTransport,
|
||||||
|
constSolidRad,
|
||||||
|
constSolidThermo,
|
||||||
|
constRho
|
||||||
|
);
|
||||||
|
|
||||||
|
makeSolidMixtureThermo
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
solidMixtureThermo,
|
||||||
|
multiComponentSolidMixture,
|
||||||
|
exponentialSolidTransport,
|
||||||
|
constSolidRad,
|
||||||
|
exponentialSolidThermo,
|
||||||
|
constRho
|
||||||
|
);
|
||||||
|
|
||||||
|
makeSolidMixtureThermo
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
solidMixtureThermo,
|
||||||
|
reactingSolidMixture,
|
||||||
|
exponentialSolidTransport,
|
||||||
|
constSolidRad,
|
||||||
|
exponentialSolidThermo,
|
||||||
|
constRho
|
||||||
|
);
|
||||||
|
|
||||||
|
makeSolidMixtureThermo
|
||||||
|
(
|
||||||
|
basicSolidThermo,
|
||||||
|
solidMixtureThermo,
|
||||||
|
reactingSolidMixture,
|
||||||
|
constSolidTransport,
|
||||||
|
constSolidRad,
|
||||||
|
constSolidThermo,
|
||||||
|
constRho
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
3
src/thermophysicalModels/pointSolidMixture/Make/files
Normal file
3
src/thermophysicalModels/pointSolidMixture/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pointSolidMixture/pointSolidMixture.C
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libpointSolidMixture
|
||||||
3
src/thermophysicalModels/pointSolidMixture/Make/options
Normal file
3
src/thermophysicalModels/pointSolidMixture/Make/options
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I${LIB_SRC}/thermophysicalModels/pointSolids/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pointSolidMixture.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::pointSolidMixture::pointSolidMixture
|
||||||
|
(
|
||||||
|
const dictionary& thermophysicalProperties
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(thermophysicalProperties.lookup("solidComponents")),
|
||||||
|
properties_(components_.size())
|
||||||
|
{
|
||||||
|
// can use sub-dictionary "solidProperties" to avoid
|
||||||
|
// collisions with identically named gas-phase entries
|
||||||
|
const dictionary* subDictPtr = thermophysicalProperties.subDictPtr
|
||||||
|
(
|
||||||
|
"solidProperties"
|
||||||
|
);
|
||||||
|
|
||||||
|
const dictionary& props =
|
||||||
|
(
|
||||||
|
subDictPtr ? *subDictPtr : thermophysicalProperties
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(components_, i)
|
||||||
|
{
|
||||||
|
properties_.set(i, pointSolid::New(props.subDict(components_[i])));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::pointSolidMixture::pointSolidMixture(const pointSolidMixture& s)
|
||||||
|
:
|
||||||
|
components_(s.components_),
|
||||||
|
properties_(s.properties_.size())
|
||||||
|
{
|
||||||
|
forAll(properties_, i)
|
||||||
|
{
|
||||||
|
properties_.set(i, s.properties_(i)->clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::pointSolidMixture> Foam::pointSolidMixture::New
|
||||||
|
(
|
||||||
|
const dictionary& thermophysicalProperties
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolidMixture>(new
|
||||||
|
pointSolidMixture(thermophysicalProperties));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::scalarField Foam::pointSolidMixture::X
|
||||||
|
(
|
||||||
|
const scalarField& Y
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalarField X(Y.size());
|
||||||
|
scalar rhoInv = 0.0;
|
||||||
|
forAll(X, i)
|
||||||
|
{
|
||||||
|
rhoInv += Y[i]/properties_[i].rho();
|
||||||
|
X[i] = Y[i]/properties_[i].rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
return X/rhoInv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::pointSolidMixture::rho
|
||||||
|
(
|
||||||
|
const scalarField& X
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar val = 0.0;
|
||||||
|
forAll(properties_, i)
|
||||||
|
{
|
||||||
|
val += properties_[i].rho()*X[i];
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::pointSolidMixture::Cp
|
||||||
|
(
|
||||||
|
const scalarField& Y
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar val = 0.0;
|
||||||
|
forAll(properties_, i)
|
||||||
|
{
|
||||||
|
val += properties_[i].Cp()*Y[i];
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::pointSolidMixture
|
||||||
|
|
||||||
|
Description
|
||||||
|
A mixture of solids.
|
||||||
|
|
||||||
|
Note
|
||||||
|
The dictionary constructor searches for the entry @c solidComponents,
|
||||||
|
which is a wordList. The pointSolid properties of each component can either
|
||||||
|
be contained within a @c solidProperties sub-dictionary or (for legacy
|
||||||
|
purposes) can be found directly in the dictionary.
|
||||||
|
The @c solidProperties sub-dictionary entry should be used when possible
|
||||||
|
to avoid conflicts with identically named gas-phase entries.
|
||||||
|
|
||||||
|
SeeAlso
|
||||||
|
Foam::pointSolidMixture
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef pointSolidMixture_H
|
||||||
|
#define pointSolidMixture_H
|
||||||
|
|
||||||
|
#include "scalarField.H"
|
||||||
|
#include "PtrList.H"
|
||||||
|
#include "pointSolid.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class pointSolidMixture Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class pointSolidMixture
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- The names of the solids
|
||||||
|
List<word> components_;
|
||||||
|
|
||||||
|
//- The pointSolid properties
|
||||||
|
PtrList<pointSolid> properties_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
pointSolidMixture(const dictionary&);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
pointSolidMixture(const pointSolidMixture& lm);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<pointSolidMixture> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolidMixture>(new pointSolidMixture(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~pointSolidMixture()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
//- Select construct from dictionary
|
||||||
|
static autoPtr<pointSolidMixture> New(const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the pointSolid names
|
||||||
|
inline const List<word>& components() const
|
||||||
|
{
|
||||||
|
return components_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the pointSolid properties
|
||||||
|
inline const PtrList<pointSolid>& properties() const
|
||||||
|
{
|
||||||
|
return properties_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the number of solids in the mixture
|
||||||
|
inline label size() const
|
||||||
|
{
|
||||||
|
return components_.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Returns the mass fractions, given mole fractions
|
||||||
|
scalarField Y(const scalarField& X) const;
|
||||||
|
|
||||||
|
//- Returns the mole fractions, given mass fractions
|
||||||
|
scalarField X(const scalarField& Y) const;
|
||||||
|
|
||||||
|
//- Calculate the mixture density [kg/m^3] as a function of
|
||||||
|
// volume fractions
|
||||||
|
scalar rho(const scalarField& X) const;
|
||||||
|
|
||||||
|
//- Calculate the mixture heat capacity [J/(kg K)] as a function
|
||||||
|
// of mass fractions
|
||||||
|
scalar Cp(const scalarField& Y) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
95
src/thermophysicalModels/pointSolids/C/C.C
Normal file
95
src/thermophysicalModels/pointSolids/C/C.C
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "C.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(C, 0);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, C,);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, C, Istream);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, C, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::C::C()
|
||||||
|
:
|
||||||
|
pointSolid(2010, 710, 0.04, 0.0, 1.0)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn("C::C()")
|
||||||
|
<< "Properties of graphite need to be checked!!!"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::C::C(const pointSolid& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::C::C(Istream& is)
|
||||||
|
:
|
||||||
|
pointSolid(is)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::C::C(const dictionary& dict)
|
||||||
|
:
|
||||||
|
pointSolid(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::C::C(const C& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::C::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
pointSolid::writeData(os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const C& s)
|
||||||
|
{
|
||||||
|
s.writeData(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
111
src/thermophysicalModels/pointSolids/C/C.H
Normal file
111
src/thermophysicalModels/pointSolids/C/C.H
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::C
|
||||||
|
|
||||||
|
Description
|
||||||
|
Graphite
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
C.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solid_C_H
|
||||||
|
#define solid_C_H
|
||||||
|
|
||||||
|
#include "pointSolid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class C;
|
||||||
|
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const C&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class C Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class C
|
||||||
|
:
|
||||||
|
public pointSolid
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("C");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
C();
|
||||||
|
|
||||||
|
//- Construct from pointSolid
|
||||||
|
C(const pointSolid& s);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
C(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
C(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
C(const C& s);
|
||||||
|
|
||||||
|
//- Construct and return clone
|
||||||
|
virtual autoPtr<pointSolid> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolid>(new C(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the function coefficients
|
||||||
|
void writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Ostream Operator
|
||||||
|
friend Ostream& operator<<(Ostream& os, const C& s);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
95
src/thermophysicalModels/pointSolids/CaCO3/CaCO3.C
Normal file
95
src/thermophysicalModels/pointSolids/CaCO3/CaCO3.C
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "CaCO3.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(CaCO3, 0);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, CaCO3,);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, CaCO3, Istream);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, CaCO3, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::CaCO3::CaCO3()
|
||||||
|
:
|
||||||
|
pointSolid(2710, 850, 1.3, 0.0, 1.0)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn("CaCO3::CaCO3()")
|
||||||
|
<< "Properties of CaCO3 need to be checked!!!"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::CaCO3::CaCO3(const pointSolid& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::CaCO3::CaCO3(Istream& is)
|
||||||
|
:
|
||||||
|
pointSolid(is)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::CaCO3::CaCO3(const dictionary& dict)
|
||||||
|
:
|
||||||
|
pointSolid(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::CaCO3::CaCO3(const CaCO3& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::CaCO3::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
pointSolid::writeData(os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const CaCO3& s)
|
||||||
|
{
|
||||||
|
s.writeData(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
113
src/thermophysicalModels/pointSolids/CaCO3/CaCO3.H
Normal file
113
src/thermophysicalModels/pointSolids/CaCO3/CaCO3.H
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::CaCO3
|
||||||
|
|
||||||
|
Description
|
||||||
|
Calcium carbonate (limestone)
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
CaCO3.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solid_CaCO3_H
|
||||||
|
#define solid_CaCO3_H
|
||||||
|
|
||||||
|
#include "pointSolid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class CaCO3;
|
||||||
|
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const CaCO3&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class CaCO3 Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class CaCO3
|
||||||
|
:
|
||||||
|
public pointSolid
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("CaCO3");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
CaCO3();
|
||||||
|
|
||||||
|
//- Construct from pointSolid
|
||||||
|
CaCO3(const pointSolid& s);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
CaCO3(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
CaCO3(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
CaCO3(const CaCO3& s);
|
||||||
|
|
||||||
|
//- Construct and return clone
|
||||||
|
virtual autoPtr<pointSolid> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolid>(new CaCO3(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the function coefficients
|
||||||
|
void writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<(Ostream& os, const CaCO3& s);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
8
src/thermophysicalModels/pointSolids/Make/files
Normal file
8
src/thermophysicalModels/pointSolids/Make/files
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
pointSolid/pointSolid.C
|
||||||
|
pointSolid/pointSolidNew.C
|
||||||
|
|
||||||
|
ash/ash.C
|
||||||
|
C/C.C
|
||||||
|
CaCO3/CaCO3.C
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libpointSolids
|
||||||
3
src/thermophysicalModels/pointSolids/Make/options
Normal file
3
src/thermophysicalModels/pointSolids/Make/options
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
|
||||||
|
|
||||||
95
src/thermophysicalModels/pointSolids/ash/ash.C
Normal file
95
src/thermophysicalModels/pointSolids/ash/ash.C
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "ash.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(ash, 0);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, ash,);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, ash, Istream);
|
||||||
|
addToRunTimeSelectionTable(pointSolid, ash, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::ash::ash()
|
||||||
|
:
|
||||||
|
pointSolid(2010, 710, 0.04, 0.0, 1.0)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn("ash::ash()")
|
||||||
|
<< "Properties of ash need to be checked!!!"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::ash::ash(const pointSolid& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::ash::ash(Istream& is)
|
||||||
|
:
|
||||||
|
pointSolid(is)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::ash::ash(const dictionary& dict)
|
||||||
|
:
|
||||||
|
pointSolid(dict)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::ash::ash(const ash& s)
|
||||||
|
:
|
||||||
|
pointSolid(s)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::ash::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
pointSolid::writeData(os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const ash& s)
|
||||||
|
{
|
||||||
|
s.writeData(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
113
src/thermophysicalModels/pointSolids/ash/ash.H
Normal file
113
src/thermophysicalModels/pointSolids/ash/ash.H
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::ash
|
||||||
|
|
||||||
|
Description
|
||||||
|
Coal ash
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
ash.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solid_ash_H
|
||||||
|
#define solid_ash_H
|
||||||
|
|
||||||
|
#include "pointSolid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class ash;
|
||||||
|
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const ash&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class ash Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class ash
|
||||||
|
:
|
||||||
|
public pointSolid
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("ash");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
ash();
|
||||||
|
|
||||||
|
//- Construct from pointSolid
|
||||||
|
ash(const pointSolid& s);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
ash(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
ash(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
ash(const ash& s);
|
||||||
|
|
||||||
|
//- Construct and return clone
|
||||||
|
virtual autoPtr<pointSolid> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolid>(new ash(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the function coefficients
|
||||||
|
void writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<(Ostream& os, const ash& s);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
108
src/thermophysicalModels/pointSolids/pointSolid/pointSolid.C
Normal file
108
src/thermophysicalModels/pointSolids/pointSolid/pointSolid.C
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pointSolid.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(pointSolid, 0);
|
||||||
|
defineRunTimeSelectionTable(pointSolid,);
|
||||||
|
defineRunTimeSelectionTable(pointSolid, Istream);
|
||||||
|
defineRunTimeSelectionTable(pointSolid, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::pointSolid::pointSolid
|
||||||
|
(
|
||||||
|
scalar rho,
|
||||||
|
scalar Cp,
|
||||||
|
scalar K,
|
||||||
|
scalar Hf,
|
||||||
|
scalar emissivity
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rho_(rho),
|
||||||
|
Cp_(Cp),
|
||||||
|
K_(K),
|
||||||
|
Hf_(Hf),
|
||||||
|
emissivity_(emissivity)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::pointSolid::pointSolid(Istream& is)
|
||||||
|
:
|
||||||
|
rho_(readScalar(is)),
|
||||||
|
Cp_(readScalar(is)),
|
||||||
|
K_(readScalar(is)),
|
||||||
|
Hf_(readScalar(is)),
|
||||||
|
emissivity_(readScalar(is))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::pointSolid::pointSolid(const dictionary& dict)
|
||||||
|
:
|
||||||
|
rho_(readScalar(dict.lookup("rho"))),
|
||||||
|
Cp_(readScalar(dict.lookup("Cp"))),
|
||||||
|
K_(readScalar(dict.lookup("K"))),
|
||||||
|
Hf_(readScalar(dict.lookup("Hf"))),
|
||||||
|
emissivity_(readScalar(dict.lookup("emissivity")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::pointSolid::pointSolid(const pointSolid& s)
|
||||||
|
:
|
||||||
|
rho_(s.rho_),
|
||||||
|
Cp_(s.Cp_),
|
||||||
|
K_(s.K_),
|
||||||
|
Hf_(s.Hf_),
|
||||||
|
emissivity_(s.emissivity_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::pointSolid::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << rho_ << token::SPACE
|
||||||
|
<< Cp_ << token::SPACE
|
||||||
|
<< K_ << token::SPACE
|
||||||
|
<< Hf_ << token::SPACE
|
||||||
|
<< emissivity_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const pointSolid& s)
|
||||||
|
{
|
||||||
|
s.writeData(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
210
src/thermophysicalModels/pointSolids/pointSolid/pointSolid.H
Normal file
210
src/thermophysicalModels/pointSolids/pointSolid/pointSolid.H
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::pointSolid
|
||||||
|
|
||||||
|
Description
|
||||||
|
The thermophysical properties of a pointSolid
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
pointSolid.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef pointSolid_H
|
||||||
|
#define pointSolid_H
|
||||||
|
|
||||||
|
#include "typeInfo.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class pointSolid;
|
||||||
|
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const pointSolid&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class pointSolid Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class pointSolid
|
||||||
|
{
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
scalar rho_;
|
||||||
|
|
||||||
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
|
scalar Cp_;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
scalar K_;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
scalar Hf_;
|
||||||
|
|
||||||
|
//- Emissivity
|
||||||
|
scalar emissivity_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("pointSolid");
|
||||||
|
|
||||||
|
|
||||||
|
// Declare run-time constructor selection tables
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
pointSolid,
|
||||||
|
,
|
||||||
|
(),
|
||||||
|
()
|
||||||
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
pointSolid,
|
||||||
|
Istream,
|
||||||
|
(Istream& is),
|
||||||
|
(is)
|
||||||
|
);
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
pointSolid,
|
||||||
|
dictionary,
|
||||||
|
(const dictionary& dict),
|
||||||
|
(dict)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
pointSolid
|
||||||
|
(
|
||||||
|
scalar rho,
|
||||||
|
scalar Cp,
|
||||||
|
scalar K,
|
||||||
|
scalar Hf,
|
||||||
|
scalar emissivity
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
pointSolid(Istream& is);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
pointSolid(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
pointSolid(const pointSolid& s);
|
||||||
|
|
||||||
|
//- Construct and return clone
|
||||||
|
virtual autoPtr<pointSolid> clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<pointSolid>(new pointSolid(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
//- Return a pointer to a new pointSolid created from input
|
||||||
|
static autoPtr<pointSolid> New(Istream& is);
|
||||||
|
|
||||||
|
//- Return a pointer to a new pointSolid created from dictionary
|
||||||
|
static autoPtr<pointSolid> New(const dictionary& dict);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~pointSolid()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Physical constants which define the pointSolid
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
inline scalar rho() const;
|
||||||
|
|
||||||
|
//- Specific heat capacity [J/(kg.K)]
|
||||||
|
inline scalar Cp() const;
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/(m.K)]
|
||||||
|
inline scalar K() const;
|
||||||
|
|
||||||
|
//- Heat of formation [J/kg]
|
||||||
|
inline scalar Hf() const;
|
||||||
|
|
||||||
|
//- Total enthalpy - reference to Tstd [J/kg]
|
||||||
|
inline scalar H(const scalar T) const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy - reference to Tstd [J/kg]
|
||||||
|
inline scalar Hs(const scalar T) const;
|
||||||
|
|
||||||
|
//- Emissivity []
|
||||||
|
inline scalar emissivity() const;
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write the pointSolid properties
|
||||||
|
virtual void writeData(Ostream& os) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<(Ostream& os, const pointSolid& s);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "pointSolidI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "specie.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::rho() const
|
||||||
|
{
|
||||||
|
return rho_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::Cp() const
|
||||||
|
{
|
||||||
|
return Cp_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::K() const
|
||||||
|
{
|
||||||
|
return K_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::Hf() const
|
||||||
|
{
|
||||||
|
return Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::H(const scalar T) const
|
||||||
|
{
|
||||||
|
return Hs(T) + Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::Hs(const scalar T) const
|
||||||
|
{
|
||||||
|
return Cp_*(T - specie::Tstd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::pointSolid::emissivity() const
|
||||||
|
{
|
||||||
|
return emissivity_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
132
src/thermophysicalModels/pointSolids/pointSolid/pointSolidNew.C
Normal file
132
src/thermophysicalModels/pointSolids/pointSolid/pointSolidNew.C
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pointSolid.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(Istream& is)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "pointSolid::New(Istream&): constructing pointSolid" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word solidType(is);
|
||||||
|
const word coeffs(is);
|
||||||
|
|
||||||
|
if (coeffs == "defaultCoeffs")
|
||||||
|
{
|
||||||
|
ConstructorTable::iterator cstrIter =
|
||||||
|
ConstructorTablePtr_->find(solidType);
|
||||||
|
|
||||||
|
if (cstrIter == ConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pointSolid::New(Istream&)")
|
||||||
|
<< "Unknown pointSolid type " << solidType << nl << nl
|
||||||
|
<< "Valid pointSolid types are :" << endl
|
||||||
|
<< ConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<pointSolid>(cstrIter()());
|
||||||
|
}
|
||||||
|
else if (coeffs == "coeffs")
|
||||||
|
{
|
||||||
|
IstreamConstructorTable::iterator cstrIter =
|
||||||
|
IstreamConstructorTablePtr_->find(solidType);
|
||||||
|
|
||||||
|
if (cstrIter == IstreamConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pointSolid::New(Istream&)")
|
||||||
|
<< "Unknown pointSolid type " << solidType << nl << nl
|
||||||
|
<< "Valid pointSolid types are :" << endl
|
||||||
|
<< IstreamConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<pointSolid>(cstrIter()(is));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("pointSolid::New(Istream&)")
|
||||||
|
<< "pointSolid type " << solidType
|
||||||
|
<< ", option " << coeffs << " given"
|
||||||
|
<< ", should be coeffs or defaultCoeffs"
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
return autoPtr<pointSolid>(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "pointSolid::New(const dictionary&): constructing pointSolid"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word solidType(dict.dictName());
|
||||||
|
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
|
||||||
|
|
||||||
|
if (defaultCoeffs)
|
||||||
|
{
|
||||||
|
ConstructorTable::iterator cstrIter =
|
||||||
|
ConstructorTablePtr_->find(solidType);
|
||||||
|
|
||||||
|
if (cstrIter == ConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pointSolid::New(const dictionary&)")
|
||||||
|
<< "Unknown pointSolid type " << solidType << nl << nl
|
||||||
|
<< "Valid pointSolid types are :" << endl
|
||||||
|
<< ConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<pointSolid>(cstrIter()());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dictionaryConstructorTable::iterator cstrIter =
|
||||||
|
dictionaryConstructorTablePtr_->find(solidType);
|
||||||
|
|
||||||
|
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalErrorIn("pointSolid::New(const dictionary&)")
|
||||||
|
<< "Unknown pointSolid type " << solidType << nl << nl
|
||||||
|
<< "Valid pointSolid types are :" << endl
|
||||||
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<pointSolid>(cstrIter()(dict));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
8
src/thermophysicalModels/solid/Make/files
Normal file
8
src/thermophysicalModels/solid/Make/files
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
rhoType/const/constRho.C
|
||||||
|
|
||||||
|
reaction/Reactions/solidReaction/solidReaction.C
|
||||||
|
|
||||||
|
reaction/reactions/makeSolidReactionThermoReactions.C
|
||||||
|
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libsolid
|
||||||
2
src/thermophysicalModels/solid/Make/options
Normal file
2
src/thermophysicalModels/solid/Make/options
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Typedefs
|
||||||
|
Foam::solidThermoPhysicsTypes
|
||||||
|
|
||||||
|
Description
|
||||||
|
Type definitions for solid-thermo-physics models
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidThermoPhysicsTypes_H
|
||||||
|
#define solidThermoPhysicsTypes_H
|
||||||
|
|
||||||
|
#include "constRho.H"
|
||||||
|
|
||||||
|
#include "constSolidThermo.H"
|
||||||
|
#include "exponentialSolidThermo.H"
|
||||||
|
|
||||||
|
#include "constSolidTransport.H"
|
||||||
|
#include "exponentialSolidTransport.H"
|
||||||
|
|
||||||
|
#include "constSolidRad.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
typedef constSolidTransport<constSolidRad<constSolidThermo<constRho> > >
|
||||||
|
constSolidThermoPhysics;
|
||||||
|
|
||||||
|
typedef constSolidTransport
|
||||||
|
<
|
||||||
|
constSolidRad
|
||||||
|
<
|
||||||
|
exponentialSolidThermo
|
||||||
|
<
|
||||||
|
constRho
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>
|
||||||
|
expoSolidThermoPhysics;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
|
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constSolidRad.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
constSolidRad<thermo>::constSolidRad(const dictionary& dict)
|
||||||
|
:
|
||||||
|
thermo(dict),
|
||||||
|
kappa_(readScalar(dict.subDict("radiativeProperties").lookup("kappa"))),
|
||||||
|
sigmaS_
|
||||||
|
(
|
||||||
|
readScalar
|
||||||
|
(
|
||||||
|
dict.subDict("radiativeProperties").lookup("sigmaS")
|
||||||
|
)
|
||||||
|
),
|
||||||
|
emissivity_
|
||||||
|
(
|
||||||
|
readScalar(dict.subDict("radiativeProperties").lookup("emissivity"))
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Ostream& operator<<(Ostream& os, const constSolidRad<thermo>& pg)
|
||||||
|
{
|
||||||
|
os << static_cast<const thermo&>(pg);
|
||||||
|
os << tab << pg.kappa_ << tab << pg.sigmaS_ << tab << pg.emissivity_;
|
||||||
|
|
||||||
|
os.check("Ostream& operator<<(Ostream& os, const constSolidRad& st)");
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
139
src/thermophysicalModels/solid/radiation/const/constSolidRad.H
Normal file
139
src/thermophysicalModels/solid/radiation/const/constSolidRad.H
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::constSolidRad
|
||||||
|
|
||||||
|
Description
|
||||||
|
Constant radiative properties
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
constSolidRadI.H
|
||||||
|
constSolidRad.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef constSolidRad_H
|
||||||
|
#define constSolidRad_H
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class thermo> class constSolidRad;
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidRad<thermo>&
|
||||||
|
);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class constSolidRad Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
class constSolidRad
|
||||||
|
:
|
||||||
|
public thermo
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Absorption coefficient
|
||||||
|
scalar kappa_;
|
||||||
|
|
||||||
|
//- Scattering coefficient
|
||||||
|
scalar sigmaS_;
|
||||||
|
|
||||||
|
//- Emissivity coefficient
|
||||||
|
scalar emissivity_;
|
||||||
|
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline constSolidRad
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar kappa,
|
||||||
|
const scalar sigmaS,
|
||||||
|
const scalar emissivity
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
constSolidRad(const dictionary&);
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline constSolidRad(const word& name, const constSolidRad&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
inline autoPtr<constSolidRad> clone() const;
|
||||||
|
|
||||||
|
// Selector from Istream
|
||||||
|
inline static autoPtr<constSolidRad> New(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Return absorption coefficient [1/m]
|
||||||
|
inline scalar kappa(scalar T) const;
|
||||||
|
|
||||||
|
//- Return scattering [1/m]
|
||||||
|
inline scalar sigmaS(scalar T) const;
|
||||||
|
|
||||||
|
//- Return emissivity[]
|
||||||
|
inline scalar emissivity(scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <thermo>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidRad&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "constSolidRadI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "constSolidRad.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
109
src/thermophysicalModels/solid/radiation/const/constSolidRadI.H
Normal file
109
src/thermophysicalModels/solid/radiation/const/constSolidRadI.H
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constSolidRad.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline constSolidRad<thermo>::constSolidRad
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar kappa,
|
||||||
|
const scalar sigmaS,
|
||||||
|
const scalar emissivity
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(t),
|
||||||
|
kappa_(kappa),
|
||||||
|
sigmaS_(sigmaS),
|
||||||
|
emissivity_(emissivity)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline constSolidRad<thermo>::constSolidRad
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const constSolidRad& pg
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(name, pg),
|
||||||
|
kappa_(pg.kappa_),
|
||||||
|
sigmaS_(pg.sigmaS_),
|
||||||
|
emissivity_(pg.emissivity_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline autoPtr<constSolidRad<thermo> > constSolidRad<thermo>::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<constSolidRad<thermo> >(new constSolidRad<thermo>(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline autoPtr<constSolidRad<thermo> > constSolidRad<thermo>::New(Istream& is)
|
||||||
|
{
|
||||||
|
return autoPtr<constSolidRad<thermo> >(new constSolidRad<thermo>(is));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline scalar constSolidRad<thermo>::kappa(scalar) const
|
||||||
|
{
|
||||||
|
return kappa_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline scalar constSolidRad<thermo>::sigmaS(scalar) const
|
||||||
|
{
|
||||||
|
return sigmaS_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline scalar constSolidRad<thermo>::emissivity(scalar) const
|
||||||
|
{
|
||||||
|
return emissivity_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "IrreversibleSolidReaction.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
|
||||||
|
(
|
||||||
|
const solidReaction& reaction,
|
||||||
|
const ReactionRate& k,
|
||||||
|
const scalar nReact
|
||||||
|
)
|
||||||
|
:
|
||||||
|
solidReaction(reaction),
|
||||||
|
k_(k),
|
||||||
|
nReact_(nReact)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
Foam::IrreversibleSolidReaction<ReactionRate>::IrreversibleSolidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolysisGases
|
||||||
|
)
|
||||||
|
:
|
||||||
|
solidReaction(components, is, pyrolysisGases),
|
||||||
|
k_(components, is),
|
||||||
|
nReact_(readScalar(is))
|
||||||
|
{
|
||||||
|
is.readEnd("solidArrheniusReactionRate(Istream&)");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::kf
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& c
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return k_(T, p, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
Foam::scalar Foam::IrreversibleSolidReaction<ReactionRate>::nReact() const
|
||||||
|
{
|
||||||
|
return nReact_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
void Foam::IrreversibleSolidReaction<ReactionRate>::write
|
||||||
|
(
|
||||||
|
Ostream& os
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
solidReaction::write(os);
|
||||||
|
os << token::SPACE << "Reaction order: " << nReact_ << nl << k_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::IrreversibleSolidReaction
|
||||||
|
|
||||||
|
Description
|
||||||
|
Simple extension of Reaction to handle reversible reactions
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
IrreversibleSolidReaction.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef IrreversibleSolidReaction_H
|
||||||
|
#define IrreversibleSolidReaction_H
|
||||||
|
|
||||||
|
#include "solidReaction.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class IrreversibleSolidReaction Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class ReactionRate>
|
||||||
|
class IrreversibleSolidReaction
|
||||||
|
:
|
||||||
|
public solidReaction
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
// Reaction rate
|
||||||
|
ReactionRate k_;
|
||||||
|
|
||||||
|
// Reaction order
|
||||||
|
scalar nReact_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=
|
||||||
|
(
|
||||||
|
const IrreversibleSolidReaction<ReactionRate>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("irreversible");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
IrreversibleSolidReaction
|
||||||
|
(
|
||||||
|
const solidReaction& reaction,
|
||||||
|
const ReactionRate& reactionRate,
|
||||||
|
const scalar nReact
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
IrreversibleSolidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolysisGases
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~IrreversibleSolidReaction()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// IrreversibleSolidReaction rate coefficients
|
||||||
|
|
||||||
|
//- Forward rate constant
|
||||||
|
virtual scalar kf
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& c
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Reaction order
|
||||||
|
virtual scalar nReact() const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "IrreversibleSolidReaction.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,325 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidReaction.H"
|
||||||
|
#include "DynamicList.H"
|
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(solidReaction, 0);
|
||||||
|
defineRunTimeSelectionTable(solidReaction, Istream);
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::solidReaction::solidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& componets,
|
||||||
|
const speciesTable& pyrolisisGases,
|
||||||
|
const List<label>& slhs,
|
||||||
|
const List<label>& srhs,
|
||||||
|
const List<label>& grhs
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(componets),
|
||||||
|
pyrolisisGases_(pyrolisisGases),
|
||||||
|
slhs_(slhs),
|
||||||
|
srhs_(srhs),
|
||||||
|
grhs_(grhs)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidReaction::solidReaction
|
||||||
|
(
|
||||||
|
const solidReaction& r,
|
||||||
|
const speciesTable& componets,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(componets),
|
||||||
|
pyrolisisGases_(pyrolisisGases),
|
||||||
|
slhs_(r.slhs_),
|
||||||
|
srhs_(r.srhs_),
|
||||||
|
grhs_(r.grhs_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::solidReaction::solidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(components),
|
||||||
|
pyrolisisGases_(pyrolisisGases)
|
||||||
|
{
|
||||||
|
setLRhs(is);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::solidReaction::componentIndex
|
||||||
|
(
|
||||||
|
bool& isGas,
|
||||||
|
Istream& is
|
||||||
|
)
|
||||||
|
{
|
||||||
|
token t(is);
|
||||||
|
|
||||||
|
if (t.isWord())
|
||||||
|
{
|
||||||
|
word componentName = t.wordToken();
|
||||||
|
|
||||||
|
size_t i = componentName.find('=');
|
||||||
|
|
||||||
|
if (i != word::npos)
|
||||||
|
{
|
||||||
|
string exponentStr = componentName
|
||||||
|
(
|
||||||
|
i + 1,
|
||||||
|
componentName.size() - i - 1
|
||||||
|
);
|
||||||
|
componentName = componentName(0, i);
|
||||||
|
}
|
||||||
|
if (components_.contains(componentName))
|
||||||
|
{
|
||||||
|
isGas = false;
|
||||||
|
return (components_[componentName]);
|
||||||
|
}
|
||||||
|
else if (pyrolisisGases_.contains(componentName))
|
||||||
|
{
|
||||||
|
isGas = true;
|
||||||
|
return (pyrolisisGases_[componentName]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"solidReaction::componentIndex(bool&, Istream& is)",
|
||||||
|
is
|
||||||
|
)
|
||||||
|
<< "Cannot find component" << componentName
|
||||||
|
<< "in tables :" << pyrolisisGases_ << " or "
|
||||||
|
<< components_
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn("solidReaction::componentIndex(bool&, Istream& is)", is)
|
||||||
|
<< "Expected a word but found " << t.info()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::solidReaction::setLRhs(Istream& is)
|
||||||
|
{
|
||||||
|
DynamicList<label> dlsrhs;
|
||||||
|
|
||||||
|
label index = 0;
|
||||||
|
|
||||||
|
while (is)
|
||||||
|
{
|
||||||
|
bool isGas = false;
|
||||||
|
index = componentIndex(isGas, is);
|
||||||
|
|
||||||
|
if (index != -1)
|
||||||
|
{
|
||||||
|
dlsrhs.append(index);
|
||||||
|
|
||||||
|
token t(is);
|
||||||
|
|
||||||
|
if (t.isPunctuation())
|
||||||
|
{
|
||||||
|
if (t == token::ADD)
|
||||||
|
{
|
||||||
|
if(isGas)
|
||||||
|
{
|
||||||
|
grhs_ = dlsrhs.shrink();
|
||||||
|
dlsrhs.clear();
|
||||||
|
//is.putBack(t);
|
||||||
|
//return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
srhs_ = dlsrhs.shrink();
|
||||||
|
dlsrhs.clear(); //is.putBack(t);
|
||||||
|
//return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (t == token::ASSIGN)
|
||||||
|
{
|
||||||
|
if(isGas)
|
||||||
|
{
|
||||||
|
Info << "Pyrolysis Gases should appear on lhs of the"
|
||||||
|
"reaction" << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
slhs_ = dlsrhs.shrink();
|
||||||
|
dlsrhs.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(isGas)
|
||||||
|
{
|
||||||
|
grhs_ = dlsrhs.shrink();
|
||||||
|
is.putBack(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
srhs_ = dlsrhs.shrink();
|
||||||
|
is.putBack(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(isGas)
|
||||||
|
{
|
||||||
|
grhs_ = dlsrhs.shrink();
|
||||||
|
is.putBack(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
srhs_ = dlsrhs.shrink();
|
||||||
|
is.putBack(t);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
|
||||||
|
<< "Cannot find component in tables"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FatalIOErrorIn("solidReaction::lsrhs(Istream& is)", is)
|
||||||
|
<< "Cannot continue reading reaction data from stream"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::autoPtr<Foam::solidReaction> Foam::solidReaction::New
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (is.eof())
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"solidReaction::New(const speciesTable& species,"
|
||||||
|
" const HashPtrTable& thermoDatabase, Istream&)",
|
||||||
|
is
|
||||||
|
) << "solidReaction type not specified" << nl << nl
|
||||||
|
<< "Valid solidReaction types are :" << endl
|
||||||
|
<< IstreamConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
const word reactionTypeName(is);
|
||||||
|
|
||||||
|
IstreamConstructorTable::iterator cstrIter
|
||||||
|
= IstreamConstructorTablePtr_->find(reactionTypeName);
|
||||||
|
|
||||||
|
if (cstrIter == IstreamConstructorTablePtr_->end())
|
||||||
|
{
|
||||||
|
FatalIOErrorIn
|
||||||
|
(
|
||||||
|
"solidReaction::New(const speciesTable& species,"
|
||||||
|
" const HashPtrTable& thermoDatabase, Istream&)",
|
||||||
|
is
|
||||||
|
) << "Unknown reaction type "
|
||||||
|
<< reactionTypeName << nl << nl
|
||||||
|
<< "Valid reaction types are :" << endl
|
||||||
|
<< IstreamConstructorTablePtr_->sortedToc()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return autoPtr<solidReaction>
|
||||||
|
(
|
||||||
|
cstrIter()(species, is, pyrolisisGases)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::solidReaction::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << type() << nl << " ";
|
||||||
|
|
||||||
|
forAll(slhs_, i)
|
||||||
|
{
|
||||||
|
os << components_[slhs_[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
os << " = ";
|
||||||
|
|
||||||
|
forAll(srhs_, i)
|
||||||
|
{
|
||||||
|
os << components_[srhs_[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
os << " + ";
|
||||||
|
|
||||||
|
forAll(grhs_, i)
|
||||||
|
{
|
||||||
|
os << pyrolisisGases_[grhs_[i]];
|
||||||
|
}
|
||||||
|
|
||||||
|
os << endl << " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::solidReaction::kf
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& c
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::solidReaction::nReact() const
|
||||||
|
{
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,254 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::solidReaction
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
Read solid reactions of the type S1 = S2 + G1
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
solidReactionI.H
|
||||||
|
solidReaction.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidReaction_H
|
||||||
|
#define solidReaction_H
|
||||||
|
|
||||||
|
#include "speciesTable.H"
|
||||||
|
#include "scalarField.H"
|
||||||
|
#include "typeInfo.H"
|
||||||
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of friend functions and operators
|
||||||
|
class solidReaction;
|
||||||
|
|
||||||
|
inline Ostream& operator<<(Ostream&, const solidReaction&);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidReaction Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class solidReaction
|
||||||
|
{
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- List of solid names present in reaction system
|
||||||
|
const speciesTable& components_;
|
||||||
|
|
||||||
|
//- List of gas species present in reaction system
|
||||||
|
speciesTable pyrolisisGases_;
|
||||||
|
|
||||||
|
//- Solid components index for the left-hand-side of the reaction
|
||||||
|
List<label> slhs_;
|
||||||
|
|
||||||
|
//- Solid components index for the right-hand-side of the reaction
|
||||||
|
List<label> srhs_;
|
||||||
|
|
||||||
|
//- Specie index for the right-hand-side of the reaction
|
||||||
|
List<label> grhs_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Set rhs and lhs of the reaction
|
||||||
|
void setLRhs(Istream&);
|
||||||
|
|
||||||
|
//- Look for the component index in the reaction
|
||||||
|
label componentIndex(bool& isGas, Istream& is);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const solidReaction&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("Reaction");
|
||||||
|
|
||||||
|
|
||||||
|
// Declare run-time constructor selection tables
|
||||||
|
|
||||||
|
declareRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
autoPtr,
|
||||||
|
solidReaction,
|
||||||
|
Istream,
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolysisGases
|
||||||
|
),
|
||||||
|
(components, is, pyrolysisGases)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Public classes
|
||||||
|
|
||||||
|
//- Class used for the read-construction of PtrLists of reaction
|
||||||
|
class iNew
|
||||||
|
{
|
||||||
|
const speciesTable& components_;
|
||||||
|
speciesTable pyrolisisGases_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
iNew
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& pyrolisisGases
|
||||||
|
)
|
||||||
|
:
|
||||||
|
components_(components),
|
||||||
|
pyrolisisGases_(pyrolisisGases)
|
||||||
|
{}
|
||||||
|
|
||||||
|
autoPtr<solidReaction> operator()(Istream& is) const
|
||||||
|
{
|
||||||
|
return autoPtr<solidReaction>
|
||||||
|
(
|
||||||
|
solidReaction::New
|
||||||
|
(
|
||||||
|
components_,
|
||||||
|
is,
|
||||||
|
pyrolisisGases_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
solidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
const speciesTable& pyrolisisGases,
|
||||||
|
const List<label>& slhs,
|
||||||
|
const List<label>& srhs,
|
||||||
|
const List<label>& grhs
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy given new speciesTable
|
||||||
|
solidReaction
|
||||||
|
(
|
||||||
|
const solidReaction&,
|
||||||
|
const speciesTable& components,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
solidReaction
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream& is,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<solidReaction > clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<solidReaction >
|
||||||
|
(
|
||||||
|
new solidReaction(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Selectors
|
||||||
|
|
||||||
|
//- Return a pointer to a new patchField created on freestore from input
|
||||||
|
static autoPtr<solidReaction > New
|
||||||
|
(
|
||||||
|
const speciesTable& components,
|
||||||
|
Istream&,
|
||||||
|
const speciesTable& pyrolisisGases
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~solidReaction()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
inline const List<label>& slhs() const;
|
||||||
|
inline const List<label>& srhs() const;
|
||||||
|
inline const List<label>& grhs() const;
|
||||||
|
|
||||||
|
inline const speciesTable& pyrolisisGases() const;
|
||||||
|
|
||||||
|
|
||||||
|
// solidReaction rate coefficients
|
||||||
|
|
||||||
|
virtual scalar kf
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& c
|
||||||
|
) const;
|
||||||
|
|
||||||
|
virtual scalar nReact() const;
|
||||||
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const solidReaction&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "solidReactionI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "solidReaction.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline const List<label>& solidReaction::slhs() const
|
||||||
|
{
|
||||||
|
return slhs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const List<label>& solidReaction::srhs() const
|
||||||
|
{
|
||||||
|
return srhs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const List<label>& solidReaction::grhs() const
|
||||||
|
{
|
||||||
|
return grhs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const speciesTable& solidReaction::pyrolisisGases() const
|
||||||
|
{
|
||||||
|
return pyrolisisGases_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const solidReaction& r
|
||||||
|
)
|
||||||
|
{
|
||||||
|
r.write(os);
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,117 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::solidArrheniusReactionRate
|
||||||
|
|
||||||
|
Description
|
||||||
|
Arrhenius reaction rate for solids
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
solidArrheniusReactionRateI.H
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef solidArrheniusReactionRate_H
|
||||||
|
#define solidArrheniusReactionRate_H
|
||||||
|
|
||||||
|
#include "scalarField.H"
|
||||||
|
#include "typeInfo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class solidArrheniusReactionRate Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class solidArrheniusReactionRate
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
scalar A_;
|
||||||
|
scalar Ta_;
|
||||||
|
scalar Tcrit_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline solidArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const scalar A,
|
||||||
|
const scalar Ta,
|
||||||
|
const scalar Tcrit
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
inline solidArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable& species,
|
||||||
|
Istream& is
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return the type name
|
||||||
|
static word type()
|
||||||
|
{
|
||||||
|
return "SolidArrhenius";
|
||||||
|
}
|
||||||
|
|
||||||
|
inline scalar operator()
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& c
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
inline friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const solidArrheniusReactionRate&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "solidArrheniusReactionRateI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const scalar A,
|
||||||
|
const scalar Ta,
|
||||||
|
const scalar Tcrit
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(A),
|
||||||
|
Ta_(Ta),
|
||||||
|
Tcrit_(Tcrit)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::solidArrheniusReactionRate::solidArrheniusReactionRate
|
||||||
|
(
|
||||||
|
const speciesTable&,
|
||||||
|
Istream& is
|
||||||
|
)
|
||||||
|
:
|
||||||
|
A_(readScalar(is.readBegin("solidArrheniusReaction(Istream&)"))),
|
||||||
|
Ta_(readScalar(is)),
|
||||||
|
Tcrit_(readScalar(is))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::solidArrheniusReactionRate::operator()
|
||||||
|
(
|
||||||
|
const scalar T,
|
||||||
|
const scalar,
|
||||||
|
const scalarField&
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar ak = A_;
|
||||||
|
|
||||||
|
if (T < Tcrit_)
|
||||||
|
{
|
||||||
|
ak *= 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ak *= exp(-Ta_/T);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ak;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const solidArrheniusReactionRate& arr
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << token::BEGIN_LIST
|
||||||
|
<< arr.A_ << token::SPACE << arr.Ta_ << token::SPACE << arr.Tcrit_
|
||||||
|
<< token::END_LIST;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
InClass
|
||||||
|
Foam::makeSolidReactionThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Macros for instantiating reactions on given solid thermo packages
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef makeReactionThermo_H
|
||||||
|
#define makeReactionThermo_H
|
||||||
|
|
||||||
|
#include "solidReaction.H"
|
||||||
|
#include "IrreversibleSolidReaction.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#define makeReaction(ReactionType, ReactionRate) \
|
||||||
|
\
|
||||||
|
typedef solidReaction Reaction; \
|
||||||
|
\
|
||||||
|
typedef ReactionType<ReactionRate> \
|
||||||
|
ReactionType##ReactionRate; \
|
||||||
|
\
|
||||||
|
template<> \
|
||||||
|
const word ReactionType##ReactionRate::typeName \
|
||||||
|
( \
|
||||||
|
ReactionType::typeName_() \
|
||||||
|
+ ReactionRate::type() \
|
||||||
|
+ Reaction::typeName_() \
|
||||||
|
); \
|
||||||
|
\
|
||||||
|
addToRunTimeSelectionTable \
|
||||||
|
( \
|
||||||
|
Reaction, \
|
||||||
|
ReactionType##ReactionRate, \
|
||||||
|
Istream \
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
#define makeIRReactions(ReactionRate) \
|
||||||
|
\
|
||||||
|
makeReaction(IrreversibleSolidReaction, ReactionRate)
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "makeSolidReactionThermo.H"
|
||||||
|
#include "solidArrheniusReactionRate.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Make Solid reactions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makeIRReactions(solidArrheniusReactionRate)
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
47
src/thermophysicalModels/solid/rhoType/const/constRho.C
Normal file
47
src/thermophysicalModels/solid/rhoType/const/constRho.C
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constRho.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::constRho::constRho(const dictionary& dict)
|
||||||
|
:
|
||||||
|
rho_(readScalar(dict.subDict("densityProperties").lookup("rho")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<(Ostream& os, const constRho& cr)
|
||||||
|
{
|
||||||
|
os << cr.rho_;
|
||||||
|
|
||||||
|
os.check("Ostream& operator<<(Ostream& os, const constRho& cr)");
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
104
src/thermophysicalModels/solid/rhoType/const/constRho.H
Normal file
104
src/thermophysicalModels/solid/rhoType/const/constRho.H
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::constRho
|
||||||
|
|
||||||
|
Description
|
||||||
|
rho constant
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
constRhoI.H
|
||||||
|
constRho.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef constRho_H
|
||||||
|
#define constRho_H
|
||||||
|
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "autoPtr.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class constRho Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class constRho
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Density [kg/m3]
|
||||||
|
scalar rho_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline constRho(scalar rho);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
//constRho(Istream&);
|
||||||
|
constRho(const dictionary& dict);
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline constRho(const constRho&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
inline autoPtr<constRho> clone() const;
|
||||||
|
|
||||||
|
// Selector from dictionary
|
||||||
|
inline static autoPtr<constRho> New(const dictionary& is);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Return density [kg/m3]
|
||||||
|
inline scalar rho(scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<<(Ostream&, const constRho&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "constRhoI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
67
src/thermophysicalModels/solid/rhoType/const/constRhoI.H
Normal file
67
src/thermophysicalModels/solid/rhoType/const/constRhoI.H
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constRho.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::constRho::constRho
|
||||||
|
(
|
||||||
|
scalar rho
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rho_(rho)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::constRho::constRho(const constRho& pg)
|
||||||
|
:
|
||||||
|
rho_(pg.rho_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::autoPtr<Foam::constRho> Foam::constRho::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<constRho>(new constRho(*this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::autoPtr<Foam::constRho> Foam::constRho::New(const dictionary& is)
|
||||||
|
{
|
||||||
|
return autoPtr<constRho>(new constRho(is));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::constRho::rho(scalar) const
|
||||||
|
{
|
||||||
|
return rho_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constSolidThermo.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Foam::constSolidThermo<rhoType>::constSolidThermo
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(dict),
|
||||||
|
Cp_(readScalar(dict.subDict("thermoProperties").lookup("Cp"))),
|
||||||
|
Hf_(readScalar(dict.subDict("thermoProperties").lookup("Hf")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const constSolidThermo<rhoType>& ct
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << static_cast<const rhoType&>(ct) << tab
|
||||||
|
<< ct.Cp_ << tab << ct.Hf_;
|
||||||
|
|
||||||
|
os.check("Ostream& operator<<(Ostream& os, const constSolidThermo& ct)");
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
142
src/thermophysicalModels/solid/thermo/const/constSolidThermo.H
Normal file
142
src/thermophysicalModels/solid/thermo/const/constSolidThermo.H
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::constSolidThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Constant properties thermodynamics package for solids
|
||||||
|
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
constSolidThermoI.H
|
||||||
|
constSolidThermo.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef constSolidThermo_H
|
||||||
|
#define constSolidThermo_H
|
||||||
|
|
||||||
|
#include "specie.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class rhoType> class constSolidThermo;
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidThermo<rhoType>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class constSolidThermo Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
class constSolidThermo
|
||||||
|
:
|
||||||
|
public rhoType
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
scalar Cp_;
|
||||||
|
scalar Hf_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline constSolidThermo
|
||||||
|
(
|
||||||
|
const rhoType& st,
|
||||||
|
const scalar Cp,
|
||||||
|
const scalar hf
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
constSolidThermo(const dictionary&);
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline constSolidThermo(const word&, const constSolidThermo&);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
inline autoPtr<constSolidThermo> clone() const;
|
||||||
|
|
||||||
|
//- Selector from Istream
|
||||||
|
inline static autoPtr<constSolidThermo> New(dictionary& is);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Fundamental properties
|
||||||
|
|
||||||
|
//- Heat capacity at constant pressure [J/(kg K)]
|
||||||
|
inline scalar Cp(const scalar T) const;
|
||||||
|
|
||||||
|
//- Enthalpy [J/kg]
|
||||||
|
inline scalar h(const scalar T) const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy [J/kg]
|
||||||
|
inline scalar hs(const scalar T) const;
|
||||||
|
|
||||||
|
//- Enthalpy of formation [J/kg]
|
||||||
|
inline scalar hf() const;
|
||||||
|
|
||||||
|
|
||||||
|
// IOstream Operators
|
||||||
|
|
||||||
|
friend Ostream& operator<< <rhoType>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidThermo&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "constSolidThermoI.H"
|
||||||
|
# include "constSolidThermo.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
119
src/thermophysicalModels/solid/thermo/const/constSolidThermoI.H
Normal file
119
src/thermophysicalModels/solid/thermo/const/constSolidThermoI.H
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::constSolidThermo<rhoType>::constSolidThermo
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const constSolidThermo& ct
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(name, ct),
|
||||||
|
Cp_(ct.Cp_),
|
||||||
|
Hf_(ct.Hf_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::constSolidThermo<rhoType>::constSolidThermo
|
||||||
|
(
|
||||||
|
const rhoType& st,
|
||||||
|
const scalar Cp,
|
||||||
|
const scalar hf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(st),
|
||||||
|
Cp_(Cp),
|
||||||
|
Hf_(hf)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::autoPtr<Foam::constSolidThermo<rhoType> >
|
||||||
|
Foam::constSolidThermo<rhoType>::clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<constSolidThermo<rhoType> >
|
||||||
|
(
|
||||||
|
new constSolidThermo<rhoType>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::autoPtr<Foam::constSolidThermo<rhoType> >
|
||||||
|
Foam::constSolidThermo<rhoType>::New(dictionary& is)
|
||||||
|
{
|
||||||
|
return autoPtr<constSolidThermo<rhoType> >
|
||||||
|
(
|
||||||
|
new constSolidThermo<rhoType>(is)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::constSolidThermo<rhoType>::Cp
|
||||||
|
(
|
||||||
|
const scalar
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return Cp_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::constSolidThermo<rhoType>::h
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar hOffset = Cp_*(specie::Tstd);
|
||||||
|
|
||||||
|
return (Cp_*T + Hf_ - hOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::constSolidThermo<rhoType>::hs
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return h(T) - Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::constSolidThermo<rhoType>::hf() const
|
||||||
|
{
|
||||||
|
return Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "exponentialSolidThermo.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Foam::exponentialSolidThermo<rhoType>::exponentialSolidThermo
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(dict),
|
||||||
|
c0_(readScalar(dict.subDict("thermoProperties").lookup("C0"))),
|
||||||
|
n0_(readScalar(dict.subDict("thermoProperties").lookup("n0"))),
|
||||||
|
Tref_(readScalar(dict.subDict("thermoProperties").lookup("Tref"))),
|
||||||
|
Hf_(readScalar(dict.subDict("thermoProperties").lookup("Hf")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const exponentialSolidThermo<rhoType>& et
|
||||||
|
)
|
||||||
|
{
|
||||||
|
os << static_cast<const rhoType&>(et) << nl
|
||||||
|
<< " " << et.c0_
|
||||||
|
<< tab << et.n0_
|
||||||
|
<< tab << et.Tref_
|
||||||
|
<< tab << et.Hf_;
|
||||||
|
|
||||||
|
os << nl << " ";
|
||||||
|
|
||||||
|
os << endl;
|
||||||
|
|
||||||
|
os.check
|
||||||
|
(
|
||||||
|
"operator<<(Ostream& os, const exponentialSolidThermo<rhoType>& et)"
|
||||||
|
);
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::exponentialSolidThermo
|
||||||
|
|
||||||
|
Description
|
||||||
|
Exponential thermodynamics package for solids templated into the rhoType.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
exponentialSolidThermoI.H
|
||||||
|
exponentialSolidThermo.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef exponentialSolidThermo_H
|
||||||
|
#define exponentialSolidThermo_H
|
||||||
|
|
||||||
|
#include "scalar.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "specie.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class rhoType> class exponentialSolidThermo;
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const exponentialSolidThermo<rhoType>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class exponentialSolidThermo Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
class exponentialSolidThermo
|
||||||
|
:
|
||||||
|
public rhoType
|
||||||
|
{
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
scalar c0_;
|
||||||
|
scalar n0_;
|
||||||
|
scalar Tref_;
|
||||||
|
scalar Hf_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Check given temperature is within the range of the fitted coeffs
|
||||||
|
inline void checkT(const scalar T) const;
|
||||||
|
|
||||||
|
//- Integrate Cp expression
|
||||||
|
inline scalar integrateCp(const scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline exponentialSolidThermo
|
||||||
|
(
|
||||||
|
const rhoType& st,
|
||||||
|
const scalar c0,
|
||||||
|
const scalar n0,
|
||||||
|
const scalar Tref,
|
||||||
|
const scalar Hf
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
exponentialSolidThermo(const dictionary&);
|
||||||
|
|
||||||
|
//- Construct as a named copy
|
||||||
|
inline exponentialSolidThermo
|
||||||
|
(
|
||||||
|
const word&,
|
||||||
|
const exponentialSolidThermo&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Heat capacity at constant pressure [J/(kg K)]
|
||||||
|
inline scalar Cp(const scalar T) const;
|
||||||
|
|
||||||
|
//- Enthalpy [J/kmol]
|
||||||
|
inline scalar h(const scalar T) const;
|
||||||
|
|
||||||
|
//- Sensible enthalpy [J/kg]
|
||||||
|
inline scalar hs(const scalar T) const;
|
||||||
|
|
||||||
|
//- Formation enthalpy [J/kg]
|
||||||
|
inline scalar hf() const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <rhoType>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const exponentialSolidThermo&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "exponentialSolidThermoI.H"
|
||||||
|
# include "exponentialSolidThermo.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "exponentialSolidThermo.H"
|
||||||
|
#include "specie.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline void Foam::exponentialSolidThermo<rhoType>::checkT(const scalar T) const
|
||||||
|
{
|
||||||
|
if (T < 0.0)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"exponentialSolidThermo<rhoType>::checkT(const scalar T) const"
|
||||||
|
) << "attempt to use exponentialSolidThermo<rhoType>"
|
||||||
|
" out of temperature range "
|
||||||
|
<< T
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::exponentialSolidThermo<rhoType>::exponentialSolidThermo
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const exponentialSolidThermo& jt
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(name, jt),
|
||||||
|
c0_(jt.c0_),
|
||||||
|
n0_(jt.n0_),
|
||||||
|
Tref_(jt.Tref_),
|
||||||
|
Hf_(jt.Hf_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::exponentialSolidThermo<rhoType>::exponentialSolidThermo
|
||||||
|
(
|
||||||
|
const rhoType& st,
|
||||||
|
const scalar c0,
|
||||||
|
const scalar n0,
|
||||||
|
const scalar Tref,
|
||||||
|
const scalar Hf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
rhoType(st),
|
||||||
|
c0_(c0),
|
||||||
|
n0_(n0),
|
||||||
|
Tref_(Tref),
|
||||||
|
Hf_(Hf)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidThermo<rhoType>::integrateCp
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
c0_*pow(T, n0_ + 1.0)
|
||||||
|
/(pow(Tref_, n0_)*(n0_ + 1.0))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidThermo<rhoType>::Cp
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return c0_*pow(T/Tref_, n0_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidThermo<rhoType>::h
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar hOffset = integrateCp(specie::Tstd);
|
||||||
|
|
||||||
|
return
|
||||||
|
(
|
||||||
|
integrateCp(T) + Hf_ - hOffset
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidThermo<rhoType>::hs
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return h(T) - Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class rhoType>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidThermo<rhoType>::hf() const
|
||||||
|
{
|
||||||
|
return Hf_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "constSolidTransport.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Foam::constSolidTransport<thermo>::constSolidTransport(const dictionary& dict)
|
||||||
|
:
|
||||||
|
thermo(dict),
|
||||||
|
K_(readScalar(dict.subDict("transportProperties").lookup("K")))
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const constSolidTransport<thermo>& ct
|
||||||
|
)
|
||||||
|
{
|
||||||
|
operator<<(os, static_cast<const thermo&>(ct));
|
||||||
|
os << tab << ct.K_;
|
||||||
|
|
||||||
|
os.check("Ostream& operator<<(Ostream& os,const constSolidTransport& ct)");
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::constSolidTransport
|
||||||
|
|
||||||
|
Description
|
||||||
|
Constant properties Transport package.
|
||||||
|
Templated into a given thermodynamics package (needed for thermal
|
||||||
|
conductivity).
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
constSolidTransportI.H
|
||||||
|
constSolidTransport.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef constSolidTransport_H
|
||||||
|
#define constSolidTransport_H
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class thermo> class constSolidTransport;
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidTransport<thermo>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class constSolidTransport Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
class constSolidTransport
|
||||||
|
:
|
||||||
|
public thermo
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Constant thermal conductivity.
|
||||||
|
scalar K_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline constSolidTransport
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar k
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline constSolidTransport(const word&, const constSolidTransport&);
|
||||||
|
|
||||||
|
//- Construct from Istream
|
||||||
|
//constSolidTransport(Istream&);
|
||||||
|
constSolidTransport(const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/mK]
|
||||||
|
inline scalar K(const scalar T) const;
|
||||||
|
|
||||||
|
//- Thermal diffusivity [kg/ms]
|
||||||
|
inline scalar alpha(const scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <thermo>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const constSolidTransport&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "constSolidTransportI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "constSolidTransport.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::constSolidTransport<thermo>::constSolidTransport
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar k
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(t),
|
||||||
|
K_(k)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::constSolidTransport<thermo>::constSolidTransport
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const constSolidTransport& ct
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(name, ct),
|
||||||
|
K_(ct.K_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::scalar Foam::constSolidTransport<thermo>::K(const scalar T) const
|
||||||
|
{
|
||||||
|
return K_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::scalar Foam::constSolidTransport<thermo>::alpha
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar Cp = this->Cp(T);
|
||||||
|
|
||||||
|
scalar rho = this->rho(T);
|
||||||
|
|
||||||
|
return K_/(rho*Cp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "exponentialSolidTransport.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
|
||||||
|
(
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(dict),
|
||||||
|
K0_(0.0),
|
||||||
|
n0_(0.0),
|
||||||
|
Tref_(0.0)
|
||||||
|
{
|
||||||
|
const dictionary& subDict = dict.subDict("transportProperties");
|
||||||
|
K0_ = readScalar(subDict.lookup("K0"));
|
||||||
|
n0_ = readScalar(subDict.lookup("n0"));
|
||||||
|
Tref_ = readScalar(subDict.lookup("Tref"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os, const exponentialSolidTransport<thermo>& et
|
||||||
|
)
|
||||||
|
{
|
||||||
|
operator<<(os, static_cast<const thermo&>(et));
|
||||||
|
os << tab << et.K0_ << tab << et.n0_ << tab << et.Tref_;
|
||||||
|
|
||||||
|
os.check
|
||||||
|
(
|
||||||
|
"Ostream& operator<<(Ostream& os, const exponentialSolidTransport& et)"
|
||||||
|
);
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::exponentialSolidTransport
|
||||||
|
|
||||||
|
Description
|
||||||
|
Exponential properties for solid heat transport
|
||||||
|
Templated into a given thermodynamics package.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
exponentialSolidTransportI.H
|
||||||
|
exponentialSolidTransport.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef exponentialSolidTransport_H
|
||||||
|
#define exponentialSolidTransport_H
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class thermo> class exponentialSolidTransport;
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const exponentialSolidTransport<thermo>&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class exponentialSolidTransport Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
class exponentialSolidTransport
|
||||||
|
:
|
||||||
|
public thermo
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Constant thermal coefficient.
|
||||||
|
scalar K0_;
|
||||||
|
|
||||||
|
//- Exponent coefficient
|
||||||
|
scalar n0_;
|
||||||
|
|
||||||
|
//- Reference temperature
|
||||||
|
scalar Tref_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
inline exponentialSolidTransport
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar K0,
|
||||||
|
const scalar n0,
|
||||||
|
const scalar Tref
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct as named copy
|
||||||
|
inline exponentialSolidTransport
|
||||||
|
(
|
||||||
|
const word&,
|
||||||
|
const exponentialSolidTransport&
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
exponentialSolidTransport(const dictionary&);
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
//- Thermal conductivity [W/mK]
|
||||||
|
inline scalar K(const scalar T) const;
|
||||||
|
|
||||||
|
//- Thermal diffusivity [kg/ms]
|
||||||
|
inline scalar alpha(const scalar T) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Ostream Operator
|
||||||
|
|
||||||
|
friend Ostream& operator<< <thermo>
|
||||||
|
(
|
||||||
|
Ostream&,
|
||||||
|
const exponentialSolidTransport&
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#include "exponentialSolidTransportI.H"
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "exponentialSolidTransport.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
|
||||||
|
(
|
||||||
|
const thermo& t,
|
||||||
|
const scalar K0,
|
||||||
|
const scalar n0,
|
||||||
|
const scalar Tref
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(t),
|
||||||
|
K0_(K0),
|
||||||
|
n0_(n0),
|
||||||
|
Tref_(Tref)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const exponentialSolidTransport& ct
|
||||||
|
)
|
||||||
|
:
|
||||||
|
thermo(name, ct),
|
||||||
|
K0_(ct.K0_),
|
||||||
|
n0_(ct.n0_),
|
||||||
|
Tref_(ct.Tref_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::K
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return (K0_*pow(T/Tref_, n0_));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class thermo>
|
||||||
|
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::alpha
|
||||||
|
(
|
||||||
|
const scalar T
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar Cp = this->Cp(T);
|
||||||
|
|
||||||
|
scalar rho = this->rho(T);
|
||||||
|
|
||||||
|
return (K(T)/(rho*Cp));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object Tchar;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object Ypmma;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
".*"
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -12,14 +12,14 @@ runApplication splitMeshRegions -cellZones -overwrite
|
|||||||
# remove fluid fields from solid regions (important for post-processing)
|
# remove fluid fields from solid regions (important for post-processing)
|
||||||
for i in heater leftSolid rightSolid
|
for i in heater leftSolid rightSolid
|
||||||
do
|
do
|
||||||
rm -f 0*/$i/{mut,alphat,epsilon,k,p,U}
|
rm -f 0*/$i/{mut,alphat,epsilon,k,p,U,p_rgh}
|
||||||
done
|
done
|
||||||
|
|
||||||
## remove solid fields from fluid regions (important for post-processing)
|
# remove solid fields from fluid regions (important for post-processing)
|
||||||
#for i in bottomAir topAir
|
for i in bottomAir topAir
|
||||||
#do
|
do
|
||||||
# rm -f 0*/$i/{cp,K,rho}
|
rm -f 0*/$i/{Ychar,Ypmma}
|
||||||
#done
|
done
|
||||||
|
|
||||||
for i in bottomAir topAir heater leftSolid rightSolid
|
for i in bottomAir topAir heater leftSolid rightSolid
|
||||||
do
|
do
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: 1.6 |
|
| \\ / O peration | Version: dev |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -15,48 +15,60 @@ FoamFile
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
thermoType constSolidThermo;
|
thermoType constSolidThermo;
|
||||||
//thermoType interpolatedSolidThermo;
|
//thermoType isotropicKSolidThermo;
|
||||||
//thermoType directionalSolidThermo;
|
//thermoType directionalKSolidThermo;
|
||||||
|
//thermoType solidMixtureThermo<multiComponentSolidMixture<exponentialSolidTransport<constSolidRad<exponentialSolidThermo<constRho>>>>>;
|
||||||
|
|
||||||
|
|
||||||
constSolidThermoCoeffs
|
constSolidThermoCoeffs
|
||||||
{
|
{
|
||||||
//- constant properties
|
//- thermo properties
|
||||||
|
|
||||||
rho rho [1 -3 0 0 0 0 0] 8000;
|
rho rho [1 -3 0 0 0 0 0] 8000;
|
||||||
cp cp [0 2 -2 -1 0 0 0] 450;
|
Cp Cp [0 2 -2 -1 0 0 0] 450;
|
||||||
K K [1 1 -3 -1 0 0 0] 80;
|
K K [1 1 -3 -1 0 0 0] 80;
|
||||||
|
|
||||||
// N/A
|
//- radiative properties
|
||||||
Hf Hf [0 2 -2 0 0 0 0] 1;
|
kappa kappa [0 -1 0 0 0 0 0] 0;
|
||||||
|
sigmaS sigmaS [0 -1 0 0 0 0 0] 0;
|
||||||
emissivity emissivity [0 0 0 0 0 0 0] 1;
|
emissivity emissivity [0 0 0 0 0 0 0] 1;
|
||||||
|
|
||||||
|
//- chemical properties
|
||||||
|
Hf Hf [0 2 -2 0 0 0 0] 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interpolatedSolidThermoCoeffs
|
isotropicKSolidThermoCoeffs
|
||||||
{
|
{
|
||||||
//- interpolated properties
|
|
||||||
|
|
||||||
|
//- thermo properties
|
||||||
TValues (100 1000);
|
TValues (100 1000);
|
||||||
rhoValues (1700 1700);
|
rhoValues (1000 1700);
|
||||||
cpValues (1700 1700);
|
cpValues (1700 1700);
|
||||||
KValues (80 40);
|
KValues (80 40);
|
||||||
HfValues (1 1);
|
|
||||||
|
|
||||||
|
//- radiative properties
|
||||||
emissivityValues (1 1);
|
emissivityValues (1 1);
|
||||||
|
kappaValues (0 0);
|
||||||
|
sigmaSValues (0 0);
|
||||||
|
|
||||||
|
//- chemical properties
|
||||||
|
HfValues (1 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
directionalSolidThermoCoeffs
|
directionalKSolidThermoCoeffs
|
||||||
{
|
{
|
||||||
//- does interpolation and directional K in coordinate system.
|
//- does interpolation and directional K in coordinate system.
|
||||||
// Specify multiple values, one for each temperature. Properties are
|
// Specify multiple values, one for each temperature. Properties are
|
||||||
// interpolated according to the local temperature.
|
// interpolated according to the local temperature.
|
||||||
|
|
||||||
|
//- thermo properties
|
||||||
TValues (100 1000);
|
TValues (100 1000);
|
||||||
rhoValues (1700 1700);
|
rhoValues (1000 1700);
|
||||||
cpValues (1700 1700);
|
cpValues (1700 1700);
|
||||||
|
KValues ((10 10 10) (40 40 40));
|
||||||
KValues ((40 40 40) (40 40 40));
|
|
||||||
|
|
||||||
coordinateSystem
|
coordinateSystem
|
||||||
{
|
{
|
||||||
@ -69,8 +81,72 @@ directionalSolidThermoCoeffs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- chemical properties
|
||||||
HfValues (1 1);
|
HfValues (1 1);
|
||||||
|
|
||||||
|
//- radiative properties
|
||||||
emissivityValues (1 1);
|
emissivityValues (1 1);
|
||||||
|
kappaValues (1 1);
|
||||||
|
sigmaSValues (1 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
solidComponents
|
||||||
|
(
|
||||||
|
pmma char
|
||||||
|
);
|
||||||
|
|
||||||
|
pmmaCoeffs
|
||||||
|
{
|
||||||
|
transportProperties
|
||||||
|
{
|
||||||
|
K0 0.152;
|
||||||
|
n0 1.3;
|
||||||
|
Tref 300; //K0*pow(T/Tref_, n0))
|
||||||
|
}
|
||||||
|
radiativeProperties
|
||||||
|
{
|
||||||
|
sigmaS 0.0;
|
||||||
|
kappa 0.0;
|
||||||
|
emissivity 0.1;
|
||||||
|
}
|
||||||
|
thermoProperties
|
||||||
|
{
|
||||||
|
Hf 0;
|
||||||
|
C0 1462; // Cp = C0*(T/Tref)^n0
|
||||||
|
Tref 300;
|
||||||
|
n0 1.31;
|
||||||
|
}
|
||||||
|
densityProperties
|
||||||
|
{
|
||||||
|
rho 1114.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
charCoeffs
|
||||||
|
{
|
||||||
|
transportProperties
|
||||||
|
{
|
||||||
|
K0 0.4;
|
||||||
|
n0 1.3;
|
||||||
|
Tref 300; //K0*pow(T/Tref_, n0))
|
||||||
|
}
|
||||||
|
radiativeProperties
|
||||||
|
{
|
||||||
|
sigmaS 0.0;
|
||||||
|
kappa 0.0;
|
||||||
|
emissivity 0.0;
|
||||||
|
}
|
||||||
|
thermoProperties
|
||||||
|
{
|
||||||
|
Hf 0;
|
||||||
|
C0 611.0;; // Cp = C0*(T/Tref)^n0
|
||||||
|
Tref 300;
|
||||||
|
n0 1.31;
|
||||||
|
}
|
||||||
|
densityProperties
|
||||||
|
{
|
||||||
|
rho 11.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,7 +29,7 @@ deltaT 0.001;
|
|||||||
|
|
||||||
writeControl adjustableRunTime;
|
writeControl adjustableRunTime;
|
||||||
|
|
||||||
writeInterval 50;
|
writeInterval 5;
|
||||||
|
|
||||||
purgeWrite 0;
|
purgeWrite 0;
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user