1 #include "FiveEqsTwoFluid.hxx"
5 int main(int argc, char** argv)
7 //Preprocessing: mesh and group creation
8 cout << "Building Cartesian 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,"Wall");
20 M.setGroupAtPlan(ysup,1,eps,"Wall");
21 int spaceDim = M.getSpaceDimension();
23 // set the limit field for each boundary
24 vector<double> wallVelocityX(2,0);
25 vector<double> wallVelocityY(2,0);
26 double wallTemperature=300;
29 vector<double> gravite(spaceDim,0.) ;
33 FiveEqsTwoFluid myProblem(around1bar300K,spaceDim);
34 int nbPhase = myProblem.getNumberOfPhases();
35 int nVar = myProblem.getNumberOfVariables();
36 // Prepare for the initial condition
37 Vector VV_Constant(nVar);
45 VV_Constant(6) = wallTemperature;
47 //Initial field creation
48 cout << "Building initial data" << endl;
49 myProblem.setInitialFieldConstant(M,VV_Constant);
51 //set the boundary conditions
52 myProblem.setWallBoundaryCondition("Wall",wallTemperature,wallVelocityX,wallVelocityY);
54 // set physical parameters
55 myProblem.setGravity(gravite);
57 // set the numerical method
58 myProblem.setNumericalScheme(upwind, Implicit);
61 string fileName = "2DInclinedSedimentation";
63 // parameters calculation
64 unsigned MaxNbOfTimeStep = 3 ;
68 double precision = 1e-6;
70 myProblem.setCFL(cfl);
71 myProblem.setPrecision(precision);
72 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
73 myProblem.setTimeMax(maxTime);
74 myProblem.setFreqSave(freqSave);
75 myProblem.setFileName(fileName);
76 myProblem.saveVelocity();
77 myProblem.displayConditionNumber();
78 myProblem.setSaveFileFormat(CSV);
81 myProblem.initialize();
83 bool ok = myProblem.run();
85 cout << "Simulation "<<fileName<<" is successful !" << endl;
87 cout << "Simulation "<<fileName<<" failed ! " << endl;
89 cout << "------------ End of calculation !!! -----------" << endl;
90 myProblem.terminate();