steamproperty.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#ifndef STEAMPROPERTY_H
00023
#define STEAMPROPERTY_H
00024
00025
#include "steamcalculator.h"
00026
00027
#ifndef NDEBUG
00028
#include <sstream>
00029
#include "exception.h"
00030
#endif
00031
00033
00038
template<
class Property,
int PropertyAlternative=0>
00039 class SteamProperty{
00040
public:
00041
static inline Property get(
const SteamCalculator &S);
00042
static const char *name();
00043
00044
static inline const bool plotOnLogAxis(){
00045
return false;
00046 }
00047 };
00048
00049
00050
00051
inline SpecificEnergy
00052
SteamProperty<SpecificEnergy,SOLVE_IENERGY>::get(
const SteamCalculator &S){
00053
return S.
specienergy();
00054 }
00055
00056
inline SpecificEnergy
00057
SteamProperty<SpecificEnergy,SOLVE_ENTHALPY>::get(
const SteamCalculator &S){
00058
return S.
specenthalpy();
00059 }
00060
00061
inline Density
00062
SteamProperty<Density,0>::get(
const SteamCalculator &S){
00063
return S.
dens();
00064 }
00065
00066
inline SpecificVolume
00067
SteamProperty<SpecificVolume,0>::get(
const SteamCalculator &S){
00068
return S.
specvol();
00069 }
00070
00071
inline Temperature
00072
SteamProperty<Temperature,0>::get(
const SteamCalculator &S){
00073
return S.
temp();
00074 }
00075
00076
inline Pressure
00077
SteamProperty<Pressure,0>::get(
const SteamCalculator &S){
00078
return S.
pres();
00079 }
00080
00081
inline SpecificEntropy
00082
SteamProperty<SpecificEntropy,SOLVE_ENTROPY>::get(
const SteamCalculator &S){
00083
#ifndef NDEBUG
00084
try{
00085
#endif
00086
00087
return S.
specentropy();
00088
00089
#ifndef NDEBUG
00090
}
catch(Exception *E){
00091 std::stringstream s;
00092 s <<
"SteamProperty<s>::get: " << E->what();
00093
delete E;
00094
throw new Exception(s.str());
00095 }
00096
#endif
00097
}
00098
00099
inline SpecHeatCap
00100
SteamProperty<SpecHeatCap,SOLVE_CP>::get(
const SteamCalculator &S){
00101
return S.
speccp();
00102 }
00103
00104
inline SpecHeatCap
00105
SteamProperty<SpecHeatCap,SOLVE_CV>::get(
const SteamCalculator &S){
00106
return S.
speccv();
00107 }
00108
00109
inline Num
00110
SteamProperty<Num,0>::get(
const SteamCalculator &S){
00111
return S.
quality();
00112 }
00113
00114
inline
00115
const bool
00116
SteamProperty<SpecificVolume,0>::plotOnLogAxis(){
00117
return true;
00118 }
00119
00120
inline
00121
const bool
00122
SteamProperty<Pressure,0>::plotOnLogAxis(){
00123
return true;
00124 }
00125
00126
#endif
Generated on Tue Mar 22 19:07:05 2005 for freesteam by
1.3.8