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
35 Field VV("Enthalpy", CELLS, M, 1);
\r
39 Vector VV_Constant(1);//initial enthalpy
\r
40 VV_Constant(0) = 1.3e6;
\r
42 cout << "Building the initial data " << endl;
\r
43 myProblem.setInitialFieldConstant(M,VV_Constant);
\r
45 //Set rod temperature and heat exchamge coefficient
\r
46 double rodTemp=623;//Rod clad temperature
\r
47 double heatTransfertCoeff=1000;//fluid/solid exchange coefficient
\r
48 myProblem.setRodTemperature(rodTemp);
\r
49 myProblem.setHeatTransfertCoeff(heatTransfertCoeff);
\r
51 //set the boundary conditions
\r
52 myProblem.setBoundaryFields(boundaryFields);
\r
54 // set the numerical method
\r
55 myProblem.setTimeScheme( Explicit);
\r
58 string fileName = "1DFluidEnthalpy";
\r
60 // parameters calculation
\r
61 unsigned MaxNbOfTimeStep =3;
\r
65 double precision = 1e-6;
\r
67 myProblem.setCFL(cfl);
\r
68 myProblem.setPrecision(precision);
\r
69 myProblem.setMaxNbOfTimeStep(MaxNbOfTimeStep);
\r
70 myProblem.setTimeMax(maxTime);
\r
71 myProblem.setFreqSave(freqSave);
\r
72 myProblem.setFileName(fileName);
\r
74 // set display option to monitor the calculation
\r
75 bool computation=true;
\r
77 myProblem.setVerbose( computation, system);
\r
78 myProblem.setSaveFileFormat(CSV);
\r
81 myProblem.initialize();
\r
82 bool ok = myProblem.run();
\r
84 cout << "Simulation "<<fileName<<" is successful !" << endl;
\r
86 cout << "Simulation "<<fileName<<" failed ! " << endl;
\r
88 cout << "------------ End of calculation -----------" << endl;
\r
89 myProblem.terminate();
\r
91 return EXIT_SUCCESS;
\r