7 def FiveEqsTwoFluid_2DInclinedBoilingChannel():
10 # Prepare for the mesh
18 # set the limit field for each boundary
29 gravite = [0] * spaceDim
36 myProblem = cf.FiveEqsTwoFluid(cf.around155bars600K,spaceDim);
37 nVar =myProblem.getNumberOfVariables();
39 # Prepare for the initial condition
43 VV_Constant[0] = inletVoidFraction;
44 VV_Constant[1] = outletPressure ;
45 VV_Constant[2] = inletVelocityX[0];
46 VV_Constant[3] = inletVelocityY[0];
47 VV_Constant[4] = inletVelocityX[1];
48 VV_Constant[5] = inletVelocityY[1];
49 VV_Constant[6] = inletTemperature ;
51 #Initial field creation
52 print("Building mesh and initial data " );
53 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,
54 xinf,xsup,nx,"wall","wall",
55 yinf,ysup,ny,"inlet","outlet",
58 # the boundary conditions
59 myProblem.setOutletBoundaryCondition("outlet", outletPressure);
60 myProblem.setInletBoundaryCondition("inlet", inletVoidFraction, inletTemperature, inletVelocityX, inletVelocityY);
61 myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);
63 # set physical parameters
64 myProblem.setHeatSource(heatPower);
65 myProblem.setGravity(gravite);
67 # set the numerical method
68 myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
69 myProblem.setLinearSolver(cf.GMRES,cf.ILU,True);
70 myProblem.setEntropicCorrection(True);
71 #myProblem.setWellBalancedCorrection(True);
74 fileName = "2DInclinedBoilingChannel";
76 # simulation parameters
83 myProblem.setCFL(cfl);
84 myProblem.setPrecision(precision);
85 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
86 myProblem.setTimeMax(maxTime);
87 myProblem.setFreqSave(freqSave);
88 myProblem.setFileName(fileName);
89 myProblem.setNewtonSolver(precision,20);
90 #myProblem.saveConservativeField(True);
92 myProblem.saveVelocity();
96 myProblem.initialize();
97 print("Running python "+ fileName );
101 print( "Simulation python " + fileName + " is successful !" );
104 print( "Simulation python " + fileName + " failed ! " );
107 print( "------------ End of calculation !!! -----------" );
109 myProblem.terminate();
112 if __name__ == """__main__""":
113 FiveEqsTwoFluid_2DInclinedBoilingChannel()