!************************************************************
!CÁLCULO DO COEFICIENTE DE ARRASTO DE BASE
!************************************************************

!CÁLCULO DO COEFICIENTE DE BASE DO CORPO
 
SUBROUTINE Cdbasec (Sref, Pi, Dc, Cdbc, St, M, motorligado, Cbc, Cda, Cf)

INTEGER motorligado
!REAL*8 Cbc, Cf, Swet, Sref, Cdbc, Pi, Dc, St, 
REAL*8 M , Pi, Dc, Sref, St, Cbc, Cdbc, Cda, Cf

!Cbc = 0.029d0/(dsqrt(Cf*(Swet/Sref)))           !Coeficiente de base do corpo para escoamento subsônico
Cbc = 0.12d0+0.13d0*M**2d0
!Cbc = 0.029d0/(dsqrt(Cf))

IF (motorligado == 0) THEN

	Cdbc = Cbc*(Pi*Dc**2d0/(4d0*Sref))                !Coeficinete de arrasto de base do corpo para motor desligado 
    
	ELSE

	Cdbc = Cbc*(Pi*Dc**2d0/(4d0*Sref))*(1d0-St/Sref)  !Coeficinete de arrasto de base do corpo para motor ligado

END IF

END SUBROUTINE Cdbasec 


!CÁLCULO DO COEFICIENTE DE BASE DAS EMPENAS (Desconsiderado)

SUBROUTINE Cdbasee (N, e, S, Sref, Cfe, Cdbe)


REAL*8 N, e, S, Sref, Cfe, Cdbe 

Cdbe = 0.135d0*N*e*S/(Sref*(Cfe)**(1d0/3d0))  !Coeficiente de arrasto de base das empenas 

!write(*,*) Cfe, Sref

END SUBROUTINE Cdbasee 