Esempio n. 1
0
    def configure(self):

        # Create Optimizer instance
        self.add('driver', CONMINdriver())

        # Create LCOE instances
        self.add('lcoe', lcoe_csm_assembly())

        # Driver process definition
        self.driver.workflow.add('lcoe')

        self.driver.iprint = 0
        self.driver.iprint = 1
        self.driver.itmax = 30  # default is 10
        self.driver.dabfun = 0.00001 # default is.001
        self.driver.delfun = 0.001  # default is 0.1
        #self.driver.fdch = .0001
        #self.driver.fdchm = .0001   
             
        # Objective
        self.driver.add_objective('lcoe.lcoe')

        # Design Variables
        self.driver.add_parameter('lcoe.rotorDiameter', low=110., high=145.)
        if rpopt:
            self.driver.add_parameter('lcoe.ratedPower',    low=4500.,  high=5500.)
        else:
            self.driver.add_parameter('lcoe.maxTipSpeed',   low=75.,  high=100.)
        self.driver.case_outputs = ['lcoe.lcoe'] #,'lcoe.ratedPower','lcoe.maxTipSpeed'] 
          # lcoe.lcoe will be named 'Objective' in case recorder
        
        
        #Simple recorder which stores the cases in memory.
        self.driver.recorders = [ListCaseRecorder(),]
Esempio n. 2
0
    def configure(self):

        # Create Optimizer instance
        self.add('driver',DOEdriver())
        
        self.nfact = 10
        self.rdMin = 110.0
        self.rdMax = 145.0
        self.tsMin =  75.0
        self.tsMax = 100.0
        self.rpMin = 4500.0
        self.rpMax = 5400.0
        
        #There are a number of different kinds of DOE available in openmdao.lib.doegenerators
        self.driver.DOEgenerator = FullFactorial(self.nfact) # Full Factorial DOE with X levels for each variable
        #self.driver.DOEgenerator = Uniform(50) # random uniform sample of points - can't plot results with wireframe

        # Create LCOE instances
        self.add('lcoe', lcoe_csm_assembly())

        # Driver process definition
        self.driver.workflow.add('lcoe')

        self.driver.iprint = 0
        #self.driver.iprint = 1

        # Design Variables
        self.driver.add_parameter('lcoe.rotorDiameter', low=self.rdMin, high=self.rdMax)
        if rpopt:
            self.driver.add_parameter('lcoe.ratedPower',   low=self.rpMin, high=self.rpMax)
        else:
            self.driver.add_parameter('lcoe.maxTipSpeed',  low=self.tsMin, high=self.tsMax)
        
        self.driver.case_outputs = ['lcoe.lcoe', 'lcoe.turbineCost', 'lcoe.BOScost', 
                                    'lcoe.OnMcost', 'lcoe.aep', 'lcoe.ratedPower',
                                    'lcoe.maxTipSpeed']
        
        #Simple recorder which stores the cases in memory.
        self.driver.recorders = [ListCaseRecorder(),]
Esempio n. 3
0
def main():
    
    global doplot
    
    lcoe = lcoe_csm_assembly()
    
    lcoe.advancedBlade = True
    
    lcoe.execute()
    
    #lcoe.printResults()
    lcoe.printShortHeader()
    lcoe.printShortResults()
    
    lcoe.advancedBlade = False
    
    lcoe.execute()
    
    #lcoe.printResults()
    lcoe.printShortResults()
    
    #--------------  Sensitivity analysis  --------------
    
    import numpy as np
    
    # keep default values so we can reset
    
    hhDefault = lcoe.hubHeight
    tsDefault = lcoe.maxTipSpeed
    rdDefault = lcoe.rotorDiameter
    rpDefault = lcoe.ratedPower
    lcoe_start = lcoe.lcoe
    
    # sweep over hubht (hubHeight = 90.0)
    
    x = []
    y = []
    for hubht in np.arange(70.0,121.0,10.0):
        lcoe.hubHeight = hubht
        lcoe.execute()
        print '{:4.0f}m '.format(hubht),
        lcoe.printShortResults()
        x.append(hubht)
        y.append(lcoe.lcoe)
    lcoe.hubHeight = hhDefault
    lcoePlot(x,y,'HubHeight (m)', 221, lcoe_start)
    
    # sweep over rotor diameter (rotorDiameter=126.0)
    
    x = []
    y = []
    for rotorDiameter in np.arange(112.0,141.0,2.0):
        lcoe.rotorDiameter = rotorDiameter
        lcoe.execute()
        print '{:4.0f}m '.format(rotorDiameter),
        lcoe.printShortResults()
        x.append(rotorDiameter)
        y.append(lcoe.lcoe)
    lcoe.rotorDiameter = rdDefault
    lcoePlot(x,y,'Rotor Diameter (m)', 222, lcoe_start)
    
    # sweep over tip speed (maxTipSpeed = 80.0)
    
    x = []
    y = []
    for maxTipSpeed in np.arange(70.0,101.0,2.0):
        lcoe.maxTipSpeed = maxTipSpeed
        lcoe.execute()
        print '{:4.0f}mps '.format(maxTipSpeed),
        lcoe.printShortResults()
        x.append(maxTipSpeed)
        y.append(lcoe.lcoe)
    lcoe.maxTipSpeed = tsDefault
    lcoePlot(x,y,'Max Tip Speed (m/s)', 223, lcoe_start)
    
    # sweep over rated power (ratedPower = 5000.0)
    
    x = []
    y = []
    for ratedPower in np.arange(4500.0,5501.0,100.0):
        lcoe.ratedPower = ratedPower
        lcoe.execute()
        print '{:4.0f}kW '.format(ratedPower),
        lcoe.printShortResults()
        x.append(ratedPower)
        y.append(lcoe.lcoe)
    lcoe.ratedPower = rpDefault
    lcoePlot(x,y,'Rated Power (kW)', 224, lcoe_start)
    
    if doplot:
        plt.tight_layout()
        plt.savefig('csmdemo.png')
        plt.show()