41 pnpn_prs_res_factory, pnpn_vel_res_factory, &
42 pnpn_prs_res_stress_factory, pnpn_vel_res_stress_factory
45 rhs_maker_ext_fctry, rhs_maker_oifs_fctry
57 use json_module,
only : json_file, json_core, json_value
95 use mpi_f08,
only : mpi_allreduce, mpi_in_place, mpi_max, mpi_lor, &
96 mpi_integer, mpi_logical
106 integer :: schwarz_iterations = 0
122 class(
ax_t),
allocatable :: ax_vel
124 class(
ax_t),
allocatable :: ax_prs
152 logical :: prs_dirichlet = .false.
190 logical :: full_stress_formulation = .false.
202 procedure, pass(this) :: recompute_metrics => &
205 procedure, pass(this) :: update_velocity_lags => &
213 procedure, pass(this) :: set_initial_condition => &
218 procedure, pass(this) :: write_boundary_conditions => &
230 module subroutine fluid_pnpn_bc_split(json, velocity_json, &
231 pressure_json, has_velocity, has_pressure)
232 type(json_file),
intent(inout) :: json
233 type(json_file),
intent(inout) :: velocity_json
234 type(json_file),
intent(inout) :: pressure_json
235 logical,
intent(out) :: has_velocity
236 logical,
intent(out) :: has_pressure
237 end subroutine fluid_pnpn_bc_split
248 module subroutine pressure_bc_factory(object, scheme, json, coef,
user)
249 class(
bc_t),
pointer,
intent(inout) :: object
250 type(fluid_pnpn_t),
intent(in) :: scheme
251 type(json_file),
intent(inout) :: json
252 type(
coef_t),
target,
intent(in) :: coef
254 end subroutine pressure_bc_factory
265 module subroutine velocity_bc_factory(object, scheme, json, coef,
user)
266 class(
bc_t),
pointer,
intent(inout) :: object
267 type(fluid_pnpn_t),
intent(in) :: scheme
268 type(json_file),
intent(inout) :: json
269 type(
coef_t),
target,
intent(in) :: coef
271 end subroutine velocity_bc_factory
280 module subroutine fluid_pnpn_velocity_bc_allocator(object, type_name, &
281 full_stress_formulation)
282 class(
bc_t),
pointer,
intent(inout) :: object
283 character(len=*),
intent(in) :: type_name
284 logical,
intent(in) :: full_stress_formulation
285 end subroutine fluid_pnpn_velocity_bc_allocator
292 module subroutine fluid_pnpn_pressure_bc_allocator(object, type_name)
293 class(
bc_t),
pointer,
intent(inout) :: object
294 character(len=*),
intent(in) :: type_name
295 end subroutine fluid_pnpn_pressure_bc_allocator
306 subroutine fluid_pnpn_bc_allocate(obj)
308 class(
bc_t),
pointer,
intent(inout) :: obj
309 end subroutine fluid_pnpn_bc_allocate
317 module subroutine register_fluid_pnpn_velocity_bc(type_name, allocator)
318 character(len=*),
intent(in) :: type_name
319 procedure(fluid_pnpn_bc_allocate),
pointer,
intent(in) :: allocator
320 end subroutine register_fluid_pnpn_velocity_bc
328 module subroutine register_fluid_pnpn_pressure_bc(type_name, allocator)
329 character(len=*),
intent(in) :: type_name
330 procedure(fluid_pnpn_bc_allocate),
pointer,
intent(in) :: allocator
331 end subroutine register_fluid_pnpn_pressure_bc
335 type fluid_pnpn_bc_allocator_entry
336 character(len=NEKO_TYPENAME_LEN) :: type_name
337 procedure(fluid_pnpn_bc_allocate),
pointer,
nopass :: allocator => null()
338 end type fluid_pnpn_bc_allocator_entry
341 type(fluid_pnpn_bc_allocator_entry),
allocatable,
private :: &
342 fluid_pnpn_velocity_bc_registry(:)
345 integer,
private :: fluid_pnpn_velocity_bc_registry_size = 0
348 type(fluid_pnpn_bc_allocator_entry),
allocatable,
private :: &
349 fluid_pnpn_pressure_bc_registry(:)
352 integer,
private :: fluid_pnpn_pressure_bc_registry_size = 0
354 public :: fluid_pnpn_bc_split, fluid_pnpn_bc_allocate, &
355 fluid_pnpn_velocity_bc_allocator, fluid_pnpn_pressure_bc_allocator, &
356 register_fluid_pnpn_velocity_bc, register_fluid_pnpn_pressure_bc
369 subroutine fluid_pnpn_init(this, msh, lx, params, numerics_params, user, &
370 chkp, output_boundary)
371 class(fluid_pnpn_t),
target,
intent(inout) :: this
372 type(
mesh_t),
target,
intent(inout) :: msh
373 integer,
intent(in) :: lx
374 type(json_file),
target,
intent(inout) :: params
375 type(json_file),
target,
intent(inout) :: numerics_params
376 type(
user_t),
target,
intent(in) :: user
377 type(
chkp_t),
target,
intent(inout) :: chkp
378 logical,
intent(in) :: output_boundary
379 character(len=15),
parameter :: scheme =
'Modular (Pn/Pn)'
381 class(
bc_t),
pointer :: bc_i, vel_bc
382 real(kind=
rp) :: abs_tol
383 character(len=LOG_SIZE) :: log_buf
384 integer :: ierr, integer_val
385 character(len=:),
allocatable :: solver_type, precon_type
387 type(json_file) :: precon_params, solver_params
389 real(kind=
dp),
pointer :: tlag(:), dtlag(:)
394 call this%init_base(msh, lx, params, numerics_params, scheme,
user, &
395 .true., output_boundary)
407 allocate(this%ext_bdf)
408 call this%ext_bdf%init(integer_val)
411 this%full_stress_formulation, .false.)
415 call this%c_Xh%generate_cyclic_bc()
418 call fluid_pnpn_ax_vel_factory(this)
420 if (this%full_stress_formulation)
then
422 call pnpn_prs_res_stress_factory(this%prs_res)
425 call pnpn_vel_res_stress_factory(this%vel_res)
431 call pnpn_prs_res_factory(this%prs_res)
434 call pnpn_vel_res_factory(this%vel_res)
441 call this%bcs_vel_projector%init(this%c_Xh)
443 if (params%valid_path(
'nut_field'))
then
444 if (.not. this%full_stress_formulation)
then
445 call neko_error(
"You need to set full_stress_formulation to " // &
446 "true for the fluid to have a spatially varying " // &
449 call json_get(params,
'nut_field', this%nut_field_name)
451 this%nut_field_name =
""
455 if (this%c_Xh%geo_compression)
then
456 call ax_helm_allocator(this%Ax_prs, type_name =
"standard_compr")
458 call ax_helm_allocator(this%Ax_prs, type_name =
"standard")
463 call rhs_maker_sumab_fctry(this%sumab)
466 call rhs_maker_ext_fctry(this%makeabf)
469 call rhs_maker_bdf_fctry(this%makebdf)
472 call rhs_maker_oifs_fctry(this%makeoifs)
475 associate(xh_lx => this%Xh%lx, xh_ly => this%Xh%ly, xh_lz => this%Xh%lz, &
476 dm_xh => this%dm_Xh, nelv => this%msh%nelv)
478 call this%p_res%init(dm_xh,
"p_res")
479 call this%u_res%init(dm_xh,
"u_res")
480 call this%v_res%init(dm_xh,
"v_res")
481 call this%w_res%init(dm_xh,
"w_res")
482 call this%abx1%init(dm_xh,
"abx1")
483 call this%aby1%init(dm_xh,
"aby1")
484 call this%abz1%init(dm_xh,
"abz1")
485 call this%abx2%init(dm_xh,
"abx2")
486 call this%aby2%init(dm_xh,
"aby2")
487 call this%abz2%init(dm_xh,
"abz2")
488 call this%advx%init(dm_xh,
"advx")
489 call this%advy%init(dm_xh,
"advy")
490 call this%advz%init(dm_xh,
"advz")
493 call this%du%init(this%dm_Xh,
'du')
494 call this%dv%init(this%dm_Xh,
'dv')
495 call this%dw%init(this%dm_Xh,
'dw')
496 call this%dp%init(this%dm_Xh,
'dp')
498 call this%ale%init(this%c_Xh, params, numerics_params,
user, chkp)
500 call neko_log%section(
"Fluid boundary conditions")
502 call this%setup_bcs(
user, params)
505 if (output_boundary)
call this%write_boundary_conditions()
508 call this%proj_prs%init(this%dm_Xh%size(), this%pr_projection_dim, &
509 this%pr_projection_activ_step, &
510 this%pr_projection_reorthogonalize_basis)
512 call this%proj_vel%init(this%dm_Xh%size(), this%vel_projection_dim, &
513 this%vel_projection_activ_step)
519 if (params%valid_path(
'flow_rate_force'))
then
520 call this%vol_flow%init(this%dm_Xh, params)
524 call neko_log%section(
"Pressure solver")
526 call json_get(params,
'pressure_solver', solver_params)
527 call json_get(params,
'pressure_solver.type', solver_type)
528 call json_get(params,
'pressure_solver.preconditioner.type', &
531 'pressure_solver.preconditioner', precon_params)
533 'pressure_solver.absolute_tolerance', &
535 call neko_log%message(
'Type : ('// trim(solver_type) // &
536 ', ' // trim(precon_type) //
')')
537 write(log_buf,
'(A,ES13.6)')
'Abs tol :', abs_tol
540 call this%solver_factory(this%ksp_prs, this%dm_Xh%size(), solver_params)
541 call this%precon_factory_(this%pc_prs, this%ksp_prs, &
542 this%c_Xh, this%bcs_prs, &
543 precon_type, precon_params)
551 call chkp%get_time_history(tlag, dtlag)
552 call advection_factory(this%adv, numerics_params, this%c_Xh, &
553 this%ulag, this%vlag, this%wlag, &
554 dtlag, tlag, this%ext_bdf, &
559 payload => this%chkp%add_payload(
"fluid")
560 call payload%add_field(this%u)
561 call payload%add_field(this%v)
562 call payload%add_field(this%w)
563 call payload%add_field(this%p)
564 call payload%add_field(this%abx1)
565 call payload%add_field(this%abx2)
566 call payload%add_field(this%aby1)
567 call payload%add_field(this%aby2)
568 call payload%add_field(this%abz1)
569 call payload%add_field(this%abz2)
570 call payload%add_series(this%ulag)
571 call payload%add_series(this%vlag)
572 call payload%add_series(this%wlag)
576 this%schwarz_iterations, 0)
580 nullify(bc_i, vel_bc)
582 end subroutine fluid_pnpn_init
586 subroutine fluid_pnpn_ax_vel_factory(this)
587 class(fluid_pnpn_t),
target,
intent(inout) :: this
589 if (this%full_stress_formulation)
then
590 if (this%svv_enabled)
then
591 if (this%svv%formulation .eq.
"factorized")
then
592 call ax_helm_allocator(this%Ax_vel, &
593 type_name =
"full_factorized_svv")
595 call ax_helm_allocator(this%Ax_vel, &
596 type_name =
"full_one_sided_svv")
598 select type (operator => this%Ax_vel)
599 class is (ax_helm_svv_full_t)
600 operator%svv => this%svv
603 call ax_helm_allocator(this%Ax_vel, type_name =
"full")
606 if (this%svv_enabled)
then
607 if (this%svv%formulation .eq.
"factorized")
then
608 call ax_helm_allocator(this%Ax_vel, type_name =
"factorized_svv")
610 call ax_helm_allocator(this%Ax_vel, type_name =
"one_sided_svv")
612 select type (operator => this%Ax_vel)
613 class is (ax_helm_svv_t)
614 operator%svv => this%svv
616 else if (this%c_Xh%geo_compression)
then
617 call ax_helm_allocator(this%Ax_vel, &
618 type_name =
"standard_compr")
620 call ax_helm_allocator(this%Ax_vel, type_name =
"standard")
624 end subroutine fluid_pnpn_ax_vel_factory
626 subroutine fluid_pnpn_restart(this, chkp)
627 class(fluid_pnpn_t),
target,
intent(inout) :: this
628 type(chkp_t),
intent(inout) :: chkp
630 class(bc_t),
pointer :: bc_i
632 n = this%u%dof%size()
633 if (
allocated(chkp%previous_mesh%elements) .or. &
634 chkp%previous_Xh%lx .ne. this%Xh%lx)
then
635 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
636 c_xh => this%c_Xh, ulag => this%ulag, vlag => this%vlag, &
638 do concurrent(j = 1:n)
639 u%x(j,1,1,1) = u%x(j,1,1,1) * c_xh%mult(j,1,1,1)
640 v%x(j,1,1,1) = v%x(j,1,1,1) * c_xh%mult(j,1,1,1)
641 w%x(j,1,1,1) = w%x(j,1,1,1) * c_xh%mult(j,1,1,1)
642 p%x(j,1,1,1) = p%x(j,1,1,1) * c_xh%mult(j,1,1,1)
644 do i = 1, this%ulag%size()
645 do concurrent(j = 1:n)
646 ulag%lf(i)%x(j,1,1,1) = ulag%lf(i)%x(j,1,1,1) &
648 vlag%lf(i)%x(j,1,1,1) = vlag%lf(i)%x(j,1,1,1) &
650 wlag%lf(i)%x(j,1,1,1) = wlag%lf(i)%x(j,1,1,1) &
657 if (neko_bcknd_device .eq. 1)
then
658 associate(u => this%u, v => this%v, w => this%w, &
659 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag,&
661 call device_memcpy(u%x, u%x_d, u%dof%size(), &
662 host_to_device, sync = .false.)
663 call device_memcpy(v%x, v%x_d, v%dof%size(), &
664 host_to_device, sync = .false.)
665 call device_memcpy(w%x, w%x_d, w%dof%size(), &
666 host_to_device, sync = .false.)
667 call device_memcpy(p%x, p%x_d, p%dof%size(), &
668 host_to_device, sync = .false.)
669 call device_memcpy(ulag%lf(1)%x, ulag%lf(1)%x_d, &
670 u%dof%size(), host_to_device, sync = .false.)
671 call device_memcpy(ulag%lf(2)%x, ulag%lf(2)%x_d, &
672 u%dof%size(), host_to_device, sync = .false.)
674 call device_memcpy(vlag%lf(1)%x, vlag%lf(1)%x_d, &
675 v%dof%size(), host_to_device, sync = .false.)
676 call device_memcpy(vlag%lf(2)%x, vlag%lf(2)%x_d, &
677 v%dof%size(), host_to_device, sync = .false.)
679 call device_memcpy(wlag%lf(1)%x, wlag%lf(1)%x_d, &
680 w%dof%size(), host_to_device, sync = .false.)
681 call device_memcpy(wlag%lf(2)%x, wlag%lf(2)%x_d, &
682 w%dof%size(), host_to_device, sync = .false.)
683 call device_memcpy(this%abx1%x, this%abx1%x_d, &
684 w%dof%size(), host_to_device, sync = .false.)
685 call device_memcpy(this%abx2%x, this%abx2%x_d, &
686 w%dof%size(), host_to_device, sync = .false.)
687 call device_memcpy(this%aby1%x, this%aby1%x_d, &
688 w%dof%size(), host_to_device, sync = .false.)
689 call device_memcpy(this%aby2%x, this%aby2%x_d, &
690 w%dof%size(), host_to_device, sync = .false.)
691 call device_memcpy(this%abz1%x, this%abz1%x_d, &
692 w%dof%size(), host_to_device, sync = .false.)
693 call device_memcpy(this%abz2%x, this%abz2%x_d, &
694 w%dof%size(), host_to_device, sync = .false.)
695 call device_memcpy(this%advx%x, this%advx%x_d, &
696 w%dof%size(), host_to_device, sync = .false.)
697 call device_memcpy(this%advy%x, this%advy%x_d, &
698 w%dof%size(), host_to_device, sync = .false.)
699 call device_memcpy(this%advz%x, this%advz%x_d, &
700 w%dof%size(), host_to_device, sync = .false.)
707 if (
allocated(chkp%previous_mesh%elements) &
708 .or. chkp%previous_Xh%lx .ne. this%Xh%lx)
then
710 call rotate_cyc(this%u, this%v, this%w, 1, this%c_Xh)
711 call this%gs_Xh%op(this%u, gs_op_add)
712 call this%gs_Xh%op(this%v, gs_op_add)
713 call this%gs_Xh%op(this%w, gs_op_add)
714 call this%gs_Xh%op(this%p, gs_op_add)
715 call rotate_cyc(this%u, this%v, this%w, 0, this%c_Xh)
717 do i = 1, this%ulag%size()
718 call rotate_cyc(this%ulag%lf(i), this%vlag%lf(i), &
719 this%wlag%lf(i), 1, this%c_Xh)
720 call this%gs_Xh%op(this%ulag%lf(i), gs_op_add)
721 call this%gs_Xh%op(this%vlag%lf(i), gs_op_add)
722 call this%gs_Xh%op(this%wlag%lf(i), gs_op_add)
723 call rotate_cyc(this%ulag%lf(i), this%vlag%lf(i), &
724 this%wlag%lf(i), 0, this%c_Xh)
728 call this%ale%sync_chkp(this%c_Xh, this%Xh, this%adv, chkp, this%gs_Xh)
729 if (this%ale%active)
then
730 call this%bc_prs_surface%recompute_normals()
731 call this%bc_sym_surface%recompute_normals()
735 do i = 1, this%bcs_vel%size()
736 bc_i => this%bcs_vel%get(i)
737 call bc_i%restart(this%u, this%v, this%w, &
738 this%ulag, this%vlag, this%wlag)
742 do i = 1, this%bcs_prs%size()
743 bc_i => this%bcs_prs%get(i)
744 call bc_i%restart(this%p)
751 select type (adv => this%adv)
756 end subroutine fluid_pnpn_restart
764 subroutine fluid_pnpn_set_initial_condition(this, params, user, is_restart)
765 class(fluid_pnpn_t),
intent(inout) :: this
766 type(json_file),
intent(inout) :: params
767 type(user_t),
intent(in) :: user
768 logical,
intent(in) :: is_restart
771 if (.not. is_restart)
then
772 call this%ale%set_initial_mesh_velocity(this%c_Xh)
775 call this%set_initial_condition_base(params,
user, is_restart)
777 if (.not. is_restart)
then
778 call this%ulag%set(this%u)
779 call this%vlag%set(this%v)
780 call this%wlag%set(this%w)
783 end subroutine fluid_pnpn_set_initial_condition
785 subroutine fluid_pnpn_free(this)
786 class(fluid_pnpn_t),
intent(inout) :: this
788 if (
allocated(this%Ax_vel))
then
789 call this%Ax_vel%free()
790 deallocate(this%Ax_vel)
793 if (
allocated(this%Ax_prs))
then
794 call this%Ax_prs%free()
795 deallocate(this%Ax_prs)
799 call this%scheme_free()
801 if (
allocated(this%ext_bdf))
then
802 call this%ext_bdf%free()
803 deallocate(this%ext_bdf)
806 call this%bc_prs_surface%free()
807 call this%bc_sym_surface%free()
808 if (
allocated(this%bcs_vel_projector))
then
809 call this%bcs_vel_projector%free()
810 deallocate(this%bcs_vel_projector)
812 call this%bcs_prs_projector%free()
813 call this%proj_prs%free()
814 call this%proj_vel%free()
816 call this%p_res%free()
817 call this%u_res%free()
818 call this%v_res%free()
819 call this%w_res%free()
828 call this%abx1%free()
829 call this%aby1%free()
830 call this%abz1%free()
832 call this%abx2%free()
833 call this%aby2%free()
834 call this%abz2%free()
836 call this%advx%free()
837 call this%advy%free()
838 call this%advz%free()
840 if (
allocated(this%adv))
then
845 if (
allocated(this%prs_res))
then
846 deallocate(this%prs_res)
849 if (
allocated(this%vel_res))
then
850 deallocate(this%vel_res)
853 if (
allocated(this%sumab))
then
854 deallocate(this%sumab)
857 if (
allocated(this%makeabf))
then
858 deallocate(this%makeabf)
861 if (
allocated(this%makebdf))
then
862 deallocate(this%makebdf)
865 if (
allocated(this%makeoifs))
then
866 deallocate(this%makeoifs)
869 if (
allocated(this%ext_bdf))
then
870 deallocate(this%ext_bdf)
873 call this%vol_flow%free()
875 end subroutine fluid_pnpn_free
883 subroutine fluid_pnpn_step(this, time, dt_controller)
884 class(fluid_pnpn_t),
target,
intent(inout) :: this
885 type(time_state_t),
intent(in) :: time
886 type(time_step_controller_t),
intent(in) :: dt_controller
888 if (this%freeze)
return
890 call profiler_start_region(
'Fluid', 1)
892 call this%assemble_rhs(time)
894 if (this%ale%active)
then
896 call this%ale%advance_mesh(this%c_Xh, time, this%ext_bdf%nadv)
897 call this%recompute_metrics()
900 call this%update_velocity_lags()
902 call this%solve(time, dt_controller, this%proj_prs, this%proj_vel)
906 if (this%ale%active)
then
907 call this%ale%update_mesh_velocity(this%c_Xh, time)
910 call profiler_end_region(
'Fluid', 1)
911 end subroutine fluid_pnpn_step
916 subroutine fluid_pnpn_assemble_rhs(this, time)
917 class(fluid_pnpn_t),
target,
intent(inout) :: this
918 type(time_state_t),
intent(in) :: time
922 n = this%dm_Xh%size()
924 associate(u => this%u, v => this%v, w => this%w, &
925 u_e => this%u_e, v_e => this%v_e, w_e => this%w_e, &
927 c_xh => this%c_Xh, dm_xh => this%dm_Xh, &
928 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag, &
929 sumab => this%sumab, makeoifs => this%makeoifs, &
930 makeabf => this%makeabf, makebdf => this%makebdf, &
933 f_x => this%f_x, f_y => this%f_y, f_z => this%f_z, &
935 ext_bdf => this%ext_bdf, &
939 call sumab%compute_fluid(u_e, v_e, w_e, u, v, w, &
940 ulag, vlag, wlag, ext_bdf%advection_coeffs%x, ext_bdf%nadv)
943 call this%source_term%compute(time, extrapolate = .true.)
946 call this%bcs_vel%apply_vector(f_x%x, f_y%x, f_z%x, &
947 this%dm_Xh%size(), time, strong = .false.)
949 if (this%ale%active)
then
951 call neko_error(
"ALE is not yet supported " // &
952 "with OIFS time integration.")
955 call this%adv%compute_ale(u, v, w, &
956 ale%wm_x, ale%wm_y, ale%wm_z, &
958 xh, c_xh, dm_xh%size())
964 call this%adv%compute(u, v, w, &
965 this%advx, this%advy, this%advz, &
966 xh, this%c_Xh, dm_xh%size(),
real(dt, kind=rp))
973 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
974 this%abx2, this%aby2, this%abz2, &
975 f_x%x, f_y%x, f_z%x, &
976 rho%x(1,1,1,1), ext_bdf%advection_coeffs%x, n)
980 call makeoifs%compute_fluid(this%advx%x, this%advy%x, this%advz%x, &
981 f_x%x, f_y%x, f_z%x, &
982 rho%x(1,1,1,1),
real(dt, kind=rp), n)
985 call this%adv%compute(u, v, w, &
987 xh, this%c_Xh, dm_xh%size())
994 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
995 this%abx2, this%aby2, this%abz2, &
996 f_x%x, f_y%x, f_z%x, &
997 rho%x(1,1,1,1), ext_bdf%advection_coeffs%x, n)
1003 call makebdf%compute_fluid(ulag, vlag, wlag, f_x%x, f_y%x, f_z%x, &
1004 u, v, w, c_xh%B, c_xh%Blag, c_xh%Blaglag, rho%x(1,1,1,1), &
1005 real(dt, kind=rp), &
1006 ext_bdf%diffusion_coeffs%x, ext_bdf%ndiff, n)
1013 call this%source_term%compute(time, extrapolate = .false., scale = rho)
1016 end subroutine fluid_pnpn_assemble_rhs
1019 subroutine fluid_pnpn_recompute_metrics(this)
1020 class(fluid_pnpn_t),
target,
intent(inout) :: this
1022 call profiler_start_region(
'ALE recompute metrics')
1024 call this%c_Xh%recompute_metrics()
1027 call this%adv%recompute_metrics(this%c_Xh, .true.)
1029 call this%bc_prs_surface%recompute_normals()
1030 call this%bc_sym_surface%recompute_normals()
1031 call profiler_end_region(
'ALE recompute metrics')
1032 end subroutine fluid_pnpn_recompute_metrics
1037 subroutine fluid_pnpn_update_velocity_lags(this)
1038 class(fluid_pnpn_t),
intent(inout) :: this
1040 call this%ulag%update()
1041 call this%vlag%update()
1042 call this%wlag%update()
1043 end subroutine fluid_pnpn_update_velocity_lags
1052 subroutine fluid_pnpn_solve(this, time, dt_controller, proj_prs, proj_vel)
1053 class(fluid_pnpn_t),
target,
intent(inout) :: this
1054 type(time_state_t),
intent(in) :: time
1055 type(time_step_controller_t),
intent(in) :: dt_controller
1056 type(projection_t),
intent(inout),
optional :: proj_prs
1057 type(projection_vel_t),
intent(inout),
optional :: proj_vel
1061 type(ksp_monitor_t) :: ksp_results(4)
1064 n = this%dm_Xh%size()
1066 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
1067 u_e => this%u_e, v_e => this%v_e, w_e => this%w_e, &
1068 du => this%du, dv => this%dv, dw => this%dw, dp => this%dp, &
1069 u_res => this%u_res, v_res => this%v_res, w_res => this%w_res, &
1070 p_res => this%p_res, ax_vel => this%Ax_vel, ax_prs => this%Ax_prs, &
1072 c_xh => this%c_Xh, dm_xh => this%dm_Xh, gs_xh => this%gs_Xh, &
1073 msh => this%msh, prs_res => this%prs_res, &
1074 vel_res => this%vel_res, &
1075 rho => this%rho, mu_tot => this%mu_tot, &
1076 f_x => this%f_x, f_y => this%f_y, f_z => this%f_z, &
1077 tstep => time%tstep, dt => time%dt, &
1078 ext_bdf => this%ext_bdf, event => glb_cmd_event)
1081 call this%update_material_properties(time)
1084 if (this%svv_enabled)
then
1085 call this%svv%update(rho, tstep)
1088 do iter = 1, 1 + this%schwarz_iterations
1090 call this%bc_apply_vel(time, strong = .true.)
1091 call this%bc_apply_prs(time)
1094 call profiler_start_region(
'Pressure_residual', 18)
1095 call prs_res%compute(p, p_res,&
1100 this%bc_prs_surface, this%bc_sym_surface,&
1101 ax_prs, ext_bdf%diffusion_coeffs%x(1),
real(dt, kind=rp), &
1106 if (.not. this%prs_dirichlet .and. neko_bcknd_device .eq. 1)
then
1107 call device_ortho(p_res%x_d, this%glb_n_points, n)
1108 else if (.not. this%prs_dirichlet)
then
1109 call ortho(p_res%x, this%glb_n_points, n)
1112 call gs_xh%op(p_res, gs_op_add, event)
1115 call this%bcs_prs_projector%apply(p_res%x, p%dof%size())
1118 call profiler_end_region(
'Pressure_residual', 18)
1122 if (iter .eq. 1 .and.
present(proj_prs))
then
1123 call proj_prs%pre_solving(p_res%x, tstep, c_xh, n, &
1124 dt_controller, ax = ax_prs, gs_h = gs_xh, &
1125 bclst = this%bcs_prs_projector, string =
'Pressure')
1128 call this%pc_prs%update()
1130 call profiler_start_region(
'Pressure_solve', 3)
1134 this%ksp_prs%solve(ax_prs, dp, p_res%x, n, c_xh, &
1135 this%bcs_prs_projector, gs_xh)
1136 ksp_results(1)%name =
'Pressure'
1139 call profiler_end_region(
'Pressure_solve', 3)
1141 if (iter .eq. 1 .and.
present(proj_prs))
then
1142 call proj_prs%post_solving(dp%x, ax_prs, c_xh, &
1143 this%bcs_prs_projector, gs_xh, n, tstep, dt_controller)
1147 call field_add2(p, dp, n)
1148 if (.not. this%prs_dirichlet .and. neko_bcknd_device .eq. 1)
then
1149 call device_ortho(p%x_d, this%glb_n_points, n)
1150 else if (.not. this%prs_dirichlet)
then
1151 call ortho(p%x, this%glb_n_points, n)
1155 call profiler_start_region(
'Velocity_residual', 19)
1156 call vel_res%compute(ax_vel, u, v, w, &
1157 u_res, v_res, w_res, &
1161 mu_tot, rho, ext_bdf%diffusion_coeffs%x(1), &
1162 real(dt, kind=rp), dm_xh%size())
1164 call rotate_cyc(u_res, v_res, w_res, 1, c_xh)
1165 call gs_xh%op(u_res%x, v_res%x, w_res%x, dm_xh%size(), &
1167 call rotate_cyc(u_res, v_res, w_res, 0, c_xh)
1170 call this%bcs_vel_projector%apply(u_res%x, v_res%x, w_res%x, &
1174 call profiler_end_region(
'Velocity_residual', 19)
1176 if (iter .eq. 1 .and.
present(proj_vel))
then
1177 call proj_vel%pre_solving(u_res%x, v_res%x, w_res%x, &
1178 tstep, c_xh, n, dt_controller,
'Velocity')
1181 call this%pc_vel%update()
1183 call profiler_start_region(
"Velocity_solve", 4)
1184 ksp_results(2:4) = this%ksp_vel%solve_coupled(ax_vel, du, dv, dw, &
1185 u_res%x, v_res%x, w_res%x, n, c_xh, &
1186 this%bcs_vel_projector, gs_xh, &
1187 this%ksp_vel%max_iter)
1188 call profiler_end_region(
"Velocity_solve", 4)
1189 if (this%full_stress_formulation)
then
1190 ksp_results(2)%name =
'Momentum'
1192 ksp_results(2)%name =
'X-Velocity'
1193 ksp_results(3)%name =
'Y-Velocity'
1194 ksp_results(4)%name =
'Z-Velocity'
1197 if (iter .eq. 1 .and.
present(proj_vel))
then
1198 call proj_vel%post_solving(du%x, dv%x, dw%x, ax_vel, c_xh, &
1199 this%bcs_vel_projector, gs_xh, n, tstep, &
1203 if (neko_bcknd_device .eq. 1)
then
1204 call device_opadd2cm(u%x_d, v%x_d, w%x_d, &
1205 du%x_d, dv%x_d, dw%x_d, 1.0_rp, n, msh%gdim)
1207 call opadd2cm(u%x, v%x, w%x, du%x, dv%x, dw%x, 1.0_rp, n, msh%gdim)
1210 call fluid_step_info(time, ksp_results, &
1211 this%full_stress_formulation, this%strict_convergence, &
1212 this%allow_stabilization, iter)
1216 if (this%forced_flow_rate)
then
1218 call this%vol_flow%adjust( u, v, w, p, u_res, v_res, w_res, p_res, &
1219 c_xh, gs_xh, ext_bdf, rho%x(1,1,1,1), mu_tot, &
1220 real(dt, kind=rp), time, this%bcs_prs_projector, &
1221 this%bcs_vel_projector, ax_vel, ax_prs, this%ksp_prs, &
1222 this%ksp_vel, this%pc_prs, this%pc_vel, this%ksp_prs%max_iter, &
1223 this%ksp_vel%max_iter)
1227 end subroutine fluid_pnpn_solve
1239 subroutine fluid_pnpn_setup_bcs(this, user, params)
1240 class(fluid_pnpn_t),
target,
intent(inout) :: this
1241 type(user_t),
target,
intent(in) :: user
1242 type(json_file),
intent(inout) :: params
1243 integer :: i, n_bcs, j, k, l, zone_size, global_zone_size, ierr
1244 integer :: facet_value
1245 class(bc_t),
pointer :: bc_i
1246 type(json_core) :: core
1247 type(json_value),
pointer :: bc_object
1248 type(json_file) :: bc_subdict, velocity_subdict, pressure_subdict
1249 logical :: moving_, has_velocity, has_pressure, pressure_dirichlet
1252 logical,
allocatable :: marked_zones(:)
1253 integer,
allocatable :: zone_indices(:)
1254 character(len=256) :: error_msg
1255 character(len=:),
allocatable :: bc_type_str
1257 this%ale%has_moving_boundary = .false.
1260 call this%bc_prs_surface%init_from_components(this%c_Xh)
1261 call this%bc_sym_surface%init_from_components(this%c_Xh)
1264 if (params%valid_path(
'boundary_conditions'))
then
1265 call params%info(
'boundary_conditions', n_children = n_bcs)
1266 call params%get_core(core)
1267 call params%get(
'boundary_conditions', bc_object, found)
1269 call this%bcs_vel%init(n_bcs)
1270 call this%bcs_prs%init(n_bcs)
1272 allocate(marked_zones(
size(this%msh%labeled_zones)))
1273 marked_zones = .false.
1277 call json_extract_item(core, bc_object, i, bc_subdict)
1279 call json_get_or_lookup(bc_subdict,
"zone_indices", zone_indices)
1284 do j = 1,
size(zone_indices)
1285 zone_size = this%msh%labeled_zones(zone_indices(j))%size
1286 call mpi_allreduce(zone_size, global_zone_size, 1, &
1287 mpi_integer, mpi_max, neko_comm, ierr)
1289 if (global_zone_size .eq. 0)
then
1290 write(error_msg,
'(A, I0, A, A, I0, A)') &
1291 "Zone index ", zone_indices(j), &
1292 " is invalid as this zone has 0 size, meaning it ", &
1293 "is not in the mesh. Check fluid boundary condition ", &
1295 call neko_error(error_msg)
1298 if (marked_zones(zone_indices(j)))
then
1299 write(error_msg,
'(A, I0, A, A, A, A)') &
1300 "Zone with index ", zone_indices(j), &
1301 " has already been assigned a boundary condition. ", &
1302 "Please check your boundary_conditions entry for the ", &
1303 "fluid and make sure that each zone index appears only ", &
1304 "in a single boundary condition."
1305 call neko_error(error_msg)
1307 marked_zones(zone_indices(j)) = .true.
1311 call fluid_pnpn_bc_split(bc_subdict, velocity_subdict, &
1312 pressure_subdict, has_velocity, has_pressure)
1318 if (has_velocity)
then
1320 call json_get(velocity_subdict,
"type", bc_type_str)
1321 if (trim(bc_type_str) .eq.
"no_slip")
then
1322 call json_get_or_default(velocity_subdict,
"moving", moving_, &
1324 if (moving_) this%ale%has_moving_boundary = .true.
1327 call velocity_bc_factory(bc_i, this, velocity_subdict, &
1333 if (
associated(bc_i))
then
1336 type is (symmetry_aligned_t)
1341 call this%bcs_vel_projector%mark(bc_i%bc_x, component =
'x')
1342 call this%bcs_vel_projector%mark(bc_i%bc_y, component =
'y')
1343 call this%bcs_vel_projector%mark(bc_i%bc_z, component =
'z')
1344 call this%bcs_vel%append(bc_i)
1345 call this%bc_sym_surface%mark_facets(bc_i%marked_facet)
1346 type is (symmetry_t)
1349 if (.not. this%full_stress_formulation)
then
1350 call neko_error(
"The symmetry boundary condition " // &
1351 "requires the full stress formulation to be enabled.")
1353 call this%bcs_vel_projector%mark(bc_i)
1354 call this%bcs_vel%append(bc_i)
1355 call this%bc_sym_surface%mark_facets(bc_i%marked_facet)
1356 type is (non_normal_aligned_t)
1358 call this%bcs_vel_projector%mark(bc_i%bc_x, component =
'x')
1359 call this%bcs_vel_projector%mark(bc_i%bc_y, component =
'y')
1360 call this%bcs_vel_projector%mark(bc_i%bc_z, component =
'z')
1361 call this%bcs_vel%append(bc_i)
1362 type is (non_normal_t)
1363 call this%bcs_vel_projector%mark(bc_i)
1364 call this%bcs_vel%append(bc_i)
1365 type is (shear_stress_t)
1366 if (.not. this%full_stress_formulation)
then
1367 call neko_error(
"The shear_stress boundary condition " // &
1368 "requires the full stress formulation to be enabled.")
1370 call this%bcs_vel_projector%mark(bc_i)
1371 call this%bcs_vel%append(bc_i)
1372 type is (wall_model_bc_t)
1373 if (.not. this%full_stress_formulation)
then
1374 call neko_error(
"The wall_model boundary condition " // &
1375 "requires the full stress formulation to be enabled.")
1377 call this%bcs_vel_projector%mark(bc_i)
1378 call this%bcs_vel%append(bc_i)
1379 class is (mixed_bc_t)
1382 if (.not. this%full_stress_formulation)
then
1383 call neko_error(
"The " // trim(bc_i%name) // &
1384 " boundary condition is a mixed condition and " // &
1385 "requires the full stress formulation to be enabled.")
1387 call this%bcs_vel_projector%mark(bc_i)
1388 call this%bcs_vel%append(bc_i)
1392 if (bc_i%bc_type .eq. bc_dirichlet)
then
1393 call this%bc_prs_surface%mark_labeled_zones( &
1395 if (this%full_stress_formulation)
then
1396 call this%bcs_vel_projector%mark(bc_i)
1398 call this%bcs_vel_projector%mark(bc_i, component =
'x')
1399 call this%bcs_vel_projector%mark(bc_i, component =
'y')
1400 call this%bcs_vel_projector%mark(bc_i, component =
'z')
1404 call this%bcs_vel%append(bc_i)
1412 pressure_dirichlet = .false.
1413 if (has_pressure)
then
1414 call pressure_bc_factory(bc_i, this, pressure_subdict, &
1420 if (
associated(bc_i))
then
1421 call this%bcs_prs%append(bc_i)
1424 if (bc_i%bc_type .eq. bc_dirichlet)
then
1425 call this%bcs_prs_projector%mark(bc_i)
1426 pressure_dirichlet = .true.
1432 if (pressure_dirichlet)
then
1438 do j = 1,
size(zone_indices)
1439 do k = 1, this%msh%nelv
1440 do l = 1, 2 * this%msh%gdim
1441 if (this%msh%facet_type(l, k) .eq. -zone_indices(j))
then
1442 this%msh%facet_type(l, k) = facet_value
1449 call velocity_subdict%destroy()
1450 call pressure_subdict%destroy()
1452 if (this%ale%active .and. (.not. this%ale%has_moving_boundary))
then
1453 call neko_error(
"Case file error: ALE is active, " // &
1454 "but no moving wall was found. " // &
1455 "Use type = 'no_slip' with 'moving': true in case file.")
1459 do i = 1,
size(this%msh%labeled_zones)
1460 if ((this%msh%labeled_zones(i)%size .gt. 0) .and. &
1461 (.not. marked_zones(i)))
then
1462 write(error_msg,
'(A, I0)') &
1463 "No fluid boundary condition assigned to zone ", i
1464 call neko_error(error_msg)
1469 do i = 1,
size(this%msh%labeled_zones)
1470 if (this%msh%labeled_zones(i)%size .gt. 0)
then
1471 call neko_error(
"No boundary_conditions entry in the case file!")
1477 call this%bcs_vel%init()
1478 call this%bcs_prs%init()
1482 call this%bc_prs_surface%finalize()
1483 call this%bc_sym_surface%finalize()
1484 call this%bcs_vel_projector%finalize(rebuild_mask = .true.)
1487 this%prs_dirichlet = this%bcs_prs_projector%dof_mask%is_set()
1488 call mpi_allreduce(mpi_in_place, this%prs_dirichlet, 1, &
1489 mpi_logical, mpi_lor, neko_comm)
1491 if (
allocated(marked_zones))
then
1492 deallocate(marked_zones)
1495 if (
allocated(zone_indices))
then
1496 deallocate(zone_indices)
1499 nullify(bc_i, bc_object)
1501 end subroutine fluid_pnpn_setup_bcs
1504 subroutine fluid_pnpn_write_boundary_conditions(this)
1511 class(fluid_pnpn_t),
target,
intent(inout) :: this
1512 type(dirichlet_t) :: bdry_mask
1513 type(field_t),
pointer :: bdry_field
1514 type(file_t) :: bdry_file
1515 integer :: temp_index, i
1516 class(bc_t),
pointer :: bci
1517 character(len=LOG_SIZE) :: log_buf
1519 write(log_buf,
'(A)')
'Marking using integer keys in bdry0.f00000'
1520 call neko_log%message(log_buf)
1521 write(log_buf,
'(A)')
'Condition-value pairs: '
1522 call neko_log%message(log_buf)
1523 write(log_buf,
'(A)')
' no_slip (stationary wall) = 1'
1524 call neko_log%message(log_buf)
1525 write(log_buf,
'(A)')
' velocity_value = 2'
1526 call neko_log%message(log_buf)
1527 write(log_buf,
'(A)')
' outflow, normal_outflow (+dong) = 3'
1528 call neko_log%message(log_buf)
1529 write(log_buf,
'(A)')
' symmetry = 4'
1530 call neko_log%message(log_buf)
1531 write(log_buf,
'(A)')
' periodic = 6'
1532 call neko_log%message(log_buf)
1533 write(log_buf,
'(A)')
' user_velocity = 7'
1534 call neko_log%message(log_buf)
1535 write(log_buf,
'(A)')
' user_pressure = 8'
1536 call neko_log%message(log_buf)
1537 write(log_buf,
'(A)')
' shear_stress = 9'
1538 call neko_log%message(log_buf)
1539 write(log_buf,
'(A)')
' wall_modelling = 10'
1540 call neko_log%message(log_buf)
1541 write(log_buf,
'(A)')
' blasius_profile = 11'
1542 call neko_log%message(log_buf)
1543 write(log_buf,
'(A)')
' no_slip (moving wall) = 12'
1544 call neko_log%message(log_buf)
1546 call neko_scratch_registry%request_field(bdry_field, temp_index, .true.)
1550 call bdry_mask%init_from_components(this%c_Xh, 6.0_rp)
1551 call bdry_mask%mark_zone(this%msh%periodic)
1552 call bdry_mask%finalize()
1553 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1554 call bdry_mask%free()
1556 do i = 1, this%bcs_prs%size()
1557 bci => this%bcs_prs%get(i)
1558 select type (
bc => bci)
1559 type is (zero_dirichlet_t)
1560 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1561 call bdry_mask%mark_facets(bci%marked_facet)
1562 call bdry_mask%finalize()
1563 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1564 call bdry_mask%free()
1566 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1567 call bdry_mask%mark_facets(bci%marked_facet)
1568 call bdry_mask%finalize()
1569 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1570 call bdry_mask%free()
1572 call bdry_mask%init_from_components(this%c_Xh, 8.0_rp)
1573 call bdry_mask%mark_facets(bci%marked_facet)
1574 call bdry_mask%finalize()
1575 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1576 call bdry_mask%free()
1580 do i = 1, this%bcs_vel%size()
1581 bci => this%bcs_vel%get(i)
1582 select type (
bc => bci)
1584 if (
bc%is_moving)
then
1586 call bdry_mask%init_from_components(this%c_Xh, 12.0_rp)
1589 call bdry_mask%init_from_components(this%c_Xh, 1.0_rp)
1591 call bdry_mask%mark_facets(bci%marked_facet)
1592 call bdry_mask%finalize()
1593 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1594 call bdry_mask%free()
1596 call bdry_mask%init_from_components(this%c_Xh, 2.0_rp)
1597 call bdry_mask%mark_facets(bci%marked_facet)
1598 call bdry_mask%finalize()
1599 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1600 call bdry_mask%free()
1601 type is (symmetry_aligned_t)
1602 call bdry_mask%init_from_components(this%c_Xh, 4.0_rp)
1603 call bdry_mask%mark_facets(bci%marked_facet)
1604 call bdry_mask%finalize()
1605 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1606 call bdry_mask%free()
1607 type is (symmetry_t)
1608 call bdry_mask%init_from_components(this%c_Xh, 4.0_rp)
1609 call bdry_mask%mark_facets(bci%marked_facet)
1610 call bdry_mask%finalize()
1611 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1612 call bdry_mask%free()
1614 call bdry_mask%init_from_components(this%c_Xh, 7.0_rp)
1615 call bdry_mask%mark_facets(bci%marked_facet)
1616 call bdry_mask%finalize()
1617 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1618 call bdry_mask%free()
1619 type is (shear_stress_t)
1620 call bdry_mask%init_from_components(this%c_Xh, 9.0_rp)
1621 call bdry_mask%mark_facets(bci%marked_facet)
1622 call bdry_mask%finalize()
1623 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1624 call bdry_mask%free()
1625 type is (wall_model_bc_t)
1626 call bdry_mask%init_from_components(this%c_Xh, 10.0_rp)
1627 call bdry_mask%mark_facets(bci%marked_facet)
1628 call bdry_mask%finalize()
1629 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1630 call bdry_mask%free()
1632 call bdry_mask%init_from_components(this%c_Xh, 11.0_rp)
1633 call bdry_mask%mark_facets(bci%marked_facet)
1634 call bdry_mask%finalize()
1635 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1636 call bdry_mask%free()
1641 call bdry_file%init(
'bdry.fld')
1642 call bdry_file%write(bdry_field)
1644 call neko_scratch_registry%relinquish_field(temp_index)
1646 nullify(bdry_field, bci)
1648 end subroutine fluid_pnpn_write_boundary_conditions
__device__ T solve(const T u, const T y, const T guess, const T nu, const T kappa, const T B)
Copy data between host and device (or device and device).
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.
Apply cyclic boundary condition to a vector field.
Subroutines to add advection terms to the RHS of a transport equation.
Subroutines to add advection terms to the RHS of a transport equation.
ALE Manager: Handles Mesh Motion.
Defines the full-stress SVV Helmholtz operator.
Base type for an SVV Helmholtz operator.
Defines a Matrix-vector product.
Defines a boundary condition.
integer, parameter, public bc_dirichlet
Supported boundary condition types. The values are set in order of precedence for global resolution....
Defines a Blasius profile dirichlet condition.
Format-independent checkpoint payloads.
Defines format-independent checkpoint registration and restart state.
type(mpi_comm), public neko_comm
MPI communicator.
subroutine, public device_opadd2cm(a1_d, a2_d, a3_d, b1_d, b2_d, b3_d, c, n, gdim)
subroutine, public device_opcolv(a1_d, a2_d, a3_d, c_d, gdim, n)
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
type(c_ptr), bind(C), public glb_cmd_event
Event for the global command queue.
Defines a dirichlet boundary condition.
Defines a dong outflow condition.
Dirichlet condition applied in the facet normal direction.
Defines inflow dirichlet conditions.
Defines user dirichlet condition for a scalar field.
subroutine, public field_add2(a, b, n)
Vector addition .
subroutine, public field_copy(a, b, n)
Copy a vector .
Contains the field_serties_t type.
Module for file I/O operations.
Auxiliary routines for fluid solvers.
subroutine, public fluid_step_info(time, ksp_results, full_stress_formulation, strict_convergence, allow_stabilization, iteration)
Prints for prs, velx, vely, velz the following: Number of iterations, start residual,...
Modular version of the Classic Nek5000 Pn/Pn formulation for fluids.
subroutine fluid_pnpn_setup_bcs(this, user, params)
Sets up the boundary conditions for the scheme.
subroutine fluid_pnpn_recompute_metrics(this)
Recompute geometry-dependent quantities after the mesh has moved.
subroutine fluid_pnpn_restart(this, chkp)
subroutine fluid_pnpn_set_initial_condition(this, params, user, is_restart)
Set the initial condition of the velocity and pressure, copy the initial velocity to the lagged veloc...
subroutine fluid_pnpn_init(this, msh, lx, params, numerics_params, user, chkp, output_boundary)
Initialize the Pn/Pn fluid scheme.
subroutine fluid_pnpn_write_boundary_conditions(this)
Write a field with boundary condition specifications.
subroutine fluid_pnpn_step(this, time, dt_controller)
Advance fluid simulation in time.
subroutine fluid_pnpn_assemble_rhs(this, time)
Assemble the explicit part of the right-hand side and extrapolate the velocity.
subroutine fluid_pnpn_free(this)
subroutine fluid_pnpn_update_velocity_lags(this)
Shift the velocity history by one time step. Called once per step, after the right-hand side is assem...
subroutine fluid_pnpn_solve(this, time, dt_controller, proj_prs, proj_vel)
Solve for the pressure and velocity, given an assembled right-hand side.
Defines Gather-scatter operations.
integer, parameter, public gs_op_add
Defines inflow dirichlet conditions.
Utilities for retrieving parameters from the case files.
Implements the base abstract type for Krylov solvers plus helper types.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
Collection of vector field operations operating on and . Note that in general the indices and ....
subroutine, public opcolv(a1, a2, a3, c, gdim, n)
subroutine, public opadd2cm(a1, a2, a3, b1, b2, b3, c, n, gdim)
integer, parameter neko_bcknd_device
Defines no-slip boundary condition (extends zero_dirichlet).
Implements non_normal_aligned_t.
integer, parameter, public dp
integer, parameter, public rp
Global precision used in computations.
subroutine, public ortho(x, glb_n_points, n)
Othogonalize with regard to vector (1,1,1,1,1,1...,1)^T.
Operators accelerator backends.
subroutine, public device_ortho(x_d, glb_n_points, n)
Othogonalize with regard to vector (1,1,1,1,1,1...,1)^T.
Defines Pressure and velocity residuals in the Pn-Pn formulation.
subroutine, public profiler_start_region(name, region_id)
Started a named (name) profiler region.
subroutine, public profiler_end_region(name, region_id)
End the most recently started profiler region.
Project x onto X , the space of old solutions and back again Couple projections for velocity.
Project x onto X, the space of old solutions and back again.
Defines a registry for storing solution fields.
type(registry_t), target, public neko_registry
Global field registry.
Routines to generate the right-hand sides for the convection-diffusion equation. Employs the EXT/BDF ...
Implements scalar_projector_t.
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 shear stress boundary condition for a vector field. Maintainer: Timofey Mukha.
Implements symmetry_aligned_t.
Module with things related to the simulation time.
Implements type time_step_controller.
Interfaces for user interaction with NEKO.
integer, parameter, public neko_typename_len
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Implements boundary condition projectors for vector fields. Two types concrete types are provided: se...
Defines the wall_model_bc_t type. Maintainer: Timofey Mukha.
Defines a zero-valued Dirichlet boundary condition.
Base abstract type for computing the advection operator.
Helmholtz operator carrying a non-owning SVV object.
Matrix-vector product for a Helmholtz problem.
Base type for a matrix-vector product providing .
Base type for a boundary condition.
Blasius profile for inlet (vector valued).
Collection of live simulation data registered for checkpointing.
A named collection of live fields to checkpoint together.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Generic Dirichlet boundary condition on .
Dong outflow condition Follows "A Convective-like Energy-Stable Open Boundary Condition forSimulation...
Dirichlet condition in facet normal direction.
User defined dirichlet condition, for which the user can work with an entire field....
Extension of the user defined dirichlet condition field_dirichlet.
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Base type of all fluid formulations.
Dirichlet condition for inlet (vector valued).
Type for storing initial and final residuals in a Krylov solver.
Base type for mixed boundary conditions that need projector-provided local-basis data on the physical...
Mixed Dirichlet condition constraining the tangential vector components.
Axis-aligned mixed Dirichlet condition in the non-normal direction.
Abstract type to compute pressure residual.
Abstract type to compute velocity residual.
Abstract type to add contributions to F from lagged BD terms.
Abstract type to sum up contributions to kth order extrapolation scheme.
Abstract type to add contributions of kth order OIFS scheme.
Abstract type to compute extrapolated velocity field for the pressure equation.
Projector for scalar boundary conditions.
A shear stress boundary condition.
Symmetry boundary condition constraining the normal vector component.
Axis-aligned symmetry boundary condition.
A struct that contains all info about the time, expand as needed.
Provides a tool to set time step dt.
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.
A projector for vector fields that acts component-wise.
Abstract type for resolving vector boundary conditions.
A shear stress boundary condition, computing the stress values using a wall model.
Zero-valued Dirichlet boundary condition. Used for no-slip walls, but also for various auxillary cond...