Module containing subroutines for building MUSUBI specific source variables
Abstract interface to update state with source terms
Type | Intent | Optional | 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 |
Interface to add source to auxField vars in source_op_type for all nSolve elements (nFluids+nGhostFromCoarser+nGhostFromFiner). Halo elements are exchanged
Type | Intent | Optional | 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 |
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.
Type | Intent | Optional | 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 |
Stores correction term for HRR_bgk
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public, | allocatable | :: | dens(:) |
density |
||
real(kind=rk), | public, | allocatable | :: | vel(:,:) |
velocity |
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
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 |
Description contains list of elements on which source is active and function pointer to update source
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 |
Description of musubi source type
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 |
Contains source elements position in state array and idx to access data variable refered in config file. This type is defined for each level
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 |
Routine initialize possible source variable depends on scheme kind
Type | Intent | Optional | 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 |
Routine load musubi source terms for given key. key is glob_source or source
Type | Intent | Optional | 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 |
This routine act as a destructor for source type. The arrays allocated in mus_init_sourceTerms are destroyed here
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_source_type), | intent(inout) | :: | me |
Dummy routine for apply source
Type | Intent | Optional | 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 |
Dummy routine for add source to auxField
Type | Intent | Optional | 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 |
Dummy routine for update source variable
Type | Intent | Optional | 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 |
Load shape, bulk velocity and height for turbulent channel force
Type | Intent | Optional | 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 |