1 #include "SinglePhase.hxx"
\r
2 #include "DriftModel.hxx"
\r
3 #include "FiveEqsTwoFluid.hxx"
\r
4 #include "IsothermalTwoFluid.hxx"
\r
5 #include "TransportEquation.hxx"
\r
6 #include "DiffusionEquation.hxx"
\r
10 using namespace std;
\r
16 // set the limit field for each boundary
\r
17 double wallVelocityX=0;
\r
18 double wallVelocityY=0;
\r
19 double wallTemperature=563;
\r
21 double inletConcentration=0;
\r
22 double inletVelocityX=0;
\r
23 double inletVelocityY=1;
\r
24 double inletTemperature=563;
\r
26 double outletPressure=155e5;
\r
28 // physical constants
\r
29 vector<double> gravite(spaceDim,0.) ;
\r
33 DriftModel myProblem(around155bars600K,spaceDim);
\r
34 int nVar = myProblem.getNumberOfVariables();
\r
36 //Prepare for the mesh
\r
44 // Prepare for the initial condition
\r
45 vector<double> VV_Constant(nVar);
\r
48 VV_Constant[1] = 155e5;
\r
51 VV_Constant[4] = 563;
\r
53 //Initial field creation
\r
54 cout << "Building initial data" << endl;
\r
55 myProblem.setVerbose(true);
\r
56 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"wall","wall",yinf,ysup,ny,"inlet","outlet");
\r
58 //set the boundary conditions
\r
59 vector<double>pressure_reference_point(2);
\r
60 pressure_reference_point[0]=xsup;
\r
61 pressure_reference_point[1]=ysup;
\r
62 myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point);
\r
63 myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletConcentration, inletVelocityX, inletVelocityY);
\r
64 myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);
\r
66 // set physical parameters
\r
67 myProblem.setGravity(gravite);
\r
69 // set the numerical method
\r
70 myProblem.setNumericalScheme(staggered, Implicit);
\r
71 myProblem.setWellBalancedCorrection(true);
\r
72 myProblem.setNonLinearFormulation(VFFC);
\r
74 // name of result file
\r
75 string fileName = "DriftModel_2DInclinedBoilingChannel";
\r
77 // computation parameters
\r
78 unsigned MaxNbOfTimeStep = 1 ;
\r
82 double precision = 1e-4;
\r
84 myProblem.setCFL(cfl);
\r
85 myProblem.setPrecision(precision);
\r
86 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
\r
87 myProblem.setTimeMax(maxTime);
\r
88 myProblem.setFreqSave(freqSave);
\r
89 myProblem.setFileName(fileName);
\r
90 myProblem.saveVelocity();
\r
91 myProblem.setNewtonSolver(precision,1);
\r
94 myProblem.initialize();
\r
96 bool ok = myProblem.run();
\r
98 cout << "Simulation "<<fileName<<" is successful !" << endl;
\r
100 cout << "Simulation "<<fileName<<" failed ! " << endl;
\r
102 cout << "------------ End of calculation !!! -----------" << endl;
\r
103 myProblem.terminate();
\r