25 #ifndef GRINS_THERMOCHEM_TEST_COMMON_H
26 #define GRINS_THERMOCHEM_TEST_COMMON_H
28 #include "grins_config.h"
30 #ifdef GRINS_HAVE_CPPUNIT
32 #include <cppunit/extensions/HelperMacros.h>
36 #include "libmesh/libmesh_common.h"
45 const std::vector<libMesh::Real>& mass_fracs )
47 CPPUNIT_ASSERT_EQUAL( properties.size(), mass_fracs.size() );
49 unsigned int size = properties.size();
51 libMesh::Real mixed_value = 0.0;
52 for(
unsigned int s = 0; s < size; s++ )
53 mixed_value += mass_fracs[s]*properties[s];
65 return A*std::pow(T,b)*std::exp(-Ea/RT);
69 const std::vector<libMesh::Real>& three_body_efficiencies )
71 CPPUNIT_ASSERT_EQUAL( molar_densities.size(), three_body_efficiencies.size() );
73 libMesh::Real M = 0.0;
75 for(
unsigned int s = 0; s < molar_densities.size(); s++ )
76 M += molar_densities[s]*three_body_efficiencies[s];
82 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2,
83 libMesh::Real a3, libMesh::Real a4 )
85 return a0 + a1*T + a2*T*T + a3*T*T*T + a4*(T*T*T*T);
89 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2,
90 libMesh::Real a3, libMesh::Real a4, libMesh::Real a5 )
92 return a0 + a1/2.0*T + a2/3.0*T*T + a3/4.0*T*T*T + a4/5.0*(T*T*T*T) + a5/T;
96 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2,
97 libMesh::Real a3, libMesh::Real a4, libMesh::Real a6 )
99 return a0*std::log(T) + a1*T + a2/2.0*T*T + a3/3.0*T*T*T + a4/4.0*(T*T*T*T) + a6;
103 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2,
104 libMesh::Real a3, libMesh::Real a4, libMesh::Real a5, libMesh::Real a6 )
106 return a0/(T*T) + a1/T + a2 + a3*T + a4*(T*T) + a5*(T*T*T) + a6*(T*T*T*T);
110 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3,
111 libMesh::Real a4, libMesh::Real a5, libMesh::Real a6, libMesh::Real a7 )
113 return -a0/(T*T) + a1*std::log(T)/T + a2 + a3*T/2.0 + a4*(T*T)/3.0
114 + a5*(T*T*T)/4.0 + a6*(T*T*T*T)/5.0 + a7/T;
118 libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3,
119 libMesh::Real a4, libMesh::Real a5, libMesh::Real a6, libMesh::Real a8 )
121 return -a0/(2.*T*T) - a1/T + a2*std::log(T) + a3*T + a4*(T*T)/2.0
122 + a5*(T*T*T)/3.0 + a6*(T*T*T*T)/4.0 + a8;
129 #endif // GRINS_HAVE_CPPUNIT
131 #endif // GRINS_THERMOCHEM_TEST_COMMON_H
static libMesh::Real nasa7_cp_R_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4)
const libMesh::Real R_universal
Universal Gas Constant, R, [J/(kmol-K)].
static libMesh::Real nasa9_s_R_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4, libMesh::Real a5, libMesh::Real a6, libMesh::Real a8)
static libMesh::Real compute_third_body_molar_density(const std::vector< libMesh::Real > &molar_densities, const std::vector< libMesh::Real > &three_body_efficiencies)
static libMesh::Real arrhenius_rate(libMesh::Real A, libMesh::Real b, libMesh::Real Ea, libMesh::Real T)
static libMesh::Real nasa9_cp_R_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4, libMesh::Real a5, libMesh::Real a6)
static libMesh::Real nasa7_s_R_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4, libMesh::Real a6)
static libMesh::Real nasa7_h_RT_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4, libMesh::Real a5)
static libMesh::Real compute_mass_frac_mixture_prop(const std::vector< libMesh::Real > &properties, const std::vector< libMesh::Real > &mass_fracs)
static libMesh::Real nasa9_h_RT_exact(libMesh::Real T, libMesh::Real a0, libMesh::Real a1, libMesh::Real a2, libMesh::Real a3, libMesh::Real a4, libMesh::Real a5, libMesh::Real a6, libMesh::Real a7)