7 def FiveEqsTwoFluid_2DInclinedSedimentation():
10 # Prepare for the mesh
18 # set the limit field for each boundary
23 # set the initial field
24 initialVoidFraction=0.5;
25 initialVelocityX=[0]*2;
26 initialVelocityY=[1]*2;
27 initialTemperature=573;
28 initialPressure=155e5;
31 gravite = [0] * spaceDim
36 myProblem = cf.FiveEqsTwoFluid(cf.around155bars600K,spaceDim);
37 nVar =myProblem.getNumberOfVariables();
39 # Prepare for the initial condition
43 VV_Constant[0] = initialVoidFraction;
44 VV_Constant[1] = initialPressure ;
45 VV_Constant[2] = initialVelocityX[0];
46 VV_Constant[3] = initialVelocityY[0];
47 VV_Constant[4] = initialVelocityX[1];
48 VV_Constant[5] = initialVelocityY[1];
49 VV_Constant[6] = initialTemperature ;
51 #Initial field creation
52 print("Building initial data " );
53 myProblem.setInitialFieldConstant(spaceDim,VV_Constant,
54 xinf,xsup,nx,"wall","wall",
55 yinf,ysup,ny,"wall","wall",
58 # the boundary conditions
59 myProblem.setWallBoundaryCondition("wall", wallTemperature, wallVelocityX, wallVelocityY);
61 # set physical parameters
62 myProblem.setGravity(gravite);
64 # set the numerical method
65 myProblem.setNumericalScheme(cf.upwind, cf.Explicit);
66 myProblem.setEntropicCorrection(True);
69 fileName = "2DInclinedSedimentation";
71 # simulation parameters
78 myProblem.setCFL(cfl);
79 myProblem.setPrecision(precision);
80 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
81 myProblem.setTimeMax(maxTime);
82 myProblem.setFreqSave(freqSave);
83 myProblem.setFileName(fileName);
84 myProblem.setNewtonSolver(precision,20);
85 myProblem.saveConservativeField(True);
87 myProblem.saveVelocity();
91 myProblem.initialize();
92 print("Running python "+ fileName );
96 print( "Simulation python " + fileName + " is successful !" );
99 print( "Simulation python " + fileName + " failed ! " );
102 print( "------------ End of calculation !!! -----------" );
104 myProblem.terminate();
107 if __name__ == """__main__""":
108 FiveEqsTwoFluid_2DInclinedSedimentation()