238 subroutine fluid_pnpn_init(this, msh, lx, params, user)
239 class(fluid_pnpn_t),
target,
intent(inout) :: this
240 type(
mesh_t),
target,
intent(inout) :: msh
241 integer,
intent(in) :: lx
242 type(json_file),
target,
intent(inout) :: params
243 type(
user_t),
target,
intent(in) :: user
244 character(len=15),
parameter :: scheme =
'Modular (Pn/Pn)'
246 class(
bc_t),
pointer :: bc_i, vel_bc
247 real(kind=
rp) :: abs_tol
248 character(len=LOG_SIZE) :: log_buf
249 integer :: ierr, integer_val, solver_maxiter
250 character(len=:),
allocatable :: solver_type, precon_type
251 logical :: monitor, found
257 call this%init_base(msh, lx, params, scheme, user, .true.)
268 call json_get(params,
'case.numerics.time_order', integer_val)
269 allocate(this%ext_bdf)
270 call this%ext_bdf%init(integer_val)
272 if (this%variable_material_properties .eqv. .true.)
then
274 call ax_helm_factory(this%Ax_vel, full_formulation = .true.)
277 call pnpn_prs_res_stress_factory(this%prs_res)
280 call pnpn_vel_res_stress_factory(this%vel_res)
283 call ax_helm_factory(this%Ax_vel, full_formulation = .false.)
286 call pnpn_prs_res_factory(this%prs_res)
289 call pnpn_vel_res_factory(this%vel_res)
293 call ax_helm_factory(this%Ax_prs, full_formulation = .false.)
297 call rhs_maker_sumab_fctry(this%sumab)
300 call rhs_maker_ext_fctry(this%makeabf)
303 call rhs_maker_bdf_fctry(this%makebdf)
306 call rhs_maker_oifs_fctry(this%makeoifs)
309 associate(xh_lx => this%Xh%lx, xh_ly => this%Xh%ly, xh_lz => this%Xh%lz, &
310 dm_xh => this%dm_Xh, nelv => this%msh%nelv)
312 call this%p_res%init(dm_xh,
"p_res")
313 call this%u_res%init(dm_xh,
"u_res")
314 call this%v_res%init(dm_xh,
"v_res")
315 call this%w_res%init(dm_xh,
"w_res")
316 call this%abx1%init(dm_xh,
"abx1")
317 call this%aby1%init(dm_xh,
"aby1")
318 call this%abz1%init(dm_xh,
"abz1")
319 call this%abx2%init(dm_xh,
"abx2")
320 call this%aby2%init(dm_xh,
"aby2")
321 call this%abz2%init(dm_xh,
"abz2")
322 call this%advx%init(dm_xh,
"advx")
323 call this%advy%init(dm_xh,
"advy")
324 call this%advz%init(dm_xh,
"advz")
327 call this%du%init(this%dm_Xh,
'du')
328 call this%dv%init(this%dm_Xh,
'dv')
329 call this%dw%init(this%dm_Xh,
'dw')
330 call this%dp%init(this%dm_Xh,
'dp')
333 call this%setup_bcs(user, params)
337 if (found)
call this%write_boundary_conditions()
339 call this%proj_prs%init(this%dm_Xh%size(), this%pr_projection_dim, &
340 this%pr_projection_activ_step)
342 call this%proj_vel%init(this%dm_Xh%size(), this%vel_projection_dim, &
343 this%vel_projection_activ_step)
347 call this%chkp%add_lag(this%ulag, this%vlag, this%wlag)
354 call advection_factory(this%adv, params, this%c_Xh, &
355 this%ulag, this%vlag, this%wlag, &
356 this%chkp%dtlag, this%chkp%tlag, this%ext_bdf, &
359 if (params%valid_path(
'case.fluid.flow_rate_force'))
then
360 call this%vol_flow%init(this%dm_Xh, params)
364 call neko_log%section(
"Pressure solver")
367 'case.fluid.pressure_solver.max_iterations', &
369 call json_get(params,
'case.fluid.pressure_solver.type', solver_type)
370 call json_get(params,
'case.fluid.pressure_solver.preconditioner', &
372 call json_get(params,
'case.fluid.pressure_solver.absolute_tolerance', &
376 call neko_log%message(
'Type : ('// trim(solver_type) // &
377 ', ' // trim(precon_type) //
')')
378 write(log_buf,
'(A,ES13.6)')
'Abs tol :', abs_tol
381 call this%solver_factory(this%ksp_prs, this%dm_Xh%size(), &
382 solver_type, solver_maxiter, abs_tol, monitor)
383 call this%precon_factory_(this%pc_prs, this%ksp_prs, &
384 this%c_Xh, this%dm_Xh, this%gs_Xh, this%bcs_prs, precon_type)
390 subroutine fluid_pnpn_restart(this, dtlag, tlag)
391 class(fluid_pnpn_t),
target,
intent(inout) :: this
392 real(kind=rp) :: dtlag(10), tlag(10)
393 type(field_t) :: u_temp, v_temp, w_temp
396 n = this%u%dof%size()
397 if (
allocated(this%chkp%previous_mesh%elements) .or. &
398 this%chkp%previous_Xh%lx .ne. this%Xh%lx)
then
399 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
400 c_xh => this%c_Xh, ulag => this%ulag, vlag => this%vlag, &
402 do concurrent(j = 1:n)
403 u%x(j,1,1,1) = u%x(j,1,1,1) * c_xh%mult(j,1,1,1)
404 v%x(j,1,1,1) = v%x(j,1,1,1) * c_xh%mult(j,1,1,1)
405 w%x(j,1,1,1) = w%x(j,1,1,1) * c_xh%mult(j,1,1,1)
406 p%x(j,1,1,1) = p%x(j,1,1,1) * c_xh%mult(j,1,1,1)
408 do i = 1, this%ulag%size()
409 do concurrent(j = 1:n)
410 ulag%lf(i)%x(j,1,1,1) = ulag%lf(i)%x(j,1,1,1) &
412 vlag%lf(i)%x(j,1,1,1) = vlag%lf(i)%x(j,1,1,1) &
414 wlag%lf(i)%x(j,1,1,1) = wlag%lf(i)%x(j,1,1,1) &
421 if (neko_bcknd_device .eq. 1)
then
422 associate(u => this%u, v => this%v, w => this%w, &
423 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag,&
425 call device_memcpy(u%x, u%x_d, u%dof%size(), &
426 host_to_device, sync = .false.)
427 call device_memcpy(v%x, v%x_d, v%dof%size(), &
428 host_to_device, sync = .false.)
429 call device_memcpy(w%x, w%x_d, w%dof%size(), &
430 host_to_device, sync = .false.)
431 call device_memcpy(p%x, p%x_d, p%dof%size(), &
432 host_to_device, sync = .false.)
433 call device_memcpy(ulag%lf(1)%x, ulag%lf(1)%x_d, &
434 u%dof%size(), host_to_device, sync = .false.)
435 call device_memcpy(ulag%lf(2)%x, ulag%lf(2)%x_d, &
436 u%dof%size(), host_to_device, sync = .false.)
438 call device_memcpy(vlag%lf(1)%x, vlag%lf(1)%x_d, &
439 v%dof%size(), host_to_device, sync = .false.)
440 call device_memcpy(vlag%lf(2)%x, vlag%lf(2)%x_d, &
441 v%dof%size(), host_to_device, sync = .false.)
443 call device_memcpy(wlag%lf(1)%x, wlag%lf(1)%x_d, &
444 w%dof%size(), host_to_device, sync = .false.)
445 call device_memcpy(wlag%lf(2)%x, wlag%lf(2)%x_d, &
446 w%dof%size(), host_to_device, sync = .false.)
447 call device_memcpy(this%abx1%x, this%abx1%x_d, &
448 w%dof%size(), host_to_device, sync = .false.)
449 call device_memcpy(this%abx2%x, this%abx2%x_d, &
450 w%dof%size(), host_to_device, sync = .false.)
451 call device_memcpy(this%aby1%x, this%aby1%x_d, &
452 w%dof%size(), host_to_device, sync = .false.)
453 call device_memcpy(this%aby2%x, this%aby2%x_d, &
454 w%dof%size(), host_to_device, sync = .false.)
455 call device_memcpy(this%abz1%x, this%abz1%x_d, &
456 w%dof%size(), host_to_device, sync = .false.)
457 call device_memcpy(this%abz2%x, this%abz2%x_d, &
458 w%dof%size(), host_to_device, sync = .false.)
459 call device_memcpy(this%advx%x, this%advx%x_d, &
460 w%dof%size(), host_to_device, sync = .false.)
461 call device_memcpy(this%advy%x, this%advy%x_d, &
462 w%dof%size(), host_to_device, sync = .false.)
463 call device_memcpy(this%advz%x, this%advz%x_d, &
464 w%dof%size(), host_to_device, sync = .false.)
471 if (
allocated(this%chkp%previous_mesh%elements) &
472 .or. this%chkp%previous_Xh%lx .ne. this%Xh%lx)
then
473 call this%gs_Xh%op(this%u, gs_op_add)
474 call this%gs_Xh%op(this%v, gs_op_add)
475 call this%gs_Xh%op(this%w, gs_op_add)
476 call this%gs_Xh%op(this%p, gs_op_add)
478 do i = 1, this%ulag%size()
479 call this%gs_Xh%op(this%ulag%lf(i), gs_op_add)
480 call this%gs_Xh%op(this%vlag%lf(i), gs_op_add)
481 call this%gs_Xh%op(this%wlag%lf(i), gs_op_add)
624 subroutine fluid_pnpn_step(this, t, tstep, dt, ext_bdf, dt_controller)
625 class(fluid_pnpn_t),
target,
intent(inout) :: this
626 real(kind=rp),
intent(in) :: t
627 integer,
intent(in) :: tstep
628 real(kind=rp),
intent(in) :: dt
629 type(time_scheme_controller_t),
intent(in) :: ext_bdf
630 type(time_step_controller_t),
intent(in) :: dt_controller
634 type(ksp_monitor_t) :: ksp_results(4)
636 type(file_t) :: dump_file
637 class(bc_t),
pointer :: bc_i
638 type(non_normal_t),
pointer :: bc_j
640 if (this%freeze)
return
642 n = this%dm_Xh%size()
644 call profiler_start_region(
'Fluid', 1)
645 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
646 u_e => this%u_e, v_e => this%v_e, w_e => this%w_e, &
647 du => this%du, dv => this%dv, dw => this%dw, dp => this%dp, &
648 u_res => this%u_res, v_res => this%v_res, w_res => this%w_res, &
649 p_res => this%p_res, ax_vel => this%Ax_vel, ax_prs => this%Ax_prs, &
651 c_xh => this%c_Xh, dm_xh => this%dm_Xh, gs_xh => this%gs_Xh, &
652 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag, &
653 msh => this%msh, prs_res => this%prs_res, &
654 source_term => this%source_term, vel_res => this%vel_res, &
655 sumab => this%sumab, makeoifs => this%makeoifs, &
656 makeabf => this%makeabf, makebdf => this%makebdf, &
657 vel_projection_dim => this%vel_projection_dim, &
658 pr_projection_dim => this%pr_projection_dim, &
659 rho => this%rho, mu => this%mu, oifs => this%oifs, &
660 rho_field => this%rho_field, mu_field => this%mu_field, &
661 f_x => this%f_x, f_y => this%f_y, f_z => this%f_z, &
662 if_variable_dt => dt_controller%if_variable_dt, &
663 dt_last_change => dt_controller%dt_last_change, &
664 event => glb_cmd_event)
667 call sumab%compute_fluid(u_e, v_e, w_e, u, v, w, &
668 ulag, vlag, wlag, ext_bdf%advection_coeffs, ext_bdf%nadv)
671 call this%source_term%compute(t, tstep)
674 call this%bcs_vel%apply_vector(f_x%x, f_y%x, f_z%x, &
675 this%dm_Xh%size(), t, tstep, strong = .false.)
678 if (this%if_gradient_jump_penalty .eqv. .true.)
then
679 call this%gradient_jump_penalty_u%compute(u, v, w, u)
680 call this%gradient_jump_penalty_v%compute(u, v, w, v)
681 call this%gradient_jump_penalty_w%compute(u, v, w, w)
682 call this%gradient_jump_penalty_u%perform(f_x)
683 call this%gradient_jump_penalty_v%perform(f_y)
684 call this%gradient_jump_penalty_w%perform(f_z)
689 call this%adv%compute(u, v, w, &
690 this%advx, this%advy, this%advz, &
691 xh, this%c_Xh, dm_xh%size(), dt)
697 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
698 this%abx2, this%aby2, this%abz2, &
699 f_x%x, f_y%x, f_z%x, &
700 rho, ext_bdf%advection_coeffs, n)
703 call makeoifs%compute_fluid(this%advx%x, this%advy%x, this%advz%x, &
704 f_x%x, f_y%x, f_z%x, &
708 call this%adv%compute(u, v, w, &
710 xh, this%c_Xh, dm_xh%size())
716 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
717 this%abx2, this%aby2, this%abz2, &
718 f_x%x, f_y%x, f_z%x, &
719 rho, ext_bdf%advection_coeffs, n)
722 call makebdf%compute_fluid(ulag, vlag, wlag, f_x%x, f_y%x, f_z%x, &
723 u, v, w, c_xh%B, rho, dt, &
724 ext_bdf%diffusion_coeffs, ext_bdf%ndiff, n)
731 call this%bc_apply_vel(t, tstep, strong = .true.)
732 call this%bc_apply_prs(t, tstep)
735 call this%update_material_properties()
738 call profiler_start_region(
'Pressure_residual', 18)
740 call prs_res%compute(p, p_res,&
745 this%bc_prs_surface, this%bc_sym_surface,&
746 ax_prs, ext_bdf%diffusion_coeffs(1), dt, &
747 mu_field, rho_field, event)
750 if (.not. this%prs_dirichlet)
call ortho(p_res%x, this%glb_n_points, n)
752 call gs_xh%op(p_res, gs_op_add, event)
753 if (neko_bcknd_device .eq. 1)
then
754 call device_stream_wait_event(glb_cmd_queue, event, 0)
758 call this%bclst_dp%apply_scalar(p_res%x, p%dof%size(), t, tstep)
761 call profiler_end_region(
'Pressure_residual', 18)
764 call this%proj_prs%pre_solving(p_res%x, tstep, c_xh, n, dt_controller, &
767 call this%pc_prs%update()
769 call profiler_start_region(
'Pressure_solve', 3)
773 this%ksp_prs%solve(ax_prs, dp, p_res%x, n, c_xh, this%bclst_dp, gs_xh)
776 call profiler_end_region(
'Pressure_solve', 3)
778 call this%proj_prs%post_solving(dp%x, ax_prs, c_xh, &
779 this%bclst_dp, gs_xh, n, tstep, dt_controller)
782 call field_add2(p, dp, n)
783 if (.not. this%prs_dirichlet)
call ortho(p%x, this%glb_n_points, n)
786 call profiler_start_region(
'Velocity_residual', 19)
787 call vel_res%compute(ax_vel, u, v, w, &
788 u_res, v_res, w_res, &
792 mu_field, rho_field, ext_bdf%diffusion_coeffs(1), &
795 call gs_xh%op(u_res, gs_op_add, event)
796 call gs_xh%op(v_res, gs_op_add, event)
797 call gs_xh%op(w_res, gs_op_add, event)
798 if (neko_bcknd_device .eq. 1)
then
799 call device_stream_wait_event(glb_cmd_queue, event, 0)
803 call this%bclst_vel_res%apply(u_res, v_res, w_res, t, tstep)
806 call profiler_end_region(
'Velocity_residual', 19)
808 call this%proj_vel%pre_solving(u_res%x, v_res%x, w_res%x, &
809 tstep, c_xh, n, dt_controller,
'Velocity')
811 call this%pc_vel%update()
813 call profiler_start_region(
"Velocity_solve", 4)
814 ksp_results(2:4) = this%ksp_vel%solve_coupled(ax_vel, du, dv, dw, &
815 u_res%x, v_res%x, w_res%x, n, c_xh, &
816 this%bclst_du, this%bclst_dv, this%bclst_dw, gs_xh, &
817 this%ksp_vel%max_iter)
818 call profiler_end_region(
"Velocity_solve", 4)
820 call this%proj_vel%post_solving(du%x, dv%x, dw%x, ax_vel, c_xh, &
821 this%bclst_du, this%bclst_dv, this%bclst_dw, gs_xh, n, tstep, &
824 if (neko_bcknd_device .eq. 1)
then
825 call device_opadd2cm(u%x_d, v%x_d, w%x_d, &
826 du%x_d, dv%x_d, dw%x_d, 1.0_rp, n, msh%gdim)
828 call opadd2cm(u%x, v%x, w%x, du%x, dv%x, dw%x, 1.0_rp, n, msh%gdim)
831 if (this%forced_flow_rate)
then
832 call this%vol_flow%adjust( u, v, w, p, u_res, v_res, w_res, p_res, &
833 c_xh, gs_xh, ext_bdf, rho, mu, dt, &
834 this%bclst_dp, this%bclst_du, this%bclst_dv, &
835 this%bclst_dw, this%bclst_vel_res, ax_vel, ax_prs, this%ksp_prs, &
836 this%ksp_vel, this%pc_prs, this%pc_vel, this%ksp_prs%max_iter, &
837 this%ksp_vel%max_iter)
840 call fluid_step_info(tstep, t, dt, ksp_results, this%strict_convergence)
843 call profiler_end_region(
'Fluid', 1)
848 subroutine fluid_pnpn_setup_bcs(this, user, params)
849 class(fluid_pnpn_t),
intent(inout) :: this
850 type(user_t),
target,
intent(in) :: user
851 type(json_file),
intent(inout) :: params
852 integer :: i, n_bcs, zone_index, j, zone_size, global_zone_size, ierr
853 class(bc_t),
pointer :: bc_i
854 type(json_core) :: core
855 type(json_value),
pointer :: bc_object
856 type(json_file) :: bc_subdict
859 logical,
allocatable :: marked_zones(:)
860 integer,
allocatable :: zone_indices(:)
863 call this%bclst_vel_res%init()
864 call this%bclst_du%init()
865 call this%bclst_dv%init()
866 call this%bclst_dw%init()
867 call this%bclst_dp%init()
869 call this%bc_vel_res%init_from_components(this%c_Xh)
870 call this%bc_du%init_from_components(this%c_Xh)
871 call this%bc_dv%init_from_components(this%c_Xh)
872 call this%bc_dw%init_from_components(this%c_Xh)
873 call this%bc_dp%init_from_components(this%c_Xh)
876 call this%bc_prs_surface%init_from_components(this%c_Xh)
877 call this%bc_sym_surface%init_from_components(this%c_Xh)
880 if (params%valid_path(
'case.fluid.boundary_conditions'))
then
881 call params%info(
'case.fluid.boundary_conditions', n_children = n_bcs)
882 call params%get_core(core)
883 call params%get(
'case.fluid.boundary_conditions', bc_object, found)
888 call this%bcs_vel%init(n_bcs)
890 allocate(marked_zones(
size(this%msh%labeled_zones)))
891 marked_zones = .false.
895 call json_extract_item(core, bc_object, i, bc_subdict)
897 call json_get(bc_subdict,
"zone_indices", zone_indices)
902 do j = 1,
size(zone_indices)
903 zone_size = this%msh%labeled_zones(zone_indices(j))%size
904 call mpi_allreduce(zone_size, global_zone_size, 1, &
905 mpi_integer, mpi_max, neko_comm, ierr)
907 if (global_zone_size .eq. 0)
then
908 write(error_unit,
'(A, A, I0, A, A, I0, A)')
"*** ERROR ***: ",&
909 "Zone index ", zone_indices(j), &
910 " is invalid as this zone has 0 size, meaning it ", &
911 "is not in the mesh. Check fluid boundary condition ", &
916 if (marked_zones(zone_indices(j)) .eqv. .true.)
then
917 write(error_unit,
'(A, A, I0, A, A, A, A)')
"*** ERROR ***: ", &
918 "Zone with index ", zone_indices(j), &
919 " has already been assigned a boundary condition. ", &
920 "Please check your boundary_conditions entry for the ", &
921 "fluid and make sure that each zone index appears only ", &
922 "in a single boundary condition."
925 marked_zones(zone_indices(j)) = .true.
930 call velocity_bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
934 if (
associated(bc_i))
then
948 call this%bclst_vel_res%append(bc_i)
949 call this%bc_du%mark_facets(bc_i%bc_x%marked_facet)
950 call this%bc_dv%mark_facets(bc_i%bc_y%marked_facet)
951 call this%bc_dw%mark_facets(bc_i%bc_z%marked_facet)
953 call this%bcs_vel%append(bc_i)
955 call this%bc_sym_surface%mark_facets(bc_i%marked_facet)
956 type is (non_normal_t)
959 call this%bclst_vel_res%append(bc_i)
960 call this%bc_du%mark_facets(bc_i%bc_x%marked_facet)
961 call this%bc_dv%mark_facets(bc_i%bc_y%marked_facet)
962 call this%bc_dw%mark_facets(bc_i%bc_z%marked_facet)
963 type is (shear_stress_t)
965 call this%bclst_vel_res%append(bc_i%symmetry)
966 call this%bclst_du%append(bc_i%symmetry%bc_x)
967 call this%bclst_dv%append(bc_i%symmetry%bc_y)
968 call this%bclst_dw%append(bc_i%symmetry%bc_z)
970 call this%bcs_vel%append(bc_i)
971 type is (wall_model_bc_t)
973 call this%bclst_vel_res%append(bc_i%symmetry)
974 call this%bclst_du%append(bc_i%symmetry%bc_x)
975 call this%bclst_dv%append(bc_i%symmetry%bc_y)
976 call this%bclst_dw%append(bc_i%symmetry%bc_z)
978 call this%bcs_vel%append(bc_i)
985 if (bc_i%strong .eqv. .true.)
then
986 call this%bc_vel_res%mark_facets(bc_i%marked_facet)
987 call this%bc_du%mark_facets(bc_i%marked_facet)
988 call this%bc_dv%mark_facets(bc_i%marked_facet)
989 call this%bc_dw%mark_facets(bc_i%marked_facet)
991 call this%bc_prs_surface%mark_facets(bc_i%marked_facet)
994 call this%bcs_vel%append(bc_i)
1000 do i = 1,
size(this%msh%labeled_zones)
1001 if ((this%msh%labeled_zones(i)%size .gt. 0) .and. &
1002 (marked_zones(i) .eqv. .false.))
then
1003 write(error_unit,
'(A, A, I0)')
"*** ERROR ***: ", &
1004 "No fluid boundary condition assigned to zone ", i
1012 call this%bcs_prs%init(n_bcs)
1016 call json_extract_item(core, bc_object, i, bc_subdict)
1018 call pressure_bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
1022 if (
associated(bc_i))
then
1023 call this%bcs_prs%append(bc_i)
1026 if (bc_i%strong .eqv. .true.)
then
1027 call this%bc_dp%mark_facets(bc_i%marked_facet)
1035 do i = 1,
size(this%msh%labeled_zones)
1036 if (this%msh%labeled_zones(i)%size .gt. 0)
then
1037 call neko_error(
"No boundary_conditions entry in the case file!")
1043 call this%bc_prs_surface%finalize()
1044 call this%bc_sym_surface%finalize()
1046 call this%bc_vel_res%finalize()
1047 call this%bc_du%finalize()
1048 call this%bc_dv%finalize()
1049 call this%bc_dw%finalize()
1050 call this%bc_dp%finalize()
1052 call this%bclst_vel_res%append(this%bc_vel_res)
1053 call this%bclst_du%append(this%bc_du)
1054 call this%bclst_dv%append(this%bc_dv)
1055 call this%bclst_dw%append(this%bc_dw)
1056 call this%bclst_dp%append(this%bc_dp)
1059 this%prs_dirichlet = .not. this%bclst_dp%is_empty()
1060 call mpi_allreduce(mpi_in_place, this%prs_dirichlet, 1, &
1061 mpi_logical, mpi_lor, neko_comm)
1066 subroutine fluid_pnpn_write_boundary_conditions(this)
1073 class(fluid_pnpn_t),
target,
intent(inout) :: this
1074 type(dirichlet_t) :: bdry_mask
1075 type(field_t),
pointer :: bdry_field
1076 type(file_t) :: bdry_file
1077 integer :: temp_index, i
1078 class(bc_t),
pointer :: bci
1079 character(len=LOG_SIZE) :: log_buf
1081 call neko_log%section(
"Fluid boundary conditions")
1082 write(log_buf,
'(A)')
'Marking using integer keys in bdry0.f00000'
1083 call neko_log%message(log_buf)
1084 write(log_buf,
'(A)')
'Condition-value pairs: '
1085 call neko_log%message(log_buf)
1086 write(log_buf,
'(A)')
' no_slip = 1'
1087 call neko_log%message(log_buf)
1088 write(log_buf,
'(A)')
' velocity_value = 2'
1089 call neko_log%message(log_buf)
1090 write(log_buf,
'(A)')
' outflow, normal_outflow (+dong) = 3'
1091 call neko_log%message(log_buf)
1092 write(log_buf,
'(A)')
' symmetry = 4'
1093 call neko_log%message(log_buf)
1094 write(log_buf,
'(A)')
' user_velocity_pointwise = 5'
1095 call neko_log%message(log_buf)
1096 write(log_buf,
'(A)')
' periodic = 6'
1097 call neko_log%message(log_buf)
1098 write(log_buf,
'(A)')
' user_velocity = 7'
1099 call neko_log%message(log_buf)
1100 write(log_buf,
'(A)')
' user_pressure = 8'
1101 call neko_log%message(log_buf)
1102 write(log_buf,
'(A)')
' shear_stress = 9'
1103 call neko_log%message(log_buf)
1104 write(log_buf,
'(A)')
' wall_modelling = 10'
1105 call neko_log%message(log_buf)
1106 write(log_buf,
'(A)')
' blasius_profile = 11'
1107 call neko_log%message(log_buf)
1108 call neko_log%end_section()
1110 call this%scratch%request_field(bdry_field, temp_index)
1115 call bdry_mask%init_from_components(this%c_Xh, 6.0_rp)
1116 call bdry_mask%mark_zone(this%msh%periodic)
1117 call bdry_mask%finalize()
1118 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1119 call bdry_mask%free()
1121 do i = 1, this%bcs_prs%size()
1122 bci => this%bcs_prs%get(i)
1123 select type (
bc => bci)
1124 type is (zero_dirichlet_t)
1125 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1126 call bdry_mask%mark_facets(bci%marked_facet)
1127 call bdry_mask%finalize()
1128 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1129 call bdry_mask%free()
1131 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1132 call bdry_mask%mark_facets(bci%marked_facet)
1133 call bdry_mask%finalize()
1134 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1135 call bdry_mask%free()
1137 call bdry_mask%init_from_components(this%c_Xh, 8.0_rp)
1138 call bdry_mask%mark_facets(bci%marked_facet)
1139 call bdry_mask%finalize()
1140 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1141 call bdry_mask%free()
1145 do i = 1, this%bcs_vel%size()
1146 bci => this%bcs_vel%get(i)
1147 select type (
bc => bci)
1148 type is (zero_dirichlet_t)
1149 call bdry_mask%init_from_components(this%c_Xh, 1.0_rp)
1150 call bdry_mask%mark_facets(bci%marked_facet)
1151 call bdry_mask%finalize()
1152 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1153 call bdry_mask%free()
1155 call bdry_mask%init_from_components(this%c_Xh, 2.0_rp)
1156 call bdry_mask%mark_facets(bci%marked_facet)
1157 call bdry_mask%finalize()
1158 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1159 call bdry_mask%free()
1160 type is (symmetry_t)
1161 call bdry_mask%init_from_components(this%c_Xh, 4.0_rp)
1162 call bdry_mask%mark_facets(bci%marked_facet)
1163 call bdry_mask%finalize()
1164 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1165 call bdry_mask%free()
1167 call bdry_mask%init_from_components(this%c_Xh, 5.0_rp)
1168 call bdry_mask%mark_facets(bci%marked_facet)
1169 call bdry_mask%finalize()
1170 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1171 call bdry_mask%free()
1173 call bdry_mask%init_from_components(this%c_Xh, 7.0_rp)
1174 call bdry_mask%mark_facets(bci%marked_facet)
1175 call bdry_mask%finalize()
1176 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1177 call bdry_mask%free()
1178 type is (shear_stress_t)
1179 call bdry_mask%init_from_components(this%c_Xh, 9.0_rp)
1180 call bdry_mask%mark_facets(bci%marked_facet)
1181 call bdry_mask%finalize()
1182 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1183 call bdry_mask%free()
1184 type is (wall_model_bc_t)
1185 call bdry_mask%init_from_components(this%c_Xh, 10.0_rp)
1186 call bdry_mask%mark_facets(bci%marked_facet)
1187 call bdry_mask%finalize()
1188 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1189 call bdry_mask%free()
1191 call bdry_mask%init_from_components(this%c_Xh, 11.0_rp)
1192 call bdry_mask%mark_facets(bci%marked_facet)
1193 call bdry_mask%finalize()
1194 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1195 call bdry_mask%free()
1200 bdry_file = file_t(
'bdry.fld')
1201 call bdry_file%write(bdry_field)
1203 call this%scratch%relinquish_field(temp_index)