32 f_y, f_z, c_Xh, gs_Xh, bc_prs_surface, bc_sym_surface, Ax, bd, dt, mu, &
34 type(
field_t),
intent(inout) :: p, u, v, w
35 type(
field_t),
intent(in) :: u_e, v_e, w_e
36 type(
field_t),
intent(inout) :: p_res
37 type(
field_t),
intent(in) :: f_x, f_y, f_z
38 type(
coef_t),
intent(inout) :: c_Xh
39 type(
gs_t),
intent(inout) :: gs_Xh
42 class(
ax_t),
intent(inout) :: Ax
43 real(kind=
rp),
intent(in) :: bd
44 real(kind=
rp),
intent(in) :: dt
46 type(
field_t),
intent(in) :: rho
47 type(c_ptr),
intent(inout) :: event
48 real(kind=
rp) :: dtbd, rho_val, mu_val
51 type(
field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2
52 integer :: temp_indices(8)
66 rho_val = rho%x(1,1,1,1)
67 mu_val = mu%x(1,1,1,1)
73 c_xh%h1(i,1,1,1) = 1.0_rp / rho_val
74 c_xh%h2(i,1,1,1) = 0.0_rp
79 call curl(ta1, ta2, ta3, u_e, v_e, w_e, work1, work2, c_xh)
80 call curl(wa1, wa2, wa3, ta1, ta2, ta3, work1, work2, c_xh)
88 ta1%x(i,1,1,1) = f_x%x(i,1,1,1) / rho_val &
89 - ((wa1%x(i,1,1,1) * (mu_val / rho_val)) * c_xh%B(i,1,1,1))
90 ta2%x(i,1,1,1) = f_y%x(i,1,1,1) / rho_val &
91 - ((wa2%x(i,1,1,1) * (mu_val / rho_val)) * c_xh%B(i,1,1,1))
92 ta3%x(i,1,1,1) = f_z%x(i,1,1,1) / rho_val &
93 - ((wa3%x(i,1,1,1) * (mu_val / rho_val)) * c_xh%B(i,1,1,1))
98 call gs_xh%op(ta1, gs_op_add)
99 call gs_xh%op(ta2, gs_op_add)
100 call gs_xh%op(ta3, gs_op_add)
108 ta1%x(i,1,1,1) = ta1%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
109 ta2%x(i,1,1,1) = ta2%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
110 ta3%x(i,1,1,1) = ta3%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
114 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
115 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
116 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
118 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
126 p_res%x(i,1,1,1) = (-p_res%x(i,1,1,1)) &
127 + wa1%x(i,1,1,1) + wa2%x(i,1,1,1) + wa3%x(i,1,1,1)
139 wa1%x(i,1,1,1) = 0.0_rp
140 wa2%x(i,1,1,1) = 0.0_rp
141 wa3%x(i,1,1,1) = 0.0_rp
146 call bc_sym_surface%apply_surfvec(wa1%x, wa2%x, wa3%x, ta1%x, ta2%x, ta3%x,&
155 ta1%x(i,1,1,1) = 0.0_rp
156 ta2%x(i,1,1,1) = 0.0_rp
157 ta3%x(i,1,1,1) = 0.0_rp
161 call bc_prs_surface%apply_surfvec(ta1%x, ta2%x, ta3%x, u%x, v%x, w%x, n)
168 p_res%x(i,1,1,1) = p_res%x(i,1,1,1) &
169 - (dtbd * (ta1%x(i,1,1,1) + ta2%x(i,1,1,1) + ta3%x(i,1,1,1)))&
170 - (wa1%x(i,1,1,1) + wa2%x(i,1,1,1) + wa3%x(i,1,1,1))
179 p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
180 class(
ax_t),
intent(in) :: Ax
181 type(
mesh_t),
intent(inout) :: msh
182 type(
space_t),
intent(inout) :: Xh
183 type(
field_t),
intent(inout) :: p, u, v, w
184 type(
field_t),
intent(inout) :: u_res, v_res, w_res
185 type(
field_t),
intent(in) :: f_x, f_y, f_z
186 type(
coef_t),
intent(inout) :: c_Xh
187 type(
field_t),
intent(in) :: mu
188 type(
field_t),
intent(in) :: rho
189 real(kind=
rp),
intent(in) :: bd
190 real(kind=
rp),
intent(in) :: dt
191 real(kind=
rp) :: rho_val, mu_val
192 integer :: temp_indices(3)
193 type(
field_t),
pointer :: ta1, ta2, ta3
194 integer,
intent(in) :: n
198 rho_val = rho%x(1,1,1,1)
199 mu_val = mu%x(1,1,1,1)
206 c_xh%h1(i,1,1,1) = mu_val
207 c_xh%h2(i,1,1,1) = rho_val * bd / dt
212 call ax%compute(u_res%x, u%x, c_xh, msh, xh)
213 call ax%compute(v_res%x, v%x, c_xh, msh, xh)
214 call ax%compute(w_res%x, w%x, c_xh, msh, xh)
219 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
226 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)
227 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)
228 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)