Example #1
0
    def configure(self):
        super(Assembly, self).configure()

        # Let's analyze the lifetime cost of energy cost scaling model!
        self.add('lcoe_csm', lcoe_csm_assembly())

        # ..using the cutting edge pydakdriver
        dakDriver = pydakdriver()
        dakDriver.UQ(seed=3232)
        driver = self.add('driver',dakDriver)
        driver.workflow.add('lcoe_csm')
        driver.stdout = 'dakota.out'
        driver.stderr = 'dakota.err'

        driver.add_parameter('lcoe_csm.weibull_k',low=2.6*0.5, high=2.6*1.5)
        driver.add_parameter('lcoe_csm.shear_exponent',low=.1*0.5, high=.1*1.5)

        # use same objectives as previous sensitivity analysis
        driver.add_objective('lcoe_csm.coe')
        driver.add_objective('lcoe_csm.lcoe')
        driver.add_objective('lcoe_csm.net_aep')
        driver.add_objective('lcoe_csm.bos_costs')
        driver.add_objective('lcoe_csm.avg_annual_opex')
        driver.add_objective('lcoe_csm.turbine_cost')
        driver.add_objective('lcoe_csm.turbine_mass')
        driver.add_objective('lcoe_csm.rated_rotor_speed')
#A simple test of WISDEM using the NREL CSM
# collected some code and added input output descriptions and layout output result to show to internal discuss
 

from wisdem.lcoe.lcoe_csm_assembly import lcoe_csm_assembly

lcoe = lcoe_csm_assembly()

# NREL 5 MW turbine specifications and plant attributes
lcoe.machine_rating = 5000.0 # Float(units = 'kW', iotype='in', desc= 'rated machine power in kW')
lcoe.rotor_diameter = 126.0 # Float(units = 'm', iotype='in', desc= 'rotor diameter of the machine')
lcoe.max_tip_speed = 80.0 # Float(units = 'm/s', iotype='in', desc= 'maximum allowable tip speed for the rotor')
lcoe.hub_height = 90.0 # Float(units = 'm', iotype='in', desc='hub height of wind turbine above ground / sea level')
lcoe.sea_depth = 20.0 # Float(units = 'm', iotype='in', desc = 'sea depth for offshore wind project')

# Parameters
lcoe.drivetrain_design = 'pm_direct_drive' # Enum('geared', ('geared', 'single_stage', 'multi_drive', 'pm_direct_drive'), iotype='in')
lcoe.altitude = 0.0 # Float(0.0, units = 'm', iotype='in', desc= 'altitude of wind plant')
lcoe.turbine_number = 100 # Int(100, iotype='in', desc = 'total number of wind turbines at the plant')
lcoe.year = 2009 # Int(2009, iotype='in', desc = 'year of project start')
lcoe.month = 12 # Int(12, iotype='in', desc = 'month of project start')

# Extra AEP inputs
lcoe.max_power_coefficient = 0.488 #Float(0.488, iotype='in', desc= 'maximum power coefficient of rotor for operation in region 2')
lcoe.opt_tsr = 7.525 #Float(7.525, iotype='in', desc= 'optimum tip speed ratio for operation in region 2')
lcoe.cut_in_wind_speed = 3.0 #Float(3.0, units = 'm/s', iotype='in', desc= 'cut in wind speed for the wind turbine')
lcoe.cut_out_wind_speed = 25.0 #Float(25.0, units = 'm/s', iotype='in', desc= 'cut out wind speed for the wind turbine')
lcoe.hub_height = 90.0 #Float(90.0, units = 'm', iotype='in', desc= 'hub height of wind turbine above ground / sea level')
lcoe.altitude = 0.0 #Float(0.0, units = 'm', iotype='in', desc= 'altitude of wind plant')
#lcoe.air_density = Float(0.0, units = 'kg / (m * m * m)', iotype='in', desc= 'air density at wind plant site')  # default air density value is 0.0 - forces aero csm to calculate air density in model
lcoe.drivetrain_design = 'geared' #Enum('geared', ('geared', 'single_stage', 'multi_drive', 'pm_direct_drive'), iotype='in')
Example #3
0
# A simple test of WISDEM using the NREL CSM
from wisdem.lcoe.lcoe_csm_assembly import lcoe_csm_assembly

lcoe = lcoe_csm_assembly()

# NREL 5 MW turbine specifications and plant attributes
lcoe.machine_rating = 5000.0 # Float(units = 'kW', iotype='in', desc= 'rated machine power in kW')
lcoe.rotor_diameter = 126.0 # Float(units = 'm', iotype='in', desc= 'rotor diameter of the machine')
lcoe.max_tip_speed = 80.0 # Float(units = 'm/s', iotype='in', desc= 'maximum allowable tip speed for the rotor')
lcoe.hub_height = 90.0 # Float(units = 'm', iotype='in', desc='hub height of wind turbine above ground / sea level')
lcoe.sea_depth = 20.0 # Float(units = 'm', iotype='in', desc = 'sea depth for offshore wind project')

# Parameters
lcoe.drivetrain_design = 'geared' # Enum('geared', ('geared', 'single_stage', 'multi_drive', 'pm_direct_drive'), iotype='in')
lcoe.altitude = 0.0 # Float(0.0, units = 'm', iotype='in', desc= 'altitude of wind plant')
lcoe.turbine_number = 100 # Int(100, iotype='in', desc = 'total number of wind turbines at the plant')
lcoe.year = 2009 # Int(2009, iotype='in', desc = 'year of project start')
lcoe.month = 12 # Int(12, iotype='in', desc = 'month of project start')

