1 #include "FiveEqsTwoFluid.hxx"
5 int main(int argc, char** argv)
7 //Preprocessing: mesh and group creation
8 cout << "Building regular mesh " << endl;
15 Mesh M(xinf,xsup,nx,yinf,ysup,ny);
17 M.setGroupAtPlan(xsup,0,eps,"Wall");
18 M.setGroupAtPlan(xinf,0,eps,"Wall");
19 M.setGroupAtPlan(yinf,1,eps,"Inlet");
20 M.setGroupAtPlan(ysup,1,eps,"Outlet");
21 int spaceDim = M.getSpaceDimension();
24 vector<double> gravite(spaceDim,0.) ;
28 // set the limit field for each boundary
30 map<string, LimitField> boundaryFields;
31 limitWall.bcType=Wall;
33 limitWall.v_x = vector<double>(2,0);
34 limitWall.v_y = vector<double>(2,0);
35 boundaryFields["Wall"]= limitWall;
37 LimitField limitInlet;
38 limitInlet.bcType=Inlet;
41 limitInlet.v_x = vector<double>(2,0);
42 limitInlet.v_y = vector<double>(2,1);
43 boundaryFields["Inlet"]= limitInlet;
45 LimitField limitOutlet;
46 limitOutlet.bcType=Outlet;
47 limitOutlet.p = 155e5;
48 boundaryFields["Outlet"]= limitOutlet;
53 FiveEqsTwoFluid myProblem(around155bars600K,spaceDim);
54 int nbPhase = myProblem.getNumberOfPhases();
55 int nVar = myProblem.getNumberOfVariables();
56 // Prepare for the initial condition
57 Vector VV_Constant(nVar);
60 VV_Constant(1) = 155e5;
67 //Initial field creation
68 cout << "Building initial data " << endl;
69 myProblem.setInitialFieldConstant(M,VV_Constant);
71 //set the boundary conditions
72 myProblem.setBoundaryFields(boundaryFields);
74 // set physical parameters
75 myProblem.setHeatSource(heatPower);
76 myProblem.setGravity(gravite);
79 string fileName = "2DInclinedBoilingChannel";
81 //numerical parameters
82 myProblem.setNumericalScheme(upwind, Explicit);
83 unsigned MaxNbOfTimeStep = 3 ;
87 double precision = 1e-6;
89 myProblem.setCFL(cfl);
90 myProblem.setPrecision(precision);
91 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
92 myProblem.setTimeMax(maxTime);
93 myProblem.setFreqSave(freqSave);
94 myProblem.setFileName(fileName);
95 myProblem.saveVelocity();
98 myProblem.initialize();
100 bool ok = myProblem.run();
102 cout << "Simulation "<<fileName<<" is successful !" << endl;
104 cout << "Simulation "<<fileName<<" failed ! " << endl;
106 cout << "------------ End of calculation !!! -----------" << endl;
107 myProblem.terminate();