Skip to content
Snippets Groups Projects
Commit 05e08889 authored by Henry's avatar Henry
Browse files

solidReactionThermo: Removed radiation

parent 9d044ac1
Branches
Tags
No related merge requests found
......@@ -39,7 +39,6 @@ Description
#include "constIsoSolidTransport.H"
#include "constAnIsoSolidTransport.H"
#include "exponentialSolidTransport.H"
#include "constSolidRad.H"
#include "sensibleEnthalpy.H"
#include "thermo.H"
......@@ -50,16 +49,13 @@ namespace Foam
typedef
constIsoSolidTransport
<
constSolidRad
species::thermo
<
species::thermo
hConstThermo
<
hConstThermo
<
rhoConst<specie>
>,
sensibleEnthalpy
>
rhoConst<specie>
>,
sensibleEnthalpy
>
>
hConstSolidThermoPhysics;
......@@ -67,16 +63,13 @@ namespace Foam
typedef
exponentialSolidTransport
<
constSolidRad
species::thermo
<
species::thermo
hExponentialThermo
<
hExponentialThermo
<
rhoConst<specie>
>,
sensibleEnthalpy
>
rhoConst<specie>
>,
sensibleEnthalpy
>
>
hExponentialSolidThermoPhysics;
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constSolidRad.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo>
constSolidRad<thermo>::constSolidRad(const dictionary& dict)
:
thermo(dict),
kappaRad_(readScalar(dict.subDict("radiation").lookup("kappaRad"))),
sigmaS_(readScalar(dict.subDict("radiation").lookup("sigmaS"))),
emissivity_(readScalar(dict.subDict("radiation").lookup("emissivity")))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo>
void Foam::constSolidRad<thermo>::constSolidRad::write(Ostream& os) const
{
thermo::write(os);
dictionary dict("radiation");
dict.add("kappaRad", kappaRad_);
dict.add("sigmaS", sigmaS_);
dict.add("emissivity", emissivity_);
os << indent << dict.dictName() << dict;
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class thermo>
Ostream& operator<<(Ostream& os, const constSolidRad<thermo>& pg)
{
os << static_cast<const thermo&>(pg);
os << tab << pg.kappaRad_ << tab << pg.sigmaS_ << tab << pg.emissivity_;
os.check("Ostream& operator<<(Ostream& os, const constSolidRad& st)");
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::constSolidRad
Description
Constant radiative properties
SourceFiles
constSolidRadI.H
constSolidRad.C
\*---------------------------------------------------------------------------*/
#ifndef constSolidRad_H
#define constSolidRad_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Thermo> class constSolidRad;
template<class Thermo>
inline constSolidRad<Thermo> operator*
(
const scalar,
const constSolidRad<Thermo>&
);
template<class Thermo>
Ostream& operator<<
(
Ostream&,
const constSolidRad<Thermo>&
);
/*---------------------------------------------------------------------------*\
Class constSolidRad Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo>
class constSolidRad
:
public Thermo
{
// Private data
//- Absorption coefficient
scalar kappaRad_;
//- Scattering coefficient
scalar sigmaS_;
//- Emissivity coefficient
scalar emissivity_;
//- Construct from components
inline constSolidRad
(
const Thermo& t,
const scalar kappaRad,
const scalar sigmaS,
const scalar emissivity
);
public:
// Constructors
//- Construct from Istream
constSolidRad(const dictionary&);
//- Construct as named copy
inline constSolidRad(const word& name, const constSolidRad&);
//- Construct and return a clone
inline autoPtr<constSolidRad> clone() const;
// Selector from Istream
inline static autoPtr<constSolidRad> New(Istream& is);
// Member functions
//- Return the instantiated type name
static word typeName()
{
return "const<" + Thermo::typeName() + '>';
}
//- Return absorption coefficient [1/m]
inline scalar kappaRad(scalar T) const;
//- Return scattering [1/m]
inline scalar sigmaS(scalar T) const;
//- Return emissivity[]
inline scalar emissivity(scalar T) const;
//- Write to Ostream
void write(Ostream& os) const;
// Member operators
inline constSolidRad& operator=(const constSolidRad&);
inline void operator+=(const constSolidRad&);
inline void operator-=(const constSolidRad&);
// Friend operators
friend constSolidRad operator* <Thermo>
(
const scalar,
const constSolidRad&
);
// Ostream Operator
friend Ostream& operator<< <Thermo>
(
Ostream&,
const constSolidRad&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "constSolidRadI.H"
#ifdef NoRepository
# include "constSolidRad.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constSolidRad.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class thermo>
inline Foam::constSolidRad<thermo>::constSolidRad
(
const thermo& t,
const scalar kappaRad,
const scalar sigmaS,
const scalar emissivity
)
:
thermo(t),
kappaRad_(kappaRad),
sigmaS_(sigmaS),
emissivity_(emissivity)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo>
inline Foam::constSolidRad<thermo>::constSolidRad
(
const word& name,
const constSolidRad& pg
)
:
thermo(name, pg),
kappaRad_(pg.kappaRad_),
sigmaS_(pg.sigmaS_),
emissivity_(pg.emissivity_)
{}
template<class thermo>
inline Foam::autoPtr<Foam::constSolidRad<thermo> >
Foam::constSolidRad<thermo>::clone() const
{
return autoPtr<constSolidRad<thermo> >(new constSolidRad<thermo>(*this));
}
template<class thermo>
inline Foam::autoPtr<Foam::constSolidRad<thermo> >
Foam::constSolidRad<thermo>::New(Istream& is)
{
return autoPtr<constSolidRad<thermo> >(new constSolidRad<thermo>(is));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo>
inline Foam::scalar Foam::constSolidRad<thermo>::kappaRad(scalar) const
{
return kappaRad_;
}
template<class thermo>
inline Foam::scalar Foam::constSolidRad<thermo>::sigmaS(scalar) const
{
return sigmaS_;
}
template<class thermo>
inline Foam::scalar Foam::constSolidRad<thermo>::emissivity(scalar) const
{
return emissivity_;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo>
inline Foam::constSolidRad<thermo>&
Foam::constSolidRad<thermo>::operator=(const constSolidRad<thermo>& ct)
{
thermo::operator=(ct);
kappaRad_ = ct.kappaRad_;
sigmaS_ = ct.sigmaS_;
emissivity_ = ct.emissivity_;
return *this;
}
template<class thermo>
inline void Foam::constSolidRad<thermo>::operator+=
(
const constSolidRad<thermo>& ct
)
{
scalar molr1 = this->nMoles();
thermo::operator+=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
kappaRad_ = molr1*kappaRad_ + molr2*ct.kappaRad_;
sigmaS_ = molr1*sigmaS_ + molr2*ct.sigmaS_;
emissivity_ = molr1*emissivity_ + molr2*ct.emissivity_;
}
template<class thermo>
inline void Foam::constSolidRad<thermo>::operator-=
(
const constSolidRad<thermo>& ct
)
{
scalar molr1 = this->nMoles();
thermo::operator-=(ct);
molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles();
kappaRad_ = molr1*kappaRad_ - molr2*ct.kappaRad_;
sigmaS_ = molr1*sigmaS_ - molr2*ct.sigmaS_;
emissivity_ = molr1*emissivity_ - molr2*ct.emissivity_;
}
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo>
inline Foam::constSolidRad<thermo> Foam::operator*
(
const scalar s,
const constSolidRad<thermo>& ct
)
{
return constSolidRad<thermo>
(
s*static_cast<const thermo&>(ct),
ct.kappaRad_,
ct.sigmaS_,
ct.emissivity_
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment