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 inline eConstThermo::eConstThermo
00040 (
00041 const specieThermo& st,
00042 const scalar cv,
00043 const scalar hf
00044 )
00045 :
00046 specieThermo(st),
00047 CV(cv),
00048 Hf(hf)
00049 {}
00050
00051
00052
00053
00054
00055 inline eConstThermo::eConstThermo(const word& name, const eConstThermo& ct)
00056 :
00057 specieThermo(name, ct),
00058 CV(ct.CV),
00059 Hf(ct.Hf)
00060 {}
00061
00062
00063
00064 template<class equationOfState>
00065 inline autoPtr<eConstThermo<equationOfState> > eConstThermo<equationOfState>::
00066 clone() const
00067 {
00068 return autoPtr<eConstThermo<equationOfState> >
00069 (
00070 new eConstThermo<equationOfState>(*this)
00071 );
00072 }
00073
00074
00075
00076 template<class equationOfState>
00077 inline autoPtr<eConstThermo<equationOfState> > eConstThermo<equationOfState>::
00078 New(Istream& is)
00079 {
00080 return autoPtr<eConstThermo<equationOfState> >
00081 (
00082 new eConstThermo<equationOfState>(is)
00083 );
00084 }
00085
00086
00087
00088
00089
00090 inline scalar eConstThermo::cp(const scalar) const
00091 {
00092 return CV*W() + RR;
00093 }
00094
00095
00096
00097 inline scalar eConstThermo::h(const scalar T) const
00098 {
00099 return cp(T)*T + Hf*W();
00100 }
00101
00102
00103
00104 inline scalar eConstThermo::s(const scalar T) const
00105 {
00106 notImplemented("scalar eConstThermo::s(const scalar T) const");
00107 return T;
00108 }
00109
00110
00111
00112 inline scalar eConstThermo::TH(const scalar h, const scalar T0) const
00113 {
00114 return (h - Hf)/Cp(T0);
00115 }
00116
00117
00118
00119 inline scalar eConstThermo::TE(const scalar e, const scalar) const
00120 {
00121 return (e - Hf)/CV;
00122 }
00123
00124
00125
00126
00127 inline eConstThermo& eConstThermo::operator=
00128 (
00129 const eConstThermo& ct
00130 )
00131 {
00132 specieThermo::operator=(ct);
00133
00134 CV = ct.CV;
00135 Hf = ct.Hf;
00136
00137 return *this;
00138 }
00139
00140
00141
00142
00143 inline eConstThermo operator+
00144 (
00145 const eConstThermo& ct1,
00146 const eConstThermo& ct2
00147 )
00148 {
00149 specieThermo st(((const specieThermo&)ct1) + ((const specieThermo&)ct2));
00150
00151 return eConstThermo
00152 (
00153 st,
00154 ct1.nMoles()/st.nMoles()*ct1.CV + ct2.nMoles()/st.nMoles()*ct2.CV,
00155 ct1.nMoles()/st.nMoles()*ct1.Hf + ct2.nMoles()/st.nMoles()*ct2.Hf
00156 );
00157 }
00158
00159
00160 inline eConstThermo operator-
00161 (
00162 const eConstThermo& ct1,
00163 const eConstThermo& ct2
00164 )
00165 {
00166 specieThermo st(((const specieThermo&)ct1) - ((const specieThermo&)ct2));
00167
00168 return eConstThermo
00169 (
00170 st,
00171 ct1.nMoles()/st.nMoles()*ct1.CV - ct2.nMoles()/st.nMoles()*ct2.CV,
00172 ct1.nMoles()/st.nMoles()*ct1.Hf - ct2.nMoles()/st.nMoles()*ct2.Hf
00173 );
00174 }
00175
00176
00177 inline eConstThermo operator*
00178 (
00179 const scalar s,
00180 const eConstThermo& ct
00181 )
00182 {
00183 return eConstThermo
00184 (
00185 s*((const specieThermo&)ct),
00186 ct.CV,
00187 ct.Hf
00188 );
00189 }
00190
00191
00192 inline eConstThermo operator==
00193 (
00194 const eConstThermo& ct1,
00195 const eConstThermo& ct2
00196 )
00197 {
00198 return ct2 - ct1;
00199 }
00200
00201
00202
00203
00204 }
00205
00206