case_abl_t Derived Type

type, public, extends(base_case_t) :: case_abl_t


Inherits

type~~case_abl_t~~InheritsGraph type~case_abl_t case_abl_t type~abl_config_t abl_config_t type~case_abl_t->type~abl_config_t abl_cfg type~abl_diagnostics_t abl_diagnostics_t type~case_abl_t->type~abl_diagnostics_t diagnostics type~abl_t abl_t type~case_abl_t->type~abl_t abl type~base_case_t base_case_t type~case_abl_t->type~base_case_t type~inflow_config_t inflow_config_t type~case_abl_t->type~inflow_config_t inflow_cfg type~inflow_plane_reader_t inflow_plane_reader_t type~case_abl_t->type~inflow_plane_reader_t inflow_reader type~inflow_plane_writer_t inflow_plane_writer_t type~case_abl_t->type~inflow_plane_writer_t inflow_writer type~turbine_model_t turbine_model_t type~case_abl_t->type~turbine_model_t turbine type~wind_turbine_config_t wind_turbine_config_t type~case_abl_t->type~wind_turbine_config_t turbine_cfg type~base_config_t base_config_t type~abl_config_t->type~base_config_t type~abl_diagnostics_t->type~abl_config_t cfg type~base_backend_t base_backend_t type~abl_diagnostics_t->type~base_backend_t backend type~mesh_t mesh_t type~abl_diagnostics_t->type~mesh_t mesh type~abl_t->type~abl_config_t cfg type~allocator_t allocator_t type~abl_t->type~allocator_t host_allocator type~abl_t->type~base_backend_t backend type~field_t field_t type~abl_t->type~field_t damp_coeff type~abl_t->type~mesh_t mesh type~base_case_t->type~field_t bc_start_u_x, bc_start_v_x, bc_start_w_x, bc_end_u_x, bc_end_v_x, bc_end_w_x, bc_start_u_y, bc_start_v_y, bc_start_w_y, bc_end_u_y, bc_end_v_y, bc_end_w_y type~io_manager_t io_manager_t type~base_case_t->type~io_manager_t io_mgr type~monitoring_t monitoring_t type~base_case_t->type~monitoring_t monitoring type~solver_t solver_t type~base_case_t->type~solver_t solver type~inflow_config_t->type~base_config_t type~inflow_plane_reader_t->type~inflow_config_t cfg type~inflow_plane_reader_t->type~mesh_t mesh type~plane_block_t plane_block_t type~inflow_plane_reader_t->type~plane_block_t blocks type~inflow_plane_writer_t->type~inflow_config_t cfg type~inflow_plane_writer_t->type~base_backend_t backend type~inflow_plane_writer_t->type~mesh_t mesh type~checkpoint_state_t checkpoint_state_t type~turbine_model_t->type~checkpoint_state_t type~wind_turbine_config_t->type~base_config_t type~allocator_t->type~field_t first type~base_backend_t->type~allocator_t allocator type~base_backend_t->type~mesh_t mesh type~poisson_fft_t poisson_fft_t type~base_backend_t->type~poisson_fft_t poisson_fft type~field_t->type~field_t next type~io_manager_t->type~checkpoint_state_t additional_checkpoint_state type~checkpoint_manager_t checkpoint_manager_t type~io_manager_t->type~checkpoint_manager_t checkpoint_mgr type~snapshot_manager_t snapshot_manager_t type~io_manager_t->type~snapshot_manager_t snapshot_mgr type~stats_manager_t stats_manager_t type~io_manager_t->type~stats_manager_t stats_mgr type~geo_t geo_t type~mesh_t->type~geo_t geo type~grid_t grid_t type~mesh_t->type~grid_t grid type~par_t par_t type~mesh_t->type~par_t par type~scalar_series_t scalar_series_t type~monitoring_t->type~scalar_series_t series type~solver_t->type~allocator_t host_allocator type~solver_t->type~base_backend_t backend type~solver_t->type~field_t u, v, w, pressure, pressure_vert, dpdx_last, dpdy_last, dpdz_last, vort, qcrit type~solver_t->type~mesh_t mesh type~dirps_t dirps_t type~solver_t->type~dirps_t xdirps, ydirps, zdirps type~flist_t flist_t type~solver_t->type~flist_t species type~ibm_t ibm_t type~solver_t->type~ibm_t ibm type~les_t les_t type~solver_t->type~les_t les type~time_intg_t time_intg_t type~solver_t->type~time_intg_t time_integrator type~vector_calculus_t vector_calculus_t type~solver_t->type~vector_calculus_t vector_calculus type~checkpoint_config_t checkpoint_config_t type~checkpoint_manager_t->type~checkpoint_config_t config type~field_buffer_map_t field_buffer_map_t type~checkpoint_manager_t->type~field_buffer_map_t field_buffers type~tdsops_t tdsops_t type~dirps_t->type~tdsops_t der1st, der1st_sym, der2nd, der2nd_sym, stagder_v2p, stagder_p2v, interpl_v2p, interpl_p2v, lowpass, lowpass_sym type~flist_t->type~field_t ptr type~ibm_t->type~allocator_t host_allocator type~ibm_t->type~base_backend_t backend type~ibm_t->type~field_t ep1 type~ibm_t->type~mesh_t mesh type~les_t->type~field_t nut, mixing_length_sq type~poisson_fft_t->type~mesh_t mesh type~snapshot_manager_t->type~checkpoint_config_t config type~snapshot_manager_t->type~field_buffer_map_t field_buffers type~writer_session_t writer_session_t type~snapshot_manager_t->type~writer_session_t snapshot_writer type~stats_config_t stats_config_t type~stats_manager_t->type~stats_config_t config type~time_intg_t->type~allocator_t allocator type~time_intg_t->type~base_backend_t backend type~time_intg_t->type~flist_t olds type~vector_calculus_t->type~base_backend_t backend type~checkpoint_config_t->type~base_config_t type~stats_config_t->type~base_config_t type~io_session_base_t io_session_base_t type~writer_session_t->type~io_session_base_t type~io_writer_t io_writer_t type~writer_session_t->type~io_writer_t writer type~io_file_t io_file_t type~io_session_base_t->type~io_file_t file

