janafThermo.C
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 #include "janafThermo.H"
00028 #include "IOstreams.H"
00029
00030
00031
00032 template<class equationOfState>
00033 Foam::janafThermo<equationOfState>::janafThermo(Istream& is)
00034 :
00035 equationOfState(is),
00036 Tlow_(readScalar(is)),
00037 Thigh_(readScalar(is)),
00038 Tcommon_(readScalar(is))
00039 {
00040 if (Tlow_ >= Thigh_)
00041 {
00042 FatalIOErrorIn
00043 (
00044 "janafThermo<equationOfState>::janafThermo(Istream& is)",
00045 is
00046 ) << "Tlow(" << Tlow_ << ") >= Thigh(" << Thigh_ << ')'
00047 << exit(FatalIOError);
00048 }
00049
00050 if (Tcommon_ <= Tlow_)
00051 {
00052 FatalIOErrorIn
00053 (
00054 "janafThermo<equationOfState>::janafThermo(Istream& is)",
00055 is
00056 ) << "Tcommon(" << Tcommon_ << ") <= Tlow(" << Tlow_ << ')'
00057 << exit(FatalIOError);
00058 }
00059
00060 if (Tcommon_ > Thigh_)
00061 {
00062 FatalIOErrorIn
00063 (
00064 "janafThermo<equationOfState>::janafThermo(Istream& is)",
00065 is
00066 ) << "Tcommon(" << Tcommon_ << ") > Thigh(" << Thigh_ << ')'
00067 << exit(FatalIOError);
00068 }
00069
00070 for
00071 (
00072 register label coefLabel=0;
00073 coefLabel<janafThermo<equationOfState>::nCoeffs_;
00074 coefLabel++
00075 )
00076 {
00077 is >> highCpCoeffs_[coefLabel];
00078 }
00079
00080 for
00081 (
00082 register label coefLabel=0;
00083 coefLabel<janafThermo<equationOfState>::nCoeffs_;
00084 coefLabel++
00085 )
00086 {
00087 is >> lowCpCoeffs_[coefLabel];
00088 }
00089
00090
00091 is.check("janafThermo::janafThermo(Istream& is)");
00092 }
00093
00094
00095
00096
00097 template<class equationOfState>
00098 Foam::Ostream& Foam::operator<<
00099 (
00100 Ostream& os,
00101 const janafThermo<equationOfState>& jt
00102 )
00103 {
00104 os << static_cast<const equationOfState&>(jt) << nl
00105 << " " << jt.Tlow_
00106 << tab << jt.Thigh_
00107 << tab << jt.Tcommon_;
00108
00109 os << nl << " ";
00110
00111 for
00112 (
00113 register label coefLabel=0;
00114 coefLabel<janafThermo<equationOfState>::nCoeffs_;
00115 coefLabel++
00116 )
00117 {
00118 os << jt.highCpCoeffs_[coefLabel] << ' ';
00119 }
00120
00121 os << nl << " ";
00122
00123 for
00124 (
00125 register label coefLabel=0;
00126 coefLabel<janafThermo<equationOfState>::nCoeffs_;
00127 coefLabel++
00128 )
00129 {
00130 os << jt.lowCpCoeffs_[coefLabel] << ' ';
00131 }
00132
00133 os << endl;
00134
00135 os.check
00136 (
00137 "operator<<(Ostream& os, const janafThermo<equationOfState>& jt)"
00138 );
00139
00140 return os;
00141 }
00142
00143
00144
Copyright © 2000-2009 OpenCFD Ltd