1 #include "FiveEqsTwoFluid.hxx"
5 int main(int argc, char** argv)
7 //Preprocessing: mesh and group creation
8 cout << "Building cartesian mesh" << endl;
14 M.setGroupAtPlan(xsup,0,eps,"Outlet");//Neumann
15 M.setGroupAtPlan(xinf,0,eps,"Wall");//
16 int spaceDim = M.getSpaceDimension();
18 // set the limit field for each boundary
19 LimitField limitOutlet, limitWall;
20 map<string, LimitField> boundaryFields;
21 limitOutlet.bcType=Outlet;
22 limitOutlet.p = 100e5;
23 boundaryFields["Outlet"] = limitOutlet;
25 limitWall.bcType=Wall;
27 limitWall.v_x = vector<double>(2,0);
28 boundaryFields["Wall"]= limitWall;
31 double latentHeat=1e6;
33 double dHsatl_over_dp=0.05;
36 FiveEqsTwoFluid myProblem(around155bars600K,spaceDim);
37 int nbPhase = myProblem.getNumberOfPhases();
38 int nVar = myProblem.getNumberOfVariables();
40 //Initial field creation
41 Vector VV_Constant(nVar);
43 VV_Constant(1) = 155e5;
44 for (int idim=0; idim<spaceDim;idim++){
45 VV_Constant(2+idim) = 0;
46 VV_Constant(2+idim +spaceDim) =0;
48 VV_Constant(2+spaceDim*nbPhase) = 600;
50 cout << "Number of Phases = " << nbPhase << endl;
51 cout << "Building initial data " << endl;
53 // generate initial condition
54 myProblem.setInitialFieldConstant(M,VV_Constant);
56 //set the boundary conditions
57 myProblem.setBoundaryFields(boundaryFields);
58 /* set physical parameters*/
59 // myProblem.setLatentHeat(latentHeat);
60 // myProblem.setSatPressure( Psat, dHsatl_over_dp);
62 // set the numerical method
63 myProblem.setNumericalScheme(upwind, Explicit);
64 myProblem.setEntropicCorrection(true);
67 string fileName = "1DDepressurisation";
69 // set numerical parameters
70 unsigned MaxNbOfTimeStep =3;
74 double precision = 1e-6;
76 myProblem.setCFL(cfl);
77 myProblem.setPrecision(precision);
78 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
79 myProblem.setTimeMax(maxTime);
80 myProblem.setFreqSave(freqSave);
81 myProblem.setFileName(fileName);
85 myProblem.initialize();
89 cout << "Simulation "<<fileName<<" is successful !" << endl;
91 cout << "Simulation "<<fileName<<" failed ! " << endl;
93 cout << "------------ End of calculation -----------" << endl;
94 myProblem.terminate();