mod_input Module

Parsing and validation of simulation parameters from case.nml.

This module handles the ingestion of user-defined parameters using Fortran namelists. It is structured to read parameters in logical groups: - mesh_input: Path to the native hexahedral grid files. - time_input: Step counts, timestep size, and CFL control. - fluid_input: Constant/Cantera properties (density, viscosity). - solver_input: Linear solver tolerances and numerical schemes. - boundary_input: Mapping of BC types and values to mesh patches. - species_input: Multi-species transport and chemical mechanism selection. - output_input: Control over VTK and diagnostic file generation. - profiling_input: Control over profiling enable/disable and nested reporting.


Uses

  • module~~mod_input~~UsesGraph module~mod_input mod_input module~mod_kinds mod_kinds module~mod_input->module~mod_kinds iso_fortran_env iso_fortran_env module~mod_kinds->iso_fortran_env

Used by

  • module~~mod_input~~UsedByGraph module~mod_input mod_input module~mod_bc mod_bc module~mod_bc->module~mod_input module~mod_energy mod_energy module~mod_energy->module~mod_input module~mod_energy->module~mod_bc module~mod_fields mod_fields module~mod_energy->module~mod_fields module~mod_fields->module~mod_input module~mod_fields->module~mod_bc module~mod_flow_projection mod_flow_projection module~mod_flow_projection->module~mod_input module~mod_flow_projection->module~mod_bc module~mod_flow_projection->module~mod_fields module~mod_transport_properties mod_transport_properties module~mod_flow_projection->module~mod_transport_properties module~mod_output mod_output module~mod_output->module~mod_input module~mod_output->module~mod_energy module~mod_output->module~mod_fields module~mod_output->module~mod_flow_projection module~mod_species mod_species module~mod_output->module~mod_species module~mod_output->module~mod_transport_properties module~mod_species->module~mod_input module~mod_species->module~mod_bc module~mod_species->module~mod_fields module~mod_species->module~mod_flow_projection module~mod_species->module~mod_transport_properties module~mod_transport_properties->module~mod_input program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->module~mod_input program~lowmach_react_hex->module~mod_bc program~lowmach_react_hex->module~mod_energy program~lowmach_react_hex->module~mod_fields program~lowmach_react_hex->module~mod_flow_projection program~lowmach_react_hex->module~mod_output program~lowmach_react_hex->module~mod_species program~lowmach_react_hex->module~mod_transport_properties

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: max_patches = 64
integer, public, parameter :: max_species = 256

Derived Types

type, public ::  case_params_t

Global container for all parsed simulation parameters.

Read more…

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: background_press = 101325.0_rk
real(kind=rk), public :: background_temp = 300.0_rk
real(kind=rk), public :: body_force(3) = zero
character(len=path_len), public :: cantera_mech_file = "gri30.yaml"
character(len=name_len), public :: convection_scheme = "upwind"
real(kind=rk), public :: dt = zero
logical, public :: enable_cantera_fluid = .false.

name: Cantera Bridge Integration

logical, public :: enable_cantera_species = .false.
logical, public :: enable_cantera_thermo = .false.
logical, public :: enable_energy = .false.

name: Enthalpy Energy Equation Controls

logical, public :: enable_profiling = .true.

name: Profiling Controls

logical, public :: enable_reactions = .false.
logical, public :: enable_species = .false.

name: Multi-Species Transport

logical, public :: enable_variable_density = .false.
logical, public :: enable_variable_nu = .false.
real(kind=rk), public :: energy_cp = 1005.0_rk
real(kind=rk), public :: energy_lambda = 2.6e-2_rk
real(kind=rk), public :: energy_reference_T = 298.15_rk
real(kind=rk), public :: energy_reference_h = zero
real(kind=rk), public :: initial_T = 300.0_rk
real(kind=rk), public :: initial_Y(max_species) = 0.0_rk
real(kind=rk), public :: max_cfl = 0.5_rk
character(len=path_len), public :: mesh_dir = "mesh_native"
integer, public :: n_patches = 0

name: Boundary Condition Mapping

integer, public :: namelist_nspecies = 0

name: Internal Registry (Reacting discovery)

character(len=name_len), public :: namelist_species_name(max_species) = ""
logical, public :: nested_profiling = .true.
integer, public :: nspecies = 0
integer, public :: nsteps = 0

name: Time Stepping

real(kind=rk), public :: nu = 1.0e-2_rk
character(len=path_len), public :: output_dir = "output"

name: Data Output

integer, public :: output_interval = 1
real(kind=rk), public :: patch_T(max_patches) = 300.0_rk
real(kind=rk), public :: patch_Y(max_species,max_patches) = zero
real(kind=rk), public :: patch_dpdn(max_patches) = zero
character(len=name_len), public :: patch_name(max_patches) = ""
real(kind=rk), public :: patch_p(max_patches) = zero
character(len=name_len), public :: patch_pressure_type(max_patches) = ""
character(len=name_len), public :: patch_species_type(max_patches) = ""

Species Boundary Conditions

character(len=name_len), public :: patch_temperature_type(max_patches) = ""
character(len=name_len), public :: patch_type(max_patches) = ""
real(kind=rk), public :: patch_u(max_patches) = zero
real(kind=rk), public :: patch_v(max_patches) = zero
character(len=name_len), public :: patch_velocity_type(max_patches) = ""

Field-specific BC Overrides

real(kind=rk), public :: patch_w(max_patches) = zero
integer, public :: pressure_max_iter = 300

name: Linear Solver & Numerics

real(kind=rk), public :: pressure_tol = 1.0e-10_rk
real(kind=rk), public :: rho = one

name: Fluid Properties

real(kind=rk), public :: species_diffusivity(max_species) = 0.0_rk
character(len=name_len), public :: species_name(max_species) = ""
character(len=name_len), public :: thermo_default_species = 'N2'
integer, public :: thermo_update_interval = 1
integer, public :: transport_update_interval = 1
logical, public :: use_dynamic_dt = .false.
logical, public :: write_diagnostics = .true.
logical, public :: write_vtu = .true.

Subroutines

public subroutine read_case_params(filename, params)

Orchestrates the reading of all namelist blocks from the configuration file.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename

Path to the .nml file (usually case.nml).

type(case_params_t), intent(inout) :: params

Container to be populated with parsed values.

private subroutine open_namelist_file(filename, unit_id, ios)

Helper routine to safely open a namelist file for reading.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
integer, intent(out) :: unit_id
integer, intent(out) :: ios

private subroutine read_boundary_input(filename, params)

Reads the &boundary_input namelist block.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_energy_input(filename, params)

Reads the &output_input namelist block. Reads the &energy_input namelist block.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_fluid_input(filename, params)

Reads the &fluid_input namelist block.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_mesh_input(filename, params)

Reads the &mesh_input namelist block.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_output_input(filename, params)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_profiling_input(filename, params)

Reads the &profiling_input block.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_solver_input(filename, params)

Reads the &solver_input namelist block.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_species_input(filename, params)

Reads the &species_input namelist block.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine read_time_input(filename, params)

Reads the &time_input namelist block.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(case_params_t), intent(inout) :: params

private subroutine validate_boundary_arrays(params)

Ensures all boundary patch names and types are non-empty.

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params

private subroutine validate_params(params)

Validates all parsed parameters against physical and algorithmic limits.

Read more…

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params