]> SALOME platform Git repositories - tools/solverlab.git/blob - CoreFlows/Documentation/functionalities.md
Salome HOME
Improved message display
[tools/solverlab.git] / CoreFlows / Documentation / functionalities.md
1 Available functionalities  
2 ===========================
3
4 Meshes
5 ------
6
7 The simulation requires a mesh $M$ that can be defined either
8
9 - using the [CDMATH-Toolbox](https://github.com/ndjinga/CDMATH) structured mesh constructor Mesh $M(xmin,xmax,nx)$
10 - loading a [MED](https://www.salome-platform.org/user-section/about/med) file generated by [SALOME](https://www.salome-platform.org/) platform Mesh $M$ (''  filename '')
11
12 All the boundary faces of the mesh sould be gathered into groups of FACES that will be used to set boundary conditions. These groups of faces can be set
13 - using the [CDMATH-Toolbox](https://github.com/ndjinga/CDMATH) face group generator \a M.setGroupAtPlan(value,direction,tolerance,groupName), where direction is an integer with value $0$ for the plane $x=value$, $1$ for the plane $y=value$ and $2$ for the plane $z=value$
14 - using [SALOME](https://www.salome-platform.org/) platform when generating the [MED](https://www.salome-platform.org/user-section/about/med) file
15
16
17 Initial data and power fields
18 -----------------------------
19
20 The initial data and power fields can be defined on the simulation mesh using the Field class of [CDMATH-Toolbox](https://github.com/ndjinga/CDMATH) either
21 - starting from a null field using the command Field(fieldname,ON\_CELLS,numberOfComponents), then setting the values on cell $i$ for each component  $j$ with the command $F(i,j)=fij$
22 - loading a field stored in a [MED](https://www.salome-platform.org/user-section/about/med) file using the command Field(filename,ON\_CELLS, filename)
23
24 The initial data should in general be a vector field containing parameters that are specific to each model
25 - [SinglePhase](../Models/inc/SinglePhase.hxx) : $(p, \vec{v}, T)$, ie pressure, velocity, temperature
26 - [DriftModel](../Models/inc/DriftModel.hxx) : $(c_g, p, \vec{v}, T)$, ie phase 1 concentration, pressure, velocity, temperature
27 - [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx) : $(\alpha_g, p,\vec{v}_g,\vec{v}_l)$, ie phase 1 void fraction, pressure, phase 1 velocity, phase 2 velocity
28 - [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx) : $(\alpha_g, p,\vec{v}_g,\vec{v}_l,T)$, ie phase 1 void fraction, pressure, phase 1 velocity, phase 2 velocity, common temperature
29 - [TransportEquation](../Models/inc/TransportEquation.hxx) : $h$ the fluid enthalpy 
30 - [DiffusionEquation](../Models/inc/DiffusionEquation.hxx) : $T$ the solid temperature
31
32 Whatever the model chosen, the initial data is set with the function ProblemCoreFlows::setInitialField (initialField), and the heat power field is set with the function ProblemCoreFlows::setHeatSource(heatPower) for a constant uniform value or the function ProblemCoreFlows::setHeatSourceField(heatPowerField) for a variable power field.
33
34 Models
35 ------
36
37 The model can be set as
38
39 - [SinglePhase](../Models/inc/SinglePhase.hxx)::SinglePhase ( \ref fluidType, \ref pressureEstimate,spaceDimension) where \ref fluidType is either  \ref Liquid or \ref Steam, and \ref pressureEstimate is \ref around1bar300K or \ref around155bars600K
40 - [DriftModel](../Models/inc/DriftModel.hxx)::DriftModel (\ref pressureEstimate,spaceDimension) where  pressureEstimate is \ref around1bar300K or \ref around155bars600K
41 - [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx)::IsothermalTwoFluid (\ref pressureEstimate,spaceDimension) where  pressureEstimate is \ref around1bar300K or \ref around155bars600K
42 - [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)::FiveEqsTwoFluid (\ref pressureEstimate,spaceDimension) where  pressureEstimate is \ref around1bar300K or \ref around155bars600K
43 - [TransportEquation](../Models/inc/TransportEquation.hxx)::TransportEquation (\ref fluidType, \ref pressureEstimate ,$\vec v$) where \ref fluidType is either  \ref Liquid or \ref Steam, \ref pressureEstimate is \ref around1bar300K or \ref around155bars600K and$\vec v$ is the velocity vector assumed constant and of type vector<double>
44 - [DiffusionEquation](../Models/inc/DiffusionEquation.hxx)::DiffusionEquation (spaceDim,$ \rho, c_p,\lambda$) where $\rho$ is the solid density, $c_p$ its specific heat and $\lambda$ its conductivity with default values set for Uranirum
45
46 Physical options
47 ----------------
48
49 The following physical parameters have default value zero but can be set by the user:
50
51 - In order to set a constant heat source : ProblemCoreFlows::setHeatSource($ heatSource $) where heat source is a double
52 - In order to set the viscosities : ProblemFluid::setViscosity($ viscosite $ ) where viscosite is a $vector<double>$ of size nbPhases
53 - In order to set the conductivities : ProblemFluid::setConductivity ($ conductivite$ ) where conductivite is a $vector<double>$ of size nbPhases
54 - In order to set the gravity : ProblemFluid::setGravity($ gravite$ ) where gravite is a $vector<double>$ of size spaceDim
55 - In order to set the friction coefficients : ProblemFluid::setDragCoeffs($ dragCoeffs$ ) where dragCoeffs is a $vector<double>$ containing the friction coefficients between fluid and solid in a porous approach for [SinglePhase](../Models/inc/SinglePhase.hxx) (one coefficient) and [DriftModel](../Models/inc/DriftModel.hxx) (two coefficients), or interfacial friction between the two phases for [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx) (one coefficient) and [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx) (one coefficient)
56 - In order to set the heat transfert coefficient between fluid and solid in a porous flow ProblemCoreFlows::setHeatTransfertCoeff (heatCoeff)
57
58 Numerical options
59 -----------------
60
61 - The nonlinear formulation can be \ref Roe, \ref VFRoe or \ref VFFC and is set by the method ProblemFluid::setNonLinearFormulation(\ref NonLinearFormulation)
62 - The time discretisation can be \ref Explicit or \ref Implicit, and the space discretisation can be \ref upwind, \ref lowMach, \ref pressureCorrection, \ref staggered or \ref centered. The space and time discretisations can be set using the command ProblemCoreFlows::setNumericalScheme( \ref upwind ,  \ref Explicit ); or ProblemCoreFlows::setNumericalScheme( \ref centered ,  \ref Implicit); for instance. 
63 - Advanced options can be set to enforce a well balanced scheme with ProblemFluid::setWellBalancedCorrection or an entropic scheme  with ProblemFluid::setEntropicCorrection.
64 - In order to set the cfl number: ProblemCoreFlows::setCFL($ cfl $ );
65 - In order to set the tolerance number  : ProblemCoreFlows::setPrecision($ precision $ );
66 - In order to set the maximum number of time steps : ProblemCoreFlows::setMaxNbOfTimeStep($ MaxNbOfTimeStep$ );
67 - In order to set the maximum time of the computation : ProblemCoreFlows::setTimeMax($ maxTime$);
68 - In order to set the linear solver and preconditioner : ProblemCoreFlows::setLinearSolver(\ref GMRES, \ref ILU ).
69 The usual linear solvers are [GMRES](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPGMRES.html) and [BICGSTAB](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPBCGS.html), and the usual "preconditionners" are [ILU](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCILU.html) and [LU](https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCLU.html).
70
71
72 Boundary conditions
73 -------------------
74
75 For the numerical treatment of the boundaries, it is important that each boundary (Group in Salome vocabulary) be assigned a \ref BoundaryType.
76
77 Boundary types can be 
78
79 - \ref Wall
80       + simply set with the function [SinglePhase](../Models/inc/SinglePhase.hxx)::setWallBoundaryCondition, [DriftModel](../Models/inc/DriftModel.hxx)::setWallBoundaryCondition, [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx)::setWallBoundaryCondition, [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)::setWallBoundaryCondition
81       + possible for all fluid models : [SinglePhase](../Models/inc/SinglePhase.hxx), [DriftModel](../Models/inc/DriftModel.hxx), [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx), [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)
82 - \ref Neumann
83       + simply set with the function ProblemCoreFlows::setNeumannBoundaryCondition
84       + possible for all models
85 - \ref Inlet
86       + simply set with the functions [SinglePhase](../Models/inc/SinglePhase.hxx)::setInletBoundaryCondition, [SinglePhase](../Models/inc/SinglePhase.hxx)::setInletBoundaryCondition, [DriftModel](../Models/inc/DriftModel.hxx)::setInletBoundaryCondition, [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx)::setInletBoundaryCondition, [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)::setInletBoundaryCondition or [TransportEquation](../Models/inc/TransportEquation.hxx)::setInletBoundaryCondition
87       + possible for [TransportEquation](../Models/inc/TransportEquation.hxx), [SinglePhase](../Models/inc/SinglePhase.hxx), [DriftModel](../Models/inc/DriftModel.hxx), [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx), [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)
88 - \ref Outlet
89       + simply set with the command ProblemFluid::setOutletBoundaryCondition
90       + possible for all fluid models : [SinglePhase](../Models/inc/SinglePhase.hxx), [DriftModel](../Models/inc/DriftModel.hxx), [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx), [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx)
91 - \ref Dirichlet
92       + simply set with the command [DiffusionEquation](../Models/inc/DiffusionEquation.hxx)::setDirichletBoundaryCondition
93       + possible for [DiffusionEquation](../Models/inc/DiffusionEquation.hxx)
94
95 The former way to set the boundary conditions was to create a C++ map $map<string, LimitField> boundaryFields$ that associates the boundary name to a field. Once the map is filled with the appropriate content, the boundary conditions are set with the command ProblemCoreFlows::setBoundaryFields(boundaryFields).
96 The LimitField structure is specific to each model and each type of boundary condition.
97 - for a Neumann boundary condition :  LimitField limitNeumann; limitNeumann.bcType=Neumann;
98
99 - for an Inlet boundary condition (not possible for [DiffusionEquation](../Models/inc/DiffusionEquation.hxx)): LimitField limitInlet; limitInlet.bcType=Inlet; then
100       + For [TransportEquation](../Models/inc/TransportEquation.hxx): 
101                 - limitInlet.h=1.3e6
102       + For [SinglePhase](../Models/inc/SinglePhase.hxx) (3D case):
103           - limitInlet.T = 600; 
104           - limitInlet.v\_x = $vector<double>(1,0)$;
105           - limitInlet.v\_y = $vector<double>(1,0)$;
106           - limitInlet.v\_z = $vector<double>(1,0)$; 
107
108      + For [DriftModel](../Models/inc/DriftModel.hxx) (3D case):
109           - limitInlet.c=0;     
110           - limitInlet.T = 600; 
111           - limitInlet.v\_x = $vector<double>(1,0)$;
112           - limitInlet.v\_y = $vector<double>(1,0)$;
113           - limitInlet.v\_z = $vector<double>(1,0)$;
114
115      + For [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx) Model (3D case):  
116           - limitInlet.alpha=0; 
117           - limitInlet.v\_x = $vector<double>(2,0)$;
118           - limitInlet.v\_y = $vector<double>(2,0)$;    
119           - limitInlet.v\_z = $vector<double>(2,0)$;
120
121      + For [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx) (3D case):              
122           - limitInlet.alpha=0; 
123           - limitInlet.T = 600; 
124           - limitInlet.v\_x = $vector<double>(2,0)$;    
125           - limitInlet.v\_y = $vector<double>(2,0)$;    
126           - limitInlet.v\_z = $vector<double>(2,0)$; 
127
128      + then boundaryFields['' \a Inlet'']= limitInlet;  
129
130 - for an Outlet boundary condition (for fluid models): LimitField limitOutlet; limitOutlet.bcType=Outlet; then
131       + For all fluid models ([SinglePhase](../Models/inc/SinglePhase.hxx), [DriftModel](../Models/inc/DriftModel.hxx), [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx), [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx):               
132           - limitOutlet.p = 155e5;
133       + then boundaryFields[''\a outlet'']= limitOutlet;
134       
135 - for a Wall with friction and/or heat conduction : LimitField limitWall; limitWall.bcType=Wall; then
136       + For [SinglePhase](../Models/inc/SinglePhase.hxx) (3D case): 
137           - limitWall.T = 600;  
138           - limitWall.v\_x = $vector<double>(1,0)$;     
139           - limitWall.v\_y = $vector<double>(1,0)$;     
140           - limitWall.v\_z = $vector<double>(1,0)$;
141       + For [DriftModel](../Models/inc/DriftModel.hxx) (3D case):               
142           - limitWall.T = 600;  
143           - limitWall.v\_x = $vector<double>(1,0)$;     
144           - limitWall.v\_y = $vector<double>(1,0)$;     
145           - limitWall.v\_z = $vector<double>(1,0)$;
146       + For [IsothermalTwoFluid](../Models/inc/IsothermalTwoFluid.hxx) Model (3D case): 
147           - limitWall.v\_x = $vector<double>(2,0)$;
148           - limitWall.v\_y = $vector<double>(2,0)$;
149           - limitWall.v\_z = $vector<double>(2,0)$;
150       + For [FiveEqsTwoFluid](../Models/inc/FiveEqsTwoFluid.hxx) (3D case):             
151           - limitWall.T = 600;
152           - limitWall.v\_x = $vector<double>(2,0)$;     
153           - limitWall.v\_y = $vector<double>(2,0)$;     
154           - limitWall.v\_z = $vector<double>(2,0)$;     
155       + Then boundaryFields['' \a Wall '']= limitWall;  
156
157 - for a Dirichlet boundary condition (only for [DiffusionEquation](../Models/inc/DiffusionEquation.hxx)) : LimitField limitDirichlet; limitDirichlet.bcType=Dirichlet; then
158         - limitDirichlet.T = 600; 
159         - boundaryFields['' \a Dirichlet'']= limitDirichlet; 
160
161