MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_derived_types.fpp.f90
Go to the documentation of this file.
1# 1 "/home/runner/work/MFC/MFC/src/common/m_derived_types.fpp"
2!>
3!! @file
4!! @brief Contains module m_derived_types
5
6# 1 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 1
7# 1 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 1
8# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
9# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
10# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
11# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
12# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
13# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
14
15# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
16# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
17# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
18
19# 12 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
20# 1 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp" 1
21! Default for Fypp runs outside the toolchain (e.g. documentation). Searched last, so the
22! build/include/<target>/thermochem.fpp the toolchain writes from m_thermochem takes precedence.
23# 4 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
24# 5 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
25# 13 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 2
26
27# 16 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
28# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
29
30# 24 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
31
32# 53 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
33
34# 65 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
35
36# 75 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
37
38# 105 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
39
40# 117 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
41
42# 127 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
43
44# 174 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
45! New line at end of file is required for FYPP
46# 2 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
47# 1 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 1
48# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
49# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
50# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
51# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
52# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
53# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
54
55# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
56# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
57# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
58
59# 12 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
60# 1 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp" 1
61! Default for Fypp runs outside the toolchain (e.g. documentation). Searched last, so the
62! build/include/<target>/thermochem.fpp the toolchain writes from m_thermochem takes precedence.
63# 4 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
64# 5 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
65# 13 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 2
66
67# 16 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
68# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
69
70# 24 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
71
72# 53 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
73
74# 65 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
75
76# 75 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
77
78# 105 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
79
80# 117 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
81
82# 127 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
83
84# 174 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
85! New line at end of file is required for FYPP
86# 2 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 2
87
88# 4 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
89# 5 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
90# 6 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
91# 7 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
92# 8 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
93
94# 20 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
95
96# 43 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
97
98# 48 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
99
100# 53 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
101
102# 58 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
103
104# 63 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
105
106# 68 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
107
108# 81 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
109
110# 95 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
111
112# 100 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
113
114# 105 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
115
116# 110 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
117
118# 115 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
119
120# 120 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
121
122# 125 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
123
124# 130 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
125
126# 135 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
127
128# 165 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
129
130# 219 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
131
132# 233 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
133
134# 258 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
135
136# 269 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
137
138# 271 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
139# 282 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
140
141# 332 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
142
143# 342 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
144
145# 352 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
146
147# 361 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
148
149# 378 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
150
151# 388 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
152
153# 395 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
154
155# 401 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
156
157# 407 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
158
159# 413 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
160
161# 419 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
162
163# 425 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
164! New line at end of file is required for FYPP
165# 3 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
166# 1 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 1
167# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
168# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
169# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
170# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
171# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
172# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
173
174# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
175# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
176# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
177
178# 12 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
179# 1 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp" 1
180! Default for Fypp runs outside the toolchain (e.g. documentation). Searched last, so the
181! build/include/<target>/thermochem.fpp the toolchain writes from m_thermochem takes precedence.
182# 4 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
183# 5 "/home/runner/work/MFC/MFC/src/common/include/defaults/thermochem.fpp"
184# 13 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 2
185
186# 16 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
187# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
188
189# 24 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
190
191# 53 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
192
193# 65 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
194
195# 75 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
196
197# 105 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
198
199# 117 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
200
201# 127 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
202
203# 174 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
204! New line at end of file is required for FYPP
205# 2 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 2
206
207# 7 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
208
209# 17 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
210
211# 22 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
212
213# 27 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
214
215# 32 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
216
217# 37 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
218
219# 42 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
220
221# 47 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
222
223# 52 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
224
225# 57 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
226
227# 62 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
228
229# 73 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
230
231# 78 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
232
233# 83 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
234
235# 88 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
236
237# 103 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
238
239# 131 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
240
241# 160 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
242
243# 175 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
244
245# 193 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
246
247# 215 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
248
249# 244 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
250
251# 259 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
252
253# 269 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
254
255# 278 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
256
257# 294 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
258
259# 304 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
260
261# 311 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
262! New line at end of file is required for FYPP
263# 4 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
264
265! GPU parallel region (scalar reductions, maxval/minval)
266# 23 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
267
268! GPU parallel loop over threads (most common GPU macro)
269# 43 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
270
271! Required closing for GPU_PARALLEL_LOOP
272# 55 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
273
274! Mark routine for device compilation
275# 112 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
276
277! Declare device-resident data
278# 130 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
279
280! Inner loop within a GPU parallel region
281# 145 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
282
283! Scoped GPU data region
284# 164 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
285
286! Host code with device pointers (for MPI with GPU buffers)
287# 193 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
288
289! Allocate device memory (unscoped)
290# 207 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
291
292! Free device memory
293# 219 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
294
295! Atomic operation on device
296# 231 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
297
298! End atomic capture block
299# 242 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
300
301! Copy data between host and device
302# 254 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
303
304! Synchronization barrier
305# 266 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
306
307! Import GPU library module (openacc or omp_lib)
308# 275 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
309
310! Emit code only for AMD compiler
311# 282 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
312
313! Emit code for non-Cray compilers
314# 289 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
315
316! Emit code only for Cray compiler
317# 296 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
318
319! Emit code for non-NVIDIA compilers
320# 303 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
321
322# 305 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
323# 306 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
324! New line at end of file is required for FYPP
325# 2 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 2
326
327# 14 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
328
329! Caution: This macro requires the use of a binding script to set CUDA_VISIBLE_DEVICES, such that we have one GPU device per MPI
330! rank. That's because for both cudaMemAdvise (preferred location) and cudaMemPrefetchAsync we use location = device_id = 0. For an
331! example see misc/nvidia_uvm/bind.sh.
332# 52 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
333
334! Allocate and create GPU device memory
335# 72 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
336
337! Free GPU device memory and deallocate
338# 80 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
339
340! Cray-specific GPU pointer setup for vector fields
341# 104 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
342
343! Cray-specific GPU pointer setup for scalar fields
344# 120 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
345
346! Cray-specific GPU pointer setup for acoustic source spatials
347# 145 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
348
349# 151 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
350
351# 158 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
352! New line at end of file is required for FYPP
353# 6 "/home/runner/work/MFC/MFC/src/common/m_derived_types.fpp" 2
354
355!> @brief Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures
357
358 use m_constants
360 use m_thermochem, only: num_species
361
362 implicit none
363
364 !> Derived type adding the field position (fp) as an attribute
366 real(stp), allocatable, dimension(:,:,:) :: fp !< Field position
367 end type field_position
368
369 !> Derived type annexing a scalar field (SF)
371 real(stp), pointer, dimension(:,:,:) :: sf => null()
372 end type scalar_field
373
374 !> Derived type for bubble variables pb and mv at quadrature nodes (qbmm)
376 real(stp), pointer, dimension(:,:,:,:,:) :: sf => null()
377 end type pres_field
378
379 !> Derived type annexing an integer scalar field (SF)
381#ifdef MFC_MIXED_PRECISION
382 integer(kind=1), pointer, dimension(:,:,:) :: sf => null()
383#else
384 integer, pointer, dimension(:,:,:) :: sf => null()
385#endif
386 end type integer_field
387
388 !> Derived type for levelset
390 real(stp), pointer, dimension(:,:,:,:) :: sf => null()
391 end type levelset_field
392
393 !> Derived type for levelset norm
395 real(stp), pointer, dimension(:,:,:,:,:) :: sf => null()
396 end type levelset_norm_field
397
399 integer, allocatable, dimension(:) :: view
400 type(scalar_field), allocatable, dimension(:) :: var
401 end type mpi_io_var
402
404 integer :: view
405 type(integer_field) :: var
406 end type mpi_io_ib_var
407
409 integer :: view
410 type(levelset_field) :: var
411 end type mpi_io_levelset_var
412
417
418 !> Derived type annexing a vector field (VF)
420 type(scalar_field), allocatable, dimension(:) :: vf !< Vector field
421 end type vector_field
422
423 !> Generic 3-component vector (e.g., spatial coordinates or field components) Named _dt (derived types: x,y,z) to differentiate
424 !! from t_vec3 (3-component vector)
425 type vec3_dt ! dt for derived types
426 real(wp) :: x
427 real(wp) :: y
428 real(wp) :: z
429 end type vec3_dt
430
431 !> Left and right Riemann states
433 real(wp) :: l
434 real(wp) :: r
435 end type riemann_states
436
437 !> Left and right Riemann states for 3-component vectors
439 real(wp) :: l(3)
440 real(wp) :: r(3)
441 end type riemann_states_vec3
442
443 !> Lightweight beg/end pair for equation index ranges (no BC payload).
445 integer :: beg
446 integer :: end
447 end type idx_bounds_info
448
449 !> Integer bounds for variables
451 integer :: beg
452 integer :: end
453 real(wp) :: vb1
454 real(wp) :: vb2
455 real(wp) :: vb3
456 real(wp) :: ve1
457 real(wp) :: ve2
458 real(wp) :: ve3
459 real(wp) :: pres_in, pres_out
460 real(wp), dimension(3) :: vel_in, vel_out
461 real(wp), dimension(num_fluids_max) :: alpha_rho_in, alpha_in
462 logical :: grcbc_in, grcbc_out, grcbc_vel_out
463 !> Smooth start-up of a GRCBC inflow: the inflow velocity is scaled by f(t) = vel_in_frac0 + (1 - vel_in_frac0) (1 + tanh(6
464 !! (t - t0)/tau - 3))/2, so it leaves vel_in_frac0 of its final value at t0 and reaches it after vel_in_ramp. Inactive when
465 !! the ramp duration is zero.
466 real(wp) :: vel_in_ramp, vel_in_t0, vel_in_frac0
467 logical :: isothermal_in, isothermal_out
468 real(wp) :: twall_in, twall_out
469 end type int_bounds_info
470
471 !> Groups the x, y, z boundary condition begin/end codes for passing as a single argument.
473 type(int_bounds_info) :: x, y, z
474 end type bc_xyz_info
475
476 !> QBMM moment index mappings - separate from bub beg/end so eqn_idx contains no allocatables.
478 integer, dimension(:), allocatable :: rs !< R moment indices per bubble bin
479 integer, dimension(:), allocatable :: vs !< V moment indices per bubble bin
480 integer, dimension(:), allocatable :: ps !< Pressure moment indices per bubble bin
481 integer, dimension(:), allocatable :: ms !< Mass moment indices per bubble bin
482 integer, dimension(:,:), allocatable :: moms !< Moment indices for qbmm
483 integer, dimension(:,:,:), allocatable :: fullmom !< Full moment indices for qbmm
484 end type qbmm_idx_info
485
486 !> All conserved-variable equation indices, computed at startup from model_eqns and enabled features.
487 !> Range indices (beg/end) use int_bounds_info; scalar indices are plain integers (0 = inactive).
488 !> Contains no allocatable members - safe for GPU_DECLARE as a single struct.
490 type(idx_bounds_info) :: cont !< Partial densities (continuity equations)
491 type(idx_bounds_info) :: mom !< Momentum components
492 type(idx_bounds_info) :: adv !< Volume fractions (advection equations)
493 type(idx_bounds_info) :: bub !< Bubble equation range (beg/end only)
494 type(idx_bounds_info) :: stress !< Stress tensor components
495 type(idx_bounds_info) :: b !< Magnetic field components
496 type(idx_bounds_info) :: int_en !< Internal energy equations
497 type(idx_bounds_info) :: species !< Chemistry species equations
498 integer :: e !< Energy/pressure equation
499 integer :: n !< Number density equation
500 integer :: alf !< Void fraction (scalar, model_eqns=4)
501 integer :: gamma !< Specific heat ratio function (model_eqns=1)
502 integer :: pi_inf !< Liquid stiffness function (model_eqns=1)
503 integer :: c !< Color function equation
504 integer :: damage !< Damage variable equation
505 integer :: psi !< Psi variable equation
506 end type eqn_idx_info
507
508 !> Initial-condition state assembled by pre_process: working primitive and
509 !> conservative fields, temperature, boundary-condition types, and the
510 !> patch-identity bookkeeping array.
512 type(scalar_field), allocatable, dimension(:) :: q_prim_vf !< Primitive variables
513 type(scalar_field), allocatable, dimension(:) :: q_cons_vf !< Conservative variables
514 type(scalar_field) :: q_t_sf !< Temperature field
515 type(integer_field), allocatable, dimension(:,:) :: bc_type !< Boundary-condition type fields
516#ifdef MFC_MIXED_PRECISION
517 integer(kind=1), allocatable, dimension(:,:,:) :: patch_id_fp !< Patch identities bookkeeping
518#else
519 integer, allocatable, dimension(:,:,:) :: patch_id_fp !< Patch identities bookkeeping
520#endif
521 end type ic_context
522
523 !> Finite-difference state for post_process: density gradient magnitude for
524 !> numerical Schlieren and centered FD coefficients in x-, y-, and z-directions.
526 real(wp), allocatable, dimension(:,:,:) :: gm_rho_sf !< Density gradient magnitude for numerical Schlieren
527 real(wp), allocatable, dimension(:,:) :: fd_coeff_x !< FD coefficients in the x-direction
528 real(wp), allocatable, dimension(:,:) :: fd_coeff_y !< FD coefficients in the y-direction
529 real(wp), allocatable, dimension(:,:) :: fd_coeff_z !< FD coefficients in the z-direction
530 end type fd_context
531
532 !> Output workspace for post_process: flow variable buffers, VisIt extents/offsets,
533 !> directory paths, Silo/Binary file handles, and variable count.
535 ! Flow variable storage; q_root_sf gathers to rank 0 in 1D parallel runs
536 real(wp), allocatable, dimension(:,:,:) :: q_sf !< Working flow variable field (public)
537 real(wp), allocatable, dimension(:,:,:) :: q_root_sf !< Gathered 1D flow variable field (rank 0 only)
538 real(wp), allocatable, dimension(:,:,:) :: cyl_q_sf !< Cylindrical-geometry reordered field
539 ! Single precision storage for flow variables
540 real(sp), allocatable, dimension(:,:,:) :: q_sf_s !< Single-precision working field (public)
541 real(sp), allocatable, dimension(:,:,:) :: q_root_sf_s !< Single-precision gathered 1D field
542 real(sp), allocatable, dimension(:,:,:) :: cyl_q_sf_s !< Single-precision cylindrical reordered field
543 ! Spatial and data extents for VisIt visualization (Silo only)
544 real(wp), allocatable, dimension(:,:) :: spatial_extents !< Spatial extents per process
545 real(wp), allocatable, dimension(:,:) :: data_extents !< Data extents per process
546 ! Ghost zone layer sizes (lo/hi) for subdomain connectivity in VisIt (Silo only)
547 integer, allocatable, dimension(:) :: lo_offset !< Ghost zone lo sizes per active direction
548 integer, allocatable, dimension(:) :: hi_offset !< Ghost zone hi sizes per active direction
549 ! Cell-boundary count per active coordinate direction (Silo only)
550 integer, allocatable, dimension(:) :: dims !< Cell-boundary counts per active direction
551 ! Formatted database directory paths
552 character(LEN=path_len + name_len) :: dbdir !< Base database directory
553 character(LEN=path_len + 2*name_len) :: proc_rank_dir !< Per-rank subdirectory
554 character(LEN=path_len + 2*name_len) :: rootdir !< Root subdirectory
555 ! Formatted database file handles
556 integer :: dbroot !< Master/root file handle
557 integer :: dbfile !< Slave/local file handle
558 integer :: optlist !< Silo options list handle (per-call scratch)
559 ! Variable count for Binary format
560 integer :: dbvars !< Total flow variables to write
561 end type output_context
562
564 integer :: geometry
565 integer :: type
566 integer :: dir
567 integer :: loc
568 real(wp), dimension(3) :: centroid
569 real(wp), dimension(3) :: length
570 real(wp) :: radius
571 end type bc_patch_parameters
572
573 !> Derived type adding beginning (beg) and end bounds info as attributes
575 real(wp) :: beg
576 real(wp) :: end
577 end type bounds_info
578
579 !> Defines parameters for a Model Patch
581 character(LEN=pathlen_max) :: filepath !< Path the STL file relative to case_dir.
582 real(wp), dimension(1:3) :: translate !< Translation of the STL object.
583 real(wp), dimension(1:3) :: scale !< Scale factor for the STL object.
584 real(wp), dimension(1:3) :: rotate !< Angle to rotate the STL object along each cartesian coordinate axis, in radians.
585 integer :: spc !< Number of samples per cell to use when discretizing the STL object.
586 real(wp) :: threshold !< Threshold to turn on smoothen STL patch.
587 end type ic_model_parameters
588
590 real(wp), dimension(1:3,1:3) :: v !< Vertices of the triangle
591 real(wp), dimension(1:3) :: n !< Normal vector
592 end type t_triangle
593
594 type :: t_bbox
595 real(wp), dimension(1:3) :: min !< Minimum coordinates
596 real(wp), dimension(1:3) :: max !< Maximum coordinates
597 end type t_bbox
598
599 type :: t_model
600 integer :: ntrs !< Number of triangles
601 type(t_triangle), allocatable :: trs(:) !< Triangles
602 end type t_model
603
605 ! Original CPU-side fields (unchanged)
606 type(t_model), allocatable :: model !< STL/OBJ geometry model
607 real(wp), allocatable, dimension(:,:,:) :: boundary_v !< Boundary vertices
608 integer :: boundary_edge_count !< Number of boundary edges
609
610 ! GPU-friendly flattened arrays
611 integer :: ntrs !< Copy of model%ntrs
612 real(wp), allocatable, dimension(:,:,:) :: trs_v !< Triangle vertices (3, 3, ntrs)
613 real(wp), allocatable, dimension(:,:) :: trs_n !< Triangle normals (3, ntrs)
614 end type t_model_array
615
616 !> Derived type adding initial condition (ic) patch parameters as attributes NOTE: The requirements for the specification of the
617 !! above parameters are strongly dependent on both the choice of the multicomponent flow model as well as the choice of the
618 !! patch geometry.
620
621 integer :: geometry !< Type of geometry for the patch
622 real(wp) :: x_centroid, y_centroid, z_centroid !< Geometric center coordinates of the patch
623 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
624 real(wp) :: radius !< Dimensions of the patch. radius.
625 real(wp), dimension(3) :: radii !< Elliptical/ellipsoidal patch radii in x, y, z
626 real(wp) :: epsilon, beta !< The isentropic vortex parameters for the amplitude of the disturbance and domain of influence.
627 real(wp), dimension(2:9) :: a !< Used by hardcoded IC and as temporary variables.
628 logical :: non_axis_sym
629
630 ! Geometry 13 (2D modal Fourier): fourier_cos(n), fourier_sin(n) for mode n
631 real(wp), dimension(1:max_2d_fourier_modes) :: fourier_cos, fourier_sin
632 !> When true, clip boundary radius: R(theta) = max(R(theta), modal_r_min) (Non-exp form only)
633 logical :: modal_clip_r_to_min
634 real(wp) :: modal_r_min !< Minimum boundary radius when modal_clip_r_to_min is true (Non-exp form only)
635 logical :: modal_use_exp_form !< When true, boundary = radius*exp(Fourier series)
636 ! Geometry 14 (3D spherical harmonic): sph_har_coeff(l,m) for real Y_lm
637 real(wp), dimension(0:max_sph_harm_degree,-max_sph_harm_degree:max_sph_harm_degree) :: sph_har_coeff
638 real(wp), dimension(3) :: normal !< Patch orientation normal vector (x, y, z)
639 logical, dimension(0:num_patches_max - 1) :: alter_patch !< Overwrite permissions for preceding patches
640 logical :: smoothen !< Whether patch boundaries are smoothed across cells
641 integer :: smooth_patch_id !< Identity (id) of the patch with which current patch is to get smoothed
642 real(wp) :: smooth_coeff !< Smoothing stencil size coefficient
643 real(wp), dimension(num_fluids_max) :: alpha_rho
644 real(wp) :: rho
645 real(wp), dimension(3) :: vel
646 real(wp) :: pres
647 real(wp), dimension(num_fluids_max) :: alpha
648 real(wp) :: gamma
649 real(wp) :: pi_inf
650 real(wp) :: cv
651 real(wp) :: qv
652 real(wp) :: qvp !< Reference entropy per unit mass (SGEOS)
653 real(wp) :: bx, by, bz !< Magnetic field components; B%x is not used for 1D
654 real(wp), dimension(6) :: tau_e !< Elastic stresses added to primitive variables if hypoelasticity = True
655 real(wp) :: r0 !< Bubble size
656 real(wp) :: v0 !< Bubble velocity
657 real(wp) :: p0 !< Bubble size
658 real(wp) :: m0 !< Bubble velocity
659 integer :: hcid !< Hardcoded initial condition ID
660 real(wp) :: cf_val !< Color function value
661 real(wp) :: y(1:num_species) !< Species mass fractions
662
663 ! STL/OBJ model patch: index into the shared stl_models(:) table
664 integer :: model_id !< index into stl_models(:) for STL/OBJ geometry patches
665 end type ic_patch_parameters
666
667 !> User-input parameters for a NACA 4-digit airfoil (namelist-safe: scalars only)
669 real(wp) :: c = dflt_real !< chord length
670 real(wp) :: p = dflt_real !< maximum camber position (fraction of chord)
671 real(wp) :: t = dflt_real !< maximum thickness (fraction of chord)
672 real(wp) :: m = dflt_real !< maximum camber (fraction of chord)
673 end type ib_airfoil_parameters
674
675 !> Computed surface grid for a NACA airfoil (simulation-only, not in namelist)
677 integer :: np = 0 !< number of surface grid points per surface
678 real(wp), allocatable :: upper(:,:,:) !< upper segments (1:Np-1, vertex 1/vertex 2/normal, x/y), as STL boundary_v
679 real(wp), allocatable :: lower(:,:,:) !< lower segments (1:Np-1, vertex 1/vertex 2/normal, x/y), as STL boundary_v
680 end type ib_airfoil_grid
681
682 !> User-input parameters for an STL/OBJ immersed boundary model (namelist-safe: scalars + fixed arrays)
684 character(LEN=pathlen_max) :: model_filepath !< Path to the STL file relative to case_dir.
685 real(wp), dimension(1:3) :: model_translate !< Translation of the STL object.
686 real(wp), dimension(1:3) :: model_scale !< Scale factor for the STL object.
687 real(wp) :: model_threshold !< Threshold to turn on smooth STL patch.
688 end type ib_stl_parameters
689
691 integer :: geometry !< Type of geometry for the patch
692 integer :: gbl_patch_id
693 integer :: owner_rank !< MPI rank whose subdomain holds the centroid; the only rank that sums this IB's force
694 real(wp) :: x_centroid, y_centroid, z_centroid !< Geometric center coordinates of the patch
695
696 !> Centroid locations of intermediate steps in the time_stepper module
697 real(wp) :: step_x_centroid, step_y_centroid, step_z_centroid
698 real(wp), dimension(1:3) :: centroid_offset !< offset of center of mass from computed cell center for odd-shaped IBs
699 real(wp), dimension(1:3) :: angles
700 real(wp), dimension(1:3) :: step_angles
701 !> matrix that converts from IB reference frame to fluid reference frame
702 real(wp), dimension(1:3,1:3) :: rotation_matrix
703 !> matrix that converts from fluid reference frame to IB reference frame
704 real(wp), dimension(1:3,1:3) :: rotation_matrix_inverse
705 integer :: airfoil_id !< index into ib_airfoil(:) for airfoil geometry patches
706 integer :: model_id !< index into stl_models(:) for STL/OBJ geometry patches
707 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
708 real(wp) :: radius !< Dimensions of the patch. radius.
709 logical :: slip
710
711 ! Thermal immersed-boundary condition
712 ! 0 = zero-normal-gradient temperature
713 ! 1 = prescribed wall temperature (Twall)
714 ! 2 = reacting surface energy balance
715 integer :: thermal_bc
716 real(wp) :: twall
717
718 ! Heterogeneous surface reaction 0 = none 1 = enabled
719 integer :: surface_reaction
720 integer :: moving_ibm !< 0 for no moving, 1 for moving, 2 for moving on forced path
721 real(wp) :: v_blow !< Wall-normal surface blowing speed (burning/transpiring IB surface); 0 = impermeable
722 integer :: inj_species !< Injected species index at a blowing surface (chemistry); 0 = mirror ambient
723 real(wp) :: burn_rate_exp !< Pressure exponent n in v_blow*(p/p_ref)^n (Vieille's law); 0 = constant blowing
724 real(wp) :: burn_rate_pref !< Reference pressure p_ref for the pressure-coupled burn rate; 0 = coupling off
725 real(wp) :: mass, moment !< mass and moment of inertia of object used to compute forces in 2-way coupling
726 real(wp), dimension(1:3) :: force, torque !< vectors for the computed force and torque values applied to an IB
727 real(wp), dimension(1:3) :: vel
728 real(wp), dimension(1:3) :: step_vel !< velocity array used to store intermediate steps in the time_stepper module
729 real(wp), dimension(1:3) :: angular_vel
730 real(wp), dimension(1:3) :: step_angular_vel !< velocity array used to store intermediate steps in the time_stepper module
731 !> Prescribed kinematics (moving_ibm = 1 only): 0 = off; 1 = hinged flapping, roll about the lab x axis through the hinge
732 !! and pitch about the body spanwise (y) axis through the hinge, R = Rx(phi) Ry(theta)
733 integer :: kin_model
734 real(wp), dimension(1:3) :: kin_hinge !< hinge point
735 real(wp), dimension(1:3) :: kin_offset !< body-frame vector from the hinge to the patch centroid
736 real(wp) :: kin_phi0, kin_theta0, kin_theta_mean !< roll amplitude, pitch amplitude, mean pitch (rad)
737 real(wp) :: kin_freq, kin_phase, kin_t0, kin_ramp !< frequency, pitch phase lead (rad), onset time, ramp duration
738 real(wp) :: kin_pitch_rate, kin_smooth !< kin_model = 2: nominal pitch rate (rad/time) and Eldredge smoothing parameter a
739 end type ib_patch_parameters
740
742 real(wp) :: x_centroid, y_centroid, z_centroid !< Center of the particle bed region
743 real(wp) :: length_x, length_y, length_z !< Dimensions of the particle bed region
744 integer :: num_particles !< Number of particles to generate
745 real(wp) :: radius !< Particle radius
746 real(wp) :: mass !< Particle mass
747 real(wp) :: min_spacing !< Minimum surface-to-surface gap (particle centers are 2*radius + min_spacing apart)
748 real(wp) :: shell_inner_radius !< Inner radius for shell packing
749 real(wp) :: shell_outer_radius !< Outer radius for shell packing
750 integer :: moving_ibm !< Motion flag: 0=static, 1=moving (forces), 2=forced path
751 integer :: seed !< Random seed for reproducible placement
752 integer :: cloud_geometry !< Cloud region geometry: 1=box, 2=hemisphere shell
753 integer :: shell_axis !< Axis the hemisphere shell opens toward: 1=x, 2=y, 3=z (2D ignores 3)
754 integer :: packing_method !< Packing algorithm: 1=rejection sampling, 2=lattice
755 integer :: periodic !< Periodic overlap flag for box rejection packing: 0=off, 1=on
757
758 !> Derived type annexing the physical parameters (PP) of the fluids. These include the specific heat ratio function and liquid
759 !! stiffness function.
761 real(wp) :: gamma !< Sp. heat ratio
762 real(wp) :: pi_inf !< Liquid stiffness
763 real(wp), dimension(2) :: re !< Reynolds number
764 real(wp) :: k_therm !< Thermal conductivity (name avoids %K, the Herschel-Bulkley index)
765 real(wp) :: cv !< heat capacity
766 real(wp) :: qv !< reference energy per unit mass for SGEOS, q (see Le Metayer (2004))
767 real(wp) :: qvp !< reference entropy per unit mass for SGEOS, q' (see Le Metayer (2004))
768 real(wp) :: g
769 integer :: eos !< Equation of state selector (eos_* in m_constants)
770 real(wp) :: mg_rho0 !< Mie-Gruneisen reference density
771 real(wp) :: mg_c0 !< Mie-Gruneisen bulk sound speed at mg_rho0
772 real(wp) :: mg_s !< Mie-Gruneisen linear Hugoniot slope, u_s = c0 + s u_p
773 real(wp) :: mg_gruneisen !< Gruneisen coefficient Gamma_G (not the shear modulus G)
774 real(wp) :: mg_gruneisen_a !< d(Gamma_G)/d(mu): Gamma_G = Gamma_0 + a mu, zero keeps it constant
775 real(wp) :: mg_t0 !< temperature at the reference density (for T output)
776 real(wp) :: mg_s2, mg_s3 !< u_s = c0 + s u_p + s2 u_p^2 + s3 u_p^3; zero keeps the fit linear
777 real(wp) :: jwl_a !< JWL A
778 real(wp) :: jwl_b !< JWL B
779 real(wp) :: jwl_r1 !< JWL R1
780 real(wp) :: jwl_r2 !< JWL R2
781 real(wp) :: jwl_omega !< JWL omega (its Gruneisen coefficient)
782 real(wp) :: jwl_rho0 !< JWL reference density
783 real(wp) :: jwl_t0 !< temperature at the reference density (for T output)
784 real(wp) :: vinet_k0 !< Vinet bulk modulus at rho0
785 real(wp) :: vinet_k0p !< Vinet pressure derivative of the bulk modulus
786 real(wp) :: vinet_rho0 !< Vinet reference density
787 real(wp) :: vinet_gruneisen !< Gruneisen coefficient at rho0
788 real(wp) :: vinet_gruneisen_a !< d(Gamma_G)/d(mu)
789 real(wp) :: vinet_t0 !< temperature at the reference density (for T output)
790 logical :: non_newtonian !< Enable Herschel-Bulkley non-Newtonian viscosity
791 real(wp) :: k !< HB consistency index
792 real(wp) :: nn !< HB flow behavior index
793 real(wp) :: tau0 !< HB yield stress (0 => power-law)
794 real(wp) :: hb_m !< Papanastasiou regularization parameter
795 real(wp) :: mu_min !< Lower viscosity clamp (inactive sentinel = dflt_real)
796 real(wp) :: mu_max !< Upper viscosity clamp (required when non_newtonian)
797 real(wp) :: mu_bulk !< Bulk viscosity for NN (inactive sentinel = dflt_real)
798 end type physical_parameters
799
800 !> Derived type annexing the physical parameters required for sub-grid bubble models
802 real(wp) :: r0ref !< reference bubble radius
803 real(wp) :: p0ref !< reference pressure
804 real(wp) :: rho0ref !< reference density
805 real(wp) :: t0ref !< reference temperature
806 real(wp) :: ss !< surface tension between host and gas (bubble)
807 real(wp) :: pv !< vapor pressure of host
808 real(wp) :: vd !< vapor diffusivity in gas (bubble)
809 real(wp) :: mu_l !< viscosity of host in liquid state
810 real(wp) :: mu_v !< viscosity of host in vapor state
811 real(wp) :: mu_g !< viscosity of gas (bubble)
812 real(wp) :: gam_v !< specific heat ratio of host in vapor state
813 real(wp) :: gam_g !< specific heat ratio of gas (bubble)
814 real(wp) :: m_v !< Molecular weight of host
815 real(wp) :: m_g !< Molecular weight of gas (bubble)
816 real(wp) :: k_v !< thermal conductivity of host in vapor state
817 real(wp) :: k_g !< thermal conductivity of gas (bubble)
818 real(wp) :: cp_v !< specific heat capacity in constant pressure of host in vapor state
819 real(wp) :: cp_g !< specific heat capacity in constant pressure of gas (bubble)
820 real(wp) :: r_v !< gas constant of host in vapor state
821 real(wp) :: r_g !< gas constant of gas (bubble)
823
825 integer, dimension(2) :: view
826 type(vec3_dt), allocatable, dimension(:) :: var
827 end type mpi_io_airfoil_ib_var
828
829 !> Parameters for body force with spatial support
831 real(wp) :: amp
832 real(wp) :: x_centroid
833 real(wp) :: y_centroid
834 real(wp) :: conv_vel
835 real(wp) :: sigma
836 real(wp), dimension(8) :: freq
837 real(wp), dimension(8) :: phase
838 end type spbf_parameters
839
840 !> Acoustic source parameters
842 integer :: pulse !< Type of pulse
843 integer :: support !< Type of support
844 logical :: dipole !< Whether the source is a dipole or monopole
845 real(wp), dimension(3) :: loc !< Physical location of acoustic source
846 real(wp) :: mag !< Acoustic pulse magnitude
847 real(wp) :: length !< Length of planar source (2D/3D)
848 real(wp) :: height !< Height of planar source (3D)
849 real(wp) :: wavelength !< Wave length of pulse
850 real(wp) :: frequency !< Frequency of pulse
851 real(wp) :: gauss_sigma_dist !< sigma of Gaussian pulse multiplied by speed of sound
852 real(wp) :: gauss_sigma_time !< sigma of Gaussian pulse
853 real(wp) :: npulse !< Number of cycles of pulse
854 real(wp) :: dir !< Direction of pulse
855 real(wp) :: delay !< Time-delay of pulse start
856 real(wp) :: foc_length !< Focal length of transducer
857 real(wp) :: aperture !< Aperture diameter of transducer
858 real(wp) :: element_spacing_angle !< Spacing between aperture elements in 2D acoustic array
859 !> Ratio of aperture element diameter to side length of polygon connecting their centers, in 3D acoustic array
860 real(wp) :: element_polygon_ratio
861 real(wp) :: rotate_angle !< Angle of rotation of the entire circular 3D acoustic array
862 real(wp) :: bb_bandwidth !< Bandwidth of each frequency in broadband wave
863 real(wp) :: bb_lowest_freq !< The lower frequency bound of broadband wave
864 integer :: num_elements !< Number of elements in the acoustic array
865 integer :: element_on !< Element in the acoustic array to turn on
866 integer :: bb_num_freq !< Number of frequencies in the broadband wave
867 end type acoustic_parameters
868
869 !> Acoustic source source_spatial pre-calculated values
871 integer, pointer, dimension(:,:) :: coord => null() !< List of grid points indices with non-zero source_spatial values
872 real(wp), pointer, dimension(:) :: val => null() !< List of non-zero source_spatial values
873 real(wp), pointer, dimension(:) :: angle => null() !< List of angles with x-axis for mom source term vector
874 real(wp), pointer, dimension(:,:) :: xyz_to_r_ratios => null() !< List of [xyz]/r for mom source term vector
875 end type source_spatial_type
876
877 !> Ghost Point for Immersed Boundaries
879 integer, dimension(3) :: loc !< Physical location of the ghost point
880 real(wp), dimension(3) :: ip_loc !< Physical location of the image point
881 integer, dimension(3) :: ip_grid !< Top left grid point of IP
882 real(wp), dimension(2, 2, 2) :: interp_coeffs !< Interpolation Coefficients of image point
883 logical :: interp_valid !< .false. if every image point stencil cell lies inside an IB
884 integer :: ib_patch_id !< ID of the IB Patch the ghost point is part of
885 real(wp) :: levelset
886 real(wp), dimension(1:3) :: levelset_norm
887 logical :: slip
888 integer, dimension(3) :: db
889 integer :: x_periodicity, y_periodicity, z_periodicity
890 end type ghost_point
891
892 !> Species parameters
894 character(LEN=name_len) :: name !< Name of species
895 end type species_parameters
896
897 !> Chemistry parameters
899 character(LEN=name_len) :: cantera_file !< Path to Cantera file
900 logical :: diffusion
901 logical :: reactions
902
903 !> Method of determining gamma.
904 !> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97.
905 !> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats.
906 integer :: gamma_method
907 integer :: transport_model
908 !> reaction_substeps > 0 integrates the reaction source with operator splitting: after the
909 !> flow update, each cell's constant-(rho,e) reactor ODE is advanced with this many alpha-QSS
910 !> sub-steps. Stabilizes stiff mechanisms (e.g. methane). 0 = off (reaction source is added to
911 !> the RHS and integrated by the flow time stepper, the default behavior).
912 integer :: reaction_substeps
913 !> adap_substeps = T: adapt the alpha-QSS sub-step count per rank each step from a local
914 !> stiffness estimate, ranging in [reaction_substeps (floor), reaction_substeps_max (ceiling)].
915 !> Zero MPI: each rank sizes its own work from its own cells. Default F = fixed reaction_substeps.
916 logical :: adap_substeps
917 integer :: reaction_substeps_max
918 end type chemistry_parameters
919
920 !> Condensed-phase reactive-burn (programmed pressure detonation) parameters. The rate is
921 !> dlambda/dt = k (1 - lambda) ((p - pign)/pref)^n, optionally scaled by exp(-ta/T) when ta > 0.
923 real(wp) :: k !< Rate coefficient [1/s]
924 real(wp) :: pign !< Ignition pressure threshold [Pa]
925 real(wp) :: pref !< Reference pressure for the pressure drive [Pa]
926 real(wp) :: n !< Pressure-drive exponent
927 real(wp) :: ta !< Activation temperature [K] (0 = pure pressure-driven; > 0 adds exp(-ta/T))
928 integer :: substeps !< Operator-split sub-steps per time step (0 = source added to the flow RHS)
930
931 !> Coefficients of one fluid's equation of state, resolved once at init. Held as a record per fluid rather than as parallel
932 !! arrays: every read wants several of these for a single fluid, so one base address serves them all, where fifteen arrays cost
933 !! fifteen live descriptors in the Riemann kernels.
935 real(wp) :: rho0, t0 !< Reference density [kg/m^3] and temperature [K]
936 real(wp) :: gruneisen0, gruneisen_a !< Gruneisen closure Gamma_G = Gamma_0 + a mu
937 real(wp) :: c0, s, s2, s3 !< Mie-Gruneisen Hugoniot u_s = c0 + s u_p + s2 u_p^2 + s3 u_p^3
938 real(wp) :: mu_max !< Compression at which a cubic Hugoniot fit turns over
939 real(wp) :: a, b, r1, r2 !< JWL principal isentrope p = A exp(-R1 V) + B exp(-R2 V)
940 real(wp) :: k0, k0p !< Vinet bulk modulus and its pressure derivative
941 end type eos_coefficients
942
943 !> Lagrangian bubble parameters
945
946 integer :: solver_approach !< 1: One-way coupling, 2: two-way coupling
947 integer :: cluster_type !< Cluster model to find p_inf
948 logical :: pressure_corrector !< Cell pressure correction term
949 integer :: smooth_type !< Smoothing function. 1: Gaussian, 2:Delta 3x3
950 logical :: heattransfer_model !< Activate HEAT transfer model at the bubble-liquid interface
951 logical :: masstransfer_model !< Activate MASS transfer model at the bubble-liquid interface
952 logical :: write_void_evol !< Write files to track evolution of void fraction at each time step
953 logical :: write_bubbles !< Write files to track the bubble evolution each time step
954 logical :: write_bubbles_stats !< Write the maximum and minimum radius of each bubble
955 integer :: nbubs_glb !< Global number of bubbles
956 integer :: vel_model !< Particle velocity model
957 integer :: drag_model !< Particle drag model
958 logical :: pressure_force !< Include pressure force translational motion
959 logical :: gravity_force !< Include gravity force in translational motion
960 logical :: kahan_summation !< Use Kahan summation for void fraction accumulation (improves precision)
961 character(LEN=pathlen_max) :: input_path !< Path to lag_bubbles.dat
962 real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
963 real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
964 integer :: charnz !< Number of grid cells in characteristic depth
965 real(wp) :: valmaxvoid !< Maximum void fraction permitted
967
968 !> Max and min number of cells in a direction of each combination of x-,y-, and z-
970 integer :: mn_max, np_max, mp_max, mnp_max
971 integer :: mn_min, np_min, mp_min, mnp_min
972 end type cell_num_bounds
973
975 logical, dimension(3) :: perturb_vel
976 real(wp), dimension(3) :: perturb_vel_freq
977 real(wp), dimension(3) :: perturb_vel_scale
978 real(wp), dimension(3, 3) :: perturb_vel_offset
979 logical, dimension(1:num_fluids_max) :: perturb_dens
980 real(wp), dimension(1:num_fluids_max) :: perturb_dens_freq
981 real(wp), dimension(1:num_fluids_max) :: perturb_dens_scale
982 real(wp), dimension(1:num_fluids_max,3) :: perturb_dens_offset
983 end type simplex_noise_params
984end module m_derived_types
type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf
integer, intent(in) k
integer, intent(in) l
Compile-time constant parameters: default values, tolerances, and physical constants.
real(wp), parameter dflt_real
Default real value.
Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures.
Working-precision kind selection (half/single/double) and corresponding MPI datatype parameters.
integer, parameter sp
integer, parameter wp
Change to single_precision if needed.
integer, parameter stp
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-.
Coefficients of one fluid's equation of state, resolved once at init. Held as a record per fluid rath...
All conserved-variable equation indices, computed at startup from model_eqns and enabled features....
Finite-difference state for post_process: density gradient magnitude for numerical Schlieren and cent...
Derived type adding the field position (fp) as an attribute.
Ghost Point for Immersed Boundaries.
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).
User-input parameters for an STL/OBJ immersed boundary model (namelist-safe: scalars + fixed arrays).
Initial-condition state assembled by pre_process: working primitive and conservative fields,...
Defines parameters for a Model Patch.
Derived type adding initial condition (ic) patch parameters as attributes NOTE: The requirements for ...
Lightweight beg/end pair for equation index ranges (no BC payload).
Integer bounds for variables.
Derived type annexing an integer scalar field (SF).
Derived type for levelset norm.
Output workspace for post_process: flow variable buffers, VisIt extents/offsets, directory paths,...
Derived type annexing the physical parameters (PP) of the fluids. These include the specific heat rat...
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.
Condensed-phase reactive-burn (programmed pressure detonation) parameters. The rate is dlambda/dt = k...
Left and right Riemann states for 3-component vectors.
Left and right Riemann states.
Derived type annexing a scalar field (SF).
Acoustic source source_spatial pre-calculated values.
Parameters for body force with spatial support.
Derived type annexing the physical parameters required for sub-grid bubble models.
Generic 3-component vector (e.g., spatial coordinates or field components) Named _dt (derived types: ...
Derived type annexing a vector field (VF).