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