6 def FiveEqsTwoFluid_1DBoilingChannel():
14 # set the limit field for each boundary
24 myProblem = cf.FiveEqsTwoFluid(cf.around155bars600K,spaceDim);
25 nVar = myProblem.getNumberOfVariables();
27 # Prepare for the initial condition
28 VV_Constant =[0]*nVar;
31 VV_Constant[0] = inletVoidFraction;
32 VV_Constant[1] = outletPressure ;
33 VV_Constant[2] = inletVelocityX[0];
34 VV_Constant[3] = inletVelocityX[1];
35 VV_Constant[4] = inletTemperature ;
38 #Initial field creation
39 print("Building mesh and initial data " );
40 myProblem.setInitialFieldConstant( spaceDim, VV_Constant, xinf, xsup, nx,"inlet","outlet");
42 # set the boundary conditions
43 myProblem.setInletBoundaryCondition("inlet",inletVoidFraction,inletTemperature,inletVelocityX)
44 myProblem.setOutletBoundaryCondition("outlet", outletPressure);
46 # set physical parameters
47 myProblem.setHeatSource(heatPower);
49 # set the numerical method
50 myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
51 myProblem.setEntropicCorrection(True);
52 myProblem.setWellBalancedCorrection(True);
55 fileName = "1DBoilingChannel";
57 # simulation parameters
64 myProblem.setCFL(cfl);
65 myProblem.setPrecision(precision);
66 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
67 myProblem.setTimeMax(maxTime);
68 myProblem.setFreqSave(freqSave);
69 myProblem.setFileName(fileName);
70 myProblem.setNewtonSolver(precision,20);
71 #myProblem.saveConservativeField(True);
73 myProblem.saveVelocity();
77 myProblem.initialize();
78 print("Running python "+ fileName );
82 print( "Simulation python " + fileName + " is successful !" );
85 print( "Simulation python " + fileName + " failed ! " );
88 print( "------------ End of calculation !!! -----------" );
90 myProblem.terminate();
93 if __name__ == """__main__""":
94 FiveEqsTwoFluid_1DBoilingChannel()