1 #include "SinglePhase.hxx"
6 int main(int argc, char** argv)
8 // preprocessing: mesh and group creation
9 cout << "Loading unstructured mesh for test SinglePhase_3DSphericalExplosion_unstructured()" << endl;
10 string inputfile="resources/meshCube.med";
20 M.setGroupAtPlan(xinf,0,eps,"GAUCHE");
21 M.setGroupAtPlan(xsup,0,eps,"DROITE");
22 M.setGroupAtPlan(yinf,1,eps,"ARRIERE");
23 M.setGroupAtPlan(ysup,1,eps,"AVANT");
24 M.setGroupAtPlan(zinf,2,eps,"BAS");
25 M.setGroupAtPlan(zsup,2,eps,"HAUT");
27 /* Initial field data */
31 Vector Center(3);//default value is (0,0,0)
32 Vector Vout(nVar), Vin(nVar);
45 SinglePhase myProblem(Gas,around1bar300K,spaceDim);
47 /*Setting mesh and Initial */
48 cout << "Setting initial data " << endl;
49 myProblem.setInitialFieldSphericalStepFunction( M, Vout, Vin, radius, Center);
51 //set the boundary conditions
52 double wallVelocityX=0;
53 double wallVelocityY=0;
54 double wallVelocityZ=0;
55 double wallTemperature=563;
56 myProblem.setWallBoundaryCondition("GAUCHE", wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
57 myProblem.setWallBoundaryCondition("DROITE", wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
58 myProblem.setWallBoundaryCondition("HAUT", wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
59 myProblem.setWallBoundaryCondition("BAS" , wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
60 myProblem.setWallBoundaryCondition("AVANT", wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
61 myProblem.setWallBoundaryCondition("ARRIERE" , wallTemperature, wallVelocityX, wallVelocityY, wallVelocityZ);
63 // set the numerical method
64 myProblem.setNumericalScheme(upwind, Explicit);
67 string fileName = "3DSphericalExplosion_unstructured";
69 // parameters calculation
70 unsigned MaxNbOfTimeStep = 3 ;
74 double precision = 1e-6;
76 myProblem.setCFL(cfl);
77 myProblem.setPrecision(precision);
78 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
79 myProblem.setTimeMax(maxTime);
80 myProblem.setFreqSave(freqSave);
81 myProblem.setFileName(fileName);
82 myProblem.setNewtonSolver(precision,20);
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();