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 !> Radius cutoff to avoid division by zero for 3D spherical harmonic patch (geometry 14)
19 real(wp), parameter :: small_radius = 1.e-32_wp
20 integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
21 integer, parameter :: path_len = 400 !< Maximum path length
22 integer, parameter :: name_len = 50 !< Maximum name length
23 integer, parameter :: dflt_int = -100 !< Default integer value
24 integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
25 integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
26 integer, parameter :: num_probes_max = 10 !< Maximum number of flow probes in the simulation
27 integer, parameter :: num_patches_max = 1000 !< Maximum number of IC patches
28 integer, parameter :: num_bc_patches_max = 10 !< Maximum number of boundary condition patches
29 integer, parameter :: max_2d_fourier_modes = 10 !< Max Fourier mode index for 2D modal patch (geometry 13)
30 integer, parameter :: max_sph_harm_degree = 5 !< Max degree L for 3D spherical harmonic patch (geometry 14)
31 integer, parameter :: pathlen_max = 400 !< Maximum path length for STL/OBJ model files
32 integer, parameter :: nnode = 4 !< Number of QBMM nodes
33 integer, parameter :: dflt_num_igr_iters = 2 !< number of iterations for IGR elliptic solve
34 integer, parameter :: dflt_num_igr_warm_start_iters = 50 !< default number of iterations for IGR elliptic solve
35 real(wp), parameter :: dflt_alf_factor = 10._wp !< scaling factor for IGR alpha
36 integer, parameter :: gp_layers = 3 !< Number of ghost point layers for IBM
37 !> color function gradient magnitude at which to apply the surface tension fluxes
38 real(wp), parameter :: capillary_cutoff = 1.e-6
39 !> Spatial support width of acoustic source, used in s_source_spatial
40 real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp
41 real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size
42 !> The constant to scale the spectral level at the lower frequency bound
43 real(wp), parameter :: broadband_spectral_level_constant = 20._wp
44 !> The spectral level constant to correct the magnitude at each frequency to ensure the source is overall broadband
45 real(wp), parameter :: broadband_spectral_level_growth_rate = 10._wp
46 ! Reconstruction Types
47 integer, parameter :: weno_type = 1 !< Using WENO for reconstruction type
48 integer, parameter :: muscl_type = 2 !< Using MUSCL for reconstruction type
49 ! Interface Compression
50 real(wp), parameter :: dflt_ic_eps = 1e-4_wp !< Ensure compression is only applied to surface cells in THINC
51 real(wp), parameter :: dflt_ic_beta = 1.6_wp !< Sharpness parameter's default value used in THINC
52 real(wp), parameter :: moncon_cutoff = 1e-8_wp !< Monotonicity constraint's limiter to prevent extremas in THINC
53 ! Chemistry
54 real(wp), parameter :: dflt_t_guess = 1200._wp !< Default guess for temperature (when a previous value is not available)
55
56 ! IBM+STL interpolation constants
57 integer, parameter :: num_ray = 20 !< Default number of rays traced per cell
58 real(wp), parameter :: ray_tracing_threshold = 0.9_wp !< Threshold above which the cell is marked as the model patch
59 real(wp), parameter :: threshold_vector_zero = 1.e-10_wp !< Threshold to treat the component of a vector to be zero
60 real(wp), parameter :: threshold_edge_zero = 1.e-10_wp !< Threshold to treat two edges to be overlapped
61 real(wp), parameter :: initial_distance_buffer = 1.e12_wp !< Initialized levelset distance for the shortest path pair algorithm
62 ! Lagrange bubbles constants
63 integer, parameter :: mapcells = 3 !< Number of cells around the bubble where the smoothening function will have effect
64 real(wp), parameter :: r_uni = 8314._wp !< Universal gas constant - J/kmol/K
65 integer, parameter :: lag_io_vars = 21 !< Number of variables per particle for MPI_IO
66
67 ! Strang Splitting constants
68 real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
69 integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default max iteration for adaptive step size
70 ! Constants of the algorithm described by Heirer, E. Hairer, S. P.Norsett, G. Wanner, Solving Ordinary Differential Equations I,
71 ! Chapter II.4 to choose the initial time step size for the adaptive time stepping routine
72 real(wp), parameter :: threshold_first_guess = 1.e-5_wp !< Threshold for initial step size estimate
73 real(wp), parameter :: threshold_second_guess = 1.e-15_wp !< Threshold for refined step size estimate
74 real(wp), parameter :: scale_first_guess = 1.e-3_wp !< Scale factor for initial step size
75 real(wp), parameter :: scale_guess = 1.e-2_wp !< Scale factor for step size adjustment
76 real(wp), parameter :: small_guess = 1.e-6_wp !< Minimum initial step size
77
78 ! Relativity
79 !> Max Newton-Raphson iterations for relativistic primitive recovery
80 integer, parameter :: relativity_cons_to_prim_max_iter = 100
81
82 ! Linear congruential pseudo-random number generator parameters
83 integer, parameter :: modulus = 2**30 - 1 !< PRNG modulus
84 integer, parameter :: multiplier = 1664525 !< PRNG multiplier
85 integer, parameter :: increment = 1013904223 !< PRNG increment
86 integer, parameter :: amplifier = 3**13 !< PRNG amplifier for mixing
87 real(wp), parameter :: decimal_trim = 1.e5_wp !< PRNG decimal truncation factor
88
89 ! System constants
90 integer, parameter :: case_file_error_code = 22 !< Exit code for case file validation errors
91
92 ! Boundary condition enumeration Abbreviations CHAR - Characteristic NR - Non-reflecting SUB - subsonic SUP - supersonic FF -
93 ! Force-free CP - Constant pressure
94 integer, parameter :: bc_periodic = -1
95 integer, parameter :: bc_reflective = -2
96 integer, parameter :: bc_ghost_extrap = -3
97 integer, parameter :: bc_riemann_extrap = -4
98 integer, parameter :: bc_char_slip_wall = -5
99 integer, parameter :: bc_char_nr_sub_buffer = -6
100 integer, parameter :: bc_char_nr_sub_inflow = -7
101 integer, parameter :: bc_char_nr_sub_outflow = -8
102 integer, parameter :: bc_char_ff_sub_outflow = -9
103 integer, parameter :: bc_char_cp_sub_outflow = -10
104 integer, parameter :: bc_char_sup_inflow = -11
105 integer, parameter :: bc_char_sup_outflow = -12
106 integer, parameter :: bc_null = -13
107 integer, parameter :: bc_axis = -14
108 integer, parameter :: bc_slip_wall = -15
109 integer, parameter :: bc_no_slip_wall = -16
110 integer, parameter :: bc_dirichlet = -17
111end module m_constants
Compile-time constant parameters: default values, tolerances, and physical constants.
integer, parameter lag_io_vars
Number of variables per particle for MPI_IO.
integer, parameter bc_null
real(wp), parameter small_radius
Radius cutoff to avoid division by zero for 3D spherical harmonic patch (geometry 14).
integer, parameter bc_char_sup_outflow
real(wp), parameter dflt_ic_beta
Sharpness parameter's default value used in THINC.
integer, parameter name_len
Maximum name length.
integer, parameter amplifier
PRNG amplifier for mixing.
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.
real(wp), parameter dflt_ic_eps
Ensure compression is only applied to surface cells in THINC.
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 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 muscl_type
Using MUSCL for reconstruction type.
real(wp), parameter sgm_eps
Segmentation tolerance.
real(wp), parameter dflt_real
Default real value.
integer, parameter bc_dirichlet
integer, parameter bc_axis
real(wp), parameter dflt_alf_factor
scaling factor for IGR alpha
real(wp), parameter decimal_trim
PRNG decimal truncation factor.
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 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 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.
integer, parameter weno_type
Using WENO for reconstruction type.
real(wp), parameter r_uni
Universal gas constant - J/kmol/K.
character, parameter dflt_char
Default string value.
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 num_fluids_max
Maximum number of fluids in the simulation.
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
real(wp), parameter broadband_spectral_level_constant
The constant to scale the spectral level at the lower frequency bound.
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 bc_char_nr_sub_outflow
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
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.
real(wp), parameter small_alf
Small alf tolerance.
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 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.
real(wp), parameter scale_guess
Scale factor for step size adjustment.
real(wp), parameter chem_tolerance
Speed of Sound Tolerance in Chemistry.
integer, parameter bc_periodic
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.