66"""
77
88from dataclasses import dataclass
9+ from typing import Any
910from typing import Tuple
1011
1112import numpy as np
@@ -72,7 +73,7 @@ def c_r(self) -> float:
7273 return 1.0 if self .milled else 0.75
7374
7475 @property
75- def q (self ):
76+ def q (self ) -> float :
7677 """Evaluate the cover shear flow.
7778
7879 Assuming the section masses are concentrated at the longerons
@@ -87,7 +88,7 @@ def zee(self) -> float:
8788 b = min (self .D , self .L )
8889 frac = b ** 2 / (self .RC * self .t_c )
8990 # Note, ADA002867 uses lowercase greek mu, but confirms that it is Poisson's Ratio.
90- root = np .sqrt (1 - self .material .nu ** 2 )
91+ root = float ( np .sqrt (1 - self .material .nu ** 2 ) )
9192 return frac * root
9293
9394 @property
@@ -104,9 +105,11 @@ def k_s(self) -> float:
104105 elif z < 2 :
105106 return 7.5
106107 elif 2 < z < 10 :
107- return 7.5 * (z / 2 ) ** 0.113
108+ return float ( 7.5 * (z / 2 ) ** 0.113 )
108109 elif 10 < z :
109- return 9 * (z / 10 ) ** 0.522
110+ return float (9 * (z / 10 ) ** 0.522 )
111+ else :
112+ raise NotImplementedError ("I don't know how you got here..." )
110113
111114 def field_thickness_block_shear (self ) -> float :
112115 """Field thickness based on shear strength.
@@ -116,9 +119,9 @@ def field_thickness_block_shear(self) -> float:
116119 if self .milled :
117120 t_c = self .q / self .material .F_su
118121 else :
119- t_c = self .q / (self .C_r * self .material .F_su )
122+ t_c = self .q / (self .c_r * self .material .F_su )
120123
121- return t_c
124+ return float ( t_c )
122125
123126 def field_thickness_postbuckled (self , alpha : float = 45 ) -> float :
124127 """Field thickness based on critical shear flow.
@@ -165,7 +168,7 @@ def field_thickness_postbuckled(self, alpha: float = 45) -> float:
165168 1 / 3
166169 )
167170
168- return t_c
171+ return float ( t_c )
169172
170173 def land_thickness_net_section (self ) -> float :
171174 """Land thickness based on net section allowable.
@@ -174,11 +177,11 @@ def land_thickness_net_section(self) -> float:
174177 On unmilled panels, the land thickness is simply equivalent to the field thickness.
175178 """
176179 if not self .milled :
177- return self .t_c
180+ return float ( self .t_c )
178181 else :
179- return self .q / (self .c_r * self .material .F_su )
182+ return float ( self .q / (self .c_r * self .material .F_su ) )
180183
181- def thickness_pressure (self , F_allow = None ) -> Tuple [float , float ]:
184+ def thickness_pressure (self , F_allow : Any = None ) -> Tuple [float , float ]:
182185 """Thicknesses based on cover pressure.
183186
184187 A required thickness is evaluated to resist hoop stress,
@@ -237,9 +240,9 @@ def thickness_pressure(self, F_allow=None) -> Tuple[float, float]:
237240 t_min = min (t_1 , t_2 , t_3 , t_4 )
238241
239242 if self .milled :
240- return (t_3 , t_min )
243+ return (float ( t_3 ), float ( t_min ) )
241244 else :
242- return (t_min , t_min )
245+ return (float ( t_min ), float ( t_min ) )
243246
244247 def panel_flutter (self , mach : float , altitude : float ) -> float :
245248 """Evaluate baseline thickness to avoid local panel flutter.
@@ -295,7 +298,7 @@ def panel_flutter(self, mach: float, altitude: float) -> float:
295298
296299 t_b = (phi_b * self .L ) / (FM * self .material .E / q ) ** (1 / 3 )
297300
298- return t_b
301+ return float ( t_b )
299302
300303 def acoustic_fatigue (self ) -> Tuple [float , float ]:
301304 """Thickness requirements based on acoustic fatigue.
@@ -339,4 +342,4 @@ def acoustic_fatigue(self) -> Tuple[float, float]:
339342 f_l = 1.0794 + 0.000143 * x_l - 0.076475 * (1 / x_l ) - 0.29969 * np .log (x_l )
340343 f_c = 1.0794 + 0.000143 * x_c - 0.076475 * (1 / x_c ) - 0.29969 * np .log (x_c )
341344
342- return (f_l * t_l , f_c * t_c )
345+ return (float ( f_l * t_l ), float ( f_c * t_c ) )
0 commit comments