initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / specie / transport / sutherland / sutherlandTransportI.H
blob6e8539101e6ce8e3d0ed949fd508a6942778061e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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 \*---------------------------------------------------------------------------*/
27 #include "specie.H"
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 namespace Foam
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
59     const thermo& t,
60     const scalar as,
61     const scalar ts
64     thermo(t),
65     As(as),
66     Ts(ts)
70 // Construct from components
71 template<class thermo>
72 inline sutherlandTransport<thermo>::sutherlandTransport
74     const thermo& t,
75     const scalar mu1, const scalar T1,
76     const scalar mu2, const scalar T2
79     thermo(t)
81     calcCoeffs(mu1, T1, mu2, T2);
85 //- Construct as named copy
86 template<class thermo>
87 inline sutherlandTransport<thermo>::sutherlandTransport
89     const word& name,
90     const sutherlandTransport& st
93     thermo(name, st),
94     As(st.As),
95     Ts(st.Ts)
99 // Construct and return a clone
100 template<class thermo>
101 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::clone
102 () const
104     return autoPtr<sutherlandTransport<thermo> >
105     (
106         new sutherlandTransport<thermo>(*this)
107     );
111 // Selector from Istream
112 template<class thermo>
113 inline autoPtr<sutherlandTransport<thermo> > sutherlandTransport<thermo>::New
115     Istream& is
118     return autoPtr<sutherlandTransport<thermo> >
119     (
120         new sutherlandTransport<thermo>(is)
121     );
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;
153     scalar CpBar =
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);
170     As = st.As;
171     Ts = st.Ts;
173     return *this;
177 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
179 template<class thermo>
180 inline sutherlandTransport<thermo> operator+
182     const sutherlandTransport<thermo>& st1,
183     const sutherlandTransport<thermo>& st2
186     thermo t
187     (
188         static_cast<const thermo&>(st1) + static_cast<const thermo&>(st2)
189     );
191     scalar molr1 = st1.nMoles()/t.nMoles();
192     scalar molr2 = st2.nMoles()/t.nMoles();
194     return sutherlandTransport<thermo>
195     (
196         t,
197         molr1*st1.As + molr2*st2.As,
198         molr1*st1.Ts + molr2*st2.Ts
199     );
203 template<class thermo>
204 inline sutherlandTransport<thermo> operator-
206     const sutherlandTransport<thermo>& st1,
207     const sutherlandTransport<thermo>& st2
210     thermo t
211     (
212         static_cast<const thermo&>(st1) - static_cast<const thermo&>(st2)
213     );
215     scalar molr1 = st1.nMoles()/t.nMoles();
216     scalar molr2 = st2.nMoles()/t.nMoles();
218     return sutherlandTransport<thermo>
219     (
220         t,
221         molr1*st1.As - molr2*st2.As,
222         molr1*st1.Ts - molr2*st2.Ts
223     );
227 template<class thermo>
228 inline sutherlandTransport<thermo> operator*
230     const scalar s,
231     const sutherlandTransport<thermo>& st
234     return sutherlandTransport<thermo>
235     (
236         s*static_cast<const thermo&>(st),
237         st.As,
238         st.Ts
239     );
243 template<class thermo>
244 inline sutherlandTransport<thermo> operator==
246     const sutherlandTransport<thermo>& st1,
247     const sutherlandTransport<thermo>& st2
250     return st2 - st1;
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 } // End namespace Foam
258 // ************************************************************************* //