36 use user_intf,
only: user_t
37 use utils,
only: neko_type_error
38 use field_dirichlet,
only: field_dirichlet_t
39 use inflow,
only: inflow_t
40 use blasius,
only: blasius_t
41 use dirichlet,
only: dirichlet_t
42 use dong_outflow,
only: dong_outflow_t
43 use symmetry,
only: symmetry_t
44 use non_normal,
only: non_normal_t
45 use field_dirichlet_vector,
only: field_dirichlet_vector_t
49 character(len=25) :: ADJOINT_FLUID_PNPN_KNOWN_BCS(13) = &
50 [character(len=25) :: &
57 "normal_outflow+dong", &
62 "user_velocity_pointwise", &
73 module subroutine pressure_bc_factory(object, scheme, json, coef, user)
74 class(bc_t),
pointer,
intent(inout) :: object
75 type(adjoint_fluid_pnpn_t),
intent(in) :: scheme
76 type(json_file),
intent(inout) :: json
77 type(coef_t),
intent(in) :: coef
78 type(user_t),
intent(in) :: user
79 character(len=:),
allocatable :: type
81 integer,
allocatable :: zone_indices(:)
83 call json_get(json,
"type", type)
85 select case (trim(type))
86 case (
"outflow",
"normal_outflow")
87 allocate(zero_dirichlet_t::object)
89 case (
"outflow+dong",
"normal_outflow+dong")
90 allocate(dong_outflow_t::object)
92 case (
"user_pressure")
93 allocate(field_dirichlet_t::object)
94 select type (obj => object)
95 type is (field_dirichlet_t)
96 obj%update => user%dirichlet_conditions
97 call json%add(
"field_name", scheme%p_adj%name)
101 do i = 1,
size(adjoint_fluid_pnpn_known_bcs)
102 if (trim(type) .eq. trim(adjoint_fluid_pnpn_known_bcs(i)))
return
104 call neko_type_error(
"adjoint_fluid_pnpn boundary conditions",
type, &
105 ADJOINT_FLUID_PNPN_KNOWN_BCS)
108 call json_get(json,
"zone_indices", zone_indices)
109 call object%init(coef, json)
111 do i = 1,
size(zone_indices)
112 call object%mark_zone(coef%msh%labeled_zones(zone_indices(i)))
114 call object%finalize()
118 do i = 1,
size(zone_indices)
119 do j = 1, scheme%msh%nelv
120 do k = 1, 2 * scheme%msh%gdim
121 if (scheme%msh%facet_type(k,j) .eq. -zone_indices(i))
then
122 scheme%msh%facet_type(k, j) = 1
127 end subroutine pressure_bc_factory
135 module subroutine velocity_bc_factory(object, scheme, json, coef, user)
136 class(bc_t),
pointer,
intent(inout) :: object
137 type(adjoint_fluid_pnpn_t),
intent(in) :: scheme
138 type(json_file),
intent(inout) :: json
139 type(coef_t),
intent(in) :: coef
140 type(user_t),
intent(in) :: user
141 character(len=:),
allocatable :: type
143 integer,
allocatable :: zone_indices(:)
145 call json_get(json,
"type", type)
147 select case (trim(type))
149 allocate(symmetry_t::object)
150 case (
"velocity_value")
151 allocate(inflow_t::object)
153 allocate(zero_dirichlet_t::object)
154 case (
"normal_outflow",
"normal_outflow+dong")
155 allocate(non_normal_t::object)
156 case (
"blasius_profile")
157 allocate(blasius_t::object)
158 case (
"shear_stress")
159 allocate(shear_stress_t::object)
161 allocate(wall_model_bc_t::object)
167 case (
"user_velocity")
168 allocate(field_dirichlet_vector_t::object)
169 select type (obj => object)
170 type is (field_dirichlet_vector_t)
171 obj%update => user%dirichlet_conditions
183 do i = 1,
size(adjoint_fluid_pnpn_known_bcs)
184 if (trim(type) .eq. trim(adjoint_fluid_pnpn_known_bcs(i)))
return
186 call neko_type_error(
"adjoint_fluid_pnpn boundary conditions",
type, &
187 ADJOINT_FLUID_PNPN_KNOWN_BCS)
190 call json_get(json,
"zone_indices", zone_indices)
191 call object%init(coef, json)
192 do i = 1,
size(zone_indices)
193 call object%mark_zone(coef%msh%labeled_zones(zone_indices(i)))
195 call object%finalize()
198 if (trim(type) .ne.
"normal_outflow" .and. &
199 trim(type) .ne.
"normal_outflow+dong")
then
200 do i = 1,
size(zone_indices)
201 do j = 1, scheme%msh%nelv
202 do k = 1, 2 * scheme%msh%gdim
203 if (scheme%msh%facet_type(k,j) .eq. -zone_indices(i))
then
204 scheme%msh%facet_type(k, j) = 2
210 end subroutine velocity_bc_factory
212end submodule adjoint_fluid_pnpn_bc_fctry
Adjoint Pn/Pn formulation.