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