hips
Loading...
Searching...
No Matches
batchReactor_cantera.h
Go to the documentation of this file.
1#pragma once
2
3#include "batchReactor.h"
4#include "cantera/base/Solution.h"
5#include "cantera/thermo.h"
6#include "cantera/kinetics.h"
7#include "cantera/numerics/Integrator.h"
8
9#include <memory>
10#include <vector>
11
13
14class batchReactor_cantera : public batchReactor, public Cantera::FuncEval {
15
17
18std::unique_ptr<Cantera::Integrator> integrator;
19
21
22public:
23
24 batchReactor_cantera(std::shared_ptr<Cantera::Solution> cantSol);
25
26 virtual void react(double &h, std::vector<double> &y, const double tRun);
27
28 void eval(double t, double *vars, double *dvarsdt, double *not_used); // rhsf: dydt = rhsf
29
30 size_t neq() const { return nvar; } // Called by Cantera
31
32 void getState(double* y) { // Called by cantera to set y
33 gas->getMassFractions(y);
34 }
35
37};
batchReactor_cantera(std::shared_ptr< Cantera::Solution > cantSol)
Constructor for batchReactor_cantera.
std::unique_ptr< Cantera::Integrator > integrator
Cantera cvode wrapper.
virtual void react(double &h, std::vector< double > &y, const double tRun)
Simulates a reaction in the batch reactor.
void eval(double t, double *vars, double *dvarsdt, double *not_used)
Evaluates the reaction rates.
int nvar
number of variables/equations solved
std::shared_ptr< Cantera::ThermoPhase > gas
Cantera thermo object.