H2 Combustion
reaction.h
00001 #ifndef zh2_reaction
00002 #define zh2_reaction
00003 
00004 #include <utility>
00005 #include <vector>
00006 #include <iostream>
00007 
00008 namespace h2comb {
00009     
00010 class Substance;
00011 
00021 class Reaction
00022 {
00023 public:
00024     void addSubstance(Substance *s, bool is_product, bool optional = false);
00025     void setParameters(double, double, double, double);
00026     void setAdditionalParameters(double, double, double);
00027     void setTroe(double);
00028     bool isTroe(){return is_troe;}
00029     void addEfficiency(Substance *, double);
00030     void addEfficiency(std::pair<Substance *, double>);
00031     Reaction *makeReverse();
00032     
00033     double getK(double = 300);
00034     double getK_lp(double = 300);
00035     double getH(){return H;}
00036     
00037     std::vector<Substance *>* getReactants(){return &reactants;}
00038     std::vector<Substance *>* getLpReactants(){return &lp_reactants;}
00039     
00040     std::vector<Substance *>* getProducts(){return &products;}
00041     std::vector<Substance *>* getLpProducts(){return &lp_products;}
00042     
00043     friend std::ostream& operator<<(std::ostream &out, Reaction &r);
00044 
00045 private:
00046     std::vector<Substance *> reactants;
00047     std::vector<Substance *> products;
00048     
00049     double H, A, n, E;
00050     
00051     bool is_troe = false;
00052     bool paramsSet = false;
00053     bool addParamsSet = false;
00054     
00055     std::vector<Substance *> lp_reactants;
00056     std::vector<Substance *> lp_products;
00057     
00058     double hp_A, hp_n, hp_E, F;
00059     std::vector<std::pair<Substance *, double>> efficiencies;
00060 
00061 public: // For testing: \cond
00062     int getNumParams();
00063     void getParams(double *);
00064     void getNumSubsts(int *);
00065     void getSubsts(Substance **, Substance **, Substance **, Substance **, Substance **); // \endcond
00066 };
00067 
00068 }
00069 
00070 #endif
 All Classes Files Functions