37 use user_intf,
only: user_t
38 use utils,
only: neko_type_error
39 use field_dirichlet,
only: field_dirichlet_t
40 use inflow,
only: inflow_t
41 use blasius,
only: blasius_t
42 use dirichlet,
only: dirichlet_t
43 use dong_outflow,
only: dong_outflow_t
44 use symmetry_aligned,
only: symmetry_aligned_t
45 use non_normal_aligned,
only: non_normal_aligned_t
46 use zero_dirichlet,
only: zero_dirichlet_t
47 use shear_stress,
only: shear_stress_t
48 use wall_model_bc,
only: wall_model_bc_t
49 use field_dirichlet_vector,
only: field_dirichlet_vector_t
53 character(len=25) :: ADJOINT_FLUID_PNPN_KNOWN_BCS(13) = &
54 [character(len=25) :: &
61 "normal_outflow+dong", &
66 "user_velocity_pointwise", &
77 module subroutine pressure_bc_factory(object, scheme, json, coef, user)
78 class(bc_t),
pointer,
intent(inout) :: object
79 type(adjoint_fluid_pnpn_t),
intent(in) :: scheme
80 type(json_file),
intent(inout) :: json
81 type(coef_t),
target,
intent(in) :: coef
82 type(user_t),
target,
intent(in) :: user
83 character(len=:),
allocatable :: type
85 integer,
allocatable :: zone_indices(:)
87 call json_get(json,
"type", type)
89 select case (trim(type))
90 case (
"outflow",
"normal_outflow")
91 allocate(zero_dirichlet_t::object)
93 case (
"outflow+dong",
"normal_outflow+dong")
94 allocate(dong_outflow_t::object)
96 case (
"user_pressure")
97 allocate(field_dirichlet_t::object)
98 select type (obj => object)
99 type is (field_dirichlet_t)
100 obj%update => user%dirichlet_conditions
101 call json%add(
"field_name", scheme%p_adj%name)
105 do i = 1,
size(adjoint_fluid_pnpn_known_bcs)
106 if (trim(type) .eq. trim(adjoint_fluid_pnpn_known_bcs(i)))
return
108 call neko_type_error(
"adjoint_fluid_pnpn boundary conditions",
type, &
109 ADJOINT_FLUID_PNPN_KNOWN_BCS)
112 call json_get(json,
"zone_indices", zone_indices)
113 call object%init(coef, json)
115 do i = 1,
size(zone_indices)
116 call object%mark_labeled_zone(zone_indices(i))
118 call object%finalize()
122 do i = 1,
size(zone_indices)
123 do j = 1, scheme%msh%nelv
124 do k = 1, 2 * scheme%msh%gdim
125 if (scheme%msh%facet_type(k,j) .eq. -zone_indices(i))
then
126 scheme%msh%facet_type(k, j) = 1
131 end subroutine pressure_bc_factory
139 module subroutine velocity_bc_factory(object, scheme, json, coef, user)
140 class(bc_t),
pointer,
intent(inout) :: object
141 type(adjoint_fluid_pnpn_t),
intent(in) :: scheme
142 type(json_file),
intent(inout) :: json
143 type(coef_t),
target,
intent(in) :: coef
144 type(user_t),
target,
intent(in) :: user
145 character(len=:),
allocatable :: type
147 integer,
allocatable :: zone_indices(:)
149 call json_get(json,
"type", type)
151 select case (trim(type))
153 allocate(symmetry_aligned_t::object)
154 case (
"velocity_value")
155 allocate(inflow_t::object)
157 allocate(zero_dirichlet_t::object)
158 case (
"normal_outflow",
"normal_outflow+dong")
159 allocate(non_normal_aligned_t::object)
160 case (
"blasius_profile")
161 allocate(blasius_t::object)
162 case (
"shear_stress")
163 allocate(shear_stress_t::object)
165 allocate(wall_model_bc_t::object)
171 case (
"user_velocity")
172 allocate(field_dirichlet_vector_t::object)
173 select type (obj => object)
174 type is (field_dirichlet_vector_t)
175 obj%update => user%dirichlet_conditions
187 do i = 1,
size(adjoint_fluid_pnpn_known_bcs)
188 if (trim(type) .eq. trim(adjoint_fluid_pnpn_known_bcs(i)))
return
190 call neko_type_error(
"adjoint_fluid_pnpn boundary conditions",
type, &
191 ADJOINT_FLUID_PNPN_KNOWN_BCS)
194 call json_get(json,
"zone_indices", zone_indices)
195 call object%init(coef, json)
196 do i = 1,
size(zone_indices)
197 call object%mark_labeled_zone(zone_indices(i))
199 call object%finalize()
202 if (trim(type) .ne.
"normal_outflow" .and. &
203 trim(type) .ne.
"normal_outflow+dong")
then
204 do i = 1,
size(zone_indices)
205 do j = 1, scheme%msh%nelv
206 do k = 1, 2 * scheme%msh%gdim
207 if (scheme%msh%facet_type(k,j) .eq. -zone_indices(i))
then
208 scheme%msh%facet_type(k, j) = 2
214 end subroutine velocity_bc_factory
216end submodule adjoint_fluid_pnpn_bc_fctry
Adjoint Pn/Pn formulation.