def __init__(self, database=None, relative_thickness=0.15, interpolator='2DSpline',Sref=1., Lref=1.): ''' Constructor for a polar of a simple airfoil. @param Sref : reference surface @param Lref : reference length @param database : the dataBase in which the discrete values are stored, or None ''' Airfoil.__init__(self,Sref,Lref,relative_thickness) # self.__database=database # self.__fd_database=Database() if interpolator == '2DSpline': print "building new spline 2D Interpolator" x,y=self.__database.get_all_in_outs(self.DATABASE_ABSCISSA_TAG,self.DATABASE_AERO_COEFS_TAG) y=array(y).T x=array(x) scale=array([1.,1.]) self.__cl_interpolator=Spline2D_interpolator(array(x),array(y[0,:]),scale) self.__cd_interpolator=Spline2D_interpolator(array(x),array(y[1,:]),scale) self.__cm_interpolator=Spline2D_interpolator(array(x),array(y[2,:]),scale) print "Done." else: self.__cl_interpolator=aero_coefs_interpolator[0] self.__cd_interpolator=aero_coefs_interpolator[1] self.__cm_interpolator=aero_coefs_interpolator[2]
def __init__(self, OC, AoA0=0., Sref=1., Lref=1., rel_thick=0.0, sweep=0.0, pcop=0.25, Ka=0.95, grad_active=True): ''' Constructor for airfoils @param AoA0:angle of attack of null lift @param Cd0 : drag @param Cm0 : pitch moment @param relative_thickness : relative thickness for addition of a correction of ClAlpha @param Sref : reference surface @param Lref : reference length ''' if rel_thick<0. or rel_thick>0.30: raise Exception, "Relative thickness must be >0. and <0.30" Airfoil.__init__(self, OC, Lref=Lref, Sref=Sref, grad_active=grad_active) self.__AoA0_deg = None self.__AoA0 = None self.set_AoA0(AoA0) self.__Ka = None self.set_Ka(Ka) self.__rel_thick = None self.__rel_thick_grad = None self.set_rel_thick(rel_thick) self.__sweep = None self.__sweep_grad = None self.set_sweep(sweep) self.pcop = pcop
def __init__(self, OC, surrogate_model, relative_thickness=.12, camber=0., Sref=1., Lref=1., sweep=0., surrogate_fcs=None): Airfoil.__init__(self, OC, Sref, Lref, relative_thickness, sweep, camber) if not surrogate_fcs: self.__coefs = SurrogateCoefs(surrogate_model) else: self.__coefs = surrogate_fcs self.__surrogate_model = surrogate_model
def __init__(self, controls=None, proxy=None, pos = Vector3(0,0,0), attitude = Quaternion(0.5, -0.5, 0.5, 0.5), velocity = Vector3(0,0,0), thrust = 0, ident=None): global cterrain Airfoil.__init__(self, pos, attitude, velocity, thrust, cterrain) ControlledSer.__init__(self, MyAirfoil.TYP, ident, proxy) self.setControls(controls)
def __init__(self, controls=None, proxy=None, pos=Vector3(0, 0, 0), attitude=Quaternion(0.5, -0.5, 0.5, 0.5), velocity=Vector3(0, 0, 0), thrust=0, ident=None): global cterrain Airfoil.__init__(self, pos, attitude, velocity, thrust, cterrain) ControlledSer.__init__(self, MyAirfoil.TYP, ident, proxy) self.setControls(controls)
def __init__(self, OC, AoA0=0., Cm0=0.0, Sref=1., Lref=1., rel_thick=0.0, sweep=0.0, Ka=0.95): ''' Constructor for airfoils @param AoA0:angle of attack of null lift @param Cd0 : drag @param Cm0 : pitch moment @param relative_thickness : relative thickness for addition of a correction of ClAlpha @param Sref : reference surface @param Lref : reference length ''' if rel_thick<0. or rel_thick>0.25: raise Exception, "Relative thickness must be >0. and <0.25" Airfoil.__init__(self,OC, Sref,Lref,rel_thick,sweep) self.__AoA0 = AoA0*np.pi/180. self.__Cm0 = Cm0 self.__Ka = Ka
def __init__(self, OC, surrogate_model, relative_thickness=.12, camber=0., Sref=1., Lref=1., sweep=0., surrogate_fcs=None): Airfoil.__init__(self, OC, Sref, Lref, relative_thickness, sweep, camber) if not surrogate_fcs: self.__coefs = SurrogateCoefs(surrogate_model) else: self.__coefs = surrogate_fcs self.__surrogate_model = surrogate_model
def __init__(self, OC, Sref=1., Lref=1., y_pos=None, grad_active=False): ''' Constructor for airfoils @param y_pos : span-wise position for interpolation @param Sref : reference surface @param Lref : reference length ''' Airfoil.__init__(self, OC, Lref=Lref, Sref=Sref, grad_active=grad_active) self.y_pos = y_pos self.__y_def_list = None self.__file_def_list = None self.__interp_list = None self.__index_p = None self.__index_m = None self.__fact_p = None self.__fact_m = None