m_inflow_planes Module

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.


Uses

  • module~~m_inflow_planes~~UsesGraph module~m_inflow_planes m_inflow_planes m_mpi m_mpi module~m_inflow_planes->m_mpi module~m_base_backend m_base_backend module~m_inflow_planes->module~m_base_backend module~m_common m_common module~m_inflow_planes->module~m_common module~m_config m_config module~m_inflow_planes->module~m_config module~m_field m_field module~m_inflow_planes->module~m_field module~m_io_session m_io_session module~m_inflow_planes->module~m_io_session module~m_logger m_logger module~m_inflow_planes->module~m_logger module~m_mesh m_mesh module~m_inflow_planes->module~m_mesh module~m_base_backend->m_mpi module~m_base_backend->module~m_common module~m_base_backend->module~m_field module~m_base_backend->module~m_logger module~m_base_backend->module~m_mesh iso_c_binding iso_c_binding module~m_base_backend->iso_c_binding module~m_allocator m_allocator module~m_base_backend->module~m_allocator module~m_poisson_fft m_poisson_fft module~m_base_backend->module~m_poisson_fft module~m_tdsops m_tdsops module~m_base_backend->module~m_tdsops module~m_common->m_mpi module~m_common->module~m_logger module~m_config->module~m_common module~m_config->module~m_logger iso_fortran_env iso_fortran_env module~m_config->iso_fortran_env module~m_field->module~m_common module~m_field->iso_c_binding module~m_io_session->module~m_base_backend module~m_io_session->module~m_common module~m_io_session->module~m_field module~m_io_session->module~m_logger module~m_io_backend m_io_backend module~m_io_session->module~m_io_backend module~m_io_base m_io_base module~m_io_session->module~m_io_base module~m_logger->m_mpi module~m_logger->iso_fortran_env module~m_mesh->m_mpi module~m_mesh->module~m_common module~m_mesh->module~m_field module~m_mesh->module~m_logger module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content module~m_allocator->module~m_common module~m_allocator->module~m_field module~m_io_backend->module~m_base_backend module~m_io_backend->module~m_common module~m_io_backend->module~m_field module~m_io_backend->module~m_logger module~m_io_backend->module~m_io_base module~m_io_base->module~m_base_backend module~m_io_base->module~m_common module~m_io_base->module~m_field module~m_mesh_content->module~m_common module~m_mesh_content->module~m_logger module~m_poisson_fft->module~m_common module~m_poisson_fft->module~m_field module~m_poisson_fft->module~m_logger module~m_poisson_fft->module~m_mesh module~m_poisson_fft->module~m_tdsops module~m_tdsops->module~m_common module~m_tdsops->module~m_logger

Used by

  • module~~m_inflow_planes~~UsedByGraph module~m_inflow_planes m_inflow_planes module~m_case_abl m_case_abl module~m_case_abl->module~m_inflow_planes module~m_case_factory m_case_factory module~m_case_factory->module~m_case_abl module~m_memcheck_build m_memcheck_build module~m_memcheck_build->module~m_case_abl module~m_memcheck_build->module~m_case_factory program~x3d2_memcheck x3d2_memcheck program~x3d2_memcheck->module~m_memcheck_build program~xcompact xcompact program~xcompact->module~m_case_factory

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: INFLOW_FORMAT_VERSION = 1

Interfaces

public interface inflow_plane_writer_t

  • private function init(backend, mesh, cfg, dt) result(writer)

    Arguments

    Type IntentOptional 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

    Return Value type(inflow_plane_writer_t)

public interface inflow_plane_reader_t

  • private function init_reader(mesh, cfg) result(reader)

    Opens the first file to learn the plane count and spacing

    Arguments

    Type IntentOptional Attributes Name
    type(mesh_t), intent(inout), target :: mesh
    type(inflow_config_t), intent(in) :: cfg

    Return Value type(inflow_plane_reader_t)


Derived Types

type, public ::  inflow_plane_writer_t

Components

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

Constructor

private function init (backend, mesh, cfg, dt)

Type-Bound Procedures

procedure, public :: sample

type, public ::  inflow_plane_reader_t

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.

Components

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

Constructor

private function init_reader (mesh, cfg)

Opens the first file to learn the plane count and spacing

Type-Bound Procedures

procedure, public :: planes_at

Functions

public pure function inflow_file_name(prefix, block) result(filename)

File holding block block (1-based) of a plane database

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: prefix
integer, intent(in) :: block

Return Value character(len=:), allocatable


Subroutines

public subroutine read_inflow_block(filename, mesh, u, v, w, times, plane_dt)

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.

Arguments

Type IntentOptional 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