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