This module contains datatypes and subroutines for the immersed boundary method (IBM).
IBM: some more information on IBM
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | nTimers | = | 14 |
log units for the IBM |
integer, | private, | save | :: | IBM_logUnit(0:tem_last_lu) | |||
integer, | private, | save | :: | mess_velX | = | 22 | |
integer, | private, | save | :: | mess_forceXk | = | 23 | |
integer, | private, | save | :: | mess_amountXk | = | 24 | |
integer, | private, | save | :: | mess_posXk | = | 25 | |
integer, | private, | save | :: | mess_pointsXk | = | 26 | |
integer, | private, | save | :: | mess_velXk | = | 27 | |
integer, | private, | save | :: | mess_posXk2 | = | 28 | |
integer, | private, | save | :: | mess_velXk2 | = | 29 | |
integer, | private, | save | :: | fileID | = | 1 |
Datatype containing information on the immersed boundary method
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | active | = | .false. |
is this IBM active? |
|
type(tem_surfData_type), | public | :: | surfData |
surface data information incl. the filenames, point coordinates and corresponding triangle data |
|||
character(len=LabelLen), | public | :: | label |
label for indentifying the type of IBM |
|||
integer, | public | :: | stencilPos |
position of the stencil in layout%stencil array |
|||
logical, | public | :: | useInitPos |
use the initial positions in the movement function or use the updated values |
|||
logical, | public | :: | movPredef |
is the motion predefined? If a movement and velocity spacetime function is provided the new positions can be caluclated locally. This reduced the amount of communication. |
|||
type(tem_spacetime_fun_type), | public | :: | movement |
spacetime function type describing the movement of the points |
|||
type(tem_spacetime_fun_type), | public | :: | velocity |
spacetime function type describing the velocity of movement |
|||
integer, | public | :: | nInaIters |
number of iterations for calculating the force |
|||
type(dyn_intarray_type), | public | :: | neighs_Xk |
temporary dynamic array for storing the actual neighbor positions of the Xk |
|||
integer, | public | :: | locNeighs_Xk | = | 0 |
number of local neighbor elements |
|
type(tem_labeledtimer_type), | public | :: | timings |
timer type for evaluating runtime in different routines |
|||
integer, | public, | allocatable | :: | timerHandles(:) |
array of timer handles (definition in mus_init_IBM) |
||
type(mus_IBM_tmpData_type), | public | :: | IBMData |
temporary data used |
This datatype is a wrapper for the immersed boundary information and a possible logging type for debugging
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(mus_IBM_type), | public, | allocatable | :: | IBM(:) |
the immersed boundary data |
||
integer, | public | :: | nIBMs |
number of immersed boundaries |
|||
type(tem_logging_type), | public | :: | logIBM |
logging unit for IBM debug output to file |
This datatype includes all necessary variables needed for 1 IBM step. It will be filled at every timestep.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public, | allocatable | :: | force_Xk(:) |
tmp array holding the body force at the lagrangian surface points Xk (Inamuro paper: \f$ g_{l}(X_{k}, t+\delta t) \f$) size: nPoints*3 |
||
real(kind=rk), | public, | allocatable | :: | force_X(:) |
tmp array holding the body force at the eulerian grid elements X (Inamuro paper: \f$ g_{l}(x, t+\delta t) \f$) size: nPoints*stencil%QQ, 3 |
||
real(kind=rk), | public, | allocatable | :: | vel_Xk(:) |
tmp array holding the velocity at the lagrangian surface points Xk (Inamuro paper: \f$ u_{l}(X_{k}, t+\delta t) \f$) size: nPoints*3 |
||
real(kind=rk), | public, | allocatable | :: | vel_X(:) |
tmp array holding the velocity at the eulerian grid elements X (Inamuro paper: \f$ u_{l}(x, t+\delta t) \f$) size: nPoints*stencil%QQ, 3 |
||
real(kind=rk), | public, | allocatable | :: | vel_Xk_ini(:) |
tmp array holding the initial velocity at the lagrangian points Xk (Inamuro paper: \f$ u(X_{k}, t+\delta t) \f$) size: nPoints3 |
||
real(kind=rk), | public, | allocatable | :: | vel_X_ini(:) |
tmp array holding the initial velocity at the eulerian grid elements X (Inamuro paper: \f$ u(x, t+\delta t) \f$) size: nPointsstencil%QQ, 3 |
||
real(kind=rk), | public, | allocatable | :: | vel_Xk_surf(:) |
tmp array holding the predef. velocity at the lagrangian surface points X (Inamuro paper: \f$ U_{k}(t+\delta t) \f$) size: nPoints*3 |
||
integer, | public, | allocatable | :: | ptrs_neighs_Xk(:) |
temporary array storing pointers to the dynamic array of neighbor positions in the total treeID list of the parent elements of Xk size: nPoints * stencil%QQ |
||
type(grw_intarray_type), | public, | allocatable | :: | neighs_x(:) |
temporary dynamic array for storing the actual neighbor positions of the Xk tmp array for storing the neighbor positions in the total treeID list of the eulerian grid points |
||
real(kind=rk), | public, | allocatable | :: | inaDelta_Xk(:) |
tmp array for the result of the inamura delta function for the lagrangian points X size: nPoints * stencil%QQ |
||
type(grw_realarray_type), | public, | allocatable | :: | inaDelta_X(:) |
tmp array for the result of the inamura delta function for the eulerian points X size: nElems (fluid, ghosts, halos) |
||
type(tem_communication_type), | public | :: | IBMSend_Xk |
sendBuffer to communicate the force values on Xk (on this process) |
|||
type(tem_communication_type), | public | :: | IBMRecv_Xk |
recvBuffer to communicate the force values on Xk (on this process) |
|||
type(grw_intarray_type), | public, | allocatable | :: | posXk(:) |
tmp array of growing arrays storing the Xk positions |
||
type(tem_communication_type), | public | :: | IBMSend_X |
sendBuffer to communicate the force values on X (on this process) |
|||
type(tem_communication_type), | public | :: | IBMRecv_X |
recvBuffer to communicate the force values on X (on this process) |
|||
integer, | public, | allocatable | :: | map2globSend(:) |
map from the global send proc array to the local one |
||
integer, | public, | allocatable | :: | map2globRecv(:) |
map from the global recv proc array to the local one |
||
type(tem_communication_type), | public | :: | IBMSend_X_pdf |
sendBuffer to communicate the pdf values on X (on this process) |
|||
type(tem_communication_type), | public | :: | IBMRecv_X_pdf |
recvBuffer to communicate the pdf values on X (on this process) |
|||
integer, | public, | allocatable | :: | map2globSend_pdf(:) |
map from the global send proc array to the local one |
||
integer, | public, | allocatable | :: | map2globRecv_pdf(:) |
map from the global recv proc array to the local one |
||
type(grw_intarray_type), | public, | allocatable | :: | treeIDs(:) |
tmp array of growing arrays storing the treeID position at the send proc |
Load the IBM information from the lua config file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_globType), | intent(inout) | :: | me |
datatype to store the surface information |
||
type(flu_State), | intent(in) | :: | conf |
handle of the lua config file |
||
integer, | intent(in) | :: | rank |
the current rank |
This subroutine initializes the IBM data incl. reading the stl, unifying the coordinates, storing the connectivity, allocating the parentIDs array and initializing the stencil used.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_globType), | intent(inout) | :: | me |
datatype to store the surface information |
||
type(treelmesh_type), | intent(in) | :: | globTree |
global tree information |
This subroutine sets the positions of the parent IDs in the level descriptor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nIBMs |
number of IBM types |
||
type(mus_IBM_type), | intent(inout) | :: | me(:) |
datatype to store the surface information |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc(:) |
the level descriptor incl. ghost and halo elements as well as the communicator information on the level iLevel |
||
type(treelmesh_type), | intent(inout) | :: | tree |
global Tree information |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me(:) |
datatype to store the surface information |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern |
||
type(treelmesh_type) | :: | globTree |
global tree information |
|||
type(mus_param_type) | :: | params |
global parameters |
|||
type(mus_scheme_layout_type) | :: | layout |
scheme layout of the current scheme incl. array of stencils |
|||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. ghost and halo elements as well as the communicator information on the level iLevel |
||
integer, | intent(in) | :: | iLevel |
the current level |
This subroutine modifies the state vector according to the method described in the paper \a Lift generation by a two-dimensional symmetric flapping wing: immersed boundary-lattice Boltzmann simulations \a by Inamuro et al. @cite Ota:2012bx .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me(:) |
datatype to store the surface information |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern |
||
type(treelmesh_type) | :: | globTree |
global tree information |
|||
type(tem_general_type), | intent(in) | :: | general |
general data |
||
type(pdf_data_type), | intent(inout) | :: |
pdf_data_type incl. connectivity array on all levels |
|||
type(mus_scheme_layout_type) | :: | layout |
scheme layout of the current scheme incl. array of stencils |
|||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. ghost and halo elements as well as the communicator information on the level iLevel |
||
type(tem_varSys_type) | :: | globSys |
global variable system of the current scheme |
|||
integer, | intent(in) | :: | stateVarMap(:) |
Position of state variables in globSys |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
||
integer, | intent(in) | :: | iField |
the current field |
||
integer, | intent(in) | :: | iLevel |
the current level |
||
real(kind=rk), | intent(inout) | :: | state(:,:) |
state_data type |
This routine dumps the timings%timedat to disc
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_globType), | intent(inout) | :: | me |
global IBM datatype incl. array of IBM datatypes |
||
type(mus_param_type), | intent(in) | :: | params |
global parameters |
||
logical, | intent(in) | :: | useTime |
use the timestamps when dumping the info? |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me(:) |
IBM data type |
||
type(tem_comm_env_type), | intent(in) | :: | proc |
Global parameters |
||
integer, | intent(in) | :: | minLevel |
Level range |
||
integer, | intent(in) | :: | maxLevel |
Level range |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me(:) |
IBM data type |
||
integer, | intent(in) | :: | iField |
scheme and field number |
||
type(tem_levelDesc_type), | intent(inout) | :: | LevelDesc(:) |
Global parameters Level desc |
||
type(treelmesh_type), | intent(inout) | :: | tree |
tree |
Load a single IBM table from the config file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me |
datatype to store the surface information |
||
type(flu_State), | intent(in) | :: | conf |
handle of the lua config file |
||
integer, | intent(in) | :: | sub_handle |
handle for the surfaceData table |
This routine builds the neighbor lists for Xk -> x (neigh_Xk) and x->Xk (neigh_x) as well as the send and receive buffers for the eulerian elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me |
IBM data including the surface data |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil(:) |
array of stencils (1 is the fluid stencil) |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. ghost and halo elements on the level iLevel |
||
type(treelmesh_type), | intent(in) | :: | globTree |
global tree information |
||
integer, | intent(in) | :: | parentIDs(:) |
array of parentID positions hosting the lagrangian points |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern to be used |
||
type(mus_param_type), | intent(inout) | :: | params |
global parameters |
This subroutine fills the initial force, initial velocity, predef. velocity array for the surface points Xk as well as the velocity array for the neighbors.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(in) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
real(kind=rk), | intent(in) | :: | state(:) |
the state array holding the pdfs |
||
type(treelmesh_type), | intent(in) | :: | globTree |
global tree information |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil(:) |
stencil used by the IBM |
||
integer, | intent(in) | :: | stencilPos |
position of the IBM stencil |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc |
level descriptor incl. ghost and fluid elements |
||
type(tem_varSys_type) | :: | globSys |
global variable system of the current scheme |
|||
integer | :: | pdfPos |
position of the velocity in the global variable system |
|||
integer | :: | iLevel |
the current level |
|||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
This subroutine fills the force array for the X (neighbors). (Inamuro paper: step 1, fill g_l(X))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(in) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid elements on this process |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
This subroutine corrects the velocity values according to the force on X (neighbors). (Inamuro paper: step 2, correct u_l(X))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(in) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
This subroutine interpolates the velocity values using the velocity on Xk. (neighbors). (Inamuro paper: step 3, correct u_l(X_k))
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
integer, | intent(in) | :: | nNeighs |
the number of neighbors for the surface points |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
||
integer, | intent(in) | :: | nPoints |
number of points |
||
integer, | intent(in) | :: | parentIDs(:) |
array of parentID positions hosting the lagrangian points |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid elements on this process |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
||
integer, | intent(in) | :: | nPoints |
number of points |
||
integer, | intent(in) | :: | parentIDs(:) |
array of parentID positions hosting the lagrangian points |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid elements on this process |
This subroutine applies the force calculated to the eulerian elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(in) | :: | me |
datatype to store the surface information |
||
real(kind=rk), | intent(inout) | :: | state(:) |
the state array holding the pdfs |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(mus_scheme_layout_type), | intent(in) | :: | layout |
scheme layout of the current scheme incl. array of stencils and weights |
||
integer, | intent(in) | :: | varPos(:) |
variable positions of the state variables in the levelDesc/state vector |
||
integer, | intent(in) | :: | nScalars |
number of scalars in the global variable system |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid elements on this partition and level |
||
type(mus_convertFac_type), | intent(in) | :: | convFac |
conversion factors |
||
type(tem_time_type), | intent(in) | :: | time |
current time |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc |
level descriptor incl. ghost and fluid elements |
This subroutine builds the communication types for the lagrangian elements Xk.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. the global send and receive buffers |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern to be used |
||
type(treelmesh_type), | intent(inout) | :: | globTree |
global tree information |
||
integer, | intent(in) | :: | iLevel |
current level |
||
type(mus_param_type), | intent(inout) | :: | params |
global parameters |
This subroutine prepares the send and receive buffers for the eulerian elements by copying information from the send and receive buffers for the lagrangian elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
IBM temporary datatype incl. map2glob and communicator for send and recv |
||
type(tem_communication_type), | intent(in) | :: | globSend |
global send communicator |
||
integer, | intent(in) | :: | treeIDPos |
element position in the level desc total list |
||
integer, | intent(in) | :: | startPos |
starting position of what to send as elemPos |
||
integer(kind=long_k), | intent(in) | :: | parentID |
element position in the level desc total list |
||
type(treelmesh_type), | intent(in) | :: | globTree |
global tree information |
||
logical, | intent(inout) | :: | added(:) |
is this element added to the communication |
||
logical | :: | match |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
IBM temporary datatype incl. map2glob and communicator for send and recv |
||
type(tem_communication_type), | intent(in) | :: | globRecv |
global recv communicator |
||
integer, | intent(in) | :: | treeIDPos |
element position in the level desc total list |
||
integer, | intent(in) | :: | startPos |
starting position of what to recv as elemPos |
||
logical, | intent(inout) | :: | added(:) |
is this element added to the communication |
||
logical | :: | match |
This subroutine initializes all arrays in the mus_IBM_tmpData_type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | me |
tmpData type to be initialized |
||
type(mus_IBM_type), | intent(inout) | :: | IBM |
IBM datatype |
||
integer, | intent(in) | :: | totNeighs |
total number of neighbors: number of surface points*stencil%QQ |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid nodes on this process |
This routine frees all temporary variables and destroys growing arrays as well as the communicators.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | me |
tmpData type to be initialized |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern to be used |
||
integer, | intent(in) | :: | nElems_fluid |
number of fluid nodes on this process |
This routine calculates the surface velocity for all local xk.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(in) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(tem_levelDesc_type), | intent(in) | :: | levelDesc |
level descriptor incl. ghost and fluid elements |
||
type(tem_general_type), | intent(in) | :: | general |
general info |
||
integer | :: | iLevel |
the current level |
This subroutine communicates all elements which just moved from the fluids to the halo elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. the global send and receive buffers |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern to be used |
||
type(treelmesh_type), | intent(inout) | :: | globTree |
global tree information |
||
type(tem_surfData_type), | intent(inout) | :: | surfData |
the surface data incl. the coordinates for the Xk |
||
integer, | intent(in) | :: | iLevel |
current level |
||
integer, | intent(in) | :: | comm |
process description to use |
This routine finishes the buffers for Xk and X_pdf. This is moved to a seperate routine since both buffers depend on a local communication which should be done nearby the global synchronization point (mus_exchange)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mus_IBM_type), | intent(inout) | :: | me |
datatype to store the surface information |
||
type(mus_IBM_tmpData_type), | intent(inout) | :: | IBMData |
tmp IBMData type to be filled |
||
type(tem_levelDesc_type), | intent(inout) | :: | levelDesc |
the level descriptor incl. the global send and receive buffers |
||
type(tem_commPattern_type), | intent(inout) | :: | commPattern |
communication pattern to be used |
||
type(treelmesh_type), | intent(inout) | :: | globTree |
global tree information |
||
integer, | intent(in) | :: | iLevel |
current level |
||
integer, | intent(in) | :: | comm |
MPI communicator |
||
type(tem_stencilHeader_type), | intent(in) | :: | stencil(:) |
array of stencils (1 is the fluid stencil) |