Beispiel #1
0
    def setUp(self):
        """
        This setUp() method executes before each test. It creates an
        instance attribute, self.instance, that refers to a ManagementCost
        instance under test. input_dict is the dictionary of inputs values
        that configures that instance.

        This is just a default dictionary. Methods that test behavior of
        specific variables customize the relevant key/value pairs.

        The key site_facility_building_area_df is set to None here. The
        dataframe is read from the csv in the site_facility tests below.
        """
        # TODO: Refactor the parts of the filenames to the top of the file. Do not hardcode.
        site_facility_building_area_csv = os.path.join(
            landbosse_test_input_dir(), 'site_facility_building_area.csv')
        site_facility_building_area_df = pd.read_csv(
            site_facility_building_area_csv)
        self.input_dict = dict()
        self.input_dict['project_value_usd'] = 1e8
        self.input_dict['foundation_cost_usd'] = 1e5
        self.input_dict['construction_time_months'] = 12
        self.input_dict['num_hwy_permits'] = 10
        self.input_dict['num_turbines'] = 10
        self.input_dict['project_size_megawatts'] = 30
        self.input_dict['hub_height_meters'] = 80
        self.input_dict['num_access_roads'] = 2
        self.input_dict['markup_contingency'] = 0.1
        self.input_dict['markup_warranty_management'] = 0.1
        self.input_dict['markup_sales_and_use_tax'] = 0.1
        self.input_dict['markup_overhead'] = 0.1
        self.input_dict['markup_profit_margin'] = 0.1
        self.input_dict[
            'site_facility_building_area_df'] = site_facility_building_area_df
        self.input_dict['construct_duration'] = 9  #months
        self.project_name = 'project_1'
        self.output_dict = dict()
        self.management_cost = ManagementCost(input_dict=self.input_dict,
                                              output_dict=self.output_dict,
                                              project_name=PROJECT_NAME)
    def setUp(self):
        self.input_dict = dict()
        self.project_name = 'Project_1'
        self.input_dict[
            'road_distributed_wind'] = True  #TODO add this to input file.

        #Inputs for calculate_road_properties():
        # self.input_dict['road_length'] = 108000   #TODO: Also add option to make road_length a user specified input.
        self.input_dict['road_width_ft'] = 10  # feet 10
        self.input_dict['road_thickness'] = 2  # inches
        self.input_dict[
            'crane_width'] = 4.548  # metres 10.7 + shoulder width 1.5 m
        self.input_dict['num_access_roads'] = 5
        self.input_dict['num_turbines'] = 1
        self.input_dict['rsmeans'] = pd.read_csv(
            os.path.join(landbosse_test_input_dir(),
                         'rsmeans_proprietary.csv'))
        crew_data = os.path.join(landbosse_test_input_dir(), 'crews.csv')
        self.input_dict['crew'] = pd.read_csv(crew_data)
        crew_cost_data = os.path.join(landbosse_test_input_dir(),
                                      'crew_price_proprietary.csv')
        self.input_dict['crew_cost'] = pd.read_csv(crew_cost_data)
        self.input_dict['duration_construction'] = 0.1  # months
        self.input_dict['construct_duration'] = 0.1  # months
        self.input_dict['fraction_new_roads'] = 1
        self.input_dict['road_quality'] = 0.6
        self.input_dict['rsmeans_per_diem'] = 144

        self.input_dict['road_length_adder_m'] = 5000  # 5km
        self.input_dict['fraction_new_roads'] = 0.33
        self.input_dict['road_quality'] = 0.3
        self.input_dict['rsmeans_per_diem'] = 0

        # Weather window:
        self.input_dict['num_delays'] = 7
        self.input_dict['avg_hours_per_delay'] = 20
        self.input_dict['std_dev_hours_per_delay'] = 5
        self.input_dict['delay_speed_m_per_s'] = 9
        self.input_dict['seed'] = 101
        self.input_dict['weather_window'] = generate_a_year(
            num_delays=self.input_dict['num_delays'],
            avg_hours_per_delay=self.input_dict['avg_hours_per_delay'],
            std_dev_hours_per_delay=self.input_dict['std_dev_hours_per_delay'],
            delay_speed_m_per_s=self.input_dict['delay_speed_m_per_s'],
            seed=self.input_dict['seed'])

        self.input_dict['start_delay_hours'] = 100
        self.input_dict['mission_time_hours'] = 50
        self.input_dict['critical_wind_speed_m_per_s'] = 8.0
        self.input_dict['wind_height_of_interest_m'] = 10
        self.input_dict['wind_shear_exponent'] = 0.25
        self.input_dict['season_construct'] = ['spring', 'summer']
        self.input_dict['time_construct'] = 'normal'
        self.input_dict['hour_day'] = {'long': 24, 'normal': 10}
        self.input_dict['operational_hrs_per_day'] = 10
        self.input_dict['critical_speed_non_erection_wind_delays_m_per_s'] = 15
        self.input_dict['critical_height_non_erection_wind_delays_m'] = 10

        #Inputs for calculate_costs():
        material_price_csv = os.path.join(landbosse_test_input_dir(),
                                          'material_price_proprietary.csv')
        self.input_dict['material_price'] = pd.read_csv(material_price_csv)
        self.input_dict['turbine_rating_MW'] = 0.02  # 20 kW Turbine
        self.input_dict[
            'overtime_multiplier'] = 1.4  # multiplier for labor overtime rates due to working 60 hr/wk rather than 40 hr/wk
        self.input_dict['rotor_diameter_m'] = 7
        self.input_dict['turbine_spacing_rotor_diameters'] = 5
        self.input_dict['critical_height_non_erection_wind_delays_m'] = 10
        self.input_dict['site_prep_area_m2'] = 0

        self.output_dict = dict()
    def setUp(self):
        self.input_dict = dict()
        self.output_dict = dict()
        self.cable_input_dict = dict()
        self.addl_specs = dict()

        rsmeans_csv = os.path.join(landbosse_test_input_dir(),
                                   'rsmeans_proprietary.csv')
        self.input_dict['rsmeans'] = pd.read_csv(rsmeans_csv)
        crew_cost_csv = os.path.join(landbosse_test_input_dir(),
                                     'crew_price_proprietary.csv')
        self.input_dict['crew_cost'] = pd.read_csv(crew_cost_csv)
        crews_csv = os.path.join(landbosse_test_input_dir(), 'crews.csv')
        self.input_dict['crew'] = pd.read_csv(crews_csv)
        self.input_dict['construct_duration'] = 9  # months
        self.input_dict['time_construct'] = 'normal'
        self.input_dict['hour_day'] = {'long': 24, 'normal': 10}

        #============================================================
        #All below inputs are inputs for ArraySystem class:
        self.input_dict['cable_specs'] = dict()

        cable_specs_path = os.path.join(landbosse_test_input_dir(),
                                        'cable_specs.csv')

        self.input_dict['cable_specs_pd'] = pd.read_csv(
            cable_specs_path)  #Read in cable specs into a dataframe.
        # self.input_dict['cable_specs'] = self.input_dict['cable_specs_pd'].T.to_dict()

        self.input_dict[
            'user_defined_distance_to_grid_connection'] = 0  # 0 = No ; 1 = Yes
        self.input_dict['distance_to_grid_connection_km'] = 2
        self.project_name = 'project_1'

        #Inputs for ArraySystem:

        self.input_dict['num_turbines'] = 1
        self.input_dict['plant_capacity_MW'] = 15
        self.input_dict['row_spacing_rotor_diameters'] = 5
        self.input_dict['turbine_rating_MW'] = 0.02
        self.input_dict['upstream_turb'] = 0
        self.input_dict['turb_sequence'] = 1
        self.input_dict['depth'] = 45
        self.input_dict['rsmeans_per_diem'] = 144

        self.input_dict['turbine_spacing_rotor_diameters'] = 5
        self.input_dict['rotor_diameter_m'] = 154
        self.input_dict['line_frequency_hz'] = 60
        self.input_dict[
            'overtime_multiplier'] = 1.4  # multiplier for labor overtime rates due to working 60 hr/wk rather than 40 hr/wk

        # Weather window:
        self.input_dict['num_delays'] = 7
        self.input_dict['avg_hours_per_delay'] = 20
        self.input_dict['std_dev_hours_per_delay'] = 5
        self.input_dict['delay_speed_m_per_s'] = 9
        self.input_dict['seed'] = 101
        self.input_dict['weather_window'] = generate_a_year(
            num_delays=self.input_dict['num_delays'],
            avg_hours_per_delay=self.input_dict['avg_hours_per_delay'],
            std_dev_hours_per_delay=self.input_dict['std_dev_hours_per_delay'],
            delay_speed_m_per_s=self.input_dict['delay_speed_m_per_s'],
            seed=self.input_dict['seed'])

        self.input_dict['start_delay_hours'] = 100
        self.input_dict['mission_time_hours'] = 50
        self.input_dict['critical_wind_speed_m_per_s'] = 8.0
        self.input_dict['wind_height_of_interest_m'] = 100
        self.input_dict['wind_shear_exponent'] = 0.25
        self.input_dict['season_construct'] = ['spring', 'summer']
        self.input_dict['time_construct'] = 'normal'
        self.input_dict['operational_hrs_per_day'] = 10
        self.input_dict['duration_construction'] = 9  # months
        self.input_dict['operational_hrs_per_day'] = 10
        self.input_dict['critical_speed_non_erection_wind_delays_m_per_s'] = 15
        self.input_dict['critical_height_non_erection_wind_delays_m'] = 10
        self.input_dict['rsmeans_per_diem'] = 99

        #============================================================

        # Test inputs for Cable class: (Taken from cable specs dict)
        self.cable_input_dict[
            'Current Capacity (A)'] = 610  # Amps (at 1 m burial depth)
        self.cable_input_dict['Rated Voltage (V)'] = 33  # kV, line-to-line
        self.cable_input_dict[
            'AC Resistance (Ohms/km)'] = 0.062  # Ohms/km (at 90 deg C at 60 Hz)
        self.cable_input_dict['Inductance (mH/km)'] = 0.381  # mH/km
        self.cable_input_dict['Capacitance (nF/km)'] = 224  # nF/km
        self.cable_input_dict['Cost (USD/LF)'] = 250000  # $US/km

        # Additional inputs for Array(Cable) class

        self.addl_specs['turbine_rating_MW'] = 7
        self.addl_specs['upstream_turb'] = 0
        self.addl_specs['turb_sequence'] = 0
        self.addl_specs['turbine_spacing_rotor_diameters'] = 5
        self.addl_specs['rotor_diameter_m'] = 154
        self.addl_specs['line_frequency_hz'] = 60
