Time-indexed y-z velocity planes for precursor-successor inflow.
A precursor run samples u, v, w on one y-z plane every sample_every
iterations and writes them in blocks of ntimesteps planes, one ADIOS2
file per block (Incompact3d append_outflow/write_outflow). A successor
reads the blocks back with read_inflow_block and imposes them as a
time-varying inflow. The on-disk layout is documented under "Precursor
inflow planes" in docs/source/user/input_file.rst; bump
INFLOW_FORMAT_VERSION when it changes.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | INFLOW_FORMAT_VERSION | = | 1 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_backend_t), | intent(inout), | target | :: | backend | ||
| type(mesh_t), | intent(inout), | target | :: | mesh | ||
| type(inflow_config_t), | intent(in) | :: | cfg | |||
| real(kind=dp), | intent(in) | :: | dt |
Opens the first file to learn the plane count and spacing
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(inout), | target | :: | mesh | ||
| type(inflow_config_t), | intent(in) | :: | cfg |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| class(base_backend_t), | public, | pointer | :: | backend | => | null() | |
| type(mesh_t), | public, | pointer | :: | mesh | => | null() | |
| type(inflow_config_t), | public | :: | cfg | ||||
| real(kind=dp), | public, | allocatable | :: | u(:,:,:) |
Buffered planes, (ntimesteps, ny, nz) per component on local y-z |
||
| real(kind=dp), | public, | allocatable | :: | v(:,:,:) |
Buffered planes, (ntimesteps, ny, nz) per component on local y-z |
||
| real(kind=dp), | public, | allocatable | :: | w(:,:,:) |
Buffered planes, (ntimesteps, ny, nz) per component on local y-z |
||
| real(kind=dp), | public, | allocatable | :: | times(:,:,:) |
Simulation time of each plane; 3D only to fit the array writer |
||
| real(kind=dp), | public, | allocatable | :: | host(:,:,:) |
Padded Cartesian scratch for the field-to-host copy |
||
| real(kind=dp), | public | :: | dt | = | 0._dp |
solver time step |
|
| integer, | public | :: | x_index | = | 0 |
global x vertex index of the plane |
|
| integer, | public | :: | i_local | = | 0 |
local x index, 0 if not on this rank |
|
| integer, | public | :: | n_filled | = | 0 |
planes sampled into the current block |
| private function init (backend, mesh, cfg, dt) |
| procedure, public :: sample |
Replays the planes of ninflows files as a time-varying inflow.
Plane n (1-based, counted across the files) is the inflow at time
n*plane_dt; between planes it is interpolated linearly, and after
the last plane the series repeats from the first.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(mesh_t), | public, | pointer | :: | mesh | => | null() | |
| type(inflow_config_t), | public | :: | cfg | ||||
| integer, | public | :: | ntimesteps | = | 0 |
planes per file |
|
| real(kind=dp), | public | :: | plane_dt | = | 0._dp |
time between planes |
|
| type(plane_block_t), | public | :: | blocks(2) |
Two files are enough to interpolate across a file boundary |
| private function init_reader (mesh, cfg) | Opens the first file to learn the plane count and spacing |
| procedure, public :: planes_at |
File holding block block (1-based) of a plane database
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | prefix | |||
| integer, | intent(in) | :: | block |
Read one block on this rank's y-z subdomain. The arrays are allocated
here as (ntimesteps, ny, nz) on the local VERT dims, and times as
(ntimesteps). The rank layout may differ from the precursor's, but the
global y-z vertex counts must match.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(mesh_t), | intent(in) | :: | mesh | |||
| real(kind=dp), | intent(out), | allocatable | :: | u(:,:,:) | ||
| real(kind=dp), | intent(out), | allocatable | :: | v(:,:,:) | ||
| real(kind=dp), | intent(out), | allocatable | :: | w(:,:,:) | ||
| real(kind=dp), | intent(out), | allocatable | :: | times(:) | ||
| real(kind=dp), | intent(out), | optional | :: | plane_dt |
Time between planes, sample_every*dt of the precursor |