Loading [MathJax]/extensions/tex2jax.js
Neko 0.9.99
A portable framework for high-order spectral element flow simulations
All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Pages
fluid_plan1.f90
Go to the documentation of this file.
1
6 space_t, dofmap_t, gs_t, coef_t, gs_init, gs_free, space_free, &
7 mesh_t, rp, time_step_controller_t, time_scheme_controller_t
8 implicit none
9
11 type(space_t) :: yh
12 type(dofmap_t) :: dm_yh
13 type(gs_t) :: gs_yh
14 type(coef_t) :: c_yh
16 contains
17 procedure, pass(this) :: init => fluid_plan1_init
18 procedure, pass(this) :: free => fluid_plan1_free
19 procedure, pass(this) :: step => fluid_plan1_step
20 end type fluid_plan1_t
21
22contains
23
24 subroutine fluid_plan1_init(this, msh, lx, param)
25 class(fluid_plan1_t), target, intent(inout) :: this
26 type(mesh_t), target, intent(inout) :: msh
27 integer, intent(in) :: lx
28 type(param_t), target, intent(inout) :: param
29 character(len=15), parameter :: scheme = 'plan1 (Pn/Pn-2)'
30 integer :: lx2
31
32 call this%free()
33
35 call this%scheme_init(msh, lx, param, kspv_init=.true., scheme=scheme)
36
38 lx2 = lx - 2
39 if (msh%gdim .eq. 2) then
40 call this%Yh%init(gll, lx2, lx2)
41 else
42 call this%Yh%init(gll, lx2, lx2, lx2)
43 end if
44
45 call this%dm_Yh%init(msh, this%Yh)
46
47 call this%p%init(this%dm_Yh)
48
49 call gs_init(this%gs_Yh, this%dm_Yh)
50
51 call this%c_Yh%init(this%gs_Yh)
52
53 call fluid_scheme_solver_factory(this%ksp_prs, this%dm_Yh%size(), &
54 param%ksp_prs, param%abstol_prs)
55 call fluid_scheme_precon_factory(this%pc_prs, this%ksp_prs, &
56 this%c_Yh, this%dm_Yh, this%gs_Yh, this%bclst_prs, param%pc_prs)
57
58
59 end subroutine fluid_plan1_init
60
61 subroutine fluid_plan1_free(this)
62 class(fluid_plan1_t), intent(inout) :: this
63
64 ! Deallocate velocity and pressure fields
65 call this%scheme_free()
66
67 ! Deallocate Pressure dofmap and space
68 call space_free(this%Yh)
69
70 call gs_free(this%gs_Yh)
71
72 call this%c_Yh%free()
73
74 end subroutine fluid_plan1_free
75
76 subroutine fluid_plan1_step(this, t, tstep, ext_bdf, dt_controller)
77 class(fluid_plan1_t), target, intent(inout) :: this
78 real(kind=rp), intent(in) :: t
79 integer, intent(in) :: tstep
80 type(time_scheme_controller_t), intent(in) :: ext_bdf
81 type(time_step_controller_t), intent(in) :: dt_controller
82
83 if (this%freeze) return
84
85 end subroutine fluid_plan1_step
86
87end module fluid_plan1
Classic NEKTON formulation Compute pressure and velocity using consistent approximation spaces.
subroutine fluid_plan1_step(this, t, tstep, ext_bdf, dt_controller)
subroutine fluid_plan1_init(this, msh, lx, param)
subroutine fluid_plan1_free(this)
subroutine fluid_scheme_solver_factory(ksp, n, solver, max_iter, abstol, monitor)
Initialize a linear solver.
subroutine fluid_scheme_precon_factory(this, pc, ksp, coef, dof, gs, bclst, pctype)
Initialize a Krylov preconditioner.