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# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
20
21# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
22
23# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
24
25# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
26
27# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
28
29# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
30
31# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
32! New line at end of file is required for FYPP
33# 2 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
34# 1 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 1
35# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
36# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
37# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
38# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
39# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
40# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
41
42# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
43# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
44# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
45
46# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
47
48# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
49
50# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
51
52# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
53
54# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
55
56# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
57
58# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
59! New line at end of file is required for FYPP
60# 2 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp" 2
61
62# 4 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
63# 5 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
64# 6 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
65# 7 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
66# 8 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
67
68# 20 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
69
70# 43 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
71
72# 48 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
73
74# 53 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
75
76# 58 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
77
78# 63 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
79
80# 68 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
81
82# 76 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
83
84# 81 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
85
86# 86 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
87
88# 91 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
89
90# 96 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
91
92# 101 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
93
94# 106 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
95
96# 111 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
97
98# 116 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
99
100# 121 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
101
102# 151 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
103
104# 192 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
105
106# 206 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
107
108# 231 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
109
110# 242 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
111
112# 244 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
113# 255 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
114
115# 284 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
116
117# 294 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
118
119# 304 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
120
121# 313 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
122
123# 330 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
124
125# 340 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
126
127# 347 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
128
129# 353 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
130
131# 359 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
132
133# 365 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
134
135# 371 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
136
137# 377 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
138! New line at end of file is required for FYPP
139# 3 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
140# 1 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 1
141# 1 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp" 1
142# 2 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
143# 3 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
144# 4 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
145# 5 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
146# 6 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
147
148# 8 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
149# 9 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
150# 10 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
151
152# 17 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
153
154# 46 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
155
156# 58 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
157
158# 68 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
159
160# 98 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
161
162# 110 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
163
164# 120 "/home/runner/work/MFC/MFC/src/common/include/shared_parallel_macros.fpp"
165! New line at end of file is required for FYPP
166# 2 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp" 2
167
168# 7 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
169
170# 17 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
171
172# 22 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
173
174# 27 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
175
176# 32 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
177
178# 37 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
179
180# 42 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
181
182# 47 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
183
184# 52 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
185
186# 57 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
187
188# 62 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
189
190# 73 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
191
192# 78 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
193
194# 83 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
195
196# 88 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
197
198# 103 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
199
200# 131 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
201
202# 160 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
203
204# 175 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
205
206# 193 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
207
208# 215 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
209
210# 244 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
211
212# 259 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
213
214# 269 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
215
216# 278 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
217
218# 294 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
219
220# 304 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
221
222# 311 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
223! New line at end of file is required for FYPP
224# 4 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp" 2
225
226! GPU parallel region (scalar reductions, maxval/minval)
227# 23 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
228
229! GPU parallel loop over threads (most common GPU macro)
230# 43 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
231
232! Required closing for GPU_PARALLEL_LOOP
233# 55 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
234
235! Mark routine for device compilation
236# 112 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
237
238! Declare device-resident data
239# 130 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
240
241! Inner loop within a GPU parallel region
242# 145 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
243
244! Scoped GPU data region
245# 164 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
246
247! Host code with device pointers (for MPI with GPU buffers)
248# 193 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
249
250! Allocate device memory (unscoped)
251# 207 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
252
253! Free device memory
254# 219 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
255
256! Atomic operation on device
257# 231 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
258
259! End atomic capture block
260# 242 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
261
262! Copy data between host and device
263# 254 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
264
265! Synchronization barrier
266# 266 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
267
268! Import GPU library module (openacc or omp_lib)
269# 275 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
270
271! Emit code only for AMD compiler
272# 282 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
273
274! Emit code for non-Cray compilers
275# 289 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
276
277! Emit code only for Cray compiler
278# 296 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
279
280! Emit code for non-NVIDIA compilers
281# 303 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
282
283# 305 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
284# 306 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
285! New line at end of file is required for FYPP
286# 2 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 2
287
288# 14 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
289
290! Caution: This macro requires the use of a binding script to set CUDA_VISIBLE_DEVICES, such that we have one GPU device per MPI
291! rank. That's because for both cudaMemAdvise (preferred location) and cudaMemPrefetchAsync we use location = device_id = 0. For an
292! example see misc/nvidia_uvm/bind.sh. NVIDIA unified memory page placement hint
293# 57 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
294
295! Allocate and create GPU device memory
296# 77 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
297
298! Free GPU device memory and deallocate
299# 85 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
300
301! Cray-specific GPU pointer setup for vector fields
302# 109 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
303
304! Cray-specific GPU pointer setup for scalar fields
305# 125 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
306
307! Cray-specific GPU pointer setup for acoustic source spatials
308# 150 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
309
310# 156 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
311
312# 163 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
313! New line at end of file is required for FYPP
314# 6 "/home/runner/work/MFC/MFC/src/common/m_derived_types.fpp" 2
315
316!> @brief Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures
318
319 use m_constants
321 use m_thermochem, only: num_species
322
323 implicit none
324
325 !> Derived type adding the field position (fp) as an attribute
327 real(stp), allocatable, dimension(:,:,:) :: fp !< Field position
328 end type field_position
329
330 !> Derived type annexing a scalar field (SF)
332 real(stp), pointer, dimension(:,:,:) :: sf => null()
333 end type scalar_field
334
335 !> Derived type for bubble variables pb and mv at quadrature nodes (qbmm)
337 real(stp), pointer, dimension(:,:,:,:,:) :: sf => null()
338 end type pres_field
339
340 !> Derived type annexing an integer scalar field (SF)
342#ifdef MFC_MIXED_PRECISION
343 integer(kind=1), pointer, dimension(:,:,:) :: sf => null()
344#else
345 integer, pointer, dimension(:,:,:) :: sf => null()
346#endif
347 end type integer_field
348
349 !> Derived type for levelset
351 real(stp), pointer, dimension(:,:,:,:) :: sf => null()
352 end type levelset_field
353
354 !> Derived type for levelset norm
356 real(stp), pointer, dimension(:,:,:,:,:) :: sf => null()
357 end type levelset_norm_field
358
360 integer, allocatable, dimension(:) :: view
361 type(scalar_field), allocatable, dimension(:) :: var
362 end type mpi_io_var
363
365 integer :: view
366 type(integer_field) :: var
367 end type mpi_io_ib_var
368
370 integer :: view
371 type(levelset_field) :: var
372 end type mpi_io_levelset_var
373
378
379 !> Derived type annexing a vector field (VF)
381 type(scalar_field), allocatable, dimension(:) :: vf !< Vector field
382 end type vector_field
383
384 !> Generic 3-component vector (e.g., spatial coordinates or field components) Named _dt (derived types: x,y,z) to differentiate
385 !! from t_vec3 (3-component vector)
386 type vec3_dt ! dt for derived types
387 real(wp) :: x
388 real(wp) :: y
389 real(wp) :: z
390 end type vec3_dt
391
392 !> Left and right Riemann states
394 real(wp) :: l
395 real(wp) :: r
396 end type riemann_states
397
398 !> Left and right Riemann states for 3-component vectors
400 real(wp) :: l(3)
401 real(wp) :: r(3)
402 end type riemann_states_vec3
403
404 !> Integer bounds for variables
406 integer :: beg
407 integer :: end
408 real(wp) :: vb1
409 real(wp) :: vb2
410 real(wp) :: vb3
411 real(wp) :: ve1
412 real(wp) :: ve2
413 real(wp) :: ve3
414 real(wp) :: pres_in, pres_out
415 real(wp), dimension(3) :: vel_in, vel_out
416 real(wp), dimension(num_fluids_max) :: alpha_rho_in, alpha_in
417 logical :: grcbc_in, grcbc_out, grcbc_vel_out
418 end type int_bounds_info
419
421 integer :: geometry
422 integer :: type
423 integer :: dir
424 integer :: loc
425 real(wp), dimension(3) :: centroid
426 real(wp), dimension(3) :: length
427 real(wp) :: radius
428 end type bc_patch_parameters
429
430 !> Derived type adding beginning (beg) and end bounds info as attributes
432 real(wp) :: beg
433 real(wp) :: end
434 end type bounds_info
435
436 !> bounds for the bubble dynamic variables
438 integer :: beg
439 integer :: end
440 integer, dimension(:), allocatable :: rs
441 integer, dimension(:), allocatable :: vs
442 integer, dimension(:), allocatable :: ps
443 integer, dimension(:), allocatable :: ms
444 integer, dimension(:,:), allocatable :: moms !< Moment indices for qbmm
445 integer, dimension(:,:,:), allocatable :: fullmom !< Moment indices for qbmm
446 end type bub_bounds_info
447
448 !> Defines parameters for a Model Patch
450 character(LEN=pathlen_max) :: filepath !< Path the STL file relative to case_dir.
451 real(wp), dimension(1:3) :: translate !< Translation of the STL object.
452 real(wp), dimension(1:3) :: scale !< Scale factor for the STL object.
453 real(wp), dimension(1:3) :: rotate !< Angle to rotate the STL object along each cartesian coordinate axis, in radians.
454 integer :: spc !< Number of samples per cell to use when discretizing the STL object.
455 real(wp) :: threshold !< Threshold to turn on smoothen STL patch.
456 end type ic_model_parameters
457
459 real(wp), dimension(1:3,1:3) :: v !< Vertices of the triangle
460 real(wp), dimension(1:3) :: n !< Normal vector
461 end type t_triangle
462
463 type :: t_ray
464 real(wp), dimension(1:3) :: o !< Origin
465 real(wp), dimension(1:3) :: d !< Direction
466 end type t_ray
467
468 type :: t_bbox
469 real(wp), dimension(1:3) :: min !< Minimum coordinates
470 real(wp), dimension(1:3) :: max !< Maximum coordinates
471 end type t_bbox
472
473 type :: t_model
474 integer :: ntrs !< Number of triangles
475 type(t_triangle), allocatable :: trs(:) !< Triangles
476 end type t_model
477
479 ! Original CPU-side fields (unchanged)
480 type(t_model), allocatable :: model !< STL/OBJ geometry model
481 real(wp), allocatable, dimension(:,:,:) :: boundary_v !< Boundary vertices
482 real(wp), allocatable, dimension(:,:) :: interpolated_boundary_v !< Interpolated boundary vertices
483 integer :: boundary_edge_count !< Number of boundary edges
484 integer :: total_vertices !< Total vertex count
485 integer :: interpolate !< Interpolation flag
486
487 ! GPU-friendly flattened arrays
488 integer :: ntrs !< Copy of model%ntrs
489 real(wp), allocatable, dimension(:,:,:) :: trs_v !< Triangle vertices (3, 3, ntrs)
490 real(wp), allocatable, dimension(:,:) :: trs_n !< Triangle normals (3, ntrs)
491 end type t_model_array
492
493 !> Derived type adding initial condition (ic) patch parameters as attributes NOTE: The requirements for the specification of the
494 !! above parameters are strongly dependent on both the choice of the multicomponent flow model as well as the choice of the
495 !! patch geometry.
497
498 integer :: geometry !< Type of geometry for the patch
499 real(wp) :: x_centroid, y_centroid, z_centroid !< Geometric center coordinates of the patch
500 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
501 real(wp) :: radius !< Dimensions of the patch. radius.
502 real(wp), dimension(3) :: radii !< Elliptical/ellipsoidal patch radii in x, y, z
503 real(wp) :: epsilon, beta !< The isentropic vortex parameters for the amplitude of the disturbance and domain of influence.
504 real(wp), dimension(2:9) :: a !< Used by hardcoded IC and as temporary variables.
505 logical :: non_axis_sym
506
507 ! Geometry 13 (2D modal Fourier): fourier_cos(n), fourier_sin(n) for mode n
508 real(wp), dimension(1:max_2d_fourier_modes) :: fourier_cos, fourier_sin
509 logical :: modal_clip_r_to_min !< When true, clip boundary radius: R(theta) = max(R(theta), modal_r_min) (Non-exp form only)
510 real(wp) :: modal_r_min !< Minimum boundary radius when modal_clip_r_to_min is true (Non-exp form only)
511 logical :: modal_use_exp_form !< When true, boundary = radius*exp(Fourier series)
512 ! Geometry 14 (3D spherical harmonic): sph_har_coeff(l,m) for real Y_lm
513 real(wp), dimension(0:max_sph_harm_degree,-max_sph_harm_degree:max_sph_harm_degree) :: sph_har_coeff
514 real(wp), dimension(3) :: normal !< Patch orientation normal vector (x, y, z)
515 logical, dimension(0:num_patches_max - 1) :: alter_patch !< Overwrite permissions for preceding patches
516 logical :: smoothen !< Whether patch boundaries are smoothed across cells
517 integer :: smooth_patch_id !< Identity (id) of the patch with which current patch is to get smoothed
518 real(wp) :: smooth_coeff !< Smoothing stencil size coefficient
519 real(wp), dimension(num_fluids_max) :: alpha_rho
520 real(wp) :: rho
521 real(wp), dimension(3) :: vel
522 real(wp) :: pres
523 real(wp), dimension(num_fluids_max) :: alpha
524 real(wp) :: gamma
525 real(wp) :: pi_inf
526 real(wp) :: cv
527 real(wp) :: qv
528 real(wp) :: qvp !< Reference entropy per unit mass (SGEOS)
529 real(wp) :: bx, by, bz !< Magnetic field components; B%x is not used for 1D
530 real(wp), dimension(6) :: tau_e !< Elastic stresses added to primitive variables if hypoelasticity = True
531 real(wp) :: r0 !< Bubble size
532 real(wp) :: v0 !< Bubble velocity
533 real(wp) :: p0 !< Bubble size
534 real(wp) :: m0 !< Bubble velocity
535 integer :: hcid !< Hardcoded initial condition ID
536 real(wp) :: cf_val !< Color function value
537 real(wp) :: y(1:num_species) !< Species mass fractions
538
539 ! STL or OBJ model input parameter
540 character(LEN=pathlen_max) :: model_filepath !< Path the STL file relative to case_dir.
541 real(wp), dimension(1:3) :: model_translate !< Translation of the STL object.
542 real(wp), dimension(1:3) :: model_scale !< Scale factor for the STL object.
543 !> Angle to rotate the STL object along each cartesian coordinate axis, in radians.
544 real(wp), dimension(1:3) :: model_rotate
545 integer :: model_spc !< Number of samples per cell to use when discretizing the STL object.
546 real(wp) :: model_threshold !< Threshold to turn on smoothen STL patch.
547 end type ic_patch_parameters
548
550
551 integer :: geometry !< Type of geometry for the patch
552 real(wp) :: x_centroid, y_centroid, z_centroid !< Geometric center coordinates of the patch
553 !> Centroid locations of intermediate steps in the time_stepper module
554 real(wp) :: step_x_centroid, step_y_centroid, step_z_centroid
555 real(wp), dimension(1:3) :: centroid_offset !< offset of center of mass from computed cell center for odd-shaped IBs
556 real(wp), dimension(1:3) :: angles
557 real(wp), dimension(1:3) :: step_angles
558 !> matrix that converts from IB reference frame to fluid reference frame
559 real(wp), dimension(1:3,1:3) :: rotation_matrix
560 !> matrix that converts from fluid reference frame to IB reference frame
561 real(wp), dimension(1:3,1:3) :: rotation_matrix_inverse
562 real(wp) :: c, p, t, m
563 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
564 real(wp) :: radius !< Dimensions of the patch. radius.
565 real(wp) :: theta
566 logical :: slip
567
568 ! STL or OBJ model input parameter
569 character(LEN=pathlen_max) :: model_filepath !< Path the STL file relative to case_dir.
570 real(wp), dimension(1:3) :: model_translate !< Translation of the STL object.
571 real(wp), dimension(1:3) :: model_scale !< Scale factor for the STL object.
572 !> Angle to rotate the STL object along each cartesian coordinate axis, in radians.
573 real(wp), dimension(1:3) :: model_rotate
574 integer :: model_spc !< Number of samples per cell to use when discretizing the STL object.
575 real(wp) :: model_threshold !< Threshold to turn on smoothen STL patch. Patch conditions for moving imersed boundaries
576 integer :: moving_ibm !< 0 for no moving, 1 for moving, 2 for moving on forced path
577 real(wp) :: mass, moment !< mass and moment of inertia of object used to compute forces in 2-way coupling
578 real(wp), dimension(1:3) :: force, torque !< vectors for the computed force and torque values applied to an IB
579 real(wp), dimension(1:3) :: vel
580 real(wp), dimension(1:3) :: step_vel !< velocity array used to store intermediate steps in the time_stepper module
581 real(wp), dimension(1:3) :: angular_vel
582 real(wp), dimension(1:3) :: step_angular_vel !< velocity array used to store intermediate steps in the time_stepper module
583 end type ib_patch_parameters
584
585 !> Derived type annexing the physical parameters (PP) of the fluids. These include the specific heat ratio function and liquid
586 !! stiffness function.
588 real(wp) :: gamma !< Sp. heat ratio
589 real(wp) :: pi_inf !< Liquid stiffness
590 real(wp), dimension(2) :: re !< Reynolds number
591 real(wp) :: cv !< heat capacity
592 real(wp) :: qv !< reference energy per unit mass for SGEOS, q (see Le Metayer (2004))
593 real(wp) :: qvp !< reference entropy per unit mass for SGEOS, q' (see Le Metayer (2004))
594 real(wp) :: g
595 end type physical_parameters
596
597 !> Derived type annexing the physical parameters required for sub-grid bubble models
599 real(wp) :: r0ref !< reference bubble radius
600 real(wp) :: p0ref !< reference pressure
601 real(wp) :: rho0ref !< reference density
602 real(wp) :: t0ref !< reference temperature
603 real(wp) :: ss !< surface tension between host and gas (bubble)
604 real(wp) :: pv !< vapor pressure of host
605 real(wp) :: vd !< vapor diffusivity in gas (bubble)
606 real(wp) :: mu_l !< viscosity of host in liquid state
607 real(wp) :: mu_v !< viscosity of host in vapor state
608 real(wp) :: mu_g !< viscosity of gas (bubble)
609 real(wp) :: gam_v !< specific heat ratio of host in vapor state
610 real(wp) :: gam_g !< specific heat ratio of gas (bubble)
611 real(wp) :: m_v !< Molecular weight of host
612 real(wp) :: m_g !< Molecular weight of gas (bubble)
613 real(wp) :: k_v !< thermal conductivity of host in vapor state
614 real(wp) :: k_g !< thermal conductivity of gas (bubble)
615 real(wp) :: cp_v !< specific heat capacity in constant pressure of host in vapor state
616 real(wp) :: cp_g !< specific heat capacity in constant pressure of gas (bubble)
617 real(wp) :: r_v !< gas constant of host in vapor state
618 real(wp) :: r_g !< gas constant of gas (bubble)
620
622 integer, dimension(2) :: view
623 type(vec3_dt), allocatable, dimension(:) :: var
624 end type mpi_io_airfoil_ib_var
625
626 !> Derived type annexing integral regions
628 real(wp) :: xmin !< Min. boundary first coordinate direction
629 real(wp) :: xmax !< Max. boundary first coordinate direction
630 real(wp) :: ymin !< Min. boundary second coordinate direction
631 real(wp) :: ymax !< Max. boundary second coordinate direction
632 real(wp) :: zmin !< Min. boundary third coordinate direction
633 real(wp) :: zmax !< Max. boundary third coordinate direction
634 end type integral_parameters
635
636 !> Acoustic source parameters
638 integer :: pulse !< Type of pulse
639 integer :: support !< Type of support
640 logical :: dipole !< Whether the source is a dipole or monopole
641 real(wp), dimension(3) :: loc !< Physical location of acoustic source
642 real(wp) :: mag !< Acoustic pulse magnitude
643 real(wp) :: length !< Length of planar source (2D/3D)
644 real(wp) :: height !< Height of planar source (3D)
645 real(wp) :: wavelength !< Wave length of pulse
646 real(wp) :: frequency !< Frequency of pulse
647 real(wp) :: gauss_sigma_dist !< sigma of Gaussian pulse multiplied by speed of sound
648 real(wp) :: gauss_sigma_time !< sigma of Gaussian pulse
649 real(wp) :: npulse !< Number of cycles of pulse
650 real(wp) :: dir !< Direction of pulse
651 real(wp) :: delay !< Time-delay of pulse start
652 real(wp) :: foc_length !< Focal length of transducer
653 real(wp) :: aperture !< Aperture diameter of transducer
654 real(wp) :: element_spacing_angle !< Spacing between aperture elements in 2D acoustic array
655 !> Ratio of aperture element diameter to side length of polygon connecting their centers, in 3D acoustic array
656 real(wp) :: element_polygon_ratio
657 real(wp) :: rotate_angle !< Angle of rotation of the entire circular 3D acoustic array
658 real(wp) :: bb_bandwidth !< Bandwidth of each frequency in broadband wave
659 real(wp) :: bb_lowest_freq !< The lower frequency bound of broadband wave
660 integer :: num_elements !< Number of elements in the acoustic array
661 integer :: element_on !< Element in the acoustic array to turn on
662 integer :: bb_num_freq !< Number of frequencies in the broadband wave
663 end type acoustic_parameters
664
665 !> Acoustic source source_spatial pre-calculated values
667 integer, pointer, dimension(:,:) :: coord => null() !< List of grid points indices with non-zero source_spatial values
668 real(wp), pointer, dimension(:) :: val => null() !< List of non-zero source_spatial values
669 real(wp), pointer, dimension(:) :: angle => null() !< List of angles with x-axis for mom source term vector
670 real(wp), pointer, dimension(:,:) :: xyz_to_r_ratios => null() !< List of [xyz]/r for mom source term vector
671 end type source_spatial_type
672
673 !> Ghost Point for Immersed Boundaries
675 integer, dimension(3) :: loc !< Physical location of the ghost point
676 real(wp), dimension(3) :: ip_loc !< Physical location of the image point
677 integer, dimension(3) :: ip_grid !< Top left grid point of IP
678 real(wp), dimension(2, 2, 2) :: interp_coeffs !< Interpolation Coefficients of image point
679 integer :: ib_patch_id !< ID of the IB Patch the ghost point is part of
680 real(wp) :: levelset
681 real(wp), dimension(1:3) :: levelset_norm
682 logical :: slip
683 integer, dimension(3) :: db
684 integer :: x_periodicity, y_periodicity, z_periodicity
685 end type ghost_point
686
687 !> Species parameters
689 character(LEN=name_len) :: name !< Name of species
690 end type species_parameters
691
692 !> Chemistry parameters
694 character(LEN=name_len) :: cantera_file !< Path to Cantera file
695 logical :: diffusion
696 logical :: reactions
697
698 !> Method of determining gamma.
699 !> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97.
700 !> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats.
701 integer :: gamma_method
702 integer :: transport_model
703 end type chemistry_parameters
704
705 !> Lagrangian bubble parameters
707
708 integer :: solver_approach !< 1: One-way coupling, 2: two-way coupling
709 integer :: cluster_type !< Cluster model to find p_inf
710 logical :: pressure_corrector !< Cell pressure correction term
711 integer :: smooth_type !< Smoothing function. 1: Gaussian, 2:Delta 3x3
712 logical :: heattransfer_model !< Activate HEAT transfer model at the bubble-liquid interface
713 logical :: masstransfer_model !< Activate MASS transfer model at the bubble-liquid interface
714 logical :: write_bubbles !< Write files to track the bubble evolution each time step
715 logical :: write_bubbles_stats !< Write the maximum and minimum radius of each bubble
716 integer :: nbubs_glb !< Global number of bubbles
717 real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
718 real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
719 real(wp) :: valmaxvoid !< Maximum void fraction permitted
721
722 !> Max and min number of cells in a direction of each combination of x-,y-, and z-
724 integer :: mn_max, np_max, mp_max, mnp_max
725 integer :: mn_min, np_min, mp_min, mnp_min
726 end type cell_num_bounds
727
729 logical, dimension(3) :: perturb_vel
730 real(wp), dimension(3) :: perturb_vel_freq
731 real(wp), dimension(3) :: perturb_vel_scale
732 real(wp), dimension(3, 3) :: perturb_vel_offset
733 logical, dimension(1:num_fluids_max) :: perturb_dens
734 real(wp), dimension(1:num_fluids_max) :: perturb_dens_freq
735 real(wp), dimension(1:num_fluids_max) :: perturb_dens_scale
736 real(wp), dimension(1:num_fluids_max,3) :: perturb_dens_offset
737 end type simplex_noise_params
738end module m_derived_types
integer, intent(in) l
Compile-time constant parameters: default values, tolerances, and physical constants.
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 wp
Change to single_precision if needed.
integer, parameter stp
Derived type adding beginning (beg) and end bounds info as attributes.
bounds for the bubble dynamic variables
Max and min number of cells in a direction of each combination of x-,y-, and z-.
Derived type adding the field position (fp) as an attribute.
Ghost Point for Immersed Boundaries.
Defines parameters for a Model Patch.
Derived type adding initial condition (ic) patch parameters as attributes NOTE: The requirements for ...
Integer bounds for variables.
Derived type annexing an integer scalar field (SF).
Derived type annexing integral regions.
Derived type for levelset norm.
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).
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.
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).