38 use,
intrinsic :: iso_c_binding, only : c_ptr
43 use json_module,
only : json_file
70 procedure, pass(this) :: init_from_components => &
72 procedure, pass(this) :: set_stress_scalar => &
74 procedure, pass(this) :: set_stress_array => &
77 generic :: set_stress => set_stress_scalar, set_stress_array
89 integer,
intent(in) :: n
90 real(kind=
rp),
intent(inout),
dimension(n) :: x
91 real(kind=
rp),
intent(in),
optional :: t
92 integer,
intent(in),
optional :: tstep
93 logical,
intent(in),
optional :: strong
94 integer :: i, m, k, facet
98 call neko_error(
"The shear stress bc is not applicable to scalar fields.")
106 integer,
intent(in) :: n
107 real(kind=
rp),
intent(inout),
dimension(n) :: x
108 real(kind=
rp),
intent(inout),
dimension(n) :: y
109 real(kind=
rp),
intent(inout),
dimension(n) :: z
110 real(kind=
rp),
intent(in),
optional :: t
111 integer,
intent(in),
optional :: tstep
112 logical,
intent(in),
optional :: strong
113 logical :: strong_ = .true.
115 if (
present(strong)) strong_ = strong
118 call this%symmetry%apply_vector(x, y, z, n, t, tstep, .true.)
120 call this%neumann_x%apply_scalar(x, n, t, tstep, .false.)
121 call this%neumann_y%apply_scalar(y, n, t, tstep, .false.)
122 call this%neumann_z%apply_scalar(z, n, t, tstep, .false.)
132 real(kind=
rp),
intent(in),
optional :: t
133 integer,
intent(in),
optional :: tstep
134 logical,
intent(in),
optional :: strong
136 call neko_error(
"shear_stress bc not implemented on the device")
148 real(kind=
rp),
intent(in),
optional :: t
149 integer,
intent(in),
optional :: tstep
150 logical,
intent(in),
optional :: strong
152 call neko_error(
"shear_stress bc not implemented on the device")
161 type(
coef_t),
intent(in) :: coef
162 type(json_file),
intent(inout) ::json
163 real(kind=
rp),
allocatable :: value(:)
167 if (
size(
value) .ne. 3)
then
168 call neko_error (
"The shear stress vector provided for the shear stress &
169 & boundary condition should have 3 components.")
172 call this%init_from_components(coef,
value)
180 type(
coef_t),
intent(in) :: coef
181 real(kind=
rp),
intent(in) :: value(3)
183 call this%init_base(coef)
184 this%strong = .false.
186 call this%symmetry%free()
187 call this%symmetry%init_from_components(this%coef)
189 call this%neumann_x%free()
190 call this%neumann_y%free()
191 call this%neumann_z%free()
193 call this%neumann_x%init_from_components(this%coef, value(1))
194 call this%neumann_y%init_from_components(this%coef, value(2))
195 call this%neumann_z%init_from_components(this%coef, value(3))
202 call this%finalize_base()
204 call this%symmetry%mark_facets(this%marked_facet)
205 call this%symmetry%finalize()
208 call this%neumann_x%mark_facets(this%marked_facet)
209 call this%neumann_y%mark_facets(this%marked_facet)
210 call this%neumann_z%mark_facets(this%marked_facet)
212 call this%neumann_x%finalize()
213 call this%neumann_y%finalize()
214 call this%neumann_z%finalize()
221 real(kind=
rp),
intent(in) :: tau_x
222 real(kind=
rp),
intent(in) :: tau_y
223 real(kind=
rp),
intent(in) :: tau_z
226 call this%neumann_x%set_flux(tau_x)
227 call this%neumann_y%set_flux(tau_y)
228 call this%neumann_z%set_flux(tau_z)
236 real(kind=
rp),
intent(in) :: tau_x(this%msk(0))
237 real(kind=
rp),
intent(in) :: tau_y(this%msk(0))
238 real(kind=
rp),
intent(in) :: tau_z(this%msk(0))
240 call this%neumann_x%set_flux(tau_x)
241 call this%neumann_y%set_flux(tau_y)
242 call this%neumann_z%set_flux(tau_z)
250 call this%symmetry%free
252 call this%neumann_x%free
253 call this%neumann_y%free
254 call this%neumann_z%free
Retrieves a parameter by name or throws an error.
Defines a boundary condition.
Utilities for retrieving parameters from the case files.
Defines a Neumann boundary condition.
integer, parameter, public rp
Global precision used in computations.
Defines a shear stress boundary condition for a vector field. Maintainer: Timofey Mukha.
subroutine shear_stress_apply_vector_dev(this, x_d, y_d, z_d, t, tstep, strong)
Boundary condition apply for a generic shear_stress condition to vectors x, y and z (device version)
subroutine shear_stress_init_from_components(this, coef, value)
Constructor from components.
subroutine shear_stress_free(this)
Destructor.
subroutine shear_stress_apply_scalar(this, x, n, t, tstep, strong)
Apply shear stress for a scalar field x.
subroutine shear_stress_finalize(this)
subroutine shear_stress_set_stress_array(this, tau_x, tau_y, tau_z)
Set the shear stress components.
subroutine shear_stress_apply_vector(this, x, y, z, n, t, tstep, strong)
Boundary condition apply for a generic shear_stress condition to vectors x, y and z.
subroutine shear_stress_set_stress_scalar(this, tau_x, tau_y, tau_z)
Set the value of the shear stress vector using 3 scalars.
subroutine shear_stress_init(this, coef, json)
Constructor.
subroutine shear_stress_apply_scalar_dev(this, x_d, t, tstep, strong)
Boundary condition apply for a generic shear_stress condition to a vector x (device version)
Mixed Dirichlet-Neumann axis aligned symmetry plane.
Base type for a boundary condition.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
A Neumann boundary condition for scalar fields. Sets the flux of the field to the chosen value.
A shear stress boundary condition.
Mixed Dirichlet-Neumann symmetry plane condition.