mus_source_type_module Module

Module containing subroutines for building MUSUBI specific source variables


Uses

  • module~~mus_source_type_module~~UsesGraph module~mus_source_type_module mus_source_type_module aot_table_module aot_table_module module~mus_source_type_module->aot_table_module aotus_module aotus_module module~mus_source_type_module->aotus_module env_module env_module module~mus_source_type_module->env_module module~mus_absorblayer_module mus_absorbLayer_module module~mus_source_type_module->module~mus_absorblayer_module module~mus_dervarpos_module mus_derVarPos_module module~mus_source_type_module->module~mus_dervarpos_module module~mus_physics_module mus_physics_module module~mus_source_type_module->module~mus_physics_module module~mus_scheme_header_module mus_scheme_header_module module~mus_source_type_module->module~mus_scheme_header_module tem_aux_module tem_aux_module module~mus_source_type_module->tem_aux_module tem_logging_module tem_logging_module module~mus_source_type_module->tem_logging_module tem_shape_module tem_shape_module module~mus_source_type_module->tem_shape_module tem_stencil_module tem_stencil_module module~mus_source_type_module->tem_stencil_module tem_stringKeyValuePair_module tem_stringKeyValuePair_module module~mus_source_type_module->tem_stringKeyValuePair_module tem_subTree_type_module tem_subTree_type_module module~mus_source_type_module->tem_subTree_type_module tem_time_module tem_time_module module~mus_source_type_module->tem_time_module tem_tools_module tem_tools_module module~mus_source_type_module->tem_tools_module tem_varMap_module tem_varMap_module module~mus_source_type_module->tem_varMap_module tem_varSys_module tem_varSys_module module~mus_source_type_module->tem_varSys_module treelmesh_module treelmesh_module module~mus_source_type_module->treelmesh_module module~mus_absorblayer_module->aot_table_module module~mus_absorblayer_module->aotus_module module~mus_absorblayer_module->env_module module~mus_absorblayer_module->tem_aux_module module~mus_absorblayer_module->tem_logging_module module~mus_absorblayer_module->tem_tools_module module~mus_dervarpos_module->env_module module~mus_dervarpos_module->tem_aux_module module~mus_dervarpos_module->tem_stencil_module module~mus_dervarpos_module->tem_varSys_module module~mus_scheme_derived_quantities_module mus_scheme_derived_quantities_module module~mus_dervarpos_module->module~mus_scheme_derived_quantities_module module~mus_scheme_layout_module mus_scheme_layout_module module~mus_dervarpos_module->module~mus_scheme_layout_module module~mus_physics_module->aot_table_module module~mus_physics_module->aotus_module module~mus_physics_module->env_module module~mus_physics_module->tem_aux_module module~mus_physics_module->tem_logging_module module~mus_physics_module->tem_tools_module module~mus_physics_module->treelmesh_module aot_out_module aot_out_module module~mus_physics_module->aot_out_module tem_geometry_module tem_geometry_module module~mus_physics_module->tem_geometry_module tem_param_module tem_param_module module~mus_physics_module->tem_param_module module~mus_scheme_header_module->aot_table_module module~mus_scheme_header_module->aotus_module module~mus_scheme_header_module->env_module module~mus_scheme_header_module->tem_aux_module module~mus_scheme_header_module->tem_logging_module module~mus_scheme_header_module->tem_tools_module module~mus_scheme_header_module->aot_out_module module~mus_scheme_derived_quantities_module->env_module module~mus_scheme_derived_quantities_module->tem_aux_module module~mus_scheme_derived_quantities_module->tem_logging_module module~mus_scheme_derived_quantities_module->tem_param_module tem_compileconf_module tem_compileconf_module module~mus_scheme_derived_quantities_module->tem_compileconf_module module~mus_scheme_layout_module->aot_table_module module~mus_scheme_layout_module->aotus_module module~mus_scheme_layout_module->env_module module~mus_scheme_layout_module->tem_aux_module module~mus_scheme_layout_module->tem_logging_module module~mus_scheme_layout_module->tem_stencil_module module~mus_scheme_layout_module->tem_tools_module module~mus_scheme_layout_module->aot_out_module module~mus_scheme_layout_module->module~mus_scheme_derived_quantities_module module~mus_scheme_layout_module->tem_param_module module~mus_moments_type_module mus_moments_type_module module~mus_scheme_layout_module->module~mus_moments_type_module mpi mpi module~mus_scheme_layout_module->mpi tem_comm_env_module tem_comm_env_module module~mus_scheme_layout_module->tem_comm_env_module tem_dyn_array_module tem_dyn_array_module module~mus_scheme_layout_module->tem_dyn_array_module tem_grow_array_module tem_grow_array_module module~mus_scheme_layout_module->tem_grow_array_module module~mus_moments_type_module->env_module tem_matrix_module tem_matrix_module module~mus_moments_type_module->tem_matrix_module

