diff --git a/_data/tutorials.yml b/_data/tutorials.yml index c421b760..06106357 100644 --- a/_data/tutorials.yml +++ b/_data/tutorials.yml @@ -28,6 +28,8 @@ - Inc_Laminar_Cavity - Inc_Streamwise_Periodic - Inc_Species_Transport + - Inc_Species_Transport_Composition_Dependent_Model + - Inc_Turbulent_Bend - title: Structural Mechanics tutorials: diff --git a/_docs_v7/Markers-and-BC.md b/_docs_v7/Markers-and-BC.md index b4667551..d4c925ec 100755 --- a/_docs_v7/Markers-and-BC.md +++ b/_docs_v7/Markers-and-BC.md @@ -131,14 +131,19 @@ MARKER_FAR= (farfield) | --- | --- | | `RANS`, `INC_RANS`, | 7.3.0 | -The turbulence boundary conditions do not have a `MARKER_` keyword but can instead be set for inlet and freestream boundaries using the keywords: +The turbulence boundary conditions do not have a `MARKER_` keyword for the SA Turbulence model but can instead be set for inlet and freestream boundaries using the keyword: -For the SA turbulence model: ``` FREESTREAM_NU_FACTOR= 3 ``` -For the SST turbulence model: +Conversely, for the SST turbulence model, it is possible to provide a 'MARKER_INLET' where turbulence intensity and turbulent-to-laminar ratio can be provided at each inlet as follows: + +``` +MARKER_INLET_TURBULENT= (inlet_1, TURBULENCEINTENSITY_1, TURB2LAMVISCRATIO_1 , inlet_2, TURBULENCEINTENSITY_1, TURB2LAMVISCRATIO_1 ,..) +``` +If 'MARKER_INLET_TURBULENT' are not provided in the .cfg file, SU2 will filled up the markers with the freestream options: + ``` FREESTREAM_TURBULENCEINTENSITY= 0.05 FREESTREAM_TURB2LAMVISCRATIO= 10 diff --git a/_docs_v7/Physical-Definition.md b/_docs_v7/Physical-Definition.md index 39440704..f834c419 100644 --- a/_docs_v7/Physical-Definition.md +++ b/_docs_v7/Physical-Definition.md @@ -9,6 +9,7 @@ SU2 offers different ways of setting and computing this definition. This documen --- +- [Fluid Model](#fluid-model) - [Reference Values](#reference-values) - [Free-Stream Definition (Compressible)](#free-stream-definition-compressible) - [Thermodynamic State](#thermodynamic-state) @@ -28,6 +29,29 @@ SU2 offers different ways of setting and computing this definition. This documen --- +## Fluid Model ## + +| Solver | Version | +| --- | --- | +| `EULER`, `NAVIER_STOKES`, `RANS`, `NEMO_EULER`, `NEMO_NAVIER_STOKES`, `INC_EULER`, `INC_NAVIER_STOKES`, `INC_RANS`, `FEM_EULER`, `FEM_NAVIER_STOKES` | 7.0.0 | + +For fluid simulations, a model defining the equation of state and thermodynamic properties of the fluid or mixture is required. This is selected using the `FLUID_MODEL` option in the config. Available fluid models in SU2 include: + +| Option Value | Description | +|---|---| +|`STANDARD_AIR` | **Air model with ideal gas EOS** | +|`IDEAL_GAS` | **Arbitrary fluid with ideal gas EOS** | +|`VW_GAS` | **Arbitrary fluid with Vander-Waals EOS** | +|`PR_GAS` | **Arbitrary fluid with Peng-Robinson EOS** | +|`CONSTANT_DENSITY` | **Constant density** | +|`INC_IDEAL_GAS` | **Incompressible fluid constant specific heat** | +|`INC_IDEAL_GAS_POLY` | **Incompressible fluid polynomial specific heat** | +|`FLUID_MIXTURE` | **Incompressible ideal gas mixing laws for multicomponent flow** | +|`SU2_NONEQ` | **SU2 nonequilibrium thermochemical library** | +|`MUTATIONPP` | **Mutation++ nonequilibrium thermochemical library** | + +Some fluid models require the specification of additional parameters, with the full set of required options available in the configuration file template. + ## Reference Values ## | Solver | Version | diff --git a/_docs_v7/Solver-Setup.md b/_docs_v7/Solver-Setup.md index 5089e0f4..65a0c996 100644 --- a/_docs_v7/Solver-Setup.md +++ b/_docs_v7/Solver-Setup.md @@ -8,7 +8,6 @@ This is a basic introduction on how to set up a simulation using SU2. We disting --- - [Defining the Problem](#defining-the-problem) - - [Specifying a Fluid Model](#specifying-a-fluid-model) - [Restarting the simulation](#restarting-the-simulation) - [Controlling the simulation](#controlling-the-simulation) - [Time-dependent Simulation](#time-dependent-simulation) @@ -45,24 +44,6 @@ SU2 is capable of dealing with different kinds of physical problems. The kind of Every solver has its specific options and we refer to the tutorial cases for more information. However, the basic controls detailed in the remainder of this page are the same for all problems. -## Specifying a Fluid Model ## - -For fluid simulations, a model defining the equation of state and thermodynamic properties of the fluid or mixture is required. This is selected using the `FLUID_MODEL` option in the config. Available fluid models in SU2 include: - -| Option Value | Description | -|---|---| -|`STANDARD_AIR` | **Air model with ideal gas EOS** | -|`IDEAL_GAS` | **Arbitrary fluid with ideal gas EOS** | -|`VW_GAS` | **Arbitrary fluid with Vander-Waals EOS** | -|`PR_GAS` | **Arbitrary fluid with Peng-Robinson EOS** | -|`CONSTANT_DENSITY` | **Constant density** | -|`INC_IDEAL_GAS` | **Incompressible ideal gas** | -|`INC_IDEAL_GAS_POLY` | **Incompressible ideal gas** | -|`SU2_NONEQ` | **SU2 nonequilibrium thermochemical library** | -|`MUTATIONPP` | **Mutation++ nonequilibrium thermochemical library** | - -Some fluid models require the specification of additional parameters, with the full set of required options available in the configuration file template. - ## Restarting the simulation ## | Solver | Version | diff --git a/_tutorials/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/Inc_Species_Transport_Composition_Dependent_Model.md b/_tutorials/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/Inc_Species_Transport_Composition_Dependent_Model.md new file mode 100644 index 00000000..c937c4e0 --- /dev/null +++ b/_tutorials/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/Inc_Species_Transport_Composition_Dependent_Model.md @@ -0,0 +1,233 @@ +--- +title: Composition-Dependent model for Species Transport equations +permalink: /tutorials/Inc_Species_Transport_Composition_Dependent_Model/ +written_by: Cristopher-Morales +for_version: 7.5.0 +revised_by: +revision_date: +revised_version: +solver: INC_RANS +requires: SU2_CFD +complexity: intermediate +follows: Inc_Species_Transport +--- + + +## Goals + +In this tutorial, the user will be familiar with the composition-dependent model in SU2 based on the Ideal Gas law for a gas mixture. The necessary steps and configuration options for the aforementioned model will be explained through a 3D incompressible kenics static mixer for a methane-air mixture. + +## Resources + +The resources for this tutorial can be found in the [incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model) directory in the [tutorial repository](https://github.com/su2code/Tutorials). To complete this tutorial, you will need the configuration file ([kenics_mixer_tutorial.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/kenics_mixer_tutorial.cfg)) and the mesh file ([kenics.su2](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/kenics.su2)). + +The mesh is created using [gmsh](https://gmsh.info/) and a respective `.geo` script is available to recreate/modify the mesh [kenics_mixer_tutorial.geo](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/kenics_mixer_tutorial.geo). The mesh consists of 128790 volume elements and 138324 points. + +![Mesh with boundary conditions](../../tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/mesh_tutorial.png) +Figure (1): Computational mesh (top figure) and 2D cross-section view with color markers showing the boundary conditions and geometry (bottom figure). + +## Prerequisites + +The following tutorial assumes you have already compiled `SU2_CFD` in serial or parallel, please see the [Download](/docs_v7/Download/) and [Installation](/docs_v7/Installation/). Likewise, it is advised to perform the tutorial regarding species transport in a venturi mixer([Inc_Species_Transport](/tutorials/Inc_Species_Transport/)) where the species transport options are explained, as this tutorial mainly focuses on the composition-dependent options. + +## Background + +The geometry consists of a Static Kenics mixer with three blades, all the blades are perpendicular to each other, and are twisted 180 degrees along the z-axis in order to enhance the mixing. Furthermore, two inlets are considered, where pure air and pure methane are injected at each inlet. Finally, one outlet is considered at the end of the mixer device. + + +## Problem Setup + +In this problem, we investigate the flow and mixing along the kenic static mixer. Thus, we have the following boundary conditions at the inlets and outlet: + +- Equal Inlet Velocities (constant) = 5 m/s in normal direction (z-direction) +- Outlet Pressure (constant) = 0 Pa +- Inlet Temperature (both inlets) = 300 K +- Adiabatic walls. + +In this case, the energy equation is switched `OFF` as we consider two streams with the same temperature and adiabatic walls. + +The SST turbulence model is used with default settings of freestream turbulence intensity of 5% and turbulent-to-laminar viscosity ratio of 10. However, in order to highlight the new option available in SU2 of having different turbulence intensities and turbulent-to-laminar viscosity ratios, these will be given as marker inlets for turbulence that will be explained in the following section. + +The thermochemical properties for each gas are given below: +* Methane: + - Molecular Weight = 16.043 [g / mol] + - Viscosity: 1.1102E-05 [kg /(m s)] + - Heat capacity at constant pressure: 2224.43 [J/(kg K)] + - Thermal Conductivity: 0.0357 [W /(m K)] +* Air: + - Molecular Weight = 28.960 [g / mol] + - Viscosity: 1.8551E-05 [kg /(m s)] + - Heat capacity at constant pressure: 1009.39 [J/(kg K)] + - Thermal Conductivity: 0.0258 [W /(m K)] + +The species mass fractions at each inlet are the following: + +- Inlet_gas: mass fraction methane, Y_CH4 = 1.0 (pure methane, Y_air=0.0) +- Inlet_air: mass fraction methane, Y_CH4 = 0.0 (pure air, Y_air=1.0) + +It should be noted that within SU2, for a mixture of N species, N-1 species transport equations are solved and, the last species is computed as $$1-\sum Y_i$$. Thus, in this tutorial, a transport equation for methane is being solved. For more information, please see [Theory](/docs_v7/Theory/). + +## Configuration File Options + +All available options concerning species transport are listed in the [config_template.cfg](https://github.com/su2code/SU2/blob/master/config_template.cfg).Here, we are going to focus on the composition-dependent options. + +For activating the composition-dependent model, the fluid model must be chosen as `FLUID_MODEL= FLUID_MIXTURE`. It must be noted that this model is only compatible with `INC_DENSITY_MODEL= VARIABLE`. Otherwise, an error message will be displayed during runtime. + +A low-mach number approximation for incompressible flows allows the pressure to be decomposed into dynamic and thermodynamic (operating) pressure (see [Theory](/docs_v7/Theory/). The operating pressure is used for computing the mixture density using the Ideal gas law. The thermodynamic pressure might strongly affect the density at the inlets, causing unphysical results. Therefore, the thermodynamic pressure must be provided by the user for the `FLUID_MIXTURE` model and, it is no longer computed from the free-stream conditions as it is done in the other fluid models. As in mixing and combustion processes, the operating pressure is often assumed as 101325 pa, then this is the default value considered inside SU2 if the thermodynamic pressure is not given in the .cfg file. In the.cfg file, the thermodynamic pressure is specified as `THERMODYNAMIC_PRESSURE= 101325.0`. + +Subsequently, the molecular weights and heat capacities at constant pressure must be provided as a list as follows: `MOLECULAR_WEIGHT= W_1, W_2,...., W_N` , `SPECIFIC_HEAT_CP = Cp_1, Cp_2,..., Cp_N`. The length of the list must match the number of the N species in the mixture. Moreover, the mean molecular weight is computed as a mole fraction average, and the mixture heat capacity is computed as a mass fraction average. For more information, please see $$^{1},^{3}$$. + +For the conductivity model, the following options are available: `CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY, CONSTANT_PRANDTL, POLYNOMIAL_CONDUCTIVITY `. In this tutorial, the option `CONSTANT_CONDUCTIVITY` is used. For this option, a constant conductivity for each species must be provided as follows: `THERMAL_CONDUCTIVITY_CONSTANT= k_1, k_2,...., k_N`. +Currently, the only mixing law available in SU2 for computing the mixture thermal conductivity is based on the Wilke mixing law. Therefore, this is the default option, and it is hardcoded for the `FLUID_MIXTURE` option. For more information regarding this mixing model, please see $$^{1},^{2}$$. + +Similar treatment is done for the laminar Prandtl numbers: `PRANDTL_LAM= Pr_1, Pr_2,....,Pr_N`. Finally, for turbulence simulations, the option of turbulent Prandlt number can be enabled as `TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB`. If this option is enabled, the turbulent Prandtl numbers must have the same structure as the Laminar Prandtl numbers: `PRANDTL_TURB= Pr_Turb_1, Pr_Turb_2, ..., Pr_Turb_N`. For more information about laminar and turbulent Prandlt numbers, please see [Theory](/docs_v7/Theory/). + +For the present tutorial, the options are given below: + +``` +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_MIXTURE +% Thermodynamics(operating) Pressure (101325 Pa default value, only for incompressible flow and FLUID_MIXTURE) +THERMODYNAMIC_PRESSURE= 101325.0 +% +MOLECULAR_WEIGHT= 16.043, 28.960 +% +SPECIFIC_HEAT_CP = 2224.43, 1009.39 +% +CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY +THERMAL_CONDUCTIVITY_CONSTANT= 0.0357, 0.0258 +% +PRANDTL_LAM= 0.72, 0.72 +% +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90, 0.90 +``` + +Regarding the viscosity model, the following options are available `VISCOSITY_MODEL= SUTHERLAND, CONSTANT_VISCOSITY, POLYNOMIAL_VISCOSITY`. In the case of `CONSTANT_VISCOSITY`, the viscosities must be provided as a list as follows: `MU_CONSTANT= mu_1, mu_2, ..., mu_N`. Similarly, if `SUTHERLAND` model is chosen, the Sutherland parameters must be given as a list for each species in the mixture. For completeness, an example for SUTHERLAND option is shown below for a mixture of two species: + +``` +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= SUTHERLAND +% +MU_REF= 1.118E-05, 1.716E-05 +% +MU_T_REF= 273, 273 +% +SUTHERLAND_CONSTANT= 97, 111 +``` + +For this tutorial, as the energy equation is not being solved, we use `CONSTANT_VISCOSITY` as the viscosity model. Finally, for computing the mixture viscosity, two models are available in SU2: Wilke and Davidson Models. They can be enabled using the following option: `MIXING_VISCOSITY_MODEL = WILKE, DAVIDSON`. Please see $$^{2},^{4}$$ for more information on these models.. +The options used in this tutorial are shown below: + +``` +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +MU_CONSTANT= 1.1102E-05, 1.8551E-05 +% +MIXING_VISCOSITY_MODEL = WILKE +``` + +The Species transport is switched on by setting `KIND_SCALAR_MODEL= SPECIES_TRANSPORT`. For the mass diffusivity, the following models are available `DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY, CONSTANT_SCHMIDT, UNITY_LEWIS, CONSTANT_LEWIS` , where `CONSTANT_DIFFUSIVITY` is the default model. For the first two, a constant value must be specified in the.cfg file for all species, as it is done in the species transport tutorial [Inc_Species_Transport](/tutorials/Inc_Species_Transport/). For the UNITY_LEWIS, no values must be provided because the diffusivity is computed using the mixture thermal conductivity, density and heat capacity at constant pressure; for more information, please see $^{3}$. For highly diffusive gases, such as hydrogen, the `CONSTANT_LEWIS` option could be used. For this option, the Lewis numbers of the N-1 species for which a transport equation is being solved must be provided as a list using the option `CONSTANT_LEWIS_NUMBER= Le_1, Le_2, ..., Le_N_1`. Finally, for turbulent simulations, the turbulent diffusivity is computed based on the `SCHMIDT_NUMBER_TURBULENT`. For reference, please consult [the respective theory](/docs_v7/Theory/#species-transport). + +Finally, for the SST model, it is possible to provide the intensity and turbulent-to-laminar viscosity ratios per inlet. For this option, we use the following structure: `MARKER_INLET_TURBULENT= (inlet_1, TurbIntensity_1, TurbLamViscRatio_1, inlet_2, TurbIntensity_2, TurbLamViscRatio_2, ...)`. + +As final remarks, the option `SPECIES_USE_STRONG_BC` is advised to be set to `NO` when the convective scheme for species and turbulent are `CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR` and `CONV_NUM_METHOD_TURB= BOUNDED_SCALAR`, respectively. When `SCALAR_UPWIND` is used in both cases, the `SPECIES_USE_STRONG_BC` is advised to be switched to `YES` to enforce boundary conditions and improve convergence for this convective scheme. The convective scheme `BOUNDED_SCALAR` will be further explained in the section [Convective-Schemes](/docs_v7/Convective-Schemes/). + +Likewise, `SPECIES_CLIPPING= NO` is only recommended when the option `SCALAR_UPWIND` is used. The option `BOUNDED_SCALAR` performs well without using the clipping option. + +The other species transport options can be found in the species transport tutorial([Inc_Species_Transport](/tutorials/Inc_Species_Transport/)). + +For completeness, the options aforementioned are shown below: + +``` +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( inner_wall, 0.0,blade_1, 0.0, blade_2, 0.0, blade_3, 0.0, outer_wall,0.0) +% +SPECIFIED_INLET_PROFILE= NO +% +INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET +MARKER_INLET= ( inlet_gas, 300, 5.0, 0.0, 0.0, 1.0, inlet_air, 300, 5.0, 0.0, 0.0, 1.0 ) +SPECIES_USE_STRONG_BC= NO +MARKER_INLET_SPECIES= (inlet_gas, 1.0, inlet_air, 0.0 ) +% +MARKER_INLET_TURBULENT= (inlet_gas, 0.05, 10, inlet_air, 0.05, 10) +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) +% +% --------------------- SPECIES TRANSPORT SIMULATION --------------------------% +% +% Specify scalar transport model (NONE, SPECIES_TRANSPORT) +KIND_SCALAR_MODEL= SPECIES_TRANSPORT +% +% Mass diffusivity model (CONSTANT_DIFFUSIVITY) +DIFFUSIVITY_MODEL= UNITY_LEWIS +% +% Turbulent Schmidt number of mass diffusion +SCHMIDT_NUMBER_TURBULENT= 0.7 +% +% Convective numerical method for species transport (SCALAR_UPWIND, BOUNDED_SCALAR) +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +% +% Monotonic Upwind Scheme for Conservation Laws (TVD) in the species equations. +% Required for 2nd order upwind schemes (NO, YES) +MUSCL_SPECIES= NO +% +% Slope limiter for species equations (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, BARTH_JESPERSEN, VAN_ALBADA_EDGE) +SLOPE_LIMITER_SPECIES = NONE +% +% Time discretization for species equations (EULER_IMPLICIT, EULER_EXPLICIT) +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +% Initial values for scalar transport +SPECIES_INIT= 1.0 +% +% Activate clipping for scalar transport equations +SPECIES_CLIPPING= NO +``` + +## Running SU2 + +The simulation can be run in serial using the following command: +``` +$ SU2_CFD kenics_mixer_tutorial.cfg +``` +or in parallel with your preferred number of cores (for this case, it is recommended to use 4 cores in order to speed up the simulation): +``` +$ mpirun -n <#cores> SU2_CFD kenics_mixer_tutorial.cfg +``` + +## Results + +This case shows a smooth convergence and does not have the flat residuals observed in the [Inc_Species_Transport](/tutorials/Inc_Species_Transport/). + +![Residual plot](../../tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/residuals.png) +Figure (2): Residual plot (Incompressible mean flow, SST turbulence model, species transport). + +We observe that using the option `CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR` addressed the unphysical mass fraction fluctuations observed in the tutorial ([Inc_Species_Transport](/tutorials/Inc_Species_Transport/)). Similarly, it can be noted how the mixing process is enhanced by the mixer units. + +![Species Mass Fraction](../../tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/species_profiles.png) +Figure (3): Mass fractions of methane at the different locations along the Kenics static mixer. + +Velocity magnitude along the Kenics static mixers. + +![Velocity Magnitude](../../tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/velocity_profiles.png) +Figure (4): Velocity magnitude at different locations along the Kenics static mixer. + +The plots are cross sections of the mixing device at the following locations: 0.04, 0.09, 0.1067, 0.1133, 0.1267, 0.1333, 0.18 and 0.24 m. + +### References +$$^{1}$$ B. Poling, J. Prausnitz, J. O’Connell, The Properties of Gases and Liquids, 5th Edition, McGraw-Hill Education,2000.(URL https://books.google.nl/books?id=9tGclC3ZRX0C) + +$$^{2}$$ C. R. Wilke, A viscosity equation for gas mixtures, The Journal of Chemical Physics 18 (4) (1950),517–519.(https:doi:10.1063/1.1747673). + +$$^{3}$$ T. Poinsot, D. Veynante, Theoretical and Numerical Combustion, Ch. 1, 2012. + +$$^{4}$$ T. A. Davidson, A simple and accurate method for calculating viscosity of gaseous mixtures. (URL https://www.osti.gov/biblio/6129940) + + +## Additional remarks diff --git a/_tutorials/incompressible_flow/Inc_Turbulent_Bend/Inc_Turbulent_Bend.md b/_tutorials/incompressible_flow/Inc_Turbulent_Bend/Inc_Turbulent_Bend.md new file mode 100644 index 00000000..3e76ac58 --- /dev/null +++ b/_tutorials/incompressible_flow/Inc_Turbulent_Bend/Inc_Turbulent_Bend.md @@ -0,0 +1,177 @@ +--- +title: Turbulent Bend with wall functions +permalink: /tutorials/Inc_Turbulent_Bend/ +written_by: Nijso Beishuizen +for_version: 7.4.0 +revised_by: +revision_date: +revised_version: +solver: INC_RANS +requires: SU2_CFD +complexity: intermediate +follows: Inc_Turbulent_Flat_Plate +--- + +![Turb Bend Setup](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/yplus_001_3Dshot_with_mesh.png) + +Figure (1): impression of the 90 degree bend with velocity contours. + +## Goals + +In this tutorial we will simulate the turbulent flow in a 90 degree pipe bend. We will touch upon the following aspects: +- the mesh generation in the meshing tool gmsh +- the setup of the model in SU2, using wall functions with the SST turbulence model +- creating a more suitable inlet profile from the solution with uniform inlet conditions +- postprocessing the results with python and paraview + + +## Resources + +The resources for this tutorial can be found in the [incompressible_flow/Inc_Turbulent_Bend_Wallfunctions](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions) directory in the [tutorial repository](https://github.com/su2code/Tutorials). You will need the configuration file ([sudo.cfg](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/sudo.cfg)) and the mesh file ([sudo.su2](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/sudo.su2)). Additionally, the Gmsh geometry is also provided so you can recreate the mesh yourself: [sudo_coarse.geo](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/sudo_coarse.geo). + + +## Tutorial + +The following tutorial will briefly introduce the mesh generation with the meshing software [gmsh](https://gmsh.info/), which is a great tool especially for structured mesh generation. The test case will then be set up, using wall functions to avoid the use of very fine meshes. The postprocessing with paraview will be briefly introduced, where we do a quick check to see if the solution looks right, and then perform some data extraction for comparison with measurements. + +### Background + +The turbulent flow though the 90 degree circular pipe bend can be seen in Figure 1 and is characterized by 3 flow phenomena that we will try to capture. First of all, the turbulent flow separates in the bend. The exact location depends on the Reynolds number and the radius of curvature of the bend. Secondly, the flow re-attaches after the bend and finally, two counter-rotating vortices are formed after the bend, called Dean vortices. This particular geometry was studied experimentally by Sudo, Sumida and Hibara (*Experiments in Fluids* 25, 1998) [doi](https://doi.org/10.1007/s003480050206) and simulation results can be found in Dutta, Saha, Nandi and Pal (*Eng. Science Technol.* 19(2), 2016) [doi](https://doi.org/10.1016/j.jestch.2015.12.005). + +### Problem Setup + +The configuration is a 90 degree bend with a diameter of D=0.104 m and a radius of curvature of 2D=0.208 m. We make use of the horizontal symmetry plane and only simulate the upper half of the pipe. The Reynolds number based on pipe diameter is 60,000, which corresponds to a mean velocity of 8.7 m/s. A straight section of L=5D is attached before and a section of L=10D is attached after the bend. Uniform velocity and turbulence boundary conditions are applied at the inlet. The entry length of 5L is not sufficient for turbulence to fully develop and in the experimental setup, the entry and exit lengths were 100D and 40D. This means that the flow conditions that we impose at the inlet are not the actual, fully developed turbulent flow profiles that were present in the experiment. However, This can be solved by first performing a simulation with uniform inlet conditions and then restarting the simulation with an imposed profile for all the transported variables. The inlet profile can be created with paraview from the CFD solution by extracting the solution at 4D downstream of the inlet, where the flow is already partially developed. + +### Mesh Description + +The mesh consists of a structured mesh with 70k cells and 75k points. The mesh was created using Gmsh and the configuration file to create the mesh can be found here: [sudo_coarse.geo](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/sudo_coarse.geo). The only thing you need to do to create a mesh from the geometry is start Gmsh, and then load the .geo file. You will then see the geometry in the Gmsh visualization window. If you click on *Mesh->3D* the 3D mesh will be generated. You can then export the mesh as a .su2 file by choosing *File->Export*. The mesh will automatically be saved in su2 format when the filename has the extension .su2. In general, you should not choose *save all elements* because this will also save additional points that were used to construct the geometry but are not part of the final mesh, like for example the center of a circle. + +![Turb sudo Mesh](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/Screenshot_gmsh.png) + +Figure (2): Mesh generated by Gmsh, showing the cross-sectional block structured mesh. + +### Configuration File Options + +Several of the key configuration file options for this simulation are highlighted here. First, we activate the turbulence model: + +``` +% ------------- direct, adjoint, and linearized problem definition ------------% +% +SOLVER= INC_RANS +INC_NONDIM= DIMENSIONAL +KIND_TURB_MODEL= SST +SST_OPTIONS= V2003m +``` + +We use the incompressible RANS solver to activate the turbulence model and we then choose the SST turbulence model, using the `SST_OPTIONS= V2003m` variant. + +``` +INC_INLET_TYPE= VELOCITY_INLET +INC_OUTLET_TYPE= PRESSURE_OUTLET +``` + +The inlet boundary is a velocity inlet and the outlet boundary is a pressure outlet. + +``` +MARKER_HEATFLUX= ( wall_1, 0.0, wall_2,0.0, wall_bend,0.0) +MARKER_INLET= ( inlet, 300.0, 8.7, 0.0, 0.0, 1.0 ) +MARKER_OUTLET= ( outlet, 0.0) +MARKER_SYM= ( symmetry_1, symmetry_bend, symmetry_2 ) +MARKER_INLET_TURBULENT= (inlet, 0.10, 100.0) +``` + +There is no heat transfer, so we set zero heatflux boundary conditions on the walls and we impose a velocity of 8.7 m/s, corresponding to the experiment of *Sudo et al.* The outlet pressure is set to 0 Pa. With the keyword **MARKER_INLET_TURBULENT**, we set the inlet turbulent intensity and the viscosity ratio. Now we are ready to set up the wall function model: + +``` +MARKER_WALL_FUNCTIONS= ( wall_1, STANDARD_WALL_FUNCTION, wall_2,STANDARD_WALL_FUNCTION, wall_bend, STANDARD_WALL_FUNCTION ) +WALLMODEL_KAPPA= 0.41 +WALLMODEL_B= 5.5 +WALLMODEL_MINYPLUS= 1.0 +WALLMODEL_MAXITER= 200 +WALLMODEL_RELFAC= 0.5 +``` + +We activate the wall functions with a single option **MARKER_WALL_FUNCTIONS**. At this moment, the only wall function that you can use is the **STANDARD_WALL_FUNCTION**. Setting **MARKER_WALL_FUNCTIONS** is sufficient to set up the wall function model, but there are 5 additional expert options that you can set as well. The constant kappa is interpreted as the von Karman constant and is usually chosen as 0.41. The integration constant B is chosen as 5.5. The minimum value of y+ where the wall function is switched off because the mesh is fine enough to be considered fully resolved is 1.0. A value of 5.0 is the default value chosen in the paper of *Nichols and Nelson (2004)*, but lower values are also possible. Note that Spalding's fit gives us the nondimensional velocity and therefore the wall shear stress in the entire boundary layer. +An iterative process (Newton's method) is used to compute the nondimensional velocity u+ from y+. The maximum number of iterations chosen here is 200, which is usually more than sufficient. The relaxation factor chosen for the Newton method is 0.5. If you see messages appearing like this: + +```Warning: computation of wall coefficients (y+) did not converge in 56 points``` + +you can either let the computations continue until the warning messages disappear, increase the maximum number of iterations or decrease the relaxation factor. If these measures do not help, then the problem is most probably due to the mesh quality or due to the physics (flow separation). + +### Running SU2 + +If possible, always use a parallel setup to increase computational time. Run the SU2_CFD executable in parallel using MPI and 4 nodes by entering + + $ mpirun -n 4 SU2_CFD sudo.cfg + +Your results should converge in around 1000 iterations. + +### Results + +![Turb Bend velocities](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/turb_bend_velocities.png) +Figure (3): Velocity contour with location of the slices where experimental values were obtained. + +The paraview multiblock file can now be visualized, and the result is shown in Figure (3). Shown is the velocity magnitude on the horizontal symmetry plane together with a number of contour plots at several vertical locations in the bend. + +## Part 2 : restart with an inlet profile + +In the experiment, the pipe bend was preceded by a very long straight pipe section with a length of 100D, ensuring that the turbulent flow is fully developed by the time it arrives at the pipe bend. In our simulations, we have only a straight section with a total length of 5D and constant inlet properties. We will now restart the simulation with an inlet profile that we extract from a slice of the pipe. It is a planar slice with the normal in the Z-direction, located at Z=2.5D from the inlet. Because in a multiblock mesh, nodes are duplicated on the boundary, so we first perform an *Extract Block* and select only the interior nodes. We then apply the slice on this extracted block. To keep the original quadrilateral cells, we de-select the option *triangulate slice*. Also make sure that the option *Merge duplicated points in the slice* is selected. In the information tab, you should see that the number points is 618, and we will check later that this corresponds with the number of nodes that SU2 expects in the inlet boundary file. +Now save the slice data, making sure that only the slice is selected in the Pipeline Browser. Choose the .csv file format, and choose as _Arrays To Write_ only the variables *Omega*, *Pressure*, *Velocity* and *Turb_Kin_Energy*. The point coordinates are automatically saved. Also choose scientific notation with precision "6" to make sure that you have enough digits for the accurate interpolation of the inlet profile. A simple pvpython script is provided in the tutorials folder here: [paraview_extract_slice_data.py](https://github.com/su2code/Tutorials/tree/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/paraview_extract_slice_data.py). This is a python script that you can run with paraview's pvpython command and it will generate an inlet.csv file for you : + +``` +$ pvpython paraview_extract_slice_data.py +``` + + + +With python, matlab or a simple *awk* command it is easy to put the data in the correct format for the SU2 inlet profile. The awk command below reads the file *inlet.csv*, it assumes that the comma acts as a separator, it skips the first line (the header), and then prints the necessary columns and outputs it in the file inlet_test. We want symmetric data in the y-axis, so we check if the y-coordinate in column 2 is positive, and then we write this data for positive and negative y-coordinates. We write the data into the file *inlet_test*. + +``` +awk -F ',' '(NR>1) {if ($2>0.0) {printf ("%8f \t %8f \t %8f \t %6f \t %6f \t %6f \t %f \t %6f \t %6f \t %6f\n ", -$2,$3,-0.52,300.0, $9, 0.0, 0.0, 1.0, $6, $1);printf ("%8f \t %8f \t %8f \t %6f \t %6f \t %6f \t %f \t %6f \t %6f \t %6f\n ", $2,$3,-0.52,300.0, $9, 0.0, 0.0, 1.0, $6, $1)}}' inlet.csv > inlet_data +``` + + + +Now we setup SU2 to use an inlet boundary file. We change some configuration options. Locate and change the following options in the file: + +``` +RESTART_SOL= YES +SPECIFIED_INLET_PROFILE= YES +INLET_FILENAME= inlet.dat +``` + + + +The solution was saved as *restart.dat* and the filename used for the restart is named *solution.dat* (locate the option for the filenames in the config file!). You can simply copy the *restart.dat* file to *solution.dat* and restart the simulation with the above options. If you restart and the file *inlet.dat* is not present, SU2 will stop with the message + +``` Looked for: inlet.dat.``` +```Created a template profile file with default values named example_inlet.dat``` +```You can use this file as a guide for making your own profile specification.``` + +You will now have an example inlet profile saved in the file *example_inlet.dat*. You can now check that this file has 618 rows of data, for each of the nodes on the inlet plane. We only need the header (the first 5 lines of the file), so you can open the file, copy the first 5 lines, open the file *inlet_data* and add the 5 lines to the top of the file. You can now save this file as *inlet.dat* and restart the simulation. + +### Results + +We will now compare the simulation results of the pipe bend with results from the paper of *Sudo et al.* Some velocity measurements were performed at several locations in the pipe bend, and the location that we will use for comparison are shown in the figure below. + +![Turb Bend velocities](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/bend_with_slice_locations.png) + +Figure (4): Pipe bend showing the location of the slices that will be used for comparison with measurements. + +Below are some of the contour plots taken at several locations in the pipe, showing the velocity normal to the plane with the isocontours in black. The top half are the simulation results and the bottom half are the experimental results from *Sudo et al (1998)*. We see that the main flow features are captured in the simulation. + +![Turb Bend Contour1](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_1.png) + +![Turb Bend contour2](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_2.png) + +Figure (5): mean flow velocities in several pipe cross sections. + +A paraview script to extract the slices data as individual contour plots one by one can be found here: [extract_contours_sudo_bend.py](https://github.com/su2code/Tutorials/blob/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/extract_contours_sudo_bend.py). + +Below is a comparison of the axial velocity on the horizontal symmetry line through the vertical plane at $$\phi=90^0$$. The flow separation in the bend is difficult to capture correctly, and it leads to an underestimation of the local velocity near the inner radius of the bend. + +![Turb Bend lineplot](../../tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sudo_phi90_lineplot.png) + +Figure (6): velocity on the symmetry line in the vertical planar cross-section at $$\phi=90^0$$. + +The paraview script to extract the line data as a .csv file can be found here: [paraview_extract_linedata.py](https://github.com/su2code/Tutorials/blob/master/incompressible_flow/Inc_Turbulent_Bend_Wallfunctions/paraview_extract_linedata.py) diff --git a/_tutorials/index.md b/_tutorials/index.md index 55e4c60b..53ddb1bf 100644 --- a/_tutorials/index.md +++ b/_tutorials/index.md @@ -69,6 +69,10 @@ Simulation of internal, laminar, incompressible flow in a differentially-heated Simulation of internal, turbulent, incompressible flow in a unit cell of a 2D pin-fin heat exchanger. * [Species Transport](/tutorials/Inc_Species_Transport/) Simulation of internal, turbulent, incompressible flow through a mixing channel. +* [Species Transport Composition Dependent Model](/tutorials/Inc_Species_Transport_Composition_Dependent_Model/) +Simulation of internal, turbulent, 3D incompressible flow through a Kenics static mixer. +* [Turbulent Bend](/tutorials/Inc_Turbulent_Bend/) +Simulation of turbulent flow in a 90 degree pipe bend using wall functions. #### Structural Mechanics diff --git a/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/mesh_tutorial.png b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/mesh_tutorial.png new file mode 100644 index 00000000..722b1198 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/mesh_tutorial.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/residuals.png b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/residuals.png new file mode 100644 index 00000000..c88392cc Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/residuals.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/species_profiles.png b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/species_profiles.png new file mode 100644 index 00000000..95724f1d Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/species_profiles.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/velocity_profiles.png b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/velocity_profiles.png new file mode 100644 index 00000000..48e2061f Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model/images/velocity_profiles.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/Screenshot_gmsh.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/Screenshot_gmsh.png new file mode 100644 index 00000000..6d8da0b8 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/Screenshot_gmsh.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/bend_with_slice_locations.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/bend_with_slice_locations.png new file mode 100644 index 00000000..5b582902 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/bend_with_slice_locations.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_1.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_1.png new file mode 100644 index 00000000..2b3fcf60 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_1.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_2.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_2.png new file mode 100644 index 00000000..fd24b259 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/coarse_2.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sstv2003m_yplus_001_stretched_phi_90_3doverviewwithmesh.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sstv2003m_yplus_001_stretched_phi_90_3doverviewwithmesh.png new file mode 100644 index 00000000..db6a6764 Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sstv2003m_yplus_001_stretched_phi_90_3doverviewwithmesh.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sudo_phi90_lineplot.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sudo_phi90_lineplot.png new file mode 100644 index 00000000..2109c6ac Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/sudo_phi90_lineplot.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/turb_bend_velocities.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/turb_bend_velocities.png new file mode 100644 index 00000000..406bb1bf Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/turb_bend_velocities.png differ diff --git a/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/yplus_001_3Dshot_with_mesh.png b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/yplus_001_3Dshot_with_mesh.png new file mode 100644 index 00000000..0156709d Binary files /dev/null and b/tutorials_files/incompressible_flow/Inc_Turbulent_Bend/images/yplus_001_3Dshot_with_mesh.png differ