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# 104 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
233
234# 119 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
235
236# 130 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
237
238# 143 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
239
240# 171 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
241
242# 182 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
243
244# 193 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
245
246# 204 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
247
248# 214 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
249
250# 225 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
251
252# 236 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
253
254# 246 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
255
256# 252 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
257
258# 258 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
259
260# 264 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
261
262# 270 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
263
264# 272 "/home/runner/work/MFC/MFC/src/common/include/parallel_macros.fpp"
265# 273 "/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 !! Used by hardcoded IC and as temporary variables.
512
513 logical :: non_axis_sym
514
515 ! Geometry 13 (2D modal Fourier): fourier_cos(n), fourier_sin(n) for mode n
516 real(wp), dimension(1:max_2d_fourier_modes) :: fourier_cos, fourier_sin
517 logical :: modal_clip_r_to_min !< When true, clip boundary radius: R(theta) = max(R(theta), modal_r_min) (Non-exp form only)
518 real(wp) :: modal_r_min !< Minimum boundary radius when modal_clip_r_to_min is true (Non-exp form only)
519 logical :: modal_use_exp_form !< When true, boundary = radius*exp(Fourier series)
520
521 ! Geometry 14 (3D spherical harmonic): sph_har_coeff(l,m) for real Y_lm
522 real(wp), dimension(0:max_sph_harm_degree, -max_sph_harm_degree:max_sph_harm_degree) :: sph_har_coeff
523
524 real(wp), dimension(3) :: normal !<
525 !! Normal vector indicating the orientation of the patch. It is specified
526 !! through its x-, y- and z-components, respectively.
527
528 logical, dimension(0:num_patches_max - 1) :: alter_patch !<
529
530 !! List of permissions that indicate to the current patch which preceding
531 !! patches it is allowed to overwrite when it is in process of being laid
532 !! out in the domain
533
534 logical :: smoothen !<
535 !! Permission indicating to the current patch whether its boundaries will
536 !! be smoothed out across a few cells or whether they are to remain sharp
537
538 integer :: smooth_patch_id !<
539 !! Identity (id) of the patch with which current patch is to get smoothed
540
541 real(wp) :: smooth_coeff !<
542 !! Smoothing coefficient (coeff) for the size of the stencil of
543 !! cells across which boundaries of the current patch will be smeared out
544
545 real(wp), dimension(num_fluids_max) :: alpha_rho
546 real(wp) :: rho
547 real(wp), dimension(3) :: vel
548 real(wp) :: pres
549 real(wp), dimension(num_fluids_max) :: alpha
550 real(wp) :: gamma
551 real(wp) :: pi_inf !<
552 real(wp) :: cv !<
553 real(wp) :: qv !<
554 real(wp) :: qvp !<
555
556 !! Primitive variables associated with the patch. In order, these include
557 !! the partial densities, density, velocity, pressure, volume fractions,
558 !! specific heat ratio function and the liquid stiffness function.
559
560 real(wp) :: bx, by, bz !<
561 !! Magnetic field components; B%x is not used for 1D
562
563 real(wp), dimension(6) :: tau_e !<
564 !! Elastic stresses added to primitive variables if hypoelasticity = True
565
566 real(wp) :: r0 !< Bubble size
567 real(wp) :: v0 !< Bubble velocity
568
569 real(wp) :: p0 !< Bubble size
570 real(wp) :: m0 !< Bubble velocity
571
572 integer :: hcid
573 !! id for hard coded initial condition
574
575 real(wp) :: cf_val !! color function value
576 real(wp) :: y(1:num_species)
577
578 !! STL or OBJ model input parameter
579 character(LEN=pathlen_max) :: model_filepath !<
580 !! Path the STL file relative to case_dir.
581
582 real(wp), dimension(1:3) :: model_translate !<
583 !! Translation of the STL object.
584
585 real(wp), dimension(1:3) :: model_scale !<
586 !! Scale factor for the STL object.
587
588 real(wp), dimension(1:3) :: model_rotate !<
589 !! Angle to rotate the STL object along each cartesian coordinate axis,
590 !! in radians.
591
592 integer :: model_spc !<
593 !! Number of samples per cell to use when discretizing the STL object.
594
595 real(wp) :: model_threshold !<
596 !! Threshold to turn on smoothen STL patch.
597
598 end type ic_patch_parameters
599
601
602 integer :: geometry !< Type of geometry for the patch
603
604 real(wp) :: x_centroid, y_centroid, z_centroid !<
605 !! Location of the geometric center, i.e. the centroid, of the patch. It
606 !! is specified through its x-, y- and z-coordinates, respectively.
607 real(wp) :: step_x_centroid, step_y_centroid, step_z_centroid !<
608 !! Centroid locations of intermediate steps in the time_stepper module
609 real(wp), dimension(1:3) :: centroid_offset ! offset of center of mass from computed cell center for odd-shaped IBs
610
611 real(wp), dimension(1:3) :: angles
612 real(wp), dimension(1:3) :: step_angles
613 real(wp), dimension(1:3, 1:3) :: rotation_matrix !< matrix that converts from IB reference frame to fluid reference frame
614 real(wp), dimension(1:3, 1:3) :: rotation_matrix_inverse !< matrix that converts from fluid reference frame to IB reference frame
615
616 real(wp) :: c, p, t, m
617
618 real(wp) :: length_x, length_y, length_z !< Dimensions of the patch. x,y,z Lengths.
619 real(wp) :: radius !< Dimensions of the patch. radius.
620 real(wp) :: theta
621
622 logical :: slip
623
624 !! STL or OBJ model input parameter
625 character(LEN=pathlen_max) :: model_filepath !<
626 !! Path the STL file relative to case_dir.
627
628 real(wp), dimension(1:3) :: model_translate !<
629 !! Translation of the STL object.
630
631 real(wp), dimension(1:3) :: model_scale !<
632 !! Scale factor for the STL object.
633
634 real(wp), dimension(1:3) :: model_rotate !<
635 !! Angle to rotate the STL object along each cartesian coordinate axis,
636 !! in radians.
637
638 integer :: model_spc !<
639 !! Number of samples per cell to use when discretizing the STL object.
640
641 real(wp) :: model_threshold !<
642 !! Threshold to turn on smoothen STL patch.
643
644 !! Patch conditions for moving imersed boundaries
645 integer :: moving_ibm ! 0 for no moving, 1 for moving, 2 for moving on forced path
646 real(wp) :: mass, moment ! mass and moment of inertia of object used to compute forces in 2-way coupling
647 real(wp), dimension(1:3) :: force, torque ! vectors for the computed force and torque values applied to an IB
648 real(wp), dimension(1:3) :: vel
649 real(wp), dimension(1:3) :: step_vel ! velocity array used to store intermediate steps in the time_stepper module
650 real(wp), dimension(1:3) :: angular_vel
651 real(wp), dimension(1:3) :: step_angular_vel ! velocity array used to store intermediate steps in the time_stepper module
652
653 end type ib_patch_parameters
654
655 !> Derived type annexing the physical parameters (PP) of the fluids. These
656 !! include the specific heat ratio function and liquid stiffness function.
658 real(wp) :: gamma !< Sp. heat ratio
659 real(wp) :: pi_inf !< Liquid stiffness
660 real(wp), dimension(2) :: re !< Reynolds number
661 real(wp) :: cv !< heat capacity
662 real(wp) :: qv !< reference energy per unit mass for SGEOS, q (see Le Metayer (2004))
663 real(wp) :: qvp !< reference entropy per unit mass for SGEOS, q' (see Le Metayer (2004))
664 real(wp) :: g
665 end type physical_parameters
666
667 !> Derived type annexing the physical parameters required for sub-grid bubble models
669 real(wp) :: r0ref !< reference bubble radius
670 real(wp) :: p0ref !< reference pressure
671 real(wp) :: rho0ref !< reference density
672 real(wp) :: t0ref !< reference temperature
673 real(wp) :: ss !< surface tension between host and gas (bubble)
674 real(wp) :: pv !< vapor pressure of host
675 real(wp) :: vd !< vapor diffusivity in gas (bubble)
676 real(wp) :: mu_l !< viscosity of host in liquid state
677 real(wp) :: mu_v !< viscosity of host in vapor state
678 real(wp) :: mu_g !< viscosity of gas (bubble)
679 real(wp) :: gam_v !< specific heat ratio of host in vapor state
680 real(wp) :: gam_g !< specific heat ratio of gas (bubble)
681 real(wp) :: m_v !< Molecular weight of host
682 real(wp) :: m_g !< Molecular weight of gas (bubble)
683 real(wp) :: k_v !< thermal conductivity of host in vapor state
684 real(wp) :: k_g !< thermal conductivity of gas (bubble)
685 real(wp) :: cp_v !< specific heat capacity in constant pressure of host in vapor state
686 real(wp) :: cp_g !< specific heat capacity in constant pressure of gas (bubble)
687 real(wp) :: r_v !< gas constant of host in vapor state
688 real(wp) :: r_g !< gas constant of gas (bubble)
690
692 integer, dimension(2) :: view
693 type(vec3_dt), allocatable, dimension(:) :: var
694 end type mpi_io_airfoil_ib_var
695
696 !> Derived type annexing integral regions
698 real(wp) :: xmin !< Min. boundary first coordinate direction
699 real(wp) :: xmax !< Max. boundary first coordinate direction
700 real(wp) :: ymin !< Min. boundary second coordinate direction
701 real(wp) :: ymax !< Max. boundary second coordinate direction
702 real(wp) :: zmin !< Min. boundary third coordinate direction
703 real(wp) :: zmax !< Max. boundary third coordinate direction
704 end type integral_parameters
705
706 !> Acoustic source parameters
708 integer :: pulse !< Type of pulse
709 integer :: support !< Type of support
710 logical :: dipole !< Whether the source is a dipole or monopole
711 real(wp), dimension(3) :: loc !< Physical location of acoustic source
712 real(wp) :: mag !< Acoustic pulse magnitude
713 real(wp) :: length !< Length of planar source (2D/3D)
714 real(wp) :: height !< Height of planar source (3D)
715 real(wp) :: wavelength !< Wave length of pulse
716 real(wp) :: frequency !< Frequency of pulse
717 real(wp) :: gauss_sigma_dist !< sigma of Gaussian pulse multiplied by speed of sound
718 real(wp) :: gauss_sigma_time !< sigma of Gaussian pulse
719 real(wp) :: npulse !< Number of cycles of pulse
720 real(wp) :: dir !< Direction of pulse
721 real(wp) :: delay !< Time-delay of pulse start
722 real(wp) :: foc_length ! < Focal length of transducer
723 real(wp) :: aperture ! < Aperture diameter of transducer
724 real(wp) :: element_spacing_angle !< Spacing between aperture elements in 2D acoustic array
725 real(wp) :: element_polygon_ratio !< Ratio of aperture element diameter to side length of polygon connecting their centers, in 3D acoustic array
726 real(wp) :: rotate_angle !< Angle of rotation of the entire circular 3D acoustic array
727 real(wp) :: bb_bandwidth !< Bandwidth of each frequency in broadband wave
728 real(wp) :: bb_lowest_freq !< The lower frequency bound of broadband wave
729 integer :: num_elements !< Number of elements in the acoustic array
730 integer :: element_on !< Element in the acoustic array to turn on
731 integer :: bb_num_freq !< Number of frequencies in the broadband wave
732 end type acoustic_parameters
733
734 !> Acoustic source source_spatial pre-calculated values
736 integer, pointer, dimension(:, :) :: coord => null() !< List of grid points indices with non-zero source_spatial values
737 real(wp), pointer, dimension(:) :: val => null() !< List of non-zero source_spatial values
738 real(wp), pointer, dimension(:) :: angle => null() !< List of angles with x-axis for mom source term vector
739 real(wp), pointer, dimension(:, :) :: xyz_to_r_ratios => null() !< List of [xyz]/r for mom source term vector
740
741 end type source_spatial_type
742
743 !> Ghost Point for Immersed Boundaries
745 integer, dimension(3) :: loc !< Physical location of the ghost point
746 real(wp), dimension(3) :: ip_loc !< Physical location of the image point
747 integer, dimension(3) :: ip_grid !< Top left grid point of IP
748 real(wp), dimension(2, 2, 2) :: interp_coeffs !< Interpolation Coefficients of image point
749 integer :: ib_patch_id !< ID of the IB Patch the ghost point is part of
750 real(wp) :: levelset
751 real(wp), dimension(1:3) :: levelset_norm
752 logical :: slip
753 integer, dimension(3) :: db
754 integer :: x_periodicity, y_periodicity, z_periodicity
755 end type ghost_point
756
757 !> Species parameters
759 character(LEN=name_len) :: name !< Name of species
760 end type species_parameters
761
762 !> Chemistry parameters
764 character(LEN=name_len) :: cantera_file !< Path to Cantera file
765
766 logical :: diffusion
767 logical :: reactions
768
769 !> Method of determining gamma.
770 !> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97.
771 !> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats.
772 integer :: gamma_method
773 integer :: transport_model
774 end type chemistry_parameters
775
776 !> Lagrangian bubble parameters
778
779 integer :: solver_approach !< 1: One-way coupling, 2: two-way coupling
780 integer :: cluster_type !< Cluster model to find p_inf
781 logical :: pressure_corrector !< Cell pressure correction term
782 integer :: smooth_type !< Smoothing function. 1: Gaussian, 2:Delta 3x3
783 logical :: heattransfer_model !< Activate HEAT transfer model at the bubble-liquid interface
784 logical :: masstransfer_model !< Activate MASS transfer model at the bubble-liquid interface
785 logical :: write_bubbles !< Write files to track the bubble evolution each time step
786 logical :: write_bubbles_stats !< Write the maximum and minimum radius of each bubble
787 integer :: nbubs_glb !< Global number of bubbles
788 real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
789 real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
790 real(wp) :: valmaxvoid !< Maximum void fraction permitted
791
793
794 !> Max and min number of cells in a direction of each combination of x-,y-, and z-
796 integer :: mn_max, np_max, mp_max, mnp_max
797 integer :: mn_min, np_min, mp_min, mnp_min
798 end type cell_num_bounds
799
801 logical, dimension(3) :: perturb_vel
802 real(wp), dimension(3) :: perturb_vel_freq
803 real(wp), dimension(3) :: perturb_vel_scale
804 real(wp), dimension(3, 3) :: perturb_vel_offset
805
806 logical, dimension(1:num_fluids_max) :: perturb_dens
807 real(wp), dimension(1:num_fluids_max) :: perturb_dens_freq
808 real(wp), dimension(1:num_fluids_max) :: perturb_dens_scale
809 real(wp), dimension(1:num_fluids_max, 3) :: perturb_dens_offset
810 end type
811
812end module m_derived_types
813
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).