mus_derQuanPS_module Module

This module provides the MUSUBI specific functions for calculating macroscopic quantities from the state variables.

The depending common interface between MUSUBI and ATELES is defined in the tem_derived_module. The functionality for accessing a variable from the state and evaluating a lua function are also provided in the tem_derived module.

Do not use get_Element or get_Point routines to update the state !


Uses

Used by

  • module~~mus_derquanps_module~~UsedByGraph module~mus_derquanps_module mus_derQuanPS_module module~mus_variable_module mus_variable_module module~mus_variable_module->module~mus_derquanps_module module~mus_scheme_module mus_scheme_module module~mus_scheme_module->module~mus_variable_module module~mus_program_module mus_program_module module~mus_program_module->module~mus_scheme_module module~mus_dynloadbal_module mus_dynLoadBal_module module~mus_program_module->module~mus_dynloadbal_module module~mus_tools_module mus_tools_module module~mus_program_module->module~mus_tools_module module~mus_hvs_config_module mus_hvs_config_module module~mus_hvs_config_module->module~mus_scheme_module module~mus_config_module mus_config_module module~mus_hvs_config_module->module~mus_config_module module~mus_dynloadbal_module->module~mus_scheme_module module~mus_dynloadbal_module->module~mus_tools_module module~mus_tools_module->module~mus_scheme_module program~mus_harvesting mus_harvesting program~mus_harvesting->module~mus_scheme_module program~mus_harvesting->module~mus_hvs_config_module module~mus_config_module->module~mus_scheme_module module~mus_config_module->module~mus_tools_module module~mus_aux_module mus_aux_module module~mus_aux_module->module~mus_tools_module module~mus_tracking_module mus_tracking_module module~mus_tracking_module->module~mus_tools_module module~mus_hvs_aux_module mus_hvs_aux_module module~mus_hvs_aux_module->module~mus_tools_module module~mus_interpolate_verify_module mus_interpolate_verify_module module~mus_interpolate_verify_module->module~mus_config_module program~musubi musubi program~musubi->module~mus_program_module program~musubi->module~mus_config_module

Contents


Subroutines

public subroutine mus_append_derVar_lbmPS(varSys, solverData, fldLabel, derVarName)

subroutine to add derive variables for weakly compressible LBM (schemekind = 'passive_scalar') to the varsys. for passive scalar contains only one derive variable: density

Arguments

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

global variable system

type(mus_varSys_solverData_type), intent(in), target:: solverData

Contains pointer to solver data types

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

array of field label prefix. Size=nFields

type(grw_labelarray_type), intent(inout) :: derVarName

array of derive physical variables

public subroutine deriveEquilPS_FromMacro(density, velocity, iField, nElems, varSys, layout, res)

This routine computes equilbrium from density and velocity This must comply with mus_variable_module%derive_FromMacro

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: density(:)

Array of density. Single species: dens_1, dens_2 .. dens_n multi-species: dens_1_sp1, dens_1_sp2, dens_2_sp1, dens_2_sp2 ... dens_n_sp1, dens_n_sp2

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

Array of velocity. Size: dimension 1: n*nFields. dimension 2: 3 (nComp) 1st dimension arrangement for multi-species is same as density

integer, intent(in) :: iField

Current field

integer, intent(in) :: nElems

number of elements

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

variable system which is required to access fieldProp information via variable method data c_ptr

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

scheme layout contains stencil definition and lattice weights

real(kind=rk), intent(out) :: res(:)

Output of this routine Dimension: n*nComponents of res

public subroutine deriveAuxPS_fromState(derVarPos, state, iField, nElems, nSize, iLevel, stencil, varSys, auxField)

This routine computes auxField from state array

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_derVarPos_type), intent(in) :: derVarPos

Position of derive variable in variable system

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

Array of state n * layout%stencil(1)%QQ * nFields

integer, intent(in) :: iField

Current field

integer, intent(in) :: nElems

number of elements

integer, intent(in) :: nSize

number of elements in state array

