Validates all parsed parameters against physical and algorithmic limits.
Triggers fatal_error for non-physical values (e.g., negative density,
zero timestep) or unsupported configurations.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(case_params_t), | intent(in) | :: | params |
subroutine validate_params(params) type(case_params_t), intent(in) :: params if (params%nsteps < 0) call fatal_error('input', 'nsteps must be non-negative') if (params%dt <= zero) call fatal_error('input', 'dt must be positive') if (params%output_interval <= 0) call fatal_error('input', 'output_interval must be positive') if (params%rho <= zero) call fatal_error('input', 'rho must be positive') if (params%enable_variable_density) then call fatal_error('input', 'enable_variable_density=.true. requested, but variable-density flow is not implemented yet; rho_thermo is diagnostic only') end if if (params%nu < zero) call fatal_error('input', 'nu must be non-negative') if (params%enable_variable_nu .and. .not. params%enable_cantera_fluid) then call fatal_error('input', 'enable_variable_nu=.true. requires fluid_input enable_cantera=.true.; otherwise use constant nu') end if if (params%transport_update_interval <= 0) call fatal_error('input', 'transport_update_interval must be positive') if (params%pressure_max_iter <= 0) call fatal_error('input', 'pressure_max_iter must be positive') if (params%pressure_tol <= zero) call fatal_error('input', 'pressure_tol must be positive') if (params%initial_T <= zero) call fatal_error('input', 'initial_T must be positive') if (params%energy_reference_T <= zero) call fatal_error('input', 'energy_reference_T must be positive') if (params%energy_cp <= zero) call fatal_error('input', 'energy_cp must be positive') if (params%energy_lambda < zero) call fatal_error('input', 'energy_lambda must be non-negative') if (params%thermo_update_interval <= 0) call fatal_error('input', 'thermo_update_interval must be positive') if (params%enable_cantera_thermo .and. params%thermo_update_interval /= 1) then call fatal_error('input', 'thermo_update_interval values other than 1 are reserved; Cantera thermo is currently updated every energy step') end if if (params%enable_cantera_thermo .and. len_trim(params%thermo_default_species) == 0) & call fatal_error('input', 'thermo_default_species must not be empty when enable_cantera_thermo is true') if (params%n_patches < 0 .or. params%n_patches > max_patches) then call fatal_error('input', 'n_patches is outside supported range') end if if (len_trim(params%mesh_dir) == 0) then call fatal_error('input', 'mesh_dir cannot be empty') end if if (len_trim(params%output_dir) == 0) then call fatal_error('input', 'output_dir cannot be empty') end if if (params%nspecies < 0 .or. params%nspecies > max_species) then call fatal_error('input', 'nspecies is outside supported range') end if call validate_boundary_arrays(params) end subroutine validate_params