1 /*
2 This unit takes one input stream and divides in two or more
3 output streams. The pressure and temparature of output streams
4 are the same as the input's.
5 
6 Structure in the .process file:
7 split {name} {index of input stream}  {nb_out} {indexes of output streams and fractions of input}
8 
9 How to use:
10    1- Call the constructor: split1 = new split(nb_out, in, list_out);
11    2- Set split fractions: split1->set(fractions);
12    3- Set the name: split1->set(name);
13    4- Solve: split1->solve();
14 */
15 #ifndef SPLIT_H
16 #define SPLIT_H
17 
18 #include "stream.hpp"
19 using namespace std;
20 
21 class split
22 {
23 private:
24 
25   int i, j;
26   bool success;
27   double tmp;
28   string name;
29   int nb_out;			//number of input streams
30   stream *in;		//pointer to input stream
31   stream **out;		//list of pointers to output streams
32   double *frac;			//list of split fractions
33 
34 public:
35   split(int, stream*, stream**);		//defines the connectivities of this unit
~split()36   ~split(){}
set(double * f)37   void set(double* f)  {frac=f;}
set(const string & n)38   void set(const string & n) { name = n;}
39   bool solve();								//finds the temperature and computes mass balance
40   void write();
41 };
42 
43 #endif
44