Used by

  • module~~mus_source_type_module~~UsedByGraph module~mus_source_type_module mus_source_type_module module~mus_auxfield_module mus_auxField_module module~mus_auxfield_module->module~mus_source_type_module module~mus_auxfieldvar_module mus_auxFieldVar_module module~mus_auxfieldvar_module->module~mus_source_type_module module~mus_derquan_module mus_derQuan_module module~mus_derquan_module->module~mus_source_type_module module~mus_derquanincomp_module mus_derQuanIncomp_module module~mus_derquanincomp_module->module~mus_source_type_module module~mus_derquanisothermaceq_module mus_derQuanIsothermAcEq_module module~mus_derquanisothermaceq_module->module~mus_source_type_module module~mus_derquanmsliquid_module mus_derQuanMSLiquid_module module~mus_derquanmsliquid_module->module~mus_source_type_module module~mus_derquannernstplanck_module mus_derQuanNernstPlanck_module module~mus_derquannernstplanck_module->module~mus_source_type_module module~mus_derquanpoisson_module mus_derQuanPoisson_module module~mus_derquanpoisson_module->module~mus_source_type_module module~mus_derquanps_module mus_derQuanPS_module module~mus_derquanps_module->module~mus_source_type_module module~mus_field_module mus_field_module module~mus_field_module->module~mus_source_type_module module~mus_scheme_module mus_scheme_module module~mus_scheme_module->module~mus_source_type_module module~mus_scheme_type_module mus_scheme_type_module module~mus_scheme_type_module->module~mus_source_type_module module~mus_source_module mus_source_module module~mus_source_module->module~mus_source_type_module module~mus_source_var_module mus_source_var_module module~mus_source_var_module->module~mus_source_type_module module~mus_source_var_turbchanforce_module mus_source_var_turbChanForce_module module~mus_source_var_turbchanforce_module->module~mus_source_type_module module~mus_variable_module mus_variable_module module~mus_variable_module->module~mus_source_type_module

Abstract Interfaces

abstract interface

  • private subroutine proc_apply_source(fun, inState, outState, neigh, auxField, nPdfSize, iLevel, varSys, time, phyConvFac, derVarPos)

    Abstract interface to update state with source terms

    Arguments

    Type IntentOptional Attributes Name
    class(mus_source_op_type), intent(in) :: fun

    Description of method to update source

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

    input pdf vector \todo KM: instate is passed to compute auxField. Since auxField is precomputed from instate and passed to this routine. instate can be removed

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

    output pdf vector

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

    connectivity Array corresponding to state vector

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

    auxField array

    integer, intent(in) :: nPdfSize

    number of elements in state Array

    integer, intent(in) :: iLevel

    current level

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

    variable system

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

    Point in time at which to evaluate the variable.

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

    Physics conversion factor for current level

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

    position of derived quantities in varsys

abstract interface

  • private subroutine proc_addSrcToAuxField(fun, auxField, iLevel, time, varSys, phyConvFac, derVarPos)

    Interface to add source to auxField vars in source_op_type for all nSolve elements (nFluids+nGhostFromCoarser+nGhostFromFiner). Halo elements are exchanged

    Arguments

    Type IntentOptional Attributes Name
    class(mus_source_op_type), intent(inout) :: fun

    Description of method to update source

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

    output auxField array

    integer, intent(in) :: iLevel

    current level

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

    current timing information

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

    variable system definition

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

    Physics conversion factor for current level

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

    position of derived quantities in varsys

