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