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_inv, mu_rho
51 type(
field_t),
pointer :: ta1, ta2, ta3, wa1, wa2, wa3, work1, work2
52 integer :: temp_indices(8)
67 rho_inv = 1.0_rp / rho%x(1,1,1,1)
68 mu_rho = mu%x(1,1,1,1) / rho%x(1,1,1,1)
75 c_xh%h1(i,1,1,1) = rho_inv
76 c_xh%h2(i,1,1,1) = 0.0_rp
81 call curl(ta1, ta2, ta3, u_e, v_e, w_e, work1, work2, c_xh)
82 call curl(wa1, wa2, wa3, ta1, ta2, ta3, work1, work2, c_xh)
91 ta1%x(i,1,1,1) = f_x%x(i,1,1,1) * rho_inv &
92 - ((wa1%x(i,1,1,1) * mu_rho) * c_xh%B(i,1,1,1))
93 ta2%x(i,1,1,1) = f_y%x(i,1,1,1) * rho_inv &
94 - ((wa2%x(i,1,1,1) * mu_rho) * c_xh%B(i,1,1,1))
95 ta3%x(i,1,1,1) = f_z%x(i,1,1,1) * rho_inv &
96 - ((wa3%x(i,1,1,1) * mu_rho) * c_xh%B(i,1,1,1))
101 call gs_xh%op(ta1%x, ta2%x, ta3%x, n, gs_op_add)
110 ta1%x(i,1,1,1) = ta1%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
111 ta2%x(i,1,1,1) = ta2%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
112 ta3%x(i,1,1,1) = ta3%x(i,1,1,1) * c_xh%Binv(i,1,1,1)
116 call cdtp(wa1%x, ta1%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
117 call cdtp(wa2%x, ta2%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
118 call cdtp(wa3%x, ta3%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
120 call ax%compute(p_res%x, p%x, c_xh, p%msh, p%Xh)
131 p_res%x(i,1,1,1) = (-p_res%x(i,1,1,1)) &
132 + wa1%x(i,1,1,1) + wa2%x(i,1,1,1) + wa3%x(i,1,1,1)
139 call bc_prs_surface%apply_surfvec_sub(p_res%x, u%x, v%x, w%x, dtbd, n)
140 call bc_sym_surface%apply_surfvec_sub(p_res%x, ta1%x, ta2%x, ta3%x, &
149 p, f_x, f_y, f_z, c_Xh, msh, Xh, mu, rho, bd, dt, n)
150 class(
ax_t),
intent(in) :: Ax
151 type(
mesh_t),
intent(inout) :: msh
152 type(
space_t),
intent(inout) :: Xh
153 type(
field_t),
intent(inout) :: p, u, v, w
154 type(
field_t),
intent(inout) :: u_res, v_res, w_res
155 type(
field_t),
intent(in) :: f_x, f_y, f_z
156 type(
coef_t),
intent(inout) :: c_Xh
157 type(
field_t),
intent(in) :: mu
158 type(
field_t),
intent(in) :: rho
159 real(kind=
rp),
intent(in) :: bd
160 real(kind=
rp),
intent(in) :: dt
161 real(kind=
rp) :: rho_val, mu_val
162 integer :: temp_indices(3)
163 type(
field_t),
pointer :: ta1, ta2, ta3
164 integer,
intent(in) :: n
168 rho_val = rho%x(1,1,1,1)
169 mu_val = mu%x(1,1,1,1)
177 c_xh%h1(i,1,1,1) = mu_val
178 c_xh%h2(i,1,1,1) = rho_val * bd / dt
185 call ax%compute_vector(u_res%x, v_res%x, w_res%x, u%x, v%x, w%x, &
191 call opgrad(ta1%x, ta2%x, ta3%x, p%x, c_xh)
199 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)
200 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)
201 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)