00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 namespace Foam
00034 {
00035
00036
00037
00038
00039 template<class thermo>
00040 inline constTransport<thermo>::constTransport
00041 (
00042 const thermo& t,
00043 const scalar mu,
00044 const scalar Pr
00045 )
00046 :
00047 thermo(t),
00048 Mu(mu),
00049 rPr(1.0/Pr)
00050 {}
00051
00052
00053
00054 template<class thermo>
00055 inline constTransport<thermo>::constTransport
00056 (
00057 const word& name,
00058 const constTransport& ct
00059 )
00060 :
00061 thermo(name, ct),
00062 Mu(ct.Mu),
00063 rPr(ct.rPr)
00064 {}
00065
00066
00067
00068
00069
00070 template<class thermo>
00071 inline scalar constTransport<thermo>::mu(const scalar) const
00072 {
00073 return Mu;
00074 }
00075
00076
00077
00078 template<class thermo>
00079 inline scalar constTransport<thermo>::kappa(const scalar T) const
00080 {
00081 return this->Cp(T)*mu(T)*rPr;
00082 }
00083
00084
00085
00086 template<class thermo>
00087 inline scalar constTransport<thermo>::alpha(const scalar T) const
00088 {
00089 scalar Cp_ = this->Cp(T);
00090
00091 scalar deltaT = T - specie::Tstd;
00092 scalar CpBar =
00093 (deltaT*(this->H(T) - this->H(specie::Tstd)) + Cp_)/(sqr(deltaT) + 1);
00094
00095 return Cp_*mu(T)*rPr/CpBar;
00096 }
00097
00098
00099
00100
00101 template<class thermo>
00102 inline constTransport<thermo>& constTransport<thermo>::operator=
00103 (
00104 const constTransport<thermo>& ct
00105 )
00106 {
00107 thermo::operator=(ct);
00108
00109 Mu = ct.Mu;
00110 rPr = ct.rPr;
00111
00112 return *this;
00113 }
00114
00115
00116
00117
00118 template<class thermo>
00119 inline constTransport<thermo> operator+
00120 (
00121 const constTransport<thermo>& ct1,
00122 const constTransport<thermo>& ct2
00123 )
00124 {
00125 thermo t
00126 (
00127 static_cast<const thermo&>(ct1) + static_cast<const thermo&>(ct2)
00128 );
00129
00130 scalar molr1 = ct1.nMoles()/t.nMoles();
00131 scalar molr2 = ct2.nMoles()/t.nMoles();
00132
00133 return constTransport<thermo>
00134 (
00135 t,
00136 molr1*ct1.Mu + molr2*ct2.Mu,
00137 molr1*ct1.rPr + molr2*ct2.rPr
00138 );
00139 }
00140
00141
00142 template<class thermo>
00143 inline constTransport<thermo> operator-
00144 (
00145 const constTransport<thermo>& ct1,
00146 const constTransport<thermo>& ct2
00147 )
00148 {
00149 thermo t
00150 (
00151 static_cast<const thermo&>(ct1) - static_cast<const thermo&>(ct2)
00152 );
00153
00154 scalar molr1 = ct1.nMoles()/t.nMoles();
00155 scalar molr2 = ct2.nMoles()/t.nMoles();
00156
00157 return constTransport<thermo>
00158 (
00159 t,
00160 molr1*ct1.Mu - molr2*ct2.Mu,
00161 molr1*ct1.rPr - molr2*ct2.rPr
00162 );
00163 }
00164
00165
00166 template<class thermo>
00167 inline constTransport<thermo> operator*
00168 (
00169 const scalar s,
00170 const constTransport<thermo>& ct
00171 )
00172 {
00173 return constTransport<thermo>
00174 (
00175 s*static_cast<const thermo&>(ct),
00176 ct.Mu,
00177 ct.rPr
00178 );
00179 }
00180
00181
00182 template<class thermo>
00183 inline constTransport<thermo> operator==
00184 (
00185 const constTransport<thermo>& ct1,
00186 const constTransport<thermo>& ct2
00187 )
00188 {
00189 return ct2 - ct1;
00190 }
00191
00192
00193
00194
00195 }
00196
00197