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.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | max_patches | = | 64 | |
| integer, | public, | parameter | :: | max_species | = | 256 |
Global container for all parsed simulation parameters.
| 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 | :: | cantera_phase_name | = | "" | ||
| integer, | public | :: | cantera_reaction_count | = | 0 | ||
| character(len=name_len), | public | :: | chemistry_active_species_name(max_species) | = | "" | ||
| real(kind=rk), | public | :: | chemistry_active_species_threshold | = | zero | ||
| real(kind=rk), | public | :: | chemistry_atol | = | 1.0e-15_rk | ||
| real(kind=rk), | public | :: | chemistry_dt_min_factor | = | 0.1_rk | ||
| real(kind=rk), | public | :: | chemistry_dt_safety | = | 0.5_rk | ||
| logical, | public | :: | chemistry_energy_enabled | = | .true. | ||
| logical, | public | :: | chemistry_limit_source_update | = | .false. | ||
| real(kind=rk), | public | :: | chemistry_max_dT_per_step | = | zero | ||
| real(kind=rk), | public | :: | chemistry_max_dY_per_step | = | zero | ||
| real(kind=rk), | public | :: | chemistry_max_rel_rho_change_per_step | = | zero | ||
| integer, | public | :: | chemistry_max_steps | = | 10000 | ||
| real(kind=rk), | public | :: | chemistry_min_reactive_mass_fraction | = | zero | ||
| integer, | public | :: | chemistry_n_active_species | = | 0 | ||
| real(kind=rk), | public | :: | chemistry_rtol | = | 1.0e-8_rk | ||
| real(kind=rk), | public | :: | chemistry_source_relaxation | = | one | ||
| real(kind=rk), | public | :: | chemistry_temperature_cutoff | = | zero | ||
| integer, | public | :: | chemistry_update_interval | = | 1 |
name: Operator-split Cantera chemistry controls |
|
| character(len=name_len), | public | :: | convection_scheme | = | "upwind" | ||
| character(len=name_len), | public | :: | density_eos | = | "constant" | ||
| real(kind=rk), | public | :: | dt | = | zero | ||
| real(kind=rk), | public | :: | dt_growth_limit | = | 1.02_rk | ||
| real(kind=rk), | public | :: | dt_old | = | 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_chemistry_load_balancing | = | .false. | ||
| logical, | public | :: | enable_chemistry_subcycling | = | .false. |
name: Chemistry and Reacting Flow Stability Upgrades |
|
| logical, | public | :: | enable_density_corrector_projection | = | .false. | ||
| logical, | public | :: | enable_energy | = | .false. |
name: Enthalpy Energy Equation Controls |
|
| logical, | public | :: | enable_ignition_kernel | = | .false. |
name: Ignition-kernel initialization |
|
| logical, | public | :: | enable_profiling | = | .true. |
name: Profiling Controls |
|
| logical, | public | :: | enable_radiation | = | .false. |
name: Spectral radiation coupling controls |
|
| logical, | public | :: | enable_reactions | = | .false. | ||
| logical, | public | :: | enable_species | = | .false. |
name: Multi-Species Transport |
|
| logical, | public | :: | enable_species_enthalpy_diffusion | = | .false. | ||
| logical, | public | :: | enable_step_rejection | = | .false. | ||
| logical, | public | :: | enable_variable_density | = | .false. | ||
| logical, | public | :: | enable_variable_nu | = | .false. | ||
| character(len=name_len), | public | :: | energy_convection_scheme | = | "upwind" | ||
| 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 | ||
| character(len=name_len), | public | :: | energy_time_scheme | = | "euler" | ||
| real(kind=rk), | public | :: | ignition_kernel_T | = | zero | ||
| character(len=name_len), | public | :: | ignition_kernel_blend | = | "overwrite" | ||
| real(kind=rk), | public | :: | ignition_kernel_center(3) | = | zero | ||
| character(len=1024), | public | :: | ignition_kernel_composition | = | "" | ||
| real(kind=rk), | public | :: | ignition_kernel_radius | = | zero | ||
| character(len=name_len), | public | :: | ignition_kernel_shape | = | "sphere" | ||
| real(kind=rk), | public | :: | initial_T | = | 300.0_rk | ||
| real(kind=rk), | public | :: | initial_Y(max_species) | = | 0.0_rk | ||
| character(len=1024), | public | :: | initial_composition | = | "" | ||
| real(kind=rk), | public | :: | ke_reject_floor | = | 1.0e-12_rk | ||
| real(kind=rk), | public | :: | max_KE_growth_per_step | = | 10.0_rk | ||
| real(kind=rk), | public | :: | max_cfl | = | 0.5_rk | ||
| real(kind=rk), | public | :: | max_cfl_overshoot_factor | = | 1.25_rk | ||
| integer, | public | :: | max_chemistry_subcycles | = | 8 | ||
| real(kind=rk), | public | :: | max_dt | = | huge(one) | ||
| real(kind=rk), | public | :: | max_pressure_residual_limit | = | 1.0e-2_rk | ||
| integer, | public | :: | max_step_retries | = | 6 | ||
| real(kind=rk), | public | :: | max_temperature_limit | = | 3200.0_rk | ||
| character(len=path_len), | public | :: | mesh_dir | = | "mesh_native" | ||
| real(kind=rk), | public | :: | min_density_ratio_limit | = | 0.05_rk | ||
| real(kind=rk), | public | :: | min_dt | = | 1.0e-12_rk | ||
| real(kind=rk), | public | :: | min_temperature_limit | = | 200.0_rk | ||
| character(len=name_len), | public | :: | momentum_convection_scheme | = | "" | ||
| 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 | ||
| character(len=1024), | public | :: | patch_composition(max_patches) | = | "" | ||
| real(kind=rk), | public | :: | patch_dpdn(max_patches) | = | zero | ||
| real(kind=rk), | public | :: | patch_mass_flux(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 |
positive magnitude for inlet/outlet_mass_flux. |
|
| real(kind=rk), | public | :: | pressure_abs_tol | = | 1.0e-8_rk | ||
| integer, | public | :: | pressure_max_iter | = | 300 |
name: Linear Solver & Numerics |
|
| real(kind=rk), | public | :: | pressure_tol | = | 1.0e-10_rk | ||
| real(kind=rk), | public | :: | radiation_absorption_coeff | = | 1.0_rk | ||
| logical, | public | :: | radiation_debug | = | .false. | ||
| character(len=name_len), | public | :: | radiation_dom_quadrature | = | "s2" | ||
| real(kind=rk), | public | :: | radiation_emissivity | = | 1.0_rk | ||
| integer, | public | :: | radiation_n_scalars | = | 0 | ||
| integer, | public | :: | radiation_n_species | = | 0 | ||
| integer, | public | :: | radiation_n_wavenumbers | = | 0 | ||
| character(len=name_len), | public | :: | radiation_pressure_source | = | "background" | ||
| character(len=name_len), | public | :: | radiation_scalar_name(max_species) | = | "" | ||
| character(len=name_len), | public | :: | radiation_source_model | = | "none" | ||
| real(kind=rk), | public | :: | radiation_source_scale | = | 0.0_rk | ||
| character(len=name_len), | public | :: | radiation_species_name(max_species) | = | "" | ||
| integer, | public | :: | radiation_update_interval | = | 1 | ||
| logical, | public | :: | reject_on_nan | = | .true. | ||
| logical, | public | :: | reject_on_pressure_max_iter | = | .true. | ||
| character(len=path_len), | public | :: | restart_file | = | "" | ||
| logical, | public | :: | restart_from_file | = | .false. |
name: Restart Controls |
|
| integer, | public | :: | restart_interval | = | 0 | ||
| integer, | public | :: | restart_keep | = | 0 | ||
| logical, | public | :: | restart_nsteps_are_additional | = | .false. | ||
| character(len=path_len), | public | :: | restart_output_dir | = | "restart" | ||
| logical, | public | :: | restart_use_file_dt | = | .false. | ||
| real(kind=rk), | public | :: | rho | = | one |
name: Fluid Properties |
|
| character(len=name_len), | public | :: | scalar_limiter | = | "barth_jespersen" | ||
| character(len=name_len), | public | :: | species_convection_scheme | = | "upwind" | ||
| 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 | :: | species_time_scheme | = | "euler" | ||
| real(kind=rk), | public | :: | step_reject_cut_factor | = | 0.5_rk | ||
| real(kind=rk), | public | :: | step_reject_min_dt | = | 1.0e-12_rk | ||
| logical, | public | :: | stop_on_min_dt_failure | = | .true. | ||
| real(kind=rk), | public | :: | subcycling_dT_threshold | = | 10.0_rk | ||
| character(len=name_len), | public | :: | terminal_detail | = | "health" | ||
| integer, | public | :: | terminal_interval | = | 1 | ||
| character(len=name_len), | public | :: | thermo_default_species | = | 'N2' | ||
| integer, | public | :: | thermo_update_interval | = | 1 | ||
| integer, | public | :: | transport_update_interval | = | 1 | ||
| logical, | public | :: | upwind_dilatation_density | = | .false. | ||
| logical, | public | :: | use_dynamic_dt | = | .false. | ||
| logical, | public | :: | variable_density_debug | = | .false. | ||
| integer, | public | :: | variable_density_debug_interval | = | 1 | ||
| character(len=name_len), | public | :: | vtu_format | = | "ascii" | ||
| logical, | public | :: | write_cantera_cache_stats | = | .false. | ||
| logical, | public | :: | write_chemistry_screening_stats | = | .false. | ||
| logical, | public | :: | write_diagnostics | = | .true. | ||
| logical, | public | :: | write_radiation_diagnostics | = | .true. | ||
| logical, | public | :: | write_restart | = | .false. | ||
| logical, | public | :: | write_vtu | = | .true. |
Orchestrates the reading of all namelist blocks from the configuration file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename |
Path to the |
||
| type(case_params_t), | intent(inout) | :: | params |
Container to be populated with parsed values. |
Helper routine to safely open a namelist file for reading.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| integer, | intent(out) | :: | unit_id | |||
| integer, | intent(out) | :: | ios |
Reads the &boundary_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the optional &chemistry_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &output_input namelist block.
Reads the &energy_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &fluid_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the optional &ignition_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &mesh_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &profiling_input block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the optional &radiation_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the optional &restart_input block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &solver_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &species_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
Reads the &time_input namelist block.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | filename | |||
| type(case_params_t), | intent(inout) | :: | params |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | scheme_name | |||
| character(len=*), | intent(in) | :: | field_name | |||
| logical, | intent(in) | :: | allow_scalar_high_order |
Ensures all boundary patch names and types are non-empty.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | limiter_name |
Validates all parsed parameters against physical and algorithmic limits.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | scheme_name | |||
| character(len=*), | intent(in) | :: | field_name |