7 def SinglePhase_3DHeatDrivenCavity():
10 #Preprocessing: mesh data
22 # set the limit field for each boundary
27 coldWallTemperature=563;
32 hotWallTemperature=613;
36 gravite = [0] * spaceDim
41 conductivite=[1000];#Wall heat transfert due to nucleate boiling.
44 myProblem = cf.SinglePhase(cf.Liquid,cf.around155bars600K,spaceDim);
45 nVar = myProblem.getNumberOfVariables();
47 #Initial field creation
48 print("Building initial data " );
50 # Prepare for the initial condition
52 VV_Constant = [0] * nVar
55 VV_Constant[0] = 155e5;
61 #Initial field creation
62 print("Setting mesh and initial data" );
63 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,xinf,xsup,nx,"hotWall","hotWall",yinf,ysup,ny,"hotWall","hotWall",zinf,zsup,nz, "hotWall", "coldWall");
65 # Set the boundary conditions
66 myProblem.setWallBoundaryCondition("coldWall", coldWallTemperature, coldWallVelocityX, coldWallVelocityY, coldWallVelocityZ);
67 myProblem.setWallBoundaryCondition("hotWall", hotWallTemperature, hotWallVelocityX, hotWallVelocityY, hotWallVelocityZ);
69 # set physical parameters
70 myProblem.setViscosity(viscosite);
71 myProblem.setConductivity(conductivite);
72 myProblem.setGravity(gravite);
74 # set the numerical method
75 myProblem.setNumericalScheme(cf.upwind, cf.Implicit);
76 myProblem.setLinearSolver(cf.GMRES,cf.ILU,True);
77 myProblem.setEntropicCorrection(False);
78 myProblem.setWellBalancedCorrection(False);
81 fileName = "3DHeatDrivenCavity";
83 # simulation parameters
90 myProblem.setCFL(cfl);
91 myProblem.setPrecision(precision);
92 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
93 myProblem.setTimeMax(maxTime);
94 myProblem.setFreqSave(freqSave);
95 myProblem.setFileName(fileName);
96 myProblem.setNewtonSolver(precision,50);
97 myProblem.saveConservativeField(True);
99 myProblem.saveVelocity();
103 myProblem.initialize();
105 ok = myProblem.run();
107 print( "Simulation python " + fileName + " is successful !" );
110 print( "Simulation python " + fileName + " failed ! " );
113 print( "------------ End of calculation !!! -----------" );
115 myProblem.terminate();
118 if __name__ == """__main__""":
119 SinglePhase_3DHeatDrivenCavity()