1 #include "IsothermalTwoFluid.hxx"
\r
7 int main(int argc, char** argv)
\r
9 //Preprocessing: mesh and group creation
\r
10 cout << "Building Cartesian mesh " << endl;
\r
17 Mesh M(xinf,xsup,nx,yinf,ysup,ny);
\r
19 M.setGroupAtPlan(xsup,0,eps,"Wall");
\r
20 M.setGroupAtPlan(xinf,0,eps,"Wall");
\r
21 M.setGroupAtPlan(yinf,1,eps,"Wall");
\r
22 M.setGroupAtPlan(ysup,1,eps,"inlet");
\r
23 int spaceDim = M.getSpaceDimension();
\r
25 // set the limit field for each boundary
\r
26 vector<double> wallVelocityX(2,0);
\r
27 vector<double> wallVelocityY(2,0);
\r
28 double inletAlpha=1;
\r
29 double outletPressure=1e5;
\r
31 // physical constants
\r
32 vector<double> gravite(spaceDim,0.) ;
\r
36 IsothermalTwoFluid myProblem(around1bar300K,spaceDim);
\r
37 int nbPhase = myProblem.getNumberOfPhases();
\r
38 int nVar = myProblem.getNumberOfVariables();
\r
39 // Prepare for the initial condition
\r
40 Vector VV_Constant(nVar);
\r
42 VV_Constant(0) = 0.;
\r
43 VV_Constant(1) = 1e5;
\r
47 //Initial field creation
\r
48 cout << "Building initial data" << endl;
\r
49 myProblem.setInitialFieldConstant(M,VV_Constant);
\r
51 //set the boundary conditions
\r
52 myProblem.setWallBoundaryCondition("Wall",wallVelocityX,wallVelocityY);
\r
53 myProblem.setInletPressureBoundaryCondition("inlet", inletAlpha, outletPressure);
\r
55 // set physical parameters
\r
56 myProblem.setGravity(gravite);
\r
58 // set the numerical method
\r
59 myProblem.setNumericalScheme(upwind, Explicit);
\r
62 string fileName = "2DInclinedSedimentation";
\r
64 // parameters calculation
\r
65 unsigned MaxNbOfTimeStep = 3 ;
\r
69 double precision = 1e-6;
\r
71 myProblem.setCFL(cfl);
\r
72 myProblem.setPrecision(precision);
\r
73 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
\r
74 myProblem.setTimeMax(maxTime);
\r
75 myProblem.setFreqSave(freqSave);
\r
76 myProblem.setFileName(fileName);
\r
77 myProblem.saveVelocity();
\r
80 myProblem.initialize();
\r
82 bool ok = myProblem.run();
\r
84 cout << "Simulation "<<fileName<<" is successful !" << endl;
\r
86 cout << "Simulation "<<fileName<<" failed ! " << endl;
\r
88 cout << "------------ End of calculation !!! -----------" << endl;
\r
89 myProblem.terminate();
\r
91 return EXIT_SUCCESS;
\r