Neko 1.99.11
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 The fluid parameters, i.e. `case.fluid`
140 !> @param numerics_params The numerical parameters, i.e. `case.numerics`
141 !> @param scheme Name of the numerical scheme
142 !> @param user User-defined parameters and functions
143 subroutine fluid_scheme_compressible_init(this, msh, lx, params, &
144 numerics_params, scheme, user)
145 class(fluid_scheme_compressible_t), target, intent(inout) :: this
146 type(mesh_t), target, intent(inout) :: msh
147 integer, intent(in) :: lx
148 type(json_file), target, intent(inout) :: params
149 type(json_file), target, intent(inout) :: numerics_params
150 character(len=*), intent(in) :: scheme
151 type(user_t), target, intent(in) :: user
152 logical :: compress_geo
153 real(kind=rp) :: compress_tol
154
155 !
156 ! SEM simulation fundamentals
157 !
158
159 this%msh => msh
160
161 if (msh%gdim .eq. 2) then
162 call this%Xh%init(gll, lx, lx)
163 else
164 call this%Xh%init(gll, lx, lx, lx)
165 end if
166
167 call this%dm_Xh%init(msh, this%Xh)
168
169 call this%gs_Xh%init(this%dm_Xh)
170
171 call this%c_Xh%init(this%gs_Xh)
172
173 ! Assign Dofmap to scratch registry
174 call neko_scratch_registry%set_dofmap(this%dm_Xh)
175
176 ! Assign a name
177 call json_get_or_default(params, '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, '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(numerics_params, scheme, lx)
252
253 ! Compressed geometric factors, read by the standard Helmholtz operator
254 call json_get_or_default(numerics_params, &
255 'compress_geometric_factors', compress_geo, .false.)
256 if (compress_geo) then
257 if (numerics_params%valid_path( &
258 'compress_geometric_factors_tolerance')) then
259 call json_get_or_lookup(numerics_params, &
260 'compress_geometric_factors_tolerance', compress_tol)
261 call this%c_Xh%enable_geo_compression(compress_tol)
262 else
263 call this%c_Xh%enable_geo_compression()
264 end if
265 end if
266 end subroutine fluid_scheme_compressible_init
267
268 !> Free allocated memory and cleanup resources
269 !> @param this The compressible fluid scheme object to destroy
271 class(fluid_scheme_compressible_t), intent(inout) :: this
272 class(bc_t), pointer :: bc
273 integer :: i
274
275 do i = 1, this%bcs_vel%size()
276 bc => this%bcs_vel%get(i)
277 if (associated(bc)) then
278 call bc%free()
279 deallocate(bc)
280 end if
281 end do
282 call this%bcs_vel%free()
283
284 do i = 1, this%bcs_prs%size()
285 bc => this%bcs_prs%get(i)
286 if (associated(bc)) then
287 call bc%free()
288 deallocate(bc)
289 end if
290 end do
291 call this%bcs_prs%free()
292
293 call this%dm_Xh%free()
294 call this%gs_Xh%free()
295 call this%c_Xh%free()
296 call this%Xh%free()
297
298 if (associated(this%m_x)) then
299 call this%m_x%free()
300 end if
301
302 if (associated(this%m_y)) then
303 call this%m_y%free()
304 end if
305
306 if (associated(this%m_z)) then
307 call this%m_z%free()
308 end if
309
310 if (associated(this%E)) then
311 call this%E%free()
312 end if
313
314 if (associated(this%temperature)) then
315 call this%temperature%free()
316 end if
317
318 if (associated(this%max_wave_speed)) then
319 call this%max_wave_speed%free()
320 end if
321
322 if (associated(this%f_x)) then
323 call this%f_x%free()
324 deallocate(this%f_x)
325 end if
326
327 if (associated(this%f_y)) then
328 call this%f_y%free()
329 deallocate(this%f_y)
330 end if
331
332 if (associated(this%f_z)) then
333 call this%f_z%free()
334 deallocate(this%f_z)
335 end if
336
337 nullify(this%f_x)
338 nullify(this%f_y)
339 nullify(this%f_z)
340
341 nullify(this%m_x)
342 nullify(this%m_y)
343 nullify(this%m_z)
344 nullify(this%E)
345 nullify(this%temperature)
346 nullify(this%max_wave_speed)
347
348 nullify(this%u)
349 nullify(this%v)
350 nullify(this%w)
351 nullify(this%p)
352 nullify(this%rho)
353 nullify(this%mu)
354 nullify(this%kappa)
355
356 call this%material_properties%free()
357
358 end subroutine fluid_scheme_compressible_free
359
360 !> Validate field initialization and compute derived quantities
361 !> @param this The compressible fluid scheme object
363 class(fluid_scheme_compressible_t), target, intent(inout) :: this
364 integer :: n, i
365 type(field_t), pointer :: temp
366 integer :: temp_indices(1)
367
368 n = this%dm_Xh%size()
369 call neko_scratch_registry%request_field(temp, temp_indices(1), .false.)
370
371 !> Initialize the momentum field
372 call field_col3(this%m_x, this%u, this%rho)
373 call field_col3(this%m_y, this%v, this%rho)
374 call field_col3(this%m_z, this%w, this%rho)
375
376 !> Initialize total energy
377 !> Total energy E := p / (gamma - 1) + 0.5 * rho * (u^2 + v^2 + w^2)
378 call field_cmult2(this%E, this%p, 1.0_rp/(this%gamma - 1.0_rp), n)
379 call field_col3(temp, this%u, this%u, n)
380 call field_addcol3(temp, this%v, this%v, n)
381 call field_addcol3(temp, this%w, this%w, n)
382 call field_col2(temp, this%rho, n)
383 call field_cmult(temp, 0.5_rp, n)
384 call field_add2(this%E, temp, n)
385
386 !> Initialize temperature T = p / (rho * (gamma - 1))
387 do i = 1, n
388 this%temperature%x(i,1,1,1) = this%p%x(i,1,1,1) / &
389 (this%rho%x(i,1,1,1) * (this%gamma - 1.0_rp))
390 end do
391
392 call neko_scratch_registry%relinquish_field(temp_indices)
393
394 !> Compute initial maximum wave speed from initial conditions
395 call this%compute_max_wave_speed()
396
398
399 !> Set the initial condition of the density, velocity and pressure with the
400 !! user routine.
401 !! @param user Type with user-defined procedures.
403 class(fluid_scheme_compressible_t), intent(inout) :: this
404 type(user_t), intent(in) :: user
405
406 call set_flow_ic_user_compressible(this%rho, this%u, this%v, this%w, &
407 this%p, this%c_Xh, this%gs_Xh, user%initial_conditions, this%name)
408
410
411 !> Compute CFL number
412 !> @param this The compressible fluid scheme object
413 !> @param dt Current timestep size
414 !> @return Computed CFL number
415 function fluid_scheme_compressible_compute_cfl(this, dt) result(c)
416 class(fluid_scheme_compressible_t), intent(in) :: this
417 real(kind=dp), intent(in) :: dt
418 real(kind=dp) :: c
419 integer :: n
420
421 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
422 rho => this%rho, xh => this%Xh, c_xh => this%c_Xh, &
423 msh => this%msh, gamma => this%gamma, &
424 max_wave_speed => this%max_wave_speed)
425
426 n = xh%lx * xh%ly * xh%lz * msh%nelv
427
428 ! Use the compressible CFL function with precomputed maximum wave speed
429 c = cfl_compressible(dt, max_wave_speed%x, xh, c_xh, msh%nelv, msh%gdim)
430 end associate
431
433
434 !> Set material properties mu and rho
435 !> @param this The compressible fluid scheme object
436 !> @param params The case parameter file
437 !> @param user The user interface
439 params, user)
440 class(fluid_scheme_compressible_t), target, intent(inout) :: this
441 type(json_file), intent(inout) :: params
442 type(user_t), target, intent(in) :: user
443 procedure(user_material_properties_intf), pointer :: dummy_mp_ptr
444 type(time_state_t) :: dummy_time_state
445 real(kind=rp) :: const_mu, const_kappa
446
447 dummy_mp_ptr => dummy_user_material_properties
448
449 call neko_registry%add_field(this%dm_Xh, this%name // "_mu")
450 this%mu => neko_registry%get_field(this%name // "_mu")
451
452 call neko_registry%add_field(this%dm_Xh, this%name // "_kappa")
453 this%kappa => neko_registry%get_field(this%name // "_kappa")
454
455 call this%material_properties%init(3)
456 call this%material_properties%assign(1, this%rho)
457 call this%material_properties%assign(2, this%mu)
458 call this%material_properties%assign(3, this%kappa)
459
460 if (.not. associated(user%material_properties, dummy_mp_ptr)) then
461 this%user_material_properties => user%material_properties
462 this%variable_material_properties = .true.
463 call user%material_properties(this%name, this%material_properties, &
464 dummy_time_state)
465 else
466 this%variable_material_properties = .false.
467 this%user_material_properties => dummy_user_material_properties
468 call json_get_or_lookup_or_default(params, 'mu', const_mu, &
469 0.0_rp)
470 call json_get_or_lookup_or_default(params, 'kappa', &
471 const_kappa, 0.0_rp)
472
473 call field_cfill(this%mu, const_mu)
474 call field_cfill(this%kappa, const_kappa)
475 end if
476
477 ! Reported by log_solver_info, once the Fluid section is open.
478 call this%update_physical_flux()
479
481
482 !> Update variable material properties
483 !> @param this The compressible fluid scheme object
484 !> @param time The time state
487 class(fluid_scheme_compressible_t), intent(inout) :: this
488 type(time_state_t), intent(in) :: time
489
490 if (.not. this%variable_material_properties) return
491
492 call this%user_material_properties(this%name, this%material_properties, &
493 time)
494
495 call this%update_physical_flux()
496
498
499 !> Refresh the physical-flux switches from the current material properties.
500 !> @details Decides whether the physical Navier-Stokes viscous and heat
501 !> fluxes have to be evaluated at all, by testing \f$ \max_i |\mu_i| \f$
502 !> and \f$ \max_i |\kappa_i| \f$ against zero.
503 !>
504 !> On a device backend the reduction runs as a kernel over the device
505 !> resident arrays. Inspecting the host mirrors `mu%x` and `kappa%x`
506 !> instead would be wrong as well as slow: `field_cfill`, and the
507 !> `device_math` routines a user file calls, only write `%x_d`, so the
508 !> host copies stay at their initial zero and the solver would silently
509 !> degrade to Euler.
510 !>
511 !> The reduction is global, so all ranks agree on the branch taken even
512 !> when the viscosity is non-zero on only some of them.
513 !> @param this The compressible fluid scheme object
515 class(fluid_scheme_compressible_t), intent(inout) :: this
516 real(kind=rp) :: mu_amax, kappa_amax
517 integer :: n
518
519 n = this%dm_Xh%size()
520
521 if (neko_bcknd_device .eq. 1) then
522 mu_amax = device_glamax(this%mu%x_d, n)
523 kappa_amax = device_glamax(this%kappa%x_d, n)
524 else
525 mu_amax = glamax(this%mu%x, n)
526 kappa_amax = glamax(this%kappa%x, n)
527 end if
528
529 this%mu_amax = mu_amax
530 this%kappa_amax = kappa_amax
531
532 this%add_physical_stress = (mu_amax .ne. 0.0_rp)
533 this%add_physical_flux = this%add_physical_stress .or. &
534 (kappa_amax .ne. 0.0_rp)
535
536 call compressible_rhs_set_physical_flux(this%add_physical_flux, &
537 this%add_physical_stress)
538
540
541 !> Compute maximum wave speed for compressible flows
542 !> @param this The compressible fluid scheme object
544 class(fluid_scheme_compressible_t), intent(inout) :: this
545 integer :: n
546
547 n = this%u%dof%size()
548
549 !> TODO: Add support for SX
550 if (neko_bcknd_device .eq. 1) then
551 call compressible_ops_device_compute_max_wave_speed( &
552 this%max_wave_speed, this%u, this%v, this%w, this%gamma, this%p, &
553 this%rho, n)
554 else
555 call compressible_ops_cpu_compute_max_wave_speed(this%max_wave_speed%x, &
556 this%u%x, this%v%x, this%w%x, this%gamma, this%p%x, this%rho%x, n)
557 end if
558
560
561 !> Log comprehensive solver information
562 !> @param this The compressible fluid scheme object
563 !> @param numerics_params The numerical parameters, i.e. `case.numerics`
564 !> @param scheme Name of the numerical scheme
565 !> @param lx Polynomial order in x-direction
566 subroutine fluid_scheme_compressible_log_solver_info(this, numerics_params, &
567 scheme, lx)
568 class(fluid_scheme_compressible_t), intent(inout) :: this
569 type(json_file), intent(inout) :: numerics_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(numerics_params, '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(numerics_params, &
607 '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_init(this, msh, lx, params, numerics_params, scheme, user)
Initialize common data for compressible fluid scheme.
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_update_physical_flux(this)
Refresh the physical-flux switches from the current material properties.
subroutine fluid_scheme_compressible_log_solver_info(this, numerics_params, scheme, lx)
Log comprehensive solver information.
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...