drag_acceleration Subroutine

public pure subroutine drag_acceleration(vrel, cd, area, m, rho, acc)

Acceleration due to atmospheric drag.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(3) :: vrel

velocity relative to the atmosphere [km/s]

real(kind=wp), intent(in) :: cd

spacecraft drag coefficient [--]

real(kind=wp), intent(in) :: area

cross-section area [km^2]

real(kind=wp), intent(in) :: m

spacecraft mass [kg]

real(kind=wp), intent(in) :: rho

atmospheric density [kg/km^3]

real(kind=wp), intent(out), dimension(3) :: acc

drag acceleration vector [km/s^2]


Source Code

    pure subroutine drag_acceleration(vrel,cd,area,m,rho,acc)

    implicit none

    real(wp),dimension(3),intent(in)  :: vrel   !! velocity relative to the atmosphere [km/s]
    real(wp),intent(in)               :: cd     !! spacecraft drag coefficient [--]
    real(wp),intent(in)               :: area   !! cross-section area [km^2]
    real(wp),intent(in)               :: m      !! spacecraft mass [kg]
    real(wp),intent(in)               :: rho    !! atmospheric density [kg/km^3]
    real(wp),dimension(3),intent(out) :: acc    !! drag acceleration vector [km/s^2]

    real(wp) :: vrel_mag  !! magnitude of the relative velocity [km/s]

    vrel_mag = norm2(vrel)

    acc = - (0.5_wp * rho * cd * area * vrel_mag / m) * vrel

    end subroutine drag_acceleration