# Extra AEP inputs
lcoe.max_power_coefficient = 0.488 #Float(0.488, iotype='in', desc= 'maximum power coefficient of rotor for operation in region 2')
lcoe.opt_tsr = 7.525 #Float(7.525, iotype='in', desc= 'optimum tip speed ratio for operation in region 2')
lcoe.cut_in_wind_speed = 3.0 #Float(3.0, units = 'm/s', iotype='in', desc= 'cut in wind speed for the wind turbine')
lcoe.cut_out_wind_speed = 25.0 #Float(25.0, units = 'm/s', iotype='in', desc= 'cut out wind speed for the wind turbine')
lcoe.hub_height = 90.0 #Float(90.0, units = 'm', iotype='in', desc= 'hub height of wind turbine above ground / sea level')
lcoe.altitude = 0.0 #Float(0.0, units = 'm', iotype='in', desc= 'altitude of wind plant')
#lcoe.air_density = Float(0.0, units = 'kg / (m * m * m)', iotype='in', desc= 'air density at wind plant site')  # default air density value is 0.0 - forces aero csm to calculate air density in model
lcoe.drivetrain_design = 'geared' #Enum('geared', ('geared', 'single_stage', 'multi_drive', 'pm_direct_drive'), iotype='in')
lcoe.shear_exponent = 0.1 #Float(0.1, iotype='in', desc= 'shear exponent for wind plant') #TODO - could use wind model here
lcoe.wind_speed_50m = 8.02 #Float(8.35, units = 'm/s', iotype='in', desc='mean annual wind speed at 50 m height')
lcoe.weibull_k= 2.15 #Float(2.1, iotype='in', desc = 'weibull shape factor for annual wind speed distribution')
Example #4
0
    def configure():
        """ Configuration page
        """
        global cpnt
        global desc
        global analysis
        import fusedwindGUI
        global wt_inputs
        global sensitivityResults

        abspath = fusedwindGUI.__file__.strip('__init__.pyc')

        class ConfigForm(Form):
            pass

        models = [{'name': 'Model Selection',
                   'choices': ['Tier 1 Full Plant Analysis: WISDEM CSM',
                               'Tier 2 Full Plant Analysis: WISDEM/DTU Plant']},
                  {'name': 'Analysis Type',
                   'choices': ['Individual Analysis',
                               'Sensitivity Analysis']},
                  {'name': 'Turbine Selection',
                   'choices': ['NREL 5MW RWT',
                               'DTU 10MW RWT']}]

        for dic in models:
            name = dic['name']
            choices = [(val, val) for val in dic['choices']]
            setattr(ConfigForm, name, SelectField(name, choices=choices))

        if request.method == 'POST':  # Receiving a POST request
            inputs = request.form.to_dict()
            winenv = ''
            if platform.system() == 'Windows':
                winenv = os.getenv("SystemDrive").replace(":", "")

            if inputs[
                    'Model Selection'] == 'Tier 1 Full Plant Analysis: WISDEM CSM':
                # 2015 09 28: move desc assignment AFTER import etc. so it
                # doesn't get changed if import fails - GNS
                try:
                    from wisdem.lcoe.lcoe_csm_assembly import lcoe_csm_assembly
                    cpnt = set_as_top(lcoe_csm_assembly())
                    cpnt.gui_recorder = {}

                    desc = "The NREL Cost and Scaling Model (CSM) is an empirical model for wind plant cost analysis based on the NREL cost and scaling model."
                    if inputs['Turbine Selection'] == 'NREL 5MW RWT':
                        # TODO: fix abspath
                        filename = winenv + \
                            os.path.join(abspath, 'wt_models', 'nrel5mw_tier1.inp')
                    elif inputs['Turbine Selection'] == 'DTU 10MW RWT':
                        filename = winenv + \
                        os.path.join(abspath, 'wt_models', 'dtu10mw_tier1.inp')

                    f = open(filename, 'r')
                    wt_inputs = to_unicode(yaml.load(f))
                except Exception as e:
                    print 'lcoe_csm_assembly could not be loaded!:', str(e)
                    return render_template(
                        'error.html',
                        errmssg='{:} : lcoe_csm_assembly could not be loaded!'.format(
                            inputs['Model Selection']))
            else:
                try:
                    from wisdem.lcoe.lcoe_se_seam_assembly import create_example_se_assembly
                    lcoe_se = create_example_se_assembly(
                        'I', 0., True, False, False, False, False, '')
                    cpnt = lcoe_se
                    cpnt.gui_recorder = {}

                    desc = "The NREL WISDEM / DTU SEAM integrated model uses components across both model sets to size turbine components and perform cost of energy analysis."
                    if inputs['Turbine Selection'] == 'NREL 5MW RWT':
                        # TODO: fix abspath
                        filename = winenv + \
                            os.path.join(abspath, 'wt_models', 'nrel5mw_tier2.inp')
                    elif inputs['Turbine Selection'] == 'DTU 10MW RWT':
                        filename = os.path.join(
                            abspath, 'wt_models/dtu10mw_tier2.inp')
                    f = open(filename, 'r')
                    wt_inputs = to_unicode(yaml.load(f))
                except:
                    print 'lcoe_se_seam_assembly could not be loaded!'
                    return render_template(
                        'configure.html',
                        messages='{:} : lcoe_se_seam_assembly could not be loaded!'.format(
                            inputs['Model Selection']),
                        config=ConfigForm(MultiDict()),
                                   config_flag=False)

            analysis = inputs['Analysis Type']
            fused_webapp(True)

            return render_template('configure.html',
                                   config=ConfigForm(MultiDict()),
                                   config_flag=True)

        else:
            return render_template('configure.html',
                                   config=ConfigForm(MultiDict()),
                                   config_flag=False)