1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 template<class thermo>
37 inline void sutherlandTransport<thermo>::calcCoeffs
39 const scalar mu1, const scalar T1,
40 const scalar mu2, const scalar T2
43 scalar rootT1 = sqrt(T1);
44 scalar mu1rootT2 = mu1*sqrt(T2);
45 scalar mu2rootT1 = mu2*rootT1;
47 Ts = (mu2rootT1 - mu1rootT2)/(mu1rootT2/T1 - mu2rootT1/T2);
49 As = mu1*(1.0 + Ts/T1)/rootT1;
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 // Construct from components
56 template<class thermo>
57 inline sutherlandTransport<thermo>::sutherlandTransport
70 // Construct from components
71 template<class thermo>
72 inline sutherlandTransport<thermo>::sutherlandTransport
75 const scalar mu1, const scalar T1,
76 const scalar mu2, const scalar T2
81 calcCoeffs(mu1, T1, mu2, T2);
85 //- Construct as named copy
86 template<class thermo>
87 inline sutherlandTransport<thermo>::sutherlandTransport
90 const sutherlandTransport& st
99 // Construct and return a clone
100 template<class thermo>
101 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
104 return autoPtr<sutherlandTransport<thermo> >
106 new sutherlandTransport<thermo>(*this)
111 // Selector from Istream
112 template<class thermo>
113 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
118 return autoPtr<sutherlandTransport<thermo> >
120 new sutherlandTransport<thermo>(is)
125 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
127 // Dynamic viscosity [kg/ms]
128 template<class thermo>
129 inline scalar sutherlandTransport<thermo>::mu(const scalar T) const
131 return As*::sqrt(T)/(1.0 + Ts/T);
135 // Thermal conductivity [W/mK]
136 template<class thermo>
137 inline scalar sutherlandTransport<thermo>::kappa(const scalar T) const
139 scalar Cv_ = this->Cv(T);
140 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
144 // Thermal diffusivity for enthalpy [kg/ms]
145 template<class thermo>
146 inline scalar sutherlandTransport<thermo>::alpha(const scalar T) const
148 scalar Cv_ = this->Cv(T);
149 scalar R_ = this->R();
150 scalar Cp_ = Cv_ + R_;
152 scalar deltaT = T - specie::Tstd;
154 (deltaT*(this->H(T) - this->H(specie::Tstd)) + Cp_)/(sqr(deltaT) + 1);
156 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_)/CpBar;
160 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
162 template<class thermo>
163 inline sutherlandTransport<thermo>& sutherlandTransport<thermo>::operator=
165 const sutherlandTransport<thermo>& st
168 thermo::operator=(st);
177 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
179 template<class thermo>
180 inline sutherlandTransport<thermo> operator+
182 const sutherlandTransport<thermo>& st1,
183 const sutherlandTransport<thermo>& st2
188 static_cast<const thermo&>(st1) + static_cast<const thermo&>(st2)
191 scalar molr1 = st1.nMoles()/t.nMoles();
192 scalar molr2 = st2.nMoles()/t.nMoles();
194 return sutherlandTransport<thermo>
197 molr1*st1.As + molr2*st2.As,
198 molr1*st1.Ts + molr2*st2.Ts
203 template<class thermo>
204 inline sutherlandTransport<thermo> operator-
206 const sutherlandTransport<thermo>& st1,
207 const sutherlandTransport<thermo>& st2
212 static_cast<const thermo&>(st1) - static_cast<const thermo&>(st2)
215 scalar molr1 = st1.nMoles()/t.nMoles();
216 scalar molr2 = st2.nMoles()/t.nMoles();
218 return sutherlandTransport<thermo>
221 molr1*st1.As - molr2*st2.As,
222 molr1*st1.Ts - molr2*st2.Ts
227 template<class thermo>
228 inline sutherlandTransport<thermo> operator*
231 const sutherlandTransport<thermo>& st
234 return sutherlandTransport<thermo>
236 s*static_cast<const thermo&>(st),
243 template<class thermo>
244 inline sutherlandTransport<thermo> operator==
246 const sutherlandTransport<thermo>& st1,
247 const sutherlandTransport<thermo>& st2
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 } // End namespace Foam
258 // ************************************************************************* //