Module that defines objects and methods to manage boundary conditions.
To setup boundary conditions in LEAP, users should define regions first, then specify the type of boundary condition to apply for each variable that admits a boundary condition on this region.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | BC_DIRICHLET | = | 4 | |
| integer, | public, | parameter | :: | BC_INFLOW | = | 2 | |
| integer, | public, | parameter | :: | BC_LEFT | = | 0 | |
| integer, | public, | parameter | :: | BC_NEUMANN | = | 5 | |
| integer, | public, | parameter | :: | BC_OUTFLOW | = | 3 | |
| integer, | public, | parameter | :: | BC_RIGHT | = | 1 | |
| integer, | public, | parameter | :: | BC_SYMMETRY | = | 7 | |
| integer, | public, | parameter | :: | BC_WALL | = | 1 | |
| integer, | private, | parameter | :: | BC_SET_HTBL_SIZE | = | 20 | |
| integer, | private, | parameter | :: | BC_UNDEFINED | = | 0 |
Collection of regions
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(block_obj), | public, | pointer | :: | block | => | null() |
Associated block structure |
| integer, | public | :: | count | = | 0 |
Total number of regions across all MPI ranks |
|
| type(hdf5_obj), | public, | pointer | :: | hdf5 | => | null() |
HDF5 object for IO |
| type(parallel_obj), | public, | pointer | :: | parallel | => | null() |
Associated parallel structure |
| type(region_obj), | public, | allocatable | :: | region(:) |
Array of regions |
||
| type(hashtbl_obj), | private | :: | tbl |
Hash table |
Extents of a region
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | hi(3) | = | -1 |
High bound |
|
| integer, | public | :: | lo(3) | = | -1 |
Low bound |
Specifies boundary conditions for a given variable
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=str8), | public | :: | name |
Name of variable |
|||
| integer, | public | :: | type | = | BC_UNDEFINED |
Type of BC |
|
| real(kind=wp), | public, | pointer | :: | val(:,:,:) | => | null() |
Values on the parent region |
Defines regions where boundary conditions are applied.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(bc_obj), | public, | allocatable | :: | BC(:) |
Variables on this region |
||
| integer, | public | :: | count | = | 0 |
Count of variables defined on this region |
|
| integer, | public | :: | dir |
Normal direction (=1,2,3) |
|||
| integer, | public | :: | hi(3) | = | -100 |
Grid hi bound |
|
| integer, | public | :: | lo(3) | = | -100 |
Grid low bound |
|
| character(len=:), | public, | allocatable | :: | name |
Name of this region |
||
| type(block_obj), | public | :: | region |
Block/grid for this region |
|||
| integer, | public | :: | side |
Side (BC_LEFT or BC_RIGHT) |
|||
| real(kind=wp), | public | :: | xhi(3) |
Position of upper right corner |
|||
| real(kind=wp), | public | :: | xlo(3) |
Position of lower left corner |
|||
| type(hashtbl_obj), | private | :: | tbl |
Hash table |
| procedure, public :: Add => region_obj_Add | |
| procedure, public :: Expand => region_obj_Expand | |
| procedure, public :: Finalize => region_obj_Final | |
| procedure, public :: GetBCIndex => region_obj_GetBCIndex | |
| procedure, public :: Initialize => region_obj_Init |
Checks whether there is BC for a given variable on a given region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| character(len=*), | intent(in) | :: | var |
Variable name |
Result
Makes sure bounds represent a plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | xlo(3) |
Lower left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Upper right corner |
True, if bounds represent a plane
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| character(len=*), | intent(in) | :: | var |
Variable name |
Result
Returns the extents (lo and hi bounds) of a region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Region name |
Result
Returns the index of a region, or -1 if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Region name |
Result
Returns index of a variable in this region, or -1 if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(in) | :: | this |
A boundary region object |
||
| character(len=*), | intent(in) | :: | name |
Name of region |
Result
Adds a new region to bc_set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Name of region |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Position of lower left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Position of upper right corner |
||
| character(len=*), | intent(in) | :: | normal |
Oriented normal |
Builds an integer field, where cells=0 denotes interior cells, and cells=1 denotes boundary cells for input variable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Name of the variable |
||
| type(eulerian_obj_i), | intent(inout) | :: | mask |
Mask for this variable |
Resizes array to accomodate a new element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
Finalizes bc_set and frees memory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
Fetches a pointer to the val array describing the Dirichlet or Neumann BC of a given variable on a given region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| character(len=*), | intent(in) | :: | var |
Variable name |
||
| real(kind=wp), | intent(inout), | pointer | :: | val(:,:,:) |
Pointer |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | normal |
String denoting the normal direction |
||
| integer, | intent(out) | :: | side |
Side (=BC_LEFT,BC_RIGHT) |
||
| integer, | intent(out) | :: | dir |
Direction (=1,2,3,) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| integer, | intent(out) | :: | side |
Side (=BC_LEFT,BC_RIGHT) |
||
| integer, | intent(out) | :: | dir |
Direction (=1,2,3,) |
Prints to stdout information on bc_set, for debugging.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
Initializes bc_set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| type(block_obj), | intent(in), | target | :: | block |
A block object |
|
| type(parallel_obj), | intent(in), | target | :: | parallel |
Parallel structure to link with |
Reads boundary conditions from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| integer, | intent(out) | :: | iter |
Iteration read from file |
||
| real(kind=wp), | intent(out) | :: | time |
Time read from file |
||
| character(len=*), | intent(in), | optional | :: | name |
Name of file to write |
Sets boundary condition of a given type, for a given variable on a given region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| integer, | intent(in) | :: | type |
BC type |
||
| character(len=*), | intent(in), | optional | :: | var |
Variable name |
Updates ghost cells to enforce Dirichlet BC
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| type(eulerian_obj_r), | intent(inout) | :: | var |
Eulerian variable |
Updates ghostcells to enforce Neumann BC.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| type(eulerian_obj_r), | intent(inout) | :: | var |
Eulerian variable |
Imposes boundary conditions for a scalar variable.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| type(eulerian_obj_r), | intent(inout) | :: | var |
Eulerian variable |
Updates ghostcells to enforce symmetry BC. Minus version.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| type(eulerian_obj_r), | intent(inout) | :: | var |
Eulerian variable |
Updates ghostcells to enforce symmetry BC. Plus version.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | region |
Region name |
||
| type(eulerian_obj_r), | intent(inout) | :: | var |
Eulerian variable |
Imposes boundary conditions for a vector field. For symmetry BC, the sign depends is 'plus' or 'minus' depending on the alignment between the vector component and the symmetry direction.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(in) | :: | this |
Boundary conditions utility |
||
| type(eulerian_obj_r), | intent(inout) | :: | var(3) |
Eulerian variable |
Finds the intersection between block owned by this MPI rank, and the plane defining the region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| character(len=*), | intent(in) | :: | name |
Region name |
Writes bc_set to disk using HDF5. The file structure follows this convention:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
||
| integer, | intent(in) | :: | iter |
Iteration at write |
||
| real(kind=wp), | intent(in) | :: | time |
Time at write |
||
| character(len=*), | intent(in), | optional | :: | name |
Name of file to write |
Adds a new variable to region.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(inout) | :: | this |
A boundary region object |
||
| character(len=*), | intent(in) | :: | name |
Region name |
||
| integer, | intent(in) | :: | type |
Type of boundary condition |
||
| type(extent_obj), | intent(in) | :: | extents |
Region extents |
Resizes array to accomodate a new element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(inout) | :: | this |
A boundary region object |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(inout) | :: | this |
A boundary region object |
Initializes a region
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(region_obj), | intent(inout) | :: | this |
A boundary region object |
||
| character(len=*), | intent(in) | :: | name |
Name of region |
||
| real(kind=wp), | intent(in) | :: | xlo(3) |
Position of low left corner |
||
| real(kind=wp), | intent(in) | :: | xhi(3) |
Position of high right corner |
||
| integer, | intent(in) | :: | dir |
Direction of normal |
||
| integer, | intent(in) | :: | side |
Side (left or right) of the cell |