Пример #1
0
 def __init__(self,airfoil,flightConditions,yplus=1.0,mesh='C'):
     self.af = airfoil
     self.fc = flightConditions
     self.paths = CFD_paths()
     self._caseFilePath = self.paths.file_cas
     if mesh=='C':
         self.mesh = AirfoilCMesh(airfoil,dsWall=self.fc.get_wall_spacing(yplus))
     elif mesh=='O':
         self.mesh = AirfoilOMesh(airfoil,dsWall=self.fc.get_wall_spacing(yplus))
     self.fluent = FluentAirfoil()
     self.fluent._meshtype = mesh
Пример #2
0
class CFDsolver():
    def __init__(self,airfoil,flightConditions,yplus=1.0,mesh='C'):
        self.af = airfoil
        self.fc = flightConditions
        self.paths = CFD_paths()
        self._caseFilePath = self.paths.file_cas
        if mesh=='C':
            self.mesh = AirfoilCMesh(airfoil,dsWall=self.fc.get_wall_spacing(yplus))
        elif mesh=='O':
            self.mesh = AirfoilOMesh(airfoil,dsWall=self.fc.get_wall_spacing(yplus))
        self.fluent = FluentAirfoil()
        self.fluent._meshtype = mesh
    
    def create_mesh(self,reverse=False):
        self.mesh.create(self.paths.file_glf,self._caseFilePath)

    def run_for_multiple_aoa(self,alphaSequence=arange(-5,20,3),
                             turbulenceModel='SA',Cp=False,iterMax=5000,densityBased=False):
        """
        Run fluent at sequence of angle of attacks
        
        Parameters
        ----------
        
        alphaSequence : array, deg
            array of angles of attack
        turbulenceModel : string
            fluent turbulence model. Two options are available: 'SA' and 
            'ke-realizable'
        Cp : bool
            This option is not available yet.
        iterMax : int
            maximum number of iterations
        """
        result = AirfoilPolar1D()
        for i,alpha in enumerate(alphaSequence):
            result1 = self.fluent.run_at_aoa(alpha,self.fc,self._caseFilePath,turbulenceModel,Cp,iterMax,densityBased)
            result.alpha.append(result1.alpha)
            result.cl.append(result1.cl)
            result.cd.append(result1.cd)
            result.cm.append(result1.cm)
            result.LD.append(result1.LD)
        return result
    
    def run_for_single_aoa(self,alpha=0.0,turbulenceModel='SA',Cp=False,iterMax=5000,densityBased=False):
        """
        Run fluent at single angle of attack
        
        Parameters
        ----------
        
        alpha : float, deg
            angle of attack
        turbulenceModel : string
            fluent turbulence model. Two options are available: 'SA' and 
            'ke-realizable'
        Cp : bool
            This option is not available yet.
        iterMax : int
            maximum number of iterations
        """
        result = self.fluent.run_at_aoa(alpha,self.fc,self._caseFilePath,turbulenceModel,Cp,iterMax,densityBased)
        return result