Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
fluid_scheme_compressible_ns.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 comm, only : neko_comm
35 use advection, only : advection_t
37 use operators, only : div, rotate_cyc
41 use math, only : col2
42 use device_math, only : device_col2
43 use field, only : field_t
47 use gather_scatter, only : gs_t
48 use num_types, only : rp
49 use mesh, only : mesh_t
50 use checkpoint, only : chkp_t
51 use json_module, only : json_file, json_core, json_value
54 use user_intf, only : user_t
56 use ax_product, only : ax_t, ax_helm_allocator
57 use coefs, only : coef_t
58 use compressible_residual, only : compressible_rhs_t, compressible_rhs_factory
61 use bc_list, only : bc_list_t
62 use bc, only : bc_t
64 use logger, only : log_size, neko_log
65 use time_state, only : time_state_t
74 use mpi_f08, only : mpi_allreduce, mpi_integer, mpi_max
75 use regularization, only : regularization_t, regularization_factory
78 implicit none
79 private
80
81 type, public, extends(fluid_scheme_compressible_t) &
83 type(field_t) :: rho_res, m_x_res, m_y_res, m_z_res, m_e_res
84 type(field_t) :: drho, dm_x, dm_y, dm_z, de
85 type(field_t) :: h
86 real(kind=rp) :: c_avisc_low
87 class(advection_t), allocatable :: adv
88 class(ax_t), allocatable :: ax
89 class(ax_t), allocatable :: ax_stress
90 class(compressible_rhs_t), allocatable :: compressible_rhs
91 type(runge_kutta_time_scheme_t) :: rk_scheme
92
93 class(regularization_t), allocatable :: regularization
94
96 type(coupled_vector_bc_projector_t):: bcs_vel_projector
98 type(bc_list_t) :: bcs_density
99
100 contains
101 procedure, pass(this) :: init => fluid_scheme_compressible_ns_init
102 procedure, pass(this) :: free => fluid_scheme_compressible_ns_free
103 procedure, pass(this) :: step => fluid_scheme_compressible_ns_step
104 procedure, pass(this) :: restart => fluid_scheme_compressible_ns_restart
106 procedure, pass(this) :: setup_bcs &
108 procedure, pass(this) :: compute_h
109 procedure, pass(this), private :: setup_regularization
111
112 interface
113
120 module subroutine density_bc_factory(object, scheme, json, coef, user)
121 class(bc_t), pointer, intent(inout) :: object
122 type(fluid_scheme_compressible_ns_t), intent(in) :: scheme
123 type(json_file), intent(inout) :: json
124 type(coef_t), intent(in) :: coef
125 type(user_t), intent(in) :: user
126 end subroutine density_bc_factory
127 end interface
128
129 interface
130
137 module subroutine pressure_bc_factory(object, scheme, json, coef, user)
138 class(bc_t), pointer, intent(inout) :: object
139 type(fluid_scheme_compressible_ns_t), intent(inout) :: scheme
140 type(json_file), intent(inout) :: json
141 type(coef_t), intent(in) :: coef
142 type(user_t), intent(in) :: user
143 end subroutine pressure_bc_factory
144 end interface
145
146 interface
147
154 module subroutine velocity_bc_factory(object, scheme, json, coef, user)
155 class(bc_t), pointer, intent(inout) :: object
156 type(fluid_scheme_compressible_ns_t), intent(in) :: scheme
157 type(json_file), intent(inout) :: json
158 type(coef_t), intent(in) :: coef
159 type(user_t), intent(in) :: user
160 end subroutine velocity_bc_factory
161 end interface
162
163contains
171 subroutine fluid_scheme_compressible_ns_init(this, msh, lx, params, user, &
172 chkp)
173 class(fluid_scheme_compressible_ns_t), target, intent(inout) :: this
174 type(mesh_t), target, intent(inout) :: msh
175 integer, intent(in) :: lx
176 type(json_file), target, intent(inout) :: params
177 type(user_t), target, intent(in) :: user
178 type(chkp_t), target, intent(inout) :: chkp
179 character(len=12), parameter :: scheme = 'compressible'
180 integer :: rk_order
181
182 call this%free()
183
184 ! Initialize base class
185 call this%scheme_init(msh, lx, params, scheme, user)
186
187 call compressible_rhs_factory(this%compressible_rhs, this%gamma)
188
189 associate(xh_lx => this%Xh%lx, xh_ly => this%Xh%ly, xh_lz => this%Xh%lz, &
190 dm_xh => this%dm_Xh, nelv => this%msh%nelv)
191
192 call this%drho%init(dm_xh, 'drho')
193 call this%dm_x%init(dm_xh, 'dm_x')
194 call this%dm_y%init(dm_xh, 'dm_y')
195 call this%dm_z%init(dm_xh, 'dm_z')
196 call this%dE%init(dm_xh, 'dE')
197 call this%h%init(dm_xh, 'h')
198
199 end associate
200
201 if (neko_bcknd_device .eq. 1) then
202 associate(p => this%p, rho => this%rho, &
203 u => this%u, v => this%v, w => this%w, &
204 m_x => this%m_x, m_y => this%m_y, m_z => this%m_z, &
205 artificial_visc => this%artificial_visc)
206 call device_memcpy(p%x, p%x_d, p%dof%size(), &
207 host_to_device, sync = .false.)
208 call device_memcpy(rho%x, rho%x_d, rho%dof%size(), &
209 host_to_device, sync = .false.)
210 call device_memcpy(u%x, u%x_d, u%dof%size(), &
211 host_to_device, sync = .false.)
212 call device_memcpy(v%x, v%x_d, v%dof%size(), &
213 host_to_device, sync = .false.)
214 call device_memcpy(w%x, w%x_d, w%dof%size(), &
215 host_to_device, sync = .false.)
216 call device_memcpy(m_x%x, m_x%x_d, m_x%dof%size(), &
217 host_to_device, sync = .false.)
218 call device_memcpy(m_y%x, m_y%x_d, m_y%dof%size(), &
219 host_to_device, sync = .false.)
220 call device_memcpy(m_z%x, m_z%x_d, m_z%dof%size(), &
221 host_to_device, sync = .false.)
222 call device_memcpy(artificial_visc%x, artificial_visc%x_d, &
223 artificial_visc%dof%size(), host_to_device, sync = .false.)
224 end associate
225 end if
226
227 ! Initialize the diffusion operators
228 call ax_helm_allocator(this%Ax, type_name = "standard")
229 call ax_helm_allocator(this%Ax_stress, type_name = "full")
230
231 ! Initialize the velocity BC projector. The coupled projector builds the
232 ! local bases required by non-axis aligned mixed velocity conditions.
233 call this%bcs_vel_projector%init(this%c_Xh)
234
235 ! Compute h
236 call this%compute_h()
237
238 ! Initialize regularization
239 call this%setup_regularization(params)
240
241 ! Initialize Runge-Kutta scheme
242 call json_get_or_default(params, 'case.numerics.time_order', rk_order, 4)
243 call this%rk_scheme%init(rk_order)
244
245 call neko_log%section("Fluid boundary conditions")
246 ! Set up boundary conditions
247 call this%setup_bcs(user, params)
248 call neko_log%end_section()
249
250 end subroutine fluid_scheme_compressible_ns_init
251
254 subroutine fluid_scheme_compressible_ns_free(this)
255 class(fluid_scheme_compressible_ns_t), intent(inout) :: this
256 class(bc_t), pointer :: bc
257 integer :: i
258
259 call this%scheme_free()
260
261 if (allocated(this%Ax)) then
262 deallocate(this%Ax)
263 end if
264
265 if (allocated(this%Ax_stress)) then
266 deallocate(this%Ax_stress)
267 end if
268
269 if (allocated(this%compressible_rhs)) then
270 deallocate(this%compressible_rhs)
271 end if
272
273 call this%drho%free()
274 call this%dm_x%free()
275 call this%dm_y%free()
276 call this%dm_z%free()
277 call this%dE%free()
278 call this%h%free()
279
280 if (allocated(this%regularization)) then
281 call this%regularization%free()
282 deallocate(this%regularization)
283 end if
284
285 do i = 1, this%bcs_density%size()
286 bc => this%bcs_density%get(i)
287 if (associated(bc)) then
288 call bc%free()
289 deallocate(bc)
290 end if
291 end do
292 call this%bcs_density%free()
293 call this%bcs_vel_projector%free()
294
295 end subroutine fluid_scheme_compressible_ns_free
296
302 subroutine fluid_scheme_compressible_ns_step(this, time, dt_controller)
304 class(fluid_scheme_compressible_ns_t), target, intent(inout) :: this
305 type(time_state_t), intent(in) :: time
306 type(time_step_controller_t), intent(in) :: dt_controller
307 type(field_t), pointer :: temp
308 integer :: temp_indices(1)
309 ! number of degrees of freedom
310 integer :: n
311 integer :: i
312 class(bc_t), pointer :: b
313
314 n = this%dm_Xh%size()
315 call neko_scratch_registry%request_field(temp, temp_indices(1), .false.)
316 b => null()
317
318 call profiler_start_region('Fluid compressible', 1)
319 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
320 m_x=> this%m_x, m_y => this%m_y, m_z => this%m_z, &
321 xh => this%Xh, msh => this%msh, ax => this%Ax, &
322 c_xh => this%c_Xh, dm_xh => this%dm_Xh, gs_xh => this%gs_Xh, &
323 e => this%E, rho => this%rho, mu => this%mu, &
324 f_x => this%f_x, f_y => this%f_y, f_z => this%f_z, &
325 drho => this%drho, dm_x => this%dm_x, dm_y => this%dm_y, &
326 dm_z => this%dm_z, de => this%dE, &
327 compressible_rhs => this%compressible_rhs, h => this%h, &
328 t => time%t, tstep => time%tstep, dt => time%dt, &
329 c_avisc_low => this%c_avisc_low, rk_scheme => this%rk_scheme)
330
331 ! Compute artificial viscosity
332 call this%regularization%compute(time)
333
334 ! Refresh user-specified physical viscosity/conductivity before RHS.
335 call this%update_material_properties(time)
336
337 ! Execute RHS step with artificial viscosity field
338 call compressible_rhs%step(rho, m_x, m_y, m_z, e, &
339 p, u, v, w, this%Ax, &
340 this%Ax_stress, c_xh, gs_xh, h, this%artificial_visc, this%mu, &
341 this%kappa, this%bcs_vel, time, rk_scheme, real(dt, kind=rp))
342
344 call this%bcs_density%apply(rho, time)
345
347 ! Update u, v, w
348 if (neko_bcknd_device .eq. 1) then
349 call compressible_ops_device_update_uvw(u%x_d, v%x_d, w%x_d, &
350 m_x%x_d, m_y%x_d, m_z%x_d, rho%x_d, n)
351 else
352 call compressible_ops_cpu_update_uvw(u%x, v%x, w%x, &
353 m_x%x, m_y%x, m_z%x, rho%x, n)
354 end if
355
357 call this%bcs_vel%apply_vector(u%x, v%x, w%x, &
358 dm_xh%size(), time, strong = .true.)
359
361 if (neko_bcknd_device .eq. 1) then
362 call compressible_ops_device_update_mxyz_p_ruvw(m_x%x_d, m_y%x_d, &
363 m_z%x_d, p%x_d, temp%x_d, u%x_d, v%x_d, w%x_d, e%x_d, &
364 rho%x_d, this%gamma, n)
365 else
366 call compressible_ops_cpu_update_mxyz_p_ruvw(m_x%x, m_y%x, m_z%x, &
367 p%x, temp%x, u%x, v%x, w%x, e%x, rho%x, this%gamma, n)
368 end if
369
371 call this%bcs_prs%apply(p, time)
372
373
375 if (neko_bcknd_device .eq. 1) then
376 call compressible_ops_device_update_e(e%x_d, p%x_d, &
377 temp%x_d, this%gamma, n)
378 else
379 call compressible_ops_cpu_update_e(e%x, p%x, temp%x, this%gamma, n)
380 end if
381
383 if (neko_bcknd_device .eq. 1) then
384 call compressible_ops_device_update_temperature( &
385 this%temperature%x_d, p%x_d, rho%x_d, this%gamma, n)
386 else
387 !OCL NORECURRENCE, NOVREC, NOALIAS
388 !DIR$ CONCURRENT
389 !DIR$ IVDEP
390 !GCC$ ivdep
391 !$omp parallel do simd
392 do i = 1, n
393 this%temperature%x(i,1,1,1) = p%x(i,1,1,1) / &
394 (rho%x(i,1,1,1) * (this%gamma - 1.0_rp))
395 end do
396 !$omp end parallel do simd
397 end if
398
402 if (allocated(this%regularization)) then
403 select type (reg => this%regularization)
404 type is (entropy_viscosity_t)
405 call reg%update_lag()
406 end select
407 end if
408
410 call this%compute_entropy()
411
413 call this%compute_max_wave_speed()
414
415 do i = 1, this%bcs_vel%size()
416 b => this%bcs_vel%get(i)
417 b%updated = .false.
418 end do
419
420 do i = 1, this%bcs_prs%size()
421 b => this%bcs_prs%get(i)
422 b%updated = .false.
423 end do
424
425 do i = 1, this%bcs_density%size()
426 b => this%bcs_density%get(i)
427 b%updated = .false.
428 end do
429 nullify(b)
430
431 end associate
432 call profiler_end_region('Fluid compressible', 1)
433
434 call neko_scratch_registry%relinquish_field(temp_indices)
435
436 end subroutine fluid_scheme_compressible_ns_step
437
442 subroutine fluid_scheme_compressible_ns_setup_bcs(this, user, params)
443 class(fluid_scheme_compressible_ns_t), target, intent(inout) :: this
444 type(user_t), target, intent(in) :: user
445 type(json_file), intent(inout) :: params
446 integer :: i, n_bcs, zone_index, j, zone_size, global_zone_size, ierr
447 class(bc_t), pointer :: bc_i
448 type(json_core) :: core
449 type(json_value), pointer :: bc_object
450 type(json_file) :: bc_subdict
451 logical :: found
452 integer, allocatable :: zone_indices(:)
453 character(len=LOG_SIZE) :: log_buf
454
455 ! Process boundary conditions
456 if (params%valid_path('case.fluid.boundary_conditions')) then
457 call params%info('case.fluid.boundary_conditions', n_children = n_bcs)
458 call params%get_core(core)
459 call params%get('case.fluid.boundary_conditions', bc_object, found)
460
461 !
462 ! Velocity bcs
463 !
464 call this%bcs_vel%init(n_bcs)
465
466 do i = 1, n_bcs
467 ! Extract BC configuration
468 call json_extract_item(core, bc_object, i, bc_subdict)
469 call json_get(bc_subdict, "zone_indices", zone_indices)
470
471 ! Validate zones
472 do j = 1, size(zone_indices)
473 zone_size = this%msh%labeled_zones(zone_indices(j))%size
474 call mpi_allreduce(zone_size, global_zone_size, 1, &
475 mpi_integer, mpi_max, neko_comm, ierr)
476
477 if (global_zone_size .eq. 0) then
478 write(log_buf, '(A,I0,A)') "Error: Zone ", zone_indices(j), &
479 " has zero size"
480 call neko_error(log_buf)
481 end if
482 end do
483
484 ! Create BC
485 bc_i => null()
486 call velocity_bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
487
488 ! Add to appropriate lists
489 if (associated(bc_i)) then
490 call this%bcs_vel_projector%mark(bc_i)
491 call this%bcs_vel%append(bc_i)
492 end if
493 end do
494
495 !
496 ! Pressure bcs
497 !
498 call this%bcs_prs%init(n_bcs)
499
500 do i = 1, n_bcs
501 ! Create a new json containing just the subdict for this bc
502 call json_extract_item(core, bc_object, i, bc_subdict)
503 bc_i => null()
504 call pressure_bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
505
506 ! Not all bcs require an allocation for pressure in particular,
507 ! so we check.
508 if (associated(bc_i)) then
509 call this%bcs_prs%append(bc_i)
510 end if
511 end do
512
513 !
514 ! Density bcs
515 !
516 call this%bcs_density%init(n_bcs)
517
518 do i = 1, n_bcs
519 ! Create a new json containing just the subdict for this bc
520 call json_extract_item(core, bc_object, i, bc_subdict)
521 bc_i => null()
522 call density_bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
523
524 ! Not all bcs require an allocation for pressure in particular,
525 ! so we check.
526 if (associated(bc_i)) then
527 call this%bcs_density%append(bc_i)
528 end if
529 end do
530 else
531 ! Check that there are no labeled zones, i.e. all are periodic.
532 do i = 1, size(this%msh%labeled_zones)
533 if (this%msh%labeled_zones(i)%size .gt. 0) then
534 call neko_error("No boundary_conditions entry in the case file!")
535 end if
536 end do
537
538 ! For a pure periodic case, we still need to initilise the bc lists
539 ! to a zero size to avoid issues with apply() in step()
540 call this%bcs_prs%init()
541 call this%bcs_vel%init()
542 call this%bcs_density%init()
543
544 end if
545
546 call this%bcs_vel_projector%finalize(rebuild_mask = .true.)
547 end subroutine fluid_scheme_compressible_ns_setup_bcs
548
553 subroutine compute_h(this)
554 class(fluid_scheme_compressible_ns_t), intent(inout) :: this
555 integer :: lx, ly, lz
556
557 lx = this%c_Xh%Xh%lx
558 ly = this%c_Xh%Xh%ly
559 lz = this%c_Xh%Xh%lz
560 call compute_h_cpu(this%h%x, this%c_Xh%dof%x, this%c_Xh%dof%y, &
561 this%c_Xh%dof%z, lx, ly, lz, this%c_Xh%msh%nelv)
562
563 if (neko_bcknd_device .eq. 1) then
564 call device_memcpy(this%h%x, this%h%x_d, this%h%dof%size(),&
565 host_to_device, sync = .false.)
566 call this%gs_Xh%op(this%h, gs_op_add)
567 call device_col2(this%h%x_d, this%c_Xh%mult_d, this%h%dof%size())
568 else
569 call this%gs_Xh%op(this%h, gs_op_add)
570 call col2(this%h%x, this%c_Xh%mult, this%h%dof%size())
571 end if
572
573 end subroutine compute_h
574
575 subroutine compute_h_cpu(h, x, y, z, lx, ly, lz, nelv)
576 integer, intent(in) :: lx, ly, lz, nelv
577 real(kind=rp), intent(out) :: h(lx, ly, lz, nelv)
578 real(kind=rp), intent(in) :: x(lx, ly, lz, nelv)
579 real(kind=rp), intent(in) :: y(lx, ly, lz, nelv)
580 real(kind=rp), intent(in) :: z(lx, ly, lz, nelv)
581 integer :: e, i, j, k
582 integer :: im, ip, jm, jp, km, kp
583 real(kind=rp) :: di, dj, dk
584
585 !$omp parallel do private(i, j, k, im, ip, jm, jp, km, kp, di, dj, dk)
586 do e = 1, nelv
587 do k = 1, lz
588 km = max(1, k - 1)
589 kp = min(lz, k + 1)
590 do j = 1, ly
591 jm = max(1, j - 1)
592 jp = min(ly, j + 1)
593 do i = 1, lx
594 im = max(1, i - 1)
595 ip = min(lx, i + 1)
596
597 di = (x(ip, j, k, e) - x(im, j, k, e))**2 &
598 + (y(ip, j, k, e) - y(im, j, k, e))**2 &
599 + (z(ip, j, k, e) - z(im, j, k, e))**2
600
601 dj = (x(i, jp, k, e) - x(i, jm, k, e))**2 &
602 + (y(i, jp, k, e) - y(i, jm, k, e))**2 &
603 + (z(i, jp, k, e) - z(i, jm, k, e))**2
604
605 dk = (x(i, j, kp, e) - x(i, j, km, e))**2 &
606 + (y(i, j, kp, e) - y(i, j, km, e))**2 &
607 + (z(i, j, kp, e) - z(i, j, km, e))**2
608
609 di = sqrt(di) / (ip - im)
610 dj = sqrt(dj) / (jp - jm)
611 dk = sqrt(dk) / (kp - km)
612 h(i,j,k,e) = (di * dj * dk)**(1.0_rp / 3.0_rp)
613 end do
614 end do
615 end do
616 end do
617 !$omp end parallel do
618 end subroutine compute_h_cpu
619
624 subroutine fluid_scheme_compressible_ns_restart(this, chkp)
625 class(fluid_scheme_compressible_ns_t), target, intent(inout) :: this
626 type(chkp_t), intent(inout) :: chkp
627 end subroutine fluid_scheme_compressible_ns_restart
628
629 subroutine setup_regularization(this, params)
632 class(fluid_scheme_compressible_ns_t), target, intent(inout) :: this
633 type(json_file), intent(inout) :: params
634 type(json_file) :: reg_json
635 type(json_core) :: json_core_inst
636 type(json_value), pointer :: reg_params
637 character(len=:), allocatable :: buffer
638 real(kind=rp) :: c_avisc_entropy_val
639 character(len=:), allocatable :: regularization_type
640
641 call json_get_or_default(params, 'case.numerics.c_avisc_low', &
642 this%c_avisc_low, 0.5_rp)
643 call json_get_or_default(params, 'case.numerics.c_avisc_entropy', &
644 c_avisc_entropy_val, 1.0_rp)
645
646 call json_core_inst%initialize()
647 call json_core_inst%create_object(reg_params, '')
648 call json_core_inst%add(reg_params, 'c_avisc_entropy', c_avisc_entropy_val)
649 call json_core_inst%add(reg_params, 'c_avisc_low', this%c_avisc_low)
650 call json_core_inst%print_to_string(reg_params, buffer)
651 call json_core_inst%destroy(reg_params)
652
653 call reg_json%initialize()
654 call reg_json%load_from_string(buffer)
655
656 regularization_type = 'entropy_viscosity'
657
658 call regularization_factory(this%regularization, regularization_type, &
659 reg_json, this%c_Xh, this%dm_Xh, this%artificial_visc)
660
661 select type (reg => this%regularization)
662 type is (entropy_viscosity_t)
663 call entropy_viscosity_set_fields(reg, this%S, this%u, this%v, this%w, &
664 this%h, this%max_wave_speed, this%msh, this%Xh, this%gs_Xh)
665 end select
666
667 call reg_json%destroy()
668
669 end subroutine setup_regularization
670
double real
Abstract interface to evaluate rhs.
Copy data between host and device (or device and device)
Definition device.F90:72
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Compute the divergence of a vector field.
Definition operators.f90:86
Apply cyclic boundary condition to a vector field.
Subroutines to add advection terms to the RHS of a transport equation.
Definition advection.f90:34
Defines a Matrix-vector product.
Definition ax.f90:34
Defines a list of bc_t.
Definition bc_list.f90:34
Defines a boundary condition.
Definition bc.f90:34
Backward-differencing scheme for time integration.
Generic buffer that is extended with buffers of varying rank.
Definition buffer.F90:34
Defines a checkpoint.
Coefficients.
Definition coef.f90:34
Definition comm.F90:1
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:46
CPU implementation of compressible flow operations.
subroutine, public compressible_ops_cpu_update_uvw(u, v, w, m_x, m_y, m_z, rho, n)
Update u,v,w fields.
subroutine, public compressible_ops_cpu_update_e(e, p, ruvw, gamma, n)
Update E field.
subroutine, public compressible_ops_cpu_update_mxyz_p_ruvw(m_x, m_y, m_z, p, ruvw, u, v, w, e, rho, gamma, n)
Update m_x, m_y, m_z, p, ruvw, fields.
Device implementation of compressible flow operations.
subroutine, public compressible_ops_device_update_uvw(u_d, v_d, w_d, m_x_d, m_y_d, m_z_d, rho_d, n)
Update u,v,w fields.
subroutine, public compressible_ops_device_update_temperature(t_d, p_d, rho_d, gamma, n)
Update temperature field.
subroutine, public compressible_ops_device_update_mxyz_p_ruvw(m_x_d, m_y_d, m_z_d, p_d, ruvw_d, u_d, v_d, w_d, e_d, rho_d, gamma, n)
Update m_x, m_y, m_z, p, ruvw, fields.
subroutine, public compressible_ops_device_update_e(e_d, p_d, ruvw_d, gamma, n)
Update E field.
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
Device abstraction, common interface for various accelerators.
Definition device.F90:34
integer, parameter, public host_to_device
Definition device.F90:48
subroutine, public entropy_viscosity_set_fields(this, s, u, v, w, h, max_wave_speed, msh, xh, gs)
Contains the field_serties_t type.
Defines a field.
Definition field.f90:34
subroutine compute_h(this)
Copied from les_model_compute_delta in les_model.f90 TODO: move to a separate module Compute characte...
subroutine fluid_scheme_compressible_ns_restart(this, chkp)
Restart the simulation from saved state.
subroutine fluid_scheme_compressible_ns_step(this, time, dt_controller)
Advance the fluid simulation one timestep.
subroutine fluid_scheme_compressible_ns_free(this)
Free allocated memory and cleanup.
subroutine fluid_scheme_compressible_ns_init(this, msh, lx, params, user, chkp)
Boundary condition factory for density.
subroutine fluid_scheme_compressible_ns_setup_bcs(this, user, params)
Set up boundary conditions for the fluid scheme.
Gather-scatter.
Defines Gather-scatter operations.
Definition gs_ops.f90:34
integer, parameter, public gs_op_add
Definition gs_ops.f90:36
integer, parameter, public gs_op_max
Definition gs_ops.f90:36
integer, parameter, public gs_op_min
Definition gs_ops.f90:36
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:80
integer, parameter, public log_size
Definition log.f90:46
Definition math.f90:60
subroutine, public col2(a, b, n)
Vector multiplication .
Definition math.f90:1049
Defines a mesh.
Definition mesh.f90:34
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Operators.
Definition operators.f90:34
Profiling interface.
Definition profiler.F90:34
subroutine, public profiler_start_region(name, region_id)
Started a named (name) profiler region.
Definition profiler.F90:79
subroutine, public profiler_end_region(name, region_id)
End the most recently started profiler region.
Definition profiler.F90:116
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.
Compound scheme for the advection and diffusion operators in a transport equation.
Module with things related to the simulation time.
Implements type time_step_controller.
Interfaces for user interaction with NEKO.
Definition user_intf.f90:34
Utilities.
Definition utils.f90:35
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Definition utils.f90:365
Implements boundary condition projectors for vector fields. Two types concrete types are provided: se...
Base abstract type for computing the advection operator.
Definition advection.f90:46
Base type for a matrix-vector product providing .
Definition ax.f90:43
Base type for a boundary condition.
Definition bc.f90:72
A list of allocatable `bc_t`. Follows the standard interface of lists.
Definition bc_list.f90:49
Implicit backward-differencing scheme for time integration.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:93
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
Gather-scatter kernel.
Implements the logic to compute the time coefficients for the advection and diffusion operators in a ...
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...
A coupled projector for vector fields, suitable for mixed boundary conditions.
Abstract type for resolving vector boundary conditions.
#define max(a, b)
Definition tensor.cu:40