MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_constants.fpp.f90
Go to the documentation of this file.
1# 1 "/home/runner/work/MFC/MFC/src/common/m_constants.fpp"
2!>
3!! @file
4!! @brief Contains constant values used throughout the code(s).
5
6!> @brief Compile-time constant parameters: default values, tolerances, and physical constants
8
10
11 character, parameter :: dflt_char = ' ' !< Default string value
12 real(wp), parameter :: dflt_real = -1.e6_wp !< Default real value
13 real(wp), parameter :: sgm_eps = 1.e-16_wp !< Segmentation tolerance
14 real(wp), parameter :: chem_tolerance = 1.e-16_wp !< Speed of Sound Tolerance in Chemistry
15 real(wp), parameter :: small_alf = 1.e-11_wp !< Small alf tolerance
16 real(wp), parameter :: pi = 3.141592653589793_wp !< Pi
17 real(wp), parameter :: verysmall = 1.e-12_wp !< Very small number
18 !> Residual modulus fraction below which a damaged state's elastic energy is dropped (cont_damage)
19 real(wp), parameter :: damage_energy_cutoff = 1.e-3_wp
20 !> Temperature window the immersed-boundary reacting-surface state is kept inside. It is the range the NASA polynomials behind
21 !! the thermodynamic evaluations are fitted over -- 200 K is the T_low of every species in the mechanisms shipped with the
22 !! reacting-surface example -- so it is where those fits mean anything. Shared by the surface Newton solve, which searches
23 !! inside it, the ghost reconstruction, which will not extrapolate out of it, and the case checker, which rejects a prescribed
24 !! wall temperature outside it.
25 real(wp), parameter :: t_surface_min = 200._wp
26 real(wp), parameter :: t_surface_max = 5000._wp
27
28 !> Half-width of the contact-speed ramp, as a fraction of the sound speed, over which the HLLC tangential interface velocity
29 !! blends between the left and right states (ib_smooth_contact)
30 real(wp), parameter :: contact_ramp = 1.e-2_wp
31
32 !> Reals per IB in restart_data/ib_state: time, force(3), torque(3), vel(3), angular_vel(3), angles(3), centroid(3), radius,
33 !! Twall. Twall carries a thermal_bc = 3 body's evolving temperature across a restart.
34 integer, parameter :: ib_state_nfields = 21
35 !> Radius cutoff to avoid division by zero for 3D spherical harmonic patch (geometry 14)
36 real(wp), parameter :: small_radius = 1.e-32_wp
37 integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
38 integer, parameter :: path_len = 400 !< Maximum path length
39 integer, parameter :: name_len = 50 !< Maximum name length
40 integer, parameter :: dflt_int = -100 !< Default integer value
41 integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
42 integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
43 integer, parameter :: num_probes_max = 64 !< Maximum number of flow probes in the simulation
44 integer, parameter :: num_patches_max = 10 !< Maximum number of IC patches
45 integer, parameter :: num_ib_airfoils_max = 5 !< Maximum number of ib_airfoil instances
46 integer, parameter :: num_stl_models_max = 10
47 !> Maximum number of immersed boundary patches (legacy, not used for patch_ib sizing)
48 !> Fixed capacity of patch_ib (namelist patches + local particle bed subset after reduction)
49 integer, parameter :: num_local_ibs_max = 30000 !< Maximum number of immersed boundary patches (patch_ib)
50 integer, parameter :: num_ib_patches_max_namelist = 810000
51 integer, parameter :: num_particle_clouds_max = 10 !< Maximum number of particle bed patch specifications
52 integer, parameter :: num_bc_patches_max = 10 !< Maximum number of boundary condition patches
53 integer, parameter :: max_2d_fourier_modes = 10 !< Max Fourier mode index for 2D modal patch (geometry 13)
54 integer, parameter :: max_sph_harm_degree = 5 !< Max degree L for 3D spherical harmonic patch (geometry 14)
55 integer, parameter :: pathlen_max = 400 !< Maximum path length for STL/OBJ model files
56 integer, parameter :: nnode = 4 !< Number of QBMM nodes
57 integer, parameter :: dflt_num_igr_iters = 2 !< number of iterations for IGR elliptic solve
58 integer, parameter :: dflt_num_igr_warm_start_iters = 50 !< default number of iterations for IGR elliptic solve
59 real(wp), parameter :: dflt_alf_factor = 10._wp !< scaling factor for IGR alpha
60 integer, parameter :: gp_layers = 3 !< Number of ghost point layers for IBM
61 real(wp), parameter :: k_ib = 2._wp !< AMR block-owner cost per IB cell, relative to a fluid cell
62 !> AMR fine-level restart per-block header: region box (6) + amr_block_level (1); the writer and both readers share it.
63 integer, parameter :: amr_restart_blk_hdr_ints = 7
64 !> AMR restart per-block ownership record [owner + 1, m, n, p]; owner + 1 keeps rank 0 distinct from an unwritten slot under
65 !! MAX.
66 integer, parameter :: amr_restart_blk_own_ints = 4
67 !> color function gradient magnitude at which to apply the surface tension fluxes
68 real(wp), parameter :: capillary_cutoff = 1.e-6
69 !> Spatial support width of acoustic source, used in s_source_spatial
70 real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp
71 real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size
72 !> The constant to scale the spectral level at the lower frequency bound
73 real(wp), parameter :: broadband_spectral_level_constant = 20._wp
74 !> The spectral level constant to correct the magnitude at each frequency to ensure the source is overall broadband
75 real(wp), parameter :: broadband_spectral_level_growth_rate = 10._wp
76 ! Interface compression (THINC)
77 real(wp), parameter :: dflt_ic_eps = 1e-4_wp !< Ensure compression is only applied to surface cells in THINC
78 real(wp), parameter :: dflt_ic_beta = 1.6_wp !< Sharpness parameter's default value used in THINC
79 real(wp), parameter :: moncon_cutoff = 1e-8_wp !< Monotonicity constraint's limiter to prevent extremas in THINC
80 real(wp), parameter :: mthinc_align_tol = 1.e-8_wp !< Grid aligned snap tolerance for MTHINC normals
81 ! Chemistry
82 real(wp), parameter :: dflt_t_guess = 1200._wp !< Default guess for temperature (when a previous value is not available)
83
84 ! IBM+STL interpolation constants
85 integer, parameter :: num_ray = 20 !< Default number of rays traced per cell
86 real(wp), parameter :: ray_tracing_threshold = 0.9_wp !< Threshold above which the cell is marked as the model patch
87 real(wp), parameter :: threshold_vector_zero = 1.e-10_wp !< Threshold to treat the component of a vector to be zero
88 real(wp), parameter :: threshold_edge_zero = 1.e-10_wp !< Threshold to treat two edges to be overlapped
89 real(wp), parameter :: initial_distance_buffer = 1.e12_wp !< Initialized levelset distance for the shortest path pair algorithm
90 ! Lagrange bubbles constants
91 integer, parameter :: mapcells = 3 !< Number of cells around the bubble where the smoothening function will have effect
92 real(wp), parameter :: r_uni = 8314._wp !< Universal gas constant - J/kmol/K
93 integer, parameter :: lag_io_vars = 21 !< Number of variables per particle for MPI_IO
94
95 ! Lagrange particles constants
96 integer, parameter :: ncells_proj = 3 !< Cells per direction the Gaussian kernel projects onto
97 integer, parameter :: mapcells_loc = (ncells_proj - 1)/2 !< Gaussian kernel half-width M
98 !> Gaussian kernel decay rate, so the kernel falls to 1e-4 at M + 1 cells
99 real(wp), parameter :: kernel_alpha = 4._wp*log(10._wp)/real(mapcells_loc + 1, wp)**2
100 integer, parameter :: seed_kind = selected_int_kind(18) !< 64-bit state of s_prng_splitmix32
101 real(wp), parameter :: tiny_positive = 1.e-30_wp !< Keeps divisions and log() finite for vanishing arguments
102 real(wp), parameter :: node_coincidence_tol = 1.e-10_wp !< Distance, in cell widths, at which a particle sits on a node
103 !> Volume-fraction cap in the radial distribution, below its singularity at 0.64356
104 real(wp), parameter :: phi_chi_max = 0.64_wp
105 !> Force terms reported when a particle force is not finite, indexed by the force_status of s_get_particle_force
106 character(len=*), parameter :: force_term_names(4) = [character(len=24)::'quasi-steady drag','pressure gradient', &
107 & 'added mass', 'drag fluctuation']
108
109 ! Strang Splitting constants
110 real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
111 integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default max iteration for adaptive step size
112 ! Constants of the algorithm described by Heirer, E. Hairer, S. P.Norsett, G. Wanner, Solving Ordinary Differential Equations I,
113 ! Chapter II.4 to choose the initial time step size for the adaptive time stepping routine
114 real(wp), parameter :: threshold_first_guess = 1.e-5_wp !< Threshold for initial step size estimate
115 real(wp), parameter :: threshold_second_guess = 1.e-15_wp !< Threshold for refined step size estimate
116 real(wp), parameter :: scale_first_guess = 1.e-3_wp !< Scale factor for initial step size
117 real(wp), parameter :: scale_guess = 1.e-2_wp !< Scale factor for step size adjustment
118 real(wp), parameter :: small_guess = 1.e-6_wp !< Minimum initial step size
119
120 ! Relativity
121 !> Max Newton-Raphson iterations for relativistic primitive recovery
122 integer, parameter :: relativity_cons_to_prim_max_iter = 100
123
124 ! Linear congruential pseudo-random number generator parameters
125 integer, parameter :: modulus = 2**30 - 1 !< PRNG modulus
126 integer, parameter :: multiplier = 1664525 !< PRNG multiplier
127 integer, parameter :: increment = 1013904223 !< PRNG increment
128 integer, parameter :: amplifier = 3**13 !< PRNG amplifier for mixing
129 real(wp), parameter :: decimal_trim = 1.e5_wp !< PRNG decimal truncation factor
130
131 ! System constants
132 integer, parameter :: case_file_error_code = 22 !< Exit code for case file validation errors
133
134 ! Boundary condition enumeration Abbreviations CHAR - Characteristic NR - Non-reflecting SUB - subsonic SUP - supersonic FF -
135 ! Force-free CP - Constant pressure
136 integer, parameter :: bc_periodic = -1
137 integer, parameter :: bc_reflective = -2
138 integer, parameter :: bc_ghost_extrap = -3
139 integer, parameter :: bc_riemann_extrap = -4
140 integer, parameter :: bc_char_slip_wall = -5
141 integer, parameter :: bc_char_nr_sub_buffer = -6
142 integer, parameter :: bc_char_nr_sub_inflow = -7
143 integer, parameter :: bc_char_nr_sub_outflow = -8
144 integer, parameter :: bc_char_ff_sub_outflow = -9
145 integer, parameter :: bc_char_cp_sub_outflow = -10
146 integer, parameter :: bc_char_sup_inflow = -11
147 integer, parameter :: bc_char_sup_outflow = -12
148 integer, parameter :: bc_null = -13
149 integer, parameter :: bc_axis = -14
150 integer, parameter :: bc_slip_wall = -15
151 integer, parameter :: bc_no_slip_wall = -16
152 integer, parameter :: bc_dirichlet = -17
153
154 !> Equation of state per fluid (eos_stiffened_gas, eos_ideal_gas, eos_mie_gruneisen, eos_jwl, eos_vinet) is generated from
155 !! EOS_FAMILIES in toolchain/mfc/params/eos_families.py; see generated_constants.fpp below.
156 integer, parameter :: eos_rk4_steps = 8 !< fixed-step RK4 along a phasic isentrope or a reference temperature
157 integer, parameter :: ode_isentrope = 1, ode_reference_temperature = 2 !< the two ODEs s_rk4 integrates
158
159 ! Synthetic turbulence array size limits
160 integer, parameter :: num_synth_shells_max = 50 !< Max energy shells for synthetic turbulence
161 integer, parameter :: num_turb_sources_max = 10 !< Max Gaussian forcing zones for synthetic turbulence
162
163 ! Named values for enumerated case parameters (e.g. riemann_solver_hllc).
164 ! AUTO-GENERATED from "names" in toolchain/mfc/params/definitions.py.
165# 1 "/home/runner/work/MFC/MFC/build/include/pre_process/generated_constants.fpp" 1
166! AUTO-GENERATED - do not edit directly. Regenerate: cmake reconfigure
167!
168integer, parameter :: avg_state_roe = 1
169integer, parameter :: avg_state_arithmetic = 2
170integer, parameter :: bubble_model_particle = 0
171integer, parameter :: bubble_model_gilmore = 1
172integer, parameter :: bubble_model_keller_miksis = 2
173integer, parameter :: bubble_model_rayleigh_plesset = 3
174integer, parameter :: eos_stiffened_gas = 1
175integer, parameter :: eos_ideal_gas = 2
176integer, parameter :: eos_mie_gruneisen = 3
177integer, parameter :: eos_jwl = 4
178integer, parameter :: eos_vinet = 5
179integer, parameter :: format_silo = 1
180integer, parameter :: format_binary = 2
181integer, parameter :: int_comp_off = 0
182integer, parameter :: int_comp_thinc = 1
183integer, parameter :: int_comp_mthinc = 2
184integer, parameter :: coupling_one_way = 1
185integer, parameter :: coupling_two_way = 2
186integer, parameter :: model_eqns_gamma_law = 1
187integer, parameter :: model_eqns_5eq = 2
188integer, parameter :: model_eqns_6eq = 3
189integer, parameter :: muscl_lim_unlimited = 0
190integer, parameter :: muscl_lim_minmod = 1
191integer, parameter :: muscl_lim_mc = 2
192integer, parameter :: muscl_lim_van_albada = 3
193integer, parameter :: muscl_lim_van_leer = 4
194integer, parameter :: muscl_lim_superbee = 5
195integer, parameter :: muscl_order_first_order = 1
196integer, parameter :: muscl_order_second_order = 2
197integer, parameter :: precision_single = 1
198integer, parameter :: precision_double = 2
199integer, parameter :: recon_type_weno = 1
200integer, parameter :: recon_type_muscl = 2
201integer, parameter :: riemann_solver_hll = 1
202integer, parameter :: riemann_solver_hllc = 2
203integer, parameter :: riemann_solver_hlld = 4
204integer, parameter :: riemann_solver_lax_friedrichs = 5
205integer, parameter :: time_stepper_rk1 = 1
206integer, parameter :: time_stepper_rk2 = 2
207integer, parameter :: time_stepper_rk3 = 3
208integer, parameter :: wave_speeds_direct = 1
209integer, parameter :: wave_speeds_pressure = 2
210# 165 "/home/runner/work/MFC/MFC/src/common/m_constants.fpp" 2
211end module m_constants
Compile-time constant parameters: default values, tolerances, and physical constants.
integer, parameter num_ib_airfoils_max
Maximum number of ib_airfoil instances.
integer, parameter lag_io_vars
Number of variables per particle for MPI_IO.
integer, parameter model_eqns_5eq
integer, parameter amr_restart_blk_own_ints
AMR restart per-block ownership record [owner + 1, m, n, p]; owner + 1 keeps rank 0 distinct from an ...
integer, parameter bc_null
integer, parameter muscl_lim_van_albada
integer, parameter precision_double
real(wp), parameter small_radius
Radius cutoff to avoid division by zero for 3D spherical harmonic patch (geometry 14).
integer, parameter num_local_ibs_max
Maximum number of immersed boundary patches (legacy, not used for patch_ib sizing) Fixed capacity of ...
integer, parameter int_comp_mthinc
integer, parameter bc_char_sup_outflow
integer, parameter avg_state_roe
real(wp), parameter dflt_ic_beta
Sharpness parameter's default value used in THINC.
real(wp), parameter node_coincidence_tol
Distance, in cell widths, at which a particle sits on a node.
integer, parameter name_len
Maximum name length.
integer, parameter amplifier
PRNG amplifier for mixing.
integer, parameter ib_state_nfields
Reals per IB in restart_data/ib_state: time, force(3), torque(3), vel(3), angular_vel(3),...
integer, parameter num_patches_max
Maximum number of IC patches.
real(wp), parameter ray_tracing_threshold
Threshold above which the cell is marked as the model patch.
integer, parameter wave_speeds_direct
real(wp), parameter dflt_ic_eps
Ensure compression is only applied to surface cells in THINC.
integer, parameter amr_restart_blk_hdr_ints
AMR fine-level restart per-block header: region box (6) + amr_block_level (1); the writer and both re...
integer, parameter muscl_lim_van_leer
integer, parameter format_silo
real(wp), parameter k_ib
AMR block-owner cost per IB cell, relative to a fluid cell.
integer, parameter num_ib_patches_max_namelist
integer, parameter bc_ghost_extrap
real(wp), parameter dflt_t_guess
Default guess for temperature (when a previous value is not available).
integer, parameter dflt_int
Default integer value.
integer, parameter num_stcls_min
Minimum # of stencils.
integer, parameter bc_no_slip_wall
integer, parameter muscl_lim_mc
integer, parameter time_stepper_rk2
integer, parameter num_particle_clouds_max
Maximum number of particle bed patch specifications.
integer, parameter coupling_two_way
integer, parameter num_turb_sources_max
Max Gaussian forcing zones for synthetic turbulence.
integer, parameter riemann_solver_hll
integer, parameter relativity_cons_to_prim_max_iter
Max Newton-Raphson iterations for relativistic primitive recovery.
integer, parameter bc_char_nr_sub_inflow
integer, parameter gp_layers
Number of ghost point layers for IBM.
integer, parameter bubble_model_particle
integer, parameter eos_mie_gruneisen
integer, parameter eos_rk4_steps
Equation of state per fluid (eos_stiffened_gas, eos_ideal_gas, eos_mie_gruneisen, eos_jwl,...
integer, parameter riemann_solver_hlld
real(wp), parameter sgm_eps
Segmentation tolerance.
real(wp), parameter t_surface_min
Temperature window the immersed-boundary reacting-surface state is kept inside. It is the range the N...
real(wp), parameter dflt_real
Default real value.
integer, parameter recon_type_muscl
integer, parameter bc_dirichlet
integer, parameter muscl_order_second_order
integer, parameter ncells_proj
Cells per direction the Gaussian kernel projects onto.
integer, parameter bc_axis
integer, parameter bubble_model_gilmore
real(wp), parameter dflt_alf_factor
scaling factor for IGR alpha
integer, parameter eos_vinet
integer, parameter time_stepper_rk1
real(wp), parameter decimal_trim
PRNG decimal truncation factor.
real(wp), parameter phi_chi_max
Volume-fraction cap in the radial distribution, below its singularity at 0.64356.
integer, parameter max_2d_fourier_modes
Max Fourier mode index for 2D modal patch (geometry 13).
real(wp), parameter initial_distance_buffer
Initialized levelset distance for the shortest path pair algorithm.
integer, parameter format_binary
integer, parameter bc_reflective
integer, parameter path_len
Maximum path length.
real(wp), parameter scale_first_guess
Scale factor for initial step size.
real(wp), parameter dflt_adap_dt_tol
Default tolerance for adaptive step size.
integer, parameter int_comp_off
integer, parameter bc_char_sup_inflow
real(wp), parameter broadband_spectral_level_growth_rate
The spectral level constant to correct the magnitude at each frequency to ensure the source is overal...
integer, parameter pathlen_max
Maximum path length for STL/OBJ model files.
integer, parameter case_file_error_code
Exit code for case file validation errors.
real(wp), parameter kernel_alpha
Gaussian kernel decay rate, so the kernel falls to 1e-4 at M + 1 cells.
integer, parameter time_stepper_rk3
real(wp), parameter r_uni
Universal gas constant - J/kmol/K.
integer, parameter riemann_solver_hllc
integer, parameter muscl_order_first_order
integer, parameter wave_speeds_pressure
integer, parameter seed_kind
64-bit state of s_prng_splitmix32
character(len= *), dimension(4), parameter force_term_names
Force terms reported when a particle force is not finite, indexed by the force_status of s_get_partic...
character, parameter dflt_char
Default string value.
integer, parameter eos_ideal_gas
real(wp), parameter t_surface_max
integer, parameter num_bc_patches_max
Maximum number of boundary condition patches.
real(wp), parameter threshold_edge_zero
Threshold to treat two edges to be overlapped.
real(wp), parameter acoustic_spatial_support_width
Spatial support width of acoustic source, used in s_source_spatial.
integer, parameter max_sph_harm_degree
Max degree L for 3D spherical harmonic patch (geometry 14).
integer, parameter muscl_lim_unlimited
real(wp), parameter mthinc_align_tol
Grid aligned snap tolerance for MTHINC normals.
integer, parameter num_fluids_max
Maximum number of fluids in the simulation.
integer, parameter ode_isentrope
real(wp), parameter contact_ramp
Half-width of the contact-speed ramp, as a fraction of the sound speed, over which the HLLC tangentia...
integer, parameter num_synth_shells_max
Max energy shells for synthetic turbulence.
real(wp), parameter threshold_second_guess
Threshold for refined step size estimate.
integer, parameter bc_riemann_extrap
integer, parameter dflt_num_igr_iters
number of iterations for IGR elliptic solve
integer, parameter nnode
Number of QBMM nodes.
integer, parameter bc_char_cp_sub_outflow
integer, parameter precision_single
real(wp), parameter broadband_spectral_level_constant
The constant to scale the spectral level at the lower frequency bound.
integer, parameter riemann_solver_lax_friedrichs
integer, parameter eos_stiffened_gas
real(wp), parameter tiny_positive
Keeps divisions and log() finite for vanishing arguments.
integer, parameter dflt_adap_dt_max_iters
Default max iteration for adaptive step size.
integer, parameter multiplier
PRNG multiplier.
integer, parameter increment
PRNG increment.
integer, parameter modulus
PRNG modulus.
real(wp), parameter pi
Pi.
real(wp), parameter threshold_vector_zero
Threshold to treat the component of a vector to be zero.
integer, parameter mapcells_loc
Gaussian kernel half-width M.
integer, parameter bc_char_nr_sub_outflow
integer, parameter ode_reference_temperature
the two ODEs s_rk4 integrates
real(wp), parameter damage_energy_cutoff
Residual modulus fraction below which a damaged state's elastic energy is dropped (cont_damage).
integer, parameter bc_char_ff_sub_outflow
integer, parameter bc_slip_wall
real(wp), parameter small_guess
Minimum initial step size.
integer, parameter bc_char_nr_sub_buffer
integer, parameter recon_type_weno
integer, parameter bubble_model_rayleigh_plesset
real(wp), parameter capillary_cutoff
color function gradient magnitude at which to apply the surface tension fluxes
integer, parameter fourier_rings
Fourier filter ring limit.
real(wp), parameter threshold_first_guess
Threshold for initial step size estimate.
integer, parameter muscl_lim_superbee
real(wp), parameter small_alf
Small alf tolerance.
integer, parameter bubble_model_keller_miksis
integer, parameter bc_char_slip_wall
integer, parameter dflt_num_igr_warm_start_iters
default number of iterations for IGR elliptic solve
integer, parameter num_ray
Default number of rays traced per cell.
real(wp), parameter dflt_vcfl_dt
value of vcfl_dt when viscosity is off for computing adaptive timestep size
real(wp), parameter verysmall
Very small number.
integer, parameter int_comp_thinc
integer, parameter num_probes_max
Maximum number of flow probes in the simulation.
integer, parameter mapcells
Number of cells around the bubble where the smoothening function will have effect.
integer, parameter coupling_one_way
real(wp), parameter scale_guess
Scale factor for step size adjustment.
integer, parameter avg_state_arithmetic
integer, parameter model_eqns_6eq
real(wp), parameter chem_tolerance
Speed of Sound Tolerance in Chemistry.
integer, parameter muscl_lim_minmod
integer, parameter bc_periodic
integer, parameter eos_jwl
integer, parameter num_stl_models_max
integer, parameter model_eqns_gamma_law
real(wp), parameter moncon_cutoff
Monotonicity constraint's limiter to prevent extremas in THINC.
Working-precision kind selection (half/single/double) and corresponding MPI datatype parameters.
integer, parameter wp
Change to single_precision if needed.