mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: correct copyright
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,124 +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/>.
|
||||
|
||||
Class
|
||||
Foam::interpolateSolidThermo
|
||||
|
||||
Description
|
||||
The thermophysical properties of a interpolateSolidThermo
|
||||
|
||||
SourceFiles
|
||||
interpolateSolidThermo.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef interpolateSolidThermo_H
|
||||
#define interpolateSolidThermo_H
|
||||
|
||||
#include "basicSolidThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class basicSolidThermo;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const basicSolidThermo&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class interpolateSolidThermo Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class interpolateSolidThermo
|
||||
:
|
||||
public basicSolidThermo
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Temperature points for which there are values
|
||||
const Field<scalar> TValues_;
|
||||
|
||||
//- Density at given temperatures
|
||||
const Field<scalar> rhoValues_;
|
||||
|
||||
const Field<scalar> cpValues_;
|
||||
|
||||
const Field<symmTensor> KValues_;
|
||||
|
||||
const Field<scalar> HfValues_;
|
||||
|
||||
const Field<scalar> emissivityValues_;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("interpolateSolidThermo");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
interpolateSolidThermo(const fvMesh& mesh, const dictionary& dict);
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~interpolateSolidThermo();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update properties
|
||||
virtual void correct();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the interpolateSolidThermo properties
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const interpolateSolidThermo& s
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,763 +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 "directionalSolidThermo.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "interpolateXY.H"
|
||||
#include "transform.H"
|
||||
#include "transformField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(directionalSolidThermo, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
basicSolidThermo,
|
||||
directionalSolidThermo,
|
||||
mesh
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::directionalSolidThermo::directionalSolidThermo(const fvMesh& mesh)
|
||||
:
|
||||
basicSolidThermo(mesh),
|
||||
ccTransforms_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"ccTransforms",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimLength
|
||||
)
|
||||
{
|
||||
read();
|
||||
|
||||
// Determine transforms for cell centres
|
||||
forAll(mesh.C(), cellI)
|
||||
{
|
||||
vector dir = mesh.C()[cellI] - coordSys_.origin();
|
||||
dir /= mag(dir);
|
||||
|
||||
// Define local coordinate system with
|
||||
// - e1 : axis from cc to centre
|
||||
// - e3 : rotation axis
|
||||
coordinateSystem cs
|
||||
(
|
||||
"cc",
|
||||
coordSys_.origin(),
|
||||
coordSys_.e3(), //z',e3
|
||||
dir //x',e1
|
||||
);
|
||||
|
||||
ccTransforms_[cellI] = cs.R();
|
||||
}
|
||||
|
||||
forAll(mesh.C().boundaryField(), patchI)
|
||||
{
|
||||
const fvPatchVectorField& patchC = mesh.C().boundaryField()[patchI];
|
||||
fvPatchTensorField& patchT = ccTransforms_.boundaryField()[patchI];
|
||||
|
||||
tensorField tc(patchT.size());
|
||||
forAll(tc, i)
|
||||
{
|
||||
vector dir = patchC[i] - coordSys_.origin();
|
||||
dir /= mag(dir);
|
||||
|
||||
coordinateSystem cs
|
||||
(
|
||||
"cc",
|
||||
coordSys_.origin(),
|
||||
coordSys_.e3(), //z',e3
|
||||
dir //x',e1
|
||||
);
|
||||
|
||||
tc[i] = cs.R();
|
||||
}
|
||||
patchT = tc;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "directionalSolidThermo : dumping converted Kxx, Kyy, Kzz"
|
||||
<< endl;
|
||||
{
|
||||
volVectorField Kxx
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Kxx",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimless
|
||||
);
|
||||
Kxx.internalField() = transform
|
||||
(
|
||||
ccTransforms_.internalField(),
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.internalField().size(),
|
||||
point(1, 0, 0)
|
||||
)
|
||||
);
|
||||
forAll(Kxx.boundaryField(), patchI)
|
||||
{
|
||||
Kxx.boundaryField()[patchI] = transform
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI],
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI].size(),
|
||||
point(1, 0, 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
Kxx.write();
|
||||
}
|
||||
{
|
||||
volVectorField Kyy
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Kyy",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimless
|
||||
);
|
||||
Kyy.internalField() = transform
|
||||
(
|
||||
ccTransforms_.internalField(),
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.internalField().size(),
|
||||
point(0, 1, 0)
|
||||
)
|
||||
);
|
||||
forAll(Kyy.boundaryField(), patchI)
|
||||
{
|
||||
Kyy.boundaryField()[patchI] = transform
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI],
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI].size(),
|
||||
point(0, 1, 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
Kyy.write();
|
||||
}
|
||||
{
|
||||
volVectorField Kzz
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Kzz",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimless
|
||||
);
|
||||
Kzz.internalField() = transform
|
||||
(
|
||||
ccTransforms_.internalField(),
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.internalField().size(),
|
||||
point(0, 0, 1)
|
||||
)
|
||||
);
|
||||
forAll(Kzz.boundaryField(), patchI)
|
||||
{
|
||||
Kzz.boundaryField()[patchI] = transform
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI],
|
||||
vectorField
|
||||
(
|
||||
ccTransforms_.boundaryField()[patchI].size(),
|
||||
point(0, 0, 1)
|
||||
)
|
||||
);
|
||||
}
|
||||
Kzz.write();
|
||||
}
|
||||
}
|
||||
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::directionalSolidThermo::~directionalSolidThermo()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::symmTensor Foam::directionalSolidThermo::transformPrincipal
|
||||
(
|
||||
const tensor& tt,
|
||||
const vector& st
|
||||
) const
|
||||
{
|
||||
return symmTensor
|
||||
(
|
||||
tt.xx()*st.x()*tt.xx()
|
||||
+ tt.xy()*st.y()*tt.xy()
|
||||
+ tt.xz()*st.z()*tt.xz(),
|
||||
|
||||
tt.xx()*st.x()*tt.yx()
|
||||
+ tt.xy()*st.y()*tt.yy()
|
||||
+ tt.xz()*st.z()*tt.yz(),
|
||||
|
||||
tt.xx()*st.x()*tt.zx()
|
||||
+ tt.xy()*st.y()*tt.zy()
|
||||
+ tt.xz()*st.z()*tt.zz(),
|
||||
|
||||
tt.yx()*st.x()*tt.yx()
|
||||
+ tt.yy()*st.y()*tt.yy()
|
||||
+ tt.yz()*st.z()*tt.yz(),
|
||||
|
||||
tt.yx()*st.x()*tt.zx()
|
||||
+ tt.yy()*st.y()*tt.zy()
|
||||
+ tt.yz()*st.z()*tt.zz(),
|
||||
|
||||
tt.zx()*st.x()*tt.zx()
|
||||
+ tt.zy()*st.y()*tt.zy()
|
||||
+ tt.zz()*st.z()*tt.zz()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void Foam::directionalSolidThermo::transformField
|
||||
(
|
||||
symmTensorField& fld,
|
||||
const tensorField& tt,
|
||||
const vectorField& st
|
||||
) const
|
||||
{
|
||||
fld.setSize(tt.size());
|
||||
forAll(fld, i)
|
||||
{
|
||||
fld[i] = transformPrincipal(tt[i], st[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::directionalSolidThermo::correct()
|
||||
{}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::rho() const
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::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();
|
||||
|
||||
cp.internalField() = interpolateXY
|
||||
(
|
||||
T_.internalField(),
|
||||
TValues_,
|
||||
cpValues_
|
||||
);
|
||||
|
||||
forAll(cp.boundaryField(), patchI)
|
||||
{
|
||||
cp.boundaryField()[patchI] == this->cp(patchI)();
|
||||
}
|
||||
|
||||
return tcp;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volSymmTensorField> Foam::directionalSolidThermo::directionalK()
|
||||
const
|
||||
{
|
||||
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)
|
||||
Field<vector> localK
|
||||
(
|
||||
interpolateXY
|
||||
(
|
||||
T_.internalField(),
|
||||
TValues_,
|
||||
KValues_
|
||||
)
|
||||
);
|
||||
|
||||
// Transform into global coordinate system
|
||||
transformField(K.internalField(), ccTransforms_.internalField(), localK);
|
||||
|
||||
forAll(K.boundaryField(), patchI)
|
||||
{
|
||||
K.boundaryField()[patchI] == this->directionalK(patchI)();
|
||||
}
|
||||
|
||||
return tK;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField> Foam::directionalSolidThermo::K() const
|
||||
{
|
||||
forAll(KValues_, i)
|
||||
{
|
||||
const vector& v = KValues_[i];
|
||||
if
|
||||
(
|
||||
v.x() != v.y()
|
||||
|| v.x() != v.z()
|
||||
|| v.y() != v.z()
|
||||
)
|
||||
{
|
||||
FatalErrorIn("directionalSolidThermo::K() const")
|
||||
<< "Supplied K values " << KValues_
|
||||
<< " are not isotropic." << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// Get temperature interpolated properties (principal directions)
|
||||
Field<vector> localK
|
||||
(
|
||||
interpolateXY
|
||||
(
|
||||
T_.internalField(),
|
||||
TValues_,
|
||||
KValues_
|
||||
)
|
||||
);
|
||||
|
||||
tmp<volScalarField> tK
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"K",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimEnergy/dimTime/(dimLength*dimTemperature)
|
||||
)
|
||||
);
|
||||
volScalarField& K = tK();
|
||||
|
||||
K.internalField() = interpolateXY
|
||||
(
|
||||
T_.internalField(),
|
||||
TValues_,
|
||||
KValues_.component(0)()
|
||||
);
|
||||
|
||||
forAll(K.boundaryField(), patchI)
|
||||
{
|
||||
K.boundaryField()[patchI] == this->K(patchI)();
|
||||
}
|
||||
|
||||
return tK;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::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
|
||||
(
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
forAll(KValues_, i)
|
||||
{
|
||||
const vector& v = KValues_[i];
|
||||
if
|
||||
(
|
||||
v.x() != v.y()
|
||||
|| v.x() != v.z()
|
||||
|| v.y() != v.z()
|
||||
)
|
||||
{
|
||||
FatalErrorIn("directionalSolidThermo::K() const")
|
||||
<< "Supplied K values " << KValues_
|
||||
<< " are not isotropic." << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return tmp<scalarField>
|
||||
(
|
||||
new scalarField
|
||||
(
|
||||
interpolateXY
|
||||
(
|
||||
T_.boundaryField()[patchI],
|
||||
TValues_,
|
||||
KValues_.component(0)()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::symmTensorField> Foam::directionalSolidThermo::directionalK
|
||||
(
|
||||
const label patchI
|
||||
) const
|
||||
{
|
||||
const fvPatchScalarField& patchT = T_.boundaryField()[patchI];
|
||||
|
||||
Field<vector> localK(interpolateXY(patchT, TValues_, KValues_));
|
||||
|
||||
tmp<symmTensorField> tglobalK(new symmTensorField(localK.size()));
|
||||
transformField(tglobalK(), ccTransforms_.boundaryField()[patchI], localK);
|
||||
|
||||
return tglobalK;
|
||||
}
|
||||
|
||||
|
||||
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()
|
||||
{
|
||||
return read(subDict(typeName + "Coeffs"));
|
||||
}
|
||||
|
||||
|
||||
bool Foam::directionalSolidThermo::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);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::directionalSolidThermo::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;
|
||||
|
||||
return ok && os.good();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const directionalSolidThermo& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,183 +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/>.
|
||||
|
||||
Class
|
||||
Foam::directionalSolidThermo
|
||||
|
||||
Description
|
||||
Directional conductivity + table interpolation.
|
||||
|
||||
SourceFiles
|
||||
directionalSolidThermo.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef directionalSolidThermo_H
|
||||
#define directionalSolidThermo_H
|
||||
|
||||
#include "basicSolidThermo.H"
|
||||
#include "coordinateSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class directionalSolidThermo Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class directionalSolidThermo
|
||||
:
|
||||
public basicSolidThermo
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Temperature samples
|
||||
Field<scalar> TValues_;
|
||||
|
||||
//- Density at given temperatures
|
||||
Field<scalar> rhoValues_;
|
||||
|
||||
Field<scalar> cpValues_;
|
||||
|
||||
Field<vector> KValues_;
|
||||
|
||||
Field<scalar> HfValues_;
|
||||
|
||||
Field<scalar> emissivityValues_;
|
||||
|
||||
//- Coordinate system used for the directional properties
|
||||
coordinateSystem coordSys_;
|
||||
|
||||
//- Transformation for cell centres
|
||||
volTensorField ccTransforms_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Transform principal values of symmTensor
|
||||
symmTensor transformPrincipal(const tensor& tt, const vector& st) const;
|
||||
|
||||
//- Transform principal values of symmTensor
|
||||
void transformField
|
||||
(
|
||||
symmTensorField& fld,
|
||||
const tensorField& tt,
|
||||
const vectorField& st
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("directionalSolidThermo");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh
|
||||
directionalSolidThermo(const fvMesh& mesh);
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~directionalSolidThermo();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update properties
|
||||
virtual void correct();
|
||||
|
||||
//- Density [kg/m3]
|
||||
virtual tmp<volScalarField> rho() const;
|
||||
|
||||
//- 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;
|
||||
|
||||
|
||||
// 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
|
||||
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;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the directionalSolidThermo properties
|
||||
virtual bool writeData(Ostream& os) const;
|
||||
|
||||
//- Read the directionalSolidThermo properties
|
||||
virtual bool read();
|
||||
|
||||
//- Read the directionalSolidThermo properties
|
||||
bool read(const dictionary& dict);
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<
|
||||
(
|
||||
Ostream& os,
|
||||
const directionalSolidThermo& s
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
solidMixture/solidMixture.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsolidMixture
|
||||
@ -1,3 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I${LIB_SRC}/thermophysicalModels/solids/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
|
||||
@ -1,127 +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 "solidMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solidMixture::solidMixture
|
||||
(
|
||||
const dictionary& thermophysicalProperties
|
||||
)
|
||||
:
|
||||
components_(thermophysicalProperties.lookup("solidComponents")),
|
||||
properties_(components_.size())
|
||||
{
|
||||
// can use sub-dictionary "solidProperties" to avoid
|
||||
// collisions with identically named gas-phase entries
|
||||
const dictionary* subDictPtr = thermophysicalProperties.subDictPtr
|
||||
(
|
||||
"solidProperties"
|
||||
);
|
||||
|
||||
const dictionary& props =
|
||||
(
|
||||
subDictPtr ? *subDictPtr : thermophysicalProperties
|
||||
);
|
||||
|
||||
forAll(components_, i)
|
||||
{
|
||||
properties_.set(i, solid::New(props.subDict(components_[i])));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::solidMixture::solidMixture(const solidMixture& s)
|
||||
:
|
||||
components_(s.components_),
|
||||
properties_(s.properties_.size())
|
||||
{
|
||||
forAll(properties_, i)
|
||||
{
|
||||
properties_.set(i, s.properties_(i)->clone());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::solidMixture> Foam::solidMixture::New
|
||||
(
|
||||
const dictionary& thermophysicalProperties
|
||||
)
|
||||
{
|
||||
return autoPtr<solidMixture>(new solidMixture(thermophysicalProperties));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalarField Foam::solidMixture::X
|
||||
(
|
||||
const scalarField& Y
|
||||
) const
|
||||
{
|
||||
scalarField X(Y.size());
|
||||
scalar rhoInv = 0.0;
|
||||
forAll(X, i)
|
||||
{
|
||||
rhoInv += Y[i]/properties_[i].rho();
|
||||
X[i] = Y[i]/properties_[i].rho();
|
||||
}
|
||||
|
||||
return X/rhoInv;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::solidMixture::rho
|
||||
(
|
||||
const scalarField& X
|
||||
) const
|
||||
{
|
||||
scalar val = 0.0;
|
||||
forAll(properties_, i)
|
||||
{
|
||||
val += properties_[i].rho()*X[i];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::solidMixture::Cp
|
||||
(
|
||||
const scalarField& Y
|
||||
) const
|
||||
{
|
||||
scalar val = 0.0;
|
||||
forAll(properties_, i)
|
||||
{
|
||||
val += properties_[i].Cp()*Y[i];
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,144 +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/>.
|
||||
|
||||
Class
|
||||
Foam::solidMixture
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solidMixture_H
|
||||
#define solidMixture_H
|
||||
|
||||
#include "scalarField.H"
|
||||
#include "PtrList.H"
|
||||
#include "solid.H"
|
||||
#include "autoPtr.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solidMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solidMixture
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- The names of the solids
|
||||
List<word> components_;
|
||||
|
||||
//- The solid properties
|
||||
PtrList<solid> properties_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
solidMixture(const dictionary&);
|
||||
|
||||
//- Construct copy
|
||||
solidMixture(const solidMixture& lm);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<solidMixture> clone() const
|
||||
{
|
||||
return autoPtr<solidMixture>(new solidMixture(*this));
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~solidMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Select construct from dictionary
|
||||
static autoPtr<solidMixture> New(const dictionary&);
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the solid names
|
||||
inline const List<word>& components() const
|
||||
{
|
||||
return components_;
|
||||
}
|
||||
|
||||
//- Return the solid properties
|
||||
inline const PtrList<solid>& properties() const
|
||||
{
|
||||
return properties_;
|
||||
}
|
||||
|
||||
//- Return the number of solids in the mixture
|
||||
inline label size() const
|
||||
{
|
||||
return components_.size();
|
||||
}
|
||||
|
||||
|
||||
//- Returns the mass fractions, given mole fractions
|
||||
scalarField Y(const scalarField& X) const;
|
||||
|
||||
//- Returns the mole fractions, given mass fractions
|
||||
scalarField X(const scalarField& Y) const;
|
||||
|
||||
//- Calculate the mixture density [kg/m^3] as a function of
|
||||
// volume fractions
|
||||
scalar rho(const scalarField& X) const;
|
||||
|
||||
//- Calculate the mixture heat capacity [J/(kg K)] as a function
|
||||
// of mass fractions
|
||||
scalar Cp(const scalarField& Y) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,95 +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 "C.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(C, 0);
|
||||
addToRunTimeSelectionTable(solid, C,);
|
||||
addToRunTimeSelectionTable(solid, C, Istream);
|
||||
addToRunTimeSelectionTable(solid, C, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::C::C()
|
||||
:
|
||||
solid(2010, 710, 0.04, 0.0, 1.0)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
WarningIn("C::C()")
|
||||
<< "Properties of graphite need to be checked!!!"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::C::C(const solid& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
Foam::C::C(Istream& is)
|
||||
:
|
||||
solid(is)
|
||||
{}
|
||||
|
||||
|
||||
Foam::C::C(const dictionary& dict)
|
||||
:
|
||||
solid(dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::C::C(const C& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::C::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const C& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,111 +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/>.
|
||||
|
||||
Class
|
||||
Foam::C
|
||||
|
||||
Description
|
||||
Graphite
|
||||
|
||||
SourceFiles
|
||||
C.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_C_H
|
||||
#define solid_C_H
|
||||
|
||||
#include "solid.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class C;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const C&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class C Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class C
|
||||
:
|
||||
public solid
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("C");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
C();
|
||||
|
||||
//- Construct from solid
|
||||
C(const solid& s);
|
||||
|
||||
//- Construct from Istream
|
||||
C(Istream& is);
|
||||
|
||||
//- Construct from dictionary
|
||||
C(const dictionary& dict);
|
||||
|
||||
//- Construct copy
|
||||
C(const C& s);
|
||||
|
||||
//- Construct and return clone
|
||||
virtual autoPtr<solid> clone() const
|
||||
{
|
||||
return autoPtr<solid>(new C(*this));
|
||||
}
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
//- Ostream Operator
|
||||
friend Ostream& operator<<(Ostream& os, const C& s);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,95 +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 "CaCO3.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(CaCO3, 0);
|
||||
addToRunTimeSelectionTable(solid, CaCO3,);
|
||||
addToRunTimeSelectionTable(solid, CaCO3, Istream);
|
||||
addToRunTimeSelectionTable(solid, CaCO3, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CaCO3::CaCO3()
|
||||
:
|
||||
solid(2710, 850, 1.3, 0.0, 1.0)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
WarningIn("CaCO3::CaCO3()")
|
||||
<< "Properties of CaCO3 need to be checked!!!"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::CaCO3::CaCO3(const solid& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
Foam::CaCO3::CaCO3(Istream& is)
|
||||
:
|
||||
solid(is)
|
||||
{}
|
||||
|
||||
|
||||
Foam::CaCO3::CaCO3(const dictionary& dict)
|
||||
:
|
||||
solid(dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::CaCO3::CaCO3(const CaCO3& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::CaCO3::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const CaCO3& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,113 +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/>.
|
||||
|
||||
Class
|
||||
Foam::CaCO3
|
||||
|
||||
Description
|
||||
Calcium carbonate (limestone)
|
||||
|
||||
SourceFiles
|
||||
CaCO3.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_CaCO3_H
|
||||
#define solid_CaCO3_H
|
||||
|
||||
#include "solid.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class CaCO3;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const CaCO3&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class CaCO3 Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class CaCO3
|
||||
:
|
||||
public solid
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("CaCO3");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
CaCO3();
|
||||
|
||||
//- Construct from solid
|
||||
CaCO3(const solid& s);
|
||||
|
||||
//- Construct from Istream
|
||||
CaCO3(Istream& is);
|
||||
|
||||
//- Construct from dictionary
|
||||
CaCO3(const dictionary& dict);
|
||||
|
||||
//- Construct copy
|
||||
CaCO3(const CaCO3& s);
|
||||
|
||||
//- Construct and return clone
|
||||
virtual autoPtr<solid> clone() const
|
||||
{
|
||||
return autoPtr<solid>(new CaCO3(*this));
|
||||
}
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const CaCO3& s);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,8 +0,0 @@
|
||||
solid/solid.C
|
||||
solid/solidNew.C
|
||||
|
||||
ash/ash.C
|
||||
C/C.C
|
||||
CaCO3/CaCO3.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsolids
|
||||
@ -1,3 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude
|
||||
|
||||
@ -1,95 +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 "ash.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(ash, 0);
|
||||
addToRunTimeSelectionTable(solid, ash,);
|
||||
addToRunTimeSelectionTable(solid, ash, Istream);
|
||||
addToRunTimeSelectionTable(solid, ash, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ash::ash()
|
||||
:
|
||||
solid(2010, 710, 0.04, 0.0, 1.0)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
WarningIn("ash::ash()")
|
||||
<< "Properties of ash need to be checked!!!"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ash::ash(const solid& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
Foam::ash::ash(Istream& is)
|
||||
:
|
||||
solid(is)
|
||||
{}
|
||||
|
||||
|
||||
Foam::ash::ash(const dictionary& dict)
|
||||
:
|
||||
solid(dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::ash::ash(const ash& s)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::ash::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const ash& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,113 +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/>.
|
||||
|
||||
Class
|
||||
Foam::ash
|
||||
|
||||
Description
|
||||
Coal ash
|
||||
|
||||
SourceFiles
|
||||
ash.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_ash_H
|
||||
#define solid_ash_H
|
||||
|
||||
#include "solid.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class ash;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const ash&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ash Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class ash
|
||||
:
|
||||
public solid
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("ash");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ash();
|
||||
|
||||
//- Construct from solid
|
||||
ash(const solid& s);
|
||||
|
||||
//- Construct from Istream
|
||||
ash(Istream& is);
|
||||
|
||||
//- Construct from dictionary
|
||||
ash(const dictionary& dict);
|
||||
|
||||
//- Construct copy
|
||||
ash(const ash& s);
|
||||
|
||||
//- Construct and return clone
|
||||
virtual autoPtr<solid> clone() const
|
||||
{
|
||||
return autoPtr<solid>(new ash(*this));
|
||||
}
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const ash& s);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,108 +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 "solid.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(solid, 0);
|
||||
defineRunTimeSelectionTable(solid,);
|
||||
defineRunTimeSelectionTable(solid, Istream);
|
||||
defineRunTimeSelectionTable(solid, dictionary);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::solid::solid
|
||||
(
|
||||
scalar rho,
|
||||
scalar Cp,
|
||||
scalar K,
|
||||
scalar Hf,
|
||||
scalar emissivity
|
||||
)
|
||||
:
|
||||
rho_(rho),
|
||||
Cp_(Cp),
|
||||
K_(K),
|
||||
Hf_(Hf),
|
||||
emissivity_(emissivity)
|
||||
{}
|
||||
|
||||
|
||||
Foam::solid::solid(Istream& is)
|
||||
:
|
||||
rho_(readScalar(is)),
|
||||
Cp_(readScalar(is)),
|
||||
K_(readScalar(is)),
|
||||
Hf_(readScalar(is)),
|
||||
emissivity_(readScalar(is))
|
||||
{}
|
||||
|
||||
|
||||
Foam::solid::solid(const dictionary& dict)
|
||||
:
|
||||
rho_(readScalar(dict.lookup("rho"))),
|
||||
Cp_(readScalar(dict.lookup("Cp"))),
|
||||
K_(readScalar(dict.lookup("K"))),
|
||||
Hf_(readScalar(dict.lookup("Hf"))),
|
||||
emissivity_(readScalar(dict.lookup("emissivity")))
|
||||
{}
|
||||
|
||||
|
||||
Foam::solid::solid(const solid& s)
|
||||
:
|
||||
rho_(s.rho_),
|
||||
Cp_(s.Cp_),
|
||||
K_(s.K_),
|
||||
Hf_(s.Hf_),
|
||||
emissivity_(s.emissivity_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::solid::writeData(Ostream& os) const
|
||||
{
|
||||
os << rho_ << token::SPACE
|
||||
<< Cp_ << token::SPACE
|
||||
<< K_ << token::SPACE
|
||||
<< Hf_ << token::SPACE
|
||||
<< emissivity_;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const solid& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,210 +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/>.
|
||||
|
||||
Class
|
||||
Foam::solid
|
||||
|
||||
Description
|
||||
The thermophysical properties of a solid
|
||||
|
||||
SourceFiles
|
||||
solid.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_H
|
||||
#define solid_H
|
||||
|
||||
#include "typeInfo.H"
|
||||
#include "autoPtr.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class solid;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const solid&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class solid
|
||||
{
|
||||
|
||||
// Private data
|
||||
|
||||
//- Density [kg/m3]
|
||||
scalar rho_;
|
||||
|
||||
//- Specific heat capacity [J/(kg.K)]
|
||||
scalar Cp_;
|
||||
|
||||
//- Thermal conductivity [W/(m.K)]
|
||||
scalar K_;
|
||||
|
||||
//- Heat of formation [J/kg]
|
||||
scalar Hf_;
|
||||
|
||||
//- Emissivity
|
||||
scalar emissivity_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("solid");
|
||||
|
||||
|
||||
// Declare run-time constructor selection tables
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
solid,
|
||||
,
|
||||
(),
|
||||
()
|
||||
);
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
solid,
|
||||
Istream,
|
||||
(Istream& is),
|
||||
(is)
|
||||
);
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
solid,
|
||||
dictionary,
|
||||
(const dictionary& dict),
|
||||
(dict)
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
solid
|
||||
(
|
||||
scalar rho,
|
||||
scalar Cp,
|
||||
scalar K,
|
||||
scalar Hf,
|
||||
scalar emissivity
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
solid(Istream& is);
|
||||
|
||||
//- Construct from dictionary
|
||||
solid(const dictionary& dict);
|
||||
|
||||
//- Construct copy
|
||||
solid(const solid& s);
|
||||
|
||||
//- Construct and return clone
|
||||
virtual autoPtr<solid> clone() const
|
||||
{
|
||||
return autoPtr<solid>(new solid(*this));
|
||||
}
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a pointer to a new solid created from input
|
||||
static autoPtr<solid> New(Istream& is);
|
||||
|
||||
//- Return a pointer to a new solid created from dictionary
|
||||
static autoPtr<solid> New(const dictionary& dict);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~solid()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Physical constants which define the solid
|
||||
|
||||
//- Density [kg/m3]
|
||||
inline scalar rho() const;
|
||||
|
||||
//- Specific heat capacity [J/(kg.K)]
|
||||
inline scalar Cp() const;
|
||||
|
||||
//- Thermal conductivity [W/(m.K)]
|
||||
inline scalar K() const;
|
||||
|
||||
//- Heat of formation [J/kg]
|
||||
inline scalar Hf() const;
|
||||
|
||||
//- Total enthalpy - reference to Tstd [J/kg]
|
||||
inline scalar H(const scalar T) const;
|
||||
|
||||
//- Sensible enthalpy - reference to Tstd [J/kg]
|
||||
inline scalar Hs(const scalar T) const;
|
||||
|
||||
//- Emissivity []
|
||||
inline scalar emissivity() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the solid properties
|
||||
virtual void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const solid& s);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "solidI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,72 +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 "specie.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::scalar Foam::solid::rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::Cp() const
|
||||
{
|
||||
return Cp_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::K() const
|
||||
{
|
||||
return K_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::Hf() const
|
||||
{
|
||||
return Hf_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::H(const scalar T) const
|
||||
{
|
||||
return Hs(T) + Hf_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::Hs(const scalar T) const
|
||||
{
|
||||
return Cp_*(T - specie::Tstd);
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::emissivity() const
|
||||
{
|
||||
return emissivity_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,131 +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 "solid.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "solid::New(Istream&): constructing solid" << endl;
|
||||
}
|
||||
|
||||
const word solidType(is);
|
||||
const word coeffs(is);
|
||||
|
||||
if (coeffs == "defaultCoeffs")
|
||||
{
|
||||
ConstructorTable::iterator cstrIter =
|
||||
ConstructorTablePtr_->find(solidType);
|
||||
|
||||
if (cstrIter == ConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("solid::New(Istream&)")
|
||||
<< "Unknown solid type " << solidType << nl << nl
|
||||
<< "Valid solid types are :" << endl
|
||||
<< ConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<solid>(cstrIter()());
|
||||
}
|
||||
else if (coeffs == "coeffs")
|
||||
{
|
||||
IstreamConstructorTable::iterator cstrIter =
|
||||
IstreamConstructorTablePtr_->find(solidType);
|
||||
|
||||
if (cstrIter == IstreamConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("solid::New(Istream&)")
|
||||
<< "Unknown solid type " << solidType << nl << nl
|
||||
<< "Valid solid types are :" << endl
|
||||
<< IstreamConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<solid>(cstrIter()(is));
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("solid::New(Istream&)")
|
||||
<< "solid type " << solidType
|
||||
<< ", option " << coeffs << " given"
|
||||
<< ", should be coeffs or defaultCoeffs"
|
||||
<< exit(FatalError);
|
||||
|
||||
return autoPtr<solid>(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::solid> Foam::solid::New(const dictionary& dict)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "solid::New(const dictionary&): constructing solid" << endl;
|
||||
}
|
||||
|
||||
const word solidType(dict.dictName());
|
||||
const Switch defaultCoeffs(dict.lookup("defaultCoeffs"));
|
||||
|
||||
if (defaultCoeffs)
|
||||
{
|
||||
ConstructorTable::iterator cstrIter =
|
||||
ConstructorTablePtr_->find(solidType);
|
||||
|
||||
if (cstrIter == ConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("solid::New(const dictionary&)")
|
||||
<< "Unknown solid type " << solidType << nl << nl
|
||||
<< "Valid solid types are :" << endl
|
||||
<< ConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<solid>(cstrIter()());
|
||||
}
|
||||
else
|
||||
{
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(solidType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn("solid::New(const dictionary&)")
|
||||
<< "Unknown solid type " << solidType << nl << nl
|
||||
<< "Valid solid types are :" << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<solid>(cstrIter()(dict));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
Reference in New Issue
Block a user