Skip to content

Commit

Permalink
updated how the ME costs deal with user-entered inputs, so that model…
Browse files Browse the repository at this point in the history
…ed values are still reported even if user overwrites them
  • Loading branch information
janinefreeman committed Feb 27, 2020
1 parent d94347c commit 0654a46
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions ssc/cmod_mhk_costs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,30 +146,14 @@ class cm_mhk_costs : public compute_module
}
}

//define intermediate variables to store outputs
//define intermediate variables to store calculated outputs
double structural_assembly, power_takeoff, mooring_found_substruc;
double development, eng_and_mgmt, plant_commissioning, site_access_port_staging, assembly_and_install, other_infrastructure;
double array_cable_system, export_cable_system, onshore_substation, offshore_substation, other_elec_infra;
double project_contingency, insurance_during_construction, reserve_accounts;
double operations_cost, maintenance_cost;

// user input CapEx values
int structural_assembly_cost_method = as_integer("structural_assembly_cost_method");
int power_takeoff_system_cost_method = as_integer("power_takeoff_system_cost_method");
int mooring_found_substruc_cost_method = as_integer("mooring_found_substruc_cost_method");

int development_cost_method = as_integer("development_cost_method");
int eng_and_mgmt_cost_method = as_integer("eng_and_mgmt_cost_method");
int assembly_and_install_cost_method = as_integer("assembly_and_install_cost_method");
int other_infrastructure_cost_method = as_integer("other_infrastructure_cost_method");

int array_cable_system_cost_method = as_integer("array_cable_system_cost_method");
int export_cable_system_cost_method = as_integer("export_cable_system_cost_method");
int onshore_substation_cost_method = as_integer("onshore_substation_cost_method");
int offshore_substation_cost_method = as_integer("offshore_substation_cost_method");
int other_elec_infra_cost_method = as_integer("other_elec_infra_cost_method");

//CapEx costs depend on technology
//Most CapEx costs depend on technology
if (technology == TIDAL)
{ // device = RM1
structural_assembly = 284245.0 * system_capacity_MW + 785137.0;
Expand Down Expand Up @@ -222,10 +206,7 @@ class cm_mhk_costs : public compute_module
}
}


// double capex = structural_assembly + power_takeoff + mooring_found_substruc;

// REmaining BOS costs that are not CapEx dependent
// REmaining BOS costs that are not CapEx dependent and not technology dependent
assembly_and_install = 2805302.0 * pow(system_capacity_MW, 0.66);
other_infrastructure = 0;

Expand All @@ -237,6 +218,48 @@ class cm_mhk_costs : public compute_module
offshore_substation = 100000.0 * system_capacity_MW;
other_elec_infra = 47966.16 * system_capacity_MW + 665841.0;

// operations cost
operations_cost = 31250.0 * system_capacity_MW + 879282.0;

// maintenance cost
maintenance_cost = 116803.0 * system_capacity_MW + 317719.0;

//at this point, we need to assign the "independent" modeled outputs-
//i.e., we want the modeled value to be reported prior to overwriting with a user input
//for all variables that are NOT dependent on CapEx
assign("structural_assembly_cost_modeled", var_data(static_cast<ssc_number_t>(structural_assembly)));
assign("power_takeoff_system_cost_modeled", var_data(static_cast<ssc_number_t>(power_takeoff)));
assign("mooring_found_substruc_cost_modeled", var_data(static_cast<ssc_number_t>(mooring_found_substruc)));
assign("development_cost_modeled", var_data(static_cast<ssc_number_t>(development)));
assign("eng_and_mgmt_cost_modeled", var_data(static_cast<ssc_number_t>(eng_and_mgmt)));
assign("assembly_and_install_cost_modeled", var_data(static_cast<ssc_number_t>(assembly_and_install)));
assign("other_infrastructure_cost_modeled", var_data(static_cast<ssc_number_t>(other_infrastructure)));
assign("array_cable_system_cost_modeled", var_data(static_cast<ssc_number_t>(array_cable_system)));
assign("export_cable_system_cost_modeled", var_data(static_cast<ssc_number_t>(export_cable_system)));
assign("onshore_substation_cost_modeled", var_data(static_cast<ssc_number_t>(onshore_substation)));
assign("offshore_substation_cost_modeled", var_data(static_cast<ssc_number_t>(offshore_substation)));
assign("other_elec_infra_cost_modeled", var_data(static_cast<ssc_number_t>(other_elec_infra)));
assign("operations_cost", var_data(static_cast<ssc_number_t>(operations_cost)));
assign("maintenance_cost", var_data(static_cast<ssc_number_t>(maintenance_cost)));

