Neko-TOP
A portable framework for high-order spectral element flow toplogy optimization.
Loading...
Searching...
No Matches
advection_adjoint_fctry.f90
1
34!
36submodule(advection_adjoint) advection_adjoint_fctry
37 use json_utils, only: json_get, json_get_or_default
38 use utils, only: neko_error
39
40 ! Advection and derivatives
43
44contains
45
59 module subroutine advection_adjoint_factory(object, json, coef, ulag, vlag, wlag, &
60 dtlag, tlag, time_scheme, use_dummy, slag)
61 class(advection_adjoint_t), allocatable, intent(inout) :: object
62 type(json_file), intent(inout) :: json
63 type(coef_t), intent(inout), target :: coef
64 type(field_series_t), intent(in), target :: ulag, vlag, wlag
65 real(kind=rp), intent(in), target :: dtlag(10)
66 real(kind=rp), intent(in), target :: tlag(10)
67 type(time_scheme_controller_t), intent(in), target :: time_scheme
68 logical, optional, intent(in) :: use_dummy
69 type(field_series_t), target, optional, intent(in) :: slag
70
71 logical :: dealias, oifs
72 real(kind=rp) :: ctarget
73 integer :: lxd, order
74
75 ! Free allocatables if necessary
76 if (allocated(object)) then
77 call object%free
78 deallocate(object)
79 end if
80
81 if (present(use_dummy)) then
82 if (use_dummy .eqv. .true.) then
83 call neko_error("Dummy advection is not supported in the adjoint module.")
84 return
85 end if
86 end if
87
88 call json_get(json, 'dealias', dealias)
89 call json_get(json, 'polynomial_order', order)
90 call json_get_or_default(json, 'oifs', oifs, .false.)
91
92 call json_get_or_default(json, 'dealiased_polynomial_order', &
93 lxd, (3 * (order + 1)) / 2)
94
95 call json_get_or_default(json, 'target_cfl', ctarget, 1.9_rp)
96
97 if (oifs) then
98 call neko_error("OIFS advection is not supported in the adjoint module.")
99 else
100 if (dealias) then
101 allocate(adv_lin_dealias_t::object)
102 else
103 allocate(adv_lin_no_dealias_t::object)
104 end if
105 end if
106
107 select type (adv => object)
108 type is (adv_lin_dealias_t)
109 call adv%init(lxd, coef)
110 type is (adv_lin_no_dealias_t)
111 call adv%init(coef)
112 ! type is (adv_oifs_t)
113 ! if (present(slag)) then
114 ! call adv%init(lxd, coef, ctarget, ulag, vlag, wlag, &
115 ! dtlag, tlag, time_scheme, slag)
116 ! else
117 ! call adv%init(lxd, coef, ctarget, ulag, vlag, wlag, &
118 ! dtlag, tlag, time_scheme)
119 ! end if
120 end select
121
122 end subroutine advection_adjoint_factory
123
124
125end submodule advection_adjoint_fctry
Subroutines to add advection terms to the RHS of a transport equation.
Subroutines to add perturbed advection terms to the RHS of a transport equation.
Subroutines to add advection terms to the RHS of a transport equation.
Type encapsulating advection routines with dealiasing.
Type encapsulating advection routines with no dealiasing applied.