1 #include "SinglePhase.hxx"
6 int main(int argc, char** argv)
10 // Prepare for the mesh
18 // set the limit field for each boundary
19 double wallVelocityX=0;
20 double wallVelocityY=0;
21 double wallTemperature=573;
22 double inletVelocityX=0;
23 double inletVelocityY=0.5;
24 double inletTemperature=563;
25 double outletPressure=155e5;
28 vector<double> gravite (spaceDim);
35 SinglePhase myProblem(Liquid,around155bars600K,spaceDim);
36 int nVar =myProblem.getNumberOfVariables();
38 // Prepare for the initial condition
39 vector<double> VV_Constant (nVar);
42 VV_Constant[0] = outletPressure ;
43 VV_Constant[1] = inletVelocityX;
44 VV_Constant[2] = inletVelocityY;
45 VV_Constant[3] = inletTemperature ;
47 //Initial field creation
48 cout<<"Building initial data"<<endl;
49 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,
50 xinf,xsup,nx,"wall","wall",
51 yinf,ysup,ny,"inlet","outlet",
54 // the boundary conditions
55 vector<double>pressure_reference_point(2);
56 pressure_reference_point[0]=xsup;
57 pressure_reference_point[1]=ysup;
58 myProblem.setOutletBoundaryCondition("outlet", outletPressure,pressure_reference_point);
59 myProblem.setInletBoundaryCondition("inlet", inletTemperature, inletVelocityX, inletVelocityY);
60 myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);
62 // set physical parameters
63 myProblem.setHeatSource(heatPower);
64 myProblem.setGravity(gravite);
66 // set the numerical method
67 myProblem.setNumericalScheme(staggered, Implicit);
68 myProblem.setNonLinearFormulation(VFFC);
71 string fileName = "2DInclinedHeatedChannel";
73 /* set numerical parameters */
74 unsigned MaxNbOfTimeStep =3;
78 double precision = 1e-5;
80 myProblem.setCFL(cfl);
81 myProblem.setPrecision(precision);
82 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
83 myProblem.setTimeMax(maxTime);
84 myProblem.setFreqSave(freqSave);
85 myProblem.setFileName(fileName);
86 myProblem.usePrimitiveVarsInNewton(true);
90 myProblem.initialize();
94 cout << "Simulation "<<fileName<<" is successful !" << endl;
96 cout << "Simulation "<<fileName<<" failed ! " << endl;
98 cout << "------------ End of calculation -----------" << endl;
99 myProblem.terminate();