advance_ab2 Subroutine

private subroutine advance_ab2(mesh, flow, params, fields, rhs, local_ustar)

Advances velocity using the 2nd-order Adams-Bashforth scheme.

Falls back to 1st-order Forward Euler on the very first timestep when previous RHS data is unavailable.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(in) :: flow
type(case_params_t), intent(in) :: params
type(flow_fields_t), intent(in) :: fields
real(kind=rk), intent(in) :: rhs(:,:)
real(kind=rk), intent(out) :: local_ustar(:,:)

Called by

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

Source Code

   subroutine advance_ab2(mesh, flow, params, fields, rhs, local_ustar)
      type(mesh_t), intent(in) :: mesh
      type(flow_mpi_t), intent(in) :: flow
      type(case_params_t), intent(in) :: params
      type(flow_fields_t), intent(in) :: fields
      real(rk), intent(in) :: rhs(:,:)
      real(rk), intent(out) :: local_ustar(:,:)

      integer :: c

      local_ustar = zero

      do c = flow%first_cell, flow%last_cell
         if (fields%rhs_old_valid) then
            local_ustar(:, c) = fields%u(:, c) + params%dt * &
               (1.5_rk * rhs(:, c) - 0.5_rk * fields%rhs_old(:, c))
         else
            local_ustar(:, c) = fields%u(:, c) + params%dt * rhs(:, c)
         end if
      end do

      associate(dummy => mesh%ncells)
      end associate
   end subroutine advance_ab2