6 #include <application/application.hpp>
7 #include <application/exceptions.hpp>
20 #define PRECISION 1.E-8
23 os <<
"name: " << mol.
m_name << std::endl
24 <<
"molecular weight: " << mol.
m_mu <<
" kg/mol" << std::endl
25 <<
"heat capacity (cp): " << mol.
m_cp <<
" J/(mol K)" << std::endl
26 <<
"vaporization heat at triple point: " << mol.
m_latent <<
" kJ/mol"
28 <<
"vapor pressure coefficients: " << mol.
m_beta <<
" " << mol.
m_gamma
30 <<
"standard entropy: " << mol.
m_entropy <<
" J/(mol K)" << std::endl
31 <<
"standard enthalpy: " << mol.
m_enthalpy <<
" kJ/mol" << std::endl;
37 auto app = Application::GetInstance();
38 auto full_path = app->FindInputFile(chemfile);
112 double Tsat, Tmin, Tmax;
116 [
this, P](
double T) {
return this->
sat_vapor_p(T) - P; });
118 std::stringstream msg;
119 msg <<
"Inverting saturation vapor pressure is not sucessfull" << std::endl;
120 msg <<
"Pressure = " << P <<
" Pa" << std::endl;
121 msg <<
"Tmin = " << Tmin << std::endl;
122 msg <<
"Tmax = " << Tmax << std::endl;
123 msg <<
"Saturation vapor pressure at Tmin = " <<
sat_vapor_p(Tmin)
125 msg <<
"Saturation vapor pressure at Tmax = " <<
sat_vapor_p(Tmax)
127 msg << *
this << std::endl;
128 throw RuntimeError(
"Molecule", msg.str());
double isat_vapor_p(double P) const
std::array< double, MAXSHOMATE+1 > m_shomate_sp
virtual double entropy(double T) const
virtual double enthalpy(double T) const
void LoadThermodynamicFile(std::string chemfile)
std::array< double, MAXSHOMATE *NSHOMATE > m_shomate
double sat_vapor_p(double T) const
std::string DecommentFile(std::string fname)
decomment a file
int locate(double const *xx, double x, int n)
std::ostream & operator<<(std::ostream &os, Molecule const &mol)
#define NSHOMATE
Molecule stored the necessary information for calculating the thermodynamic properties of an air parc...
int root(double x1, double x2, double xacc, double *x_root, RootFunction_t func, void *aux)