Components

Type Visibility Attributes Name Initial
class(solver_t), public, allocatable :: solver
type(io_manager_t), public :: io_mgr
type(monitoring_t), public :: monitoring
class(field_t), public, pointer :: bc_start_u_x => null()
class(field_t), public, pointer :: bc_start_v_x => null()
class(field_t), public, pointer :: bc_start_w_x => null()
class(field_t), public, pointer :: bc_end_u_x => null()
class(field_t), public, pointer :: bc_end_v_x => null()
class(field_t), public, pointer :: bc_end_w_x => null()
class(field_t), public, pointer :: bc_start_u_y => null()
class(field_t), public, pointer :: bc_start_v_y => null()
class(field_t), public, pointer :: bc_start_w_y => null()
class(field_t), public, pointer :: bc_end_u_y => null()
class(field_t), public, pointer :: bc_end_v_y => null()
class(field_t), public, pointer :: bc_end_w_y => null()
type(abl_config_t), public :: abl_cfg
type(abl_t), public :: abl
type(abl_diagnostics_t), public :: diagnostics
type(inflow_config_t), public :: inflow_cfg
type(inflow_plane_writer_t), public :: inflow_writer

Precursor output: inflow planes for a successor run

type(inflow_plane_reader_t), public :: inflow_reader

Successor input: inflow planes from a precursor run

integer, public :: inflow_iter = -1

Iteration the inlet plane in bc_start_*_x was built for

real(kind=dp), public :: out_vel = 0._dp
real(kind=dp), public, allocatable :: flow_rate_y_weights(:)

y weights of the inlet and outlet flow rates (outflow correction)

type(wind_turbine_config_t), public :: turbine_cfg

Turbine settings from wind_turbine_nml, which is optional here

class(turbine_model_t), public, pointer :: turbine => null()

Turbine forcing model; only allocated when wind_turbine_nml asks for one


Constructor

public interface case_abl_t

  • public function case_abl_init(backend, mesh, host_allocator) result(flow_case)

    Arguments

    Type IntentOptional Attributes Name
    class(base_backend_t), intent(inout), target :: backend
    type(mesh_t), intent(inout), target :: mesh
    type(allocator_t), intent(inout), target :: host_allocator

    Return Value type(case_abl_t)


Type-Bound Procedures

procedure, public :: compute_outflow_params

  • public subroutine compute_outflow_params(self, out_vel, flow_rate_diff)

    Convective outflow number and inlet/outlet flow-rate imbalance for a case with an x inflow and a convective x outflow (the X_FACE form of field_set_face_from_field). Three slice reductions on the device and two batched MPI_Allreduces; no D2H copy of the full field. Assumes x is not decomposed, as the FFT Poisson solver requires. Without flow_rate_diff only the outflow number is computed.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    real(kind=dp), intent(out) :: out_vel
    real(kind=dp), intent(out), optional :: flow_rate_diff

