ODT
Loading...
Searching...
No Matches
main.cc
Go to the documentation of this file.
1
6#include "domain.h"
7#include "streams.h"
8#include "processor.h"
9#include "param.h"
10#include "micromixer.h"
11#include "meshManager.h"
12#include "eddy.h"
13#include "solver.h"
14#include "randomGenerator.h"
15#include "cantera/thermo/IdealGasPhase.h"
16#include "cantera/transport.h"
17
18#include <iostream>
19#include <string>
20#include <ctime>
21#include <sstream>
22
23using namespace std;
24using namespace Cantera;
25
27
29
31
32int main(int argc, char*argv[]) {
33
34
35 if(argc<3) {
36 cout << endl << "ERROR: code needs caseName and shift arguments" << endl;
37 return 1;
38 }
39 string caseName= argv[1]; // example: temporalJet (../input/temporalJet, without the ../input/)
40
41 int nShiftFileNumbers = 0;
42 stringstream ss1;
43 string s1;
44 ss1.clear(); ss1 << argv[2];
45 ss1 >> nShiftFileNumbers;
46
47 inputoutput io(caseName, nShiftFileNumbers);
48 param pram(&io);
49 streams strm;
50 IdealGasPhase gas("../input/gas_mechanisms/"+pram.chemMechFile);
51 Transport *tran = newTransportMgr("Mix", &gas);
52 eddy ed;
53 meshManager mesher;
54 solver *solv;
55 micromixer *mimx;
56 solv = new solver();
57 mimx = new micromixer();
58
59 domain domn(NULL, &pram);
60 domain eddl(&domn, &pram);
61
62 // we should increment the seed if we are starting MPI multiple times
63 if ( pram.seed >= 0 ) pram.seed += nShiftFileNumbers;
64 randomGenerator rand(pram.seed);
65
66 domn.init(&io, &mesher, &strm, &gas, tran, mimx, &ed, &eddl, solv, &rand);
67 eddl.init(NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, true);
68 //
69 //-------------------
70
71 time_t mytimeStart, mytimeEnd;
72 mytimeStart = time(0);
73 *io.ostrm << endl << "#################################################################";
74 *io.ostrm << endl << "# Start Time = " << ctime(&mytimeStart);
75 *io.ostrm << endl << "#################################################################";
76
77
78 //-------------------
79
80 domn.solv->calculateSolution();
81
82 //domn.io->outputProperties("../data/init.dat", 0.0); //doldb
83 //domn.mimx->advanceOdt(0.0, domn.pram->tEnd); //doldb
84
85 //-------------------
86
87 //delete mimx;
88 //delete solv;
89
90 mytimeEnd = time(0);
91 *io.ostrm << endl << "#################################################################";
92 *io.ostrm << endl << "# Start Time = " << ctime(&mytimeStart);
93 *io.ostrm << endl << "# End Time = " << ctime(&mytimeEnd);
94 *io.ostrm << endl << "#################################################################";
95 *io.ostrm << endl;
96
97 return 0;
98
99
100}
void init(inputoutput *p_io, meshManager *p_mesher, streams *p_strm, IdealGasPhase *p_gas, Transport *p_tran, micromixer *p_mimx, eddy *p_ed, domain *p_eddl, solver *p_solv, randomGenerator *p_rand, bool LisEddyDomain=false)
Definition domain.cc:46
solver * solv
pointer to solver object
Definition domain.h:77
Definition eddy.h:21
ostream * ostrm
Runtime: points to cout or to a file.
Definition inputoutput.h:33
Class implementing micromixer object.
Definition micromixer.h:23
Definition param.h:23
int seed
random number generator seed (negative to randomize it)
Definition param.h:32
string chemMechFile
name of chemical mechanism file
Definition param.h:41
virtual void calculateSolution()
Definition solver.cc:60
Header file for class domain.
Header file for class eddy.
int main(int argc, char *argv[])
Definition main.cc:32
processor proc
Definition main.cc:28
Header file for class meshManager.
Header file for class micromixer.
Header file for class param.
Header file for class processor.
Header file for class randomGenerator.
Header file for class solver.
Header file for class streams.