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 \*---------------------------------------------------------------------------*/
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 template<class Thermo>
31 inline void Foam::sutherlandTransport<Thermo>::calcCoeffs
33 const scalar mu1, const scalar T1,
34 const scalar mu2, const scalar T2
37 scalar rootT1 = sqrt(T1);
38 scalar mu1rootT2 = mu1*sqrt(T2);
39 scalar mu2rootT1 = mu2*rootT1;
41 Ts_ = (mu2rootT1 - mu1rootT2)/(mu1rootT2/T1 - mu2rootT1/T2);
43 As_ = mu1*(1.0 + Ts_/T1)/rootT1;
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 template<class Thermo>
50 inline Foam::sutherlandTransport<Thermo>::sutherlandTransport
63 template<class Thermo>
64 inline Foam::sutherlandTransport<Thermo>::sutherlandTransport
67 const scalar mu1, const scalar T1,
68 const scalar mu2, const scalar T2
73 calcCoeffs(mu1, T1, mu2, T2);
77 template<class Thermo>
78 inline Foam::sutherlandTransport<Thermo>::sutherlandTransport
81 const sutherlandTransport& st
90 template<class Thermo>
91 inline Foam::autoPtr<Foam::sutherlandTransport<Thermo> >
92 Foam::sutherlandTransport<Thermo>::clone() const
94 return autoPtr<sutherlandTransport<Thermo> >
96 new sutherlandTransport<Thermo>(*this)
101 template<class Thermo>
102 inline Foam::autoPtr<Foam::sutherlandTransport<Thermo> >
103 Foam::sutherlandTransport<Thermo>::New
108 return autoPtr<sutherlandTransport<Thermo> >
110 new sutherlandTransport<Thermo>(is)
115 template<class Thermo>
116 inline Foam::autoPtr<Foam::sutherlandTransport<Thermo> >
117 Foam::sutherlandTransport<Thermo>::New
119 const dictionary& dict
122 return autoPtr<sutherlandTransport<Thermo> >
124 new sutherlandTransport<Thermo>(dict)
129 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
131 template<class Thermo>
132 inline Foam::scalar Foam::sutherlandTransport<Thermo>::mu(const scalar T) const
134 return As_*::sqrt(T)/(1.0 + Ts_/T);
138 template<class Thermo>
139 inline Foam::scalar Foam::sutherlandTransport<Thermo>::kappa
144 scalar Cv_ = this->Cv(T);
145 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_);
149 template<class Thermo>
150 inline Foam::scalar Foam::sutherlandTransport<Thermo>::alpha
155 scalar Cv_ = this->Cv(T);
156 scalar R_ = this->R();
157 scalar Cp_ = Cv_ + R_;
159 scalar deltaT = T - specie::Tstd;
161 (deltaT*(this->H(T) - this->H(specie::Tstd)) + Cp_)/(sqr(deltaT) + 1);
163 return mu(T)*Cv_*(1.32 + 1.77*this->R()/Cv_)/CpBar;
167 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
169 template<class Thermo>
170 inline Foam::sutherlandTransport<Thermo>&
171 Foam::sutherlandTransport<Thermo>::operator=
173 const sutherlandTransport<Thermo>& st
176 Thermo::operator=(st);
185 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
187 template<class Thermo>
188 inline Foam::sutherlandTransport<Thermo> Foam::operator+
190 const sutherlandTransport<Thermo>& st1,
191 const sutherlandTransport<Thermo>& st2
196 static_cast<const Thermo&>(st1) + static_cast<const Thermo&>(st2)
199 scalar molr1 = st1.nMoles()/t.nMoles();
200 scalar molr2 = st2.nMoles()/t.nMoles();
202 return sutherlandTransport<Thermo>
205 molr1*st1.As_ + molr2*st2.As_,
206 molr1*st1.Ts_ + molr2*st2.Ts_
211 template<class Thermo>
212 inline Foam::sutherlandTransport<Thermo> Foam::operator-
214 const sutherlandTransport<Thermo>& st1,
215 const sutherlandTransport<Thermo>& st2
220 static_cast<const Thermo&>(st1) - static_cast<const Thermo&>(st2)
223 scalar molr1 = st1.nMoles()/t.nMoles();
224 scalar molr2 = st2.nMoles()/t.nMoles();
226 return sutherlandTransport<Thermo>
229 molr1*st1.As_ - molr2*st2.As_,
230 molr1*st1.Ts_ - molr2*st2.Ts_
235 template<class Thermo>
236 inline Foam::sutherlandTransport<Thermo> Foam::operator*
239 const sutherlandTransport<Thermo>& st
242 return sutherlandTransport<Thermo>
244 s*static_cast<const Thermo&>(st),
251 template<class Thermo>
252 inline Foam::sutherlandTransport<Thermo> Foam::operator==
254 const sutherlandTransport<Thermo>& st1,
255 const sutherlandTransport<Thermo>& st2
262 // ************************************************************************* //