integer, intent(in) :: iLevel

current level

type(tem_stencilHeader_type), intent(in) :: stencil

stencil header contains discrete velocity vectors

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

variable system which is required to access fieldProp information via variable method data c_ptr

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

Output of this routine Size: nElems*nAuxScalars

public subroutine deriveEquilPS_fromAux(derVarPos, auxField, iField, nElems, varSys, layout, fEq)

This routine computes equilbrium from auxField

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_derVarPos_type), intent(in) :: derVarPos

Position of derive variable in variable system

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

Array of auxField. Single species: dens_1, vel_1, dens_2, vel_2, .. dens_n, vel_n multi-species: dens_1_sp1, vel_1_spc1, dens_1_sp2, vel_1_spc2, dens_2_sp1, vel_2_spc2, dens_2_sp2, vel_2_spc2 ... dens_n_sp1, vel_n_sp1, dens_n_sp2, vel_n_spc2 Access: (iElem-1)*nAuxScalars + auxField_varPos

integer, intent(in) :: iField

Current field

integer, intent(in) :: nElems

number of elements

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

variable system which is required to access fieldProp information via variable method data c_ptr

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

scheme layout contains stencil definition and lattice weights

real(kind=rk), intent(out) :: fEq(:)

Output of this routine Dimension: n*QQ of res

public recursive subroutine derive_injectionPS(fun, varSys, elempos, time, tree, nElems, nDofs, res)

Derive injection variable defined as a source term for lbm passive scalar. It evaluates spacetime function defined in lua file for injection variable and convert it to state value which is to be added to the state

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

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

The variable system to obtain the variable from.

integer, intent(in) :: elempos(:)

Position of the TreeID of the element to get the variable for in the global treeID list.

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

Point in time at which to evaluate the variable.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

integer, intent(in) :: nElems

Number of values to obtain for this variable (vectorized access).

integer, intent(in) :: nDofs

Number of degrees of freedom within an element.

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

Linearized array dimension: (n requested entries) x (nComponents of this variable) x (nDegrees of freedom) Access: (iElem-1)fun%nComponentsnDofs + (iDof-1)*fun%nComponents + iComp

public recursive subroutine derive_equalInjectionPS(fun, varSys, elempos, time, tree, nElems, nDofs, res)

Derive injection variable defined as a source term for lbm passive scalar. It evaluates spacetime function defined in lua file for injection variable and convert it to state value which is to be added to the state

Arguments

TypeIntentOptionalAttributesName
class(tem_varSys_op_type), intent(in) :: fun

Description of the method to obtain the variables, here some preset values might be stored, like the space time function to use or the required variables.

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

The variable system to obtain the variable from.

integer, intent(in) :: elempos(:)

Position of the TreeID of the element to get the variable for in the global treeID list.

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

Point in time at which to evaluate the variable.

type(treelmesh_type), intent(in) :: tree

global treelm mesh info

integer, intent(in) :: nElems

Number of values to obtain for this variable (vectorized access).

integer, intent(in) :: nDofs

Number of degrees of freedom within an element.

real(kind=rk), intent(out) :: res(:)

Resulting values for the requested variable.

Linearized array dimension: (n requested entries) x (nComponents of this variable) x (nDegrees of freedom) Access: (iElem-1)fun%nComponentsnDofs + (iDof-1)*fun%nComponents + iComp

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

Update state with source variable "injection" Similar to derive routine but it updates the state whereas derive is used for tracking

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_source_op_type), intent(in) :: fun

Description of method to apply source terms

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

input pdf vector

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 applySrc_equalInjectionPS(fun, inState, outState, neigh, auxField, nPdfSize, iLevel, varSys, time, phyConvFac, derVarPos)

Update state with source variable "equalInjection" Simuilar to derive routine but it updates the state whereas derive is used for tracking

Read more…

Arguments

TypeIntentOptionalAttributesName
class(mus_source_op_type), intent(in) :: fun

Description of method to apply source terms

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

input pdf vector

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