80 type(json_file),
intent(inout) :: json
82 type(
coef_t),
intent(in),
target :: coef
83 character(len=*),
intent(in) :: variable_name
84 real(kind=
rp),
allocatable :: domain_vel(:)
86 real(kind=
rp) :: start_time, end_time
91 if (json%valid_path(
"domain_velocity"))
then
94 if (
size(domain_vel) .ne. 3)
then
95 call neko_error(
"The domain velocity should have 3 components.")
98 allocate(domain_vel(3))
103 domain_vel, coef, start_time, end_time)
114 coef, start_time, end_time)
117 real(kind=
rp),
intent(in) :: domain_vel(3)
119 real(kind=
rp),
intent(in) :: start_time
120 real(kind=
rp),
intent(in) :: end_time
123 call this%init_base(fields, coef, start_time, end_time)
125 if (fields%size() .ne. 3)
then
126 call neko_error(
"Number of fields for the translation force must be 3.")
129 this%domain_vel = domain_vel
149 type(
field_t),
pointer :: u, v, w
150 type(
field_t),
pointer :: work1, work2, work3
151 type(
field_t),
pointer :: work4, work5, work6, work7
152 integer :: tmp_index(7)
153 type(
field_t),
pointer :: fx, fy, fz
159 fx => this%fields%get_by_index(1)
160 fy => this%fields%get_by_index(2)
161 fz => this%fields%get_by_index(3)
174 work1 = this%domain_vel(1)
175 work2 = this%domain_vel(2)
176 work3 = this%domain_vel(3)
182 call div(work7%x, work4%x, work5%x, work6%x, this%coef)
189 call div(work7%x, work4%x, work5%x, work6%x, this%coef)
196 call div(work7%x, work4%x, work5%x, work6%x, this%coef)
subroutine, public div(res, ux, uy, uz, coef)
Compute the divergence of a vector field.