Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2010-12-08 18:04:53 +00:00
152 changed files with 7116 additions and 1893 deletions

View File

@ -5,6 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude

View File

@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \

View File

@ -4,7 +4,7 @@
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.cp();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();

View File

@ -4,11 +4,12 @@
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.cp();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();
//tmp<volSymmTensorField> tK = thermo.directionalK();
const volScalarField& K = tK();
//const volSymmTensorField& K = tK();
volScalarField& T = thermo.T();

View File

@ -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;
}
// ************************************************************************* //

View File

@ -41,6 +41,15 @@ namespace Foam
const volScalarField& Cprho,
const volScalarField& K
);
scalar solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& K
);
}
#endif

View File

@ -18,6 +18,8 @@ if (finalIter)
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
}
thermo.correct();
if (finalIter)
{
mesh.data::remove("finalIteration");

View File

@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -33,8 +33,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \

View File

@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -32,8 +32,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \

View File

@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
@ -26,8 +26,8 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \

View File

@ -9,8 +9,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -31,8 +31,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \

View File

@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -32,8 +32,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \

View File

@ -47,9 +47,9 @@ EXE_LIBS = \
-lrandomProcesses \
-lreactionThermophysicalModels \
-lsampling \
-lsolidMixture \
-lpointSolidMixture \
-lsolidParticle \
-lsolids \
-lpointSolids \
-lspecie \
-lsurfMesh \
-lsystemCall \

View File

@ -58,17 +58,17 @@ const scalar
Foam::KRR4::KRR4(const ODE& ode)
:
ODESolver(ode),
yTemp_(n_),
dydxTemp_(n_),
g1_(n_),
g2_(n_),
g3_(n_),
g4_(n_),
yErr_(n_),
dfdx_(n_),
dfdy_(n_, n_),
a_(n_, n_),
pivotIndices_(n_)
yTemp_(n_, 0.0),
dydxTemp_(n_, 0.0),
g1_(n_, 0.0),
g2_(n_, 0.0),
g3_(n_, 0.0),
g4_(n_, 0.0),
yErr_(n_, 0.0),
dfdx_(n_, 0.0),
dfdy_(n_, n_, 0.0),
a_(n_, n_, 0.0),
pivotIndices_(n_, 0.0)
{}

View File

@ -57,14 +57,14 @@ const scalar
Foam::RK::RK(const ODE& ode)
:
ODESolver(ode),
yTemp_(n_),
ak2_(n_),
ak3_(n_),
ak4_(n_),
ak5_(n_),
ak6_(n_),
yErr_(n_),
yTemp2_(n_)
yTemp_(n_, 0.0),
ak2_(n_, 0.0),
ak3_(n_, 0.0),
ak4_(n_, 0.0),
ak5_(n_, 0.0),
ak6_(n_, 0.0),
yErr_(n_, 0.0),
yTemp2_(n_, 0.0)
{}

View File

@ -50,17 +50,17 @@ namespace Foam
Foam::SIBS::SIBS(const ODE& ode)
:
ODESolver(ode),
a_(iMaxX_),
alpha_(kMaxX_, kMaxX_),
d_p_(n_, kMaxX_),
x_p_(kMaxX_),
err_(kMaxX_),
a_(iMaxX_, 0.0),
alpha_(kMaxX_, kMaxX_, 0.0),
d_p_(n_, kMaxX_, 0.0),
x_p_(kMaxX_, 0.0),
err_(kMaxX_, 0.0),
yTemp_(n_),
ySeq_(n_),
yErr_(n_),
dfdx_(n_),
dfdy_(n_, n_),
yTemp_(n_, 0.0),
ySeq_(n_, 0.0),
yErr_(n_, 0.0),
dfdx_(n_, 0.0),
dfdy_(n_, n_, 0.0),
first_(1),
epsOld_(-1.0)
{}

View File

@ -8,8 +8,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
@ -30,8 +30,8 @@ LIB_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lreactionThermophysicalModels \
-lSLGThermo \
-lcompressibleRASModels \

View File

@ -7,8 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
@ -27,8 +27,8 @@ LIB_LIBS = \
-lpdf \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lspecie \
-lbasicThermophysicalModels \
-lreactionThermophysicalModels \

View File

@ -100,7 +100,7 @@ const Foam::liquidMixture& Foam::CompositionModel<CloudType>::liquids() const
template<class CloudType>
const Foam::solidMixture& Foam::CompositionModel<CloudType>::solids() const
const Foam::pointSolidMixture& Foam::CompositionModel<CloudType>::solids() const
{
return thermo_.solids();
}

View File

@ -143,7 +143,7 @@ public:
const liquidMixture& liquids() const;
//- Return the global (additional) solids
const solidMixture& solids() const;
const pointSolidMixture& solids() const;
//- Return the list of phase properties
const phasePropertiesList& phaseProps() const;

View File

@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \

View File

@ -3,11 +3,12 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso specie
wmake libso solid
wmake libso thermophysicalFunctions
wmake libso liquids
wmake libso liquidMixture
wmake libso solids
wmake libso solidMixture
wmake libso pointSolids
wmake libso pointSolidMixture
wmake libso basic
wmake libso reactionThermo

View File

@ -4,8 +4,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
LIB_LIBS = \

View File

@ -72,7 +72,7 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo)
if (thermo.found("solids"))
{
solids_ = solidMixture::New(thermo.subDict("solids"));
solids_ = pointSolidMixture::New(thermo.subDict("solids"));
Info<< " solids - " << solids_->components().size()
<< " 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())
{
FatalErrorIn
(
"const Foam::solidMixture& Foam::SLGThermo::solids() const"
"const Foam::pointSolidtMixture& Foam::SLGThermo::solids() const"
) << "solids requested, but object is not allocated"
<< abort(FatalError);
}

View File

@ -49,7 +49,7 @@ SourceFiles
#include "basicThermo.H"
#include "basicMultiComponentMixture.H"
#include "liquidMixture.H"
#include "solidMixture.H"
#include "pointSolidMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,7 +76,7 @@ class SLGThermo
autoPtr<liquidMixture> liquids_;
//- Additional solid properties data
autoPtr<solidMixture> solids_;
autoPtr<pointSolidMixture> solids_;
public:
@ -108,7 +108,7 @@ public:
const liquidMixture& liquids() const;
//- Return reference to the global (additional) solids
const solidMixture& solids() const;
const pointSolidMixture& solids() const;
// Index retrieval

View File

@ -1,7 +1,13 @@
constSolidThermo/constSolidThermo.C
directionalSolidThermo/directionalSolidThermo.C
basicSolidThermo/basicSolidThermo.C
basicSolidThermo/basicSolidThermoNew.C
constSolidThermo/constSolidThermo.C
directionalKSolidThermo/directionalKSolidThermo.C
interpolatedSolidThermo/interpolatedSolidThermo.C
interpolatedSolidThermo/interpolateSolid/interpolateSolid.C
isotropicKSolidThermo/isotropicKSolidThermo.C
solidMixtureThermo/mixtures/basicSolidMixture/basicSolidMixture.C
solidMixtureThermo/solidMixtureThermo/solidMixtureThermos.C
LIB = $(FOAM_LIBBIN)/libbasicSolidThermo

View File

@ -1,7 +1,10 @@
EXE_INC = \
-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 = \
-lmeshTools \
-lfiniteVolume
-lfiniteVolume \
-lsolid

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,10 +23,11 @@ License
\*---------------------------------------------------------------------------*/
#include "basicSolidThermo.H"
#include "fvMesh.H"
#include "HashTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
namespace Foam
{
@ -34,6 +35,7 @@ namespace Foam
defineRunTimeSelectionTable(basicSolidThermo, mesh);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
@ -45,7 +47,7 @@ Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
"solidThermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
@ -61,7 +63,60 @@ Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
IOobject::AUTO_WRITE
),
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 * * * * * * * * * * * * * //
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
{
return true;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,20 +25,24 @@ Class
Foam::basicSolidThermo
Description
The thermophysical properties of a basicSolidThermo
Basic solid thermodynamic properties
SourceFiles
basicSolidThermo.C
newBasicSolidThermo.C
newBasicThermo.C
\*---------------------------------------------------------------------------*/
#ifndef basicSolidThermo_H
#define basicSolidThermo_H
#include "runTimeSelectionTables.H"
#include "volFields.H"
#include "runTimeSelectionTables.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
:
public IOdictionary
{
protected:
// Protected data
const fvMesh& mesh_;
//- Temperature [K]
volScalarField T_;
// Fields
//- 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:
@ -68,8 +87,7 @@ public:
//- Runtime type information
TypeName("basicSolidThermo");
//- Declare run-time constructor selection tables
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
@ -94,97 +112,102 @@ public:
virtual ~basicSolidThermo();
// Member Functions
// Member functions
//- Update properties
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]
inline const volScalarField& T() const;
const volScalarField& T() const;
//- Temperature [K]
inline volScalarField& T();
//- non-const access for T
volScalarField& T();
//- Density [kg/m3]
virtual tmp<volScalarField> rho() const = 0;
//- non-const access for rho
volScalarField& rho();
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> cp() const = 0;
//- Thermal conductivity [W/(m.K)]
virtual tmp<volScalarField> K() const = 0;
// Derived thermal properties
//- Thermal conductivity [W/(m.K)]
virtual tmp<volSymmTensorField> directionalK() const = 0;
//- Specific heat capacity [J/kg/K]
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;
// 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 []
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;
// Ostream Operator
//- Read thermophysicalProperties dictionary
virtual bool read() = 0;
//- Ostream Operator
friend Ostream& operator<<(Ostream& os, const basicSolidThermo& s);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "basicSolidThermoI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -1,232 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "interpolateSolidThermo.H"
#include "addToRunTimeSelectionTable.H"
#include "interpolateXY.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(interpolateSolidThermo, 0);
addToRunTimeSelectionTable
(
basicSolidThermo,
interpolateSolidThermo,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::interpolateSolidThermo::interpolateSolidThermo
(
const fvMesh& mesh,
const dictionary& dict
)
:
basicSolidThermo(mesh, dict, typeName),
TValues_(dict_.lookup("TValues")),
rhoValues_(dict_.lookup("rhoValues")),
cpValues_(dict_.lookup("cpValues")),
KValues_(dict_.lookup("KValues")),
HfValues_(dict_.lookup("HfValues")),
emissivityValues_(dict_.lookup("emissivityValues"))
{
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
(
"interpolateSolidThermo::interpolateSolidThermo\n"
"(\n"
" const fvMesh& mesh,\n"
" const dictionary& dict\n"
")\n",
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
(
"interpolateSolidThermo::interpolateSolidThermo\n"
"(\n"
" const fvMesh& mesh,\n"
" const dictionary& dict\n"
")\n",
dict_
) << "Temperature values are not in increasing order "
<< TValues_ << exit(FatalIOError);
}
}
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::interpolateSolidThermo::~interpolateSolidThermo()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::interpolateSolidThermo::correct()
{
// rho
rho_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
rhoValues_
);
forAll(rho_.boundaryField(), patchI)
{
rho_.boundaryField()[patchI] == interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
rhoValues_
);
}
// cp
cp_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
cpValues_
);
forAll(cp_.boundaryField(), patchI)
{
cp_.boundaryField()[patchI] == interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
cpValues_
);
}
// K
K_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
KValues_
);
forAll(K_.boundaryField(), patchI)
{
K_.boundaryField()[patchI] == interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
KValues_
);
}
// Hf
Hf_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
HfValues_
);
forAll(Hf_.boundaryField(), patchI)
{
Hf_.boundaryField()[patchI] == interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
HfValues_
);
}
// emissivity
emissivity_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
emissivityValues_
);
forAll(emissivity_.boundaryField(), patchI)
{
emissivity_.boundaryField()[patchI] == interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
emissivityValues_
);
}
}
void Foam::interpolateSolidThermo::write(Ostream& os) const
{
basicSolidThermo::write(os);
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("KValues") << KValues_ << token::END_STATEMENT << nl;
os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
os.writeKeyword("emissivityValues") << emissivityValues_
<< token::END_STATEMENT << nl;
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const interpolateSolidThermo& s)
{
s.write(os);
return os;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,14 +40,39 @@ namespace Foam
Foam::constSolidThermo::constSolidThermo(const fvMesh& mesh)
:
basicSolidThermo(mesh),
constRho_("zero", dimDensity, 0.0),
constCp_("zero", dimEnergy/(dimMass*dimTemperature), 0.0),
constK_("zero", dimEnergy/dimTime/(dimLength*dimTemperature), 0.0),
constHf_("zero", dimEnergy/dimMass, 0.0),
constEmissivity_("zero", dimless, 0.0)
dict_(subDict(typeName + "Coeffs")),
constK_(dimensionedScalar(dict_.lookup("K"))),
K_
(
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();
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>
(
@ -71,28 +96,7 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::rho() const
(
IOobject
(
"rho",
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",
"Cp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
@ -105,79 +109,13 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::cp() const
}
//Foam::tmp<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
const Foam::volScalarField& Foam::constSolidThermo::K() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"K",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
constK_
)
);
return K_;
}
//Foam::tmp<Foam::volSymmTensorField> Foam::constSolidThermo::directionalK()
//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
const Foam::volSymmTensorField& Foam::constSolidThermo::directionalK() const
{
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
(
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
@ -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()
{
return read(subDict(typeName + "Coeffs"));
@ -368,17 +317,21 @@ bool Foam::constSolidThermo::read()
bool Foam::constSolidThermo::read(const dictionary& dict)
{
constRho_ = dimensionedScalar(dict.lookup("rho"));
constCp_ = dimensionedScalar(dict.lookup("cp"));
constCp_ = dimensionedScalar(dict.lookup("Cp"));
constK_ = dimensionedScalar(dict.lookup("K"));
constHf_ = dimensionedScalar(dict.lookup("Hf"));
constEmissivity_ = dimensionedScalar(dict.lookup("emissivity"));
constKappa_ = dimensionedScalar(dict_.lookup("kappa"));
constSigmaS_ = dimensionedScalar(dict_.lookup("sigmaS"));
Info<< "Constructed constSolidThermo with" << nl
<< " rho : " << constRho_ << nl
<< " cp : " << constCp_ << nl
<< " Cp : " << constCp_ << nl
<< " K : " << constK_ << nl
<< " Hf : " << constHf_ << nl
<< " emissivity : " << constEmissivity_ << nl
<< " kappa : " << constKappa_ << nl
<< " sigmaS : " << constSigmaS_ << nl
<< endl;
return true;
@ -389,9 +342,11 @@ bool Foam::constSolidThermo::writeData(Ostream& os) const
{
bool ok = basicSolidThermo::writeData(os);
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("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
<< nl;
return ok && os.good();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,29 +43,45 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class constSolidThermo Declaration
Class constSolidThermo Declaration
\*---------------------------------------------------------------------------*/
class constSolidThermo
:
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]
dimensionedScalar constRho_;
//- Specific heat capacity [J/(kg.K)]
dimensionedScalar constCp_;
//- Thermal conductivity [W/(m.K)]
//dimensionedSymmTensor constK_;
dimensionedScalar constK_;
//- Heat of formation [J/kg]
dimensionedScalar constHf_;
//- Emissivity
dimensionedScalar constEmissivity_;
//- Absorptivity [1/m]
dimensionedScalar constKappa_;
//- Scatter [1/m]
dimensionedScalar constSigmaS_;
public:
//- Runtime type information
@ -77,9 +93,8 @@ public:
//- Construct from mesh
constSolidThermo(const fvMesh& mesh);
// Destructor
virtual ~constSolidThermo();
//- Destructor
virtual ~constSolidThermo();
// Member Functions
@ -87,24 +102,23 @@ public:
//- Update properties
virtual void correct();
//- Density [kg/m3]
virtual tmp<volScalarField> rho() const;
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> cp() const;
// Acces functions
//- Constant access to K
virtual const volScalarField& K() const;
//- Thermal conductivity [W/(m.K)]
// Note: needs supplied K to be isotropic
virtual tmp<volScalarField> K() const;
virtual const volSymmTensorField& directionalK() const;
//- Thermal conductivity [W/(m.K)]
virtual tmp<volSymmTensorField> directionalK() const;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> Hf() const;
// Derived properties
//- Emissivity []
virtual tmp<volScalarField> emissivity() const;
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> Cp() const;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> Hf() const;
// Per patch calculation
@ -112,19 +126,25 @@ public:
//- 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;
//- Specific heat capacity [J/kg/K)]
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;
//- Thermal conductivity [W/(m.K)]
virtual tmp<symmTensorField> directionalK(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;
//- 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;
@ -139,11 +159,8 @@ public:
//- Read solidThermophysicalProperties dictionary
bool read(const dictionary&);
// Ostream Operator
friend Ostream& operator<<(Ostream& os, const constSolidThermo& s);
//- Ostream Operator
friend Ostream& operator<<(Ostream& os, const constSolidThermo& s);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,9 +23,8 @@ License
\*---------------------------------------------------------------------------*/
#include "directionalSolidThermo.H"
#include "directionalKSolidThermo.H"
#include "addToRunTimeSelectionTable.H"
#include "interpolateXY.H"
#include "transform.H"
#include "transformField.H"
@ -33,11 +32,11 @@ License
namespace Foam
{
defineTypeNameAndDebug(directionalSolidThermo, 0);
defineTypeNameAndDebug(directionalKSolidThermo, 0);
addToRunTimeSelectionTable
(
basicSolidThermo,
directionalSolidThermo,
directionalKSolidThermo,
mesh
);
}
@ -45,9 +44,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::directionalSolidThermo::directionalSolidThermo(const fvMesh& mesh)
Foam::directionalKSolidThermo::directionalKSolidThermo(const fvMesh& mesh)
:
basicSolidThermo(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
@ -62,7 +74,7 @@ Foam::directionalSolidThermo::directionalSolidThermo(const fvMesh& mesh)
dimLength
)
{
read();
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues"));
// Determine transforms for cell centres
forAll(mesh.C(), cellI)
@ -110,7 +122,7 @@ Foam::directionalSolidThermo::directionalSolidThermo(const fvMesh& mesh)
if (debug)
{
Info<< "directionalSolidThermo : dumping converted Kxx, Kyy, Kzz"
Info<< "directionalKSolidThermo : dumping converted Kxx, Kyy, Kzz"
<< endl;
{
volVectorField Kxx
@ -234,13 +246,13 @@ Foam::directionalSolidThermo::directionalSolidThermo(const fvMesh& mesh)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::directionalSolidThermo::~directionalSolidThermo()
Foam::directionalKSolidThermo::~directionalKSolidThermo()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::symmTensor Foam::directionalSolidThermo::transformPrincipal
Foam::symmTensor Foam::directionalKSolidThermo::transformPrincipal
(
const tensor& tt,
const vector& st
@ -275,7 +287,7 @@ Foam::symmTensor Foam::directionalSolidThermo::transformPrincipal
}
void Foam::directionalSolidThermo::transformField
void Foam::directionalKSolidThermo::transformField
(
symmTensorField& fld,
const tensorField& tt,
@ -290,104 +302,23 @@ void Foam::directionalSolidThermo::transformField
}
void Foam::directionalSolidThermo::correct()
{}
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::rho() const
void Foam::directionalKSolidThermo::correct()
{
tmp<volScalarField> trho
(
new volScalarField
(
IOobject
(
"rho",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimDensity
)
);
volScalarField& rho = trho();
rho.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
rhoValues_
);
forAll(rho.boundaryField(), patchI)
{
rho.boundaryField()[patchI] == this->rho(patchI)();
}
return trho;
calculate();
interpolatedSolidThermo::calculate();
}
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::cp() const
const Foam::volSymmTensorField&
Foam::directionalKSolidThermo::directionalK() 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();
cp.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
cpValues_
);
forAll(cp.boundaryField(), patchI)
{
cp.boundaryField()[patchI] == this->cp(patchI)();
}
return tcp;
return directionalK_;
}
Foam::tmp<Foam::volSymmTensorField> Foam::directionalSolidThermo::directionalK()
const
void Foam::directionalKSolidThermo::calculate()
{
tmp<volSymmTensorField> tK
(
new volSymmTensorField
(
IOobject
(
"K",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimEnergy/dimTime/(dimLength*dimTemperature)
)
);
volSymmTensorField& K = tK();
// Get temperature interpolated properties (principal directions)
// Correct directionalK
Field<vector> localK
(
interpolateXY
@ -399,18 +330,21 @@ const
);
// Transform into global coordinate system
transformField(K.internalField(), ccTransforms_.internalField(), localK);
transformField
(
directionalK_.internalField(),
ccTransforms_.internalField(),
localK
);
forAll(K.boundaryField(), patchI)
forAll(directionalK_.boundaryField(), patchI)
{
K.boundaryField()[patchI] == this->directionalK(patchI)();
directionalK_.boundaryField()[patchI] == this->directionalK(patchI)();
}
return tK;
}
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::K() const
const Foam::volScalarField& Foam::directionalKSolidThermo::K() const
{
forAll(KValues_, i)
{
@ -422,7 +356,7 @@ Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::K() const
|| v.y() != v.z()
)
{
FatalErrorIn("directionalSolidThermo::K() const")
FatalErrorIn("directionalKSolidThermo::K() const")
<< "Supplied K values " << KValues_
<< " are not isotropic." << exit(FatalError);
}
@ -473,119 +407,7 @@ Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::K() const
}
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::Hf() const
{
tmp<volScalarField> tHf
(
new volScalarField
(
IOobject
(
"Hf",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimEnergy/dimMass
)
);
volScalarField& Hf = tHf();
Hf.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
HfValues_
);
forAll(Hf.boundaryField(), patchI)
{
Hf.boundaryField()[patchI] == this->Hf(patchI)();
}
return tHf;
}
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::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::directionalSolidThermo::rho
(
const label patchI
) const
{
return tmp<scalarField>
(
new scalarField
(
interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
rhoValues_
)
)
);
}
Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::cp
(
const label patchI
) const
{
return tmp<scalarField>
(
new scalarField
(
interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
cpValues_
)
)
);
}
Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::K
Foam::tmp<Foam::scalarField> Foam::directionalKSolidThermo::K
(
const label patchI
) const
@ -600,7 +422,7 @@ Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::K
|| v.y() != v.z()
)
{
FatalErrorIn("directionalSolidThermo::K() const")
FatalErrorIn("directionalKSolidThermo::K() const")
<< "Supplied K values " << KValues_
<< " are not isotropic." << exit(FatalError);
}
@ -621,7 +443,7 @@ Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::K
}
Foam::tmp<Foam::symmTensorField> Foam::directionalSolidThermo::directionalK
Foam::tmp<Foam::symmTensorField> Foam::directionalKSolidThermo::directionalK
(
const label patchI
) const
@ -637,123 +459,31 @@ Foam::tmp<Foam::symmTensorField> Foam::directionalSolidThermo::directionalK
}
Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::Hf
(
const label patchI
) const
{
return tmp<scalarField>
(
new scalarField
(
interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
HfValues_
)
)
);
}
Foam::tmp<Foam::scalarField> Foam::directionalSolidThermo::emissivity
(
const label patchI
) const
{
return tmp<scalarField>
(
new scalarField
(
interpolateXY
(
T_.boundaryField()[patchI],
TValues_,
emissivityValues_
)
)
);
}
bool Foam::directionalSolidThermo::read()
bool Foam::directionalKSolidThermo::read()
{
return read(subDict(typeName + "Coeffs"));
}
bool Foam::directionalSolidThermo::read(const dictionary& dict)
bool Foam::directionalKSolidThermo::read(const dictionary& dict)
{
TValues_ = Field<scalar>(dict.lookup("TValues"));
rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
cpValues_ = Field<scalar>(dict.lookup("cpValues"));
KValues_ = Field<vector>(dict.lookup("KValues"));
HfValues_ = Field<scalar>(dict.lookup("HfValues"));
emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues"));
coordSys_ = coordinateSystem(dict, mesh_);
Info<< "Constructed directionalSolidThermo with samples" << nl
<< " T : " << TValues_ << nl
<< " rho : " << rhoValues_ << nl
<< " cp : " << cpValues_ << nl
<< " K : " << KValues_ << nl
<< " in coordinates system" << nl
<< " type : " << coordSys_.type() << nl
<< " e3 : " << coordSys_.e3() << nl
<< " e1 : " << coordSys_.e1() << 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("directionalSolidThermo::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("directionalSolidThermo::read()", dict)
<< "Temperature values are not in increasing order "
<< TValues_ << exit(FatalIOError);
}
}
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues"));
return true;
}
bool Foam::directionalSolidThermo::writeData(Ostream& os) const
bool Foam::directionalKSolidThermo::writeData(Ostream& os) const
{
bool ok = basicSolidThermo::writeData(os);
os.writeKeyword("TValues") << TValues_ << token::END_STATEMENT << nl;
os.writeKeyword("rhoValues") << rhoValues_ << token::END_STATEMENT << nl;
os.writeKeyword("cpValues") << cpValues_ << token::END_STATEMENT << nl;
bool ok = interpolatedSolidThermo::writeData(os);
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();
}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const directionalSolidThermo& s)
Foam::Ostream& Foam::operator<<(Ostream& os, const directionalKSolidThermo& s)
{
s.writeData(os);
return os;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,21 +22,21 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::directionalSolidThermo
Foam::directionalKSolidThermo
Description
Directional conductivity + table interpolation.
SourceFiles
directionalSolidThermo.C
directionalKSolidThermo.C
\*---------------------------------------------------------------------------*/
#ifndef directionalSolidThermo_H
#define directionalSolidThermo_H
#ifndef directionalKSolidThermo_H
#define directionalKSolidThermo_H
#include "basicSolidThermo.H"
#include "coordinateSystem.H"
#include "interpolatedSolidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,29 +44,21 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directionalSolidThermo Declaration
Class directionalKSolidThermo Declaration
\*---------------------------------------------------------------------------*/
class directionalSolidThermo
class directionalKSolidThermo
:
public basicSolidThermo
public interpolatedSolidThermo
{
// Private data
//- Temperature samples
Field<scalar> TValues_;
//- Density at given temperatures
Field<scalar> rhoValues_;
Field<scalar> cpValues_;
//- Thermal conductivity [W/(m.K)]
volSymmTensorField directionalK_;
//- Thermal conductivity vector
Field<vector> KValues_;
Field<scalar> HfValues_;
Field<scalar> emissivityValues_;
//- Coordinate system used for the directional properties
coordinateSystem coordSys_;
@ -77,7 +69,11 @@ class directionalSolidThermo
// Private Member Functions
//- Transform principal values of symmTensor
symmTensor transformPrincipal(const tensor& tt, const vector& st) const;
symmTensor transformPrincipal
(
const tensor& tt,
const vector& st
) const;
//- Transform principal values of symmTensor
void transformField
@ -87,21 +83,24 @@ class directionalSolidThermo
const vectorField& st
) const;
//- Calculate properties
void calculate();
public:
//- Runtime type information
TypeName("directionalSolidThermo");
TypeName("directionalKSolidThermo");
// Constructors
//- Construct from mesh
directionalSolidThermo(const fvMesh& mesh);
directionalKSolidThermo(const fvMesh& mesh);
// Destructor
virtual ~directionalSolidThermo();
//- Destructor
virtual ~directionalKSolidThermo();
// Member Functions
@ -109,66 +108,40 @@ public:
//- Update properties
virtual void correct();
//- Density [kg/m3]
virtual tmp<volScalarField> rho() const;
//- Access functions
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> cp() const;
//- Thermal conductivity [W/(m.K)]
virtual tmp<volScalarField> K() const;
//- Thermal conductivity [W/(m.K)]
virtual tmp<volSymmTensorField> directionalK() const;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> Hf() const;
//- Emissivity []
virtual tmp<volScalarField> emissivity() const;
//- Thermal conductivity [W/(m.K)]
virtual const volSymmTensorField& directionalK() const;
//- Iostropic thermal conductivity [W/(m.K)]
virtual const volScalarField& K() const;
// Per patch calculation
//- 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;
//- Thermal conductivity [W/(m.K)]
// Note: needs Kvalues to be isotropic
//- Thermal conductivity [W//m/K]
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]
virtual tmp<scalarField> Hf(const label patchI) const;
//- Emissivity []
virtual tmp<scalarField> emissivity(const label) const;
//- Thermal conductivity [W//m/K]
virtual tmp<symmTensorField> directionalK(const label) const;
// I-O
//- Write the directionalSolidThermo properties
//- Write the directionalKSolidThermo properties
virtual bool writeData(Ostream& os) const;
//- Read the directionalSolidThermo properties
//- Read the directionalKSolidThermo properties
virtual bool read();
//- Read the directionalSolidThermo properties
//- Read the directionalKSolidThermo properties
bool read(const dictionary& dict);
// Ostream Operator
friend Ostream& operator<<
(
Ostream& os,
const directionalSolidThermo& s
);
//- Ostream Operator
friend Ostream& operator<<
(
Ostream& os,
const directionalKSolidThermo& s
);
};

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
// ************************************************************************* //

