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 ! Single-precision copies, handed to Silo when precision == precision_single.
66 ! Silo stores the mesh coordinates with their own datatype, independent of the
67 ! flow variables, so the mesh needs its own single-precision arrays to follow
68 ! the requested precision.
69 real(sp), allocatable, dimension(:) :: x_cb_s, y_cb_s, z_cb_s
70 !> @}
71
72 !> @name Cell-center locations in the x-, y- and z-coordinate directions
73 !> @{
74 real(wp), allocatable, dimension(:) :: x_cc, x_root_cc, y_cc, z_cc
75 real(sp), allocatable, dimension(:) :: x_root_cc_s, x_cc_s
76 !> @}
77
78 !> Cell-width distributions in the x-, y- and z-coordinate directions
79 !> @{
80 real(wp), allocatable, dimension(:) :: dx, dy, dz
81 !> @}
82
83 integer :: buff_size !< Number of ghost cells for boundary condition storage
84 !> @name IO options for adaptive time-stepping
85 !> @{
86 logical :: cfl_dt
87 integer :: n_save
88 !> @}
89
90 ! NOTE: m_root, x_root_cb, x_root_cc = defragmented grid (1D only; equals m, x_cb, x_cc in serial)
91
92 !> @name Simulation Algorithm Parameters
93 !> @{
94 ! sys_size, chemistry, eqn_idx: in m_global_parameters_common
95 !> @}
96
97 !> @name Annotations of the structure, i.e. the organization, of the state vectors
98 !> @{
99 type(qbmm_idx_info) :: qbmm_idx !< QBMM moment index mappings.
100 integer :: beta_idx !< Index of lagrange bubbles beta
101 integer :: sys_size_io !< Variables per restart/BC record: sys_size less the post-only beta slot
102 !> @}
103
104 ! Cell Indices for the (local) interior points (O-m, O-n, 0-p). Stands for "InDices With BUFFer".
106
107 ! Cell indices (InDices With BUFFer): includes buffer in simulation only
109 logical :: bc_io
110 !> @name Boundary conditions in the x-, y- and z-coordinate directions
111 !> @{
113 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
115 !> @}
116
117 ! shear_num, shear_indices, shear_BC_flip_num, shear_BC_flip_indices: in m_global_parameters_common
118 ! proc_coords, start_idx, mpiiofs, mpi_info_int: in m_global_parameters_common
119 type(int_bounds_info), dimension(3) :: nidx !< Neighbor index offsets per direction (#1290 decomposition)
120 integer, allocatable, dimension(:,:,:) :: neighbor_ranks !< MPI ranks of neighbors (#1290 decomposition)
121 type(ib_airfoil_parameters), allocatable, dimension(:) :: ib_airfoil !< Per-airfoil NACA parameters (unused in post_process)
122 !> Per-airfoil computed surface grids (unused in post_process)
123 type(ib_airfoil_grid), allocatable, dimension(:) :: ib_airfoil_grids
124
125#ifdef MFC_MPI
126 type(mpi_io_var), public :: mpi_io_data
130 real(wp), allocatable, dimension(:,:), public :: mpi_io_data_lg_bubbles
131#endif
132
133 ! fluid_pp, bub_pp: auto-generated in generated_decls.fpp
134 real(wp), allocatable, dimension(:) :: adv !< Advection variables
135 ! Formatted Database File(s) Structure Parameters
136
137 type(bounds_info) :: x_output, y_output, z_output !< Portion of domain to output for post-processing
138 type(int_bounds_info) :: x_output_idx, y_output_idx, z_output_idx !< Indices of domain to output for post-processing
139 !> @name Size of the ghost zone layer in the x-, y- and z-coordinate directions. The definition of the ghost zone layers is only
140 !! necessary when using the Silo database file format in multidimensions. These zones provide VisIt with the subdomain
141 !! connectivity information that it requires in order to produce smooth plots.
142 !> @{
144 !> @}
145
146 ! alpha_rho_wrt, mom_wrt, vel_wrt, flux_wrt, alpha_rho_e_wrt, alpha_wrt,
147 ! omega_wrt, chem_wrt_Y, schlieren_alpha: auto-generated in generated_decls.fpp
148 integer :: fd_number !< Finite-difference half-stencil size: MAX(1, fd_order/2)
150 !> @name Bubble modeling variables and parameters
151 !> @{
152 real(wp) :: eu
153 real(wp), dimension(:), allocatable :: weight, r0
154 real(wp) :: phi_vg, phi_gv, pe_c, tw, k_vl, k_gl
155 real(wp) :: gam_m
156 real(wp), dimension(:), allocatable :: pb0, mass_g0, mass_v0, pe_t, k_v, k_g
157 real(wp), dimension(:), allocatable :: re_trans_t, re_trans_c, im_trans_t, im_trans_c, omegan
159 real(wp) :: g
160 integer :: nmom
161 !> @}
162
163 real(wp) :: wall_time, wall_time_avg !< Wall time measurements
164
165contains
166
167 !> Assigns default values to user inputs prior to reading them in. This allows for an easier consistency check of these
168 !! parameters once they are read from the input file.
170
171 integer :: i !< Generic loop iterator
172
173 ! Shared defaults (case_dir, m/n/p, cyl_coord, cfl flags, model_eqns, BC blocks,
174 ! recon/weno/muscl/num_fluids/igr/mhd/relativity under case-opt guard, Tait EOS, bubble flags,
175 ! IB flags, parallel I/O flags, fft_wrt)
176
178
179 ! Boundary conditions (bc_x/y/z are per-target declarations, not visible in common)
180 bc_x%beg = dflt_int; bc_x%end = dflt_int
181 bc_y%beg = dflt_int; bc_y%end = dflt_int
182 bc_z%beg = dflt_int; bc_z%end = dflt_int
183
184# 174 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
185# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
186 bc_x%vb1 = 0._wp
187# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
188 bc_x%ve1 = 0._wp
189# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
190# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
191 bc_x%vb2 = 0._wp
192# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
193 bc_x%ve2 = 0._wp
194# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
195# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
196 bc_x%vb3 = 0._wp
197# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
198 bc_x%ve3 = 0._wp
199# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
200# 178 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
201# 174 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
202# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
203 bc_y%vb1 = 0._wp
204# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
205 bc_y%ve1 = 0._wp
206# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
207# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
208 bc_y%vb2 = 0._wp
209# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
210 bc_y%ve2 = 0._wp
211# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
212# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
213 bc_y%vb3 = 0._wp
214# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
215 bc_y%ve3 = 0._wp
216# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
217# 178 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
218# 174 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
219# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
220 bc_z%vb1 = 0._wp
221# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
222 bc_z%ve1 = 0._wp
223# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
224# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
225 bc_z%vb2 = 0._wp
226# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
227 bc_z%ve2 = 0._wp
228# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
229# 175 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
230 bc_z%vb3 = 0._wp
231# 176 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
232 bc_z%ve3 = 0._wp
233# 177 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
234# 178 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
235# 179 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
236
237# 181 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
238 bc_x%isothermal_in = .false.
239# 182 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
240 bc_x%isothermal_out = .false.
241# 183 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
242 bc_x%Twall_in = dflt_real
243# 184 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
244 bc_x%Twall_out = dflt_real
245# 185 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
246# 181 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
247 bc_y%isothermal_in = .false.
248# 182 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
249 bc_y%isothermal_out = .false.
250# 183 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
251 bc_y%Twall_in = dflt_real
252# 184 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
253 bc_y%Twall_out = dflt_real
254# 185 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
255# 181 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
256 bc_z%isothermal_in = .false.
257# 182 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
258 bc_z%isothermal_out = .false.
259# 183 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
260 bc_z%Twall_in = dflt_real
261# 184 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
262 bc_z%Twall_out = dflt_real
263# 185 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
264# 186 "/home/runner/work/MFC/MFC/src/post_process/m_global_parameters.fpp"
265
267
268 ! Computational domain parameters (post-specific)
270
273
274 cfl_dt = .false.
278
279 ! AMR: post_process overlays the refined fine blocks when this is on (default off)
280 amr = .false.
281
282 bc_io = .false.
284
285 chem_params%gamma_method = 1
286 chem_params%transport_model = 1
287
288 chem_params%reaction_substeps = 0
289 chem_params%adap_substeps = .false.
290 chem_params%reaction_substeps_max = 0
291 chem_params%transport_dt = .false.
292
293 ! Fluids physical parameters (post-specific; G = dflt_real differs from pre/sim)
294 do i = 1, num_fluids_max
296 fluid_pp(i)%mg_rho0 = dflt_real
297 fluid_pp(i)%mg_c0 = dflt_real
298 fluid_pp(i)%mg_s = dflt_real
299 fluid_pp(i)%mg_gruneisen = dflt_real
300 fluid_pp(i)%mg_gruneisen_a = 0._wp
301 fluid_pp(i)%mg_t0 = 0._wp
302 fluid_pp(i)%mg_s2 = 0._wp
303 fluid_pp(i)%mg_s3 = 0._wp
304 fluid_pp(i)%jwl_a = dflt_real
305 fluid_pp(i)%jwl_b = dflt_real
306 fluid_pp(i)%jwl_r1 = dflt_real
307 fluid_pp(i)%jwl_r2 = dflt_real
308 fluid_pp(i)%jwl_omega = dflt_real
309 fluid_pp(i)%jwl_rho0 = dflt_real
310 fluid_pp(i)%jwl_t0 = 0._wp
311 fluid_pp(i)%vinet_k0 = dflt_real
312 fluid_pp(i)%vinet_k0p = dflt_real
313 fluid_pp(i)%vinet_rho0 = dflt_real
314 fluid_pp(i)%vinet_gruneisen = dflt_real
315 fluid_pp(i)%vinet_gruneisen_a = 0._wp
316 fluid_pp(i)%vinet_t0 = 0._wp
317 fluid_pp(i)%gamma = dflt_real
318 fluid_pp(i)%pi_inf = dflt_real
319 fluid_pp(i)%cv = 0._wp
320 fluid_pp(i)%qv = 0._wp
321 fluid_pp(i)%qvp = 0._wp
322 fluid_pp(i)%k_therm = 0._wp
323 fluid_pp(i)%G = dflt_real
324 fluid_pp(i)%non_newtonian = .false.
325 fluid_pp(i)%K = dflt_real
326 fluid_pp(i)%nn = dflt_real
327 fluid_pp(i)%tau0 = 0._wp
328 fluid_pp(i)%hb_m = dflt_real
329 fluid_pp(i)%mu_min = dflt_real
330 fluid_pp(i)%mu_max = dflt_real
331 fluid_pp(i)%mu_bulk = dflt_real
332 end do
333
336 particle_cloud(i)%x_centroid = 0._wp
337 particle_cloud(i)%y_centroid = 0._wp
338 particle_cloud(i)%z_centroid = 0._wp
339 particle_cloud(i)%length_x = dflt_real
340 particle_cloud(i)%length_y = dflt_real
341 particle_cloud(i)%length_z = dflt_real
342 particle_cloud(i)%num_particles = 0
343 particle_cloud(i)%radius = dflt_real
344 particle_cloud(i)%mass = dflt_real
345 particle_cloud(i)%min_spacing = 0._wp
346 particle_cloud(i)%moving_ibm = 0
347 particle_cloud(i)%seed = 0
348 particle_cloud(i)%packing_method = dflt_int
349 end do
350
351 ! Subgrid bubble parameters (bub_pp struct + scalar companions; bub_pp%R0ref is set in common
352 ! via R0ref; the scalar companions are per-target manual declarations)
355 bub_pp%rho0ref = dflt_real; rho0ref = dflt_real
367 bub_pp%k_v = dflt_real
368 bub_pp%k_g = dflt_real
373
374 ! Formatted database file(s) structure parameters (post-specific)
375 format = dflt_int
376
378
379 alpha_rho_wrt = .false.
380 alpha_rho_e_wrt = .false.
381 rho_wrt = .false.
382 mom_wrt = .false.
383 vel_wrt = .false.
384 chem_wrt_y = .false.
385 chem_wrt_t = .false.
387 flux_wrt = .false.
388 e_wrt = .false.
389 pres_wrt = .false.
390 alpha_wrt = .false.
391 gamma_wrt = .false.
392 heat_ratio_wrt = .false.
393 pi_inf_wrt = .false.
394 pres_inf_wrt = .false.
395 prim_vars_wrt = .false.
396 cons_vars_wrt = .false.
397 c_wrt = .false.
398 t_wrt = .false.
399 omega_wrt = .false.
400 qm_wrt = .false.
401 liutex_wrt = .false.
402 schlieren_wrt = .false.
403 sim_data = .false.
404 cf_wrt = .false.
405 ib_state_wrt = .false.
406 lag_txt_wrt = .false.
407 lag_header = .true.
408 lag_db_wrt = .false.
409 lag_id_wrt = .true.
410 lag_pos_wrt = .true.
411 lag_pos_prev_wrt = .false.
412 lag_vel_wrt = .true.
413 lag_rad_wrt = .true.
414 lag_rvel_wrt = .false.
415 lag_r0_wrt = .false.
416 lag_rmax_wrt = .false.
417 lag_rmin_wrt = .false.
418 lag_dphidt_wrt = .false.
419 lag_pres_wrt = .false.
420 lag_mv_wrt = .false.
421 lag_mg_wrt = .false.
422 lag_betat_wrt = .false.
423 lag_betac_wrt = .false.
424 lag_voidfrac_wrt = .false.
425
427
429
430 ! Bubble modeling (post-specific)
431 nb = dflt_int
432
433 ! Output partial domain (post-specific)
434 output_partial_domain = .false.
435 x_output%beg = dflt_real
436 x_output%end = dflt_real
437 y_output%beg = dflt_real
438 y_output%end = dflt_real
439 z_output%beg = dflt_real
440 z_output%end = dflt_real
441
443
444 !> Computation of parameters, allocation procedures, and/or any other tasks needed to properly setup the module
446
447 integer :: i, j, fac
448
449 ! Setting m_root equal to m in the case of a 1D serial simulation
450
451 if (n == 0) m_root = m_glb
452
453 ! Declared for the common conversion kernel but not a post_process input, so it is neither
454 ! defaulted on non-root ranks nor broadcast. Post-process never carries viscous stresses.
455 viscous = .false.
456
457 ! Particle clouds expand into individual IB patches at simulation startup, so num_ibs as read
458 ! from the case file counts only the namelist patches. Match the global count the simulation
459 ! arrives at (s_read_ib_restart_data) so the IB state records can be read back.
460 do i = 1, num_particle_clouds
461 num_ibs = num_ibs + particle_cloud(i)%num_particles
462 end do
463
464 ! Gamma/Pi_inf: force num_fluids=1 (post_process-specific side effect of the gamma-law model)
466
467 ! post_process sets nmom to 6 for qbmm before the shared eqn_idx setup
468 ! (guard matches the original site: inside the 5-equation branch)
469 if (model_eqns == model_eqns_5eq .and. qbmm) nmom = 6
470
471 ! Populate eqn_idx, sys_size, shear_* (shared logic)
472 call s_initialize_eqn_idx(nmom, nb, six_eqn_alf_is_advected=.false.)
473
474 ! post-only: 6eq alf is a dummy (no void fraction in 6eq)
475 if (model_eqns == model_eqns_6eq) eqn_idx%alf = 1
476
477 ! post-only: set default indices for disabled fields (used by post-processing consumers)
479 if (.not. cont_damage) eqn_idx%damage = dflt_int
480 if (.not. hyper_cleaning) eqn_idx%psi = dflt_int
481 end if
482
483 ! post-only: species defaults when chemistry is off
484 if (.not. chemistry) then
485 eqn_idx%species%beg = 1
486 eqn_idx%species%end = 1
487 end if
488
489 ! Per-target (post_process): beta_idx for Lagrangian bubbles/particles (5eq only, after main eqn_idx setup)
491 if (model_eqns == model_eqns_5eq .and. euler_lagrange) then
492 beta_idx = sys_size + 1
494 end if
495
496 ! Per-target (post_process): qbmm_idx allocations and fills
497 if (model_eqns == model_eqns_5eq .and. bubbles_euler) then
498 allocate (qbmm_idx%rs(nb), qbmm_idx%vs(nb))
499 allocate (qbmm_idx%ps(nb), qbmm_idx%ms(nb))
500
501 if (qbmm) then
502 allocate (qbmm_idx%moms(nb, nmom))
503 do i = 1, nb
504 do j = 1, nmom
505 qbmm_idx%moms(i, j) = eqn_idx%bub%beg + (j - 1) + (i - 1)*nmom
506 end do
507 qbmm_idx%rs(i) = qbmm_idx%moms(i, 2)
508 qbmm_idx%vs(i) = qbmm_idx%moms(i, 3)
509 end do
510 else
511 do i = 1, nb
512 if (polytropic .neqv. .true.) then
513 fac = 4
514 else
515 fac = 2
516 end if
517
518 qbmm_idx%rs(i) = eqn_idx%bub%beg + (i - 1)*fac
519 qbmm_idx%vs(i) = qbmm_idx%rs(i) + 1
520
521 if (polytropic .neqv. .true.) then
522 qbmm_idx%ps(i) = qbmm_idx%vs(i) + 1
523 qbmm_idx%ms(i) = qbmm_idx%ps(i) + 1
524 end if
525 end do
526 end if
527 end if
528
529 if (output_partial_domain) then
530 x_output_idx%beg = 0
531 x_output_idx%end = 0
532 y_output_idx%beg = 0
533 y_output_idx%end = 0
534 z_output_idx%beg = 0
535 z_output_idx%end = 0
536 end if
537
538#ifdef MFC_MPI
539 if (qbmm .and. .not. polytropic) then
540 allocate (mpi_io_data%view(1:sys_size + 2*nb*nnode))
541 allocate (mpi_io_data%var(1:sys_size + 2*nb*nnode))
542 else
543 allocate (mpi_io_data%view(1:sys_size))
544 allocate (mpi_io_data%var(1:sys_size))
545 end if
546#endif
547
548 ! Size of the ghost zone layer is non-zero only when post-processing the raw simulation data of a parallel multidimensional
549 ! computation in the Silo-HDF5 format. If this is the case, one must also verify whether the raw simulation data is 2D or
550 ! 3D. In the 2D case, size of the z-coordinate direction ghost zone layer must be zeroed out.
551 if (num_procs == 1 .or. format /= format_silo) then
552 offset_x%beg = 0
553 offset_x%end = 0
554 offset_y%beg = 0
555 offset_y%end = 0
556 offset_z%beg = 0
557 offset_z%end = 0
558 else if (n == 0) then
559 offset_y%beg = 0
560 offset_y%end = 0
561 offset_z%beg = 0
562 offset_z%end = 0
563 else if (p == 0) then
564 offset_z%beg = 0
565 offset_z%end = 0
566 end if
567
568 ! Determining the finite-difference number and the buffer size. Note that the size of the buffer is unrelated to the order
569 ! of the WENO scheme. Rather, it is directly dependent on maximum size of ghost zone layers and possibly the order of the
570 ! finite difference scheme used for the computation of vorticity and/or numerical Schlieren function.
571 buff_size = max(offset_x%beg, offset_x%end, offset_y%beg, offset_y%end, offset_z%beg, offset_z%end)
572
573 if (any(omega_wrt) .or. schlieren_wrt .or. qm_wrt .or. liutex_wrt) then
574 fd_number = max(1, fd_order/2)
576 end if
577
578 ! Configuring Coordinate Direction Indexes
579 idwint(1)%beg = 0; idwint(2)%beg = 0; idwint(3)%beg = 0
580 idwint(1)%end = m; idwint(2)%end = n; idwint(3)%end = p
581
582 idwbuff(1)%beg = -buff_size
583 if (num_dims > 1) then; idwbuff(2)%beg = -buff_size; else; idwbuff(2)%beg = 0; end if
584 if (num_dims > 2) then; idwbuff(3)%beg = -buff_size; else; idwbuff(3)%beg = 0; end if
585
586 idwbuff(1)%end = idwint(1)%end - idwbuff(1)%beg
587 idwbuff(2)%end = idwint(2)%end - idwbuff(2)%beg
588 idwbuff(3)%end = idwint(3)%end - idwbuff(3)%beg
589
590 ! Allocating single precision grid variables if needed
591 allocate (x_cc_s(-buff_size:m + buff_size))
592
593 ! Allocating the grid variables in the x-coordinate direction
594 allocate (x_cb(-1 - offset_x%beg:m + offset_x%end))
595 allocate (x_cc(-buff_size:m + buff_size))
596 allocate (dx(-buff_size:m + buff_size))
597
598 if (precision == precision_single) then
599 allocate (x_cb_s(-1 - offset_x%beg:m + offset_x%end))
600 end if
601
602 ! Allocating grid variables in the y- and z-coordinate directions
603 if (n > 0) then
604 allocate (y_cb(-1 - offset_y%beg:n + offset_y%end))
605 allocate (y_cc(-buff_size:n + buff_size))
606 allocate (dy(-buff_size:n + buff_size))
607
608 if (precision == precision_single) then
609 allocate (y_cb_s(-1 - offset_y%beg:n + offset_y%end))
610 end if
611
612 if (p > 0) then
613 allocate (z_cb(-1 - offset_z%beg:p + offset_z%end))
614 allocate (z_cc(-buff_size:p + buff_size))
615 allocate (dz(-buff_size:p + buff_size))
616
617 if (precision == precision_single) then
618 allocate (z_cb_s(-1 - offset_z%beg:p + offset_z%end))
619 end if
620 end if
621
622 ! Allocating the grid variables, only used for the 1D simulations, and containing the defragmented computational domain
623 ! grid data
624 else
625 allocate (x_root_cb(-1:m_root))
626 allocate (x_root_cc(0:m_root))
627
628 if (precision == precision_single) then
629 allocate (x_root_cc_s(0:m_root))
630 end if
631 end if
632
633 allocate (adv(num_fluids))
634
635 if (cyl_coord .neqv. .true.) then ! Cartesian grid
636 grid_geometry = 1
637 else if (cyl_coord .and. p == 0) then ! Axisymmetric cylindrical grid
638 grid_geometry = 2
639 else ! Fully 3D cylindrical grid
640 grid_geometry = 3
641 end if
642
644
645 !> Subroutine to initialize parallel infrastructure
650 end subroutine s_initialize_parallel_io
651
652 !> Deallocation procedures for the module
654
655 if (bubbles_euler) then
656 deallocate (qbmm_idx%rs, qbmm_idx%vs, qbmm_idx%ps, qbmm_idx%ms)
657 if (qbmm) deallocate (qbmm_idx%moms)
658 end if
659
660 ! Deallocating the grid variables for the x-coordinate direction
661 deallocate (x_cc, x_cb, dx)
662 if (allocated(x_cb_s)) deallocate (x_cb_s)
663
664 ! Deallocating grid variables for the y- and z-coordinate directions
665 if (n > 0) then
666 deallocate (y_cc, y_cb, dy)
667 if (allocated(y_cb_s)) deallocate (y_cb_s)
668 if (p > 0) then
669 deallocate (z_cc, z_cb, dz)
670 if (allocated(z_cb_s)) deallocate (z_cb_s)
671 end if
672 else
673 ! Deallocating the grid variables, only used for the 1D simulations, and containing the defragmented computational
674 ! domain grid data
675 deallocate (x_root_cb, x_root_cc)
676 end if
677
678 ! Shared: deallocate proc_coords and start_idx
680
681 deallocate (adv)
682
683#ifdef MFC_MPI
684 deallocate (mpi_io_data%var, mpi_io_data%view)
685
686 if (ib) mpi_io_ib_data%var%sf => null()
687#endif
688
689 if (allocated(neighbor_ranks)) deallocate (neighbor_ranks)
690
692
693end 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
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 euler_lagrange
Lagrangian bubbles or particles are on. Derived, never read from the namelist.
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(sp), dimension(:), allocatable z_cb_s
real(sp), dimension(:), allocatable x_cb_s
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
integer sys_size_io
Variables per restart/BC record: sys_size less the post-only beta slot.
real(wp), dimension(:), allocatable z_cc
real(sp), dimension(:), allocatable y_cb_s
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.