Updates cell-centered velocity using the pressure potential gradient.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_t), | intent(in) | :: | mesh | |||
| type(flow_mpi_t), | intent(in) | :: | flow | |||
| type(bc_set_t), | intent(in) | :: | bc | |||
| type(case_params_t), | intent(in) | :: | params | |||
| real(kind=rk), | intent(in) | :: | ustar(:,:) | |||
| real(kind=rk), | intent(in) | :: | phi(:) | |||
| real(kind=rk), | intent(out) | :: | local_u(:,:) |
subroutine correct_cell_velocity(mesh, flow, bc, params, ustar, phi, local_u) type(mesh_t), intent(in) :: mesh type(flow_mpi_t), intent(in) :: flow type(bc_set_t), intent(in) :: bc type(case_params_t), intent(in) :: params real(rk), intent(in) :: ustar(:,:) real(rk), intent(in) :: phi(:) real(rk), intent(out) :: local_u(:,:) integer :: c, lf, f, nb real(rk) :: nvec(3), grad(3), phi_face local_u = zero do c = flow%first_cell, flow%last_cell grad = zero do lf = 1, mesh%ncell_faces(c) f = mesh%cell_faces(lf, c) nvec = outward_normal(mesh, f, c) nb = face_effective_neighbor(mesh, bc, f, c) if (nb > 0) then phi_face = face_linear_scalar(mesh, bc, f, c, nb, phi(c), phi(nb)) else if (boundary_pressure_type(mesh, bc, f) == bc_dirichlet) then phi_face = zero else phi_face = phi(c) end if end if grad = grad + phi_face * nvec * mesh%faces(f)%area end do grad = grad / mesh%cells(c)%volume local_u(:, c) = ustar(:, c) - params%dt / params%rho * grad end do end subroutine correct_cell_velocity