1 #include "DriftModel.hxx"
5 int main(int argc, char** argv)
9 // set the limit field for each boundary
10 double wallVelocityX=0;
11 double wallVelocityY=0;
12 double wallTemperature=563;
14 double inletConcentration=0;
15 double inletVelocityX=0;
16 double inletVelocityY=1;
17 double inletTemperature=563;
19 double outletPressure=155e5;
22 vector<double> gravite(spaceDim,0.) ;
27 DriftModel myProblem(around155bars600K,spaceDim);
28 int nVar = myProblem.getNumberOfVariables();
30 //Prepare for the mesh
38 // Prepare for the initial condition
39 vector<double> VV_Constant(nVar);
42 VV_Constant[1] = 155e5;
47 //Initial field creation
48 cout << "Building initial data" << endl;
49 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet");
51 //set the boundary conditions
52 vector<double>pressure_reference_point(2);
53 pressure_reference_point[0]=xsup;
54 pressure_reference_point[1]=ysup;
55 myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point);
56 myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY);
57 myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);
59 // set physical parameters
60 myProblem.setHeatSource(heatPower);
61 myProblem.setGravity(gravite);
63 // set the numerical method
64 myProblem.setNumericalScheme(upwind, Explicit);
65 myProblem.setWellBalancedCorrection(true);
67 // name of result file
68 string fileName = "DriftModel_2DInclinedBoilingChannel";
70 // computation parameters
71 unsigned MaxNbOfTimeStep = 3 ;
75 double precision = 1e-4;
77 myProblem.setCFL(cfl);
78 myProblem.setPrecision(precision);
79 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
80 myProblem.setTimeMax(maxTime);
81 myProblem.setFreqSave(freqSave);
82 myProblem.setFileName(fileName);
83 myProblem.saveVelocity();
86 myProblem.initialize();
88 bool ok = myProblem.run();
90 cout << "Simulation "<<fileName<<" is successful !" << endl;
92 cout << "Simulation "<<fileName<<" failed ! " << endl;
94 cout << "------------ End of calculation !!! -----------" << endl;
95 myProblem.terminate();