View File

@ -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::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
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,28 +27,20 @@ License
#include "addToRunTimeSelectionTable.H"
#include "interpolateXY.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(interpolatedSolidThermo, 0);
addToRunTimeSelectionTable
(
basicSolidThermo,
interpolatedSolidThermo,
mesh
);
}
// * * * * * * * * * * * * * * * * 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();
correct();
calculate();
}
@ -60,55 +52,73 @@ Foam::interpolatedSolidThermo::~interpolatedSolidThermo()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::interpolatedSolidThermo::correct()
{}
Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::rho() const
void Foam::interpolatedSolidThermo::calculate()
{
tmp<volScalarField> trho
(
new volScalarField
(
IOobject
(
"rho",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimDensity
)
);
volScalarField& rho = trho();
rho.internalField() = interpolateXY
// Correct rho
rho_.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
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
(
IOobject
(
"cp",
"Cp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
@ -118,107 +128,21 @@ Foam::tmp<Foam::volScalarField> Foam::interpolatedSolidThermo::cp() const
dimEnergy/(dimMass*dimTemperature)
)
);
volScalarField& cp = tcp();
volScalarField& Cp = tCp();
cp.internalField() = interpolateXY
Cp.internalField() = interpolateXY
(
T_.internalField(),
TValues_,
cpValues_
);
forAll(cp.boundaryField(), patchI)
forAll(Cp.boundaryField(), patchI)
{
cp.boundaryField()[patchI] == this->cp(patchI)();
Cp.boundaryField()[patchI] == this->Cp(patchI)();
}
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;
return tCp;
}
@ -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
(
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
@ -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
(
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()
{
return read(subDict(typeName + "Coeffs"));
return read(dict_);
}
bool Foam::interpolatedSolidThermo::read(const dictionary& dict)
{
TValues_ = Field<scalar>(dict.lookup("TValues"));
rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
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 ok = interpolateSolid::read(dict);
return ok;
}
bool Foam::interpolatedSolidThermo::writeData(Ostream& os) const
{
bool ok = basicSolidThermo::writeData(os);
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("KValues") << KValues_ << token::END_STATEMENT << nl;
os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
os.writeKeyword("emissivityValues") << emissivityValues_
<< token::END_STATEMENT << nl;
ok = interpolateSolid::writeData(os);
return ok && os.good();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::interpolatedSolidThermo
Description
Table interpolated solid thermo.
Table interpolated solid thermo
SourceFiles
interpolatedSolidThermo.C
@ -36,6 +36,7 @@ SourceFiles
#define interpolatedSolidThermo_H
#include "basicSolidThermo.H"
#include "interpolateSolid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,67 +44,47 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolatedSolidThermo Declaration
Class interpolatedSolidThermo Declaration
\*---------------------------------------------------------------------------*/
class interpolatedSolidThermo
:
public basicSolidThermo
public basicSolidThermo,
public interpolateSolid
{
private:
// Private data
//- Temperature samples
Field<scalar> TValues_;
//- Dictionary
const dictionary dict_;
//- Density at given temperatures
Field<scalar> rhoValues_;
Field<scalar> cpValues_;
Field<scalar> KValues_;
Field<scalar> HfValues_;
Field<scalar> emissivityValues_;
public:
//- Runtime type information
TypeName("interpolatedSolidThermo");
// Constructors
//- Construct from mesh
interpolatedSolidThermo(const fvMesh& mesh);
interpolatedSolidThermo(const fvMesh& mesh, const word);
// Destructor
virtual ~interpolatedSolidThermo();
//- Destructor
virtual ~interpolatedSolidThermo();
// Member Functions
//- Update properties
virtual void correct();
//- Calculate properties
void calculate();
//- Density [kg/m3]
virtual tmp<volScalarField> rho() const;
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> cp() const;
// Derived properties
//- Thermal conductivity [W/(m.K)]
virtual tmp<volScalarField> K() const;
//- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> Cp() const;
//- Thermal conductivity [W/(m.K)]
virtual tmp<volSymmTensorField> directionalK() const;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> Hf() const;
//- Emissivity []
virtual tmp<volScalarField> emissivity() const;
//- Heat of formation [J/kg]
virtual tmp<volScalarField> Hf() const;
// Per patch calculation
@ -111,20 +92,19 @@ public:
//- 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;
//- 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;
//- Specific heat capacity [J/kg/K)]
virtual tmp<scalarField> Cp(const label patchI) const;
//- Heat of formation [J/kg]
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;
@ -139,14 +119,12 @@ public:
//- Read the interpolatedSolidThermo properties
bool read(const dictionary& dict);
// Ostream Operator
friend Ostream& operator<<
(
Ostream& os,
const interpolatedSolidThermo& s
);
//- Ostream Operator
friend Ostream& operator<<
(
Ostream& os,
const interpolatedSolidThermo& s
);
};

View File

@ -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()
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,93 +22,92 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interpolateSolidThermo
Foam::isotropicKSolidThermo
Description
The thermophysical properties of a interpolateSolidThermo
Directional conductivity + table interpolation.
SourceFiles
interpolateSolidThermo.C
isotropicKSolidThermo.C
\*---------------------------------------------------------------------------*/
#ifndef interpolateSolidThermo_H
#define interpolateSolidThermo_H
#ifndef directionalSolidThermo_H
#define directionalSolidThermo_H
#include "basicSolidThermo.H"
#include "interpolatedSolidThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class basicSolidThermo;
Ostream& operator<<
(
Ostream&,
const basicSolidThermo&
);
/*---------------------------------------------------------------------------*\
Class interpolateSolidThermo Declaration
Class isotropicKSolidThermo Declaration
\*---------------------------------------------------------------------------*/
class interpolateSolidThermo
class isotropicKSolidThermo
:
public basicSolidThermo
public interpolatedSolidThermo
{
// Private data
//- Temperature points for which there are values
const Field<scalar> TValues_;
//- Thermal conductivity [W/(m.K)]
volScalarField K_;
//- Density at given temperatures
const Field<scalar> rhoValues_;
//- Thermal conductivity vector
Field<scalar> KValues_;
const Field<scalar> cpValues_;
const Field<symmTensor> KValues_;
const Field<scalar> HfValues_;
const Field<scalar> emissivityValues_;
public:
//- Runtime type information
TypeName("interpolateSolidThermo");
TypeName("isotropicKSolidThermo");
// Constructors
//- Construct from mesh
interpolateSolidThermo(const fvMesh& mesh, const dictionary& dict);
// Destructor
virtual ~interpolateSolidThermo();
isotropicKSolidThermo(const fvMesh& mesh);
// Member Functions
//- Destructor
virtual ~isotropicKSolidThermo();
// Member functions
//- Update properties
virtual void correct();
// Access functions
// I-O
//- Write the interpolateSolidThermo properties
virtual void write(Ostream& os) const;
//- Constant access to K
virtual const volScalarField& K() const
{
return K_;
}
// Ostream Operator
// 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 interpolateSolidThermo& s
const isotropicKSolidThermo& s
);
};

View File

@ -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
)
);
}
}
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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/>.
\*---------------------------------------------------------------------------*/
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);
}
// ************************************************************************* //

