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/post_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/post_process/m_global_parameters.fpp" 2
17
18!> @brief Global parameters for the post-process: domain geometry, equation of state, and output database settings
20
21#ifdef MFC_MPI
22 use mpi !< message passing interface (mpi) module
23#endif
24
27 use m_thermochem, only: species_names
29 ! Shared state: generated_decls, num_dims, num_vels, sys_size, eqn_idx, chemistry, shear_*
31
32 implicit none
33
34 !> @name Logistics
35 !> @{
36 integer :: num_procs !< Number of processors
37 !> @}
38
39 ! Computational Domain Parameters
40
41 integer :: proc_rank !< Rank of the local processor
42 !> @name Number of cells in the x-, y- and z-coordinate directions
43 !> @{
44 integer :: m_root
45 !> @}
46
47 !> @name Max and min number of cells in a direction of each combination of x-,y-, and z-
49 integer(kind=8) :: nglobal !< Total number of cells in global domain
50
51 !> @name Cylindrical coordinates (either axisymmetric or full 3D)
52 !> @{
53 integer :: grid_geometry
54 !> @}
55
56 !> @name Global number of cells in each direction
57 !> @{
58 integer :: m_glb, n_glb, p_glb
59 !> @}
60
61 ! num_dims, num_vels: in m_global_parameters_common
62 !> @name Cell-boundary locations in the x-, y- and z-coordinate directions
63 !> @{
64 real(wp), allocatable, dimension(:) :: x_cb, x_root_cb, y_cb, z_cb
65 !> @}
66
67 !> @name Cell-center locations in the x-, y- and z-coordinate directions
68 !> @{
69 real(wp), allocatable, dimension(:) :: x_cc, x_root_cc, y_cc, z_cc
70 real(sp), allocatable, dimension(:) :: x_root_cc_s, x_cc_s
71 !> @}
72
73 !> Cell-width distributions in the x-, y- and z-coordinate directions
74 !> @{
75 real(wp), allocatable, dimension(:) :: dx, dy, dz
76 !> @}
77
78 integer :: buff_size !< Number of ghost cells for boundary condition storage
79 !> @name IO options for adaptive time-stepping
80 !> @{
81 logical :: cfl_dt
82 integer :: n_save
83 !> @}
84
85 ! NOTE: m_root, x_root_cb, x_root_cc = defragmented grid (1D only; equals m, x_cb, x_cc in serial)
86
87 !> @name Simulation Algorithm Parameters
88 !> @{
89 ! sys_size, chemistry, eqn_idx: in m_global_parameters_common
90 !> @}
91
92 !> @name Annotations of the structure, i.e. the organization, of the state vectors
93 !> @{
94 type(qbmm_idx_info) :: qbmm_idx !< QBMM moment index mappings.
95 integer :: beta_idx !< Index of lagrange bubbles beta
96 !> @}
97
98 ! Cell Indices for the (local) interior points (O-m, O-n, 0-p). Stands for "InDices With BUFFer".
99 type(int_bounds_info) :: idwint(1:3)
100
101 ! Cell indices (InDices With BUFFer): includes buffer in simulation only
103 logical :: bc_io
104 !> @name Boundary conditions in the x-, y- and z-coordinate directions
105 !> @{
107 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
109 !> @}
110
111 ! shear_num, shear_indices, shear_BC_flip_num, shear_BC_flip_indices: in m_global_parameters_common
112 ! proc_coords, start_idx, mpiiofs, mpi_info_int: in m_global_parameters_common
113 type(int_bounds_info), dimension(3) :: nidx !< Neighbor index offsets per direction (#1290 decomposition)
114 integer, allocatable, dimension(:,:,:) :: neighbor_ranks !< MPI ranks of neighbors (#1290 decomposition)
115 type(ib_airfoil_parameters), allocatable, dimension(:) :: ib_airfoil !< Per-airfoil NACA parameters (unused in post_process)
116 !> Per-airfoil computed surface grids (unused in post_process)
117 type(ib_airfoil_grid), allocatable, dimension(:) :: ib_airfoil_grids
118
119#ifdef MFC_MPI
120 type(mpi_io_var), public :: mpi_io_data
124 real(wp), allocatable, dimension(:,:), public :: mpi_io_data_lg_bubbles
125#endif
126
127 ! fluid_pp, bub_pp: auto-generated in generated_decls.fpp
128 real(wp), allocatable, dimension(:) :: adv !< Advection variables
129 ! Formatted Database File(s) Structure Parameters
130
131 type(bounds_info) :: x_output, y_output, z_output !< Portion of domain to output for post-processing
132 type(int_bounds_info) :: x_output_idx, y_output_idx, z_output_idx !< Indices of domain to output for post-processing
133 !> @name Size of the ghost zone layer in the x-, y- and z-coordinate directions. The definition of the ghost zone layers is only
134 !! necessary when using the Silo database file format in multidimensions. These zones provide VisIt with the subdomain
135 !! connectivity information that it requires in order to produce smooth plots.
136 !> @{
138 !> @}
139
140 ! alpha_rho_wrt, mom_wrt, vel_wrt, flux_wrt, alpha_rho_e_wrt, alpha_wrt,
141 ! omega_wrt, chem_wrt_Y, schlieren_alpha: auto-generated in generated_decls.fpp
142 integer :: fd_number !< Finite-difference half-stencil size: MAX(1, fd_order/2)
144 !> @name Bubble modeling variables and parameters
145 !> @{
146 real(wp) :: eu
147 real(wp), dimension(:), allocatable :: weight, r0
148 real(wp) :: phi_vg, phi_gv, pe_c, tw, k_vl, k_gl
149 real(wp) :: gam_m
150 real(wp), dimension(:), allocatable :: pb0, mass_g0, mass_v0, pe_t, k_v, k_g
151 real(wp), dimension(:), allocatable :: re_trans_t, re_trans_c, im_trans_t, im_trans_c, omegan
153 real(wp) :: g
154 integer :: nmom
155 !> @}
156
157 real(wp) :: wall_time, wall_time_avg !< Wall time measurements
158
159contains
160
161 !> Assigns default values to user inputs prior to reading them in. This allows for an easier consistency check of these
162 !! parameters once they are read from the input file.
164
165 integer :: i !< Generic loop iterator
166
167 ! Shared defaults (case_dir, m/n/p, cyl_coord, cfl flags, model_eqns, BC blocks,
168 ! recon/weno/muscl/num_fluids/igr/mhd/relativity under case-opt guard, Tait EOS, bubble flags,
169 ! IB flags, parallel I/O flags, fft_wrt)
170
172
173 ! Boundary conditions (bc_x/y/z are per-target declarations, not visible in common)
174 bc_x%beg = dflt_int; bc_x%end = dflt_int
175 bc_y%beg = dflt_int; bc_y%end = dflt_int
176 bc_z%beg = dflt_int; bc_z%end = dflt_int
177
178# 168 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
179# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
180 bc_x%vb1 = 0._wp
181 bc_x%ve1 = 0._wp
182# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
183 bc_x%vb2 = 0._wp
184 bc_x%ve2 = 0._wp
185# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
186 bc_x%vb3 = 0._wp
187 bc_x%ve3 = 0._wp
188# 172 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
189# 168 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
190# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
191 bc_y%vb1 = 0._wp
192 bc_y%ve1 = 0._wp
193# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
194 bc_y%vb2 = 0._wp
195 bc_y%ve2 = 0._wp
196# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
197 bc_y%vb3 = 0._wp
198 bc_y%ve3 = 0._wp
199# 172 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
200# 168 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
201# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
202 bc_z%vb1 = 0._wp
203 bc_z%ve1 = 0._wp
204# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
205 bc_z%vb2 = 0._wp
206 bc_z%ve2 = 0._wp
207# 169 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
208 bc_z%vb3 = 0._wp
209 bc_z%ve3 = 0._wp
210# 172 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
211# 173 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
212
213# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
214 bc_x%isothermal_in = .false.
215 bc_x%isothermal_out = .false.
216 bc_x%Twall_in = dflt_real
217 bc_x%Twall_out = dflt_real
218# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
219 bc_y%isothermal_in = .false.
220 bc_y%isothermal_out = .false.
221 bc_y%Twall_in = dflt_real
222 bc_y%Twall_out = dflt_real
223# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
224 bc_z%isothermal_in = .false.
225 bc_z%isothermal_out = .false.
226 bc_z%Twall_in = dflt_real
227 bc_z%Twall_out = dflt_real
228# 180 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
229
231
232 ! Computational domain parameters (post-specific)
234
237
238 cfl_dt = .false.
242
243 bc_io = .false.
245
246 chem_params%gamma_method = 1
247 chem_params%transport_model = 1
248
249 chem_params%reaction_substeps = 0
250 chem_params%adap_substeps = .false.
251 chem_params%reaction_substeps_max = 0
252
253 ! Fluids physical parameters (post-specific; G = dflt_real differs from pre/sim)
254 do i = 1, num_fluids_max
256 fluid_pp(i)%mg_rho0 = dflt_real
257 fluid_pp(i)%mg_c0 = dflt_real
258 fluid_pp(i)%mg_s = dflt_real
259 fluid_pp(i)%mg_gruneisen = dflt_real
260 fluid_pp(i)%mg_gruneisen_a = 0._wp
261 fluid_pp(i)%mg_t0 = 0._wp
262 fluid_pp(i)%mg_s2 = 0._wp
263 fluid_pp(i)%mg_s3 = 0._wp
264 fluid_pp(i)%jwl_a = dflt_real
265 fluid_pp(i)%jwl_b = dflt_real
266 fluid_pp(i)%jwl_r1 = dflt_real
267 fluid_pp(i)%jwl_r2 = dflt_real
268 fluid_pp(i)%jwl_omega = dflt_real
269 fluid_pp(i)%jwl_rho0 = dflt_real
270 fluid_pp(i)%jwl_t0 = 0._wp
271 fluid_pp(i)%vinet_k0 = dflt_real
272 fluid_pp(i)%vinet_k0p = dflt_real
273 fluid_pp(i)%vinet_rho0 = dflt_real
274 fluid_pp(i)%vinet_gruneisen = dflt_real
275 fluid_pp(i)%vinet_gruneisen_a = 0._wp
276 fluid_pp(i)%vinet_t0 = 0._wp
277 fluid_pp(i)%gamma = dflt_real
278 fluid_pp(i)%pi_inf = dflt_real
279 fluid_pp(i)%cv = 0._wp
280 fluid_pp(i)%qv = 0._wp
281 fluid_pp(i)%qvp = 0._wp
282 fluid_pp(i)%k_therm = 0._wp
283 fluid_pp(i)%G = dflt_real
284 fluid_pp(i)%non_newtonian = .false.
285 fluid_pp(i)%K = dflt_real
286 fluid_pp(i)%nn = dflt_real
287 fluid_pp(i)%tau0 = 0._wp
288 fluid_pp(i)%hb_m = dflt_real
289 fluid_pp(i)%mu_min = dflt_real
290 fluid_pp(i)%mu_max = dflt_real
291 fluid_pp(i)%mu_bulk = dflt_real
292 end do
293
296 particle_cloud(i)%x_centroid = 0._wp
297 particle_cloud(i)%y_centroid = 0._wp
298 particle_cloud(i)%z_centroid = 0._wp
299 particle_cloud(i)%length_x = dflt_real
300 particle_cloud(i)%length_y = dflt_real
301 particle_cloud(i)%length_z = dflt_real
302 particle_cloud(i)%num_particles = 0
303 particle_cloud(i)%radius = dflt_real
304 particle_cloud(i)%mass = dflt_real
305 particle_cloud(i)%min_spacing = 0._wp
306 particle_cloud(i)%moving_ibm = 0
307 particle_cloud(i)%seed = 0
308 particle_cloud(i)%packing_method = dflt_int
309 end do
310
311 ! Subgrid bubble parameters (bub_pp struct + scalar companions; bub_pp%R0ref is set in common
312 ! via R0ref; the scalar companions are per-target manual declarations)
315 bub_pp%rho0ref = dflt_real; rho0ref = dflt_real
327 bub_pp%k_v = dflt_real
328 bub_pp%k_g = dflt_real
333
334 ! Formatted database file(s) structure parameters (post-specific)
335 format = dflt_int
336
338
339 alpha_rho_wrt = .false.
340 alpha_rho_e_wrt = .false.
341 rho_wrt = .false.
342 mom_wrt = .false.
343 vel_wrt = .false.
344 chem_wrt_y = .false.
345 chem_wrt_t = .false.
347 flux_wrt = .false.
348 e_wrt = .false.
349 pres_wrt = .false.
350 alpha_wrt = .false.
351 gamma_wrt = .false.
352 heat_ratio_wrt = .false.
353 pi_inf_wrt = .false.
354 pres_inf_wrt = .false.
355 prim_vars_wrt = .false.
356 cons_vars_wrt = .false.
357 c_wrt = .false.
358 t_wrt = .false.
359 omega_wrt = .false.
360 qm_wrt = .false.
361 liutex_wrt = .false.
362 schlieren_wrt = .false.
363 sim_data = .false.
364 cf_wrt = .false.
365 ib_state_wrt = .false.
366 lag_txt_wrt = .false.
367 lag_header = .true.
368 lag_db_wrt = .false.
369 lag_id_wrt = .true.
370 lag_pos_wrt = .true.
371 lag_pos_prev_wrt = .false.
372 lag_vel_wrt = .true.
373 lag_rad_wrt = .true.
374 lag_rvel_wrt = .false.
375 lag_r0_wrt = .false.
376 lag_rmax_wrt = .false.
377 lag_rmin_wrt = .false.
378 lag_dphidt_wrt = .false.
379 lag_pres_wrt = .false.
380 lag_mv_wrt = .false.
381 lag_mg_wrt = .false.
382 lag_betat_wrt = .false.
383 lag_betac_wrt = .false.
384
386
388
389 ! Bubble modeling (post-specific)
390 nb = dflt_int
391
392 ! Output partial domain (post-specific)
393 output_partial_domain = .false.
394 x_output%beg = dflt_real
395 x_output%end = dflt_real
396 y_output%beg = dflt_real
397 y_output%end = dflt_real
398 z_output%beg = dflt_real
399 z_output%end = dflt_real
400
402
403 !> Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the module
405
406 integer :: i, j, fac
407
408 ! Setting m_root equal to m in the case of a 1D serial simulation
409
410 if (n == 0) m_root = m_glb
411
412 ! Declared for the common conversion kernel but not a post_process input, so it is neither
413 ! defaulted on non-root ranks nor broadcast. Post-process never carries viscous stresses.
414 viscous = .false.
415
416 ! Particle clouds expand into individual IB patches at simulation startup, so num_ibs as read
417 ! from the case file counts only the namelist patches. Match the global count the simulation
418 ! arrives at (s_read_ib_restart_data) so the IB state records can be read back.
419 do i = 1, num_particle_clouds
420 num_ibs = num_ibs + particle_cloud(i)%num_particles
421 end do
422
423 ! Gamma/Pi_inf: force num_fluids=1 (post_process-specific side effect of the gamma-law model)
425
426 ! post_process sets nmom to 6 for qbmm before the shared eqn_idx setup
427 ! (guard matches the original site: inside the 5-equation branch)
428 if (model_eqns == model_eqns_5eq .and. qbmm) nmom = 6
429
430 ! Populate eqn_idx, sys_size, shear_* (shared logic)
431 call s_initialize_eqn_idx(nmom, nb, six_eqn_alf_is_advected=.false.)
432
433 ! post-only: 6eq alf is a dummy (no void fraction in 6eq)
434 if (model_eqns == model_eqns_6eq) eqn_idx%alf = 1
435
436 ! post-only: set default indices for disabled fields (used by post-processing consumers)
438 if (.not. cont_damage) eqn_idx%damage = dflt_int
439 if (.not. hyper_cleaning) eqn_idx%psi = dflt_int
440 end if
441
442 ! post-only: species defaults when chemistry is off
443 if (.not. chemistry) then
444 eqn_idx%species%beg = 1
445 eqn_idx%species%end = 1
446 end if
447
448 ! Per-target (post_process): beta_idx for bubbles_lagrange (5eq only, after main eqn_idx setup)
450 beta_idx = sys_size + 1
452 end if
453
454 ! Per-target (post_process): qbmm_idx allocations and fills
455 if (model_eqns == model_eqns_5eq .and. bubbles_euler) then
456 allocate (qbmm_idx%rs(nb), qbmm_idx%vs(nb))
457 allocate (qbmm_idx%ps(nb), qbmm_idx%ms(nb))
458
459 if (qbmm) then
460 allocate (qbmm_idx%moms(nb, nmom))
461 do i = 1, nb
462 do j = 1, nmom
463 qbmm_idx%moms(i, j) = eqn_idx%bub%beg + (j - 1) + (i - 1)*nmom
464 end do
465 qbmm_idx%rs(i) = qbmm_idx%moms(i, 2)
466 qbmm_idx%vs(i) = qbmm_idx%moms(i, 3)
467 end do
468 else
469 do i = 1, nb
470 if (polytropic .neqv. .true.) then
471 fac = 4
472 else
473 fac = 2
474 end if
475
476 qbmm_idx%rs(i) = eqn_idx%bub%beg + (i - 1)*fac
477 qbmm_idx%vs(i) = qbmm_idx%rs(i) + 1
478
479 if (polytropic .neqv. .true.) then
480 qbmm_idx%ps(i) = qbmm_idx%vs(i) + 1
481 qbmm_idx%ms(i) = qbmm_idx%ps(i) + 1
482 end if
483 end do
484 end if
485 end if
486
487 if (output_partial_domain) then
488 x_output_idx%beg = 0
489 x_output_idx%end = 0
490 y_output_idx%beg = 0
491 y_output_idx%end = 0
492 z_output_idx%beg = 0
493 z_output_idx%end = 0
494 end if
495
496#ifdef MFC_MPI
497 if (qbmm .and. .not. polytropic) then
498 allocate (mpi_io_data%view(1:sys_size + 2*nb*nnode))
499 allocate (mpi_io_data%var(1:sys_size + 2*nb*nnode))
500 else
501 allocate (mpi_io_data%view(1:sys_size))
502 allocate (mpi_io_data%var(1:sys_size))
503 end if
504
505 do i = 1, sys_size
506 if (down_sample) then
507 allocate (mpi_io_data%var(i)%sf(-1:m + 1,-1:n + 1,-1:p + 1))
508 else
509 allocate (mpi_io_data%var(i)%sf(0:m,0:n,0:p))
510 end if
511 mpi_io_data%var(i)%sf => null()
512 end do
513 if (qbmm .and. .not. polytropic) then
514 do i = sys_size + 1, sys_size + 2*nb*nnode
515 allocate (mpi_io_data%var(i)%sf(0:m,0:n,0:p))
516 mpi_io_data%var(i)%sf => null()
517 end do
518 end if
519
520 if (ib) allocate (mpi_io_ib_data%var%sf(0:m,0:n,0:p))
521#endif
522
523 ! Size of the ghost zone layer is non-zero only when post-processing the raw simulation data of a parallel multidimensional
524 ! computation in the Silo-HDF5 format. If this is the case, one must also verify whether the raw simulation data is 2D or
525 ! 3D. In the 2D case, size of the z-coordinate direction ghost zone layer must be zeroed out.
526 if (num_procs == 1 .or. format /= format_silo) then
527 offset_x%beg = 0
528 offset_x%end = 0
529 offset_y%beg = 0
530 offset_y%end = 0
531 offset_z%beg = 0
532 offset_z%end = 0
533 else if (n == 0) then
534 offset_y%beg = 0
535 offset_y%end = 0
536 offset_z%beg = 0
537 offset_z%end = 0
538 else if (p == 0) then
539 offset_z%beg = 0
540 offset_z%end = 0
541 end if
542
543 ! Determining the finite-difference number and the buffer size. Note that the size of the buffer is unrelated to the order
544 ! of the WENO scheme. Rather, it is directly dependent on maximum size of ghost zone layers and possibly the order of the
545 ! finite difference scheme used for the computation of vorticity and/or numerical Schlieren function.
546 buff_size = max(offset_x%beg, offset_x%end, offset_y%beg, offset_y%end, offset_z%beg, offset_z%end)
547
548 if (any(omega_wrt) .or. schlieren_wrt .or. qm_wrt .or. liutex_wrt) then
549 fd_number = max(1, fd_order/2)
551 end if
552
553 ! Configuring Coordinate Direction Indexes
554 idwint(1)%beg = 0; idwint(2)%beg = 0; idwint(3)%beg = 0
555 idwint(1)%end = m; idwint(2)%end = n; idwint(3)%end = p
556
557 idwbuff(1)%beg = -buff_size
558 if (num_dims > 1) then; idwbuff(2)%beg = -buff_size; else; idwbuff(2)%beg = 0; end if
559 if (num_dims > 2) then; idwbuff(3)%beg = -buff_size; else; idwbuff(3)%beg = 0; end if
560
561 idwbuff(1)%end = idwint(1)%end - idwbuff(1)%beg
562 idwbuff(2)%end = idwint(2)%end - idwbuff(2)%beg
563 idwbuff(3)%end = idwint(3)%end - idwbuff(3)%beg
564
565 ! Allocating single precision grid variables if needed
566 allocate (x_cc_s(-buff_size:m + buff_size))
567
568 ! Allocating the grid variables in the x-coordinate direction
569 allocate (x_cb(-1 - offset_x%beg:m + offset_x%end))
570 allocate (x_cc(-buff_size:m + buff_size))
571 allocate (dx(-buff_size:m + buff_size))
572
573 ! Allocating grid variables in the y- and z-coordinate directions
574 if (n > 0) then
575 allocate (y_cb(-1 - offset_y%beg:n + offset_y%end))
576 allocate (y_cc(-buff_size:n + buff_size))
577 allocate (dy(-buff_size:n + buff_size))
578
579 if (p > 0) then
580 allocate (z_cb(-1 - offset_z%beg:p + offset_z%end))
581 allocate (z_cc(-buff_size:p + buff_size))
582 allocate (dz(-buff_size:p + buff_size))
583 end if
584
585 ! Allocating the grid variables, only used for the 1D simulations, and containing the defragmented computational domain
586 ! grid data
587 else
588 allocate (x_root_cb(-1:m_root))
589 allocate (x_root_cc(0:m_root))
590
591 if (precision == precision_single) then
592 allocate (x_root_cc_s(0:m_root))
593 end if
594 end if
595
596 allocate (adv(num_fluids))
597
598 if (cyl_coord .neqv. .true.) then ! Cartesian grid
599 grid_geometry = 1
600 else if (cyl_coord .and. p == 0) then ! Axisymmetric cylindrical grid
601 grid_geometry = 2
602 else ! Fully 3D cylindrical grid
603 grid_geometry = 3
604 end if
605
607
608 !> Subroutine to initialize parallel infrastructure
613 end subroutine s_initialize_parallel_io
614
615 !> Deallocation procedures for the module
617
618 integer :: i
619
620 if (bubbles_euler) then
621 deallocate (qbmm_idx%rs, qbmm_idx%vs, qbmm_idx%ps, qbmm_idx%ms)
622 if (qbmm) deallocate (qbmm_idx%moms)
623 end if
624
625 ! Deallocating the grid variables for the x-coordinate direction
626 deallocate (x_cc, x_cb, dx)
627
628 ! Deallocating grid variables for the y- and z-coordinate directions
629 if (n > 0) then
630 deallocate (y_cc, y_cb, dy)
631 if (p > 0) then
632 deallocate (z_cc, z_cb, dz)
633 end if
634 else
635 ! Deallocating the grid variables, only used for the 1D simulations, and containing the defragmented computational
636 ! domain grid data
637 deallocate (x_root_cb, x_root_cc)
638 end if
639
640 ! Shared: deallocate proc_coords and start_idx
642
643 deallocate (adv)
644
645#ifdef MFC_MPI
646 if (parallel_io) then
647 do i = 1, sys_size
648 mpi_io_data%var(i)%sf => null()
649 end do
650
651 deallocate (mpi_io_data%var)
652 deallocate (mpi_io_data%view)
653 end if
654
655 if (ib) mpi_io_ib_data%var%sf => null()
656#endif
657
658 if (allocated(neighbor_ranks)) deallocate (neighbor_ranks)
659
661
662end module m_global_parameters
integer, intent(in) j
Compile-time constant parameters: default values, tolerances, and physical constants.
integer, parameter model_eqns_5eq
integer, parameter format_silo
integer, parameter dflt_int
Default integer value.
integer, parameter num_particle_clouds_max
Maximum number of particle bed patch specifications.
real(wp), parameter dflt_real
Default real value.
integer, parameter num_fluids_max
Maximum number of fluids in the simulation.
integer, parameter nnode
Number of QBMM nodes.
integer, parameter precision_single
integer, parameter eos_stiffened_gas
Equation of state per fluid. Values must match _EOS_NAMES in toolchain/mfc/params/definitions....
integer, parameter model_eqns_6eq
integer, parameter model_eqns_gamma_law
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_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, dimension(num_fluids_max) alpha_rho_e_wrt
logical, dimension(num_species) chem_wrt_y
real(wp), dimension(num_fluids_max) schlieren_alpha
logical, dimension(num_fluids_max) alpha_wrt
type(physical_parameters), dimension(num_fluids_max) fluid_pp
Per-fluid stiffened-gas EOS parameters, Reynolds numbers, and shear modulus.
logical, dimension(num_fluids_max) alpha_rho_wrt
type(eqn_idx_info) eqn_idx
All conserved-variable equation index ranges and scalars.
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.
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....
Global parameters for the post-process: domain geometry, equation of state, and output database setti...
type(int_bounds_info) ib_bc_z
bc_x/y/z before decomposition overwrites them with MPI neighbor ranks
real(sp), dimension(:), allocatable x_cc_s
type(mpi_io_levelset_norm_var), public mpi_io_levelsetnorm_data
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
Deallocation procedures for the module.
real(wp), dimension(:), allocatable im_trans_c
type(int_bounds_info), dimension(1:3) idwint
integer beta_idx
Index of lagrange bubbles beta.
type(int_bounds_info) offset_y
type(int_bounds_info) ib_bc_y
type(int_bounds_info), dimension(3) nidx
Neighbor index offsets per direction (#1290 decomposition).
type(int_bounds_info) ib_bc_x
real(wp), dimension(:), allocatable pb0
real(wp), dimension(:), allocatable im_trans_t
type(qbmm_idx_info) qbmm_idx
QBMM moment index mappings.
real(wp), dimension(:,:), allocatable, public mpi_io_data_lg_bubbles
real(wp), dimension(:), allocatable y_cc
integer proc_rank
Rank of the local processor.
real(wp), dimension(:), allocatable re_trans_t
real(wp), dimension(:), allocatable adv
Advection variables.
real(wp), dimension(:), allocatable x_root_cc
type(int_bounds_info) z_output_idx
Indices of domain to output for post-processing.
type(mpi_io_ib_var), public mpi_io_ib_data
real(wp), dimension(:), allocatable y_cb
real(wp), dimension(:), allocatable dz
real(wp), dimension(:), allocatable weight
real(wp), dimension(:), allocatable k_v
real(wp), dimension(:), allocatable x_root_cb
integer fd_number
Finite-difference half-stencil size: MAX(1, fd_order/2).
type(mpi_io_levelset_var), public mpi_io_levelset_data
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(bounds_info) z_output
Portion of domain to output for post-processing.
type(ib_airfoil_parameters), dimension(:), allocatable ib_airfoil
Per-airfoil NACA parameters (unused in post_process).
integer, dimension(:,:,:), allocatable neighbor_ranks
MPI ranks of neighbors (#1290 decomposition).
real(wp), dimension(:), allocatable r0
type(int_bounds_info) x_output_idx
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
real(wp), dimension(:), allocatable k_g
type(ib_airfoil_grid), dimension(:), allocatable ib_airfoil_grids
Per-airfoil computed surface grids (unused in post_process).
type(chemistry_parameters) chem_params
real(wp), dimension(:), allocatable x_cb
real(wp), dimension(:), allocatable dy
type(int_bounds_info) offset_x
real(wp), dimension(:), allocatable z_cc
integer num_procs
Number of processors.
type(int_bounds_info) y_output_idx
type(int_bounds_info) offset_z
type(cell_num_bounds) cells_bounds
real(wp), dimension(:), allocatable mass_g0
real(wp) wall_time_avg
Wall time measurements.
type(mpi_io_var), public mpi_io_data
impure subroutine s_initialize_parallel_io
Subroutine to initialize parallel infrastructure.
real(wp), dimension(:), allocatable omegan
real(wp), dimension(:), allocatable re_trans_c
real(sp), dimension(:), allocatable x_root_cc_s
real(wp), dimension(:), allocatable dx
Cell-width distributions in the x-, y- and z-coordinate directions.
real(wp), dimension(:), allocatable pe_t
real(wp), dimension(:), allocatable mass_v0
integer(kind=8) nglobal
Total number of cells in global 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.
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).
User-input parameters for a NACA 4-digit airfoil (namelist-safe: scalars only).
Integer bounds for variables.
QBMM moment index mappings - separate from bub beg/end so eqn_idx contains no allocatables.