1 #include "IsothermalTwoFluid.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);
28 vector<double> gravite(spaceDim,0.) ;
32 IsothermalTwoFluid myProblem(around1bar300K,spaceDim);
33 int nbPhase = myProblem.getNumberOfPhases();
34 int nVar = myProblem.getNumberOfVariables();
35 // Prepare for the initial condition
36 Vector VV_Constant(nVar);
45 //Initial field creation
46 cout << "Building initial data" << endl;
47 myProblem.setInitialFieldConstant(M,VV_Constant);
49 //set the boundary conditions
50 myProblem.setWallBoundaryCondition("Wall",wallVelocityX,wallVelocityY);
52 // set physical parameters
53 myProblem.setGravity(gravite);
55 // set the numerical method
56 myProblem.setNumericalScheme(upwind, Explicit);
59 string fileName = "2DInclinedSedimentation";
61 // parameters calculation
62 unsigned MaxNbOfTimeStep = 3 ;
66 double precision = 1e-6;
68 myProblem.setCFL(cfl);
69 myProblem.setPrecision(precision);
70 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
71 myProblem.setTimeMax(maxTime);
72 myProblem.setFreqSave(freqSave);
73 myProblem.setFileName(fileName);
74 myProblem.saveVelocity();
77 myProblem.initialize();
79 bool ok = myProblem.run();
81 cout << "Simulation "<<fileName<<" is successful !" << endl;
83 cout << "Simulation "<<fileName<<" failed ! " << endl;
85 cout << "------------ End of calculation !!! -----------" << endl;
86 myProblem.terminate();