View File

@ -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"));
}
}
// ************************************************************************* //

View File

@ -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;
//- Specific heat capacity
virtual scalar Cp(scalar T, label celli) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "multiComponentSolidMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View 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 "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
)
{}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -0,0 +1,422 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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();
}
// ************************************************************************* //

View File

@ -0,0 +1,172 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
pointSolidMixture/pointSolidMixture.C
LIB = $(FOAM_LIBBIN)/libpointSolidMixture

View File

@ -0,0 +1,3 @@
EXE_INC = \
-I${LIB_SRC}/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude

View File

@ -23,11 +23,11 @@ License
\*---------------------------------------------------------------------------*/
#include "solidMixture.H"
#include "pointSolidMixture.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidMixture::solidMixture
Foam::pointSolidMixture::pointSolidMixture
(
const dictionary& thermophysicalProperties
)
@ -49,12 +49,12 @@ Foam::solidMixture::solidMixture
forAll(components_, i)
{
properties_.set(i, solid::New(props.subDict(components_[i])));
properties_.set(i, pointSolid::New(props.subDict(components_[i])));
}
}
Foam::solidMixture::solidMixture(const solidMixture& s)
Foam::pointSolidMixture::pointSolidMixture(const pointSolidMixture& s)
:
components_(s.components_),
properties_(s.properties_.size())
@ -68,21 +68,21 @@ Foam::solidMixture::solidMixture(const solidMixture& s)
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solidMixture> Foam::solidMixture::New
Foam::autoPtr<Foam::pointSolidMixture> Foam::pointSolidMixture::New
(
const dictionary& thermophysicalProperties
)
{
return autoPtr<solidMixture>(new solidMixture(thermophysicalProperties));
return autoPtr<pointSolidMixture>
(
new pointSolidMixture(thermophysicalProperties)
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalarField Foam::solidMixture::X
(
const scalarField& Y
) const
Foam::scalarField Foam::pointSolidMixture::X(const scalarField& Y) const
{
scalarField X(Y.size());
scalar rhoInv = 0.0;
@ -96,10 +96,7 @@ Foam::scalarField Foam::solidMixture::X
}
Foam::scalar Foam::solidMixture::rho
(
const scalarField& X
) const
Foam::scalar Foam::pointSolidMixture::rho(const scalarField& X) const
{
scalar val = 0.0;
forAll(properties_, i)
@ -110,10 +107,7 @@ Foam::scalar Foam::solidMixture::rho
}
Foam::scalar Foam::solidMixture::Cp
(
const scalarField& Y
) const
Foam::scalar Foam::pointSolidMixture::Cp(const scalarField& Y) const
{
scalar val = 0.0;
forAll(properties_, i)

View File

@ -22,30 +22,30 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::solidMixture
Foam::pointSolidMixture
Description
A mixture of solids.
Note
The dictionary constructor searches for the entry @c solidComponents,
which is a wordList. The solid properties of each component can either
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::liquidMixture
Foam::pointSolidMixture
\*---------------------------------------------------------------------------*/
#ifndef solidMixture_H
#define solidMixture_H
#ifndef pointSolidMixture_H
#define pointSolidMixture_H
#include "scalarField.H"
#include "PtrList.H"
#include "solid.H"
#include "pointSolid.H"
#include "autoPtr.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,18 +54,18 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class solidMixture Declaration
Class pointSolidMixture Declaration
\*---------------------------------------------------------------------------*/
class solidMixture
class pointSolidMixture
{
// Private data
//- The names of the solids
List<word> components_;
//- The solid properties
PtrList<solid> properties_;
//- The pointSolid properties
PtrList<pointSolid> properties_;
public:
@ -73,39 +73,39 @@ public:
// Constructors
//- Construct from dictionary
solidMixture(const dictionary&);
pointSolidMixture(const dictionary&);
//- Construct copy
solidMixture(const solidMixture& lm);
pointSolidMixture(const pointSolidMixture& lm);
//- Construct and return a clone
virtual autoPtr<solidMixture> clone() const
virtual autoPtr<pointSolidMixture> clone() const
{
return autoPtr<solidMixture>(new solidMixture(*this));
return autoPtr<pointSolidMixture>(new pointSolidMixture(*this));
}
//- Destructor
virtual ~solidMixture()
virtual ~pointSolidMixture()
{}
// Selectors
//- Select construct from dictionary
static autoPtr<solidMixture> New(const dictionary&);
static autoPtr<pointSolidMixture> New(const dictionary&);
// Member Functions
//- Return the solid names
//- Return the pointSolid names
inline const List<word>& components() const
{
return components_;
}
//- Return the solid properties
inline const PtrList<solid>& properties() const
//- Return the pointSolid properties
inline const PtrList<pointSolid>& properties() const
{
return properties_;
}

View File

@ -31,16 +31,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(C, 0);
addToRunTimeSelectionTable(solid, C,);
addToRunTimeSelectionTable(solid, C, Istream);
addToRunTimeSelectionTable(solid, C, dictionary);
addToRunTimeSelectionTable(pointSolid, C,);
addToRunTimeSelectionTable(pointSolid, C, Istream);
addToRunTimeSelectionTable(pointSolid, C, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::C::C()
:
solid(2010, 710, 0.04, 0.0, 1.0)
pointSolid(2010, 710, 0.04, 0.0, 1.0)
{
if (debug)
{
@ -51,27 +51,27 @@ Foam::C::C()
}
Foam::C::C(const solid& s)
Foam::C::C(const pointSolid& s)
:
solid(s)
pointSolid(s)
{}
Foam::C::C(Istream& is)
:
solid(is)
pointSolid(is)
{}
Foam::C::C(const dictionary& dict)
:
solid(dict)
pointSolid(dict)
{}
Foam::C::C(const C& s)
:
solid(s)
pointSolid(s)
{}
@ -79,7 +79,7 @@ Foam::C::C(const C& s)
void Foam::C::writeData(Ostream& os) const
{
solid::writeData(os);
pointSolid::writeData(os);
}

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef solid_C_H
#define solid_C_H
#include "solid.H"
#include "pointSolid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +57,7 @@ Ostream& operator<<
class C
:
public solid
public pointSolid
{
public:
@ -70,8 +70,8 @@ public:
//- Construct null
C();
//- Construct from solid
C(const solid& s);
//- Construct from pointSolid
C(const pointSolid& s);
//- Construct from Istream
C(Istream& is);
@ -83,9 +83,9 @@ public:
C(const C& s);
//- Construct and return clone
virtual autoPtr<solid> clone() const
virtual autoPtr<pointSolid> clone() const
{
return autoPtr<solid>(new C(*this));
return autoPtr<pointSolid>(new C(*this));
}

View File

@ -31,16 +31,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(CaCO3, 0);
addToRunTimeSelectionTable(solid, CaCO3,);
addToRunTimeSelectionTable(solid, CaCO3, Istream);
addToRunTimeSelectionTable(solid, CaCO3, dictionary);
addToRunTimeSelectionTable(pointSolid, CaCO3,);
addToRunTimeSelectionTable(pointSolid, CaCO3, Istream);
addToRunTimeSelectionTable(pointSolid, CaCO3, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::CaCO3::CaCO3()
:
solid(2710, 850, 1.3, 0.0, 1.0)
pointSolid(2710, 850, 1.3, 0.0, 1.0)
{
if (debug)
{
@ -51,27 +51,27 @@ Foam::CaCO3::CaCO3()
}
Foam::CaCO3::CaCO3(const solid& s)
Foam::CaCO3::CaCO3(const pointSolid& s)
:
solid(s)
pointSolid(s)
{}
Foam::CaCO3::CaCO3(Istream& is)
:
solid(is)
pointSolid(is)
{}
Foam::CaCO3::CaCO3(const dictionary& dict)
:
solid(dict)
pointSolid(dict)
{}
Foam::CaCO3::CaCO3(const CaCO3& s)
:
solid(s)
pointSolid(s)
{}
@ -79,7 +79,7 @@ Foam::CaCO3::CaCO3(const CaCO3& s)
void Foam::CaCO3::writeData(Ostream& os) const
{
solid::writeData(os);
pointSolid::writeData(os);
}

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef solid_CaCO3_H
#define solid_CaCO3_H
#include "solid.H"
#include "pointSolid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +57,7 @@ Ostream& operator<<
class CaCO3
:
public solid
public pointSolid
{
public:
@ -71,8 +71,8 @@ public:
//- Construct null
CaCO3();
//- Construct from solid
CaCO3(const solid& s);
//- Construct from pointSolid
CaCO3(const pointSolid& s);
//- Construct from Istream
CaCO3(Istream& is);
@ -84,9 +84,9 @@ public:
CaCO3(const CaCO3& s);
//- Construct and return clone
virtual autoPtr<solid> clone() const
virtual autoPtr<pointSolid> clone() const
{
return autoPtr<solid>(new CaCO3(*this));
return autoPtr<pointSolid>(new CaCO3(*this));
}

View File

@ -0,0 +1,8 @@
pointSolid/pointSolid.C
pointSolid/pointSolidNew.C
ash/ash.C
C/C.C
CaCO3/CaCO3.C
LIB = $(FOAM_LIBBIN)/libpointSolids

View File

@ -31,16 +31,16 @@ License
namespace Foam
{
defineTypeNameAndDebug(ash, 0);
addToRunTimeSelectionTable(solid, ash,);
addToRunTimeSelectionTable(solid, ash, Istream);
addToRunTimeSelectionTable(solid, ash, dictionary);
addToRunTimeSelectionTable(pointSolid, ash,);
addToRunTimeSelectionTable(pointSolid, ash, Istream);
addToRunTimeSelectionTable(pointSolid, ash, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ash::ash()
:
solid(2010, 710, 0.04, 0.0, 1.0)
pointSolid(2010, 710, 0.04, 0.0, 1.0)
{
if (debug)
{
@ -51,27 +51,27 @@ Foam::ash::ash()
}
Foam::ash::ash(const solid& s)
Foam::ash::ash(const pointSolid& s)
:
solid(s)
pointSolid(s)
{}
Foam::ash::ash(Istream& is)
:
solid(is)
pointSolid(is)
{}
Foam::ash::ash(const dictionary& dict)
:
solid(dict)
pointSolid(dict)
{}
Foam::ash::ash(const ash& s)
:
solid(s)
pointSolid(s)
{}
@ -79,7 +79,7 @@ Foam::ash::ash(const ash& s)
void Foam::ash::writeData(Ostream& os) const
{
solid::writeData(os);
pointSolid::writeData(os);
}

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef solid_ash_H
#define solid_ash_H
#include "solid.H"
#include "pointSolid.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,7 +57,7 @@ Ostream& operator<<
class ash
:
public solid
public pointSolid
{
public:
@ -71,8 +71,8 @@ public:
//- Construct null
ash();
//- Construct from solid
ash(const solid& s);
//- Construct from pointSolid
ash(const pointSolid& s);
//- Construct from Istream
ash(Istream& is);
@ -84,9 +84,9 @@ public:
ash(const ash& s);
//- Construct and return clone
virtual autoPtr<solid> clone() const
virtual autoPtr<pointSolid> clone() const
{
return autoPtr<solid>(new ash(*this));
return autoPtr<pointSolid>(new ash(*this));
}

View File

@ -23,21 +23,21 @@ License
\*---------------------------------------------------------------------------*/
#include "solid.H"
#include "pointSolid.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(solid, 0);
defineRunTimeSelectionTable(solid,);
defineRunTimeSelectionTable(solid, Istream);
defineRunTimeSelectionTable(solid, dictionary);
defineTypeNameAndDebug(pointSolid, 0);
defineRunTimeSelectionTable(pointSolid,);
defineRunTimeSelectionTable(pointSolid, Istream);
defineRunTimeSelectionTable(pointSolid, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solid::solid
Foam::pointSolid::pointSolid
(
scalar rho,
scalar Cp,
@ -54,7 +54,7 @@ Foam::solid::solid
{}
Foam::solid::solid(Istream& is)
Foam::pointSolid::pointSolid(Istream& is)
:
rho_(readScalar(is)),
Cp_(readScalar(is)),
@ -64,7 +64,7 @@ Foam::solid::solid(Istream& is)
{}
Foam::solid::solid(const dictionary& dict)
Foam::pointSolid::pointSolid(const dictionary& dict)
:
rho_(readScalar(dict.lookup("rho"))),
Cp_(readScalar(dict.lookup("Cp"))),
@ -74,7 +74,7 @@ Foam::solid::solid(const dictionary& dict)
{}
Foam::solid::solid(const solid& s)
Foam::pointSolid::pointSolid(const pointSolid& s)
:
rho_(s.rho_),
Cp_(s.Cp_),
@ -86,7 +86,7 @@ Foam::solid::solid(const solid& s)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solid::writeData(Ostream& os) const
void Foam::pointSolid::writeData(Ostream& os) const
{
os << rho_ << token::SPACE
<< Cp_ << token::SPACE
@ -98,7 +98,7 @@ void Foam::solid::writeData(Ostream& os) const
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const solid& s)
Foam::Ostream& Foam::operator<<(Ostream& os, const pointSolid& s)
{
s.writeData(os);
return os;

View File

@ -22,18 +22,18 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::solid
Foam::pointSolid
Description
The thermophysical properties of a solid
The thermophysical properties of a pointSolid
SourceFiles
solid.C
pointSolid.C
\*---------------------------------------------------------------------------*/
#ifndef solid_H
#define solid_H
#ifndef pointSolid_H
#define pointSolid_H
#include "typeInfo.H"
#include "autoPtr.H"
@ -45,20 +45,20 @@ SourceFiles
namespace Foam
{
class solid;
class pointSolid;
Ostream& operator<<
(
Ostream&,
const solid&
const pointSolid&
);
/*---------------------------------------------------------------------------*\
Class solid Declaration
Class pointSolid Declaration
\*---------------------------------------------------------------------------*/
class solid
class pointSolid
{
// Private data
@ -82,7 +82,7 @@ class solid
public:
//- Runtime type information
TypeName("solid");
TypeName("pointSolid");
// Declare run-time constructor selection tables
@ -90,7 +90,7 @@ public:
declareRunTimeSelectionTable
(
autoPtr,
solid,
pointSolid,
,
(),
()
@ -99,7 +99,7 @@ public:
declareRunTimeSelectionTable
(
autoPtr,
solid,
pointSolid,
Istream,
(Istream& is),
(is)
@ -108,7 +108,7 @@ public:
declareRunTimeSelectionTable
(
autoPtr,
solid,
pointSolid,
dictionary,
(const dictionary& dict),
(dict)
@ -118,7 +118,7 @@ public:
// Constructors
//- Construct from components
solid
pointSolid
(
scalar rho,
scalar Cp,
@ -128,38 +128,38 @@ public:
);
//- Construct from Istream
solid(Istream& is);
pointSolid(Istream& is);
//- Construct from dictionary
solid(const dictionary& dict);
pointSolid(const dictionary& dict);
//- Construct copy
solid(const solid& s);
pointSolid(const pointSolid& s);
//- Construct and return clone
virtual autoPtr<solid> clone() const
virtual autoPtr<pointSolid> clone() const
{
return autoPtr<solid>(new solid(*this));
return autoPtr<pointSolid>(new pointSolid(*this));
}
// Selectors
//- Return a pointer to a new solid created from input
static autoPtr<solid> New(Istream& is);
//- Return a pointer to a new pointSolid created from input
static autoPtr<pointSolid> New(Istream& is);
//- Return a pointer to a new solid created from dictionary
static autoPtr<solid> New(const dictionary& dict);
//- Return a pointer to a new pointSolid created from dictionary
static autoPtr<pointSolid> New(const dictionary& dict);
//- Destructor
virtual ~solid()
virtual ~pointSolid()
{}
// Member Functions
// Physical constants which define the solid
// Physical constants which define the pointSolid
//- Density [kg/m3]
inline scalar rho() const;
@ -185,13 +185,13 @@ public:
// I-O
//- Write the solid properties
//- Write the pointSolid properties
virtual void writeData(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<<(Ostream& os, const solid& s);
friend Ostream& operator<<(Ostream& os, const pointSolid& s);
};
@ -201,7 +201,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "solidI.H"
#include "pointSolidI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -27,43 +27,43 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline Foam::scalar Foam::solid::rho() const
inline Foam::scalar Foam::pointSolid::rho() const
{
return rho_;
}
inline Foam::scalar Foam::solid::Cp() const
inline Foam::scalar Foam::pointSolid::Cp() const
{
return Cp_;
}
inline Foam::scalar Foam::solid::K() const
inline Foam::scalar Foam::pointSolid::K() const
{
return K_;
}
inline Foam::scalar Foam::solid::Hf() const
inline Foam::scalar Foam::pointSolid::Hf() const
{
return Hf_;
}
inline Foam::scalar Foam::solid::H(const scalar T) const
inline Foam::scalar Foam::pointSolid::H(const scalar T) const
{
return Hs(T) + Hf_;
}
inline Foam::scalar Foam::solid::Hs(const scalar T) const
inline Foam::scalar Foam::pointSolid::Hs(const scalar T) const
{
return Cp_*(T - specie::Tstd);
}
inline Foam::scalar Foam::solid::emissivity() const
inline Foam::scalar Foam::pointSolid::emissivity() const
{
return emissivity_;
}

View File

@ -23,16 +23,16 @@ License
\*---------------------------------------------------------------------------*/
#include "solid.H"
#include "pointSolid.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(Istream& is)
{
if (debug)
{
Info<< "solid::New(Istream&): constructing solid" << endl;
Info<< "pointSolid::New(Istream&): constructing pointSolid" << endl;
}
const word solidType(is);
@ -45,14 +45,14 @@ Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
if (cstrIter == ConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(Istream&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are :" << endl
FatalErrorIn("pointSolid::New(Istream&)")
<< "Unknown pointSolid type " << solidType << nl << nl
<< "Valid pointSolid types are :" << endl
<< ConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<solid>(cstrIter()());
return autoPtr<pointSolid>(cstrIter()());
}
else if (coeffs == "coeffs")
{
@ -61,33 +61,34 @@ Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(Istream&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are :" << endl
FatalErrorIn("pointSolid::New(Istream&)")
<< "Unknown pointSolid type " << solidType << nl << nl
<< "Valid pointSolid types are :" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<solid>(cstrIter()(is));
return autoPtr<pointSolid>(cstrIter()(is));
}
else
{
FatalErrorIn("solid::New(Istream&)")
<< "solid type " << solidType
FatalErrorIn("pointSolid::New(Istream&)")
<< "pointSolid type " << solidType
<< ", option " << coeffs << " given"
<< ", should be coeffs or defaultCoeffs"
<< exit(FatalError);
return autoPtr<solid>(NULL);
return autoPtr<pointSolid>(NULL);
}
}
Foam::autoPtr<Foam::solid> Foam::solid::New(const dictionary& dict)
Foam::autoPtr<Foam::pointSolid> Foam::pointSolid::New(const dictionary& dict)
{
if (debug)
{
Info<< "solid::New(const dictionary&): constructing solid" << endl;
Info<< "pointSolid::New(const dictionary&): constructing pointSolid"
<< endl;
}
const word solidType(dict.dictName());
@ -100,14 +101,14 @@ Foam::autoPtr<Foam::solid> Foam::solid::New(const dictionary& dict)
if (cstrIter == ConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(const dictionary&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are :" << endl
FatalErrorIn("pointSolid::New(const dictionary&)")
<< "Unknown pointSolid type " << solidType << nl << nl
<< "Valid pointSolid types are :" << endl
<< ConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<solid>(cstrIter()());
return autoPtr<pointSolid>(cstrIter()());
}
else
{
@ -116,14 +117,14 @@ Foam::autoPtr<Foam::solid> Foam::solid::New(const dictionary& dict)
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("solid::New(const dictionary&)")
<< "Unknown solid type " << solidType << nl << nl
<< "Valid solid types are :" << endl
FatalErrorIn("pointSolid::New(const dictionary&)")
<< "Unknown pointSolid type " << solidType << nl << nl
<< "Valid pointSolid types are :" << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<solid>(cstrIter()(dict));
return autoPtr<pointSolid>(cstrIter()(dict));
}
}

View File

@ -0,0 +1,8 @@
rhoType/const/constRho.C
reaction/Reactions/solidReaction/solidReaction.C
reaction/reactions/makeSolidReactionThermoReactions.C
LIB = $(FOAM_LIBBIN)/libsolid

View File

@ -1,3 +1,2 @@
EXE_INC = \
-I${LIB_SRC}/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View 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
// ************************************************************************* //

View 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
// ************************************************************************* //

View File

@ -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_;
}
// ************************************************************************* //

View 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::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
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View 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;
}
// ************************************************************************* //

View 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
// ************************************************************************* //

View 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_;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View 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
// ************************************************************************* //

View 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_;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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_;
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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
// ************************************************************************* //

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View 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::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
// ************************************************************************* //

View File

@ -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));
}
// ************************************************************************* //

View File

@ -1,3 +0,0 @@
solidMixture/solidMixture.C
LIB = $(FOAM_LIBBIN)/libsolidMixture

View File

@ -1,8 +0,0 @@
solid/solid.C
solid/solidNew.C
ash/ash.C
C/C.C
CaCO3/CaCO3.C
LIB = $(FOAM_LIBBIN)/libsolids

Some files were not shown because too many files have changed in this diff Show More