// there are five cost values that are a percentage of total CapEx
// we want those modeled values to reflect user-input values that are overwriting the modeled values
// therefore, here, we replace modeled values calculated above with those input by the user, if that's selected in the UI
int structural_assembly_cost_method = as_integer("structural_assembly_cost_method");
int power_takeoff_system_cost_method = as_integer("power_takeoff_system_cost_method");
int mooring_found_substruc_cost_method = as_integer("mooring_found_substruc_cost_method");

int development_cost_method = as_integer("development_cost_method");
int eng_and_mgmt_cost_method = as_integer("eng_and_mgmt_cost_method");
int assembly_and_install_cost_method = as_integer("assembly_and_install_cost_method");
int other_infrastructure_cost_method = as_integer("other_infrastructure_cost_method");

int array_cable_system_cost_method = as_integer("array_cable_system_cost_method");
int export_cable_system_cost_method = as_integer("export_cable_system_cost_method");
int onshore_substation_cost_method = as_integer("onshore_substation_cost_method");
int offshore_substation_cost_method = as_integer("offshore_substation_cost_method");
int other_elec_infra_cost_method = as_integer("other_elec_infra_cost_method");

// check for user entered values
if (structural_assembly_cost_method == 0)
structural_assembly = as_double("structural_assembly_cost_input") * system_capacity_kW;
Expand Down Expand Up @@ -290,52 +313,29 @@ class cm_mhk_costs : public compute_module
other_elec_infra = as_double("other_elec_infra_cost_input");


// CapEx to include all device costs and BOS costs that are not CapEx dependent
// Now, we calculated the CapEx using whatever combination of modeled values and user-entered values
// that we have at this point.
// CapEx is defined to include all device costs and BOS costs that are not CapEx dependent
double capex = structural_assembly + power_takeoff + mooring_found_substruc
+ development + eng_and_mgmt + assembly_and_install + other_infrastructure
+ array_cable_system + export_cable_system + onshore_substation + offshore_substation + other_elec_infra;


// CapEx dependent BOS costs
// Calculate the CapEx dependent BOS costs
plant_commissioning = 0.016 * capex;
site_access_port_staging = 0.011 * capex;


//financial costs are the same regardless of technology
// Calculate the CapEx-dependent financial costs
project_contingency = 0.05 * capex;
insurance_during_construction = 0.01 * capex;
reserve_accounts = 0.03 * capex;

// operations cost
operations_cost = 31250.0 * system_capacity_MW + 879282.0;

// maintenance cost
maintenance_cost = 116803.0 * system_capacity_MW + 317719.0;

//assign all outputs
assign("structural_assembly_cost_modeled", var_data(static_cast<ssc_number_t>(structural_assembly)));
assign("power_takeoff_system_cost_modeled", var_data(static_cast<ssc_number_t>(power_takeoff)));
assign("mooring_found_substruc_cost_modeled", var_data(static_cast<ssc_number_t>(mooring_found_substruc)));

assign("development_cost_modeled", var_data(static_cast<ssc_number_t>(development)));
assign("eng_and_mgmt_cost_modeled", var_data(static_cast<ssc_number_t>(eng_and_mgmt)));
// Assign the CapEx-dependent outputs
assign("plant_commissioning_cost_modeled", var_data(static_cast<ssc_number_t>(plant_commissioning)));
assign("site_access_port_staging_cost_modeled", var_data(static_cast<ssc_number_t>(site_access_port_staging)));
assign("assembly_and_install_cost_modeled", var_data(static_cast<ssc_number_t>(assembly_and_install)));
assign("other_infrastructure_cost_modeled", var_data(static_cast<ssc_number_t>(other_infrastructure)));

assign("array_cable_system_cost_modeled", var_data(static_cast<ssc_number_t>(array_cable_system)));
assign("export_cable_system_cost_modeled", var_data(static_cast<ssc_number_t>(export_cable_system)));
assign("onshore_substation_cost_modeled", var_data(static_cast<ssc_number_t>(onshore_substation)));
assign("offshore_substation_cost_modeled", var_data(static_cast<ssc_number_t>(offshore_substation)));
assign("other_elec_infra_cost_modeled", var_data(static_cast<ssc_number_t>(other_elec_infra)));

assign("project_contingency", var_data(static_cast<ssc_number_t>(project_contingency)));
assign("insurance_during_construction", var_data(static_cast<ssc_number_t>(insurance_during_construction)));
assign("reserve_accounts", var_data(static_cast<ssc_number_t>(reserve_accounts)));

assign("operations_cost", var_data(static_cast<ssc_number_t>(operations_cost)));
assign("maintenance_cost", var_data(static_cast<ssc_number_t>(maintenance_cost)));
}

};
Expand Down

0 comments on commit 0654a46

Please sign in to comment.