sunfluidh:sunfluidh_tutorials
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
sunfluidh:sunfluidh_tutorials [2017/09/29 16:28] – yann | sunfluidh:sunfluidh_tutorials [2020/01/30 11:31] (Version actuelle) – [Data setup] yann | ||
---|---|---|---|
Ligne 12: | Ligne 12: | ||
---- | ---- | ||
- | * [[ tuto1_fluidproperties |Data set on the fluid properties]] | + | |
- | * [[ tuto1_domainfeatures |Data set on the domain features]] | + | ===== Flow characteristics |
- | * [[ tuto1_fieldinit |Data set on physical quantity initialization over the domain]] | + | |
- | * [[ tuto1_forces |Data set on forces on the fluid]] | + | |
- | * [[ tuto1_boundaruconditionss |Data set on the boundary conditions]] | + | |
- | ===== Flow features | + | |
==== Description ==== | ==== Description ==== | ||
The computation is on a 2D heated back-facing step flow. The temperature of the bottom and top walls is imposed to $T_c$ and the temperature of the step walls is $T_h$. The inflow is fixed with an uniform velocity profile $U_b$ at temperature $Tc$. We consider an incompressible flow under the Boussinesq hypothesis : the physical properties are constant and the thermal buoyancy effect is modelised by the Boussinesq hypothesis : | The computation is on a 2D heated back-facing step flow. The temperature of the bottom and top walls is imposed to $T_c$ and the temperature of the step walls is $T_h$. The inflow is fixed with an uniform velocity profile $U_b$ at temperature $Tc$. We consider an incompressible flow under the Boussinesq hypothesis : the physical properties are constant and the thermal buoyancy effect is modelised by the Boussinesq hypothesis : | ||
$F_b= -\rho_0.\beta.g_0.(T - T_0)$ (see the page [[ Gravity_Namelist | Gravity ]] for more details). | $F_b= -\rho_0.\beta.g_0.(T - T_0)$ (see the page [[ Gravity_Namelist | Gravity ]] for more details). | ||
- | We suppose the fluid as a perfect gas. As a consequence, | + | We suppose the fluid is air that behaves |
{{ : | {{ : | ||
+ | |||
+ | __The governing equations for incompressible flows are shown [[sunfluidh: | ||
==== Dimensionless data ==== | ==== Dimensionless data ==== | ||
Ligne 53: | Ligne 51: | ||
===== Data setup ===== | ===== Data setup ===== | ||
+ | |||
+ | |||
We now build the data file by selecting the relevant namelists in the [[sunfluidh: | We now build the data file by selecting the relevant namelists in the [[sunfluidh: | ||
Ligne 58: | Ligne 58: | ||
We need to set : | We need to set : | ||
- | ==== The physical | + | * [[ tuto1_fluidproperties |Data set on the fluid properties]] |
+ | * [[ tuto1_domainfeatures |Data set on the computational domain]] | ||
+ | * [[ tuto1_fieldinit |Data set on physical quantity initialization over the domain]] | ||
+ | * [[ tuto1_forces |Data set on forces on the fluid]] | ||
+ | * [[ tuto1_boundaryconditions |Data set on the boundary conditions]] | ||
+ | * [[ tuto1_numericalmethods |Data set on the numerical methods]] | ||
+ | * [[ tuto1_simulationcontrol|Data set on the simulation control]] | ||
+ | * [[ tuto1_outputdata |Data set on the output data]] | ||
- | We report here the dimensionless data set about the fluid properties defined above. | + | < |
- | + | Boundary conditions can be difficult | |
- | & | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | < | + | |
- | The heat capacity of the fluid is not set here because unuseful. For incompressible flows without multi-species components, the enthalpy equation is reduced | + | |
- | For more examples about the fluid properties setting | + | |
</ | </ | ||
- | ==== Initialization of the velocity, temperature and density over the domain ==== | ||
- | |||
- | The fluid density is implicitly initialized with a uniform field because the fluid is incompressible and homogeneous. No data set is therefore required. | ||
- | |||
- | <note information> | ||
- | For initializing an incompressible bi-fluid flow, see the [[sunfluidh: | ||
- | For initialiazing a multi-components flow, see the [[sunfluidh: | ||
- | </ | ||
- | |||
- | The initial fluid temperature is uniform over the domain.\\ | ||
- | |||
- | & | ||
- | | ||
- | | ||
- | <note information> | ||
- | At present, only the uniform initialization of the temperature field is available unless the user creates its own initialization procedure in the fortran source file " | ||
- | </ | ||
- | The initial velocity field is defined by spreading out the inflow velocity profile. This choice allows us to ensure a perfect flowrate conservation between inflow and outflow for the first time step.\\ | ||
- | |||
- | |||
- | & | ||
- | J_Velocity_Reference_Value = 0.0 , | ||
- | K_Velocity_Reference_Value = 0.0 , | ||
- | Initial_Field_Option_For_Velocity_I = 3 , !--- the inflow velocity profile is spread out in the I-direction | ||
- | Initial_Field_Option_For_Velocity_J = 0 , !--- Initialization of the field with the default value | ||
- | Initial_Field_Option_For_Velocity_K = 0. /!--- Initialization of the field with the default value | ||
- | |||
- | <note information> | ||
- | The variables related to the white noise have been removed. \\ | ||
- | The velocity field initialization depends on the velocity profile defined in the namelist [[sunfluidh: | ||
- | For more examples about the velocity field initialization [[sunfluidh: | ||
- | </ | ||
- | |||
- | ==== Forces applied to the fluid ==== | ||
- | |||
- | Only the gravity is considered through the thermal buoyancy effect. The gravity force is oriented facing downward. | ||
- | |||
- | & | ||
- | Gravity_Angle_IJ= 0.0 , !--- {IJ} angle (in degree unit) | ||
- | Gravity_Angle_IK= 90.0 , | ||
- | Reference_Gravity_Constant= 1.D+00/ | ||
- | | ||
- | <note information> | ||
- | For more information on the gravity data set, see the [[sunfluidh: | ||
- | </ | ||
- | |||
- | ==== Domain configuration ==== | ||
- | |||
- | We here suppose a regular cartesian grid. | ||
- | We set the geometrical configuration, | ||
- | |||
- | === For a sequential computing === | ||
- | |||
- | & | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | <note important> | ||
- | Even though the geometry is 2D, the third direction must be set. Just one cell must be set for the K-direction. | ||
- | </ | ||
- | |||
- | |||
- | === For OpenMP or MPI parallel computing | ||
- | (__**Not for the release SUNFLUIDH_EDU**__).\\ | ||
- | The code SUNFLUIDH can perform OpenMP or MPI computing (if it has been compiled with the appropriate options, see [[sunfluidh: | ||
- | The user can configure a parallel computing from the data file by setting the appropriate variables of the previous namelist. All details for our example are given [[sunfluidh_tuto1_parallel_config | here]]. | ||
- | |||
- | |||
- | ==== Boundary conditions ==== | ||
- | |||
- | The problem gets different type of boundary conditions : | ||
- | * For the velocity : | ||
- | * Common wall boundary conditions : No slip and impermeable boundary conditions | ||
- | * Inflow boundary condition | ||
- | * Outflow boundary condition : mass flowrate conservation | ||
- | * For the heat transfer : | ||
- | * Wall boundary conditions | ||
- | * Inflow boundary condition | ||
- | * Outflow boundary condition : zero temperature gradient | ||
- | |||
- | === Wall boundary conditions === | ||
- | |||
- | The walls are associated with two different immersed bodies: | ||
- | * the domain ends which gets the top and bottom walls | ||
- | * the step | ||
- | The wall boundary conditions for the velocity are identical for every walls of the domain and they correspond to the wall boundary conditions stated by default in the code SUNFLUIH. As a consequence, | ||
- | The wall temperature are however different according to the immersed bodies cited above ($T_c*=1$ for the bottom and the top walls, $T_h*=2$ for the step walls). We must define two sets of boundary conditions for the temperature. | ||
- | |||
- | __Set 1 (for the walls of domain ends)__ : Only the data associated to the top (front) and bottom (back) walls are present, the other ones are useless as the corresponding walls are absent. | ||
- | |||
- | & | ||
- | Back_Heat_BC_Option | ||
- | Back_Heat_Function_Type = 0 , Front_Heat_Function_Type= 0 , !--- option value for defining a uniform value of T over the wall | ||
- | Back_Wall_BC_Value | ||
- | | ||
- | __Set 2 (for the walls of the step)___ : Only the data associated to the top (noted back for immersed bodies) and right (noted west for immersed bodies) walls are present, the other ones are useless as the corresponding walls have no role in the current problem. | ||
- | |||
- | & | ||
- | Back_Heat_BC_Option | ||
- | Back_Heat_Function_Type = 0 , East_Heat_Function_Type= 0 , !--- option value for defining a uniform value of T over the wall | ||
- | Back_Wall_BC_Value | ||
- | |||
- | We must now build the immersed bodies. \\ | ||
- | |||
- | On the walls of the domain ends : | ||
- | |||
- | This is already made. | ||
- | Keep in mind that the computational domain is enclosed by default. Walls are automatically placed at the domain ends by the code except when other boundary conditions are specified by the user (which are going to replace the walls). | ||
- | |||
- | For building the step : | ||
- | |||
- | & | ||
- | Xi_1= 0.0 , Xj_1= 0.0 ,Xk_1= 0.0 , !--- Coordinates of the 1st corner | ||
- | Xi_2= 2.0 , Xj_2= 0.0 ,Xk_2= 0.0 , !--- Coordinates of the 2nd corner | ||
- | Xi_3= 2.0 , Xj_3= 1.0 ,Xk_3= 0.0 , !--- Coordinates of the 3rd corner | ||
- | Xi_4= 0.0 , Xj_4= 1.0 ,Xk_4= 0.0 , !--- Coordinates of the 4th corner | ||
- | | ||
- | |||
- | <note important> | ||
- | Keep in mind : | ||
- | * By default, the first set of wall boundary conditions is always associated to walls placed at the domain ends (No ID value is needed) | ||
- | * For other immersed solid bodies, the ID value links the body walls with the set of wall boundary conditions that gets the same rank order in the data file (here, the 2nd set because Identifier_Value= 2). | ||
- | * Beware to the rule adopted for naming the walls (East, | ||
- | * For more information on the rules of construction [[sunfluidh: | ||
- | * For more details on the data setup of the wall boundary conditions | ||
- | * [[sunfluidh: | ||
- | * [[sunfluidh: | ||
- | * [[sunfluidh: | ||
- | * For more details on the data setup for building immersed solid bodies | ||
- | * [[sunfluidh: | ||
- | * [[sunfluidh: | ||
- | |||
- | </ | ||
- | |||
- | === Inlet boundary conditions === | ||
- | |||
- | |||
- | |||
- | The inflow conditions are uniform profiles of velocity ($U_b=1$) and temperature ($T_c= 1$). | ||
- | |||
- | & | ||
- | Type_of_BC | ||
- | Direction_Normal_Plan | ||
- | Plan_Location_Coordinate | ||
- | Start_Coordinate_of_First_Span = 1.0 , !--- Start coordinate of the inlet along the direction related to the 1st span (here J-direction, | ||
- | End_Coordinate_of_First_Span | ||
- | Start_Coordinate_of_Second_Span= 0.0 , !--- Start coordinate of the inlet along the direction related to the 2nd span (here K-direction) | ||
- | End_Coordinate_of_Second_Span | ||
- | Flow_Direction | ||
- | Define_Velocity_profile | ||
- | Normal_Velocity_Reference_Value= 1.0 , !--- Value of the normal velocity-component (here Ub= 1) , the other ones are null. | ||
- | Temperature_Reference_Value | ||
- | |||
- | <note important> | ||
- | |||
- | * The geometry of inlets is rectangular except when the domain is defined in cylindrical geometry (inlets fit the grid topology). | ||
- | * More details on the inlet data setup can be found [[sunfluidh: | ||
- | * Other examples can be found [[sunfluidh: | ||
- | </ | ||
- | |||
- | |||
- | === Outlet boundary conditions === | ||
- | |||
- | We here select usual outflow boundary conditions based on the flowrate conservation for treating the normal velocity component. The outflow boundary conditions other physical quantities are zero gradient | ||
- | |||
- | & | ||
- | Type_of_BC | ||
- | Direction_Normal_Plan | ||
- | Plan_Location_Coordinate | ||
- | Start_Coordinate_of_First_Span = 0.0 , !--- Start coordinate of the inlet along the direction related to the 1st span (here J-direction, | ||
- | End_Coordinate_of_First_Span | ||
- | Start_Coordinate_of_Second_Span= 0.0 , !--- Start coordinate of the inlet along the direction related to the 2nd span (here K-direction) | ||
- | End_Coordinate_of_Second_Span | ||
- | Flow_Direction | ||
- | | ||
- | |||
- | <note important> | ||
- | |||
- | * The geometry of outlets is rectangular except when the domain is defined in cylindrical geometry (outlets fit the grid topology). | ||
- | * More details on the outlet data setup can be found [[sunfluidh: | ||
- | * Other examples can be found [[sunfluidh: | ||
- | </ | ||
- | |||
- | === Border boundary condition === | ||
- | |||
- | The boundary conditions related to our example are already specified (walls, inflow, outflow conditions). No more boundary conditions must be defined. | ||
- | The namelist " | ||
- | |||
- | & | ||
- | West_Border= 0 , !--- Boundary conditions already defined for the left end of the domain (corresponding to the lower I-index) | ||
- | East_Border= 0 , !--- Boundary conditions already defined for the right end of the domain (corresponding to the upper I-index) | ||
- | Back_Border= 0 , !--- Boundary conditions already defined for the bottom end of the domain (corresponding to the lower J-index) | ||
- | Front_Border= 0 / !--- Boundary conditions already defined for the top end of the domain (corresponding to the upper J-index) | ||
- | |||
- | <note important> | ||
- | This dataset is used for specifying periodical or symmetrical boundary conditions at the domain ends.Click [[sunfluidh: | ||
- | </ | ||
- | |||
- | ==== Numerical Methods ==== | ||
- | |||
- | We remind the user the equations are solved with a projection method. The numerical methods used in the code SUNFLUIDH are commented in the [[sunfluidh: | ||
- | |||
- | For solving the conservation equations for velocity and temperature, | ||
- | * The spatial discretization for the convective flux is a 2nd order centered scheme (conservative form) | ||
- | * The spatial discretization for the viscous/ | ||
- | * The time discretization is a 2nd order Backward Differentiation Formula (semi-implicit method build on the viscous/ | ||
- | |||
- | The Poisson' | ||
- | The data setup is made with the following namelists : | ||
- | & | ||
- | MomentumConvection_Scheme=" | ||
- | TemperatureAdvection_Scheme=" | ||
- | Poisson_NumericalMethod=" | ||
- | | ||
- | As the used solver is a " | ||
- | |||
- | & | ||
- | Relaxation_Coefficient= 1.7 , !--- Relaxation coefficient of the SOR method ( 1 <= Relaxation_Coefficient < 2) | ||
- | Number_max_Grid= 5, !--- Number of grid levels | ||
- | Number_max_Cycle= 10, !--- Number of multigrid cycles | ||
- | Number_Iteration= 0, !--- Maximum number of SOR iterations method applied for any grid level, if 0 (or removed) the 3 next data are considered | ||
- | Number_Iteration_FineToCoarseGrid= 3, !--- number of SOR iterations applied on any grid level during the restriction step (before the coarsest grid computation) | ||
- | Number_Iteration_CoarseToFineGrid= 15, !--- number of SOR iterations applied on any grid level during the prolongation step (after the Coarsest grid computation) | ||
- | Number_Iteration_CoarsestGrid= 15 , !--- number of SOR iterations applied on the coarsest grid | ||
- | Convergence_Criterion= 1.D-08 / !--- convergence tolerance on the residu of the Poisson' | ||
- | |||
- | <note tip> | ||
- | |||
- | The SOR-multigrid method is efficient but the tuning of parameters can be delicate. Some tips are presented in order to help the user : | ||
- | * The maximum number of grid level is conditioned by the cell number of the finnest grid. The grid coarsening consists in dividing by two the cell number along each direction. The minimum number of cells on the coarsest grid is two per direction. | ||
- | * The relaxation coefficient can improve the convergence efficiency but beware of the numerical instabilities. The choice of the relaxation coefficient depends on the problem. The maximum value are about $1.8$ and the minimum value is $1$. | ||
- | * The red-black algorithm is able to keep the same solution accuracy in parallel computing regardless of the domain decomposition. It can be seen as the combination of Jacobi and Gauss-Seidel methods. As the consequence, | ||
- | * It could be useful to set the number of SOR iterations to different values for each part of a V-cycle of the multigrid method in order to reduce the total number of operations. Some numerical experiments are shown that only few SOR iterations could be sufficient during the restriction step. A fine setting of the iteration number can improve the performance of the code. | ||
- | * Beware of the maximum number of multigrid cycles. more larger is this number more longer is the CPU time consuming if the convergence is too slow. Its maximum value is generally approximately 10. Beyond this value, it could be useful to try something else. | ||
- | * Do not forget the purpose on solving the Poisson' | ||
- | </ | ||
- | |||
- | <note important> | ||
- | Other numerical methods are available for solving the conservation equations as well as the Poisson' | ||
- | </ | ||
- | |||
- | ==== Simulation control data set ===== | ||
- | |||
- | We here resort to a specific namelist named " | ||
- | We specify here some parameters in order to define the numerical time step as well as stop criteria and recording rates related to backup and check files. | ||
- | Two examples are given. | ||
- | The first one corresponds to a simulation starting at t= 0 with a variable time step. | ||
- | |||
- | |||
- | & | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | The second example corresponds to a restart of the previous simulation with a uniform time step. | ||
- | |||
- | & | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | |||
- | For more information on this data set, [[sunfluidh: | ||
- | |||
- | <note important> | ||
- | Keep in mind the time step must be chosen with caution because it can generate numerical instabilities when it is too much large. The numerical stability depends on the property of the numerical methods used for solving the conservation equations It often relies on the CFL criterion which have not to exceeded a reference value. This value depends on the numerical scheme properties as well as the computational problem. | ||
- | * For semi-implicit schemes proposed here, a maximum CFL-value about 0.5 is generally prescribed for usual computations, | ||
- | * For explicit schemes, the CFL criterion also depends on the viscous/ | ||
- | When the time-step value is constant, the user can verify if the CFL criterion is respected by checking regularly the file checkcalc_xxxxx.d | ||
- | </ | ||
- | |||
- | ==== Output data ==== | ||
- | |||
- | Here we show an example of usual data acquisition : | ||
- | |||
- | * Instantaneous fields | ||
- | * Statistical fields | ||
- | * Time series from probes located at specific positions | ||
- | |||
- | The various parameters related to each type of output data are originally splitted by topic in the appropriate namelist. For a sake of clarity, they are directly regrouped for each type of output data as shown here : | ||
- | |||
- | For instantaneous fields | ||
- | |||
- | & | ||
- | & | ||
- | & | ||
- | & | ||
- | & | ||
- | & | ||
- | & | ||
- | |||
- | For statistical fields | ||
- | |||
- | & | ||
- | Time_Range_Statistic_Calculation = 1.D+00 | ||
- | When it has been covered, the results are recorded and a new statistical computation starts again | ||
- | & | ||
- | | ||
- | | ||
- | | ||
- | & | ||
- | & | ||
- | & | ||
- | |||
- | For time-series from probes | ||
- | | ||
- | & | ||
- | & | ||
- | & | ||
- | & | ||
- | |||
- | <note important> | ||
- | |||
- | Any information about these namelist are available here : | ||
- | * [[Simulation_Management_Setup_Namelist|Simulation_Management]] | ||
- | * [[Field_Recording_Setup_Namelist_Setup|Field_Recording_Setup]] | ||
- | * [[Instantaneous_Fields_Listing_Namelist_Setup|Instantaneous_Fields_Listing]] | ||
- | * [[Statistical_Fields_Listing_Namelist_Setup|Statistical_Fields_Listing]] | ||
- | * [[Probe_Quantities_Enabled_Setup_Namelist|Probe_Quantities_Enabled]] | ||
- | * [[Probe_Location_Setup_Namelist|Probe_Location]] | ||
- | </ |
sunfluidh/sunfluidh_tutorials.1506695297.txt.gz · Dernière modification : 2017/09/29 16:28 de yann