In this module the routines and data types for interpolation of fluid properties at particle locations are implemented.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r_lat |
Data type containing information required by routines to interpolate fluid properties to particle locations
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | bnd_x(2) |
Boundaries of interpolation stencil This indicates the offset of cells to each side of the cell containing the point to be interpolated intpBnds = (/ x_lo, x_hi, y_lo, y_hi, z_lo, z_hi /) For example: intpBnds = (/ -1, 1, -1, 1, -1, 1 /) will loop over all neighbor cells, intpBnds = (/ -1 1, -1, 1, 0, 0 /) will only loop over neighbors in x and y direction etc. |
|||
| integer, | public | :: | bnd_y(2) | ||||
| integer, | public | :: | bnd_z(2) | ||||
| integer, | public, | allocatable | :: | neighDirs(:,:) |
Directions of neighboring elements to interpolate from |
||
| integer, | public, | allocatable | :: | neighPaths(:,:) |
"Paths" in terms of iDirs with which to reach neighboring stencil elements This depends on the stencil being used. We need this because not every element to interpolate from is accessible using just one neighDir e.g. when using the D3Q19 stencil the "corner elements" cannot be reached using just one neighDir. |
||
| integer, | public | :: | Nelems |
Number of elements (neighbors + the center element) to interpolate from. If all direct neighbors are used this is 27 in 3D and 9 in 2D. |
|||
| procedure(wghtFunc), | public, | pointer, nopass | :: | getWght_x |
Functions to calculate interpolation weights |
||
| procedure(wghtFunc), | public, | pointer, nopass | :: | getWght_y | |||
| procedure(wghtFunc), | public, | pointer, nopass | :: | getWght_z | |||
| character(len=labelLen), | public | :: | interpolation_kind |
Label of interpolation scheme used can be e.g. 'delta', 'linear', or 'peskin' Peskin stencil currently only works in serial. |
1D discrete delta interpolation function. Used to interpolate the fluid property of a lattice cell with barycenter xf to the position of a particle xp.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r_lat |
Distance from particle to barycenter of fluid cell |
1D discrete delta interpolation function according to Peskin. Used to interpolate the fluid property of a lattice cell with barycenter xf to the position of a particle xp. Note that this function has a support of 2*dx so requires both neighbor and next-neighbor for interpolation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r_lat |
Distance from particle to barycenter of fluid cell (must be positive) |
Weight function for 1d linear interpolation or distribution. Given the distance from particle to fluid cell barycenter, it returns weight, where weight is a linear function of the distance between the position of the particle and the barycenter of the lattice site we are distributing to.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r |
Distance r = xp - x/dx from particle to lattice barycenter |
Function to return interpolation weight 1.0 regardless of input. We need this as the weight for the z-direction interpolation in case of d2q9 stencil.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r_lat |
Distance from particle to barycenter of fluid cell |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | xd | |||
| real(kind=rk), | intent(in) | :: | f0(0:) | |||
| real(kind=rk), | intent(in) | :: | f1(0:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | x_lat |
to particle position. Choose x, y or z component depending on which direction we are interpolating |
xd = (x-x0)/(x1-x0) = (x-x0)/dx
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_interpolator_type), | intent(inout) | :: | interpolator | |||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_interpolator_type), | intent(inout) | :: | interpolator |
getInterpolationBnds is used to determine which cells to interpolate fluid quantities from for a particle positioned at its coordOfOrigin + r_lat. The 8 cells obtained are the cells whose barycenter forms the tightest bounding cube around the particle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | r_lat(3) | |||
| integer, | intent(out) | :: | lo_x | |||
| integer, | intent(out) | :: | up_x | |||
| integer, | intent(out) | :: | lo_y | |||
| integer, | intent(out) | :: | up_y | |||
| integer, | intent(out) | :: | lo_z | |||
| integer, | intent(out) | :: | up_z |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_interpolator_type), | intent(in) | :: | interpolator | |||
| integer, | intent(in) | :: | logUnit |