mus_source_var_module Module

Module containing subroutines for building MUSUBI specific source variables

\todo KM: 20210301 Move absorbLayer to seperate module. Make target_pressure and target_velocity as stFun.


Uses

  • module~~mus_source_var_module~~UsesGraph module~mus_source_var_module mus_source_var_module module~mus_scheme_header_module mus_scheme_header_module module~mus_source_var_module->module~mus_scheme_header_module module~tem_time_module tem_time_module module~mus_source_var_module->module~tem_time_module module~treelmesh_module treelmesh_module module~mus_source_var_module->module~treelmesh_module module~aot_table_module aot_table_module module~mus_source_var_module->module~aot_table_module module~tem_varmap_module tem_varMap_module module~mus_source_var_module->module~tem_varmap_module module~aotus_module aotus_module module~mus_source_var_module->module~aotus_module module~tem_stencil_module tem_stencil_module module~mus_source_var_module->module~tem_stencil_module module~mus_dervarpos_module mus_derVarPos_module module~mus_source_var_module->module~mus_dervarpos_module module~tem_varsys_module tem_varSys_module module~mus_source_var_module->module~tem_varsys_module module~tem_tools_module tem_tools_module module~mus_source_var_module->module~tem_tools_module module~mus_physics_module mus_physics_module module~mus_source_var_module->module~mus_physics_module module~tem_logging_module tem_logging_module module~mus_source_var_module->module~tem_logging_module module~tem_stringkeyvaluepair_module tem_stringKeyValuePair_module module~mus_source_var_module->module~tem_stringkeyvaluepair_module iso_c_binding iso_c_binding module~mus_source_var_module->iso_c_binding module~env_module env_module module~mus_source_var_module->module~env_module module~tem_aux_module tem_aux_module module~mus_source_var_module->module~tem_aux_module module~mus_scheme_header_module->module~aot_table_module module~mus_scheme_header_module->module~aotus_module module~mus_scheme_header_module->module~tem_tools_module module~mus_scheme_header_module->module~tem_logging_module module~mus_scheme_header_module->module~env_module module~mus_scheme_header_module->module~tem_aux_module module~aot_out_module aot_out_module module~mus_scheme_header_module->module~aot_out_module module~mus_dervarpos_module->module~tem_stencil_module module~mus_dervarpos_module->module~tem_varsys_module module~mus_dervarpos_module->module~env_module module~mus_dervarpos_module->module~tem_aux_module module~mus_scheme_layout_module mus_scheme_layout_module module~mus_dervarpos_module->module~mus_scheme_layout_module module~mus_physics_module->module~treelmesh_module module~mus_physics_module->module~aot_table_module module~mus_physics_module->module~aotus_module module~mus_physics_module->module~tem_tools_module module~mus_physics_module->module~tem_logging_module module~mus_physics_module->module~env_module module~mus_physics_module->module~tem_aux_module module~mus_physics_module->module~aot_out_module module~tem_geometry_module tem_geometry_module module~mus_physics_module->module~tem_geometry_module module~mus_scheme_layout_module->module~aot_table_module module~mus_scheme_layout_module->module~aotus_module module~mus_scheme_layout_module->module~tem_stencil_module module~mus_scheme_layout_module->module~tem_tools_module module~mus_scheme_layout_module->module~tem_logging_module module~mus_scheme_layout_module->module~env_module module~mus_scheme_layout_module->module~tem_aux_module module~mus_scheme_layout_module->module~aot_out_module module~tem_comm_env_module tem_comm_env_module module~mus_scheme_layout_module->module~tem_comm_env_module mpi mpi module~mus_scheme_layout_module->mpi module~mus_moments_type_module mus_moments_type_module module~mus_scheme_layout_module->module~mus_moments_type_module module~tem_grow_array_module tem_grow_array_module module~mus_scheme_layout_module->module~tem_grow_array_module module~tem_dyn_array_module tem_dyn_array_module module~mus_scheme_layout_module->module~tem_dyn_array_module module~tem_param_module tem_param_module module~mus_scheme_layout_module->module~tem_param_module module~mus_moments_type_module->module~env_module module~tem_matrix_module tem_matrix_module module~mus_moments_type_module->module~tem_matrix_module

Used by

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

Contents


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

    TypeIntentOptionalAttributesName
    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 if addSrcToAuxField is true in source_op_type for all nSolve elements (nFluids+nGhostFromCoarser +nGhostFromFiner). Halo elements are exchanged

    Arguments

    TypeIntentOptionalAttributesName
    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


Derived Types

type, public :: mus_source_op_type

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

Components

TypeVisibilityAttributesNameInitial
integer, private :: srcTerm_varPos

Position of this source term variable in the varSys

integer, private :: data_varPos

Position of data variable provided in config file in the varSys

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

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

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

Function to update state with source term

character(len=labelLen), private :: varname

to use source field array name of the source variable

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

Function pointer to append source field to auxilary variable

integer, private :: 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), private :: absLayer

Additional config information for absorbLayer

type, public :: mus_source_type

Description of musubi source type

Components

TypeVisibilityAttributesNameInitial
type(mus_source_op_type), private, allocatable:: method(:)

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

type(grw_stringkeyvaluepairarray_type), private :: 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 :: absorbLayer_config_type

Contains additional information for absorblayer source

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: target_pressure

target pressure

real(kind=rk), private :: target_velocity(3)

target velocityX, velocityY and velocityZ

logical, private :: isPressDyn =.false.

Use time average for pressure. Default: false.

logical, private :: isVelDyn =.false.

Use time average for Velocity. Default: false.

integer, private :: nRecord =100

Number of iterations to record for time-averaging

Stores time average values of density and velocity for dynamic absorbLayer

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private, allocatable:: dens(:)

density time average

real(kind=rk), private, allocatable:: velX(:)

velocity time average

real(kind=rk), private, allocatable:: velY(:)
real(kind=rk), private, allocatable:: velZ(:)
logical, private :: isInitDens =.true.

It is used to initialiye dynamic average density with initial condition

logical, private :: isInitVel =.true.

It is used to initialiye dynamic average velocity with initial condition

type, private :: mus_absorbLayer_type

Contains information for absorblayer

Components

TypeVisibilityAttributesNameInitial
type(absorbLayer_config_type), private :: config

Information loaded from configuration file

real(kind=rk), private :: smoothFac

Smoothing factor for expoential moving average = 2 / (nRecord+1)

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

TypeVisibilityAttributesNameInitial
integer, private :: nElems

Number of source elements on this level. nFluids + nGhosts

integer, private, 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, private, allocatable:: idx(:)

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

type(absorbLayerDynamic_average_type), private :: 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.


Subroutines

public subroutine mus_create_poss_srcVar(poss_srcVar, schemeHeader)

Routine initialize possible source variable depends on scheme kind

Arguments

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
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

TypeIntentOptionalAttributesName
type(mus_source_type), intent(inout) :: me

private subroutine load_absorbLayer(me, conf, key, parent, loadPres, loadVel)

This routine load additional information for absorblayer

Arguments

TypeIntentOptionalAttributesName
type(absorbLayer_config_type), intent(out) :: me

Absorb layer

type(flu_State) :: conf

flu state

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

Table name to load target states

integer, intent(in) :: parent

parent source handle

logical, intent(in) :: loadPres

Load pressure if true else set to dynamic

logical, intent(in) :: loadVel

Load velocity if true else set to dynamic