STY: Correcting templates names and correcting write member function in

polynomialSolidTransport
This commit is contained in:
Sergio Ferraris
2013-06-14 12:05:29 +01:00
parent 5d33f36a2f
commit ea3ba49f52
6 changed files with 54 additions and 66 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,26 +28,26 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport
( (
const dictionary& dict const dictionary& dict
) )
: :
thermo(dict), Thermo(dict),
kappa_(dict.subDict("transport").lookup("kappa")) kappa_(dict.subDict("transport").lookup("kappa"))
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
void Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport::write void Foam::constAnIsoSolidTransport<Thermo>::constAnIsoSolidTransport::write
( (
Ostream& os Ostream& os
) const ) const
{ {
thermo::write(os); Thermo::write(os);
dictionary dict("transport"); dictionary dict("transport");
dict.add("kappa", kappa_); dict.add("kappa", kappa_);
@ -57,14 +57,14 @@ void Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport::write
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, Ostream& os,
const constAnIsoSolidTransport<thermo>& ct const constAnIsoSolidTransport<Thermo>& ct
) )
{ {
operator<<(os, static_cast<const thermo&>(ct)); operator<<(os, static_cast<const Thermo&>(ct));
os << tab << ct.kappa_; os << tab << ct.kappa_;
os.check os.check

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -28,13 +28,13 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport
( (
const dictionary& dict const dictionary& dict
) )
: :
thermo(dict), Thermo(dict),
kappa0_(0.0), kappa0_(0.0),
n0_(0.0), n0_(0.0),
Tref_(0.0) Tref_(0.0)
@ -48,13 +48,13 @@ Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
void Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport::write void Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport::write
( (
Ostream& os Ostream& os
) const ) const
{ {
thermo::write(os); Thermo::write(os);
dictionary dict("transport"); dictionary dict("transport");
dict.add("kappa0", kappa0_); dict.add("kappa0", kappa0_);
@ -66,13 +66,13 @@ void Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport::write
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
( (
Ostream& os, const exponentialSolidTransport<thermo>& et Ostream& os, const exponentialSolidTransport<Thermo>& et
) )
{ {
operator<<(os, static_cast<const thermo&>(et)); operator<<(os, static_cast<const Thermo&>(et));
os << tab << et.kappa0_ << tab << et.n0_ << tab << et.Tref_; os << tab << et.kappa0_ << tab << et.n0_ << tab << et.Tref_;
os.check os.check

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,30 +25,30 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport inline Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport
( (
const thermo& t, const Thermo& t,
const scalar kappa0, const scalar kappa0,
const scalar n0, const scalar n0,
const scalar Tref const scalar Tref
) )
: :
thermo(t), Thermo(t),
kappa0_(kappa0), kappa0_(kappa0),
n0_(n0), n0_(n0),
Tref_(Tref) Tref_(Tref)
{} {}
template<class thermo> template<class Thermo>
inline Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport inline Foam::exponentialSolidTransport<Thermo>::exponentialSolidTransport
( (
const word& name, const word& name,
const exponentialSolidTransport& ct const exponentialSolidTransport& ct
) )
: :
thermo(name, ct), Thermo(name, ct),
kappa0_(ct.kappa0_), kappa0_(ct.kappa0_),
n0_(ct.n0_), n0_(ct.n0_),
Tref_(ct.Tref_) Tref_(ct.Tref_)
@ -70,8 +70,8 @@ Foam::exponentialSolidTransport<Thermo>::New
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa inline Foam::scalar Foam::exponentialSolidTransport<Thermo>::kappa
( (
const scalar p, const scalar T const scalar p, const scalar T
) const ) const
@ -80,8 +80,8 @@ inline Foam::scalar Foam::exponentialSolidTransport<thermo>::kappa
} }
template<class thermo> template<class Thermo>
inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa inline Foam::vector Foam::exponentialSolidTransport<Thermo>::Kappa
( (
const scalar p, const scalar T const scalar p, const scalar T
) const ) const
@ -91,13 +91,13 @@ inline Foam::vector Foam::exponentialSolidTransport<thermo>::Kappa
} }
template<class thermo> template<class Thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>:: inline Foam::scalar Foam::exponentialSolidTransport<Thermo>::
mu(const scalar p, const scalar T) const mu(const scalar p, const scalar T) const
{ {
notImplemented notImplemented
( (
"Foam::scalar Foam::exponentialSolidTransport<thermo>mu::" "Foam::scalar Foam::exponentialSolidTransport<Thermo>mu::"
"(" "("
" const scalar p, const scalar T" " const scalar p, const scalar T"
") const" ") const"
@ -106,8 +106,8 @@ mu(const scalar p, const scalar T) const
} }
template<class thermo> template<class Thermo>
inline Foam::scalar Foam::exponentialSolidTransport<thermo>:: inline Foam::scalar Foam::exponentialSolidTransport<Thermo>::
alphah(const scalar p, const scalar T) const alphah(const scalar p, const scalar T) const
{ {
return kappa(p, T)/this->Cpv(p, T); return kappa(p, T)/this->Cpv(p, T);
@ -116,33 +116,28 @@ alphah(const scalar p, const scalar T) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::exponentialSolidTransport<thermo>& inline Foam::exponentialSolidTransport<Thermo>&
Foam::exponentialSolidTransport<thermo>::operator= Foam::exponentialSolidTransport<Thermo>::operator=
( (
const exponentialSolidTransport<thermo>& ct const exponentialSolidTransport<Thermo>& ct
) )
{ {
//thermo::operator=(ct);
kappa0_ = ct.kappa0_; kappa0_ = ct.kappa0_;
n0_ = ct.n0_; n0_ = ct.n0_;
Tref_ = ct.Tref_; Tref_ = ct.Tref_;
return *this; return *this;
} }
template<class thermo> template<class Thermo>
inline void Foam::exponentialSolidTransport<thermo>::operator+= inline void Foam::exponentialSolidTransport<Thermo>::operator+=
( (
const exponentialSolidTransport<thermo>& ct const exponentialSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
//thermo::operator+=(ct);
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles(); scalar molr2 = ct.nMoles()/this->nMoles();
@ -152,16 +147,14 @@ inline void Foam::exponentialSolidTransport<thermo>::operator+=
} }
template<class thermo> template<class Thermo>
inline void Foam::exponentialSolidTransport<thermo>::operator-= inline void Foam::exponentialSolidTransport<Thermo>::operator-=
( (
const exponentialSolidTransport<thermo>& ct const exponentialSolidTransport<Thermo>& ct
) )
{ {
scalar molr1 = this->nMoles(); scalar molr1 = this->nMoles();
//thermo::operator-=(ct);
molr1 /= this->nMoles(); molr1 /= this->nMoles();
scalar molr2 = ct.nMoles()/this->nMoles(); scalar molr2 = ct.nMoles()/this->nMoles();
@ -173,16 +166,16 @@ inline void Foam::exponentialSolidTransport<thermo>::operator-=
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
template<class thermo> template<class Thermo>
inline Foam::exponentialSolidTransport<thermo> Foam::operator* inline Foam::exponentialSolidTransport<Thermo> Foam::operator*
( (
const scalar s, const scalar s,
const exponentialSolidTransport<thermo>& ct const exponentialSolidTransport<Thermo>& ct
) )
{ {
return exponentialSolidTransport<thermo> return exponentialSolidTransport<Thermo>
( (
s*static_cast<const thermo&>(ct), s*static_cast<const Thermo&>(ct),
ct.kappa0_, ct.kappa0_,
ct.n0_, ct.n0_,
ct.Tref_ ct.Tref_

View File

@ -63,9 +63,6 @@ Foam::polynomialSolidTransport<Thermo, PolySize>::polynomialSolidTransport
template<class Thermo, int PolySize> template<class Thermo, int PolySize>
void Foam::polynomialSolidTransport<Thermo, PolySize>::write(Ostream& os) const void Foam::polynomialSolidTransport<Thermo, PolySize>::write(Ostream& os) const
{ {
os << this->name() << endl;
os << token::BEGIN_BLOCK << incrIndent << nl;
Thermo::write(os); Thermo::write(os);
dictionary dict("transport"); dictionary dict("transport");
@ -76,8 +73,6 @@ void Foam::polynomialSolidTransport<Thermo, PolySize>::write(Ostream& os) const
kappaCoeffs_ kappaCoeffs_
); );
os << indent << dict.dictName() << dict; os << indent << dict.dictName() << dict;
os << decrIndent << token::END_BLOCK << nl;
} }

View File

@ -38,7 +38,7 @@ boundaryField
} }
outlet outlet
{ {
type fixedFluxPressure; type fixedValue;
value $internalField; value $internalField;
} }
fixedWalls fixedWalls