abstract interface

  • private subroutine proc_updateSourceVar(fun, auxField, iLevel, varSys, phyConvFac, derVarPos)

    Interface to update source variable which has dependency on auxField. Applied on all nSolve elements (nFluids+nGhostFromCoarser+nGhostFromFiner). Halo elements are exchanged This should be called after adding sorce term to state so that both auxField and apply_source uses same source value in one multilevel cycle.

    Arguments

    Type IntentOptional Attributes Name
    class(mus_source_op_type), intent(inout) :: fun

    Description of method to update source

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

    input auxField array on current level

    integer, intent(in) :: iLevel

    current level

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

    variable system definition

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

    Physics conversion factor on current level

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

    position of derived quantities in varsys


Derived Types

type, public ::  mus_HRRCorrectionTerm_type

Stores correction term for HRR_bgk

Components

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

density

real(kind=rk), public, allocatable :: vel(:,:)

velocity

type, public ::  mus_turbChannelForce_type

Contains information to compute average bulk velocity for dynamic_force. In turb_channel_force, the force term is adapted according to difference between reference bulk velocity and simulated plane average bulk velocity to avoid linear increase in simulated bulk velocits. For more information: https://www.wias-berlin.de/people/john/ELECTRONIC_PAPERS/JR07.IJNMF.pdf

Components

Type Visibility Attributes Name Initial
type(tem_shape_type), public :: geom_utau(1)

tracking shapes

type(tem_shape_type), public :: geom_umean(1)
type(tem_subTree_type), public :: subTree_utau

sub-tree resulting from the elements within the tracking shape The sub-tree also holds the sub-communicator This data needs to be UPDATED after balance

type(tem_subTree_type), public :: subTree_umean
real(kind=rk), public :: refVelBulk

Reference bulk velocity in physical unit

real(kind=rk), public :: refHeight

Characteristic height in physical unit

integer, public :: flow_direction

Stream-wise direction to compute average velocity x=1, y=2, z=3

real(kind=rk), public :: forceDyn(3)

Dynamic Force term for turbulent channel in physical unit [m/s^2] F_dyn = (refVelBulk-avgVelXBulk) * refVelBulk / refHeight

integer, public :: nElemsGlobal_utau

Global number of elements in defined shape

integer, public :: nElemsGlobal_umean

type, public ::  mus_source_op_type

Description contains list of elements on which source is active and function pointer to update source

Components

Type Visibility Attributes Name Initial
integer, public :: srcTerm_varPos

Position of this source term variable in the varSys

integer, public :: data_varPos

Position of data variable provided in config file in the varSys

type(mus_source_elems_type), public, allocatable :: elemLvl(:)

Contains source elements position in state array/total list for each level

procedure(proc_apply_source), public, pointer :: applySrc => null()

Function to update state with source term

character(len=labelLen), public :: varname

to use source field array name of the source variable

procedure(proc_addSrcToAuxField), public, pointer :: addSrcToAuxField => null()

Function pointer to append source field to auxilary variable

procedure(proc_updateSourceVar), public, pointer :: updateSourceVar => null()

Function pointer to update source variable which are dependent on auxField.

integer, public :: order

Order of approximation for source like force, electric_field, charge_density. Order = 1, uses force term in BE approximated by forward Euler method Order = 2, uses force term in BE approximated by Trapezoidal method. For order 2, macroscopic source is also added to auxField. For fluid, fluid_incompressible, multispecies_liquid: source is added to momentum and for poisson: source is added to potential. Default: order = 2.

type(mus_absorbLayer_type), public :: absLayer

Additional config information for absorbLayer

type(mus_turbChannelForce_type), public :: turbChanForce

Contains information to compute average bulk velocity for dynamic_force

type, public ::  mus_source_type

Description of musubi source type

Components

Type Visibility Attributes Name Initial
type(mus_source_op_type), public, allocatable :: method(:)

Contains source elements position in tree%treeID and function pointer to update source Size: varDict%nVals

type(grw_stringkeyvaluepairarray_type), public :: varDict

Dictionary of source variable with varDict%val()%key is the name of source variable and varDict%val()%value is the name of variable provided for the key

type, private ::  mus_source_elems_type

