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.
| Type | Intent | Optional | 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(:,:) |
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