36 f_x, f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd, dt,&
38 type(
field_t),
intent(inout) :: p, u, v, w
39 type(
field_t),
intent(in) :: u_e, v_e, w_e
40 type(
field_t),
intent(inout) :: p_res
41 type(
field_t),
intent(in) :: f_x, f_y, f_z
42 type(
coef_t),
intent(inout) :: c_Xh
43 type(
gs_t),
intent(inout) :: gs_Xh
46 class(
ax_t),
intent(inout) :: Ax
47 real(kind=
rp),
intent(in) :: bd
48 real(kind=
rp),
intent(in) :: dt
50 type(
field_t),
intent(in) :: rho
51 type(c_ptr),
intent(inout) :: event
53 integer :: n, nelv, lxyz
56 type(
field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2, work3
57 type(
field_t),
pointer :: s11, s22, s33, s12, s13, s23
58 integer :: temp_indices(15)
84 call rzero(c_xh%h2, n)
88 call curl(ta1, ta2, ta3, u_e, v_e, w_e, work1, work2, c_xh)
89 call curl(wa1, wa2, wa3, ta1, ta2, ta3, work1, work2, c_xh)
91 call col2(wa1%x, mu%x, n)
92 call col2(wa2%x, mu%x, n)
93 call col2(wa3%x, mu%x, n)
97 call strain_rate(s11%x, s22%x, s33%x, s12%x, s13%x, s23%x, &
102 call dudxyz(ta1%x, mu%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
103 call dudxyz(ta2%x, mu%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
104 call dudxyz(ta3%x, mu%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
106 call cmult(ta1%x, 2.0_rp, n)
107 call cmult(ta2%x, 2.0_rp, n)
108 call cmult(ta3%x, 2.0_rp, n)
112 call vdot3(work1%x(:, :, :, e), &
113 ta1%x(:, :, :, e), ta2%x(:, :, :, e), ta3%x(:, :, :, e), &
114 s11%x(:, :, :, e), s12%x(:, :, :, e), s13%x(:, :, :, e), &
117 call vdot3 (work2%x(:, :, :, e), &
118 ta1%x(:, :, :, e), ta2%x(:, :, :, e), ta3%x(:, :, :, e), &
119 s12%x(:, :, :, e), s22%x(:, :, :, e), s23%x(:, :, :, e), &
122 call vdot3 (work3%x(:, :, :, e), &
123 ta1%x(:, :, :, e), ta2%x(:, :, :, e), ta3%x(:, :, :, e), &
124 s13%x(:, :, :, e), s23%x(:, :, :, e), s33%x(:, :, :, e), &
132 call sub2(wa1%x, work1%x, n)
133 call sub2(wa2%x, work2%x, n)
134 call sub2(wa3%x, work3%x, n)
136 do concurrent(i = 1:n)
137 ta1%x(i,1,1,1) = f_x%x(i,1,1,1) / rho%x(i,1,1,1) &
138 - ((wa1%x(i,1,1,1) / rho%x(i,1,1,1)) * c_xh%B(i,1,1,1))
139 ta2%x(i,1,1,1) = f_y%x(i,1,1,1) / rho%x(i,1,1,1) &
140 - ((wa2%x(i,1,1,1) / rho%x(i,1,1,1)) * c_xh%B(i,1,1,1))
141 ta3%x(i,1,1,1) = f_z%x(i,1,1,1) / rho%x(i,1,1,1) &
142 - ((wa3%x(i,1,1,1) / rho%x(i,1,1,1)) * c_xh%B(i,1,1,1))
145 call gs_xh%op(ta1, gs_op_add)
146 call gs_xh%op(ta2, gs_op_add)
147 call gs_xh%op(ta3, gs_op_add)
150 ta1%x(i,1,1,1) = ta1%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
151 ta2%x(i,1,1,1) = ta2%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
152 ta3%x(i,1,1,1) = ta3%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
156 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
157 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
158 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
161 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
164 p_res%x(i,1,1,1) = (-p_res%x(i,1,1,1)) &
165 + wa1%x(i,1,1,1) + wa2%x(i,1,1,1) + wa3%x(i,1,1,1)
172 wa1%x(i,1,1,1) = 0.0_rp
173 wa2%x(i,1,1,1) = 0.0_rp
174 wa3%x(i,1,1,1) = 0.0_rp
177 call bc_sym_surface%apply_surfvec(wa1%x, wa2%x, wa3%x, ta1%x, ta2%x, ta3%x,&
182 ta1%x(i,1,1,1) = 0.0_rp
183 ta2%x(i,1,1,1) = 0.0_rp
184 ta3%x(i,1,1,1) = 0.0_rp
187 call bc_prs_surface%apply_surfvec(ta1%x, ta2%x, ta3%x, u%x, v%x, w%x, n)
190 p_res%x(i,1,1,1) = p_res%x(i,1,1,1) &
191 - (dtbd * (ta1%x(i,1,1,1) + ta2%x(i,1,1,1) + ta3%x(i,1,1,1)))&
192 - (wa1%x(i,1,1,1) + wa2%x(i,1,1,1) + wa3%x(i,1,1,1))
200 p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
201 class(
ax_t),
intent(in) :: Ax
202 type(
mesh_t),
intent(inout) :: msh
203 type(
space_t),
intent(inout) :: Xh
204 type(
field_t),
intent(inout) :: p, u, v, w
205 type(
field_t),
intent(inout) :: u_res, v_res, w_res
206 type(
field_t),
intent(in) :: f_x, f_y, f_z
207 type(
coef_t),
intent(inout) :: c_Xh
208 type(
field_t),
intent(in) :: mu
209 type(
field_t),
intent(in) :: rho
210 real(kind=
rp),
intent(in) :: bd
211 real(kind=
rp),
intent(in) :: dt
212 integer :: temp_indices(3)
213 type(
field_t),
pointer :: ta1, ta2, ta3
214 integer,
intent(in) :: n
217 call copy(c_xh%h1, mu%x, n)
218 call cmult2(c_xh%h2, rho%x, bd / dt, n)
222 call ax%compute_vector(u_res%x, v_res%x, w_res%x, u%x, v%x, w%x, c_xh,&
230 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
234 u_res%x(i,1,1,1) = (-u_res%x(i,1,1,1)) - ta1%x(i,1,1,1) + f_x%x(i,1,1,1)
235 v_res%x(i,1,1,1) = (-v_res%x(i,1,1,1)) - ta2%x(i,1,1,1) + f_y%x(i,1,1,1)
236 w_res%x(i,1,1,1) = (-w_res%x(i,1,1,1)) - ta3%x(i,1,1,1) + f_z%x(i,1,1,1)