MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_global_parameters.fpp.f90
Go to the documentation of this file.
1# 1 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
2!>
3!! @file
4!! @brief Contains module m_global_parameters
5
6# 1 "/home/runner/work/MFC/MFC/src/common/include/case.fpp" 1
7! This file exists so that Fypp can be run without generating case.fpp files for
8! each target. This is useful when generating documentation, for example. This
9! should also let MFC be built with CMake directly, without invoking mfc.sh.
10
11! For pre-process.
12# 8 "/home/runner/work/MFC/MFC/src/common/include/case.fpp"
13
14! For moving immersed boundaries in simulation
15# 12 "/home/runner/work/MFC/MFC/src/common/include/case.fpp"
16# 6 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp" 2
17
18!> @brief Defines global parameters for the computational domain, simulation algorithm, and initial conditions
20
21#ifdef MFC_MPI
22 use mpi ! Message passing interface (MPI) module
23#endif
24
25 use m_derived_types ! Definitions of the derived types
26 use m_helper_basic ! Functions to compare floating point numbers
27 ! Shared state: generated_decls, sys_size, eqn_idx, chemistry, shear_*
29
30 implicit none
31
32 ! Logistics
33 integer :: num_procs !< Number of processors
34 logical :: non_axis_sym !< Use existing IC data
35 logical :: cfl_dt
36
37 ! Computational Domain Parameters
38
39 integer :: proc_rank !< Rank of the local processor Number of cells in the x-, y- and z-coordinate directions
40
41 !> @name Max and min number of cells in a direction of each combination of x-,y-, and z-
43 integer(kind=8) :: nglobal !< Global number of cells in the domain
44 integer :: m_glb, n_glb, p_glb !< Global number of cells in each direction
45 integer :: grid_geometry !< Cylindrical coordinates (either axisymmetric or full 3D)
46 !> Locations of cell-centers (cc) in x-, y- and z-directions, respectively
47 real(wp), allocatable, dimension(:) :: x_cc, y_cc, z_cc
48 !> Locations of cell-boundaries (cb) in x-, y- and z-directions, respectively
49 real(wp), allocatable, dimension(:) :: x_cb, y_cb, z_cb
50 type(bounds_info) :: x_domain, y_domain, z_domain !< Locations of the domain bounds in the x-, y- and z-coordinate directions
51
52 ! Simulation Algorithm Parameters
53 ! sys_size, eqn_idx, chemistry, shear_*: in m_global_parameters_common
54 ! weno_polyn, muscl_polyn, num_dims, num_vels: in m_global_parameters_common
55 ! Annotations of the structure, i.e. the organization, of the state vectors
56 type(qbmm_idx_info) :: qbmm_idx !< QBMM moment index mappings.
57 ! Cell Indices for the (local) interior points (O-m, O-n, 0-p). Stands for "InDices With BUFFer".
58 type(int_bounds_info) :: idwint(1:3)
59
60 ! Cell indices (InDices With BUFFer): includes buffer except in pre_process
62 type(int_bounds_info) :: bc_x, bc_y, bc_z !< Boundary conditions in the x-, y- and z-coordinate directions
63 type(int_bounds_info) :: ib_bc_x, ib_bc_y, ib_bc_z !< bc_x/y/z before decomposition overwrites them with MPI neighbor ranks
64 type(bc_xyz_info) :: bc !< Combined BC storage (used by the shared beta-buffer routines; pre-process-local)
65 ! simplex_params: auto-generated in generated_decls.fpp
66 ! shear_num/shear_indices/shear_BC_flip_*, bc: in m_global_parameters_common
67 integer :: fd_order !< Finite-difference order for CoM/probe derivative approximations
68 integer :: fd_number !< FD half-stencil size: MAX(1, fd_order/2)
69 type(bubbles_lagrange_parameters) :: lag_params !< Lagrange bubbles' parameters (pre_process-local; not in generated_decls)
70
71 ! fluid_rho (perturbs surrounding-air density to break grid symmetry): auto-generated in generated_decls.fpp
72 ! proc_coords, start_idx, mpiiofs, mpi_info_int: in m_global_parameters_common
73
74 !> @name MPI domain-decomposition neighbor info (Lagrangian-bubble decomposition, #1290)
75 !> @{
76 type(int_bounds_info), dimension(3) :: nidx
77 integer, allocatable, dimension(:,:,:) :: neighbor_ranks !< Neighbor ranks
78 !> @}
79#ifdef MFC_MPI
80 type(mpi_io_var), public :: mpi_io_data
81#endif
82
83 ! Initial Condition Parameters patch_icpp, patch_bc: auto-generated in generated_decls.fpp
84 logical :: bc_io !< whether or not to save BC data
85
86 ! Fluids Physical Parameters fluid_pp, bub_pp: auto-generated in generated_decls.fpp
88 !> @name Bubble modeling
89 !> @{
90 real(wp) :: eu
91 real(wp), dimension(:), allocatable :: weight, r0
92 integer :: nmom !< Number of carried moments
93 !> @}
94
95 !> @name Immersed Boundaries
96 !> @{
97 ! patch_ib, ib_airfoil, stl_models: auto-generated in generated_decls.fpp
98 !> Per-airfoil computed surface grids (unused in pre_process)
99 type(ib_airfoil_grid), allocatable, dimension(:) :: ib_airfoil_grids
100 !> @}
101
102 !> @name Non-polytropic bubble gas compression
103 !> @{
104 real(wp) :: phi_vg, phi_gv, pe_c, tw, k_vl, k_gl
105 real(wp) :: gam_m
106 real(wp), dimension(:), allocatable :: pb0, mass_g0, mass_v0, pe_t, k_v, k_g
107 real(wp), dimension(:), allocatable :: re_trans_t, re_trans_c, im_trans_t, im_trans_c, omegan
109 !> @}
110
111 type(pres_field) :: pb
112 type(pres_field) :: mv
113 integer :: buff_size !< Number of ghost cells for boundary condition storage
114
115contains
116
117 !> Assigns default values to user inputs prior to reading them in. This allows for an easier consistency check of these
118 !! parameters once they are read from the input file.
120
121 integer :: i !< Generic loop operator
122
123 ! Shared defaults (case_dir, m/n/p, cyl_coord, cfl flags, model_eqns, BC blocks,
124 ! recon/weno/muscl/num_fluids/igr/mhd/relativity under case-opt guard, Tait EOS, bubble flags,
125 ! IB flags, parallel I/O flags, fft_wrt)
126
128
129 ! Boundary conditions (bc_x/y/z are per-target declarations, not visible in common)
130 bc_x%beg = dflt_int; bc_x%end = dflt_int
131 bc_y%beg = dflt_int; bc_y%end = dflt_int
132 bc_z%beg = dflt_int; bc_z%end = dflt_int
133
134# 124 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
135# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
136 bc_x%vb1 = 0._wp
137# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
138 bc_x%ve1 = 0._wp
139# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
140# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
141 bc_x%vb2 = 0._wp
142# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
143 bc_x%ve2 = 0._wp
144# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
145# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
146 bc_x%vb3 = 0._wp
147# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
148 bc_x%ve3 = 0._wp
149# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
150# 128 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
151# 124 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
152# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
153 bc_y%vb1 = 0._wp
154# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
155 bc_y%ve1 = 0._wp
156# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
157# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
158 bc_y%vb2 = 0._wp
159# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
160 bc_y%ve2 = 0._wp
161# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
162# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
163 bc_y%vb3 = 0._wp
164# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
165 bc_y%ve3 = 0._wp
166# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
167# 128 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
168# 124 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
169# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
170 bc_z%vb1 = 0._wp
171# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
172 bc_z%ve1 = 0._wp
173# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
174# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
175 bc_z%vb2 = 0._wp
176# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
177 bc_z%ve2 = 0._wp
178# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
179# 125 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
180 bc_z%vb3 = 0._wp
181# 126 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
182 bc_z%ve3 = 0._wp
183# 127 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
184# 128 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
185# 129 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
186
187# 131 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
188 bc_x%isothermal_in = .false.
189# 132 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
190 bc_x%isothermal_out = .false.
191# 133 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
192 bc_x%Twall_in = dflt_real
193# 134 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
194 bc_x%Twall_out = dflt_real
195# 135 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
196# 131 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
197 bc_y%isothermal_in = .false.
198# 132 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
199 bc_y%isothermal_out = .false.
200# 133 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
201 bc_y%Twall_in = dflt_real
202# 134 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
203 bc_y%Twall_out = dflt_real
204# 135 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
205# 131 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
206 bc_z%isothermal_in = .false.
207# 132 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
208 bc_z%isothermal_out = .false.
209# 133 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
210 bc_z%Twall_in = dflt_real
211# 134 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
212 bc_z%Twall_out = dflt_real
213# 135 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
214# 136 "/home/runner/work/MFC/MFC/src/pre_process/m_global_parameters.fpp"
215
217
218 ! Logistics (pre-specific)
219 old_grid = .false.
220 old_ic = .false.
221 t_step_old = dflt_int
222 cfl_dt = .false.
223
224 ! Computational domain parameters (pre-specific)
225 x_domain%beg = dflt_real
226 x_domain%end = dflt_real
227 y_domain%beg = dflt_real
228 y_domain%end = dflt_real
229 z_domain%beg = dflt_real
230 z_domain%end = dflt_real
231
232 stretch_x = .false.
233 stretch_y = .false.
234 stretch_z = .false.
235
236 a_x = dflt_real
237 a_y = dflt_real
238 a_z = dflt_real
239 loops_x = 1
240 loops_y = 1
241 loops_z = 1
242 x_a = dflt_real
243 x_b = dflt_real
244 y_a = dflt_real
245 y_b = dflt_real
246 z_a = dflt_real
247 z_b = dflt_real
248
249 ! Simulation algorithm parameters (pre-specific)
250 palpha_eps = dflt_real
251 ptgalpha_eps = dflt_real
252 igr_order = dflt_int
253 precision = 2
254 mixlayer_perturb = .false.
256 mixlayer_perturb_k0 = 0.4446_wp
257 perturb_flow = .false.
258 perturb_flow_fluid = dflt_int
259 perturb_flow_mag = dflt_real
260 perturb_sph = .false.
261 perturb_sph_fluid = dflt_int
262 fluid_rho = dflt_real
263 elliptic_smoothing_iters = dflt_int
264 elliptic_smoothing = .false.
265
266 simplex_perturb = .false.
267 simplex_params%perturb_vel(:) = .false.
268 simplex_params%perturb_vel_freq(:) = dflt_real
269 simplex_params%perturb_vel_scale(:) = dflt_real
270 simplex_params%perturb_vel_offset(:,:) = dflt_real
271 simplex_params%perturb_dens(:) = .false.
272 simplex_params%perturb_dens_freq(:) = dflt_real
273 simplex_params%perturb_dens_scale(:) = dflt_real
274 simplex_params%perturb_dens_offset(:,:) = dflt_real
275
276 fd_order = dflt_int
277 lag_params%cluster_type = dflt_int
278 lag_params%pressure_corrector = .false.
279 lag_params%smooth_type = dflt_int
280 lag_params%heatTransfer_model = .false.
281 lag_params%massTransfer_model = .false.
282 lag_params%write_bubbles = .false.
283 lag_params%write_bubbles_stats = .false.
284 lag_params%write_void_evol = .false.
285 lag_params%pressure_force = .false.
286 lag_params%gravity_force = .false.
287 lag_params%nBubs_glb = dflt_int
288 lag_params%vel_model = dflt_int
289 lag_params%drag_model = dflt_int
290 lag_params%epsilonb = 1._wp
291 lag_params%charwidth = dflt_real
292 lag_params%charNz = dflt_int
293 lag_params%valmaxvoid = dflt_real
294
296
298 bc_io = .false.
299
300 do i = 1, num_bc_patches_max
301 patch_bc(i)%geometry = dflt_int
302 patch_bc(i)%type = dflt_int
303 patch_bc(i)%dir = dflt_int
304 patch_bc(i)%loc = dflt_int
305 patch_bc(i)%centroid(:) = dflt_real
306 patch_bc(i)%length(:) = dflt_real
307 patch_bc(i)%radius = dflt_real
308 end do
309
310 ! Bubble modeling (pre-specific)
311 polytropic = .true.
312 thermal = dflt_int
313 nb = dflt_int
314
315 eu = dflt_real
316 ca = dflt_real
317 re_inv = dflt_real
318 web = dflt_real
319
320 nmom = 1
321
322 r_g = dflt_real
323 r_v = dflt_real
324 phi_vg = dflt_real
325 phi_gv = dflt_real
326 pe_c = dflt_real
327 tw = dflt_real
328
329 pi_fac = 1._wp
330
331 do i = 1, num_ib_patches_max_namelist
332 patch_ib(i)%geometry = dflt_int
333 patch_ib(i)%x_centroid = 0._wp
334 patch_ib(i)%y_centroid = 0._wp
335 patch_ib(i)%z_centroid = 0._wp
336 patch_ib(i)%length_x = dflt_real
337 patch_ib(i)%length_y = dflt_real
338 patch_ib(i)%length_z = dflt_real
339 patch_ib(i)%radius = dflt_real
340 patch_ib(i)%airfoil_id = 0
341 patch_ib(i)%model_id = 0
342 patch_ib(i)%slip = .false.
343
344 patch_ib(i)%thermal_bc = 0
345 patch_ib(i)%Twall = 0._wp
346 patch_ib(i)%thermal_layer = 0._wp
347 patch_ib(i)%rho_solid = 0._wp
348 patch_ib(i)%cp_solid = 0._wp
349 patch_ib(i)%emissivity = 0._wp
350 patch_ib(i)%T_rad = 0._wp
351 patch_ib(i)%heat_power = 0._wp
352 patch_ib(i)%wall_column = .false.
353 patch_ib(i)%wall_column_len = 0._wp
354 patch_ib(i)%surface_reaction = 0
355
356 patch_ib(i)%v_blow = 0._wp
357 patch_ib(i)%inj_species = 0
358 patch_ib(i)%burn_rate_exp = 0._wp
359 patch_ib(i)%burn_rate_pref = 0._wp
360
361 ! Variables to handle moving immersed boundaries, defaulting to no movement
362 patch_ib(i)%moving_ibm = 0
363 patch_ib(i)%vel(:) = 0._wp
364 patch_ib(i)%angles(:) = 0._wp
365 patch_ib(i)%angular_vel(:) = 0._wp
366 patch_ib(i)%kin_model = 0
367 patch_ib(i)%kin_hinge(:) = 0._wp
368 patch_ib(i)%kin_offset(:) = 0._wp
369 patch_ib(i)%kin_phi0 = 0._wp
370 patch_ib(i)%kin_theta0 = 0._wp
371 patch_ib(i)%kin_theta_mean = 0._wp
372 patch_ib(i)%kin_freq = 0._wp
373 patch_ib(i)%kin_phase = 0._wp
374 patch_ib(i)%kin_t0 = 0._wp
375 patch_ib(i)%kin_ramp = 0._wp
376 patch_ib(i)%kin_pitch_rate = 0._wp
377 patch_ib(i)%kin_smooth = 0._wp
378 patch_ib(i)%mass = dflt_real
379 patch_ib(i)%moment = dflt_real
380 patch_ib(i)%centroid_offset(:) = 0._wp
381
382 ! sets values of a rotation matrix which can be used when calculating rotations
383 patch_ib(i)%rotation_matrix = 0._wp
384 patch_ib(i)%rotation_matrix(1, 1) = 1._wp
385 patch_ib(i)%rotation_matrix(2, 2) = 1._wp
386 patch_ib(i)%rotation_matrix(3, 3) = 1._wp
387 patch_ib(i)%rotation_matrix_inverse = patch_ib(i)%rotation_matrix
388 end do
389
391 do i = 1, num_particle_clouds_max
392 particle_cloud(i)%x_centroid = 0._wp
393 particle_cloud(i)%y_centroid = 0._wp
394 particle_cloud(i)%z_centroid = 0._wp
395 particle_cloud(i)%length_x = dflt_real
396 particle_cloud(i)%length_y = dflt_real
397 particle_cloud(i)%length_z = dflt_real
398 particle_cloud(i)%num_particles = 0
399 particle_cloud(i)%radius = dflt_real
400 particle_cloud(i)%mass = dflt_real
401 particle_cloud(i)%min_spacing = 0._wp
402 particle_cloud(i)%shell_inner_radius = dflt_real
403 particle_cloud(i)%shell_outer_radius = dflt_real
404 particle_cloud(i)%moving_ibm = 0
405 particle_cloud(i)%seed = 0
406 particle_cloud(i)%cloud_geometry = 1
407 particle_cloud(i)%shell_axis = 3
408 particle_cloud(i)%packing_method = dflt_int
409 particle_cloud(i)%periodic = 0
410 end do
411
412 do i = 1, num_ib_airfoils_max
413 ib_airfoil(i)%c = dflt_real
414 ib_airfoil(i)%p = dflt_real
415 ib_airfoil(i)%t = dflt_real
416 ib_airfoil(i)%m = dflt_real
417 end do
418
420
421 do i = 1, num_stl_models_max
422 stl_models(i)%model_filepath(:) = dflt_char
423 stl_models(i)%model_translate(:) = 0._wp
424 stl_models(i)%model_scale(:) = 1._wp
425 stl_models(i)%model_threshold = ray_tracing_threshold
426 end do
427
428 chem_params%gamma_method = 1
429 chem_params%transport_model = 1
430
431 chem_params%reaction_substeps = 0
432 chem_params%adap_substeps = .false.
433 chem_params%reaction_substeps_max = 0
434 chem_params%transport_dt = .false.
435
436 ! Fluids physical parameters
437 do i = 1, num_fluids_max
438 fluid_pp(i)%eos = eos_stiffened_gas
439 fluid_pp(i)%mg_rho0 = dflt_real
440 fluid_pp(i)%mg_c0 = dflt_real
441 fluid_pp(i)%mg_s = dflt_real
442 fluid_pp(i)%mg_gruneisen = dflt_real
443 fluid_pp(i)%mg_gruneisen_a = 0._wp
444 fluid_pp(i)%mg_t0 = 0._wp
445 fluid_pp(i)%mg_s2 = 0._wp
446 fluid_pp(i)%mg_s3 = 0._wp
447 fluid_pp(i)%jwl_a = dflt_real
448 fluid_pp(i)%jwl_b = dflt_real
449 fluid_pp(i)%jwl_r1 = dflt_real
450 fluid_pp(i)%jwl_r2 = dflt_real
451 fluid_pp(i)%jwl_omega = dflt_real
452 fluid_pp(i)%jwl_rho0 = dflt_real
453 fluid_pp(i)%jwl_t0 = 0._wp
454 fluid_pp(i)%vinet_k0 = dflt_real
455 fluid_pp(i)%vinet_k0p = dflt_real
456 fluid_pp(i)%vinet_rho0 = dflt_real
457 fluid_pp(i)%vinet_gruneisen = dflt_real
458 fluid_pp(i)%vinet_gruneisen_a = 0._wp
459 fluid_pp(i)%vinet_t0 = 0._wp
460 fluid_pp(i)%gamma = dflt_real
461 fluid_pp(i)%pi_inf = dflt_real
462 fluid_pp(i)%cv = 0._wp
463 fluid_pp(i)%qv = 0._wp
464 fluid_pp(i)%qvp = 0._wp
465 fluid_pp(i)%k_therm = 0._wp
466 fluid_pp(i)%G = 0._wp
467 fluid_pp(i)%non_newtonian = .false.
468 fluid_pp(i)%K = dflt_real
469 fluid_pp(i)%nn = dflt_real
470 fluid_pp(i)%tau0 = 0._wp
471 fluid_pp(i)%hb_m = dflt_real
472 fluid_pp(i)%mu_min = dflt_real
473 fluid_pp(i)%mu_max = dflt_real
474 fluid_pp(i)%mu_bulk = dflt_real
475 end do
476
477 ! Subgrid bubble parameters
478 bub_pp%R0ref = dflt_real; r0ref = dflt_real
479 bub_pp%p0ref = dflt_real; p0ref = dflt_real
480 bub_pp%rho0ref = dflt_real; rho0ref = dflt_real
481 bub_pp%T0ref = dflt_real; t0ref = dflt_real
482 bub_pp%ss = dflt_real; ss = dflt_real
483 bub_pp%pv = dflt_real; pv = dflt_real
484 bub_pp%vd = dflt_real; vd = dflt_real
485 bub_pp%mu_l = dflt_real; mu_l = dflt_real
486 bub_pp%mu_v = dflt_real; mu_v = dflt_real
487 bub_pp%mu_g = dflt_real; mu_g = dflt_real
488 bub_pp%gam_v = dflt_real; gam_v = dflt_real
489 bub_pp%gam_g = dflt_real; gam_g = dflt_real
490 bub_pp%M_v = dflt_real; m_v = dflt_real
491 bub_pp%M_g = dflt_real; m_g = dflt_real
492 bub_pp%k_v = dflt_real
493 bub_pp%k_g = dflt_real
494 bub_pp%cp_v = dflt_real; cp_v = dflt_real
495 bub_pp%cp_g = dflt_real; cp_g = dflt_real
496 bub_pp%R_v = dflt_real; r_v = dflt_real
497 bub_pp%R_g = dflt_real; r_g = dflt_real
498
500
501 !> Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the module
503
504 integer :: i, j, fac
505
506 if (recon_type == recon_type_weno) then
507 weno_polyn = (weno_order - 1)/2
508 else if (recon_type == recon_type_muscl) then
510 end if
511
512 ! Gamma/Pi_inf: force num_fluids=1 (pre_process-specific side effect of the gamma-law model)
513 if (model_eqns == model_eqns_gamma_law) num_fluids = 1
514
515 ! Pre-process sets nmom to 6 for qbmm before the shared eqn_idx setup
516 ! (guards match the original site: 5-equation bubbles with 4-node qbmm)
517 if (model_eqns == model_eqns_5eq .and. bubbles_euler .and. qbmm .and. nnode == 4) nmom = 6
518
519 ! Populate eqn_idx, sys_size, shear_* (shared logic)
520 call s_initialize_eqn_idx(nmom, nb, six_eqn_alf_is_advected=.false.)
521
522 ! Per-target (pre_process): qbmm_idx allocations and fills
523 if (model_eqns == model_eqns_5eq .and. bubbles_euler) then
524 allocate (qbmm_idx%rs(nb), qbmm_idx%vs(nb))
525 allocate (qbmm_idx%ps(nb), qbmm_idx%ms(nb))
526
527 if (qbmm) then
528 allocate (qbmm_idx%moms(nb, nmom))
529 allocate (qbmm_idx%fullmom(nb,0:nmom,0:nmom))
530
531 do i = 1, nb
532 do j = 1, nmom
533 qbmm_idx%moms(i, j) = eqn_idx%bub%beg + (j - 1) + (i - 1)*nmom
534 end do
535 qbmm_idx%fullmom(i, 0, 0) = qbmm_idx%moms(i, 1)
536 qbmm_idx%fullmom(i, 1, 0) = qbmm_idx%moms(i, 2)
537 qbmm_idx%fullmom(i, 0, 1) = qbmm_idx%moms(i, 3)
538 qbmm_idx%fullmom(i, 2, 0) = qbmm_idx%moms(i, 4)
539 qbmm_idx%fullmom(i, 1, 1) = qbmm_idx%moms(i, 5)
540 qbmm_idx%fullmom(i, 0, 2) = qbmm_idx%moms(i, 6)
541 qbmm_idx%rs(i) = qbmm_idx%fullmom(i, 1, 0)
542 end do
543 else
544 do i = 1, nb
545 if (.not. polytropic) then
546 fac = 4
547 else
548 fac = 2
549 end if
550
551 qbmm_idx%rs(i) = eqn_idx%bub%beg + (i - 1)*fac
552 qbmm_idx%vs(i) = qbmm_idx%rs(i) + 1
553
554 if (.not. polytropic) then
555 qbmm_idx%ps(i) = qbmm_idx%vs(i) + 1
556 qbmm_idx%ms(i) = qbmm_idx%ps(i) + 1
557 end if
558 end do
559 end if
560 end if
561
562 if (euler_lagrange) fd_number = max(1, fd_order/2)
563
566
567#ifdef MFC_MPI
568 if (qbmm .and. .not. polytropic) then
569 allocate (mpi_io_data%view(1:sys_size + 2*nb*nnode))
570 allocate (mpi_io_data%var(1:sys_size + 2*nb*nnode))
571 else
572 allocate (mpi_io_data%view(1:sys_size))
573 allocate (mpi_io_data%var(1:sys_size))
574 end if
575#endif
576
577 ! Allocating grid variables for the x-direction
578 allocate (x_cc(0:m), x_cb(-1:m))
579 ! Allocating grid variables for the y- and z-directions
580 if (n > 0) then
581 allocate (y_cc(0:n), y_cb(-1:n))
582 if (p > 0) then
583 allocate (z_cc(0:p), z_cb(-1:p))
584 end if
585 end if
586
587 if (cyl_coord .neqv. .true.) then ! Cartesian grid
588 grid_geometry = 1
589 else if (cyl_coord .and. p == 0) then ! Axisymmetric cylindrical grid
590 grid_geometry = 2
591 else ! Fully 3D cylindrical grid
592 grid_geometry = 3
593 end if
594
596
597 !> Configure MPI parallel I/O settings and allocate processor coordinate arrays.
602 end subroutine s_initialize_parallel_io
603
604 !> Deallocate all global grid, index, and equation-of-state parameter arrays.
606
607 if (bubbles_euler) then
608 deallocate (qbmm_idx%rs, qbmm_idx%vs, qbmm_idx%ps, qbmm_idx%ms)
609 if (qbmm) deallocate (qbmm_idx%moms, qbmm_idx%fullmom)
610 end if
611
612 ! Deallocating grid variables for the x-direction
613 deallocate (x_cc, x_cb)
614 ! Deallocating grid variables for the y- and z-directions
615 if (n > 0) then
616 deallocate (y_cc, y_cb)
617 if (p > 0) then
618 deallocate (z_cc, z_cb)
619 end if
620 end if
621
622 ! Shared: deallocate proc_coords and start_idx
624
625#ifdef MFC_MPI
626 deallocate (mpi_io_data%var, mpi_io_data%view)
627#endif
628
629 if (allocated(neighbor_ranks)) deallocate (neighbor_ranks)
630
632
633end module m_global_parameters
integer, intent(in) j
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Shared global parameters and equation-index setup for all three executables. Each per-target m_global...
impure subroutine s_assign_ic_patch_defaults
Assign default values to the initial condition patch inputs (pre_process and simulation).
type(ib_stl_parameters), dimension(num_stl_models_max) stl_models
Per-STL model parameters.
impure subroutine s_finalize_global_parameters_common
Shared finalize core: deallocate proc_coords and start_idx. Per-target finalize routines call this fi...
type(subgrid_bubble_physical_parameters) bub_pp
Subgrid bubble physical parameters.
integer sys_size
Number of unknowns in system of equations.
logical euler_lagrange
Lagrangian bubbles or particles are on. Derived, never read from the namelist.
type(physical_parameters), dimension(num_fluids_max) fluid_pp
Per-fluid stiffened-gas EOS parameters, Reynolds numbers, and shear modulus.
type(bc_patch_parameters), dimension(num_bc_patches_max) patch_bc
Boundary condition patch parameters.
type(eqn_idx_info) eqn_idx
All conserved-variable equation index ranges and scalars.
real(wp), dimension(num_fluids_max) fluid_rho
type(ib_patch_parameters), dimension(num_ib_patches_max_namelist) patch_ib
Immersed boundary patch parameters.
impure subroutine s_initialize_parallel_io_common
Configure MPI parallel I/O settings and allocate processor coordinate arrays. Shared across all three...
type(particle_cloud_parameters), dimension(num_particle_clouds_max) particle_cloud
Particle bed specifications.
type(ib_airfoil_parameters), dimension(num_ib_airfoils_max) ib_airfoil
Per-airfoil NACA user inputs.
impure subroutine s_assign_common_defaults
Assign default values to the user-input parameters that are shared across all three executables (pre_...
impure subroutine s_initialize_eqn_idx(nmom_in, nb_in, six_eqn_alf_is_advected)
Initialize equation-index state (eqn_idx and sys_size) from the namelist parameters....
Defines global parameters for the computational domain, simulation algorithm, and initial conditions.
type(int_bounds_info) ib_bc_z
bc_x/y/z before decomposition overwrites them with MPI neighbor ranks
integer grid_geometry
Cylindrical coordinates (either axisymmetric or full 3D).
integer p_glb
Global number of cells in each direction.
impure subroutine s_assign_default_values_to_user_inputs
Assigns default values to user inputs prior to reading them in. This allows for an easier consistency...
impure subroutine s_finalize_global_parameters_module
Deallocate all global grid, index, and equation-of-state parameter arrays.
real(wp), dimension(:), allocatable im_trans_c
type(int_bounds_info), dimension(1:3) idwint
type(int_bounds_info) ib_bc_y
type(int_bounds_info), dimension(3) nidx
type(int_bounds_info) ib_bc_x
type(int_bounds_info) bc_z
Boundary conditions in the x-, y- and z-coordinate directions.
real(wp), dimension(:), allocatable pb0
real(wp), dimension(:), allocatable im_trans_t
type(qbmm_idx_info) qbmm_idx
QBMM moment index mappings.
type(bubbles_lagrange_parameters) lag_params
Lagrange bubbles' parameters (pre_process-local; not in generated_decls).
real(wp), dimension(:), allocatable y_cc
logical non_axis_sym
Use existing IC data.
integer proc_rank
Rank of the local processor Number of cells in the x-, y- and z-coordinate directions.
real(wp), dimension(:), allocatable re_trans_t
logical bc_io
whether or not to save BC data
real(wp), dimension(:), allocatable y_cb
type(bounds_info) z_domain
Locations of the domain bounds in the x-, y- and z-coordinate directions.
real(wp), dimension(:), allocatable weight
real(wp), dimension(:), allocatable k_v
integer fd_number
FD half-stencil size: MAX(1, fd_order/2).
type(int_bounds_info), dimension(1:3) idwbuff
integer buff_size
Number of ghost cells for boundary condition storage.
real(wp), dimension(:), allocatable z_cb
type(int_bounds_info) bc_y
integer, dimension(:,:,:), allocatable neighbor_ranks
Neighbor ranks.
real(wp), dimension(:), allocatable r0
impure subroutine s_initialize_global_parameters_module
Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the...
real(wp), dimension(:), allocatable x_cc
Locations of cell-centers (cc) in x-, y- and z-directions, respectively.
real(wp), dimension(:), allocatable k_g
type(ib_airfoil_grid), dimension(:), allocatable ib_airfoil_grids
Per-airfoil computed surface grids (unused in pre_process).
type(chemistry_parameters) chem_params
integer fd_order
Finite-difference order for CoM/probe derivative approximations.
type(int_bounds_info) bc_x
real(wp), dimension(:), allocatable x_cb
Locations of cell-boundaries (cb) in x-, y- and z-directions, respectively.
real(wp), dimension(:), allocatable z_cc
integer num_procs
Number of processors.
integer nmom
Number of carried moments.
type(cell_num_bounds) cells_bounds
real(wp), dimension(:), allocatable mass_g0
type(mpi_io_var), public mpi_io_data
impure subroutine s_initialize_parallel_io
Configure MPI parallel I/O settings and allocate processor coordinate arrays.
real(wp), dimension(:), allocatable omegan
real(wp), dimension(:), allocatable re_trans_c
type(bc_xyz_info) bc
Combined BC storage (used by the shared beta-buffer routines; pre-process-local).
real(wp), dimension(:), allocatable pe_t
real(wp), dimension(:), allocatable mass_v0
integer(kind=8) nglobal
Global number of cells in the domain.
Basic floating-point utilities: approximate equality, default detection, and coordinate bounds.
elemental subroutine, public s_update_cell_bounds(bounds, m, n, p)
Update the min and max number of cells in each set of axes.
subroutine, public s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, igr_order, buff_size, idwint, idwbuff, viscous, euler_lagrange, m, n, p, num_dims, igr, ib, fd_number)
Compute ghost-cell buffer size and set interior/buffered coordinate index bounds.
Groups the x, y, z boundary condition begin/end codes for passing as a single argument.
Derived type adding beginning (beg) and end bounds info as attributes.
Max and min number of cells in a direction of each combination of x-,y-, and z-.
Computed surface grid for a NACA airfoil (simulation-only, not in namelist).
Integer bounds for variables.
Derived type for bubble variables pb and mv at quadrature nodes (qbmm).
QBMM moment index mappings - separate from bub beg/end so eqn_idx contains no allocatables.