correct_face_flux Subroutine

private subroutine correct_face_flux(mesh, flow, bc, params, predicted_flux, phi, face_flux)

Corrects face fluxes using the pressure potential gradient.

Arguments

Type IntentOptional 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) :: predicted_flux(:)
real(kind=rk), intent(in) :: phi(:)
real(kind=rk), intent(out) :: face_flux(:)

Calls

proc~~correct_face_flux~~CallsGraph proc~correct_face_flux mod_flow_projection::correct_face_flux proc~boundary_pressure_type mod_bc::boundary_pressure_type proc~correct_face_flux->proc~boundary_pressure_type proc~face_effective_neighbor mod_bc::face_effective_neighbor proc~correct_face_flux->proc~face_effective_neighbor proc~face_normal_distance mod_flow_projection::face_normal_distance proc~correct_face_flux->proc~face_normal_distance proc~is_periodic_face mod_bc::is_periodic_face proc~face_effective_neighbor->proc~is_periodic_face proc~fatal_error mod_kinds::fatal_error proc~face_normal_distance->proc~fatal_error proc~outward_normal mod_flow_projection::outward_normal proc~face_normal_distance->proc~outward_normal proc~patch_type_for_face mod_bc::patch_type_for_face proc~face_normal_distance->proc~patch_type_for_face proc~is_periodic_face->proc~patch_type_for_face

Called by

proc~~correct_face_flux~~CalledByGraph proc~correct_face_flux mod_flow_projection::correct_face_flux proc~advance_projection_step mod_flow_projection::advance_projection_step proc~advance_projection_step->proc~correct_face_flux program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~advance_projection_step

Source Code

   subroutine correct_face_flux(mesh, flow, bc, params, predicted_flux, phi, face_flux)
      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) :: predicted_flux(:)
      real(rk), intent(in) :: phi(:)
      real(rk), intent(out) :: face_flux(:)

      integer :: i, f, owner, nb
      real(rk) :: dist

      face_flux = zero

      do i = 1, size(flow%owned_faces)
         f = flow%owned_faces(i)
         owner = mesh%faces(f)%owner

         nb = face_effective_neighbor(mesh, bc, f, owner)

         face_flux(f) = predicted_flux(f)

         if (nb > 0) then
            dist = face_normal_distance(mesh, bc, f, owner, nb)

            face_flux(f) = predicted_flux(f) - params%dt / params%rho * &
                            mesh%faces(f)%area * (phi(nb) - phi(owner)) / dist
         else
            if (boundary_pressure_type(mesh, bc, f) == bc_dirichlet) then
               dist = face_normal_distance(mesh, bc, f, owner, 0)
               face_flux(f) = predicted_flux(f) - params%dt / params%rho * &
                               mesh%faces(f)%area * (zero - phi(owner)) / dist
            end if
         end if
      end do
   end subroutine correct_face_flux