mus_relaxationParam_module Module

This module contains the data type for MRT.

Also provides functions and routines to set relaxation parameters for single-component and multispecies.


Uses

Used by

  • module~~mus_relaxationparam_module~~UsedByGraph module~mus_relaxationparam_module mus_relaxationParam_module module~mus_aux_module mus_aux_module module~mus_aux_module->module~mus_relaxationparam_module module~mus_fluid_module mus_fluid_module module~mus_aux_module->module~mus_fluid_module module~mus_tools_module mus_tools_module module~mus_aux_module->module~mus_tools_module module~mus_bc_fluid_turbulent_module mus_bc_fluid_turbulent_module module~mus_bc_fluid_turbulent_module->module~mus_relaxationparam_module module~mus_bc_fluid_wall_module mus_bc_fluid_wall_module module~mus_bc_fluid_wall_module->module~mus_relaxationparam_module module~mus_bc_general_module mus_bc_general_module module~mus_bc_general_module->module~mus_relaxationparam_module module~mus_bc_general_module->module~mus_bc_fluid_turbulent_module module~mus_bc_general_module->module~mus_bc_fluid_wall_module module~mus_fluid_module->module~mus_relaxationparam_module module~mus_interpolate_average_module mus_interpolate_average_module module~mus_interpolate_average_module->module~mus_relaxationparam_module module~mus_interpolate_average_module->module~mus_fluid_module module~mus_interpolate_linear_module mus_interpolate_linear_module module~mus_interpolate_linear_module->module~mus_relaxationparam_module module~mus_interpolate_linear_module->module~mus_fluid_module module~mus_interpolate_quadratic_module mus_interpolate_quadratic_module module~mus_interpolate_quadratic_module->module~mus_relaxationparam_module module~mus_interpolate_quadratic_module->module~mus_fluid_module module~mus_tools_module->module~mus_relaxationparam_module module~mus_config_module mus_config_module module~mus_config_module->module~mus_tools_module module~mus_control_module mus_control_module module~mus_control_module->module~mus_aux_module module~mus_control_module->module~mus_bc_general_module module~mus_debug_module mus_debug_module module~mus_debug_module->module~mus_bc_general_module module~mus_dynloadbal_module mus_dynLoadBal_module module~mus_dynloadbal_module->module~mus_bc_general_module module~mus_dynloadbal_module->module~mus_fluid_module module~mus_dynloadbal_module->module~mus_tools_module module~mus_field_module mus_field_module module~mus_field_module->module~mus_fluid_module module~mus_field_prop_module mus_field_prop_module module~mus_field_prop_module->module~mus_fluid_module module~mus_flow_module mus_flow_module module~mus_flow_module->module~mus_fluid_module module~mus_hvs_aux_module mus_hvs_aux_module module~mus_hvs_aux_module->module~mus_fluid_module module~mus_hvs_aux_module->module~mus_tools_module module~mus_interpolate_debug_module mus_interpolate_debug_module module~mus_interpolate_debug_module->module~mus_fluid_module module~mus_interpolate_module mus_interpolate_module module~mus_interpolate_module->module~mus_interpolate_average_module module~mus_interpolate_module->module~mus_interpolate_linear_module module~mus_interpolate_module->module~mus_interpolate_quadratic_module module~mus_program_module mus_program_module module~mus_program_module->module~mus_aux_module module~mus_program_module->module~mus_bc_general_module module~mus_program_module->module~mus_tools_module module~mus_tracking_module mus_tracking_module module~mus_tracking_module->module~mus_tools_module program~musubi musubi program~musubi->module~mus_aux_module

Derived Types

type, public ::  mus_viscosity_type

Contains STfun of viscosity variable and relaxation parameter for each level

Components

Type Visibility Attributes Name Initial
type(tem_spacetime_fun_type), public :: STfun

space-time function

type(grw_realarray_type), public, allocatable :: dataOnLvl(:)

viscosity value evaluated from STfun

type(mus_relaxationParam_type), public, allocatable :: omLvl(:)

relaxation paramter omega for each level

type, private ::  mus_relaxationParam_type

Contains relaxation parameter for a level

Components

Type Visibility Attributes Name Initial
real(kind=rk), public, allocatable :: val(:)

Relaxation parameter computed from viscosity For kinematic viscosity, if turbulence is active, this omega refers to effective omega which is omega_bg + omega_turb size: nElems_solve


Functions

public elemental function mus_calcOmegaFromVisc(visc) result(omega)

This function compute relaxation paramter omega from viscosity

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: visc

scaled lattice viscosity i.e vL_c/dtL

Return Value real(kind=rk)

lattice time step size in current level real(kind=rk), intent(in) :: dtL output: relaxation parameter omega


Subroutines

public subroutine mus_init_relaxParam(omLvl, minLevel, maxLevel, nElems)

This routine initialize relaxation parameter

Arguments

