8 def SinglePhase_2DSphericalExplosion_HEXAGON():
10 inputfile="./meshHexagonWithTriangles300.med";
11 my_mesh=cdmath.Mesh(inputfile);
17 Center=cdmath.Vector(spaceDim);#default value is (0,0,0)
18 Vout=cdmath.Vector(nVar)
19 Vin =cdmath.Vector(nVar)
29 myProblem = cf.SinglePhase(cf.Liquid,cf.around155bars600K,spaceDim);
31 # Initial field creation
32 print ("Setting mesh and initial data" ) ;
33 myProblem.setInitialFieldSphericalStepFunction( my_mesh, Vout, Vin, radius, Center);
35 # set the boundary conditions
40 myProblem.setWallBoundaryCondition("boundaries", wallTemperature, wallVelocityX, wallVelocityY);
42 # set the numerical method
43 myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
46 fileName = "2DSphericalExplosion_HEXAGON";
48 # parameters calculation
49 MaxNbOfTimeStep = 3000 ;
55 myProblem.setCFL(cfl);
56 myProblem.setPrecision(precision);
57 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
58 myProblem.setTimeMax(maxTime);
59 myProblem.setFreqSave(freqSave);
60 myProblem.setFileName(fileName);
61 myProblem.setNewtonSolver(precision,20);
62 myProblem.saveConservativeField(False);
64 myProblem.saveVelocity();
69 myProblem.initialize();
73 print( "Simulation python " + fileName + " is successful !" );
76 print( "Simulation python " + fileName + " failed ! " );
79 print( "------------ End of calculation !!! -----------" );
81 myProblem.terminate();
84 if __name__ == """__main__""":
85 SinglePhase_2DSphericalExplosion_HEXAGON()