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# 207 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
107
108# 232 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
109
110# 243 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
111
112# 245 "/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# 283 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
116
117# 293 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
118
119# 303 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
120
121# 312 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
122
123# 329 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
124
125# 339 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
126
127# 346 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
128
129# 352 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
130
131# 358 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
132
133# 364 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
134
135# 370 "/home/runner/work/MFC/MFC/src/common/include/omp_macros.fpp"
136
137# 376 "/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# 192 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
207
208# 213 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
209
210# 241 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
211
212# 256 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
213
214# 266 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
215
216# 275 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
217
218# 291 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
219
220# 301 "/home/runner/work/MFC/MFC/src/common/include/acc_macros.fpp"
221
222# 308 "/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# 21 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
227
228# 37 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
229
230# 50 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
231
232# 76 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
233
234# 91 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
235
236# 102 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
237
238# 115 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
239
240# 143 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
241
242# 154 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
243
244# 165 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
245
246# 176 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
247
248# 186 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
249
250# 197 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
251
252# 208 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
253
254# 218 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
255
256# 224 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
257
258# 230 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
259
260# 236 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
261
262# 242 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
263
264# 244 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
265# 245 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
266! New line at end of file is required for FYPP
267# 2 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp" 2
268
269# 14 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
270
271! Caution:
272! This macro requires the use of a binding script to set CUDA_VISIBLE_DEVICES, such that we have one GPU device per MPI rank.
273! That's because for both cudaMemAdvise (preferred location) and cudaMemPrefetchAsync we use location = device_id = 0.
274! For an example see misc/nvidia_uvm/bind.sh.
275# 63 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
276
277# 81 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
278
279# 88 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
280
281# 111 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
282
283# 127 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
284
285# 153 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
286
287# 159 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
288
289# 167 "/home/runner/work/MFC/MFC/src/common/include/macros.fpp"
290! New line at end of file is required for FYPP
291# 6 "/home/runner/work/MFC/MFC/src/common/m_derived_types.fpp" 2
292
293!> @brief Shared derived types for field data, patch geometry, bubble dynamics, and MPI I/O structures
295
296 use m_constants !< constants
297
299 use m_thermochem, only: num_species
300
301 implicit none
302
303 !> Derived type adding the field position (fp) as an attribute
305 real(stp), allocatable, dimension(:, :, :) :: fp !< Field position
306 end type field_position
307
308 !> Derived type annexing a scalar field (SF)
310 real(stp), pointer, dimension(:, :, :) :: sf => null()
311 end type scalar_field
312
313 !> Derived type for bubble variables pb and mv at quadrature nodes (qbmm)
315 real(stp), pointer, dimension(:, :, :, :, :) :: sf => null()
316 end type pres_field
317
318 !> Derived type annexing an integer scalar field (SF)
320#ifdef MFC_MIXED_PRECISION
321 integer(kind=1), pointer, dimension(:, :, :) :: sf => null()
322#else
323 integer, pointer, dimension(:, :, :) :: sf => null()
324#endif
325 end type integer_field
326
327 !> Derived type for levelset
329 real(stp), pointer, dimension(:, :, :, :) :: sf => null()
330 end type levelset_field
331
332 !> Derived type for levelset norm
334 real(stp), pointer, dimension(:, :, :, :, :) :: sf => null()
335 end type levelset_norm_field
336
338 integer, allocatable, dimension(:) :: view
339 type(scalar_field), allocatable, dimension(:) :: var
340 end type mpi_io_var
341
343 integer :: view
344 type(integer_field) :: var
345 end type mpi_io_ib_var
346
348 integer :: view
349 type(levelset_field) :: var
350 end type mpi_io_levelset_var
351
356
357 !> Derived type annexing a vector field (VF)
359 type(scalar_field), allocatable, dimension(:) :: vf !< Vector field
360 end type vector_field
361
362 !> Generic 3-component vector (e.g., spatial coordinates or field components)
363 !! Named _dt (derived types: x,y,z) to differentiate from t_vec3 (3-component vector)
364 type vec3_dt ! dt for derived types
365 real(wp) :: x
366 real(wp) :: y
367 real(wp) :: z
368 end type vec3_dt
369
370 !> Left and right Riemann states
372 real(wp) :: l
373 real(wp) :: r
374 end type riemann_states
375
376 !> Left and right Riemann states for 3-component vectors
378 real(wp) :: l(3)
379 real(wp) :: r(3)
380 end type riemann_states_vec3
381
382 !> Integer bounds for variables
384 integer :: beg
385 integer :: end
386
387 real(wp) :: vb1
388 real(wp) :: vb2
389 real(wp) :: vb3
390 real(wp) :: ve1
391 real(wp) :: ve2
392 real(wp) :: ve3
393 real(wp) :: pres_in, pres_out
394 real(wp), dimension(3) :: vel_in, vel_out
395 real(wp), dimension(num_fluids_max) :: alpha_rho_in, alpha_in
396 logical :: grcbc_in, grcbc_out, grcbc_vel_out
397
398 end type int_bounds_info
399
401 integer :: geometry
402 integer :: type
403 integer :: dir
404 integer :: loc
405 real(wp), dimension(3) :: centroid
406 real(wp), dimension(3) :: length
407 real(wp) :: radius
408 end type bc_patch_parameters
409
410 !> Derived type adding beginning (beg) and end bounds info as attributes
412 real(wp) :: beg
413 real(wp) :: end
414 end type bounds_info
415
416 !> bounds for the bubble dynamic variables
418 integer :: beg
419 integer :: end
420 integer, dimension(:), allocatable :: rs
421 integer, dimension(:), allocatable :: vs
422 integer, dimension(:), allocatable :: ps
423 integer, dimension(:), allocatable :: ms
424 integer, dimension(:, :), allocatable :: moms !< Moment indices for qbmm
425 integer, dimension(:, :, :), allocatable :: fullmom !< Moment indices for qbmm
426 end type bub_bounds_info
427
428 !> Defines parameters for a Model Patch
430 character(LEN=pathlen_max) :: filepath !<
431 !! Path the STL file relative to case_dir.
432
433 real(wp), dimension(1:3) :: translate !<
434 !! Translation of the STL object.
435
436 real(wp), dimension(1:3) :: scale !<
437 !! Scale factor for the STL object.
438
439 real(wp), dimension(1:3) :: rotate !<
440 !! Angle to rotate the STL object along each cartesian coordinate axis,
441 !! in radians.
442
443 integer :: spc !<
444 !! Number of samples per cell to use when discretizing the STL object.
445
446 real(wp) :: threshold !<
447 !! Threshold to turn on smoothen STL patch.
448 end type ic_model_parameters
449
451 real(wp), dimension(1:3, 1:3) :: v ! Vertices of the triangle
452 real(wp), dimension(1:3) :: n ! Normal vector
453 end type t_triangle
454
455 type :: t_ray
456 real(wp), dimension(1:3) :: o ! Origin
457 real(wp), dimension(1:3) :: d ! Direction
458 end type t_ray
459
460 type :: t_bbox
461 real(wp), dimension(1:3) :: min ! Minimum coordinates
462 real(wp), dimension(1:3) :: max ! Maximum coordinates
463 end type t_bbox
464
465 type :: t_model
466 integer :: ntrs ! Number of triangles
467 type(t_triangle), allocatable :: trs(:) ! Triangles
468
469 end type t_model
470
472 ! Original CPU-side fields (unchanged)
473 type(t_model), allocatable :: model
474 real(wp), allocatable, dimension(:, :, :) :: boundary_v
475 real(wp), allocatable, dimension(:, :) :: interpolated_boundary_v
476 integer :: boundary_edge_count
477 integer :: total_vertices
478 integer :: interpolate
479
480 ! GPU-friendly flattened arrays
481 integer :: ntrs ! copy of model%ntrs
482 real(wp), allocatable, dimension(:, :, :) :: trs_v ! (3, 3, ntrs) - triangle vertices
483 real(wp), allocatable, dimension(:, :) :: trs_n ! (3, ntrs) - triangle normals
484 end type t_model_array
485
486 !> Derived type adding initial condition (ic) patch parameters as attributes
487 !! NOTE: The requirements for the specification of the above parameters
488 !! are strongly dependent on both the choice of the multicomponent flow
489 !! model as well as the choice of the patch geometry.
491
492 integer :: geometry !< Type of geometry for the patch
493
494 real(wp) :: x_centroid, y_centroid, z_centroid !<
495 !! Location of the geometric center, i.e. the centroid, of the patch. It
496 !! is specified through its x-, y- and z-coordinates, respectively.
497
498 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
499 real(wp) :: radius !< Dimensions of the patch. radius.
500
501 real(wp), dimension(3) :: radii !<
502 !! Vector indicating the various radii for the elliptical and ellipsoidal
503 !! patch geometries. It is specified through its x-, y-, and z-components
504 !! respectively.
505
506 real(wp) :: epsilon, beta !<
507 !! The isentropic vortex parameters for the amplitude of the disturbance and
508 !! domain of influence.
509
510 real(wp), dimension(2:9) :: a !<
511 !! The parameters needed for the spherical harmonic patch
512
513 logical :: non_axis_sym
514
515 real(wp), dimension(3) :: normal !<
516 !! Normal vector indicating the orientation of the patch. It is specified
517 !! through its x-, y- and z-components, respectively.
518
519 logical, dimension(0:num_patches_max - 1) :: alter_patch !<
520
521 !! List of permissions that indicate to the current patch which preceding
522 !! patches it is allowed to overwrite when it is in process of being laid
523 !! out in the domain
524
525 logical :: smoothen !<
526 !! Permission indicating to the current patch whether its boundaries will
527 !! be smoothed out across a few cells or whether they are to remain sharp
528
529 integer :: smooth_patch_id !<
530 !! Identity (id) of the patch with which current patch is to get smoothed
531
532 real(wp) :: smooth_coeff !<
533 !! Smoothing coefficient (coeff) for the size of the stencil of
534 !! cells across which boundaries of the current patch will be smeared out
535
536 real(wp), dimension(num_fluids_max) :: alpha_rho
537 real(wp) :: rho
538 real(wp), dimension(3) :: vel
539 real(wp) :: pres
540 real(wp), dimension(num_fluids_max) :: alpha
541 real(wp) :: gamma
542 real(wp) :: pi_inf !<
543 real(wp) :: cv !<
544 real(wp) :: qv !<
545 real(wp) :: qvp !<
546
547 !! Primitive variables associated with the patch. In order, these include
548 !! the partial densities, density, velocity, pressure, volume fractions,
549 !! specific heat ratio function and the liquid stiffness function.
550
551 real(wp) :: bx, by, bz !<
552 !! Magnetic field components; B%x is not used for 1D
553
554 real(wp), dimension(6) :: tau_e !<
555 !! Elastic stresses added to primitive variables if hypoelasticity = True
556
557 real(wp) :: r0 !< Bubble size
558 real(wp) :: v0 !< Bubble velocity
559
560 real(wp) :: p0 !< Bubble size
561 real(wp) :: m0 !< Bubble velocity
562
563 integer :: hcid
564 !! id for hard coded initial condition
565
566 real(wp) :: cf_val !! color function value
567 real(wp) :: y(1:num_species)
568
569 !! STL or OBJ model input parameter
570 character(LEN=pathlen_max) :: model_filepath !<
571 !! Path the STL file relative to case_dir.
572
573 real(wp), dimension(1:3) :: model_translate !<
574 !! Translation of the STL object.
575
576 real(wp), dimension(1:3) :: model_scale !<
577 !! Scale factor for the STL object.
578
579 real(wp), dimension(1:3) :: model_rotate !<
580 !! Angle to rotate the STL object along each cartesian coordinate axis,
581 !! in radians.
582
583 integer :: model_spc !<
584 !! Number of samples per cell to use when discretizing the STL object.
585
586 real(wp) :: model_threshold !<
587 !! Threshold to turn on smoothen STL patch.
588
589 end type ic_patch_parameters
590
592
593 integer :: geometry !< Type of geometry for the patch
594
595 real(wp) :: x_centroid, y_centroid, z_centroid !<
596 !! Location of the geometric center, i.e. the centroid, of the patch. It
597 !! is specified through its x-, y- and z-coordinates, respectively.
598 real(wp) :: step_x_centroid, step_y_centroid, step_z_centroid !<
599 !! Centroid locations of intermediate steps in the time_stepper module
600 real(wp), dimension(1:3) :: centroid_offset ! offset of center of mass from computed cell center for odd-shaped IBs
601
602 real(wp), dimension(1:3) :: angles
603 real(wp), dimension(1:3) :: step_angles
604 real(wp), dimension(1:3, 1:3) :: rotation_matrix !< matrix that converts from IB reference frame to fluid reference frame
605 real(wp), dimension(1:3, 1:3) :: rotation_matrix_inverse !< matrix that converts from fluid reference frame to IB reference frame
606
607 real(wp) :: c, p, t, m
608
609 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
610 real(wp) :: radius !< Dimensions of the patch. radius.
611 real(wp) :: theta
612
613 logical :: slip
614
615 !! STL or OBJ model input parameter
616 character(LEN=pathlen_max) :: model_filepath !<
617 !! Path the STL file relative to case_dir.
618
619 real(wp), dimension(1:3) :: model_translate !<
620 !! Translation of the STL object.
621
622 real(wp), dimension(1:3) :: model_scale !<
623 !! Scale factor for the STL object.
624
625 real(wp), dimension(1:3) :: model_rotate !<
626 !! Angle to rotate the STL object along each cartesian coordinate axis,
627 !! in radians.
628
629 integer :: model_spc !<
630 !! Number of samples per cell to use when discretizing the STL object.
631
632 real(wp) :: model_threshold !<
633 !! Threshold to turn on smoothen STL patch.
634
635 !! Patch conditions for moving imersed boundaries
636 integer :: moving_ibm ! 0 for no moving, 1 for moving, 2 for moving on forced path
637 real(wp) :: mass, moment ! mass and moment of inertia of object used to compute forces in 2-way coupling
638 real(wp), dimension(1:3) :: force, torque ! vectors for the computed force and torque values applied to an IB
639 real(wp), dimension(1:3) :: vel
640 real(wp), dimension(1:3) :: step_vel ! velocity array used to store intermediate steps in the time_stepper module
641 real(wp), dimension(1:3) :: angular_vel
642 real(wp), dimension(1:3) :: step_angular_vel ! velocity array used to store intermediate steps in the time_stepper module
643
644 end type ib_patch_parameters
645
646 !> Derived type annexing the physical parameters (PP) of the fluids. These
647 !! include the specific heat ratio function and liquid stiffness function.
649 real(wp) :: gamma !< Sp. heat ratio
650 real(wp) :: pi_inf !< Liquid stiffness
651 real(wp), dimension(2) :: re !< Reynolds number
652 real(wp) :: cv !< heat capacity
653 real(wp) :: qv !< reference energy per unit mass for SGEOS, q (see Le Metayer (2004))
654 real(wp) :: qvp !< reference entropy per unit mass for SGEOS, q' (see Le Metayer (2004))
655 real(wp) :: g
656 end type physical_parameters
657
658 !> Derived type annexing the physical parameters required for sub-grid bubble models
660 real(wp) :: r0ref !< reference bubble radius
661 real(wp) :: p0ref !< reference pressure
662 real(wp) :: rho0ref !< reference density
663 real(wp) :: t0ref !< reference temperature
664 real(wp) :: ss !< surface tension between host and gas (bubble)
665 real(wp) :: pv !< vapor pressure of host
666 real(wp) :: vd !< vapor diffusivity in gas (bubble)
667 real(wp) :: mu_l !< viscosity of host in liquid state
668 real(wp) :: mu_v !< viscosity of host in vapor state
669 real(wp) :: mu_g !< viscosity of gas (bubble)
670 real(wp) :: gam_v !< specific heat ratio of host in vapor state
671 real(wp) :: gam_g !< specific heat ratio of gas (bubble)
672 real(wp) :: m_v !< Molecular weight of host
673 real(wp) :: m_g !< Molecular weight of gas (bubble)
674 real(wp) :: k_v !< thermal conductivity of host in vapor state
675 real(wp) :: k_g !< thermal conductivity of gas (bubble)
676 real(wp) :: cp_v !< specific heat capacity in constant pressure of host in vapor state
677 real(wp) :: cp_g !< specific heat capacity in constant pressure of gas (bubble)
678 real(wp) :: r_v !< gas constant of host in vapor state
679 real(wp) :: r_g !< gas constant of gas (bubble)
681
683 integer, dimension(2) :: view
684 type(vec3_dt), allocatable, dimension(:) :: var
685 end type mpi_io_airfoil_ib_var
686
687 !> Derived type annexing integral regions
689 real(wp) :: xmin !< Min. boundary first coordinate direction
690 real(wp) :: xmax !< Max. boundary first coordinate direction
691 real(wp) :: ymin !< Min. boundary second coordinate direction
692 real(wp) :: ymax !< Max. boundary second coordinate direction
693 real(wp) :: zmin !< Min. boundary third coordinate direction
694 real(wp) :: zmax !< Max. boundary third coordinate direction
695 end type integral_parameters
696
697 !> Acoustic source parameters
699 integer :: pulse !< Type of pulse
700 integer :: support !< Type of support
701 logical :: dipole !< Whether the source is a dipole or monopole
702 real(wp), dimension(3) :: loc !< Physical location of acoustic source
703 real(wp) :: mag !< Acoustic pulse magnitude
704 real(wp) :: length !< Length of planar source (2D/3D)
705 real(wp) :: height !< Height of planar source (3D)
706 real(wp) :: wavelength !< Wave length of pulse
707 real(wp) :: frequency !< Frequency of pulse
708 real(wp) :: gauss_sigma_dist !< sigma of Gaussian pulse multiplied by speed of sound
709 real(wp) :: gauss_sigma_time !< sigma of Gaussian pulse
710 real(wp) :: npulse !< Number of cycles of pulse
711 real(wp) :: dir !< Direction of pulse
712 real(wp) :: delay !< Time-delay of pulse start
713 real(wp) :: foc_length ! < Focal length of transducer
714 real(wp) :: aperture ! < Aperture diameter of transducer
715 real(wp) :: element_spacing_angle !< Spacing between aperture elements in 2D acoustic array
716 real(wp) :: element_polygon_ratio !< Ratio of aperture element diameter to side length of polygon connecting their centers, in 3D acoustic array
717 real(wp) :: rotate_angle !< Angle of rotation of the entire circular 3D acoustic array
718 real(wp) :: bb_bandwidth !< Bandwidth of each frequency in broadband wave
719 real(wp) :: bb_lowest_freq !< The lower frequency bound of broadband wave
720 integer :: num_elements !< Number of elements in the acoustic array
721 integer :: element_on !< Element in the acoustic array to turn on
722 integer :: bb_num_freq !< Number of frequencies in the broadband wave
723 end type acoustic_parameters
724
725 !> Acoustic source source_spatial pre-calculated values
727 integer, pointer, dimension(:, :) :: coord => null() !< List of grid points indices with non-zero source_spatial values
728 real(wp), pointer, dimension(:) :: val => null() !< List of non-zero source_spatial values
729 real(wp), pointer, dimension(:) :: angle => null() !< List of angles with x-axis for mom source term vector
730 real(wp), pointer, dimension(:, :) :: xyz_to_r_ratios => null() !< List of [xyz]/r for mom source term vector
731
732 end type source_spatial_type
733
734 !> Ghost Point for Immersed Boundaries
736 integer, dimension(3) :: loc !< Physical location of the ghost point
737 real(wp), dimension(3) :: ip_loc !< Physical location of the image point
738 integer, dimension(3) :: ip_grid !< Top left grid point of IP
739 real(wp), dimension(2, 2, 2) :: interp_coeffs !< Interpolation Coefficients of image point
740 integer :: ib_patch_id !< ID of the IB Patch the ghost point is part of
741 real(wp) :: levelset
742 real(wp), dimension(1:3) :: levelset_norm
743 logical :: slip
744 integer, dimension(3) :: db
745 integer :: x_periodicity, y_periodicity, z_periodicity
746 end type ghost_point
747
748 !> Species parameters
750 character(LEN=name_len) :: name !< Name of species
751 end type species_parameters
752
753 !> Chemistry parameters
755 character(LEN=name_len) :: cantera_file !< Path to Cantera file
756
757 logical :: diffusion
758 logical :: reactions
759
760 !> Method of determining gamma.
761 !> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97.
762 !> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats.
763 integer :: gamma_method
764 integer :: transport_model
765 end type chemistry_parameters
766
767 !> Lagrangian bubble parameters
769
770 integer :: solver_approach !< 1: One-way coupling, 2: two-way coupling
771 integer :: cluster_type !< Cluster model to find p_inf
772 logical :: pressure_corrector !< Cell pressure correction term
773 integer :: smooth_type !< Smoothing function. 1: Gaussian, 2:Delta 3x3
774 logical :: heattransfer_model !< Activate HEAT transfer model at the bubble-liquid interface
775 logical :: masstransfer_model !< Activate MASS transfer model at the bubble-liquid interface
776 logical :: write_bubbles !< Write files to track the bubble evolution each time step
777 logical :: write_bubbles_stats !< Write the maximum and minimum radius of each bubble
778 integer :: nbubs_glb !< Global number of bubbles
779 real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
780 real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
781 real(wp) :: valmaxvoid !< Maximum void fraction permitted
782
784
785 !> Max and min number of cells in a direction of each combination of x-,y-, and z-
787 integer :: mn_max, np_max, mp_max, mnp_max
788 integer :: mn_min, np_min, mp_min, mnp_min
789 end type cell_num_bounds
790
792 logical, dimension(3) :: perturb_vel
793 real(wp), dimension(3) :: perturb_vel_freq
794 real(wp), dimension(3) :: perturb_vel_scale
795 real(wp), dimension(3, 3) :: perturb_vel_offset
796
797 logical, dimension(1:num_fluids_max) :: perturb_dens
798 real(wp), dimension(1:num_fluids_max) :: perturb_dens_freq
799 real(wp), dimension(1:num_fluids_max) :: perturb_dens_scale
800 real(wp), dimension(1:num_fluids_max, 3) :: perturb_dens_offset
801 end type
802
803end module m_derived_types
804
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
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).