Type IntentOptional Attributes Name
type(mus_relaxationParam_type), intent(out), allocatable :: omLvl(:)

relaxation paramter

integer, intent(in) :: minLevel

minlevel and maxLevel

integer, intent(in) :: maxLevel

minlevel and maxLevel

integer, intent(in) :: nElems(minLevel:maxLevel)

number of local elements per level

public subroutine mus_update_viscKine(viscKine, state, neigh, auxField, gradData, layout, baryOfTotal, tNow, nSize, nFluids, nGhostFromCoarser, nGhostFromFiner, nHalo, varSys, iLevel, convFac, dxL, dtL, derVarPos, turb, nNwtn, Grad)

Update kinematic viscosity from STfun and calculate turbulent viscosity from velocity gradient or nonEqPDF Viscosity obtained from this routine are normalized to the level

Read more…

Arguments

Type IntentOptional Attributes Name
type(mus_viscosity_type), intent(inout) :: viscKine

Kinematic viscosity

real(kind=rk), intent(in) :: state(:)

state array

integer, intent(in) :: neigh(:)

neighbor connectivity array

real(kind=rk), intent(in) :: auxField(:)

Auxiliary field variable array

type(mus_gradData_type), intent(in) :: gradData

gradient data

type(mus_scheme_layout_type), intent(in) :: layout

stencil layout

real(kind=rk), intent(in) :: baryOfTotal(:,:)

bary of treeID in total list

type(tem_time_type), intent(in) :: tNow

current simulation time

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: nFluids

number of fluid elements in state array

integer, intent(in) :: nGhostFromCoarser

Number of ghostFromCoarser element in state array

integer, intent(in) :: nGhostFromFiner

Number of ghostFromFiner element in state array

integer, intent(in) :: nHalo

Number of halo element in state array

type(tem_varSys_type), intent(in) :: varSys

variable system

integer, intent(in) :: iLevel

current level

type(mus_convertFac_type), intent(in) :: convFac

reference physical conversion factors for current level

real(kind=rk), intent(in) :: dxL

lattice element size in current level

real(kind=rk), intent(in) :: dtL

lattice time step size in current level

type(mus_derVarPos_type), intent(in) :: derVarPos

contains position of in varSys

type(mus_turbulence_type), intent(inout) :: turb

turbulence type

type(mus_nNwtn_type), intent(in) :: nNwtn

non-Newtonian type

type(mus_Grad_type), intent(in) :: Grad

Object that contains pointers to calculate gradients

public subroutine mus_update_relaxParamKine(viscKine, turb, nSolve, iLevel)

Update kinematic relaxation parameter from viscosity and check omega

Arguments

Type IntentOptional Attributes Name
type(mus_viscosity_type), intent(inout) :: viscKine

Kinematic viscosity

type(mus_turbulence_type), intent(in) :: turb

turbulence type

integer, intent(in) :: nSolve

Number of elements to solve in compute kernel

integer, intent(in) :: iLevel

current level

public subroutine mus_update_relaxParamFromViscSTfun(omega, visc, viscSTfun, nElems, baryOfTotal, tNow, viscRef)

This routine is used to initialize relaxation paramter and update bulk viscosity at every time step Bulk visocisty is defined as space-time function to apply ramping and spatial sponge in bulk viscosity

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: omega(:)

relaxation parameter

real(kind=rk), intent(inout) :: visc(:)

Kinematic viscosity

type(tem_spacetime_fun_type), intent(in) :: viscSTfun

viscosity space-time function

integer, intent(in) :: nElems

Number of local elements including halos

real(kind=rk), intent(in) :: baryOfTotal(:,:)

baryID of total list

type(tem_time_type), intent(in) :: tNow

current simulation time

real(kind=rk), intent(in) :: viscRef

reference physical viscosity on current level i.e. (dxP_l)^2/dtP_l Dividing physical viscosity with the viscRef gives vL_l/dtL_l

public subroutine mus_check_omegaKine(schemeRelax, omLvlKine, nSolve, minLevel, maxLevel, general)

This routine checks whether omega is within the stability limit. If not it will terminate the simulation with error message. Using limits given in Tölke, J., Freudiger, S., & Krafczyk, M. (2006). An adaptive scheme using hierarchical grids for lattice Boltzmann multi-phase flow simulations. Computers & Fluids, 35(8–9), 820–830. For BGK: 2/3 < omega < 1.976 For MRT: 2/3 < omega < 1.999

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: schemeRelax

scheme relaxation type

type(mus_relaxationParam_type), intent(in) :: omLvlKine(minLevel:maxLevel)

array of kinematic relaxation parameter on all levels

integer, intent(in) :: nSolve(minLevel:maxLevel)

Number of elements to solve in compute kernel

integer, intent(in) :: minLevel

minlevel and maxlevel

integer, intent(in) :: maxLevel

minlevel and maxlevel

type(tem_general_type), intent(inout) :: general

Contains proc, simControl, solveHead