Neko 1.99.10
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
fluid_scheme_compressible.f90
Go to the documentation of this file.
1! Copyright (c) 2025-2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
34 use field, only : field_t
35 use field_math, only : field_col2, field_col3, &
38
39 use registry, only : neko_registry
40 use bc, only : bc_t
42 use json_module, only : json_file
43 use num_types, only : rp, dp
44 use mesh, only : mesh_t
46 use space, only : gll
51 use mpi_f08
52 use operators, only : cfl_compressible
54 use compressible_ops_cpu, only : &
56 use compressible_ops_device, only : &
59 use time_state, only : time_state_t
60 use logger, only : neko_log, log_size
61 use math, only : glsum, glamax
62 use device_math, only : device_glamax
63 use compressible_residual, only : compressible_rhs_set_physical_flux
64 use num_types, only : i8
66 implicit none
67 private
68
69 !> Base type of compressible fluid formulations.
70 type, public, abstract, extends(fluid_scheme_base_t) :: &
72 !> The momentum field
73 type(field_t), pointer :: m_x => null() !< x-component of Momentum
74 type(field_t), pointer :: m_y => null() !< y-component of Momentum
75 type(field_t), pointer :: m_z => null() !< z-component of Momentum
76 type(field_t), pointer :: e => null() !< Total energy
77 type(field_t), pointer :: temperature => null() !< Temperature field
78 type(field_t), pointer :: max_wave_speed => null() !< Maximum wave speed field
79 type(field_t), pointer :: artificial_visc => null() !< Artificial viscosity field (without physical)
80 type(field_t), pointer :: kappa => null() !< Thermal conductivity
81
82 real(kind=rp) :: gamma
83
84 !> Largest magnitude of the dynamic viscosity over the domain.
85 real(kind=rp) :: mu_amax = 0.0_rp
86 !> Largest magnitude of the thermal conductivity over the domain.
87 real(kind=rp) :: kappa_amax = 0.0_rp
88
89 !> Whether the physical viscous and heat fluxes are evaluated.
90 logical :: add_physical_flux = .false.
91 !> Whether the physical viscous stress is evaluated.
92 logical :: add_physical_stress = .false.
93 !> Whether a user routine re-evaluates the material properties every
94 !! time-step, in which case the switches above have to be refreshed.
95 logical :: variable_material_properties = .false.
96
97 !> Global number of GLL points for the fluid (not unique)
98 integer(kind=i8) :: glb_n_points
99 !> Global number of GLL points for the fluid (unique)
100 integer(kind=i8) :: glb_unique_points
101
102 contains
103 !> Constructors
104 procedure, pass(this) :: scheme_init => fluid_scheme_compressible_init
105 !> Destructor for the base type
106 procedure, pass(this) :: scheme_free => fluid_scheme_compressible_free
107
108 !> Validate that all components are properly allocated
109 procedure, pass(this) :: validate => fluid_scheme_compressible_validate
110 !> Set the initial condition with the user routine
111 procedure, pass(this) :: set_user_initial_condition => &
113 !> Compute the CFL number
114 procedure, pass(this) :: compute_cfl &
116 !> Set rho and mu
117 procedure, pass(this) :: set_material_properties => &
119 !> Update variable material properties
120 procedure, pass(this) :: update_material_properties => &
122 !> Refresh the physical-flux switches from the material properties
123 procedure, pass(this) :: update_physical_flux => &
125 !> Compute maximum wave speed
126 procedure, pass(this) :: compute_max_wave_speed => &
128 !> Log solver information
129 procedure, pass(this) :: log_solver_info => &
131
133
134contains
135 !> Initialize common data for compressible fluid scheme
136 !> @param this The compressible fluid scheme object
137 !> @param msh Mesh data structure
138 !> @param lx Polynomial order in x-direction
139 !> @param params JSON configuration parameters
140 !> @param scheme Name of the numerical scheme
141 !> @param user User-defined parameters and functions
142 subroutine fluid_scheme_compressible_init(this, msh, lx, params, scheme, user)
143 class(fluid_scheme_compressible_t), target, intent(inout) :: this
144 type(mesh_t), target, intent(inout) :: msh
145 integer, intent(in) :: lx
146 character(len=*), intent(in) :: scheme
147 type(json_file), target, intent(inout) :: params
148 type(user_t), target, intent(in) :: user
149 logical :: compress_geo
150 real(kind=rp) :: compress_tol
151
152 !
153 ! SEM simulation fundamentals
154 !
155
156 this%msh => msh
157
158 if (msh%gdim .eq. 2) then
159 call this%Xh%init(gll, lx, lx)
160 else
161 call this%Xh%init(gll, lx, lx, lx)
162 end if
163
164 call this%dm_Xh%init(msh, this%Xh)
165
166 call this%gs_Xh%init(this%dm_Xh)
167
168 call this%c_Xh%init(this%gs_Xh)
169
170 ! Assign Dofmap to scratch registry
171 call neko_scratch_registry%set_dofmap(this%dm_Xh)
172
173 ! Case parameters
174 this%params => params
175
176 ! Assign a name
177 call json_get_or_default(params, 'case.fluid.name', this%name, "fluid")
178
179 ! Material properties will be set up via set_material_properties
180 call neko_registry%add_field(this%dm_Xh, this%name // "_rho")
181 this%rho => neko_registry%get_field(this%name // "_rho")
182
183 ! Assign momentum fields
184 call neko_registry%add_field(this%dm_Xh, "m_x")
185 call neko_registry%add_field(this%dm_Xh, "m_y")
186 call neko_registry%add_field(this%dm_Xh, "m_z")
187 this%m_x => neko_registry%get_field("m_x")
188 this%m_y => neko_registry%get_field("m_y")
189 this%m_z => neko_registry%get_field("m_z")
190 call this%m_x%init(this%dm_Xh, "m_x")
191 call this%m_y%init(this%dm_Xh, "m_y")
192 call this%m_z%init(this%dm_Xh, "m_z")
193
194 ! Assign energy field
195 call neko_registry%add_field(this%dm_Xh, "E")
196 this%E => neko_registry%get_field("E")
197 call this%E%init(this%dm_Xh, "E")
198
199 ! Assign temperature field
200 call neko_registry%add_field(this%dm_Xh, "temperature")
201 this%temperature => neko_registry%get_field("temperature")
202 call this%temperature%init(this%dm_Xh, "temperature")
203
204 ! Assign maximum wave speed field
205 call neko_registry%add_field(this%dm_Xh, "max_wave_speed")
206 this%max_wave_speed => neko_registry%get_field("max_wave_speed")
207 call this%max_wave_speed%init(this%dm_Xh, "max_wave_speed")
208
209 ! Assign artificial viscosity field (without physical viscosity)
210 call neko_registry%add_field(this%dm_Xh, "artificial_visc")
211 this%artificial_visc => neko_registry%get_field("artificial_visc")
212 call this%artificial_visc%init(this%dm_Xh, "artificial_visc")
213
214 ! ! Assign velocity fields
215 call neko_registry%add_field(this%dm_Xh, "u")
216 call neko_registry%add_field(this%dm_Xh, "v")
217 call neko_registry%add_field(this%dm_Xh, "w")
218 this%u => neko_registry%get_field("u")
219 this%v => neko_registry%get_field("v")
220 this%w => neko_registry%get_field("w")
221 call this%u%init(this%dm_Xh, "u")
222 call this%v%init(this%dm_Xh, "v")
223 call this%w%init(this%dm_Xh, "w")
224 call neko_registry%add_field(this%dm_Xh, 'p')
225 this%p => neko_registry%get_field('p')
226 call this%p%init(this%dm_Xh, "p")
227
228 !
229 ! Setup right-hand side fields.
230 !
231 allocate(this%f_x)
232 allocate(this%f_y)
233 allocate(this%f_z)
234 call this%f_x%init(this%dm_Xh, fld_name = "fluid_rhs_x")
235 call this%f_y%init(this%dm_Xh, fld_name = "fluid_rhs_y")
236 call this%f_z%init(this%dm_Xh, fld_name = "fluid_rhs_z")
237
238 ! Material properties
239 call this%set_material_properties(params, user)
240
241 ! Compressible parameters
242 call json_get_or_default(params, 'case.fluid.gamma', this%gamma, 1.4_rp)
243
244 ! Calculate global points for logging
245 this%glb_n_points = int(this%msh%glb_nelv, i8)*int(this%Xh%lxyz, i8)
246 this%glb_unique_points = int(glsum(this%c_Xh%mult, this%dm_Xh%size()), i8)
247
248 !
249 ! Log solver information
250 !
251 call this%log_solver_info(params, scheme, lx)
252
253 ! Compressed geometric factors, read by the standard Helmholtz operator
254 call json_get_or_default(params, &
255 'case.numerics.compress_geometric_factors', compress_geo, .false.)
256 if (compress_geo) then
257 if (params%valid_path( &
258 'case.numerics.compress_geometric_factors_tolerance')) then
259 call json_get_or_lookup(params, &
260 'case.numerics.compress_geometric_factors_tolerance', &
261 compress_tol)
262 call this%c_Xh%enable_geo_compression(compress_tol)
263 else
264 call this%c_Xh%enable_geo_compression()
265 end if
266 end if
267 end subroutine fluid_scheme_compressible_init
268
269 !> Free allocated memory and cleanup resources
270 !> @param this The compressible fluid scheme object to destroy
272 class(fluid_scheme_compressible_t), intent(inout) :: this
273 class(bc_t), pointer :: bc
274 integer :: i
275
276 do i = 1, this%bcs_vel%size()
277 bc => this%bcs_vel%get(i)
278 if (associated(bc)) then
279 call bc%free()
280 deallocate(bc)
281 end if
282 end do
283 call this%bcs_vel%free()
284
285 do i = 1, this%bcs_prs%size()
286 bc => this%bcs_prs%get(i)
287 if (associated(bc)) then
288 call bc%free()
289 deallocate(bc)
290 end if
291 end do
292 call this%bcs_prs%free()
293
294 call this%dm_Xh%free()
295 call this%gs_Xh%free()
296 call this%c_Xh%free()
297 call this%Xh%free()
298
299 if (associated(this%m_x)) then
300 call this%m_x%free()
301 end if
302
303 if (associated(this%m_y)) then
304 call this%m_y%free()
305 end if
306
307 if (associated(this%m_z)) then
308 call this%m_z%free()
309 end if
310
311 if (associated(this%E)) then
312 call this%E%free()
313 end if
314
315 if (associated(this%temperature)) then
316 call this%temperature%free()
317 end if
318
319 if (associated(this%max_wave_speed)) then
320 call this%max_wave_speed%free()
321 end if
322
323 if (associated(this%f_x)) then
324 call this%f_x%free()
325 deallocate(this%f_x)
326 end if
327
328 if (associated(this%f_y)) then
329 call this%f_y%free()
330 deallocate(this%f_y)
331 end if
332
333 if (associated(this%f_z)) then
334 call this%f_z%free()
335 deallocate(this%f_z)
336 end if
337
338 nullify(this%f_x)
339 nullify(this%f_y)
340 nullify(this%f_z)
341
342 nullify(this%m_x)
343 nullify(this%m_y)
344 nullify(this%m_z)
345 nullify(this%E)
346 nullify(this%temperature)
347 nullify(this%max_wave_speed)
348
349 nullify(this%u)
350 nullify(this%v)
351 nullify(this%w)
352 nullify(this%p)
353 nullify(this%rho)
354 nullify(this%mu)
355 nullify(this%kappa)
356
357 call this%material_properties%free()
358
359 end subroutine fluid_scheme_compressible_free
360
361 !> Validate field initialization and compute derived quantities
362 !> @param this The compressible fluid scheme object
364 class(fluid_scheme_compressible_t), target, intent(inout) :: this
365 integer :: n, i
366 type(field_t), pointer :: temp
367 integer :: temp_indices(1)
368
369 n = this%dm_Xh%size()
370 call neko_scratch_registry%request_field(temp, temp_indices(1), .false.)
371
372 !> Initialize the momentum field
373 call field_col3(this%m_x, this%u, this%rho)
374 call field_col3(this%m_y, this%v, this%rho)
375 call field_col3(this%m_z, this%w, this%rho)
376
377 !> Initialize total energy
378 !> Total energy E := p / (gamma - 1) + 0.5 * rho * (u^2 + v^2 + w^2)
379 call field_cmult2(this%E, this%p, 1.0_rp/(this%gamma - 1.0_rp), n)
380 call field_col3(temp, this%u, this%u, n)
381 call field_addcol3(temp, this%v, this%v, n)
382 call field_addcol3(temp, this%w, this%w, n)
383 call field_col2(temp, this%rho, n)
384 call field_cmult(temp, 0.5_rp, n)
385 call field_add2(this%E, temp, n)
386
387 !> Initialize temperature T = p / (rho * (gamma - 1))
388 do i = 1, n
389 this%temperature%x(i,1,1,1) = this%p%x(i,1,1,1) / &
390 (this%rho%x(i,1,1,1) * (this%gamma - 1.0_rp))
391 end do
392
393 call neko_scratch_registry%relinquish_field(temp_indices)
394
395 !> Compute initial maximum wave speed from initial conditions
396 call this%compute_max_wave_speed()
397
399
400 !> Set the initial condition of the density, velocity and pressure with the
401 !! user routine.
402 !! @param user Type with user-defined procedures.
404 class(fluid_scheme_compressible_t), intent(inout) :: this
405 type(user_t), intent(in) :: user
406
407 call set_flow_ic_user_compressible(this%rho, this%u, this%v, this%w, &
408 this%p, this%c_Xh, this%gs_Xh, user%initial_conditions, this%name)
409
411
412 !> Compute CFL number
413 !> @param this The compressible fluid scheme object
414 !> @param dt Current timestep size
415 !> @return Computed CFL number
416 function fluid_scheme_compressible_compute_cfl(this, dt) result(c)
417 class(fluid_scheme_compressible_t), intent(in) :: this
418 real(kind=dp), intent(in) :: dt
419 real(kind=dp) :: c
420 integer :: n
421
422 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
423 rho => this%rho, xh => this%Xh, c_xh => this%c_Xh, &
424 msh => this%msh, gamma => this%gamma, &
425 max_wave_speed => this%max_wave_speed)
426
427 n = xh%lx * xh%ly * xh%lz * msh%nelv
428
429 ! Use the compressible CFL function with precomputed maximum wave speed
430 c = cfl_compressible(dt, max_wave_speed%x, xh, c_xh, msh%nelv, msh%gdim)
431 end associate
432
434
435 !> Set material properties mu and rho
436 !> @param this The compressible fluid scheme object
437 !> @param params The case parameter file
438 !> @param user The user interface
440 params, user)
441 class(fluid_scheme_compressible_t), target, intent(inout) :: this
442 type(json_file), intent(inout) :: params
443 type(user_t), target, intent(in) :: user
444 procedure(user_material_properties_intf), pointer :: dummy_mp_ptr
445 type(time_state_t) :: dummy_time_state
446 real(kind=rp) :: const_mu, const_kappa
447
448 dummy_mp_ptr => dummy_user_material_properties
449
450 call neko_registry%add_field(this%dm_Xh, this%name // "_mu")
451 this%mu => neko_registry%get_field(this%name // "_mu")
452
453 call neko_registry%add_field(this%dm_Xh, this%name // "_kappa")
454 this%kappa => neko_registry%get_field(this%name // "_kappa")
455
456 call this%material_properties%init(3)
457 call this%material_properties%assign(1, this%rho)
458 call this%material_properties%assign(2, this%mu)
459 call this%material_properties%assign(3, this%kappa)
460
461 if (.not. associated(user%material_properties, dummy_mp_ptr)) then
462 this%user_material_properties => user%material_properties
463 this%variable_material_properties = .true.
464 call user%material_properties(this%name, this%material_properties, &
465 dummy_time_state)
466 else
467 this%variable_material_properties = .false.
468 this%user_material_properties => dummy_user_material_properties
469 call json_get_or_lookup_or_default(params, 'case.fluid.mu', const_mu, &
470 0.0_rp)
471 call json_get_or_lookup_or_default(params, 'case.fluid.kappa', &
472 const_kappa, 0.0_rp)
473
474 call field_cfill(this%mu, const_mu)
475 call field_cfill(this%kappa, const_kappa)
476 end if
477
478 ! Reported by log_solver_info, once the Fluid section is open.
479 call this%update_physical_flux()
480
482
483 !> Update variable material properties
484 !> @param this The compressible fluid scheme object
485 !> @param time The time state
488 class(fluid_scheme_compressible_t), intent(inout) :: this
489 type(time_state_t), intent(in) :: time
490
491 if (.not. this%variable_material_properties) return
492
493 call this%user_material_properties(this%name, this%material_properties, &
494 time)
495
496 call this%update_physical_flux()
497
499
500 !> Refresh the physical-flux switches from the current material properties.
501 !> @details Decides whether the physical Navier-Stokes viscous and heat
502 !> fluxes have to be evaluated at all, by testing \f$ \max_i |\mu_i| \f$
503 !> and \f$ \max_i |\kappa_i| \f$ against zero.
504 !>
505 !> On a device backend the reduction runs as a kernel over the device
506 !> resident arrays. Inspecting the host mirrors `mu%x` and `kappa%x`
507 !> instead would be wrong as well as slow: `field_cfill`, and the
508 !> `device_math` routines a user file calls, only write `%x_d`, so the
509 !> host copies stay at their initial zero and the solver would silently
510 !> degrade to Euler.
511 !>
512 !> The reduction is global, so all ranks agree on the branch taken even
513 !> when the viscosity is non-zero on only some of them.
514 !> @param this The compressible fluid scheme object
516 class(fluid_scheme_compressible_t), intent(inout) :: this
517 real(kind=rp) :: mu_amax, kappa_amax
518 integer :: n
519
520 n = this%dm_Xh%size()
521
522 if (neko_bcknd_device .eq. 1) then
523 mu_amax = device_glamax(this%mu%x_d, n)
524 kappa_amax = device_glamax(this%kappa%x_d, n)
525 else
526 mu_amax = glamax(this%mu%x, n)
527 kappa_amax = glamax(this%kappa%x, n)
528 end if
529
530 this%mu_amax = mu_amax
531 this%kappa_amax = kappa_amax
532
533 this%add_physical_stress = (mu_amax .ne. 0.0_rp)
534 this%add_physical_flux = this%add_physical_stress .or. &
535 (kappa_amax .ne. 0.0_rp)
536
537 call compressible_rhs_set_physical_flux(this%add_physical_flux, &
538 this%add_physical_stress)
539
541
542 !> Compute maximum wave speed for compressible flows
543 !> @param this The compressible fluid scheme object
545 class(fluid_scheme_compressible_t), intent(inout) :: this
546 integer :: n
547
548 n = this%u%dof%size()
549
550 !> TODO: Add support for SX
551 if (neko_bcknd_device .eq. 1) then
552 call compressible_ops_device_compute_max_wave_speed( &
553 this%max_wave_speed, this%u, this%v, this%w, this%gamma, this%p, &
554 this%rho, n)
555 else
556 call compressible_ops_cpu_compute_max_wave_speed(this%max_wave_speed%x, &
557 this%u%x, this%v%x, this%w%x, this%gamma, this%p%x, this%rho%x, n)
558 end if
559
561
562 !> Log comprehensive solver information
563 !> @param this The compressible fluid scheme object
564 !> @param params JSON configuration parameters
565 !> @param scheme Name of the numerical scheme
566 !> @param lx Polynomial order in x-direction
567 subroutine fluid_scheme_compressible_log_solver_info(this, params, scheme, lx)
568 class(fluid_scheme_compressible_t), intent(inout) :: this
569 type(json_file), intent(inout) :: params
570 character(len=*), intent(in) :: scheme
571 integer, intent(in) :: lx
572 character(len=LOG_SIZE) :: log_buf
573 logical :: logical_val
574 integer :: integer_val
575
576 call neko_log%section('Fluid')
577 write(log_buf, '(A, A)') 'Type : ', trim(scheme)
578 call neko_log%message(log_buf)
579 write(log_buf, '(A, A)') 'Name : ', trim(this%name)
580 call neko_log%message(log_buf)
581
582 ! Polynomial order
583 if (lx .lt. 10) then
584 write(log_buf, '(A, I1)') 'Poly order : ', lx-1
585 else if (lx .ge. 10) then
586 write(log_buf, '(A, I2)') 'Poly order : ', lx-1
587 else
588 write(log_buf, '(A, I3)') 'Poly order : ', lx-1
589 end if
590 call neko_log%message(log_buf)
591
592 ! Global points information
593 write(log_buf, '(A, I0)') 'GLL points : ', this%glb_n_points
594 call neko_log%message(log_buf)
595 write(log_buf, '(A, I0)') 'Unique pts.: ', this%glb_unique_points
596 call neko_log%message(log_buf)
597
598 ! Material properties
599 write(log_buf, '(A,ES13.6)') 'gamma :', this%gamma
600 call neko_log%message(log_buf)
601
602 call json_get_or_default(params, 'case.numerics.time_order', integer_val, 4)
603 write(log_buf, '(A, I0)') 'RK order : ', integer_val
604 call neko_log%message(log_buf)
605
606 call json_get_or_default(params, &
607 'case.numerics.compress_geometric_factors', logical_val, .false.)
608 write(log_buf, '(A, L1)') 'Compress G : ', logical_val
609 call neko_log%message(log_buf)
610
611 ! Physical viscosity and conductivity. For user-defined properties the
612 ! fields need not be uniform, so report the largest magnitude found.
613 if (this%variable_material_properties) then
614 write(log_buf, '(A,ES13.6,A)') 'mu :', this%mu_amax, &
615 ' (user, max)'
616 call neko_log%message(log_buf)
617 write(log_buf, '(A,ES13.6,A)') 'kappa :', this%kappa_amax, &
618 ' (user, max)'
619 call neko_log%message(log_buf)
620 else
621 write(log_buf, '(A,ES13.6)') 'mu :', this%mu_amax
622 call neko_log%message(log_buf)
623 write(log_buf, '(A,ES13.6)') 'kappa :', this%kappa_amax
624 call neko_log%message(log_buf)
625 end if
626
627 if (this%add_physical_flux) then
628 write(log_buf, '(A, A)') 'NS fluxes : ', 'enabled'
629 else
630 write(log_buf, '(A, A)') 'NS fluxes : ', &
631 'disabled (mu = kappa = 0, Euler)'
632 end if
633 call neko_log%message(log_buf)
634
635 call neko_log%end_section()
636
638
Copy data between host and device (or device and device).
Definition device.F90:72
Abstract interface to sets rho and mu.
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Compute CFL condition for compressible flow.
Abstract interface for setting material properties.
Defines a boundary condition.
Definition bc.f90:34
CPU implementation of compressible flow operations.
subroutine, public compressible_ops_cpu_compute_max_wave_speed(max_wave_speed, u, v, w, gamma, p, rho, n)
Compute maximum wave speed for compressible flows on CPU.
Device implementation of compressible flow operations.
subroutine, public compressible_ops_device_compute_max_wave_speed(max_wave_speed, u, v, w, gamma, p, rho, n)
Compute maximum wave speed for compressible flows on device.
real(kind=rp) function, public device_glamax(a_d, n, strm)
Max of the absolute value of a vector of length n.
Device abstraction, common interface for various accelerators.
Definition device.F90:34
integer, parameter, public host_to_device
Definition device.F90:48
subroutine, public field_col2(a, b, n)
Vector multiplication .
subroutine, public field_cmult2(a, b, c, n)
Multiplication by constant c .
subroutine, public field_cfill(a, c, n)
Set all elements to a constant c .
subroutine, public field_addcol3(a, b, c, n)
Returns .
subroutine, public field_add2(a, b, n)
Vector addition .
subroutine, public field_col3(a, b, c, n)
Vector multiplication with 3 vectors .
subroutine, public field_cmult(a, c, n)
Multiplication by constant c .
Defines a field.
Definition field.f90:34
Initial flow condition.
Definition flow_ic.f90:34
subroutine, public set_flow_ic_user_compressible(rho, u, v, w, p, coef, gs, user_proc, scheme_name)
Set initial flow condition (user defined) for compressible flows.
Definition flow_ic.f90:203
subroutine fluid_scheme_compressible_log_solver_info(this, params, scheme, lx)
Log comprehensive solver information.
subroutine fluid_scheme_compressible_free(this)
Free allocated memory and cleanup resources.
subroutine fluid_scheme_compressible_update_material_properties(this, time)
Update variable material properties.
subroutine fluid_scheme_compressible_set_material_properties(this, params, user)
Set material properties mu and rho.
real(kind=dp) function fluid_scheme_compressible_compute_cfl(this, dt)
Compute CFL number.
subroutine fluid_scheme_compressible_init(this, msh, lx, params, scheme, user)
Initialize common data for compressible fluid scheme.
subroutine fluid_scheme_compressible_update_physical_flux(this)
Refresh the physical-flux switches from the current material properties.
subroutine fluid_scheme_compressible_compute_max_wave_speed(this)
Compute maximum wave speed for compressible flows.
subroutine fluid_scheme_compressible_validate(this)
Validate field initialization and compute derived quantities.
subroutine fluid_scheme_compressible_set_user_initial_condition(this, user)
Set the initial condition of the density, velocity and pressure with the user routine.
Utilities for retrieving parameters from the case files.
Logging routines.
Definition log.f90:34
type(log_t), public neko_log
Global log stream.
Definition log.f90:92
integer, parameter, public log_size
Definition log.f90:46
Definition math.F90:60
real(kind=rp) function, public glamax(a, n)
Max of the absolute value of a vector of length n.
Definition math.F90:684
real(kind=rp) function, public glsum(a, n)
Sum a vector of length n.
Definition math.F90:643
Defines a mesh.
Definition mesh.f90:34
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public i8
Definition num_types.f90:7
integer, parameter, public dp
Definition num_types.f90:10
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Operators.
Definition operators.f90:34
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:158
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Defines a function space.
Definition space.f90:34
integer, parameter, public gll
Definition space.f90:50
Module with things related to the simulation time.
Interfaces for user interaction with NEKO.
Definition user_intf.f90:34
subroutine, public dummy_user_material_properties(scheme_name, properties, time)
Base type for a boundary condition.
Definition bc.f90:73
Base type of all fluid formulations.
A struct that contains all info about the time, expand as needed.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...