Neko 1.99.10
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
fluid_pnpn.f90
Go to the documentation of this file.
1! Copyright (c) 2022-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!
33!> Modular version of the Classic Nek5000 Pn/Pn formulation for fluids
35 use coefs, only : coef_t
36 use registry, only : neko_registry
37 use logger, only : neko_log, log_size
38 use num_types, only : rp, dp
39 use krylov, only : ksp_monitor_t
41 pnpn_prs_res_factory, pnpn_vel_res_factory, &
42 pnpn_prs_res_stress_factory, pnpn_vel_res_stress_factory
44 rhs_maker_oifs_t, rhs_maker_sumab_fctry, rhs_maker_bdf_fctry, &
45 rhs_maker_ext_fctry, rhs_maker_oifs_fctry
50 use fluid_aux, only : fluid_step_info
51 use projection, only : projection_t
54 use advection, only : advection_t, advection_factory
55 use adv_oifs, only : adv_oifs_t
57 use json_module, only : json_file, json_core, json_value
60 use ax_product, only : ax_t, ax_helm_allocator
61 use ax_helm_svv, only : ax_helm_svv_t
63 use field, only : field_t
64 use dirichlet, only : dirichlet_t
69 use non_normal, only : non_normal_t
71 use symmetry, only : symmetry_t
72 use checkpoint, only : chkp_t
74 use mesh, only : mesh_t
75 use user_intf, only : user_t
77 use gs_ops, only : gs_op_add
79 use mathops, only : opadd2cm, opcolv
83 use bc, only : bc_t, bc_dirichlet
84 use mixed_bc, only : mixed_bc_t
88 use file, only : file_t
89 use operators, only : ortho, rotate_cyc
90 use opr_device, only : device_ortho
91 use time_state, only : time_state_t
92 use comm, only : neko_comm
93 use ale_manager, only : ale_manager_t
95 use mpi_f08, only : mpi_allreduce, mpi_in_place, mpi_max, mpi_lor, &
96 mpi_integer, mpi_logical
97 implicit none
98 private
99
100
101
103
104 !> Number of schwarz-like iterations to perform each time step.
105 !! Set to 0 for no iterations.
106 integer :: schwarz_iterations = 0
107
108 !> The right-hand sides in the linear solves.
109 type(field_t) :: p_res, u_res, v_res, w_res
110
111 !> The unknowns in the linear solves, i.e. the solution increments with
112 !! respect to the previous time-step.
113 type(field_t) :: dp, du, dv, dw
114
115 !> ALE Manager
116 type(ale_manager_t) :: ale
117
118 ! ! Implicit operators, i.e. the left-hand-side of the Helmholz problem.
119 !
120
121 ! Coupled Helmholz operator for velocity
122 class(ax_t), allocatable :: ax_vel
123 ! Helmholz operator for pressure
124 class(ax_t), allocatable :: ax_prs
125
126 !
127 ! Projections for solver speed-up
128 !
129
130 !> Pressure projection
131 type(projection_t) :: proj_prs
132 type(projection_vel_t) :: proj_vel
133
134 !
135 ! Special Karniadakis scheme boundary conditions in the pressure equation
136 !
137
138 !> Surface term in pressure rhs. Masks all strong velocity bcs.
139 type(facet_normal_t) :: bc_prs_surface
140
141 !> Surface term in pressure rhs. Masks symmetry bcs.
142 type(facet_normal_t) :: bc_sym_surface
143
144 !> Boundary conditions projector for velocity constraints.
145 class(vector_bc_projector_t), allocatable :: bcs_vel_projector
146 !> Boundary conditions projector for pressure constraints.
147 type(scalar_bc_projector_t) :: bcs_prs_projector
148
149
150 ! Checker for wether we have a strong pressure bc. If not, the pressure
151 ! is demeaned at every time step.
152 logical :: prs_dirichlet = .false.
153
154
155 ! The advection operator.
156 class(advection_t), allocatable :: adv
157
158 ! Time OIFS interpolation scheme for advection.
159 logical :: oifs
160
161 ! Time variables
162 type(field_t) :: abx1, aby1, abz1
163 type(field_t) :: abx2, aby2, abz2
164
165 ! Advection terms for the oifs method
166 type(field_t) :: advx, advy, advz
167
168 !> Pressure residual equation for computing `p_res`.
169 class(pnpn_prs_res_t), allocatable :: prs_res
170
171 !> Velocity residual equation for computing `u_res`, `v_res`, `w_res`.
172 class(pnpn_vel_res_t), allocatable :: vel_res
173
174 !> Summation of AB/BDF contributions
175 class(rhs_maker_sumab_t), allocatable :: sumab
176
177 !> Contributions to kth order extrapolation scheme
178 class(rhs_maker_ext_t), allocatable :: makeabf
179
180 !> Contributions to F from lagged BD terms
181 class(rhs_maker_bdf_t), allocatable :: makebdf
182
183 !> Contributions to the RHS from the OIFS method
184 class(rhs_maker_oifs_t), allocatable :: makeoifs
185
186 !> Adjust flow volume
187 type(fluid_volflow_t) :: vol_flow
188
189 !> Whether to use the full formulation of the viscous stress term
190 logical :: full_stress_formulation = .false.
191
192 contains
193 !> Constructor.
194 procedure, pass(this) :: init => fluid_pnpn_init
195 !> Destructor.
196 procedure, pass(this) :: free => fluid_pnpn_free
197 !> Perform a single time-step of the scheme.
198 procedure, pass(this) :: step => fluid_pnpn_step
199 !> Restart from a previous solution.
200 procedure, pass(this) :: restart => fluid_pnpn_restart
201 !> Set the initial condition, the lagged velocity fields and the ALE
202 !! mesh velocity.
203 procedure, pass(this) :: set_initial_condition => &
205 !> Set up boundary conditions.
206 procedure, pass(this) :: setup_bcs => fluid_pnpn_setup_bcs
207 !> Write a field with boundary condition specifications.
208 procedure, pass(this) :: write_boundary_conditions => &
210 end type fluid_pnpn_t
211
212 interface
213 !> Split a boundary condition entry of the case file into a velocity
214 !! part and a pressure part.
215 !! @param[inout] json The boundary condition entry.
216 !! @param[inout] velocity_json The velocity part, valid if `has_velocity`.
217 !! @param[inout] pressure_json The pressure part, valid if `has_pressure`.
218 !! @param[out] has_velocity Whether the entry defines a velocity condition.
219 !! @param[out] has_pressure Whether the entry defines a pressure condition.
220 module subroutine fluid_pnpn_bc_split(json, velocity_json, &
221 pressure_json, has_velocity, has_pressure)
222 type(json_file), intent(inout) :: json
223 type(json_file), intent(inout) :: velocity_json
224 type(json_file), intent(inout) :: pressure_json
225 logical, intent(out) :: has_velocity
226 logical, intent(out) :: has_pressure
227 end subroutine fluid_pnpn_bc_split
228 end interface
229
230 interface
231 !> Boundary condition factory for pressure.
232 !! @details Will mark a mesh zone for the bc and finalize.
233 !! @param[inout] object The object to be allocated.
234 !! @param[in] scheme The `fluid_pnpn` scheme.
235 !! @param[inout] json The pressure part of the boundary condition entry.
236 !! @param[in] coef SEM coefficients.
237 !! @param[in] user The user interface.
238 module subroutine pressure_bc_factory(object, scheme, json, coef, user)
239 class(bc_t), pointer, intent(inout) :: object
240 type(fluid_pnpn_t), intent(in) :: scheme
241 type(json_file), intent(inout) :: json
242 type(coef_t), target, intent(in) :: coef
243 type(user_t), target, intent(in) :: user
244 end subroutine pressure_bc_factory
245 end interface
246
247 interface
248 !> Boundary condition factory for velocity
249 !! @details Will mark a mesh zone for the bc and finalize.
250 !! @param[inout] object The object to be allocated.
251 !! @param[in] scheme The `fluid_pnpn` scheme.
252 !! @param[inout] json The velocity part of the boundary condition entry.
253 !! @param[in] coef SEM coefficients.
254 !! @param[in] user The user interface.
255 module subroutine velocity_bc_factory(object, scheme, json, coef, user)
256 class(bc_t), pointer, intent(inout) :: object
257 type(fluid_pnpn_t), intent(in) :: scheme
258 type(json_file), intent(inout) :: json
259 type(coef_t), target, intent(in) :: coef
260 type(user_t), target, intent(in) :: user
261 end subroutine velocity_bc_factory
262 end interface
263
264 interface
265 !> Velocity boundary condition allocator.
266 !! @param[inout] object The object to be allocated.
267 !! @param[in] type_name The name of the boundary condition type.
268 !! @param[in] full_stress_formulation Whether the scheme uses the full
269 !! viscous stress formulation.
270 module subroutine fluid_pnpn_velocity_bc_allocator(object, type_name, &
271 full_stress_formulation)
272 class(bc_t), pointer, intent(inout) :: object
273 character(len=*), intent(in) :: type_name
274 logical, intent(in) :: full_stress_formulation
275 end subroutine fluid_pnpn_velocity_bc_allocator
276 end interface
277
278 interface
279 !> Pressure boundary condition allocator.
280 !! @param[inout] object The object to be allocated.
281 !! @param[in] type_name The name of the boundary condition type.
282 module subroutine fluid_pnpn_pressure_bc_allocator(object, type_name)
283 class(bc_t), pointer, intent(inout) :: object
284 character(len=*), intent(in) :: type_name
285 end subroutine fluid_pnpn_pressure_bc_allocator
286 end interface
287
288 !
289 ! Machinery for injecting user-defined types
290 !
291
292 !> Interface for a fluid Pn/Pn boundary condition allocator.
293 !! Implemented in user modules, it should allocate `obj` to the custom user
294 !! type.
295 abstract interface
296 subroutine fluid_pnpn_bc_allocate(obj)
297 import bc_t
298 class(bc_t), pointer, intent(inout) :: obj
299 end subroutine fluid_pnpn_bc_allocate
300 end interface
301
302 interface
303 !> Called in user modules to add an allocator for custom velocity
304 !! boundary condition types.
305 !! @param[in] type_name The name of the boundary condition type.
306 !! @param[in] allocator The allocator for the custom user type.
307 module subroutine register_fluid_pnpn_velocity_bc(type_name, allocator)
308 character(len=*), intent(in) :: type_name
309 procedure(fluid_pnpn_bc_allocate), pointer, intent(in) :: allocator
310 end subroutine register_fluid_pnpn_velocity_bc
311 end interface
312
313 interface
314 !> Called in user modules to add an allocator for custom pressure
315 !! boundary condition types.
316 !! @param[in] type_name The name of the boundary condition type.
317 !! @param[in] allocator The allocator for the custom user type.
318 module subroutine register_fluid_pnpn_pressure_bc(type_name, allocator)
319 character(len=*), intent(in) :: type_name
320 procedure(fluid_pnpn_bc_allocate), pointer, intent(in) :: allocator
321 end subroutine register_fluid_pnpn_pressure_bc
322 end interface
323
324 !> A name-allocator pair for user-defined fluid Pn/Pn boundary conditions.
325 type fluid_pnpn_bc_allocator_entry
326 character(len=NEKO_TYPENAME_LEN) :: type_name
327 procedure(fluid_pnpn_bc_allocate), pointer, nopass :: allocator => null()
328 end type fluid_pnpn_bc_allocator_entry
329
330 !> Registry of user-defined velocity boundary condition allocators.
331 type(fluid_pnpn_bc_allocator_entry), allocatable, private :: &
332 fluid_pnpn_velocity_bc_registry(:)
333
334 !> The size of `fluid_pnpn_velocity_bc_registry`.
335 integer, private :: fluid_pnpn_velocity_bc_registry_size = 0
336
337 !> Registry of user-defined pressure boundary condition allocators.
338 type(fluid_pnpn_bc_allocator_entry), allocatable, private :: &
339 fluid_pnpn_pressure_bc_registry(:)
340
341 !> The size of `fluid_pnpn_pressure_bc_registry`.
342 integer, private :: fluid_pnpn_pressure_bc_registry_size = 0
343
344 public :: fluid_pnpn_bc_split, fluid_pnpn_bc_allocate, &
345 fluid_pnpn_velocity_bc_allocator, fluid_pnpn_pressure_bc_allocator, &
346 register_fluid_pnpn_velocity_bc, register_fluid_pnpn_pressure_bc
347
348contains
349
350 subroutine fluid_pnpn_init(this, msh, lx, params, user, chkp)
351 class(fluid_pnpn_t), target, intent(inout) :: this
352 type(mesh_t), target, intent(inout) :: msh
353 integer, intent(in) :: lx
354 type(json_file), target, intent(inout) :: params
355 type(user_t), target, intent(in) :: user
356 type(chkp_t), target, intent(inout) :: chkp
357 character(len=15), parameter :: scheme = 'Modular (Pn/Pn)'
358 integer :: i
359 class(bc_t), pointer :: bc_i, vel_bc
360 real(kind=rp) :: abs_tol
361 character(len=LOG_SIZE) :: log_buf
362 integer :: ierr, integer_val
363 character(len=:), allocatable :: solver_type, precon_type
364 logical :: found
365 logical :: advection
366 type(json_file) :: numerics_params, precon_params, solver_params
367 type(checkpoint_payload_t), pointer :: payload
368 real(kind=dp), pointer :: tlag(:), dtlag(:)
369
370 call this%free()
371
372 ! Initialize base class
373 call this%init_base(msh, lx, params, scheme, user, .true.)
374
375 ! Add pressure field to the registry. For this scheme it is in the same
376 ! Xh as the velocity
377 call neko_registry%add_field(this%dm_Xh, 'p')
378 this%p => neko_registry%get_field('p')
379
380 !
381 ! Select governing equations via associated residual and Ax types
382 !
383
384 call json_get_or_lookup(params, 'case.numerics.time_order', integer_val)
385 allocate(this%ext_bdf)
386 call this%ext_bdf%init(integer_val)
387
388 call json_get_or_default(params, "case.fluid.full_stress_formulation", &
389 this%full_stress_formulation, .false.)
390
391 call json_get_or_default(params, "case.fluid.cyclic", this%c_Xh%cyclic, &
392 .false.)
393 call this%c_Xh%generate_cyclic_bc()
394
395 ! Setup backend dependent Ax routines for the velocity
396 call fluid_pnpn_ax_vel_factory(this)
397
398 if (this%full_stress_formulation) then
399 ! Setup backend dependent prs residual routines
400 call pnpn_prs_res_stress_factory(this%prs_res)
401
402 ! Setup backend dependent vel residual routines
403 call pnpn_vel_res_stress_factory(this%vel_res)
404
405 ! Allocate coupled projector for velocity boundary conditions
406 allocate(coupled_vector_bc_projector_t :: this%bcs_vel_projector)
407 else
408 ! Setup backend dependent prs residual routines
409 call pnpn_prs_res_factory(this%prs_res)
410
411 ! Setup backend dependent vel residual routines
412 call pnpn_vel_res_factory(this%vel_res)
413
414 ! Allocate segregated projector for velocity boundary conditions
415 allocate(segregated_vector_bc_projector_t :: this%bcs_vel_projector)
416 end if
417
418 ! Initialize the velocity bc projector
419 call this%bcs_vel_projector%init(this%c_Xh)
420
421 if (params%valid_path('case.fluid.nut_field')) then
422 if (.not. this%full_stress_formulation) then
423 call neko_error("You need to set full_stress_formulation to " // &
424 "true for the fluid to have a spatially varying " // &
425 "viscocity field.")
426 end if
427 call json_get(params, 'case.fluid.nut_field', this%nut_field_name)
428 else
429 this%nut_field_name = ""
430 end if
431
432 ! Setup Ax for the pressure
433 if (this%c_Xh%geo_compression) then
434 call ax_helm_allocator(this%Ax_prs, type_name = "standard_compr")
435 else
436 call ax_helm_allocator(this%Ax_prs, type_name = "standard")
437 end if
438
439
440 ! Setup backend dependent summation of AB/BDF
441 call rhs_maker_sumab_fctry(this%sumab)
442
443 ! Setup backend dependent summation of extrapolation scheme
444 call rhs_maker_ext_fctry(this%makeabf)
445
446 ! Setup backend depenent contributions to F from lagged BD terms
447 call rhs_maker_bdf_fctry(this%makebdf)
448
449 ! Setup backend dependent summations of the OIFS method
450 call rhs_maker_oifs_fctry(this%makeoifs)
451
452 ! Initialize variables specific to this plan
453 associate(xh_lx => this%Xh%lx, xh_ly => this%Xh%ly, xh_lz => this%Xh%lz, &
454 dm_xh => this%dm_Xh, nelv => this%msh%nelv)
455
456 call this%p_res%init(dm_xh, "p_res")
457 call this%u_res%init(dm_xh, "u_res")
458 call this%v_res%init(dm_xh, "v_res")
459 call this%w_res%init(dm_xh, "w_res")
460 call this%abx1%init(dm_xh, "abx1")
461 call this%aby1%init(dm_xh, "aby1")
462 call this%abz1%init(dm_xh, "abz1")
463 call this%abx2%init(dm_xh, "abx2")
464 call this%aby2%init(dm_xh, "aby2")
465 call this%abz2%init(dm_xh, "abz2")
466 call this%advx%init(dm_xh, "advx")
467 call this%advy%init(dm_xh, "advy")
468 call this%advz%init(dm_xh, "advz")
469 end associate
470
471 call this%du%init(this%dm_Xh, 'du')
472 call this%dv%init(this%dm_Xh, 'dv')
473 call this%dw%init(this%dm_Xh, 'dw')
474 call this%dp%init(this%dm_Xh, 'dp')
475 ! Initialize ALE
476 call this%ale%init(this%c_Xh, params, user, chkp)
477
478 call neko_log%section("Fluid boundary conditions")
479 ! Set up boundary conditions
480 call this%setup_bcs(user, params)
481
482 ! Check if we need to output boundaries
483 call json_get_or_default(params, 'case.output_boundary', found, .false.)
484 if (found) call this%write_boundary_conditions()
485 call neko_log%end_section()
486
487 call this%proj_prs%init(this%dm_Xh%size(), this%pr_projection_dim, &
488 this%pr_projection_activ_step, &
489 this%pr_projection_reorthogonalize_basis)
490
491 call this%proj_vel%init(this%dm_Xh%size(), this%vel_projection_dim, &
492 this%vel_projection_activ_step)
493
494
495
496 ! Determine the time-interpolation scheme
497 call json_get_or_default(params, 'case.numerics.oifs', this%oifs, .false.)
498 if (params%valid_path('case.fluid.flow_rate_force')) then
499 call this%vol_flow%init(this%dm_Xh, params)
500 end if
501
502 ! Setup pressure solver
503 call neko_log%section("Pressure solver")
504
505 call json_get(params, 'case.fluid.pressure_solver', solver_params)
506 call json_get(params, 'case.fluid.pressure_solver.type', solver_type)
507 call json_get(params, 'case.fluid.pressure_solver.preconditioner.type', &
508 precon_type)
509 call json_get(params, &
510 'case.fluid.pressure_solver.preconditioner', precon_params)
511 call json_get_or_lookup(params, &
512 'case.fluid.pressure_solver.absolute_tolerance', &
513 abs_tol)
514 call neko_log%message('Type : ('// trim(solver_type) // &
515 ', ' // trim(precon_type) // ')')
516 write(log_buf, '(A,ES13.6)') 'Abs tol :', abs_tol
517 call neko_log%message(log_buf)
518
519 call this%solver_factory(this%ksp_prs, this%dm_Xh%size(), solver_params)
520 call this%precon_factory_(this%pc_prs, this%ksp_prs, &
521 this%c_Xh, this%bcs_prs, &
522 precon_type, precon_params)
523 call neko_log%end_section()
524
525 ! Initialize the advection factory
526 call json_get_or_default(params, 'case.fluid.advection', advection, .true.)
527 ! OIFS integrates the advection term. With advection disabled, fall back to
528 ! the standard BDF history assembly.
529 this%oifs = this%oifs .and. advection
530 call json_get(params, 'case.numerics', numerics_params)
531 call chkp%get_time_history(tlag, dtlag)
532 call advection_factory(this%adv, numerics_params, this%c_Xh, &
533 this%ulag, this%vlag, this%wlag, &
534 dtlag, tlag, this%ext_bdf, &
535 .not. advection)
536 ! Should be in init_base maybe?
537 this%chkp => chkp
538 ! Register the scheme state for checkpointing.
539 payload => this%chkp%add_payload("fluid")
540 call payload%add_field(this%u)
541 call payload%add_field(this%v)
542 call payload%add_field(this%w)
543 call payload%add_field(this%p)
544 call payload%add_field(this%abx1)
545 call payload%add_field(this%abx2)
546 call payload%add_field(this%aby1)
547 call payload%add_field(this%aby2)
548 call payload%add_field(this%abz1)
549 call payload%add_field(this%abz2)
550 call payload%add_series(this%ulag)
551 call payload%add_series(this%vlag)
552 call payload%add_series(this%wlag)
553
554 !> Set the number of schwarz iterations to perform each time step.
555 call json_get_or_default(params, 'case.fluid.schwarz_iterations', &
556 this%schwarz_iterations, 0)
557
558 call neko_log%end_section()
559
560 nullify(bc_i, vel_bc)
561
562 end subroutine fluid_pnpn_init
563
564 !> Allocate and configure the Helmholtz matrix-vector product for the
565 !! velocity, `this%Ax_vel`.
566 subroutine fluid_pnpn_ax_vel_factory(this)
567 class(fluid_pnpn_t), target, intent(inout) :: this
568
569 if (this%full_stress_formulation) then
570 if (this%svv_enabled) then
571 call ax_helm_allocator(this%Ax_vel, type_name = "full_svv")
572 select type (operator => this%Ax_vel)
573 class is (ax_helm_svv_full_t)
574 operator%svv => this%svv
575 end select
576 else
577 call ax_helm_allocator(this%Ax_vel, type_name = "full")
578 end if
579 else
580 if (this%svv_enabled) then
581 call ax_helm_allocator(this%Ax_vel, type_name = "standard_svv")
582 select type (operator => this%Ax_vel)
583 class is (ax_helm_svv_t)
584 operator%svv => this%svv
585 end select
586 else if (this%c_Xh%geo_compression) then
587 call ax_helm_allocator(this%Ax_vel, &
588 type_name = "standard_compr")
589 else
590 call ax_helm_allocator(this%Ax_vel, type_name = "standard")
591 end if
592 end if
593
594 end subroutine fluid_pnpn_ax_vel_factory
595
596 subroutine fluid_pnpn_restart(this, chkp)
597 class(fluid_pnpn_t), target, intent(inout) :: this
598 type(chkp_t), intent(inout) :: chkp
599 integer :: i, j, n
600 class(bc_t), pointer :: bc_i
601
602 n = this%u%dof%size()
603 if (allocated(chkp%previous_mesh%elements) .or. &
604 chkp%previous_Xh%lx .ne. this%Xh%lx) then
605 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
606 c_xh => this%c_Xh, ulag => this%ulag, vlag => this%vlag, &
607 wlag => this%wlag)
608 do concurrent(j = 1:n)
609 u%x(j,1,1,1) = u%x(j,1,1,1) * c_xh%mult(j,1,1,1)
610 v%x(j,1,1,1) = v%x(j,1,1,1) * c_xh%mult(j,1,1,1)
611 w%x(j,1,1,1) = w%x(j,1,1,1) * c_xh%mult(j,1,1,1)
612 p%x(j,1,1,1) = p%x(j,1,1,1) * c_xh%mult(j,1,1,1)
613 end do
614 do i = 1, this%ulag%size()
615 do concurrent(j = 1:n)
616 ulag%lf(i)%x(j,1,1,1) = ulag%lf(i)%x(j,1,1,1) &
617 * c_xh%mult(j,1,1,1)
618 vlag%lf(i)%x(j,1,1,1) = vlag%lf(i)%x(j,1,1,1) &
619 * c_xh%mult(j,1,1,1)
620 wlag%lf(i)%x(j,1,1,1) = wlag%lf(i)%x(j,1,1,1) &
621 * c_xh%mult(j,1,1,1)
622 end do
623 end do
624 end associate
625 end if
626
627 if (neko_bcknd_device .eq. 1) then
628 associate(u => this%u, v => this%v, w => this%w, &
629 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag,&
630 p => this%p)
631 call device_memcpy(u%x, u%x_d, u%dof%size(), &
632 host_to_device, sync = .false.)
633 call device_memcpy(v%x, v%x_d, v%dof%size(), &
634 host_to_device, sync = .false.)
635 call device_memcpy(w%x, w%x_d, w%dof%size(), &
636 host_to_device, sync = .false.)
637 call device_memcpy(p%x, p%x_d, p%dof%size(), &
638 host_to_device, sync = .false.)
639 call device_memcpy(ulag%lf(1)%x, ulag%lf(1)%x_d, &
640 u%dof%size(), host_to_device, sync = .false.)
641 call device_memcpy(ulag%lf(2)%x, ulag%lf(2)%x_d, &
642 u%dof%size(), host_to_device, sync = .false.)
643
644 call device_memcpy(vlag%lf(1)%x, vlag%lf(1)%x_d, &
645 v%dof%size(), host_to_device, sync = .false.)
646 call device_memcpy(vlag%lf(2)%x, vlag%lf(2)%x_d, &
647 v%dof%size(), host_to_device, sync = .false.)
648
649 call device_memcpy(wlag%lf(1)%x, wlag%lf(1)%x_d, &
650 w%dof%size(), host_to_device, sync = .false.)
651 call device_memcpy(wlag%lf(2)%x, wlag%lf(2)%x_d, &
652 w%dof%size(), host_to_device, sync = .false.)
653 call device_memcpy(this%abx1%x, this%abx1%x_d, &
654 w%dof%size(), host_to_device, sync = .false.)
655 call device_memcpy(this%abx2%x, this%abx2%x_d, &
656 w%dof%size(), host_to_device, sync = .false.)
657 call device_memcpy(this%aby1%x, this%aby1%x_d, &
658 w%dof%size(), host_to_device, sync = .false.)
659 call device_memcpy(this%aby2%x, this%aby2%x_d, &
660 w%dof%size(), host_to_device, sync = .false.)
661 call device_memcpy(this%abz1%x, this%abz1%x_d, &
662 w%dof%size(), host_to_device, sync = .false.)
663 call device_memcpy(this%abz2%x, this%abz2%x_d, &
664 w%dof%size(), host_to_device, sync = .false.)
665 call device_memcpy(this%advx%x, this%advx%x_d, &
666 w%dof%size(), host_to_device, sync = .false.)
667 call device_memcpy(this%advy%x, this%advy%x_d, &
668 w%dof%size(), host_to_device, sync = .false.)
669 call device_memcpy(this%advz%x, this%advz%x_d, &
670 w%dof%size(), host_to_device, sync = .false.)
671 end associate
672 end if
673 ! Make sure that continuity is maintained (important for interpolation)
674 ! Do not do this for lagged rhs
675 ! (derivatives are not necessairly coninous across elements)
676
677 if (allocated(chkp%previous_mesh%elements) &
678 .or. chkp%previous_Xh%lx .ne. this%Xh%lx) then
679
680 call rotate_cyc(this%u, this%v, this%w, 1, this%c_Xh)
681 call this%gs_Xh%op(this%u, gs_op_add)
682 call this%gs_Xh%op(this%v, gs_op_add)
683 call this%gs_Xh%op(this%w, gs_op_add)
684 call this%gs_Xh%op(this%p, gs_op_add)
685 call rotate_cyc(this%u, this%v, this%w, 0, this%c_Xh)
686
687 do i = 1, this%ulag%size()
688 call rotate_cyc(this%ulag%lf(i), this%vlag%lf(i), &
689 this%wlag%lf(i), 1, this%c_Xh)
690 call this%gs_Xh%op(this%ulag%lf(i), gs_op_add)
691 call this%gs_Xh%op(this%vlag%lf(i), gs_op_add)
692 call this%gs_Xh%op(this%wlag%lf(i), gs_op_add)
693 call rotate_cyc(this%ulag%lf(i), this%vlag%lf(i), &
694 this%wlag%lf(i), 0, this%c_Xh)
695 end do
696 end if
697
698 call this%ale%sync_chkp(this%c_Xh, this%Xh, this%adv, chkp, this%gs_Xh)
699 if (this%ale%active) then
700 call this%bc_prs_surface%recompute_normals()
701 call this%bc_sym_surface%recompute_normals()
702 end if
703
704 ! Restore velocity bcs that need it (overset mostly)
705 do i = 1, this%bcs_vel%size()
706 bc_i => this%bcs_vel%get(i)
707 call bc_i%restart(this%u, this%v, this%w, &
708 this%ulag, this%vlag, this%wlag)
709 end do
710
711 ! Restore pressure bcs that need it (overset mostly)
712 do i = 1, this%bcs_prs%size()
713 bc_i => this%bcs_prs%get(i)
714 call bc_i%restart(this%p)
715 end do
716
717 nullify(bc_i)
718
719 ! The OIFS convecting field series is not in the checkpoint, rebuild it
720 ! from the restored velocity lags.
721 select type (adv => this%adv)
722 type is (adv_oifs_t)
723 call adv%restart()
724 end select
725
726 end subroutine fluid_pnpn_restart
727
728 !> Set the initial condition of the velocity and pressure, copy the initial
729 !! velocity to the lagged velocity fields, and set the initial ALE mesh
730 !! velocity.
731 !! @param user Type with user-defined procedures.
732 !! @param is_restart Whether the case is restarting from a checkpoint.
733 subroutine fluid_pnpn_set_initial_condition(this, user, is_restart)
734 class(fluid_pnpn_t), intent(inout) :: this
735 type(user_t), intent(in) :: user
736 logical, intent(in) :: is_restart
737
738 ! Set before the IC
739 if (.not. is_restart) then
740 call this%ale%set_initial_mesh_velocity(this%c_Xh)
741 end if
742
743 call this%set_initial_condition_base(user, is_restart)
744
745 if (.not. is_restart) then
746 call this%ulag%set(this%u)
747 call this%vlag%set(this%v)
748 call this%wlag%set(this%w)
749 end if
750
751 end subroutine fluid_pnpn_set_initial_condition
752
753 subroutine fluid_pnpn_free(this)
754 class(fluid_pnpn_t), intent(inout) :: this
755
756 if (allocated(this%Ax_vel)) then
757 call this%Ax_vel%free()
758 deallocate(this%Ax_vel)
759 end if
760
761 if (allocated(this%Ax_prs)) then
762 call this%Ax_prs%free()
763 deallocate(this%Ax_prs)
764 end if
765
766 !Deallocate velocity and pressure fields
767 call this%scheme_free()
768
769 if (allocated(this%ext_bdf)) then
770 call this%ext_bdf%free()
771 deallocate(this%ext_bdf)
772 end if
773
774 call this%bc_prs_surface%free()
775 call this%bc_sym_surface%free()
776 if (allocated(this%bcs_vel_projector)) then
777 call this%bcs_vel_projector%free()
778 deallocate(this%bcs_vel_projector)
779 end if
780 call this%bcs_prs_projector%free()
781 call this%proj_prs%free()
782 call this%proj_vel%free()
783
784 call this%p_res%free()
785 call this%u_res%free()
786 call this%v_res%free()
787 call this%w_res%free()
788
789 call this%ale%free()
790
791 call this%du%free()
792 call this%dv%free()
793 call this%dw%free()
794 call this%dp%free()
795
796 call this%abx1%free()
797 call this%aby1%free()
798 call this%abz1%free()
799
800 call this%abx2%free()
801 call this%aby2%free()
802 call this%abz2%free()
803
804 call this%advx%free()
805 call this%advy%free()
806 call this%advz%free()
807
808 if (allocated(this%adv)) then
809 call this%adv%free()
810 deallocate(this%adv)
811 end if
812
813 if (allocated(this%prs_res)) then
814 deallocate(this%prs_res)
815 end if
816
817 if (allocated(this%vel_res)) then
818 deallocate(this%vel_res)
819 end if
820
821 if (allocated(this%sumab)) then
822 deallocate(this%sumab)
823 end if
824
825 if (allocated(this%makeabf)) then
826 deallocate(this%makeabf)
827 end if
828
829 if (allocated(this%makebdf)) then
830 deallocate(this%makebdf)
831 end if
832
833 if (allocated(this%makeoifs)) then
834 deallocate(this%makeoifs)
835 end if
836
837 if (allocated(this%ext_bdf)) then
838 deallocate(this%ext_bdf)
839 end if
840
841 call this%vol_flow%free()
842
843 end subroutine fluid_pnpn_free
844
845 !> Advance fluid simulation in time.
846 !! @param t The time value.
847 !! @param tstep The current interation.
848 !! @param dt The timestep
849 !! @param ext_bdf Time integration logic.
850 !! @param dt_controller timestep controller
851 subroutine fluid_pnpn_step(this, time, dt_controller)
852 class(fluid_pnpn_t), target, intent(inout) :: this
853 type(time_state_t), intent(in) :: time
854 type(time_step_controller_t), intent(in) :: dt_controller
855 ! number of degrees of freedom
856 integer :: n
857 ! Solver results monitors (pressure + 3 velocity)
858 type(ksp_monitor_t) :: ksp_results(4)
859 integer :: iter
860
861 type(file_t) :: dump_file
862 class(bc_t), pointer :: bc_i
863
864 if (this%freeze) return
865
866 n = this%dm_Xh%size()
867
868 call profiler_start_region('Fluid', 1)
869 associate(u => this%u, v => this%v, w => this%w, p => this%p, &
870 u_e => this%u_e, v_e => this%v_e, w_e => this%w_e, &
871 du => this%du, dv => this%dv, dw => this%dw, dp => this%dp, &
872 u_res => this%u_res, v_res => this%v_res, w_res => this%w_res, &
873 p_res => this%p_res, ax_vel => this%Ax_vel, ax_prs => this%Ax_prs, &
874 xh => this%Xh, &
875 c_xh => this%c_Xh, dm_xh => this%dm_Xh, gs_xh => this%gs_Xh, &
876 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag, &
877 msh => this%msh, prs_res => this%prs_res, &
878 source_term => this%source_term, vel_res => this%vel_res, &
879 sumab => this%sumab, makeoifs => this%makeoifs, &
880 makeabf => this%makeabf, makebdf => this%makebdf, &
881 vel_projection_dim => this%vel_projection_dim, &
882 pr_projection_dim => this%pr_projection_dim, &
883 oifs => this%oifs, &
884 rho => this%rho, mu_tot => this%mu_tot, &
885 f_x => this%f_x, f_y => this%f_y, f_z => this%f_z, &
886 t => time%t, tstep => time%tstep, dt => time%dt, &
887 ext_bdf => this%ext_bdf, event => glb_cmd_event, &
888 ale => this%ale)
889
890 ! Extrapolate the velocity if it's not done in nut_field estimation
891 call sumab%compute_fluid(u_e, v_e, w_e, u, v, w, &
892 ulag, vlag, wlag, ext_bdf%advection_coeffs%x, ext_bdf%nadv)
893
894 ! Compute the source terms that are extrapolated in time below
895 call this%source_term%compute(time, extrapolate = .true.)
896
897 ! Add Neumann bc contributions to the RHS
898 call this%bcs_vel%apply_vector(f_x%x, f_y%x, f_z%x, &
899 this%dm_Xh%size(), time, strong = .false.)
900
901 if (this%ale%active) then
902 if (oifs) then
903 call neko_error("ALE is not yet supported " // &
904 "with OIFS time integration.")
905 end if
906 !> adds div.(u_i*wm) to RHS
907 call this%adv%compute_ale(u, v, w, &
908 ale%wm_x, ale%wm_y, ale%wm_z, &
909 f_x, f_y, f_z, &
910 xh, c_xh, dm_xh%size())
911 end if
912
913
914 if (oifs) then
915 ! Add the advection operators to the right-hand-side.
916 call this%adv%compute(u, v, w, &
917 this%advx, this%advy, this%advz, &
918 xh, this%c_Xh, dm_xh%size(), real(dt, kind=rp))
919
920 ! At this point the RHS contains the sum of the advection operator and
921 ! additional source terms, evaluated using the velocity field from the
922 ! previous time-step. Now, this value is used in the explicit time
923 ! scheme to advance both terms in time.
924
925 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
926 this%abx2, this%aby2, this%abz2, &
927 f_x%x, f_y%x, f_z%x, &
928 rho%x(1,1,1,1), ext_bdf%advection_coeffs%x, n)
929
930 ! Now, the source terms from the previous time step are added to the
931 ! RHS.
932 call makeoifs%compute_fluid(this%advx%x, this%advy%x, this%advz%x, &
933 f_x%x, f_y%x, f_z%x, &
934 rho%x(1,1,1,1), real(dt, kind=rp), n)
935 else
936 ! Add the advection operators to the right-hand-side.
937 call this%adv%compute(u, v, w, &
938 f_x, f_y, f_z, &
939 xh, this%c_Xh, dm_xh%size())
940
941 ! At this point the RHS contains the sum of the advection operator and
942 ! additional source terms, evaluated using the velocity field from the
943 ! previous time-step. Now, this value is used in the explicit time
944 ! scheme to advance both terms in time.
945
946 call makeabf%compute_fluid(this%abx1, this%aby1, this%abz1,&
947 this%abx2, this%aby2, this%abz2, &
948 f_x%x, f_y%x, f_z%x, &
949 rho%x(1,1,1,1), ext_bdf%advection_coeffs%x, n)
950
951 ! Add the RHS contributions coming from the BDF scheme.
952 ! Blag and Blaglag are history of B matrices, mainly used for ALE.
953 ! For a normal simulation (no moving mesh), Blag and Blaglag
954 ! are just the initial B matrix, filled at initialization.
955 call makebdf%compute_fluid(ulag, vlag, wlag, f_x%x, f_y%x, f_z%x, &
956 u, v, w, c_xh%B, c_xh%Blag, c_xh%Blaglag, rho%x(1,1,1,1), &
957 real(dt, kind=rp), &
958 ext_bdf%diffusion_coeffs%x, ext_bdf%ndiff, n)
959
960 end if
961
962 ! Source terms that must not be extrapolated in time are added as
963 ! computed, weighted by the mass matrix and the density like the
964 ! extrapolated terms above.
965 call this%source_term%compute(time, extrapolate = .false., scale = rho)
966
967 if (this%ale%active) then
968 ! Advance Mesh (Moves points, updates B history, updates wm_lags)
969 call this%ale%advance_mesh(c_xh, time, ext_bdf%nadv)
970
971 call profiler_start_region('ALE recompute metrics')
972 ! Update Metrics
973 call c_xh%recompute_metrics()
974 ! Update the metrics used by the adv operator for delaiasing (coef_GL)
975 ! Maps the updated coef_GLL to coef_GL.
976 call this%adv%recompute_metrics(c_xh, .true.)
977
978 call this%bc_prs_surface%recompute_normals()
979 call this%bc_sym_surface%recompute_normals()
980 call profiler_end_region('ALE recompute metrics')
981 end if
982
983 call ulag%update()
984 call vlag%update()
985 call wlag%update()
986
987 ! Update material properties if necessary
988 call this%update_material_properties(time)
989
990 ! Update the SVV coefficient if necessary
991 if (this%svv_enabled) then
992 call this%svv%update(rho, tstep)
993 end if
994
995 do iter = 1, 1 + this%schwarz_iterations
996
997 call this%bc_apply_vel(time, strong = .true.)
998 call this%bc_apply_prs(time)
999
1000 ! Compute pressure residual.
1001 call profiler_start_region('Pressure_residual', 18)
1002 call prs_res%compute(p, p_res,&
1003 u, v, w, &
1004 u_e, v_e, w_e, &
1005 f_x, f_y, f_z, &
1006 c_xh, gs_xh, &
1007 this%bc_prs_surface, this%bc_sym_surface,&
1008 ax_prs, ext_bdf%diffusion_coeffs%x(1), real(dt, kind=rp), &
1009 mu_tot, rho, event)
1010
1011
1012 ! De-mean the pressure residual when no strong pressure boundaries present
1013 if (.not. this%prs_dirichlet .and. neko_bcknd_device .eq. 1) then
1014 call device_ortho(p_res%x_d, this%glb_n_points, n)
1015 else if (.not. this%prs_dirichlet) then
1016 call ortho(p_res%x, this%glb_n_points, n)
1017 end if
1018
1019 call gs_xh%op(p_res, gs_op_add, event)
1020
1021 ! Set the residual to zero at strong pressure boundaries.
1022 call this%bcs_prs_projector%apply(p_res%x, p%dof%size())
1023
1024
1025 call profiler_end_region('Pressure_residual', 18)
1026
1027 ! Do projections only on the actual solutions of the tstep
1028 ! not intermediate solutions from the subiterations.
1029 if (iter .eq. 1) then
1030 call this%proj_prs%pre_solving(p_res%x, tstep, c_xh, n, &
1031 dt_controller, ax = ax_prs, gs_h = gs_xh, &
1032 bclst = this%bcs_prs_projector, string = 'Pressure')
1033 end if
1034
1035 call this%pc_prs%update()
1036
1037 call profiler_start_region('Pressure_solve', 3)
1038
1039 ! Solve for the pressure increment.
1040 ksp_results(1) = &
1041 this%ksp_prs%solve(ax_prs, dp, p_res%x, n, c_xh, &
1042 this%bcs_prs_projector, gs_xh)
1043 ksp_results(1)%name = 'Pressure'
1044
1045
1046 call profiler_end_region('Pressure_solve', 3)
1047
1048 if (iter .eq. 1) then
1049 call this%proj_prs%post_solving(dp%x, ax_prs, c_xh, &
1050 this%bcs_prs_projector, gs_xh, n, tstep, dt_controller)
1051 end if
1052
1053 ! Update the pressure with the increment. Demean if necessary.
1054 call field_add2(p, dp, n)
1055 if (.not. this%prs_dirichlet .and. neko_bcknd_device .eq. 1) then
1056 call device_ortho(p%x_d, this%glb_n_points, n)
1057 else if (.not. this%prs_dirichlet) then
1058 call ortho(p%x, this%glb_n_points, n)
1059 end if
1060
1061 ! Compute velocity residual.
1062 call profiler_start_region('Velocity_residual', 19)
1063 call vel_res%compute(ax_vel, u, v, w, &
1064 u_res, v_res, w_res, &
1065 p, &
1066 f_x, f_y, f_z, &
1067 c_xh, msh, xh, &
1068 mu_tot, rho, ext_bdf%diffusion_coeffs%x(1), &
1069 real(dt, kind=rp), dm_xh%size())
1070
1071 call rotate_cyc(u_res, v_res, w_res, 1, c_xh)
1072 call gs_xh%op(u_res%x, v_res%x, w_res%x, dm_xh%size(), &
1073 gs_op_add, event)
1074 call rotate_cyc(u_res, v_res, w_res, 0, c_xh)
1075
1076 ! Set residual to zero at strong velocity boundaries.
1077 call this%bcs_vel_projector%apply(u_res%x, v_res%x, w_res%x, &
1078 dm_xh%size())
1079
1080
1081 call profiler_end_region('Velocity_residual', 19)
1082
1083 if (iter .eq. 1) then
1084 call this%proj_vel%pre_solving(u_res%x, v_res%x, w_res%x, &
1085 tstep, c_xh, n, dt_controller, 'Velocity')
1086 end if
1087
1088 call this%pc_vel%update()
1089
1090 call profiler_start_region("Velocity_solve", 4)
1091 ksp_results(2:4) = this%ksp_vel%solve_coupled(ax_vel, du, dv, dw, &
1092 u_res%x, v_res%x, w_res%x, n, c_xh, &
1093 this%bcs_vel_projector, gs_xh, &
1094 this%ksp_vel%max_iter)
1095 call profiler_end_region("Velocity_solve", 4)
1096 if (this%full_stress_formulation) then
1097 ksp_results(2)%name = 'Momentum'
1098 else
1099 ksp_results(2)%name = 'X-Velocity'
1100 ksp_results(3)%name = 'Y-Velocity'
1101 ksp_results(4)%name = 'Z-Velocity'
1102 end if
1103
1104 if (iter .eq. 1) then
1105 call this%proj_vel%post_solving(du%x, dv%x, dw%x, ax_vel, c_xh, &
1106 this%bcs_vel_projector, gs_xh, n, tstep, &
1107 dt_controller)
1108 end if
1109
1110 if (neko_bcknd_device .eq. 1) then
1111 call device_opadd2cm(u%x_d, v%x_d, w%x_d, &
1112 du%x_d, dv%x_d, dw%x_d, 1.0_rp, n, msh%gdim)
1113 else
1114 call opadd2cm(u%x, v%x, w%x, du%x, dv%x, dw%x, 1.0_rp, n, msh%gdim)
1115 end if
1116
1117 call fluid_step_info(time, ksp_results, &
1118 this%full_stress_formulation, this%strict_convergence, &
1119 this%allow_stabilization, iter)
1120
1121 end do
1122
1123 if (this%forced_flow_rate) then
1124 ! Horrible mu hack?!
1125 call this%vol_flow%adjust( u, v, w, p, u_res, v_res, w_res, p_res, &
1126 c_xh, gs_xh, ext_bdf, rho%x(1,1,1,1), mu_tot, &
1127 real(dt, kind=rp), time, this%bcs_prs_projector, &
1128 this%bcs_vel_projector, ax_vel, ax_prs, this%ksp_prs, &
1129 this%ksp_vel, this%pc_prs, this%pc_vel, this%ksp_prs%max_iter, &
1130 this%ksp_vel%max_iter)
1131 end if
1132
1133 ! Update mesh velocities for ALE
1134 ! We update them here (end of step) for the next step.
1135 ! Returns if .not. ale.
1136 call this%ale%update_mesh_velocity(c_xh, time)
1137
1138 end associate
1139
1140 nullify(bc_i)
1141
1142 call profiler_end_region('Fluid', 1)
1143 end subroutine fluid_pnpn_step
1144
1145 !> Sets up the boundary conditions for the scheme.
1146 !! @details Each entry of `case.fluid.boundary_conditions` is split into a
1147 !! velocity part and a pressure part by `fluid_pnpn_bc_split`. The parts are
1148 !! passed to `velocity_bc_factory` and `pressure_bc_factory`, and the
1149 !! resulting objects are appended to `bcs_vel` and `bcs_prs` and marked in
1150 !! the residual projectors. The `facet_type` array of the mesh, used by the
1151 !! FDM preconditioner, is set to 1 on the zones of an entry with a Dirichlet
1152 !! pressure condition and to 2 otherwise.
1153 !! @param user The user interface.
1154 !! @param params The case file parameters.
1155 subroutine fluid_pnpn_setup_bcs(this, user, params)
1156 class(fluid_pnpn_t), target, intent(inout) :: this
1157 type(user_t), target, intent(in) :: user
1158 type(json_file), intent(inout) :: params
1159 integer :: i, n_bcs, j, k, l, zone_size, global_zone_size, ierr
1160 integer :: facet_value
1161 class(bc_t), pointer :: bc_i
1162 type(json_core) :: core
1163 type(json_value), pointer :: bc_object
1164 type(json_file) :: bc_subdict, velocity_subdict, pressure_subdict
1165 logical :: moving_, has_velocity, has_pressure, pressure_dirichlet
1166 logical :: found
1167 ! Monitor which boundary zones have been marked
1168 logical, allocatable :: marked_zones(:)
1169 integer, allocatable :: zone_indices(:)
1170 character(len=256) :: error_msg
1171 character(len=:), allocatable :: bc_type_str
1172
1173 this%ale%has_moving_boundary = .false.
1174
1175 ! Special PnPn boundary conditions for pressure
1176 call this%bc_prs_surface%init_from_components(this%c_Xh)
1177 call this%bc_sym_surface%init_from_components(this%c_Xh)
1178
1179 ! Populate bcs_vel and bcs_prs based on the case file
1180 if (params%valid_path('case.fluid.boundary_conditions')) then
1181 call params%info('case.fluid.boundary_conditions', n_children = n_bcs)
1182 call params%get_core(core)
1183 call params%get('case.fluid.boundary_conditions', bc_object, found)
1184
1185 call this%bcs_vel%init(n_bcs)
1186 call this%bcs_prs%init(n_bcs)
1187
1188 allocate(marked_zones(size(this%msh%labeled_zones)))
1189 marked_zones = .false.
1190
1191 do i = 1, n_bcs
1192 ! Create a new json containing just the subdict for this bc
1193 call json_extract_item(core, bc_object, i, bc_subdict)
1194
1195 call json_get_or_lookup(bc_subdict, "zone_indices", zone_indices)
1196
1197 ! Check that we are not trying to assing a bc to zone, for which one
1198 ! has already been assigned and that the zone has more than 0 size
1199 ! in the mesh.
1200 do j = 1, size(zone_indices)
1201 zone_size = this%msh%labeled_zones(zone_indices(j))%size
1202 call mpi_allreduce(zone_size, global_zone_size, 1, &
1203 mpi_integer, mpi_max, neko_comm, ierr)
1204
1205 if (global_zone_size .eq. 0) then
1206 write(error_msg, '(A, I0, A, A, I0, A)') &
1207 "Zone index ", zone_indices(j), &
1208 " is invalid as this zone has 0 size, meaning it ", &
1209 "is not in the mesh. Check fluid boundary condition ", &
1210 i, "."
1211 call neko_error(error_msg)
1212 end if
1213
1214 if (marked_zones(zone_indices(j))) then
1215 write(error_msg, '(A, I0, A, A, A, A)') &
1216 "Zone with index ", zone_indices(j), &
1217 " has already been assigned a boundary condition. ", &
1218 "Please check your boundary_conditions entry for the ", &
1219 "fluid and make sure that each zone index appears only ", &
1220 "in a single boundary condition."
1221 call neko_error(error_msg)
1222 else
1223 marked_zones(zone_indices(j)) = .true.
1224 end if
1225 end do
1226
1227 call fluid_pnpn_bc_split(bc_subdict, velocity_subdict, &
1228 pressure_subdict, has_velocity, has_pressure)
1229
1230 !
1231 ! Velocity
1232 !
1233 bc_i => null()
1234 if (has_velocity) then
1235 ! Set the ALE flag to true if there is any moving no_slip wall
1236 call json_get(velocity_subdict, "type", bc_type_str)
1237 if (trim(bc_type_str) .eq. "no_slip") then
1238 call json_get_or_default(velocity_subdict, "moving", moving_, &
1239 .false.)
1240 if (moving_) this%ale%has_moving_boundary = .true.
1241 end if
1242
1243 call velocity_bc_factory(bc_i, this, velocity_subdict, &
1244 this%c_Xh, user)
1245 end if
1246
1247 ! A homogeneous Neumann condition for velocity does not create an
1248 ! object, so we check.
1249 if (associated(bc_i)) then
1250
1251 select type (bc_i)
1252 type is (symmetry_aligned_t)
1253 ! In this case we need to tell the segregated projector where
1254 ! we have the dirichlet dofs component-wise. This is stored
1255 ! in the nested bcs. Of course, we rely on axis-alignment of
1256 ! the geometry.
1257 call this%bcs_vel_projector%mark(bc_i%bc_x, component = 'x')
1258 call this%bcs_vel_projector%mark(bc_i%bc_y, component = 'y')
1259 call this%bcs_vel_projector%mark(bc_i%bc_z, component = 'z')
1260 call this%bcs_vel%append(bc_i)
1261 call this%bc_sym_surface%mark_facets(bc_i%marked_facet)
1262 type is (symmetry_t)
1263 ! In this case we add the bc itself to the projector, which
1264 ! should be coupled.
1265 if (.not. this%full_stress_formulation) then
1266 call neko_error("The symmetry boundary condition " // &
1267 "requires the full stress formulation to be enabled.")
1268 end if
1269 call this%bcs_vel_projector%mark(bc_i)
1270 call this%bcs_vel%append(bc_i)
1271 call this%bc_sym_surface%mark_facets(bc_i%marked_facet)
1272 type is (non_normal_aligned_t)
1273 ! The situation is the same as symmetry.
1274 call this%bcs_vel_projector%mark(bc_i%bc_x, component = 'x')
1275 call this%bcs_vel_projector%mark(bc_i%bc_y, component = 'y')
1276 call this%bcs_vel_projector%mark(bc_i%bc_z, component = 'z')
1277 call this%bcs_vel%append(bc_i)
1278 type is (non_normal_t)
1279 call this%bcs_vel_projector%mark(bc_i)
1280 call this%bcs_vel%append(bc_i)
1281 type is (shear_stress_t)
1282 if (.not. this%full_stress_formulation) then
1283 call neko_error("The shear_stress boundary condition " // &
1284 "requires the full stress formulation to be enabled.")
1285 end if
1286 call this%bcs_vel_projector%mark(bc_i)
1287 call this%bcs_vel%append(bc_i)
1288 type is (wall_model_bc_t)
1289 if (.not. this%full_stress_formulation) then
1290 call neko_error("The wall_model boundary condition " // &
1291 "requires the full stress formulation to be enabled.")
1292 end if
1293 call this%bcs_vel_projector%mark(bc_i)
1294 call this%bcs_vel%append(bc_i)
1295 class is (mixed_bc_t)
1296 ! User-defined mixed conditions, resolved by the coupled
1297 ! projector.
1298 if (.not. this%full_stress_formulation) then
1299 call neko_error("The " // trim(bc_i%name) // &
1300 " boundary condition is a mixed condition and " // &
1301 "requires the full stress formulation to be enabled.")
1302 end if
1303 call this%bcs_vel_projector%mark(bc_i)
1304 call this%bcs_vel%append(bc_i)
1305 class default
1306
1307 ! Additionally we mark the special PnPn pressure bc.
1308 if (bc_i%bc_type .eq. bc_dirichlet) then
1309 call this%bc_prs_surface%mark_labeled_zones( &
1310 bc_i%zone_indices)
1311 if (this%full_stress_formulation) then
1312 call this%bcs_vel_projector%mark(bc_i)
1313 else
1314 call this%bcs_vel_projector%mark(bc_i, component = 'x')
1315 call this%bcs_vel_projector%mark(bc_i, component = 'y')
1316 call this%bcs_vel_projector%mark(bc_i, component = 'z')
1317 end if
1318 end if
1319
1320 call this%bcs_vel%append(bc_i)
1321 end select
1322 end if
1323
1324 !
1325 ! Pressure
1326 !
1327 bc_i => null()
1328 pressure_dirichlet = .false.
1329 if (has_pressure) then
1330 call pressure_bc_factory(bc_i, this, pressure_subdict, &
1331 this%c_Xh, user)
1332 end if
1333
1334 ! The natural pressure condition does not create an object, so we
1335 ! check.
1336 if (associated(bc_i)) then
1337 call this%bcs_prs%append(bc_i)
1338
1339 ! Mark strong pressure bcs in the projector to force zero change.
1340 if (bc_i%bc_type .eq. bc_dirichlet) then
1341 call this%bcs_prs_projector%mark(bc_i)
1342 pressure_dirichlet = .true.
1343 end if
1344 end if
1345
1346 ! Mark the facets of the zones for the FDM preconditioner: 1 where
1347 ! the pressure is strongly imposed, 2 otherwise.
1348 if (pressure_dirichlet) then
1349 facet_value = 1
1350 else
1351 facet_value = 2
1352 end if
1353
1354 do j = 1, size(zone_indices)
1355 do k = 1, this%msh%nelv
1356 do l = 1, 2 * this%msh%gdim
1357 if (this%msh%facet_type(l, k) .eq. -zone_indices(j)) then
1358 this%msh%facet_type(l, k) = facet_value
1359 end if
1360 end do
1361 end do
1362 end do
1363 end do
1364
1365 call velocity_subdict%destroy()
1366 call pressure_subdict%destroy()
1367
1368 if (this%ale%active .and. (.not. this%ale%has_moving_boundary)) then
1369 call neko_error("Case file error: ALE is active, " // &
1370 "but no moving wall was found. " // &
1371 "Use type = 'no_slip' with 'moving': true in case file.")
1372 end if
1373
1374 ! Make sure all labeled zones with non-zero size have been marked
1375 do i = 1, size(this%msh%labeled_zones)
1376 if ((this%msh%labeled_zones(i)%size .gt. 0) .and. &
1377 (.not. marked_zones(i))) then
1378 write(error_msg, '(A, I0)') &
1379 "No fluid boundary condition assigned to zone ", i
1380 call neko_error(error_msg)
1381 end if
1382 end do
1383 else
1384 ! Check that there are no labeled zones, i.e. all are periodic.
1385 do i = 1, size(this%msh%labeled_zones)
1386 if (this%msh%labeled_zones(i)%size .gt. 0) then
1387 call neko_error("No boundary_conditions entry in the case file!")
1388 end if
1389 end do
1390
1391 ! For a pure periodic case, we still need to initilise the bc lists
1392 ! to a zero size to avoid issues with apply() in step()
1393 call this%bcs_vel%init()
1394 call this%bcs_prs%init()
1395
1396 end if
1397
1398 call this%bc_prs_surface%finalize()
1399 call this%bc_sym_surface%finalize()
1400 call this%bcs_vel_projector%finalize(rebuild_mask = .true.)
1401
1402 ! If we have no strong pressure bcs, we will demean the pressure
1403 this%prs_dirichlet = this%bcs_prs_projector%dof_mask%is_set()
1404 call mpi_allreduce(mpi_in_place, this%prs_dirichlet, 1, &
1405 mpi_logical, mpi_lor, neko_comm)
1406
1407 if (allocated(marked_zones)) then
1408 deallocate(marked_zones)
1409 end if
1410
1411 if (allocated(zone_indices)) then
1412 deallocate(zone_indices)
1413 end if
1414
1415 nullify(bc_i, bc_object)
1416
1417 end subroutine fluid_pnpn_setup_bcs
1418
1419 !> Write a field with boundary condition specifications
1420 subroutine fluid_pnpn_write_boundary_conditions(this)
1421 use inflow, only : inflow_t
1423 use blasius, only : blasius_t
1425 use dong_outflow, only : dong_outflow_t
1426 use no_slip, only : no_slip_t
1427 class(fluid_pnpn_t), target, intent(inout) :: this
1428 type(dirichlet_t) :: bdry_mask
1429 type(field_t), pointer :: bdry_field
1430 type(file_t) :: bdry_file
1431 integer :: temp_index, i
1432 class(bc_t), pointer :: bci
1433 character(len=LOG_SIZE) :: log_buf
1434
1435 write(log_buf, '(A)') 'Marking using integer keys in bdry0.f00000'
1436 call neko_log%message(log_buf)
1437 write(log_buf, '(A)') 'Condition-value pairs: '
1438 call neko_log%message(log_buf)
1439 write(log_buf, '(A)') ' no_slip (stationary wall) = 1'
1440 call neko_log%message(log_buf)
1441 write(log_buf, '(A)') ' velocity_value = 2'
1442 call neko_log%message(log_buf)
1443 write(log_buf, '(A)') ' outflow, normal_outflow (+dong) = 3'
1444 call neko_log%message(log_buf)
1445 write(log_buf, '(A)') ' symmetry = 4'
1446 call neko_log%message(log_buf)
1447 write(log_buf, '(A)') ' periodic = 6'
1448 call neko_log%message(log_buf)
1449 write(log_buf, '(A)') ' user_velocity = 7'
1450 call neko_log%message(log_buf)
1451 write(log_buf, '(A)') ' user_pressure = 8'
1452 call neko_log%message(log_buf)
1453 write(log_buf, '(A)') ' shear_stress = 9'
1454 call neko_log%message(log_buf)
1455 write(log_buf, '(A)') ' wall_modelling = 10'
1456 call neko_log%message(log_buf)
1457 write(log_buf, '(A)') ' blasius_profile = 11'
1458 call neko_log%message(log_buf)
1459 write(log_buf, '(A)') ' no_slip (moving wall) = 12'
1460 call neko_log%message(log_buf)
1461
1462 call neko_scratch_registry%request_field(bdry_field, temp_index, .true.)
1463
1464
1465
1466 call bdry_mask%init_from_components(this%c_Xh, 6.0_rp)
1467 call bdry_mask%mark_zone(this%msh%periodic)
1468 call bdry_mask%finalize()
1469 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1470 call bdry_mask%free()
1471
1472 do i = 1, this%bcs_prs%size()
1473 bci => this%bcs_prs%get(i)
1474 select type (bc => bci)
1475 type is (zero_dirichlet_t)
1476 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1477 call bdry_mask%mark_facets(bci%marked_facet)
1478 call bdry_mask%finalize()
1479 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1480 call bdry_mask%free()
1481 type is (dong_outflow_t)
1482 call bdry_mask%init_from_components(this%c_Xh, 3.0_rp)
1483 call bdry_mask%mark_facets(bci%marked_facet)
1484 call bdry_mask%finalize()
1485 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1486 call bdry_mask%free()
1487 type is (field_dirichlet_t)
1488 call bdry_mask%init_from_components(this%c_Xh, 8.0_rp)
1489 call bdry_mask%mark_facets(bci%marked_facet)
1490 call bdry_mask%finalize()
1491 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1492 call bdry_mask%free()
1493 end select
1494 end do
1495
1496 do i = 1, this%bcs_vel%size()
1497 bci => this%bcs_vel%get(i)
1498 select type (bc => bci)
1499 type is (no_slip_t)
1500 if (bc%is_moving) then
1501 ! moving wall
1502 call bdry_mask%init_from_components(this%c_Xh, 12.0_rp)
1503 else
1504 ! stationary wall
1505 call bdry_mask%init_from_components(this%c_Xh, 1.0_rp)
1506 end if
1507 call bdry_mask%mark_facets(bci%marked_facet)
1508 call bdry_mask%finalize()
1509 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1510 call bdry_mask%free()
1511 type is (inflow_t)
1512 call bdry_mask%init_from_components(this%c_Xh, 2.0_rp)
1513 call bdry_mask%mark_facets(bci%marked_facet)
1514 call bdry_mask%finalize()
1515 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1516 call bdry_mask%free()
1517 type is (symmetry_aligned_t)
1518 call bdry_mask%init_from_components(this%c_Xh, 4.0_rp)
1519 call bdry_mask%mark_facets(bci%marked_facet)
1520 call bdry_mask%finalize()
1521 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1522 call bdry_mask%free()
1523 type is (symmetry_t)
1524 call bdry_mask%init_from_components(this%c_Xh, 4.0_rp)
1525 call bdry_mask%mark_facets(bci%marked_facet)
1526 call bdry_mask%finalize()
1527 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1528 call bdry_mask%free()
1529 type is (field_dirichlet_vector_t)
1530 call bdry_mask%init_from_components(this%c_Xh, 7.0_rp)
1531 call bdry_mask%mark_facets(bci%marked_facet)
1532 call bdry_mask%finalize()
1533 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1534 call bdry_mask%free()
1535 type is (shear_stress_t)
1536 call bdry_mask%init_from_components(this%c_Xh, 9.0_rp)
1537 call bdry_mask%mark_facets(bci%marked_facet)
1538 call bdry_mask%finalize()
1539 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1540 call bdry_mask%free()
1541 type is (wall_model_bc_t)
1542 call bdry_mask%init_from_components(this%c_Xh, 10.0_rp)
1543 call bdry_mask%mark_facets(bci%marked_facet)
1544 call bdry_mask%finalize()
1545 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1546 call bdry_mask%free()
1547 type is (blasius_t)
1548 call bdry_mask%init_from_components(this%c_Xh, 11.0_rp)
1549 call bdry_mask%mark_facets(bci%marked_facet)
1550 call bdry_mask%finalize()
1551 call bdry_mask%apply_scalar(bdry_field%x, this%dm_Xh%size())
1552 call bdry_mask%free()
1553 end select
1554 end do
1555
1556
1557 call bdry_file%init('bdry.fld')
1558 call bdry_file%write(bdry_field)
1559
1560 call neko_scratch_registry%relinquish_field(temp_index)
1561
1562 nullify(bdry_field, bci)
1563
1564 end subroutine fluid_pnpn_write_boundary_conditions
1565
1566end module fluid_pnpn
double real
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.
Apply cyclic boundary condition to a vector field.
Subroutines to add advection terms to the RHS of a transport equation.
Definition adv_oifs.f90:34
Subroutines to add advection terms to the RHS of a transport equation.
Definition advection.f90:34
ALE Manager: Handles Mesh Motion.
Defines the full-stress SVV Helmholtz operator.
Base type for an SVV Helmholtz operator.
Defines a Matrix-vector product.
Definition ax.f90:34
Defines a boundary condition.
Definition bc.f90:34
integer, parameter, public bc_dirichlet
Supported boundary condition types. The values are set in order of precedence for global resolution....
Definition bc.f90:67
Defines a Blasius profile dirichlet condition.
Definition blasius.f90:34
Format-independent checkpoint payloads.
Defines format-independent checkpoint registration and restart state.
Coefficients.
Definition coef.f90:34
Definition comm.F90:1
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:46
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.
Definition device.F90:34
integer, parameter, public host_to_device
Definition device.F90:48
type(c_ptr), bind(C), public glb_cmd_event
Event for the global command queue.
Definition device.F90:63
Defines a dirichlet boundary condition.
Definition dirichlet.f90:34
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.
Defines a field.
Definition field.f90:34
Module for file I/O operations.
Definition file.f90:34
Auxiliary routines for fluid solvers.
Definition fluid_aux.f90:34
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,...
Definition fluid_aux.f90:54
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_restart(this, chkp)
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_set_initial_condition(this, user, is_restart)
Set the initial condition of the velocity and pressure, copy the initial velocity to the lagged veloc...
subroutine fluid_pnpn_free(this)
subroutine fluid_pnpn_init(this, msh, lx, params, user, chkp)
Defines Gather-scatter operations.
Definition gs_ops.f90:34
integer, parameter, public gs_op_add
Definition gs_ops.f90:36
Defines inflow dirichlet conditions.
Definition inflow.f90:34
Utilities for retrieving parameters from the case files.
Implements the base abstract type for Krylov solvers plus helper types.
Definition krylov.f90:34
Logging routines.
Definition log.f90:34
type(log_t), public neko_log
Global log stream.
Definition log.f90:92
integer, parameter, public log_size
Definition log.f90:46
Collection of vector field operations operating on and . Note that in general the indices and ....
Definition mathops.f90:67
subroutine, public opcolv(a1, a2, a3, c, gdim, n)
Definition mathops.f90:103
subroutine, public opadd2cm(a1, a2, a3, b1, b2, b3, c, n, gdim)
Definition mathops.f90:156
Defines a mesh.
Definition mesh.f90:34
Implements mixed_bc_t.
Definition mixed_bc.f90:31
Build configurations.
integer, parameter neko_bcknd_device
Defines no-slip boundary condition (extends zero_dirichlet).
Definition no_slip.f90:34
Implements non_normal_aligned_t.
Implements non_normal_t.
integer, parameter, public dp
Definition num_types.f90:10
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Operators.
Definition operators.f90:34
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.
Definition pnpn_res.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
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.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:158
Routines to generate the right-hand sides for the convection-diffusion equation. Employs the EXT/BDF ...
Definition rhs_maker.f90:38
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 the source_term_t type and a wrapper source_term_wrapper_t.
Implements symmetry_aligned_t.
Implements symmetry_t.
Definition symmetry.f90:34
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
integer, parameter, public neko_typename_len
Definition utils.f90:44
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:415
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.
Definition advection.f90:46
Helmholtz operator carrying a non-owning SVV object.
Matrix-vector product for a Helmholtz problem.
Base type for a matrix-vector product providing .
Definition ax.f90:44
Base type for a boundary condition.
Definition bc.f90:73
Blasius profile for inlet (vector valued).
Definition blasius.f90:55
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,...
Definition coef.f90:136
Generic Dirichlet boundary condition on .
Definition dirichlet.f90:49
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...
Definition file.f90:56
Dirichlet condition for inlet (vector valued).
Definition inflow.f90:48
Type for storing initial and final residuals in a Krylov solver.
Definition krylov.f90:60
Base type for mixed boundary conditions that need projector-provided local-basis data on the physical...
Definition mixed_bc.f90:50
Mixed Dirichlet condition constraining the tangential vector components.
Axis-aligned mixed Dirichlet condition in the non-normal direction.
Abstract type to compute pressure residual.
Definition pnpn_res.f90:48
Abstract type to compute velocity residual.
Definition pnpn_res.f90:54
Abstract type to add contributions to F from lagged BD terms.
Definition rhs_maker.f90:59
Abstract type to sum up contributions to kth order extrapolation scheme.
Definition rhs_maker.f90:52
Abstract type to add contributions of kth order OIFS scheme.
Definition rhs_maker.f90:66
Abstract type to compute extrapolated velocity field for the pressure equation.
Definition rhs_maker.f90:46
Projector for scalar boundary conditions.
A shear stress boundary condition.
Symmetry boundary condition constraining the normal vector component.
Definition symmetry.f90:50
Axis-aligned symmetry boundary condition.
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.
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...