.. _equations: Equations --------- .. list-table:: :widths: 25 10 25 35 :header-rows: 1 * - Keyword - Required - Default - Valid values * - 'equations' - Yes - -- - Any of equation sets detailed below. The equations key selects the equation set to be solved. The corresponding equation set options should also be defined in the control dictionary. The valid equation keys are shown in the table below. .. list-table:: :widths: 10 60 10 10 :header-rows: 1 * - Solver - Description - Compressible - Incompressible * - Euler - Use the Euler flow equations in the simulation. These are compressible, inviscid flow equations. - :ref:`"euler" ` - -- * - Viscous - Use the viscous flow equations. These are compressible, viscid flow equations which do not model turbulence. - :ref:`"viscous" ` - :ref:`"incomp viscous" ` * - RANS - Use the RANS (Reynolds-Averaged Navier-Stokes) equations in the simulation. These are compressible, viscid flow equations with additional terms included to account for the effect of turbulence on the flow without the expense of simulating the turbulent flow structures themselves. - :ref:`"rans" ` - :ref:`"incomp rans" ` * - LES - Use the Large Eddy Simulation (LES) equations. - :ref:`"les" ` - :ref:`"incomp les" ` Example usage: .. code-block:: python parameters = { .. # Use the euler equation set 'equations' : 'euler', # Define the inputs for the 'euler' equation set 'euler': {..} .. } .. _equation_common: Common Settings ^^^^^^^^^^^^^^^ The following parameters are common for all of the equation sets. .. list-table:: :widths: 20 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values * - 'order' - Yes - -- - 'first' | 'second' | 'euler_second' * - 'first order cycles' - No - -- - Positive integer * - 'linear gradients' - No - False - True | False * - 'leastsq gradients' - No - False - True | False * - 'inviscid flux scheme' - Yes - "Roe" - "HLLC" | "Rusanov" | "Roe" | "Roe low diss" | "HLLC low diss" * - 'reconstruction' - No - "muscl" - "muscl" | "umuscl" * - 'entropy fix' - No - "0.0" - Float between 0.0 and 0.2 * - 'low dissipation sensor' - No - -- - "FD" | "NTS" | "DES" | "NONE" * - 'dissipation sensor minimum' - No - -- - Float between 0.05 and 1.0 * - 'freeze limiter cycle' - No - -- - Positive integer * - 'relax' - Yes (for incompressible equation set) - 0.5 - Positive float * - 'turbulence' - Yes (for 'les' or 'rans' equation set) - {} - See :ref:`"turbulence" ` order ===== Sets the order of the spatial discretisation. **'euler_second'** is second order for the flow variables and first order for the turbulence. first order cycles ================== Specifies the number of cycles the solver will run with first order spatial discretisation. This can be used to improve stability at start up. If the solver is dual time stepping then the number of first order cycles is taken as the total number from the start of the simulation. Example usage: Run 500 cycles first order. .. code-block:: python parameters = { .. 'equations' : 'euler', 'euler': { ... 'first order cycles': 500, ... } .. } linear gradients & leastsq gradients ====================================== By default zCFD uses a Weighted Green-Gauss gradient calculation. This can be switched to a standard Green-Gauss by setting **'linear gradients'** to True. Setting **'leastsq gradients'** to True will set the gradient calculation to Least Squares. inviscid flux scheme ==================== Picks the scheme to use for the inviscid flux. **HLLC** is good when running explicit, **Roe** is best for implicit and **Rusanov** is good for getting an implicit simulation going. The **Roe low diss** and **HLLC low diss** schemes can be used with LES or Hybrid RANS/LES low dissipation sensor ====================== The sensor decides *where* - and by *how much* - the dissipation of the **'Roe low diss'** / **'HLLC low diss'** scheme is reduced. In a resolved region the sensor returns a small value (down to **'dissipation sensor minimum'**) so the scheme approaches a low-dissipation central scheme; elsewhere it returns 1 so the full upwind dissipation needed for stability and shock capturing is retained. The three active sensors differ in *what they key off*: .. list-table:: :widths: 15 85 :header-rows: 1 * - Setting - Notes * - **'DES'** - Uses the hybrid length-scale blending of the selected DES/DDES/IDDES model (the RANS-to-LES length-scale ratio). Low dissipation is enabled wherever the model has switched to its LES branch, so it follows the model's resolved-turbulence (LES) regions directly. * - **'NTS'** - Grid-resolution sensor after Travin/Xiao (see Xiao et al. INT J HEAT FLUID FL 51 (2015) pag. 141 https://doi.org/10.1016/j.ijheatfluidflow.2014.10.007). Activates low dissipation where the local grid is fine relative to the turbulence length scale and the flow is vortical, combined with the shock sensor via a probabilistic-OR. Tends to enable low dissipation over a broader region than **'DES'**. * - **'FD'** - Eddy-viscosity (DDES-shielding) sensor after Johnsen et al. JCP 229 (2010) pag. 1234, based on the local ratio :math:`r_d = (\nu + \nu_t) / (\lVert \nabla u \rVert \, \kappa^2 d^2)`. It retains the **full** dissipation wherever the modeled eddy viscosity :math:`\nu_t` is high (the shielded near-wall / RANS region) and only reduces dissipation once :math:`\nu_t` drops. Because activation is gated on the modeled :math:`\nu_t`, it will **not** reduce dissipation in resolved regions that still carry high modeled eddy viscosity. * - **'NONE'** - No sensor; uses the value set on **'dissipation sensor minimum'** everywhere. .. note:: If the requirement is *low dissipation in resolved regions regardless of the modeled eddy viscosity*, use **'DES'** or **'NTS'**. The **'FD'** sensor is gated on the modeled eddy viscosity :math:`\nu_t` (it follows the DDES shielding function), so in regions where the turbulence model still produces significant :math:`\nu_t` it retains full dissipation even when the flow is well resolved. .. note:: The **'DES'** and **'FD'** sensors derive from a RANS turbulence model (the hybrid length-scale ratio and the DDES shielding function respectively). When no RANS model is active - for example a pure LES run (``'les': 'WALE'``) or an inviscid/laminar run - these fields are not produced, so **'DES'** and **'FD'** fall back to treating the whole domain as fully resolved LES and apply the **'dissipation sensor minimum'** everywhere (the shock-protection term still raises the dissipation at shocks). For pure LES, **'NTS'** is the natural choice as it is grid based and does not require a RANS model. dissipation sensor minimum ========================== Sets the minimum value that the dissipation term in the scheme is multiplied by when using the **'Roe low diss'** or **'HLLC low diss'** scheme. This allows you control the stability of the low diss scheme (smaller values reduce the dissipation and hence the stability of the scheme) freeze limiter cycle ==================== If set the values of the limiter used in the MUSCL reconstruction are frozen at the specified cycle. This can be useful in the latter stages of a simulation if noise from the limiter is causing the residual convergence to stall. relax ===== The relaxation factor used on the flow equations in the incompressible solver. Increasing this will speed up convergence at the expense of stability and vice versa. .. _turbulence: turbulence ========== The turbulence dictionary is required for the :ref:`"rans" ` and :ref:`"les" ` equations sets. .. _equation_euler: Euler ^^^^^ Compressible Euler flow is inviscid (no viscosity and hence no turbulence). The compressible Euler equations are appropriate when modelling flows where momentum significantly dominates viscosity - for example at very high speed. The computational mesh used for Euler flow does not need to resolve the flow detail in the boundary layer and hence will generally have far fewer cells than the corresponding viscous mesh would have. As well as the :ref:`"common" ` settings, the following settings are available: .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'precondition' - Yes - False - True | False - Use low speed mach preconditioner Example usage: .. code-block:: python parameters = { .. # Use the euler equation set 'equations' : 'euler', 'euler' : { 'order' : 'second', 'first order cycles': 100, # Cycle on which to freeze the limiter values 'freeze limiter cycle': 500, # Use low speed mach preconditioner 'precondition' : True, 'Inviscid Flux Scheme': 'HLLC', }, } .. _equation_viscous: Viscous ^^^^^^^ The viscous (laminar) equations model flow that is viscous but not turbulent. The `Reynolds number `_ of a flow regime determines whether or not the flow will be turbulent. The computational mesh for a viscous flow has to resolve the boundary layer so will generally be larger than that used for an Euler simulation. A viscous simulation will run faster than a RANS simulation using the same mesh since fewer equations are being modelled. As well as the :ref:`"common" ` settings, the following settings are available: .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'precondition' - Yes - False - True | False - Use low speed mach preconditioner Example usage: .. code-block:: python parameters = { .. # Use the viscous equation set 'equations' : 'viscous', 'viscous' : { 'order' : 'second', 'first order cycles': 100, # Use low speed mach preconditioner 'precondition' : True, 'linear gradients' : False, 'Inviscid Flux Scheme': 'HLLC', }, .. } .. _equation_incomp_viscous: Incompressible Viscous ^^^^^^^^^^^^^^^^^^^^^^ Incompressible viscous equations follow the same structure as the compressible viscous equations with the addition of several parameters to address numerical challenges related to the orthogonality of the mesh. Note that the **scheme** block is not required. .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'relax' - Yes - 0.5 - Positive float - The relaxation factor used on the flow equations in the incompressible solver. * - 'correction' - Yes - 'over relaxed' - 'none' | 'orthogonal' | 'minimum' | 'over relaxed' - Selects the type of non-orthogonal correction to apply to the flow equations. * - 'correction limiter - Yes - 0.5 - Float between 0.0 and 1.0 - Sets the limiter for the non-orthogonal correction. 1.0 applies the full correction, 0.0 turns off the correction. * - 'gradient limiter type' - Yes - 'cell md' - 'cell md' | 'cell' - Selects the type of gradient limiter to apply to the flow equations. **cell_md** is more robust on highly non-orthogonal meshes. **cell** is less dissipative. * - 'gradient limiter' - Yes - 0.5 - Float between 0.0 and 1.0 - Sets the coefficient for the gradient limiter. 1.0 is the most dissipative, 0.0 turns off the limiter. * - 'max second order non orthogonal angle' - Yes - 90.0 - Float between 0.0 and 90.0 - Sets the maximum non-orthogonal angle (in degrees) at which second order discretisation is used. Above this angle first order discretisation is used. * - 'order' - Yes - - - 'first' | 'second' | 'euler_second' | 'central' - Sets the order of the spatial discretisation. * - 'central blend' - Yes - 0.8 - Float between 0.0 and 1.0 - Coefficient of blending between first and second order terms. Example usage: .. code-block:: python parameters = { .. # Use the viscous equation set 'equations' : 'viscous', 'viscous' : { 'relax' : 0.5, 'correction' : 'over relaxed', 'correction limiter' : 0.5, 'gradient limiter type' : 'cell md', 'gradient limiter' : 0.5, 'max second order non orthogonal angle' : 70.0, 'order' : 'second', 'central blend' : 0.8, 'first order cycles': 100, 'linear gradients' : False, 'Inviscid Flux Scheme': 'HLLC', }, .. } .. _equation_rans: RANS ^^^^ The fully turbulent (Reynolds Averaged Navier-Stokes Equations) As well as the :ref:`"common" ` settings, the **'RANS'** equation set requires the additional **'turbulence'** dictionary, which can have the following parameters: .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'les' - Yes - 'none' - 'none' | 'DES" | 'DDES' | 'IDDES' | 'SAS' - Selects the hybrid RANS/LES model. * - 'model' - Yes - -- - 'sst' | 'sas' | 'sa-neg' | 'sst-transition' - Selects the RANS turbulence model * - 'approximate sa from sst results' - No - - True | False - Restart an SA-neg calculation from an SST solution * - 'rotation correction' - No - False - True | False - Adds the rotation correction term to SST or SA-neg * - 'limit gradient k' - No - - Float from 0.01 to 1 - Activates the :math:`\tilde{\nu}` gradient limiter in the SA-neg model * - 'qcr' - No - Off - 2000 | 2020 | 2021 - Activates the non-linear QCR correction to the turbulent stress. Applicable to both SST and SA-neg les === Selects the hybrid RANS/LES model in the RANS solver which is applied to the base model selected with the **"model"** key word. .. list-table:: :widths: 30 70 :header-rows: 1 * - Setting - Notes * - **'none'** - Solve the RANS equations with no hybrid RANS/LES model * - **'DES'** - Detached Eddy Simulation * - **'DDES'** - Delayed Detached Eddy Simulation * - **'IDDES'** - Improved Delayed Detached Eddy Simulation * - **'SAS'** - Scale Adaptive Simulation model ===== Selects the RANS turbulence model. .. list-table:: :widths: 30 70 :header-rows: 1 * - Setting - Notes * - **'sst'** - The Menter Shear Stress Transport Turbulence Model (https://turbmodels.larc.nasa.gov/sst.html) * - **'sa'** - Spalart-Allmaras turbulence model (https://turbmodels.larc.nasa.gov/spalart.html) * - **'sa-neg'** - Negative Spalart-Allmaras turbulence model (https://turbmodels.larc.nasa.gov/spalart.html) * - **'sst-transition'** - The Langtry-Menter 4-equation Transitional SST Model (https://turbmodels.larc.nasa.gov/langtrymenter_4eqn.html) limit gradient k ================ Activates the :math:`\tilde{\nu}` gradient limiter in the SA-neg model. This helps eliminate gradient under/over shoot in regions of poor mesh quality. The value should be between 0 and 1. **0** is off and **1** is maximum limiting. qcr === Activates the non-linear QCR correction to the turbulent stress. Applicable to both SST and SA-neg. QCR has been shown to improve the prediction of separated corner flows, particularly on highly loaded wings. Three versions of the QCR model are available: `QCR 2000 `_ , `QCR 2020 `_ and `QCR 2021 `_. Example RANS usage: =================== .. code-block:: python parameters = { .. # Use the viscous equation set 'equations' : 'RANS', 'RANS': { 'order' : 'second', 'first order cycles': 100, 'freeze limiter cycle': 500, 'linear gradients' : False, 'leastsq gradients' : False, 'Inviscid Flux Scheme': 'HLLC', 'low dissipation sensor': 'DES', 'dissipation sensor minimum': 0.05, 'turbulence' : { 'model' : 'sst', # No Hybrid RANS/LES 'les' : 'none', 'rotation correction': False, 'limit gradient k': 0.5 'qcr': 2020 }, }, ... } Advanced parameters for turbulence models ========================================= The following parameters can be used in the 'turbulence' dictionary to allow tuning of the turbulence models in zCFD. These are advanced parameters and shouldn't normally need to be adjusted. .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'betastar' - No - 0.09 - Positive number - Constant in the dissipation term on the k equation in the SST model * - 'cdes_kw' - No - 0.78 - Positive number - The :math:`k - \omega` part of the blended :math:`C_{DES}` in SST * - 'cdes_keps' - No - 0.21 - Positive number - The :math:`k - \epsilon` part of the blended :math:`C_{DES}` in SST * - 'cd1' - No - 20 - Positive number - Constant in the :math:`f_{dt}` blending function in DDES and IDDES * - 'cd2' - No - 3 - Positive integer - Constant in the :math:`f_{dt}` blending function in DDES and IDDES * - 'cw' - No - 0.15 - Positive number - Constant in the length scale calculation in IDDES * - 'a1' - No - 0.31 - Positive integer - Constant in the eddy viscosity limiter in SST * - 'production' - No - 0 - Positive integer - Selects the model for the production term in the SST model. See :ref:`Production Term Table ` below * - 'rotation correction' - No - - - True | False - Adds the rotation correction term to SST or SA-neg * - 'cdes' - No - 0.65 - Positive number - :math:`C_{DES}` constant used for SA-neg based hybrid RANS/LES models * - 'ca1' - No - 2.0 - Positive number - Constant in the production of the gamma equation in the transition model in the compressible solver * - 'ca2' - No - 0.06 - Positive number - Constant in the destruction term for gamma equation in the transition model in the compressible solver * - 'ce1' - No - 1.0 - Positive number - Constant in the production of the epsilon equation in the transition model in the compressible solver * - 'ce2' - No - 50.0 - Positive number - Constant in the destruction term for gamma equation in the transition model in the compressible solver * - 'cthetat' - No - 0.03 - Positive number - Constant in the Re-theta transition correlation in the transition model in the compressible solver * - 'sigmagamma' - No - 1.0 - Positive number - Constant in the transition model in the compressible solver * - 'sigmathetat' - No - 2.0 - Positive number - Constant in the transition model in the compressible solver * - 'limit gradient k' - No - 0.5 - Positive number - Gradient limiter for the turbulent kinetic energy in the SA-neg model. A value of 0 turns off the limiter, 1 is maximum limiting * - 'separation correction' - No - True | False - Boolean - Activates the separation correction for the transition model in the compressible solver * - 'qcr' - No - - - '2000' | '2020' | '2021' - Selects the QCR model for the turbulence model in the compressible solver **'production'** can have the following values: .. _production_term_table: .. list-table:: :widths: 30 70 :header-rows: 1 * - Setting - Notes * - 0 - Selects the vorticity based production term (SST-V) :math:`P_m=\mu_t\Omega_v^2-\frac{2}{3}\rho k \delta_{ij}\frac{\partial u_i}{\partial x_j}` * - 1 - Selects the strain based production term for incompressible flows :math:`P_m=\mu_t S^2` * - 2 - Selects the strain based production term for compressible flows :math:`P_m=\mu_t S^2 -\frac{2}{3}\rho k \delta_{ij}\frac{\partial u_i}{\partial x_j}` * - 3 - Selects the Kato-Launder source term :math:`P_m=\mu_t S\Omega_v -\frac{2}{3}\rho k \delta_{ij}\frac{\partial u_i}{\partial x_j}` Incompressible RANS ^^^^^^^^^^^^^^^^^^^ .. _equation_incomp_rans: Incompressible RANS equations follow the same structure as the compressible RANS equations with in addition to the parameters described in the :ref:`Incompressible Viscous ` section. Note that the **scheme** block is not required, and that the turbulence model can have a different relaxation parameter to the main equation block. Example incompressible RANS usage: =================================== .. code-block:: python parameters = { .. # Use the incompressible RANS equation set 'equations' : 'incomp RANS', 'incomp RANS': { 'relax' : 0.5, 'correction' : 'over relaxed', 'correction limiter' : 0.5, 'gradient limiter type' : 'cell md', 'gradient limiter' : 0.5, 'max second order non orthogonal angle' : 70.0, 'order' : 'second', 'central blend' : 0.8, 'first order cycles': 100, 'turbulence' : { 'model' : 'sst', 'relax': 0.2, }, }, ... } .. _equation_les: LES ^^^ As well as the :ref:`"common" ` settings, the **'LES'** equation set requires the additional **'turbulence'** dictionary, which can have the following parameters: .. list-table:: :widths: 20 10 10 10 20 :header-rows: 1 * - Keyword - Required - Default - Valid values - Description * - 'les' - Yes - 'none' - 'none' | 'WALE" | - Selects the hybrid RANS/LES model. les === Selects the model for the subgrid eddy viscosity in the LES solver: either **"none"** for implicit LES or **"WALE"** to use the Wall Adapted Local Eddy Viscosity model. Example usage: .. code-block:: python parameters = { .. # Use the viscous equation set 'equations' : 'LES', 'LES': { 'order' : 'second', 'first order cycles': 100, 'freeze limiter cycle': 500, 'linear gradients' : False, 'leastsq gradients' : False, 'Inviscid Flux Scheme': 'HLLC', 'low dissipation sensor': 'DES', 'dissipation sensor minimum': 0.05, 'turbulence' : { 'les' : 'none', }, }, ... } Incompressible LES ^^^^^^^^^^^^^^^^^^ .. _equation_incomp_les: Incompressible LES equations follow the same structure as the compressible LES equations with the addition of the parameters described in the :ref:`Incompressible Viscous ` section. Note that the scheme block is not required, and that the turbulence model can have a different relaxation parameter to the main equation block. Example incompressible LES usage: =================================== .. code-block:: python parameters = { .. # Use the incompressible LES equation set 'equations' : 'incomp LES', 'incomp LES': { 'relax' : 0.7, 'order' : 'second', 'first order cycles': 100, 'turbulence' : { 'les' : 'DES', 'relax' : 0.2, }, }, ... }