Contains source elements position in state array and idx to access data variable refered in config file. This type is defined for each level

Components

Type Visibility Attributes Name Initial
integer, public :: nElems

Number of source elements on this level. nFluids + nGhosts

integer, public, allocatable :: posInTotal(:)

Position of elements in state array to apply source terms. Position in state array is same as position in total list Size: nElems

integer, public, allocatable :: idx(:)

Index to access point data type to retrieve values from variable refered for source variable

type(mus_absorbLayer_dynAvg_type), public :: dynAvg

source field value obtained from ST_fun data variable. Filled only for elements where source is active i.e. elements in posInTotal. size: nElems*nComponents \todo KM: might be not neccessary Contains time average values of density and velocity for dynamic absorblayer. \todo KM: 02042021 Introduce method_data c_ptr and point to dynAvg for absorbLayer and change intent(inout) to intent(in) in proc_addSrcToAuxField.

type(mus_HRRCorrectionTerm_type), public :: HRR_Corr

Subroutines

public subroutine mus_create_poss_srcVar(poss_srcVar, schemeHeader)

Routine initialize possible source variable depends on scheme kind

Arguments

Type IntentOptional Attributes Name
type(tem_possible_variable_type), intent(out) :: poss_srcVar

possible source variables

type(mus_scheme_header_type), intent(in) :: schemeHeader

Identifier of the scheme

public subroutine mus_load_source_var(me, possVars, conf, parent, key, varSys)

Routine load musubi source terms for given key. key is glob_source or source

Arguments

Type IntentOptional Attributes Name
type(mus_source_type), intent(out) :: me

Source variable type to initialize

type(tem_possible_variable_type), intent(in) :: possVars

possible source variables

type(flu_State) :: conf

flu state

integer, intent(in), optional :: parent

parent handle if scheme table is defined

character(len=*), intent(in) :: key

key to load source term

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

Global variable system

public subroutine mus_source_cleanup(me)

This routine act as a destructor for source type. The arrays allocated in mus_init_sourceTerms are destroyed here

Arguments

Type IntentOptional Attributes Name
type(mus_source_type), intent(inout) :: me

public subroutine mus_applySrc_dummy(fun, inState, outState, neigh, auxField, nPdfSize, iLevel, varSys, time, phyConvFac, derVarPos)

Dummy routine for apply source

Arguments

Type IntentOptional Attributes Name
class(mus_source_op_type), intent(in) :: fun

Description of method to update source

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

input pdf vector \todo KM: instate is passed to compute auxField. Since auxField is precomputed from instate and passed to this routine. instate can be removed

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

output pdf vector

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

connectivity Array corresponding to state vector

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

auxField array

integer, intent(in) :: nPdfSize

number of elements in state Array

integer, intent(in) :: iLevel

current level

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

variable system

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

Point in time at which to evaluate the variable.

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

Physics conversion factor for current level

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

position of derived quantities in varsys

public subroutine mus_addSrcToAuxField_dummy(fun, auxField, iLevel, time, varSys, phyConvFac, derVarPos)

Dummy routine for add source to auxField

Arguments

Type IntentOptional Attributes Name
class(mus_source_op_type), intent(inout) :: fun

Description of method to update source

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

output auxField array

integer, intent(in) :: iLevel

current level

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

current timing information

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

variable system definition

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

Physics conversion factor for current level

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

position of derived quantities in varsys

public subroutine mus_updateSrcVar_dummy(fun, auxField, iLevel, varSys, phyConvFac, derVarPos)

Dummy routine for update source variable

Arguments

Type IntentOptional Attributes Name
class(mus_source_op_type), intent(inout) :: fun

Description of method to update source

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

input auxField array on current level

integer, intent(in) :: iLevel

current level

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

variable system definition

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

Physics conversion factor on current level

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

position of derived quantities in varsys

private subroutine load_turbChanForce(me, conf, key, parent)

Load shape, bulk velocity and height for turbulent channel force

Arguments

Type IntentOptional Attributes Name
type(mus_turbChannelForce_type), intent(out) :: me

Turbulent channel force

type(flu_State) :: conf

flu state

character(len=*), intent(in) :: key

Table name to load target states

integer, intent(in) :: parent

parent source handle