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. A Novel lattice boltzmann model for poisson equation author> Zhenhua Chai , Baochang Shi A Coupled Lattice Boltzmann method to solve Nernst -Planck Model for simulating Electro-Osmotic Flows
subroutine to add derive variables for weakly compressible PB (schemekind = 'poisson') to the varsys. A Coupled Lattice Boltzmann Method to Solve Nernst-Planck Model for Simulating Electro-Osmotic flows author> Xuguang yang
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
||
character(len=*), | intent(in) | :: | schemeKind | scheme kind |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | compute stencil defintion |
This routine computes auxField 'potential' from state array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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) | :: | neigh(:) | connectivity vector |
||
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 |
This routine computes equilbrium from auxField
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Update state with source variable "ChargeDensity" with 2nd order integration of source Term. Refer to Appendix in PhD Thesis of K. Masilamani "Coupled Simulation Framework to Simulate Electrodialysis Process for
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Update state with source variable "ChargeDensity" with 1st order integration of source Term. Refer to Appendix in PhD Thesis of K. Masilamani "Coupled Simulation Framework to Simulate Electrodialysis Process for Seawater Desalination"
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate charge density source variable referred in config file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate the electric_field of a given pre-collision pdfs i.e fetch_pdf_now
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil | fluid stencil defintion |
||
integer, | intent(in) | :: | iLevel | current Level |
||
integer, | intent(in) | :: | posInState(:) | Position of element in levelwise state array |
||
real(kind=rk), | intent(in) | :: | pdf(:) | pdf array contains pre-collision using FETCH and nNow |
||
real(kind=rk), | intent(out) | :: | res(:) | results |
||
integer, | intent(in) | :: | nVals | nVals to get |
Calculate the electric field of a given set of elements (sum up all links). This routine is used to compute electric field for all scheme kinds
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate the electric field of a given set of elements (sum up all links). This routine is used to compute electric field for all scheme kinds
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
||
type(tem_time_type), | intent(in) | :: | time | Point in time at which to evaluate the variable. |
||
integer, | intent(in) | :: | iLevel | Level on which values are requested |
||
integer, | intent(in) | :: | idx(:) | Index of points in the growing array and variable val array to return. Size: nVals |
||
integer, | intent(in), | optional | :: | idxLen(:) | With idx as start index in contiguous memory, idxLength defines length of each contiguous memory Size: nVals |
|
integer, | intent(in) | :: | nVals | Number of values to obtain for this variable (vectorized access). |
||
real(kind=rk), | intent(out) | :: | res(:) | Resulting values for the requested variable. Dimension: n requested entries x nComponents of this variable Access: (iElem-1)*fun%nComponents + iComp |
Calculate charge density from potential field using Boltzmann approximation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
Calculate charge density from potential field using Boltzmann approximation from given index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
||
type(tem_time_type), | intent(in) | :: | time | Point in time at which to evaluate the variable. |
||
integer, | intent(in) | :: | iLevel | Level on which values are requested |
||
integer, | intent(in) | :: | idx(:) | Index of points in the growing array and variable val array to return. Size: nVals |
||
integer, | intent(in), | optional | :: | idxLen(:) | With idx as start index in contiguous memory, idxLength defines length of each contiguous memory Size: nVals |
|
integer, | intent(in) | :: | nVals | Number of values to obtain for this variable (vectorized access). |
||
real(kind=rk), | intent(out) | :: | res(:) | Resulting values for the requested variable. Dimension: n requested entries x nComponents of this variable Access: (iElem-1)*fun%nComponents + iComp |