mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
tidy-up and added CaCO3 - put solids in their own namespace?
This commit is contained in:
@ -268,7 +268,7 @@ void Foam::KinematicParcel<ParcelType>::transformProperties
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "KinematicParcelIO.C"
|
||||
|
||||
|
||||
@ -385,7 +385,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "ReactingMultiphaseParcelIO.C"
|
||||
|
||||
|
||||
@ -236,7 +236,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "ReactingParcelIO.C"
|
||||
|
||||
|
||||
@ -174,7 +174,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
#include "ThermoParcelIO.C"
|
||||
|
||||
|
||||
86
src/thermophysicalModels/solids/C/C.C
Normal file
86
src/thermophysicalModels/solids/C/C.C
Normal file
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "C.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(C, 0);
|
||||
addToRunTimeSelectionTable(solid, C,);
|
||||
addToRunTimeSelectionTable(solid, C, Istream);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::C::C()
|
||||
:
|
||||
solid(2010, 710, 0.04, 0.0, 1.0)
|
||||
{
|
||||
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)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::C::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& operator<<(Ostream& os, const C& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
100
src/thermophysicalModels/solids/C/C.H
Normal file
100
src/thermophysicalModels/solids/C/C.H
Normal file
@ -0,0 +1,100 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
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);
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
// ************************************************************************* //
|
||||
86
src/thermophysicalModels/solids/CaCO3/CaCO3.C
Normal file
86
src/thermophysicalModels/solids/CaCO3/CaCO3.C
Normal file
@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "CaCO3.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(CaCO3, 0);
|
||||
addToRunTimeSelectionTable(solid, CaCO3,);
|
||||
addToRunTimeSelectionTable(solid, CaCO3, Istream);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::CaCO3::CaCO3()
|
||||
:
|
||||
solid(2710, 850, 1.3, 0.0, 1.0)
|
||||
{
|
||||
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)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::CaCO3::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& operator<<(Ostream& os, const CaCO3& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,18 +23,18 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::Cs
|
||||
Foam::CaCO3
|
||||
|
||||
Description
|
||||
Graphite
|
||||
Calcium carbonate (limestone)
|
||||
|
||||
SourceFiles
|
||||
Cs.C
|
||||
CaCO3.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef solid_Cs_H
|
||||
#define solid_Cs_H
|
||||
#ifndef solid_CaCO3_H
|
||||
#define solid_CaCO3_H
|
||||
|
||||
#include "solid.H"
|
||||
|
||||
@ -43,11 +43,20 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class CaCO3;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const CaCO3&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Cs Declaration
|
||||
Class CaCO3 Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class Cs
|
||||
class CaCO3
|
||||
:
|
||||
public solid
|
||||
{
|
||||
@ -55,50 +64,30 @@ class Cs
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Cs");
|
||||
TypeName("CaCO3");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
Cs()
|
||||
:
|
||||
solid(2010, 710, 0.04, 0.0, 1.0)
|
||||
{
|
||||
WarningIn("Cs::Cs()")
|
||||
<< "Properties of graphite need to be checked!!!"
|
||||
<< endl;
|
||||
}
|
||||
CaCO3();
|
||||
|
||||
//- Construct from solid
|
||||
Cs
|
||||
(
|
||||
const solid& s
|
||||
)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
CaCO3(const solid& s);
|
||||
|
||||
//- Construct from Istream
|
||||
Cs(Istream& is)
|
||||
:
|
||||
solid(is)
|
||||
{}
|
||||
CaCO3(Istream& is);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const Cs& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
friend Ostream& operator<<(Ostream& os, const CaCO3& s);
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
solid/solid.C
|
||||
solid/newSolid.C
|
||||
|
||||
ash/ash.C
|
||||
Cs/Cs.C
|
||||
C/C.C
|
||||
CaCO3/CaCO3.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libsolids
|
||||
|
||||
@ -38,6 +38,47 @@ defineTypeNameAndDebug(ash, 0);
|
||||
addToRunTimeSelectionTable(solid, ash,);
|
||||
addToRunTimeSelectionTable(solid, ash, Istream);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::ash::ash()
|
||||
:
|
||||
solid(2010, 710, 0.04, 0.0, 1.0)
|
||||
{
|
||||
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)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::ash::writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& operator<<(Ostream& os, const ash& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -43,6 +43,15 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class ash;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const ash&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class ash Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -61,45 +70,24 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
ash()
|
||||
:
|
||||
// rho Cp K Hf e
|
||||
// [kg/m3] [J/(kg.K)] [W/(m.K)] [J/kg] [-]
|
||||
solid(2010, 710, 0.04, 0.0, 1.0) // TODO
|
||||
{
|
||||
WarningIn("ash::ash()")
|
||||
<< "Properties of ash need to be checked!!!"
|
||||
<< endl;
|
||||
}
|
||||
ash();
|
||||
|
||||
ash
|
||||
(
|
||||
const solid& s
|
||||
)
|
||||
:
|
||||
solid(s)
|
||||
{}
|
||||
//- Construct from solid
|
||||
ash(const solid& s);
|
||||
|
||||
//- Construct from Istream
|
||||
ash(Istream& is)
|
||||
:
|
||||
solid(is)
|
||||
{}
|
||||
ash(Istream& is);
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the function coefficients
|
||||
void writeData(Ostream& os) const
|
||||
{
|
||||
solid::writeData(os);
|
||||
}
|
||||
void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const ash& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
friend Ostream& operator<<(Ostream& os, const ash& s);
|
||||
};
|
||||
|
||||
|
||||
|
||||
89
src/thermophysicalModels/solids/solid/newSolid.C
Normal file
89
src/thermophysicalModels/solids/solid/newSolid.C
Normal file
@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "solid.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::solid> Foam::solid::New(Istream& is)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "solid::New(Istream&): "
|
||||
<< "constructing solid"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
word solidType(is);
|
||||
|
||||
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_->toc()
|
||||
<< 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_->toc()
|
||||
<< 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -39,61 +39,51 @@ defineRunTimeSelectionTable(solid, Istream);
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<solid> solid::New(Istream& is)
|
||||
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))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::solid::writeData(Ostream& os) const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "solid::New(Istream&): "
|
||||
<< "constructing solid"
|
||||
<< endl;
|
||||
}
|
||||
os << rho_ << token::SPACE
|
||||
<< cp_ << token::SPACE
|
||||
<< K_ << token::SPACE
|
||||
<< Hf_ << token::SPACE
|
||||
<< emissivity_;
|
||||
}
|
||||
|
||||
word solidType(is);
|
||||
|
||||
word coeffs(is);
|
||||
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
|
||||
|
||||
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_->toc()
|
||||
<< 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_->toc()
|
||||
<< 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::Ostream& operator<<(Ostream& os, const solid& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -45,6 +45,15 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class solid;
|
||||
|
||||
Ostream& operator<<
|
||||
(
|
||||
Ostream&,
|
||||
const solid&
|
||||
);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class solid Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -107,24 +116,10 @@ public:
|
||||
scalar K,
|
||||
scalar Hf,
|
||||
scalar emissivity
|
||||
)
|
||||
:
|
||||
rho_(rho),
|
||||
cp_(cp),
|
||||
K_(K),
|
||||
Hf_(Hf),
|
||||
emissivity_(emissivity)
|
||||
{}
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
solid(Istream& is)
|
||||
:
|
||||
rho_(readScalar(is)),
|
||||
cp_(readScalar(is)),
|
||||
K_(readScalar(is)),
|
||||
Hf_(readScalar(is)),
|
||||
emissivity_(readScalar(is))
|
||||
{}
|
||||
solid(Istream& is);
|
||||
|
||||
//- Return a pointer to a new solid created from input
|
||||
static autoPtr<solid> New(Istream& is);
|
||||
@ -141,59 +136,37 @@ public:
|
||||
// Phisical constants which define the solid
|
||||
|
||||
//- Density [kg/m3]
|
||||
scalar rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
inline scalar rho() const;
|
||||
|
||||
//- Specific heat capacity [J/(kg.K)]
|
||||
scalar cp() const
|
||||
{
|
||||
return cp_;
|
||||
}
|
||||
inline scalar cp() const;
|
||||
|
||||
//- Thermal conductivity [W/(m.K)]
|
||||
scalar K() const
|
||||
{
|
||||
return K_;
|
||||
}
|
||||
inline scalar K() const;
|
||||
|
||||
//- Heat of formation [J/kg]
|
||||
scalar Hf() const
|
||||
{
|
||||
return Hf_;
|
||||
}
|
||||
inline scalar Hf() const;
|
||||
|
||||
//- emissivity
|
||||
scalar emissivity() const
|
||||
{
|
||||
return emissivity_;
|
||||
}
|
||||
//- Emissivity []
|
||||
inline scalar emissivity() const;
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Write the solid properties
|
||||
virtual void writeData(Ostream& os) const
|
||||
{
|
||||
os<< rho_ << token::SPACE
|
||||
<< cp_ << token::SPACE
|
||||
<< K_ << token::SPACE
|
||||
<< Hf_ << token::SPACE
|
||||
<< emissivity_;
|
||||
}
|
||||
virtual void writeData(Ostream& os) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream& os, const solid& s)
|
||||
{
|
||||
s.writeData(os);
|
||||
return os;
|
||||
}
|
||||
friend Ostream& operator<<(Ostream& os, const solid& s);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "solidI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -24,22 +24,36 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Cs.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
inline Foam::scalar Foam::solid::rho() const
|
||||
{
|
||||
return rho_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(Cs, 0);
|
||||
addToRunTimeSelectionTable(solid, Cs,);
|
||||
addToRunTimeSelectionTable(solid, Cs, Istream);
|
||||
inline Foam::scalar Foam::solid::cp() const
|
||||
{
|
||||
return cp_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
inline Foam::scalar Foam::solid::K() const
|
||||
{
|
||||
return K_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::Hf() const
|
||||
{
|
||||
return Hf_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::scalar Foam::solid::emissivity() const
|
||||
{
|
||||
return emissivity_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user