46 use,
intrinsic :: iso_c_binding, only : c_ptr, c_sizeof
47 use json_module,
only : json_file
61 real(kind=
rp) :: delta
63 type(c_ptr) :: normal_x_d
64 type(c_ptr) :: normal_y_d
65 type(c_ptr) :: normal_z_d
79 type(
coef_t),
intent(in) :: coef
80 type(json_file),
intent(inout) :: json
81 real(kind=
rp),
allocatable :: temp_x(:)
82 real(kind=
rp),
allocatable :: temp_y(:)
83 real(kind=
rp),
allocatable :: temp_z(:)
85 integer :: i, m, k, facet, idx(4)
86 real(kind=
rp) :: normal_xyz(3)
100 call device_alloc(this%normal_x_d, c_sizeof(dummy)*this%msk(0))
101 call device_alloc(this%normal_y_d, c_sizeof(dummy)*this%msk(0))
102 call device_alloc(this%normal_z_d, c_sizeof(dummy)*this%msk(0))
109 facet = this%facet(i)
112 this%coef%get_normal(idx(1), idx(2), idx(3), idx(4),facet)
113 temp_x(i) = normal_xyz(1)
114 temp_y(i) = normal_xyz(2)
115 temp_z(i) = normal_xyz(3)
123 deallocate( temp_x, temp_y, temp_z)
131 integer,
intent(in) :: n
132 real(kind=
rp),
intent(inout),
dimension(n) :: x
133 real(kind=
rp),
intent(in),
optional :: t
134 integer,
intent(in),
optional :: tstep
135 integer :: i, m, k, facet, idx(4)
136 real(kind=
rp) :: vn, s0, ux, uy, uz, normal_xyz(3)
141 facet = this%facet(i)
142 ux = this%u%x(k,1,1,1)
143 uy = this%v%x(k,1,1,1)
144 uz = this%w%x(k,1,1,1)
146 normal_xyz = this%coef%get_normal(idx(1), idx(2), idx(3), idx(4),facet)
147 vn = ux*normal_xyz(1) + uy*normal_xyz(2) + uz*normal_xyz(3)
148 s0 = 0.5_rp*(1.0_rp - tanh(vn / (this%uinf * this%delta)))
150 x(k)=-0.5*(ux*ux+uy*uy+uz*uz)*s0
158 integer,
intent(in) :: n
159 real(kind=
rp),
intent(inout),
dimension(n) :: x
160 real(kind=
rp),
intent(inout),
dimension(n) :: y
161 real(kind=
rp),
intent(inout),
dimension(n) :: z
162 real(kind=
rp),
intent(in),
optional :: t
163 integer,
intent(in),
optional :: tstep
172 real(kind=
rp),
intent(in),
optional :: t
173 integer,
intent(in),
optional :: tstep
176 this%normal_y_d, this%normal_z_d,&
177 this%u%x_d, this%v%x_d, this%w%x_d,&
178 this%uinf, this%delta,&
190 real(kind=
rp),
intent(in),
optional :: t
191 integer,
intent(in),
optional :: tstep
__device__ void nonlinear_index(const int idx, const int lx, int *index)
Copy data between host and device (or device and device)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Defines a boundary condition.
subroutine, public device_dong_outflow_apply_scalar(msk, x, normal_x, normal_y, normal_z, u, v, w, uinf, delta, m)
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
subroutine, public device_alloc(x_d, s)
Allocate memory on the device.
Defines a dirichlet boundary condition.
Defines a mapping of the degrees of freedom.
Defines a dong outflow condition.
subroutine dong_outflow_apply_vector(this, x, y, z, n, t, tstep)
Boundary condition apply for a generic Dirichlet condition to vectors x, y and z.
subroutine dong_outflow_apply_scalar(this, x, n, t, tstep)
Boundary condition apply for a generic Dirichlet condition to a vector x.
subroutine dong_outflow_apply_vector_dev(this, x_d, y_d, z_d, t, tstep)
Boundary condition apply for a generic Dirichlet condition to vectors x, y and z (device version)
subroutine dong_outflow_apply_scalar_dev(this, x_d, t, tstep)
Boundary condition apply for a generic Dirichlet condition to a vector x (device version)
subroutine dong_outflow_free(this)
Destructor.
subroutine dong_outflow_init(this, coef, json)
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Utilities for retrieving parameters from the case files.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Base type for a boundary condition.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Dong outflow condition Follows "A Convective-like Energy-Stable Open Boundary Condition for Simulati...