Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
FlameMasterReactor.hpp
Go to the documentation of this file.
1 // Copyright (c) 2016 Philip Berndt
2 // Copyright (c) 2018 Maikel Nadolski
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 // SOFTWARE.
21 
22 #ifndef FUB_FLAME_MASTER_REACTOR_HPP
23 #define FUB_FLAME_MASTER_REACTOR_HPP
24 
26 #include "fub/core/span.hpp"
27 #include "fub/ext/Eigen.hpp"
28 #include "fub/ode_solver/OdeSolver.hpp"
29 
30 #include <limits>
31 #include <memory>
32 #include <stdexcept>
33 #include <string>
34 #include <vector>
35 
36 namespace fub {
37 
38 /// This class encapsulates all exceptions which can occur in the
39 /// FlameMasterReactor class
40 class FlameMasterReactorException : public std::runtime_error {
41 public:
42  FlameMasterReactorException(const char* message)
43  : std::runtime_error(message) {}
44 
45  FlameMasterReactorException(std::string message)
46  : std::runtime_error(std::move(message)) {}
47 };
48 
49 /// \ingroup Euler
50 /// This abstract base class encapsulates the underlying chemistry for the
51 /// FlameMasterReactor.
53  virtual ~FlameMasterMechanism() = default;
54 
55  virtual std::unique_ptr<FlameMasterMechanism> Clone() const = 0;
56 
59  span<double> M, double temp,
60  double pressure) const = 0;
61 
62  virtual void ComputeThermoData(span<double> h, span<double> cp, double t,
63  span<double> s) const = 0;
64 
65  virtual void ComputeThermoData(ArrayXd& h, ArrayXd& cp, Array1d t) const = 0;
66 
67  virtual int getNSpecies() const = 0;
68 
69  virtual int getNReactions() const = 0;
70 
71  virtual int getNThirdBodyReactions() const = 0;
72 
73  virtual std::vector<std::string> getSpeciesNames() const = 0;
74 
75  virtual void getMolarMass(span<double>) const = 0;
76 
77  virtual double getUniversalGasConstant() const { return 8314.462175; }
78 
79  virtual int getNSpecs() const { return getNSpecies(); }
80 };
81 
83  /// The number of species in the mechanism
84  int nSpecies;
85  /// Effective number of species for mechanisms with steady state species
87  /// The number of reactions in the mechanism
89  /// The number of third body reactions in the mechanism
91  /// Universal Gas Constant for this mechanism.
92  double gasConstant;
93 
94  std::vector<double> massFractions;
95  std::vector<double> molesStorage;
96 
97  /// Derived from massFractions, stores the actual mole counts during time
98  /// Advancement
100 
101  /// We make this a pointer because we want to make sure it is stored at the
102  /// beginning of moles (for CVode)
103  double* temperature;
104 
105  double density;
106 
107  /// Computational space for the reaction mechanism
108  std::vector<double> production_rates;
109  std::vector<double> reaction_rates;
110  std::vector<double> rate_coefficients;
111  std::vector<double> third_body_concentrations;
112  std::vector<double> enthalpies;
114  std::vector<double> entropies;
115 
116  /// We store the names of the species here
117  std::vector<std::string> speciesNames;
118 
119  /// We store the molar masses of the species here
120  std::vector<double> molarMasses;
121 
122  /// Absolute integration tolerance
123  double abstol;
124  /// Relative integration tolerance
125  double reltol;
126 
127  /// A vector containing temperature for setPressureIsentropic()
128  std::array<double, 2> setPVector;
129 
130  /// Temperature at which the thermodynamic state was last evaluated
131  double thermoTemp{};
132 };
133 
138 
139  /// We make this a pointer because we want to make sure it is stored at the
140  /// beginning of moles (for CVode)
141  Array1d temperature{Array1d::Zero()};
142  /// Temperature at which the thermodynamic state was last evaluated
143  Array1d thermoTemp{Array1d::Zero()};
144  Array1d density{Array1d::Zero()};
145 
146  /// Computational space for the reaction mechanism
154 };
155 
156 /// \ingroup Euler
157 /// \brief A class mimicking the IdealGasMix / Reactor / ReactorNet interface of
158 /// Cantera, but with FlameMaster chemistry.
160 public:
162  ~FlameMasterReactor() = default;
163 
166 
169 
170  /// \brief Advance the reactor in time by dt and call a function for each
171  /// internal timestep
172  void Advance(
173  double dt,
175  feedbackFun);
176 
177  /// \brief Advance the reactor in time by dt.
178  ///
179  /// \param[in] dt The time step size.
180  ///
181  /// \throw FlameMasterReactorException This exception may be thrown if the
182  /// ode solver could not converge to a solution.
183  void Advance(double dt);
184 
185  /// \brief Advance the reactor by one internal time step and return the time
186  /// step size
187  double Step();
188 
189  /// \brief Advance the reactor in time by dt and return the time where
190  /// \f$dT/dt\f$ peaked.
191  double AdvanceAndFindMaxdT(double dt);
192 
193  /// Set tolerances for the integration. Defaults are 1e-9 for reltol and
194  /// 1e-15 for abstol.
195  // void setTolerances(double reltol, double abstol);
196 
199  return *mechanism_;
200  }
201 
202  void SetOdeSolver(std::unique_ptr<OdeSolver> solver) {
203  if (solver) {
204  ode_solver_ = std::move(solver);
205  }
206  }
207 
208  const OdeSolver& GetOdeSolver() const noexcept {
210  return *ode_solver_;
211  }
212 
213  ///@name Thermodynamic properties
214  ///@{
215 
216  /// Returns the pressure of the mixture
217  ///
218  /// This used the ideal gas law to derive the pressure from
219  /// temperature, the mass fractions and density.
220  ///
221  /// The unit for pressure is Pascal.
222  double GetPressure() const {
224  GetTemperature();
225  }
226 
230  }
231 
232  /**
233  * Set the pressure of the mixture
234  *
235  * This actually sets the density based on the current
236  * temperature and mass fractions, using the ideal gas law
237  *
238  * The unit for pressure is Pascal.
239  */
240  void SetPressure(double pressure) {
241  SetDensity(pressure * GetMeanMolarMass() / GetTemperature() /
243  }
244 
245  void SetPressureArray(Array1d pressure) {
246  const Array1d mean_molar_mass = GetMeanMolarMassArray();
247  const Array1d temperature = GetTemperatureArray();
248  const Array1d temperature_s = (temperature > 0.0).select(temperature, 1.0);
249  const double R = GetUniversalGasConstant();
250  SetDensityArray(pressure * mean_molar_mass / temperature_s / R);
251  }
252 
253  /**
254  * Adjust the pressure of the mixture isentropically
255  *
256  * Flamemaster does not offer entropy data. However, we still
257  * have the relation dH = V dp + T dS, which reduces to
258  * dH = V dp in the isentropic case. This function integrates
259  * H to the desired p and ensures fixed entropy this way.
260  *
261  * The function simultaneously integrates velocity using the relation
262  * du = - 1/(c \rho) dp = - sqrt(1/(\gamma p \rho)) dp.
263  * This relation is fulfiled across rarefaction waves, and the call
264  * allows to use the function to calculate the state behind such a
265  * wave.
266  */
267  double SetPressureIsentropic(double pressure);
268 
269  /// Returns the density of the current mixture
270  ///
271  /// The units are \f$kg/m^3\f$
272  double GetDensity() const { return state_.density; }
274 
275  /**
276  * Sets the density of the current mixture
277  *
278  * The units are \f$kg/m^3\f$
279  */
280  void SetDensity(double density) { state_.density = density; }
281  void SetDensityArray(Array1d density) { array_state_.density = density; }
282 
283  /**
284  * Returns the temperature of the current mixture
285  *
286  * In Kelvin
287  */
288  [[nodiscard]] double GetTemperature() const noexcept {
289  return *(state_.temperature);
290  }
291  [[nodiscard]] Array1d GetTemperatureArray() const noexcept {
292  return array_state_.temperature;
293  }
294 
295  /**
296  * Set the temperature of the current mixture
297  *
298  * In Kelvin
299  */
300  void SetTemperature(double temperature);
301  void SetTemperatureArray(Array1d temperature);
302 
303  /**
304  * Return the specific heat capacity cv
305  */
306  double GetCv() const;
308 
309  /**
310  * Return the specific heat capacity cp
311  */
312  double GetCp() const;
314 
315  /**
316  * Return the specific heat capacities cp for all species
317  */
319  const ArrayXd& GetCpsArray() const;
320 
321  /**
322  * Return the specific entropy
323  */
324  double GetEntropy() const;
325 
326  ///@}
327 
328  ///@name Mass-/Mole fractions
329  ///@{
330 
331  /**
332  * Return the name of the ith species
333  */
334  const std::string& GetSpeciesName(int i) const {
335  return state_.speciesNames[static_cast<std::size_t>(i)];
336  }
337 
339  return state_.speciesNames;
340  }
341 
342  /**
343  * Return the number of species in the mechanism
344  */
345  int GetNSpecies() const { return state_.nSpecies; }
346 
347  int GetNReactions() const { return state_.nReactions; }
348 
349  /**
350  * Average a quantity over the mole fractions
351  */
352  double MeanX(span<const double> quantity) const;
353  Array1d MeanX(const ArrayXd& quantity) const;
354 
355  /**
356  * Average a quantity over the mass fractions
357  */
358  double MeanY(span<const double> quantity) const;
359  Array1d MeanY(const ArrayXd& quantity) const;
360 
361  ///@{
362  /**
363  * Set the dimensionless mass fractions of the mixture.
364  *
365  * You can either supply them as a double* array, or as
366  * a string of the form
367  * species: fraction, species: fraction, ..
368  *
369  */
370  void SetMassFractions(span<const double> newMassFractions);
371  void SetMassFractionsArray(const ArrayXd& newMassFractions);
372  void SetMassFractionsArray(const ArrayXd& newMassFractions, MaskArray mask);
373  void SetMassFractions(std::string massFractions);
374  ///@}
375 
376  ///@{
377  /**
378  * Set the dimensionless mole fractions of the mixture
379  *
380  * You can either supply them as a double* array, or as
381  * a string of the form
382  * species: fraction, species: fraction, ..
383  */
384  void SetMoleFractions(span<const double> newMoleFractions);
385  void SetMoleFractionsArray(const ArrayXd& newMoleFractions);
386  void SetMoleFractions(std::string newMoleFractions);
387  ///@}
388 
389  /**
390  * Return the mass fractions of the species as a double* array
391  */
396  }
398 
399  /**
400  * get the molar mass of a single species
401  *
402  * Units are \f$kg/kmol\f$
403  */
404  double GetSpeciesMolarMass(size_t i) const { return state_.molarMasses[i]; }
405 
406  /**
407  * get the molar masses for all species
408  */
410 
411  /**
412  * get the overall molar mass
413  *
414  * Units are \f$kg/kmol\f$
415  */
416  double GetMeanMolarMass() const;
418 
419  /**
420  * get the species' enthalpies
421  */
423 
424  /**
425  * Return the mix'es specific enthalpy
426  *
427  * The unit is \f$J/kg\f$
428  */
429  double GetEnthalpy() const;
431 
432  /**
433  * Set the mix'es specific enthalpy
434  *
435  * The unit is \f$J/kg\f$. This function actually tries to match the
436  * mixtures temperature such that the enthalpy is correct. It does so by
437  * using the same Newton algorithm which is also used by Cantera.
438  */
439  void SetEnthalpy(double enthalpy, double dTtol);
440  ///@}
441 
442  /**
443  * Return the mix'es specific internal energy
444  *
445  * The unit is \f$J/kg\f$
446  */
447  double GetInternalEnergy() const;
449 
450  /**
451  * Set the mix'es specific internal energy
452  *
453  * The unit is \f$J/kg\f$. This function actually tries to match the
454  * mixtures temperature such that the energy is correct. It does so by
455  * using the same Newton algorithm which is also used by Cantera.
456  */
457  void SetInternalEnergy(double energy, double dTtol = 1E-6);
458  void SetInternalEnergyArray(Array1d energy, double dTtol = 1E-6);
460  double dTtol = 1E-6);
461  ///@}
462 
463  /// \brief get the current reaction rates d/dt m, where m denotes the actual
464  /// mole counts: Y = m * molarMasses / density
467 
470 
471  /// \brief Retrieve the universal gas constant.
472  ///
473  /// Note that some mechanisms *can* override this, to use normalized
474  /// quantities!
475  double GetUniversalGasConstant() const { return state_.gasConstant; }
476 
477 private:
481  std::unique_ptr<OdeSolver> ode_solver_;
482 };
483 
484 } // namespace fub
485 
486 #endif
#define FUB_ASSERT(x)
Definition: assert.hpp:39
This class encapsulates all exceptions which can occur in the FlameMasterReactor class.
Definition: FlameMasterReactor.hpp:40
FlameMasterReactorException(const char *message)
Definition: FlameMasterReactor.hpp:42
FlameMasterReactorException(std::string message)
Definition: FlameMasterReactor.hpp:45
A class mimicking the IdealGasMix / Reactor / ReactorNet interface of Cantera, but with FlameMaster c...
Definition: FlameMasterReactor.hpp:159
void SetPressureArray(Array1d pressure)
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:245
const OdeSolver & GetOdeSolver() const noexcept
Definition: FlameMasterReactor.hpp:208
void SetInternalEnergyArray(Array1d energy, double dTtol=1E-6)
std::unique_ptr< OdeSolver > ode_solver_
Definition: FlameMasterReactor.hpp:481
const ArrayXd & GetMoleFractionsArray()
span< const double > GetMolarMasses() const
get the molar masses for all species
Definition: FlameMasterReactor.hpp:409
int GetNReactions() const
Return the name of the ith species.
Definition: FlameMasterReactor.hpp:347
Array1d GetCvArray() const
Returns the pressure of the mixture.
Array1d GetTemperatureArray() const noexcept
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:291
const ArrayXd & GetProductionRatesArray() const
double MeanY(span< const double > quantity) const
Average a quantity over the mass fractions.
FlameMasterArrayState array_state_
Definition: FlameMasterReactor.hpp:480
void SetTemperatureArray(Array1d temperature)
Returns the pressure of the mixture.
void SetMassFractionsArray(const ArrayXd &newMassFractions)
Return the name of the ith species.
Array1d GetDensityArray() const
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:273
void SetDensityArray(Array1d density)
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:281
double GetDensity() const
Returns the density of the current mixture.
Definition: FlameMasterReactor.hpp:272
Array1d MeanX(const ArrayXd &quantity) const
Return the name of the ith species.
Array1d GetPressureArray() const
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:227
void SetInternalEnergyArray(Array1d energy, MaskArray mask, double dTtol=1E-6)
void SetMoleFractions(std::string newMoleFractions)
Set the dimensionless mole fractions of the mixture.
void SetDensity(double density)
Sets the density of the current mixture.
Definition: FlameMasterReactor.hpp:280
void SetMassFractionsArray(const ArrayXd &newMassFractions, MaskArray mask)
Return the name of the ith species.
void Advance(double dt)
Advance the reactor in time by dt.
double GetEnthalpy() const
Return the mix'es specific enthalpy.
const FlameMasterMechanism * mechanism_
Definition: FlameMasterReactor.hpp:478
const FlameMasterMechanism & getMechanism() const
Set tolerances for the integration.
Definition: FlameMasterReactor.hpp:197
void SetMassFractions(std::string massFractions)
Return the name of the ith species.
double Step()
Advance the reactor by one internal time step and return the time step size.
span< const double > GetMoleFractions()
FlameMasterReactor & operator=(FlameMasterReactor &&other) noexcept
span< const double > GetMassFractions() const
Return the mass fractions of the species as a double* array.
Definition: FlameMasterReactor.hpp:392
FlameMasterReactor & operator=(const FlameMasterReactor &other)
span< const double > GetEnthalpies()
get the species' enthalpies
FlameMasterReactor(const FlameMasterReactor &other)
double GetTemperature() const noexcept
Returns the temperature of the current mixture.
Definition: FlameMasterReactor.hpp:288
double GetEntropy() const
Return the specific entropy.
const ArrayXd & GetReactionRatesArray() const
void Advance(double dt, function_ref< void(fub::span< const double >, double, FlameMasterReactor *)> feedbackFun)
Advance the reactor in time by dt and call a function for each internal timestep.
span< const std::string > GetSpeciesNames() const
Return the name of the ith species.
Definition: FlameMasterReactor.hpp:338
Array1d MeanY(const ArrayXd &quantity) const
Return the name of the ith species.
double GetPressure() const
Returns the pressure of the mixture.
Definition: FlameMasterReactor.hpp:222
double GetCp() const
Return the specific heat capacity cp.
double GetSpeciesMolarMass(size_t i) const
get the molar mass of a single species
Definition: FlameMasterReactor.hpp:404
void SetInternalEnergy(double energy, double dTtol=1E-6)
Set the mix'es specific internal energy.
void SetPressure(double pressure)
Set the pressure of the mixture.
Definition: FlameMasterReactor.hpp:240
const ArrayXd & GetCpsArray() const
Returns the pressure of the mixture.
void SetMoleFractions(span< const double > newMoleFractions)
Set the dimensionless mole fractions of the mixture.
FlameMasterState state_
Definition: FlameMasterReactor.hpp:479
void SetTemperature(double temperature)
Set the temperature of the current mixture.
void SetOdeSolver(std::unique_ptr< OdeSolver > solver)
Definition: FlameMasterReactor.hpp:202
void SetMassFractions(span< const double > newMassFractions)
Set the dimensionless mass fractions of the mixture.
double GetInternalEnergy() const
Return the mix'es specific internal energy.
void SetEnthalpy(double enthalpy, double dTtol)
Set the mix'es specific enthalpy.
span< const double > GetCps() const
Return the specific heat capacities cp for all species.
Array1d GetMeanMolarMassArray() const
const ArrayXd & GetMassFractionsArray() const
Definition: FlameMasterReactor.hpp:394
FlameMasterReactor(FlameMasterReactor &&other) noexcept
double AdvanceAndFindMaxdT(double dt)
Advance the reactor in time by dt and return the time where peaked.
double MeanX(span< const double > quantity) const
Average a quantity over the mole fractions.
const std::string & GetSpeciesName(int i) const
Return the name of the ith species.
Definition: FlameMasterReactor.hpp:334
double SetPressureIsentropic(double pressure)
Adjust the pressure of the mixture isentropically.
void SetMoleFractionsArray(const ArrayXd &newMoleFractions)
Set the dimensionless mole fractions of the mixture.
double GetUniversalGasConstant() const
Retrieve the universal gas constant.
Definition: FlameMasterReactor.hpp:475
double GetCv() const
Return the specific heat capacity cv.
Array1d GetEnthalpyArray() const
double GetMeanMolarMass() const
get the overall molar mass
Array1d GetInternalEnergyArray() const
int GetNSpecies() const
Return the number of species in the mechanism.
Definition: FlameMasterReactor.hpp:345
span< const double > GetProductionRates()
span< const double > GetReactionRates() const
get the current reaction rates d/dt m, where m denotes the actual mole counts: Y = m * molarMasses / ...
Array1d GetCpArray() const
Returns the pressure of the mixture.
FlameMasterReactor(const FlameMasterMechanism &mechanism)
An efficient, type-erasing, non-owning reference to a callable.
Definition: function_ref.hpp:37
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
Array< double, Eigen::Dynamic > ArrayXd
Definition: Eigen.hpp:57
Array< double, 1 > Array1d
Definition: Eigen.hpp:53
Array< bool, 1 > MaskArray
Definition: Eigen.hpp:59
Definition: FlameMasterReactor.hpp:134
ArrayXd moles
Definition: FlameMasterReactor.hpp:136
ArrayXd entropies
Definition: FlameMasterReactor.hpp:153
ArrayXd heat_capacities_at_constant_pressure
Definition: FlameMasterReactor.hpp:152
Array1d density
Definition: FlameMasterReactor.hpp:144
Array1d thermoTemp
Temperature at which the thermodynamic state was last evaluated.
Definition: FlameMasterReactor.hpp:143
ArrayXd production_rates
Computational space for the reaction mechanism.
Definition: FlameMasterReactor.hpp:147
Array1d temperature
We make this a pointer because we want to make sure it is stored at the beginning of moles (for CVode...
Definition: FlameMasterReactor.hpp:141
ArrayXd reaction_rates
Definition: FlameMasterReactor.hpp:148
ArrayXd rate_coefficients
Definition: FlameMasterReactor.hpp:149
ArrayXd molesStorage
Definition: FlameMasterReactor.hpp:137
ArrayXd massFractions
Definition: FlameMasterReactor.hpp:135
ArrayXd enthalpies
Definition: FlameMasterReactor.hpp:151
ArrayXd third_body_concentrations
Definition: FlameMasterReactor.hpp:150
This abstract base class encapsulates the underlying chemistry for the FlameMasterReactor.
Definition: FlameMasterReactor.hpp:52
virtual void getMolarMass(span< double >) const =0
virtual double getUniversalGasConstant() const
Definition: FlameMasterReactor.hpp:77
virtual void ComputeProductionRates(span< double > cdot, span< double > w, span< double > k, span< double > c, span< double > M, double temp, double pressure) const =0
virtual int getNThirdBodyReactions() const =0
virtual std::unique_ptr< FlameMasterMechanism > Clone() const =0
virtual void ComputeThermoData(span< double > h, span< double > cp, double t, span< double > s) const =0
virtual int getNSpecies() const =0
virtual int getNReactions() const =0
virtual std::vector< std::string > getSpeciesNames() const =0
virtual int getNSpecs() const
Definition: FlameMasterReactor.hpp:79
virtual ~FlameMasterMechanism()=default
virtual void ComputeThermoData(ArrayXd &h, ArrayXd &cp, Array1d t) const =0
Definition: FlameMasterReactor.hpp:82
double density
Definition: FlameMasterReactor.hpp:105
std::vector< double > enthalpies
Definition: FlameMasterReactor.hpp:112
double thermoTemp
Temperature at which the thermodynamic state was last evaluated.
Definition: FlameMasterReactor.hpp:131
std::vector< std::string > speciesNames
We store the names of the species here.
Definition: FlameMasterReactor.hpp:117
std::vector< double > third_body_concentrations
Definition: FlameMasterReactor.hpp:111
std::vector< double > massFractions
Definition: FlameMasterReactor.hpp:94
std::array< double, 2 > setPVector
A vector containing temperature for setPressureIsentropic()
Definition: FlameMasterReactor.hpp:128
int nSpeciesEffective
Effective number of species for mechanisms with steady state species.
Definition: FlameMasterReactor.hpp:86
std::vector< double > heat_capacities_at_constant_pressure
Definition: FlameMasterReactor.hpp:113
double reltol
Relative integration tolerance.
Definition: FlameMasterReactor.hpp:125
double abstol
Absolute integration tolerance.
Definition: FlameMasterReactor.hpp:123
span< double > moles
Derived from massFractions, stores the actual mole counts during time Advancement.
Definition: FlameMasterReactor.hpp:99
std::vector< double > production_rates
Computational space for the reaction mechanism.
Definition: FlameMasterReactor.hpp:108
std::vector< double > rate_coefficients
Definition: FlameMasterReactor.hpp:110
int nThirdBodyReactions
The number of third body reactions in the mechanism.
Definition: FlameMasterReactor.hpp:90
std::vector< double > molarMasses
We store the molar masses of the species here.
Definition: FlameMasterReactor.hpp:120
std::vector< double > reaction_rates
Definition: FlameMasterReactor.hpp:109
int nSpecies
The number of species in the mechanism.
Definition: FlameMasterReactor.hpp:84
double gasConstant
Universal Gas Constant for this mechanism.
Definition: FlameMasterReactor.hpp:92
double * temperature
We make this a pointer because we want to make sure it is stored at the beginning of moles (for CVode...
Definition: FlameMasterReactor.hpp:103
int nReactions
The number of reactions in the mechanism.
Definition: FlameMasterReactor.hpp:88
std::vector< double > entropies
Definition: FlameMasterReactor.hpp:114
std::vector< double > molesStorage
Definition: FlameMasterReactor.hpp:95