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 | :: | 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. |
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 &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 &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 &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 |
Ensures all boundary patch names and types are non-empty.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params |
Validates all parsed parameters against physical and algorithmic limits.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params |