32 #ifndef ANTIOCH_CHEMICAL_MIXTURE_H
33 #define ANTIOCH_CHEMICAL_MIXTURE_H
36 #include "antioch_config.h"
52 template <
class NumericType>
74 template<
typename CoeffType=
double>
80 const bool verbose =
true,
87 const bool verbose =
true,
113 const std::string & species_data,
114 const std::string & vibration_data,
115 const std::string & electronic_data);
129 void add_species(
const unsigned int index,
const std::string& name,
130 CoeffType mol_wght, CoeffType h_form,
131 CoeffType n_tr_dofs,
int charge );
134 const CoeffType theta_v,
135 const unsigned int ndg_v );
138 const CoeffType theta_e,
139 const unsigned int ndg_e );
152 CoeffType
R(
const unsigned int s )
const;
155 template<
typename VectorStateType>
160 R(
const VectorStateType& mass_fractions )
const;
163 CoeffType
M(
const unsigned int s )
const;
171 template<
typename VectorStateType>
173 has_size<VectorStateType>::value,
176 M(
const VectorStateType& mass_fractions )
const;
184 template<
typename StateType>
186 X(
const unsigned int species,
const StateType& M,
187 const StateType& mass_fraction )
const
195 template<
typename VectorStateType>
197 const VectorStateType& mass_fractions,
198 VectorStateType& mole_fractions )
const;
205 template<
typename StateType>
208 const StateType& rho,
209 const StateType& mass_fraction ) const
217 template<typename StateType, typename VectorStateType>
219 const VectorStateType& mass_fractions,
236 template<typename CoeffType>
240 return _species_list.size();
243 template<
typename CoeffType>
250 template<
typename CoeffType>
257 template<
typename CoeffType>
264 template<
typename CoeffType>
271 template<
typename CoeffType>
273 const std::map<std::string,Species>&
280 template<
typename CoeffType>
287 template<
typename CoeffType>
294 template<
typename CoeffType>
295 template<
typename StateType,
typename VectorStateType>
298 const VectorStateType& mass_fractions,
307 for(
unsigned int s = 0; s < this->
n_species(); s++ )
309 molar_densities[s] = rho*mass_fractions[s]/this->
M(s);
314 template<
typename CoeffType>
315 template<
typename VectorStateType>
317 typename enable_if_c<
318 has_size<VectorStateType>::value,
327 R = mass_fractions[0]*this->
R(0);
328 for(
unsigned int s = 1; s < mass_fractions.size(); s++ )
330 R += mass_fractions[s]*this->
R(s);
337 template<
typename CoeffType>
338 template<
typename VectorStateType>
341 has_size<VectorStateType>::value,
349 M = mass_fractions[0]/this->
M(0);
350 for(
unsigned int s = 1; s < mass_fractions.size(); s++ )
352 M += mass_fractions[s]/(this->
M(s));
355 return CoeffType(1)/
M;
359 template<
typename CoeffType>
360 template<
typename VectorStateType>
363 const VectorStateType& mass_fractions,
364 VectorStateType& mole_fractions )
const
373 for(
unsigned int s = 0; s < mass_fractions.size(); s++ )
375 mole_fractions[s] = this->X(s, M, mass_fractions[s]);
381 template<
typename CoeffType>
391 #endif //ANTIOCH_CHEMICAL_MIXTURE_H
std::vector< ChemicalSpecies< CoeffType > * > _chemical_species
static const std::string & electronic_data()
std::vector< Species > _species_list
void read_species_vibrational_characteristics(ParserBase< CoeffType > *parser)
method to read vibrational characteristics
const ChemicalMixture< CoeffType > & chemical_mixture() const
method to send this back
CoeffType R(const unsigned int s) const
Gas constant for species s in [J/kg-K].
#define antioch_assert_equal_to(expr1, expr2)
void build_inverse_name_map()
const std::vector< Species > & species_list() const
#define antioch_assert_greater(expr1, expr2)
void init_species_name_map(const std::vector< std::string > &species_list)
CoeffType M(const unsigned int s) const
Molecular weight (molar mass) for species s in kg/mol.
static const std::string & chemical_mixture()
void read_species_mandatory_characteristics(ParserBase< CoeffType > *parser)
method to read mandatory characteristics
std::map< std::string, Species > _species_name_map
const std::map< std::string, Species > & species_name_map() const
Class to encapsulate data for each chemical species.
std::map< Species, std::string > _species_inv_name_map
const std::map< Species, std::string > & species_inverse_name_map() const
unsigned int n_species() const
Returns the number of species in this mixture.
#define antioch_deprecated()
static const std::string & vibrational_data()
void initialize_species(const std::vector< std::string > &species_list)
method to initialize, backward compatibility
#define ANTIOCH_AUTOFUNC(Type, Expr)
const ANTIOCH_AUTO(StateType) KineticsTheoryThermalConductivity< ThermoEvaluator
void add_species(const unsigned int index, const std::string &name, CoeffType mol_wght, CoeffType h_form, CoeffType n_tr_dofs, int charge)
void read_species_characteristics(ParserBase< CoeffType > *parser, const std::string &species_data, const std::string &vibration_data, const std::string &electronic_data)
method to read characteristics, using one parser
X(const unsigned int species, const StateType &M, const StateType &mass_fraction) const template< typename VectorStateType > void X(typename Antioch VectorStateType void molar_densities(const StateType &rho, const VectorStateType &mass_fractions, VectorStateType &molar_densities) const
void add_species_vibrational_data(const unsigned int index, const CoeffType theta_v, const unsigned int ndg_v)
Class storing chemical mixture properties.
void add_species_electronic_data(const unsigned int index, const CoeffType theta_e, const unsigned int ndg_e)
The parameters are reduced parameters.
ChemicalMixture(const std::string &filename=DefaultFilename::species_list(), const bool verbose=true, const std::string &species_data=DefaultFilename::chemical_mixture(), const std::string &vibration_data=DefaultFilename::vibrational_data(), const std::string &electronic_data=DefaultFilename::electronic_data())
ascii parser by default
void read_species_electronic_characteristics(ParserBase< CoeffType > *parser)
method to read electronic characteristics
const std::map< std::string, Species > & active_species_name_map() const
A parser is an instance related to a file.
const std::vector< ChemicalSpecies< CoeffType > * > & chemical_species() const
static const std::string & species_list()
X(const unsigned int species, const StateType &M, const StateType &mass_fraction) const template< typename VectorStateType > void X(typename Antioch molar_density(const unsigned int species, const StateType &rho, const StateType &mass_fraction) const template< typename StateType
Species mole fraction.