1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 template<class thermo>
36 inline void sutherlandTransport<thermo>::calcCoeffs
38 const scalar mu1, const scalar T1,
39 const scalar mu2, const scalar T2
42 scalar rootT1 = sqrt(T1);
43 scalar mu1rootT2 = mu1*sqrt(T2);
44 scalar mu2rootT1 = mu2*rootT1;
46 Ts = (mu2rootT1 - mu1rootT2)/(mu1rootT2/T1 - mu2rootT1/T2);
48 As = mu1*(1.0 + Ts/T1)/rootT1;
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54 // Construct from components
55 template<class thermo>
56 inline sutherlandTransport<thermo>::sutherlandTransport
69 // Construct from components
70 template<class thermo>
71 inline sutherlandTransport<thermo>::sutherlandTransport
74 const scalar mu1, const scalar T1,
75 const scalar mu2, const scalar T2
80 calcCoeffs(mu1, T1, mu2, T2);
84 //- Construct as named copy
85 template<class thermo>
86 inline sutherlandTransport<thermo>::sutherlandTransport
89 const sutherlandTransport& st
98 // Construct and return a clone
99 template<class thermo>
100 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
103 return autoPtr<sutherlandTransport<thermo> >
105 new sutherlandTransport<thermo>(*this)
110 // Selector from Istream
111 template<class thermo>
112 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
117 return autoPtr<sutherlandTransport<thermo> >
119 new sutherlandTransport<thermo>(is)
124 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
126 // Dynamic viscosity [kg/ms]
127 template<class thermo>
128 inline scalar sutherlandTransport<thermo>::mu(const scalar T) const
130 return As*::sqrt(T)/(1.0 + Ts/T);
134 // Thermal conductivity [W/mK]
135 template<class thermo>
136 inline scalar sutherlandTransport<thermo>::kappa(const scalar T) const
138 scalar Cv_ = this->Cv(T);
139 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
143 // Thermal diffusivity for enthalpy [kg/ms]
144 template<class thermo>
145 inline scalar sutherlandTransport<thermo>::alpha(const scalar T) const
147 scalar Cv_ = this->Cv(T);
148 scalar R_ = this->R();
149 scalar Cp_ = Cv_ + R_;
151 scalar deltaT = T - specie::Tstd();
153 (deltaT*(this->H(T) - this->H(specie::Tstd())) + Cp_)/(sqr(deltaT) + 1);
155 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_)/CpBar;
159 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
161 template<class thermo>
162 inline sutherlandTransport<thermo>& sutherlandTransport<thermo>::operator=
164 const sutherlandTransport<thermo>& st
167 thermo::operator=(st);
176 template<class thermo>
177 inline void Foam::sutherlandTransport<thermo>::operator+=
179 const sutherlandTransport<thermo>& st
182 scalar molr1 = this->nMoles();
184 thermo::operator+=(st);
186 molr1 /= this->nMoles();
187 scalar molr2 = st.nMoles()/this->nMoles();
189 As = molr1*As + molr2*st.As;
190 Ts = molr1*Ts + molr2*st.Ts;
194 template<class thermo>
195 inline void Foam::sutherlandTransport<thermo>::operator-=
197 const sutherlandTransport<thermo>& st
200 scalar molr1 = this->nMoles();
202 thermo::operator-=(st);
204 molr1 /= this->nMoles();
205 scalar molr2 = st.nMoles()/this->nMoles();
207 As = molr1*As - molr2*st.As;
208 Ts = molr1*Ts - molr2*st.Ts;
212 template<class thermo>
213 inline void Foam::sutherlandTransport<thermo>::operator*=
218 thermo::operator*=(s);
222 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
224 template<class thermo>
225 inline sutherlandTransport<thermo> operator+
227 const sutherlandTransport<thermo>& st1,
228 const sutherlandTransport<thermo>& st2
233 static_cast<const thermo&>(st1) + static_cast<const thermo&>(st2)
236 scalar molr1 = st1.nMoles()/t.nMoles();
237 scalar molr2 = st2.nMoles()/t.nMoles();
239 return sutherlandTransport<thermo>
242 molr1*st1.As + molr2*st2.As,
243 molr1*st1.Ts + molr2*st2.Ts
248 template<class thermo>
249 inline sutherlandTransport<thermo> operator-
251 const sutherlandTransport<thermo>& st1,
252 const sutherlandTransport<thermo>& st2
257 static_cast<const thermo&>(st1) - static_cast<const thermo&>(st2)
260 scalar molr1 = st1.nMoles()/t.nMoles();
261 scalar molr2 = st2.nMoles()/t.nMoles();
263 return sutherlandTransport<thermo>
266 molr1*st1.As - molr2*st2.As,
267 molr1*st1.Ts - molr2*st2.Ts
272 template<class thermo>
273 inline sutherlandTransport<thermo> operator*
276 const sutherlandTransport<thermo>& st
279 return sutherlandTransport<thermo>
281 s*static_cast<const thermo&>(st),
288 template<class thermo>
289 inline sutherlandTransport<thermo> operator==
291 const sutherlandTransport<thermo>& st1,
292 const sutherlandTransport<thermo>& st2
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
301 } // End namespace Foam
303 // ************************************************************************* //