antioch-0.4.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
Antioch::NASAEvaluator< CoeffType, NASAFit > Singleton Reference

#include <ascii_parser.h>

Public Member Functions

 NASAEvaluator (const NASAThermoMixture< CoeffType, NASAFit > &cea_mixture)
 
 ~NASAEvaluator ()
 
const NASAThermoMixture
< CoeffType, NASAFit > & 
cea_mixture () const
 
template<typename StateType >
StateType cp (const TempCache< StateType > &cache, unsigned int species) const
 We currently need different specializations for scalar vs vector inputs here. More...
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
StateType >::type 
cp (const TempCache< StateType > &cache, const VectorStateType &mass_fractions) const
 
template<typename StateType >
 cv (const TempCache< StateType > &cache, unsigned int species) const ANTIOCH_AUTOFUNC(StateType
 
this cp (cache, species)-this-> chem_mixture().R(species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, StateType >::typecv(const TempCache< StateType > &cache, const VectorStateType &mass_fractions) const
 
template<typename StateType >
 h (const TempCache< StateType > &cache, unsigned int species) const ANTIOCH_AUTOFUNC(StateType
 
this chem_mixture ().R(species)*cache.T *this-> h_over_RT(cache, species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, void >::typeh(const TempCache< StateType > &cache, VectorStateType &h) const
 
template<typename StateType >
StateType h_RT_minus_s_R (const TempCache< StateType > &cache, unsigned int species) const
 We currently need different specializations for scalar vs vector inputs here. More...
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
void >::type 
h_RT_minus_s_R (const TempCache< StateType > &cache, VectorStateType &h_RT_minus_s_R) const
 
template<typename StateType >
StateType dh_RT_minus_s_R_dT (const TempCache< StateType > &cache, unsigned int species) const
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
void >::type 
dh_RT_minus_s_R_dT (const TempCache< StateType > &cache, VectorStateType &h_RT_minus_s_R) const
 
template<typename StateType >
StateType cp_over_R (const TempCache< StateType > &cache, unsigned int species) const
 Cp over R, directly from the curve fit. More...
 
template<typename StateType >
StateType cv_over_R (const TempCache< StateType > &cache, unsigned int species) const
 Cv over R, from ideal gas,. More...
 
template<typename StateType >
StateType h_over_RT (const TempCache< StateType > &cache, unsigned int species) const
 h over RT, directly from the curve fit More...
 
template<typename StateType >
StateType s_over_R (const TempCache< StateType > &cache, unsigned int species) const
 s over R, directly from the curve fit More...
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
StateType >::type 
cp (const TempCache< StateType > &cache, const VectorStateType &mass_fractions) const
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
void >::type 
h_RT_minus_s_R (const TempCache< StateType > &cache, VectorStateType &h_RT_minus_s_R) const
 
template<typename StateType , typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
void >::type 
dh_RT_minus_s_R_dT (const TempCache< StateType > &cache, VectorStateType &dh_RT_minus_s_R_dT) const
 

Protected Member Functions

unsigned int n_species () const
 Convenience function. More...
 
const ChemicalMixture
< CoeffType > & 
chem_mixture () const
 Convenience function. More...
 

Protected Attributes

const NASAThermoMixture
< CoeffType, NASAFit > & 
_nasa_mixture
 

Private Member Functions

 NASAEvaluator ()
 Default constructor. More...
 

Detailed Description

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
singleton Antioch::NASAEvaluator< CoeffType, NASAFit >

Definition at line 62 of file ascii_parser.h.

Constructor & Destructor Documentation

template<typename CoeffType, typename NASAFit>
Antioch::NASAEvaluator< CoeffType, NASAFit >::NASAEvaluator ( const NASAThermoMixture< CoeffType, NASAFit > &  cea_mixture)

Definition at line 151 of file nasa_evaluator.h.

153  {
154  return;
155  }
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
const NASAThermoMixture< CoeffType, NASAFit > & cea_mixture() const
template<typename CoeffType , typename NASAFit >
Antioch::NASAEvaluator< CoeffType, NASAFit >::~NASAEvaluator ( )

Definition at line 158 of file nasa_evaluator.h.

159  {
160  return;
161  }
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
Antioch::NASAEvaluator< CoeffType, NASAFit >::NASAEvaluator ( )
private

Default constructor.

Private to force to user to supply a NASAThermoMixture object.

Member Function Documentation

template<typename CoeffType , typename NASAFit >
const NASAThermoMixture< CoeffType, NASAFit > & Antioch::NASAEvaluator< CoeffType, NASAFit >::cea_mixture ( ) const
inline

Definition at line 166 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture.

167  {
168  return _nasa_mixture;
169  }
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
this Antioch::NASAEvaluator< CoeffType, NASAFit >::chem_mixture ( ) -> h_over_RT(cache, species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, void >::typeh(const TempCache< StateType > &cache, VectorStateType &h) const
template<typename CoeffType , typename NASAFit >
const ChemicalMixture< CoeffType > & Antioch::NASAEvaluator< CoeffType, NASAFit >::chem_mixture ( ) const
inlineprotected

Convenience function.

Definition at line 180 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture.

181  {
182  return _nasa_mixture.chemical_mixture();
183  }
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::cp ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

We currently need different specializations for scalar vs vector inputs here.

Definition at line 189 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, Antioch::NASAEvaluator< CoeffType, NASAFit >::chem_mixture(), Antioch::constant_clone(), Antioch::NASAEvaluator< CoeffType, NASAFit >::cp_over_R(), Antioch::if_else(), and Antioch::TempCache< StateType >::T.

Referenced by Antioch::NASAThermoMixture< CoeffType, NASAFit >::add_curve_fit(), Antioch::NASAEvaluator< CoeffType, NASAFit >::cp(), Antioch::NASAEvaluator< CoeffType, NASAFit >::cv(), test_cp(), and tester().

190  {
191  typedef typename Antioch::value_type<StateType>::type ScalarType;
192  // T < 200.1 ? cp_at_200p1 : R * cp_over_R
193 
194  return
196  (cache.T < ScalarType(200.1),
198  (cache.T,_nasa_mixture.cp_at_200p1(species)),
199  StateType
200  (this->chem_mixture().R(species) *
201  this->cp_over_R(cache, species)));
202  }
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > constant_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex, const Scalar &value)
Definition: eigen_utils.h:181
enable_if_c< is_eigen< T1 >::value &&is_eigen< T2 >::value, typename state_type< T1 >::type >::type if_else(const Condition &condition, const T1 &if_true, const T2 &if_false)
Definition: eigen_utils.h:250
this chem_mixture().R(species)*cache.T *this-> h_over_RT(cache, species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, void >::typeh(const TempCache< StateType > &cache, VectorStateType &h) const
StateType cp_over_R(const TempCache< StateType > &cache, unsigned int species) const
Cp over R, directly from the curve fit.
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, StateType >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::cp ( const TempCache< StateType > &  cache,
const VectorStateType &  mass_fractions 
) const
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
this Antioch::NASAEvaluator< CoeffType, NASAFit >::cp ( cache  ,
species   
) -> chem_mixture().R(species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, StateType >::typecv(const TempCache< StateType > &cache, const VectorStateType &mass_fractions) const
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, StateType >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::cp ( const TempCache< StateType > &  cache,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 210 of file nasa_evaluator.h.

References antioch_assert_equal_to, antioch_assert_greater, Antioch::NASAEvaluator< CoeffType, NASAFit >::cp(), and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

212  {
213  antioch_assert_equal_to( mass_fractions.size(), this->n_species() );
214  antioch_assert_greater( mass_fractions.size(), 0 );
215 
216  StateType cp = mass_fractions[0]*this->cp(cache,0);
217 
218  for( unsigned int s = 1; s < this->n_species(); s++ )
219  {
220  cp += mass_fractions[s]*this->cp(cache,s);
221  }
222 
223  return cp;
224  }
#define antioch_assert_equal_to(expr1, expr2)
#define antioch_assert_greater(expr1, expr2)
unsigned int n_species() const
Convenience function.
StateType cp(const TempCache< StateType > &cache, unsigned int species) const
We currently need different specializations for scalar vs vector inputs here.
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::cp_over_R ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

Cp over R, directly from the curve fit.

Definition at line 250 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

Referenced by Antioch::NASAEvaluator< CoeffType, NASAFit >::cp().

251  {
252  antioch_assert_less( species, this->n_species() );
253  // FIXME - we need assert_less to be vectorizable
254  // antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
255  // _nasa_mixture.curve_fit(species).n_intervals() );
256 
257  return this->_nasa_mixture.curve_fit(species).cp_over_R(cache);
258  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType >
enable_if_c< has_size< VectorStateType >::value, StateType >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::cv ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

Definition at line 376 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::chem_mixture(), and Antioch::NASAEvaluator< CoeffType, NASAFit >::cp().

378  {
379  return this->cp(cache,mass_fractions) - this->chem_mixture().R(mass_fractions);
380  }
this chem_mixture().R(species)*cache.T *this-> h_over_RT(cache, species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, void >::typeh(const TempCache< StateType > &cache, VectorStateType &h) const
StateType cp(const TempCache< StateType > &cache, unsigned int species) const
We currently need different specializations for scalar vs vector inputs here.
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::cv_over_R ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

Cv over R, from ideal gas,.

Definition at line 264 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

Referenced by tester().

265  {
266  antioch_assert_less( species, this->n_species() );
267  // FIXME - we need assert_less to be vectorizable
268  // antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
269  // _nasa_mixture.curve_fit(species).n_intervals() );
270  return this->_nasa_mixture.curve_fit(species).cp_over_R(cache) - StateType(1.L);
271  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::dh_RT_minus_s_R_dT ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

Definition at line 339 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

Referenced by Antioch::NASAEvaluator< CoeffType, NASAFit >::dh_RT_minus_s_R_dT().

340  {
341  antioch_assert_less( species, this->n_species() );
342  // FIXME - we need assert_less to be vectorizable
343  // antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
344  // _nasa_mixture.curve_fit(species).n_intervals() );
345 
346  return this->_nasa_mixture.curve_fit(species).dh_RT_minus_s_R_dT(cache);
347  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, void >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::dh_RT_minus_s_R_dT ( const TempCache< StateType > &  cache,
VectorStateType &  h_RT_minus_s_R 
) const
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, void >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::dh_RT_minus_s_R_dT ( const TempCache< StateType > &  cache,
VectorStateType &  dh_RT_minus_s_R_dT 
) const
inline

Definition at line 356 of file nasa_evaluator.h.

References antioch_assert_equal_to, Antioch::NASAEvaluator< CoeffType, NASAFit >::dh_RT_minus_s_R_dT(), and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

358  {
360 
361  for( unsigned int s = 0; s < this->n_species(); s++ )
362  {
363  dh_RT_minus_s_R_dT[s] = this->dh_RT_minus_s_R_dT(cache,s);
364  }
365 
366  return;
367  }
StateType dh_RT_minus_s_R_dT(const TempCache< StateType > &cache, unsigned int species) const
#define antioch_assert_equal_to(expr1, expr2)
unsigned int n_species() const
Convenience function.
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType >
enable_if_c< has_size< VectorStateType >::value, void >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::h ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

Definition at line 233 of file nasa_evaluator.h.

References antioch_assert_equal_to, Antioch::NASAEvaluator< CoeffType, NASAFit >::chem_mixture(), Antioch::NASAEvaluator< CoeffType, NASAFit >::h_over_RT(), Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species(), and Antioch::TempCache< StateType >::T.

Referenced by test_h().

234  {
235  antioch_assert_equal_to( h.size(), this->n_species() );
236 
237  for( unsigned int s = 0; s < this->n_species(); s++ )
238  {
239  h[s] = this->chem_mixture().R(s)*cache.T*this->h_over_RT(cache,s);
240  }
241 
242  return;
243  }
StateType h_over_RT(const TempCache< StateType > &cache, unsigned int species) const
h over RT, directly from the curve fit
#define antioch_assert_equal_to(expr1, expr2)
unsigned int n_species() const
Convenience function.
h(const TempCache< StateType > &cache, unsigned int species) const ANTIOCH_AUTOFUNC(StateType
this chem_mixture().R(species)*cache.T *this-> h_over_RT(cache, species)) template< typename StateType, typename VectorStateType >typename enable_if_c< has_size< VectorStateType >::value, void >::typeh(const TempCache< StateType > &cache, VectorStateType &h) const
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::h_over_RT ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

h over RT, directly from the curve fit

Definition at line 276 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species(), and Antioch::TempCache< StateType >::T.

Referenced by Antioch::NASAEvaluator< CoeffType, NASAFit >::h(), and test_g().

277  {
278  antioch_assert_less( species, this->n_species() );
279  antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
280  _nasa_mixture.curve_fit(species).n_intervals() );
281 
282  return this->_nasa_mixture.curve_fit(species).h_over_RT(cache);
283  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::h_RT_minus_s_R ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

We currently need different specializations for scalar vs vector inputs here.

Definition at line 303 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

Referenced by Antioch::NASAEvaluator< CoeffType, NASAFit >::h_RT_minus_s_R(), and test_type().

304  {
305  antioch_assert_less( species, this->n_species() );
306  // FIXME - we need assert_less to be vectorizable
307  // antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
308  // _nasa_mixture.curve_fit(species).n_intervals() );
309 
310  return this->_nasa_mixture.curve_fit(species).h_RT_minus_s_R(cache);
311  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, void >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::h_RT_minus_s_R ( const TempCache< StateType > &  cache,
VectorStateType &  h_RT_minus_s_R 
) const
template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
template<typename StateType , typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, void >::type Antioch::NASAEvaluator< CoeffType, NASAFit >::h_RT_minus_s_R ( const TempCache< StateType > &  cache,
VectorStateType &  h_RT_minus_s_R 
) const
inline

Definition at line 320 of file nasa_evaluator.h.

References antioch_assert_equal_to, Antioch::NASAEvaluator< CoeffType, NASAFit >::h_RT_minus_s_R(), and Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species().

322  {
324 
325  for( unsigned int s = 0; s < this->n_species(); s++ )
326  {
327  h_RT_minus_s_R[s] = this->h_RT_minus_s_R(cache,s);
328  }
329 
330  return;
331  }
#define antioch_assert_equal_to(expr1, expr2)
StateType h_RT_minus_s_R(const TempCache< StateType > &cache, unsigned int species) const
We currently need different specializations for scalar vs vector inputs here.
unsigned int n_species() const
Convenience function.
template<typename CoeffType , typename NASAFit >
unsigned int Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species ( ) const
inlineprotected
template<typename CoeffType , typename NASAFit >
template<typename StateType >
StateType Antioch::NASAEvaluator< CoeffType, NASAFit >::s_over_R ( const TempCache< StateType > &  cache,
unsigned int  species 
) const
inline

s over R, directly from the curve fit

Definition at line 289 of file nasa_evaluator.h.

References Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture, antioch_assert_less, Antioch::NASAEvaluator< CoeffType, NASAFit >::n_species(), and Antioch::TempCache< StateType >::T.

Referenced by test_g(), and test_s().

290  {
291  antioch_assert_less( species, this->n_species() );
292  antioch_assert_less( _nasa_mixture.curve_fit(species).interval(cache.T),
293  _nasa_mixture.curve_fit(species).n_intervals() );
294 
295  return this->_nasa_mixture.curve_fit(species).s_over_R(cache);
296  }
#define antioch_assert_less(expr1, expr2)
unsigned int n_species() const
Convenience function.
const NASAThermoMixture< CoeffType, NASAFit > & _nasa_mixture

Member Data Documentation

template<typename CoeffType = double, typename NASAFit = NASA9CurveFit<CoeffType>>
const NASAThermoMixture<CoeffType,NASAFit>& Antioch::NASAEvaluator< CoeffType, NASAFit >::_nasa_mixture
protected

The documentation for this singleton was generated from the following files:

Generated on Thu Jul 7 2016 11:09:49 for antioch-0.4.0 by  doxygen 1.8.8