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