1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
28 template<class Thermo>
29 inline Foam::constTransport<Thermo>::constTransport
42 template<class Thermo>
43 inline Foam::constTransport<Thermo>::constTransport
46 const constTransport& ct
55 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
57 template<class Thermo>
58 inline Foam::scalar Foam::constTransport<Thermo>::mu(const scalar) const
64 template<class Thermo>
65 inline Foam::scalar Foam::constTransport<Thermo>::kappa(const scalar T) const
67 return this->Cp(T)*mu(T)*rPr_;
71 template<class Thermo>
72 inline Foam::scalar Foam::constTransport<Thermo>::alpha(const scalar T) const
74 scalar Cp_ = this->Cp(T);
76 scalar deltaT = T - specie::Tstd;
78 (deltaT*(this->H(T) - this->H(specie::Tstd)) + Cp_)/(sqr(deltaT) + 1);
80 return Cp_*mu(T)*rPr_/CpBar;
84 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
86 template<class Thermo>
87 inline Foam::constTransport<Thermo>& Foam::constTransport<Thermo>::operator=
89 const constTransport<Thermo>& ct
92 Thermo::operator=(ct);
101 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
103 template<class Thermo>
104 inline Foam::constTransport<Thermo> Foam::operator+
106 const constTransport<Thermo>& ct1,
107 const constTransport<Thermo>& ct2
112 static_cast<const Thermo&>(ct1) + static_cast<const Thermo&>(ct2)
115 scalar molr1 = ct1.nMoles()/t.nMoles();
116 scalar molr2 = ct2.nMoles()/t.nMoles();
118 return constTransport<Thermo>
121 molr1*ct1.mu_ + molr2*ct2.mu_,
122 molr1*ct1.rPr_ + molr2*ct2.rPr_
127 template<class Thermo>
128 inline Foam::constTransport<Thermo> Foam::operator-
130 const constTransport<Thermo>& ct1,
131 const constTransport<Thermo>& ct2
136 static_cast<const Thermo&>(ct1) - static_cast<const Thermo&>(ct2)
139 scalar molr1 = ct1.nMoles()/t.nMoles();
140 scalar molr2 = ct2.nMoles()/t.nMoles();
142 return constTransport<Thermo>
145 molr1*ct1.mu_ - molr2*ct2.mu_,
146 molr1*ct1.rPr_ - molr2*ct2.rPr_
151 template<class Thermo>
152 inline Foam::constTransport<Thermo> Foam::operator*
155 const constTransport<Thermo>& ct
158 return constTransport<Thermo>
160 s*static_cast<const Thermo&>(ct),
167 template<class Thermo>
168 inline Foam::constTransport<Thermo> Foam::operator==
170 const constTransport<Thermo>& ct1,
171 const constTransport<Thermo>& ct2
178 // ************************************************************************* //