1 #include "TransportEquation.hxx"
\r
6 int main(int argc, char** argv)
\r
8 //Preprocessing: mesh and group creation
\r
12 cout << "Building a 1D mesh with "<<nx<<" cells" << endl;
\r
13 Mesh M(xinf,xsup,nx);
\r
15 M.setGroupAtPlan(xsup,0,eps,"Neumann");
\r
16 M.setGroupAtPlan(xinf,0,eps,"Inlet");
\r
17 int spaceDim = M.getSpaceDimension();
\r
19 // Boundary conditions
\r
20 map<string, LimitFieldTransport> boundaryFields;
\r
22 LimitFieldTransport limitNeumann;
\r
23 limitNeumann.bcType=NeumannTransport;
\r
24 boundaryFields["Neumann"] = limitNeumann;
\r
26 LimitFieldTransport limitInlet;
\r
27 limitInlet.bcType=InletTransport;
\r
28 limitInlet.h =1.3e6;//Inlet water enthalpy
\r
29 boundaryFields["Inlet"] = limitInlet;
\r
31 //Set the fluid transport velocity
\r
32 vector<double> transportVelocity(1,5);//fluid velocity vector
\r
34 TransportEquation myProblem(Water,around155bars600K,transportVelocity);
\r
37 Vector VV_Constant(1);//initial enthalpy
\r
38 VV_Constant(0) = 1.3e6;
\r
40 cout << "Building the initial data " << endl;
\r
41 myProblem.setInitialFieldConstant(M,VV_Constant);
\r
43 //Set rod temperature and heat exchamge coefficient
\r
44 double rodTemp=623;//Rod clad temperature
\r
45 double heatTransfertCoeff=1000;//fluid/solid exchange coefficient
\r
46 myProblem.setRodTemperature(rodTemp);
\r
47 myProblem.setHeatTransfertCoeff(heatTransfertCoeff);
\r
49 //set the boundary conditions
\r
50 myProblem.setBoundaryFields(boundaryFields);
\r
52 // set the numerical method
\r
53 myProblem.setTimeScheme( Explicit);
\r
56 string fileName = "1DFluidEnthalpy";
\r
58 // parameters calculation
\r
59 unsigned MaxNbOfTimeStep =3;
\r
63 double precision = 1e-6;
\r
65 myProblem.setCFL(cfl);
\r
66 myProblem.setPrecision(precision);
\r
67 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
\r
68 myProblem.setTimeMax(maxTime);
\r
69 myProblem.setFreqSave(freqSave);
\r
70 myProblem.setFileName(fileName);
\r
72 // set display option to monitor the calculation
\r
73 bool computation=true;
\r
75 myProblem.setVerbose( computation, system);
\r
76 myProblem.setSaveFileFormat(CSV);
\r
79 myProblem.initialize();
\r
80 bool ok = myProblem.run();
\r
82 cout << "Simulation "<<fileName<<" is successful !" << endl;
\r
84 cout << "Simulation "<<fileName<<" failed ! " << endl;
\r
86 cout << "------------ End of calculation -----------" << endl;
\r
87 myProblem.terminate();
\r
89 return EXIT_SUCCESS;
\r