Beispiel #4
0
    def setUp(self):
        print(
            '<><>><><><><><><><><> Begin load of ErectionCost test data <><>><><><><><><><><>'
        )

        self.erection_cost_input_dict = None
        project = pd.Series({
            'Turbine rating MW':
            1.5,
            'Hub height m':
            80,
            'Rotor diameter m':
            77,
            'Number of breakdowns per 100 MW':
            4,
            'Number of sections per tower':
            3,
            'Number of RNA picks (at hub height)':
            4,
            'Number of turbines':
            100,
            'Breakpoint between base and topping (percent)':
            0.75,
            'Fuel cost USD per gal':
            1,
            'Rate of deliveries (turbines per week)':
            10,
            'Wind shear exponent':
            0.2,
            'Tower type':
            'steel',
            'Foundation depth m':
            3,
            'Rated Thrust (N)':
            100,
            'Bearing Pressure (n/m2)':
            100,
            'Critical Velocity (m/s)':
            20,
            'Line Frequency (Hz)':
            60,
            'Project ID':
            'foo',
            'Turbine spacing (times rotor diameter)':
            5,
            'Row spacing (times rotor diameter)':
            5,
            'Number of turbines per day':
            2,
            'Flag for user-defined home run trench length (0 = no; 1 = yes)':
            1,
            'Combined Homerun Trench Length to Substation (km)':
            67,
            'Total project construction time (months)':
            9,
            '50-year Gust Velocity (m/s)':
            60,
            'Road length adder (m)':
            5000,
            'Percent of roads that will be constructed':
            0.33,
            'Road Quality (0-1)':
            0.6,
            'Line Frequency (Hz)':
            60,
            'Row spacing (times rotor diameter)':
            10,
            'Flag for user-defined home run trench length (0 = no; 1 = yes)':
            0,
            'Combined Homerun Trench Length to Substation (km)':
            50,
            'Distance to interconnect (miles)':
            50,
            'Interconnect Voltage (kV)':
            137,
            'New Switchyard (y/n)':
            'y',
            'Non-Erection Wind Delay Critical Speed (m/s)':
            15,
            'Non-Erection Wind Delay Critical Height (m)':
            10,
            'Road width (ft)':
            20,
            'Road thickness (in)':
            8,
            'Crane width (m)':
            12.2,
            'Number of highway permits':
            10,
            'Number of access roads':
            2,
            'Overtime multiplier':
            1.4,
            'Allow same flag':
            'n',
            'Markup contingency':
            0.03,
            'Markup warranty management':
            0.0002,
            'Markup sales and use tax':
            0,
            'Markup overhead':
            0.05,
            'Markup profit margin':
            0.05
        })

        xlsx_reader = XlsxReader()
        input_xlsx = os.path.join(landbosse_test_input_dir(),
                                  'erection_cost_tests.xlsx')
        self.master_input_dict = xlsx_reader.create_master_input_dictionary(
            input_xlsx=input_xlsx, project_parameters=project)

        print(
            '<><>><><><><><><><><> End load of ErectionCost test data <><>><><><><><><><><>'
        )
    def setUp(self):
        """
         This setUp() method executes before each test. It creates an
         instance attribute, self.instance, that refers to a FoundationCost
         instance under test. input_dict is the dictionary of inputs values
         that configures that instance.
         This is just a default dictionary. Methods that test behavior of
         specific variables customize the relevant key/value pairs.
         The key site_facility_building_area_df is set to None here. The
         dataframe is read from the csv in the site_facility tests below.
        """

        self.input_dict = dict()
        self.input_dict['depth'] = 3.05  # in m
        self.project_name = 'project_1'

        self.input_dict['rated_thrust_N'] = 742e3
        self.input_dict['bearing_pressure_n_m2'] = 244200
        self.input_dict['critical_velocity_m_per_s'] = 52.5
        self.input_dict['gust_velocity_m_per_s'] = 60

        #Below are the inputs for calculate_foundation_load():
        component_data = os.path.join(landbosse_test_input_dir(),
                                      'components.csv')
        self.input_dict['component_data'] = pd.read_csv(component_data)
        crew_data = os.path.join(landbosse_test_input_dir(), 'crews.csv')
        self.input_dict['crew'] = pd.read_csv(crew_data)
        crew_cost_data = os.path.join(landbosse_test_input_dir(),
                                      'crew_price_proprietary.csv')
        self.input_dict['crew_cost'] = pd.read_csv(crew_cost_data)
        for component in self.input_dict['component_data'].keys():
            self.input_dict[component] = np.array(
                self.input_dict['component_data'][component])

        # Below are the inputs for determine_foundation_size():
        #'Radius_m' -> Calculated in 'calculate_foundation_load()'
        #'depth'

        #Below are the inputs for 'estimate_material_needs()':
        self.input_dict['num_turbines'] = 100
        #foundation_volume_m3_per_turbine -> calculated in 'determine_foundation_size()':

        #Below are the inputs for 'estimate_construction_time()':
        self.input_dict['duration_construction'] = 9  #months
        self.input_dict['construct_duration'] = 9  #months
        self.input_dict['hour_day'] = {'long': 24, 'normal': 10}

        #Weather window:
        self.input_dict['num_delays'] = 7
        self.input_dict['avg_hours_per_delay'] = 20
        self.input_dict['std_dev_hours_per_delay'] = 5
        self.input_dict['delay_speed_m_per_s'] = 9
        self.input_dict['seed'] = 101
        self.input_dict['weather_window'] = generate_a_year(
            num_delays=self.input_dict['num_delays'],
            avg_hours_per_delay=self.input_dict['avg_hours_per_delay'],
            std_dev_hours_per_delay=self.input_dict['std_dev_hours_per_delay'],
            delay_speed_m_per_s=self.input_dict['delay_speed_m_per_s'],
            seed=self.input_dict['seed'])

        self.input_dict['start_delay_hours'] = 100
        self.input_dict['mission_time_hours'] = 50
        self.input_dict['critical_wind_speed_m_per_s'] = 8.0
        self.input_dict['wind_height_of_interest_m'] = 100
        self.input_dict['wind_shear_exponent'] = 0.25
        self.input_dict['season_construct'] = ['spring', 'summer']
        self.input_dict['time_construct'] = 'normal'
        self.input_dict['operational_hrs_per_day'] = 10
        self.input_dict['critical_speed_non_erection_wind_delays_m_per_s'] = 10
        self.input_dict['critical_height_non_erection_wind_delays_m'] = 10

        #Calculate Costs:
        material_price = os.path.join(landbosse_test_input_dir(),
                                      'material_price_proprietary.csv')
        self.input_dict['material_price'] = pd.read_csv(material_price)

        rsmeans_csv = os.path.join(landbosse_test_input_dir(),
                                   'rsmeans_proprietary.csv')
        self.input_dict['rsmeans'] = pd.read_csv(rsmeans_csv)
        self.input_dict['rsmeans_per_diem'] = 144

        self.input_dict['overtime_multiplier'] = 1.4

        self.output_dict = dict()
        self.foundation_cost = FoundationCost(input_dict=self.input_dict,
                                              output_dict=self.output_dict,
                                              project_name=self.project_name)