28 #ifndef ANTIOCH_NASA_MIXTURE_H
29 #define ANTIOCH_NASA_MIXTURE_H
48 template<
typename CoeffType,
typename NASAFit>
51 template<
typename CoeffType=
double,
typename NASAFit = NASA9CurveFit<CoeffType> >
52 class NASAThermoMixture
63 void add_curve_fit(
const std::string& species_name,
const std::vector<CoeffType>& coeffs );
66 void add_curve_fit(
const std::string& species_name,
const std::vector<CoeffType>& coeffs,
const std::vector<CoeffType>& temps );
68 const NASAFit&
curve_fit(
unsigned int s )
const;
94 template<
typename CoeffType,
typename NASAFit>
96 : _chem_mixture(chem_mixture),
97 _species_curve_fits(chem_mixture.n_species(), NULL),
98 _cp_at_200p1( _species_curve_fits.size() )
104 template<
typename CoeffType,
typename NASAFit>
108 for(
typename std::vector<NASAFit* >::iterator it = _species_curve_fits.begin();
109 it < _species_curve_fits.end(); ++it )
118 template<
typename CoeffType,
typename NASAFit>
121 const std::vector<CoeffType>& coeffs)
123 antioch_assert( _chem_mixture.species_name_map().find(species_name) !=
124 _chem_mixture.species_name_map().end() );
126 unsigned int s = _chem_mixture.species_name_map().find(species_name)->second;
131 _species_curve_fits[s] =
new NASAFit(coeffs);
139 template<
typename CoeffType,
typename NASAFit>
142 const std::vector<CoeffType>& coeffs,
const std::vector<CoeffType>& temps )
144 antioch_assert( _chem_mixture.species_name_map().find(species_name) !=
145 _chem_mixture.species_name_map().end() );
147 unsigned int s = _chem_mixture.species_name_map().find(species_name)->second;
152 _species_curve_fits[s] =
new NASAFit(coeffs,temps);
161 template<
typename CoeffType,
typename NASAFit>
167 for(
typename std::vector<NASAFit* >::const_iterator it = _species_curve_fits.begin();
168 it != _species_curve_fits.end(); ++ it )
177 template<
typename CoeffType,
typename NASAFit>
187 return *_species_curve_fits[s];
190 template<
typename CoeffType,
typename NASAFit>
195 return _cp_at_200p1[s];
198 template<
typename CoeffType,
typename NASAFit>
202 return _chem_mixture;
207 #endif // ANTIOCH_NASA_MIXTURE_H
virtual ~NASAThermoMixture()
Destructor.
#define antioch_assert(asserted)
const NASAFit & curve_fit(unsigned int s) const
const ChemicalMixture< CoeffType > & _chem_mixture
NASAThermoMixture()
Default constructor.
#define antioch_assert_less(expr1, expr2)
CoeffType cp_at_200p1(unsigned int s) const
#define antioch_assert_less_equal(expr1, expr2)
void add_curve_fit(const std::string &species_name, const std::vector< CoeffType > &coeffs)
std::vector< NASAFit * > _species_curve_fits
const ChemicalMixture< CoeffType > & chemical_mixture() const
std::vector< CoeffType > _cp_at_200p1
Class storing chemical mixture properties.
The parameters are reduced parameters.
StateType cp(const TempCache< StateType > &cache, unsigned int species) const
We currently need different specializations for scalar vs vector inputs here.
bool check() const
Checks that curve fits have been specified for all species in the mixture.