cape.convert: Unit and angle conversion utilities¶
Perform conversions such as (alpha total, phi) to (alpha, beta). It also contains various utilities such as calculating Sutherland’s law for estimating viscosity with the standard parameters, which are commonly needed tools for CFD solvers.
- cape.convert.AlphaBeta2AlphaMPhi(alpha, beta)¶
Convert angle of attack and sideslip to maneuver axis
- Call:
>>> alpha_m, phi_m = cape.AlphaBeta2AlphaMPhi(alpha, beta)
- Inputs:
- Outputs:
- Versions:
2017-06-26
@ddalle: Version 1.0
- cape.convert.AlphaBeta2AlphaTPhi(alpha, beta)¶
Convert angle of attack and sideslip to missile axis angles
- Call:
>>> alpha_t, phi = cape.AlphaBeta2AlphaTPhi(alpha, beta)
- Inputs:
- Outputs:
- Versions:
2014-06-02
@ddalle: Version 1.02014-11-05
@ddalle: Version 1.1, transpose w formula
- cape.convert.AlphaBeta2DirectionCosines(alpha, beta)¶
Convert angle of attack and sideslip to direction cosines
- Call:
>>> u, v, w = cape.AlphaBeta2DirectionCosines(alpha, beta)
- Inputs:
- Outputs:
- Versions:
2019-06-19
@ddalle: Version 1.0
- cape.convert.AlphaMPhi2AlphaTPhi(alpha_m, phi_m)¶
Convert maneuver axis to missile axis angles
- Call:
>>> alpha_t, phi = cape.AlphaTPhi2AlphaMPhi(alpha_m, phi_m)
- Inputs:
- Outputs:
- Versions:
2017-06-27
@ddalle: Version 1.0
- cape.convert.AlphaTPhi2AlphaBeta(alpha_t, phi)¶
Convert total angle of attack and roll to alpha, beta
- cape.convert.AlphaTPhi2AlphaMPhi(alpha_t, phi)¶
Convert missile-axis to maneuver-axis angles
- Call:
>>> alpha_m, phi_m = cape.AlphaTPhi2AlphaMPhi(alpha_t, phi)
- Inputs:
- Outputs:
- Versions:
2017-06-27
@ddalle: Version 1.0
- cape.convert.AlphaTPhi2DirectionCosines(aoap, phip)¶
Convert total angle of attack and roll to direction cosines
- Call:
>>> u, v, w = cape.AlphaTPhi2DirectionCosines(aoap, phip)
- Inputs:
- Outputs:
- Versions:
2019-06-19
@ddalle: Version 1.0
- cape.convert.CriticalAreaRatio(M, gamma=1.4)¶
Get the area ratio to a Mach 1 area
- cape.convert.DirectionCosines2AlphaBeta(u, v, w)¶
Convert direction cosines to angle of attack and sideslip
- Call:
>>> alpha, beta = cape.DirectionCosines2AlphaBeta(u, v, w)
- Inputs:
- Outputs:
- Versions:
2019-06-19
@ddalle: Version 1.0
- cape.convert.DirectionCosines2AlphaTPhi(u, v, w)¶
Convert direction cosines to total angle of attack and roll
- Call:
>>> aoap, phip = cape.DirectionCosines2AlphaBeta(u, v, w)
- Inputs:
- Outputs:
- Versions:
2019-06-19
@ddalle: Version 1.0
- cape.convert.ExitMachFromAreaRatio(AR, M1, gamma=1.4, subsonic=False)¶
Calculate 1D nozzle Mach number from input Mach and area ratio
- Call:
>>> M2 = ExitMachFromAreaRatio(AR,M1, gamma=1.4, subsonic=False)
- Inputs:
- Outputs:
- M2:
float Exit Mach number
- M2:
- Versions:
2016-04-13
@ddalle: Version 1.0
- cape.convert.PressureFPSFromRe(Re, T, M, R=None, gam=None, mu0=None, T0=None, C=None)¶
Calculate pressure from Reynolds number
- Call:
>>> p = PressureFPSFromRe(Re, T, M) >>> p = PressureFPSFromRe(Re, T, M, R=None, gam=None, **kw)
- Inputs:
- Outputs:
- p:
float Static pressure [psf]
- p:
- See also:
- Versions:
2016-03-24
@ddalle: Version 1.0
- cape.convert.PressureMKSFromRe(Re, T, M, R=None, gam=None, mu0=None, T0=None, C=None)¶
Calculate pressure from Reynolds number
- Call:
>>> p = PressureMKSFromRe(Re, T, M) >>> p = PressureMKSFromRe(Re, T, M, R=None, gam=None, **kw)
- Inputs:
- Outputs:
- p:
float Static pressure [Pa]
- p:
- See also:
- Versions:
2016-03-24
@ddalle: Version 1.0
- cape.convert.ReynoldsPerFoot(p, T, M, R=None, gam=None, mu0=None, T0=None, C=None)¶
Calculate Reynolds number per foot using Sutherland’s Law
- Call:
>>> Re = ReynoldsPerFoot(p, T, M) >>> Re = ReynoldsPerFoot(p, T, M, **kw)
- Inputs:
- Outputs:
- Re:
float Reynolds number per foot
- Re:
- See also:
- Versions:
2016-03-23
@ddalle: Version 1.0
- cape.convert.ReynoldsPerMeter(p, T, M, R=None, gam=None, mu0=None, T0=None, C=None)¶
Calculate Reynolds number per meter using Sutherland’s Law
- Call:
>>> Re = ReynoldsPerMeter(p, T, M) >>> Re = ReynoldsPerMeter(p, T, M, **kw)
- Inputs:
- Outputs:
- Re:
float Reynolds number per foot
- Re:
- See also:
- Versions:
2016-03-24
@ddalle: Version 1.0
- cape.convert.SutherlandFPS(T, mu0=None, T0=None, C=None)¶
Calculate viscosity using Sutherland’s law using imperial units
This returns
\[\mu = \mu_0 \frac{T_0+C}{T+C} \left(\frac{T}{T_0}\right)^{3/2}\]- Call:
>>> mu = SutherlandFPS(T) >>> mu = SutherlandFPS(T, mu0=None, T0=None, C=None)
- Inputs:
- Outputs:
- mu:
float Dynamic viscosity [slug/ft*s]
- mu:
- Versions:
2016-03-23
@ddalle: Version 1.0
- cape.convert.SutherlandMKS(T, mu0=None, T0=None, C=None)¶
Calculate viscosity using Sutherland’s law using SI units
This returns
\[\begin{split}\mu = \mu_0 \\frac{T_0+C}{T+C} \left(\frac{T}{T_0}\right)^{3/2}\end{split}\]- Call:
>>> mu = SutherlandMKS(T) >>> mu = SutherlandMKS(T, mu0=None, T0=None, C=None)
- Inputs:
- Outputs:
- mu:
float Dynamic viscosity [kg/m*s]
- mu:
- Versions:
2016-03-23
@ddalle: Version 1.0
- cape.convert.fstep(x)¶
Return -1 for negative numbers and +1 for nonnegative numbers
- Call:
>>> y = fstep(x)
- Inputs:
- x:
float|np.ndarray Input or array of inputs
- x:
- Outputs:
- y:
-1.0|1.0|np.ndarray Output step function or array of outputs
- y:
- Versions:
2017-06-27
@ddalle: Version 1.0
- cape.convert.fstep1(x)¶
Return -1 for nonpositive numbers and +1 for positive inputs
- Call:
>>> y = fstep1(x)
- Inputs:
- x:
float|np.ndarray Input or array of inputs
- x:
- Outputs:
- y:
-1.0|1.0|np.ndarray Output step function or array of outputs
- y:
- Versions:
2017-06-27
@ddalle: Version 1.0