@@ -84,15 +84,18 @@ def __init__(self, filename=None, alpha=None, cl=None, cd=None, cm=None, Re=None
84
84
cd = df ['Cd' ].values
85
85
cm = df ['Cm' ].values
86
86
if 'fs' in df .keys ():
87
- print ('[INFO] Using separating function from input file.' )
87
+ if verbose :
88
+ print ('[INFO] Using separating function from input file.' )
88
89
self .fs = df ['fs' ].values
89
90
self ._fs_lock = True
90
91
if 'Cl_fs' in df .keys ():
91
- print ('[INFO] Using Cl fully separated from input file.' )
92
+ if verbose :
93
+ print ('[INFO] Using Cl fully separated from input file.' )
92
94
self .cl_fs = df ['Cl_fs' ].values
93
95
self ._cl_fs_lock = True
94
96
if 'Cl_inv' in df .keys ():
95
- print ('[INFO] Using Cl inviscid from input file.' )
97
+ if verbose :
98
+ print ('[INFO] Using Cl inviscid from input file.' )
96
99
self .cl_inv = df ['Cl_inv' ].values
97
100
self ._cl_inv_lock = True
98
101
# TODO we need a trigger if cl_inv provided, we should get alpha0 and slope from it
@@ -667,7 +670,7 @@ def __getCM(self, i, cmCoef, alpha, cl_ext, cd_ext, alpha_low_deg, alpha_high_de
667
670
print ("Angle encountered for which there is no CM table value " "(near +/-180 deg). Program will stop." )
668
671
return cm_new
669
672
670
- def unsteadyParams (self , window_offset = None , nMin = 720 ):
673
+ def unsteadyParams (self , window_offset = None , nMin = 720 , verbose = False ):
671
674
"""compute unsteady aero parameters used in AeroDyn input file
672
675
673
676
TODO Questions to solve:
@@ -737,7 +740,8 @@ def unsteadyParams(self, window_offset=None, nMin=720):
737
740
try :
738
741
alpha0cn = _find_alpha0 (alpha , cn , window , direction = 'up' , value_if_constant = 0. )
739
742
except NoCrossingException :
740
- print ("[WARN] Polar: Cn unsteady, cannot find zero crossing with up direction, trying down direction" )
743
+ if verbose :
744
+ print ("[WARN] Polar: Cn unsteady, cannot find zero crossing with up direction, trying down direction" )
741
745
alpha0cn = _find_alpha0 (alpha , cn , window , direction = 'down' )
742
746
743
747
# checks for inppropriate data (like cylinders)
@@ -751,7 +755,8 @@ def unsteadyParams(self, window_offset=None, nMin=720):
751
755
try :
752
756
a_MaxUpp , cn_MaxUpp , a_MaxLow , cn_MaxLow = _find_max_points (alpha , cn , alpha0 , method = "inflections" )
753
757
except NoStallDetectedException :
754
- print ('[WARN] Polar: Cn unsteady, cannot find stall based on inflections, using min and max' )
758
+ if verbose :
759
+ print ('[WARN] Polar: Cn unsteady, cannot find stall based on inflections, using min and max' )
755
760
a_MaxUpp , cn_MaxUpp , a_MaxLow , cn_MaxLow = _find_max_points (alpha , cn , alpha0 , method = "minmax" )
756
761
757
762
# --- cn slope
@@ -790,7 +795,8 @@ def unsteadyParams(self, window_offset=None, nMin=720):
790
795
a_f07_Upp = xInter [2 ]
791
796
a_f07_Low = xInter [0 ]
792
797
else :
793
- print ('[WARN] Polar: Cn unsteady, cn_f does not intersect cn 3 times. Intersections:{}.' .format (xInter ))
798
+ if verbose :
799
+ print ('[WARN] Polar: Cn unsteady, cn_f does not intersect cn 3 times. Intersections:{}.' .format (xInter ))
794
800
a_f07_Upp = abs (xInter [0 ])
795
801
a_f07_Low = - abs (xInter [0 ])
796
802
@@ -1745,6 +1751,8 @@ def _find_linear_region(x, y, nMin, x0=None):
1745
1751
iEnd = j + nMin
1746
1752
if x0 is not None :
1747
1753
sl = np .linalg .lstsq (x [iStart :iEnd ], y [iStart :iEnd ], rcond = None )[0 ][0 ]
1754
+ if not np .isscalar (sl ):
1755
+ sl = sl [0 ]
1748
1756
slp [iStart , j ] = sl
1749
1757
off [iStart , j ] = x0
1750
1758
y_lin = x [iStart :iEnd ] * sl
0 commit comments