1 /*
2 This unit simulates a burner. The user must provide the air excess
3 and all combustion data as defined in data\\combustion.prop :
4       CAS nb_moles_O2 nb_moles_CO2 nb_moles_H2O
5 Then, mass and energy balances are performed and flows of common
6 combustion pollutants are estimated.
7 (reference : Crowl & Louvar)
8 
9 Structure in the .process file:
10 burner {name} {index of input stream} {index of output stream} {air excess >0 (ex.: 1.2 is a 120% excess)}
11 
12 How to use:
13    1- Call the constructor: burn = new burner(in, out);			burner(nb_in, chem_list)
14    ->set(in, out)
15    2- Set the air excess : burn->set(excess);
16    3- Set the name of the unit: burn->set(name);
17    4- Solve: bool=burn->solve();
18 */
19 #ifndef BURNER_H
20 #define BURNER_H
21 #include "stream.hpp"
22 #include "combrx.hpp"
23 using namespace std;
24 
25 class burner
26 {
27 private:
28 
29   string filename;
30   int rem_nb;
31   stream *in, *out;
32   chemical *O2, *N2, *CO2, *H2O;
33   combrx **rx;
34   bool *can_burn, stop, OK;
35   double eta, NO, NO2, N2O, CO;
36   double T, LFLmix, UFLmix, composition;
37   string name;
38   double * m;
39   double a[4], b[4], c[4], K[4];
40   int i;
41   double buff, Q, m_can_burn, step, num, den;
42   ifstream data;
43   // ofstream logf, results;
44   // terminator *end;
45   void fill_K_array();
46 
47 public:
48   // burner(){};
49   burner ( int , chemical ** );
set(stream * s1,stream * s2)50   void set ( stream * s1 , stream * s2 ) { in=s1; out=s2; for(i=0;i<in->nb;i++) m[i] = in->chem[i]->m;}
set(const string & n)51   void set ( const string & n ) { name = n; }
set(double e)52   void set(double e) {eta = e;}
53   bool solve(double * y);
54   void write();
55   void cost();
56   double get_cost ( void );
57   ~burner();
58 };
59 #endif
60