procedure, public :: outflow_flow_rate_correction

  • public function outflow_flow_rate_correction(self, u, out_vel, y_weights) result(flow_rate_diff)

    The flow_rate_diff for the X_FACE stamp of field_set_face_from_field that makes the flow rate out equal the flow rate in exactly, as the pressure projection sees them. The x staggered derivative sums to (u(nx) - u(1))/dx over the cells, so only the two face planes enter, each weighted over y by y_weights: the case passes the weights of the y interpolation (1/2 on a non-periodic boundary plane, 1 elsewhere), with 0 on any plane it overwrites with the same value on both faces after the stamp. The stamp is linear in u, u(nx) <- (1 - c)u(nx) + cu(nx - 1) + flow_rate_diff, so the sums of the planes before it give the outlet flow rate after it. Call it with u as it is about to be stamped, once bc_start_u_x holds this substep's inlet plane. Assumes x is not decomposed, as compute_outflow_params does.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    class(field_t), intent(in) :: u
    real(kind=dp), intent(in) :: out_vel
    real(kind=dp), intent(in) :: y_weights(:)

    Return Value real(kind=dp)

procedure, public :: case_init

  • public subroutine case_init(self, backend, mesh, host_allocator)

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    class(base_backend_t), intent(inout), target :: backend
    type(mesh_t), intent(inout), target :: mesh
    type(allocator_t), intent(inout), target :: host_allocator

procedure, public :: case_finalise

procedure, public :: set_init

  • public subroutine set_init(self, field, field_func)

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t) :: self
    class(field_t), intent(inout) :: field
    public pure function field_func(coords) result(r)
    Arguments
    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: coords(3)
    Return Value real(kind=dp)

procedure, public :: substep

  • public subroutine substep(self, curr, deriv, iter)

    One time-integrator sub-stage: case-specific BCs, transeq, forcings, time integration, case BC re-application, IBM body force, and pressure correction. Extracted from run()'s per-sub-stage loop body so the same allocation path can be driven directly (e.g. by the memory-estimate probe) without going through the full time loop, I/O cadence, or diagnostics.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t), intent(inout) :: self
    type(flist_t), intent(inout) :: curr(:)
    type(flist_t), intent(inout) :: deriv(:)
    integer, intent(in) :: iter

procedure, public :: set_curr_fields

  • public subroutine set_curr_fields(self, curr, deriv)

    Allocates the time integrator field lists and points curr at the solver velocity and species fields. Shared by run() and x3d2-memcheck.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t), intent(inout) :: self
    type(flist_t), intent(out), allocatable :: curr(:)
    type(flist_t), intent(out), allocatable :: deriv(:)

procedure, public :: finish_step

  • public subroutine finish_step(self, iter, output_vorticity, output_qcriterion)

    The per-iteration work after the substeps: sets current_iter and computes the pressure and the derived fields. Shared by run() and x3d2-memcheck.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t), intent(inout) :: self
    integer, intent(in) :: iter
    logical, intent(in) :: output_vorticity
    logical, intent(in) :: output_qcriterion

procedure, public :: run

  • public subroutine run(self)

    Runs the solver forwards in time from t=t_0 to t=T, performing postprocessing/IO and reporting diagnostics.

    Arguments

    Type IntentOptional Attributes Name
    class(base_case_t), intent(inout) :: self

procedure, public :: define_BC => define_BC_abl

procedure, public :: initial_conditions => initial_conditions_abl

procedure, public :: forcings => forcings_abl

  • public subroutine forcings_abl(self, du, dv, dw, iter)

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self
    class(field_t), intent(inout) :: du
    class(field_t), intent(inout) :: dv
    class(field_t), intent(inout) :: dw
    integer, intent(in) :: iter

procedure, public :: apply_BC => apply_BC_abl

  • public subroutine apply_BC_abl(self, u, v, w)

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self
    class(field_t), intent(inout) :: u
    class(field_t), intent(inout) :: v
    class(field_t), intent(inout) :: w

procedure, public :: postprocess => postprocess_abl

  • public subroutine postprocess_abl(self, iter, t)

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self
    integer, intent(in) :: iter
    real(kind=dp), intent(in) :: t

procedure, public :: post_step => post_step_abl

  • public subroutine post_step_abl(self, iter, t)

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self
    integer, intent(in) :: iter
    real(kind=dp), intent(in) :: t

procedure, public :: finalise_case_specific => finalise_abl

  • public subroutine finalise_abl(self)

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self

procedure, public :: update_inflow_plane

  • public subroutine update_inflow_plane(self)

    Fill bc_start_*_x with the precursor plane for the iteration being computed. The plane is held for every substep of the iteration, as Incompact3d does, so it is uploaded once per iteration.

    Arguments

    Type IntentOptional Attributes Name
    class(case_abl_t) :: self