Skip to content

Commit

Permalink
Fix var labels, fix unit conversion for gross_output
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Jan 14, 2025
1 parent 3cfd0fa commit dfefcd9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ssc/cmod_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static var_info _cm_vtab_geothermal[] = {
{ SSC_OUTPUT, SSC_NUMBER, "inj_pump_hp", "Injection Pump horsepower", "hp", "", "GeoHourly", "ui_calculations_only=1", "", "" },


{ SSC_OUTPUT, SSC_NUMBER, "gross_output", "Gross output from GETEM", "", "", "GeoHourly", "ui_calculations_only=0", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "gross_output", "Gross output from GETEM", "MW", "", "GeoHourly", "ui_calculations_only=0", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "gross_cost_output", "Gross output from GETEM for cost", "", "", "GeoHourly", "ui_calculations_only=0", "", "" },

{ SSC_OUTPUT, SSC_NUMBER, "pump_depth_ft", "Pump depth calculated by GETEM", "ft", "", "GeoHourly", "ui_calculations_only=1", "", "" },
Expand Down
32 changes: 26 additions & 6 deletions ssc/cmod_geothermal_costs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static var_info _cm_vtab_geothermal_costs[] = {
{ SSC_INPUT, SSC_NUMBER, "ppi_base_year", "PPI Base Year", "", "", "GeoHourly", "?=19", "", "" },

// Binary Plant Type Inputs:
{ SSC_INPUT, SSC_NUMBER, "gross_output", "Gross output from GETEM", "kW", "", "GeoHourly", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "gross_output", "Gross output from GETEM", "MW", "", "GeoHourly", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "gross_cost_output", "Gross output from GETEM for cost calculations", "MW", "", "GeoHourly", "*", "", "" },

{ SSC_INPUT, SSC_NUMBER, "design_temp", "Power block design temperature", "C", "", "GeoHourly", "*", "", "" },
Expand Down Expand Up @@ -105,6 +105,7 @@ static var_info _cm_vtab_geothermal_costs[] = {
{ SSC_INPUT, SSC_NUMBER, "pump_size_hp", "Production pump power", "hp", "", "GeoHourly", "", "", "?733.646" },
{ SSC_INPUT, SSC_NUMBER, "inj_pump_hp", "Injection pump power", "hp", "", "GeoHourly", "", "", "" },
{ SSC_INPUT, SSC_NUMBER, "inj_num_pumps", "Number of injection pumps", "p", "", "GeoHourly", "", "", "?=1" },
{ SSC_INPUT, SSC_NUMBER, "stimulation_type", "Which wells are stimulated", "0/1/2/3", "", "GeoHourly", "", "", "?=0" },


// Outputs
Expand All @@ -115,8 +116,12 @@ static var_info _cm_vtab_geothermal_costs[] = {
{ SSC_OUTPUT, SSC_NUMBER, "expl_total_cost", "Total exploration well cost", "$", "", "GeoHourly", "calc_drill_costs=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "conf_total_cost", "Total confirmation well cost", "$", "", "GeoHourly", "calc_drill_costs=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_drilling_cost", "Total drilling cost", "$", "", "GeoHourly", "calc_drill_costs=1", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_pump_cost", "Total pumping cost", "$/kW", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_gathering_cost", "Total gathering well cost", "$/kW", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_pump_cost", "Total pumping cost", "$", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_gathering_cost", "Total gathering well cost", "$", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "indirect_pump_gathering_cost", "Indirect pump and field gathering cost", "$", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "total_pump_gathering_cost", "Total pump and field gathering system cost", "$", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "pump_only_cost", "Production pump cost per well", "$/well", "", "GeoHourly", "?", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "pump_cost_install", "Production pump installation cost", "$/well", "", "GeoHourly", "?", "", "" },


var_info_invalid };
Expand Down Expand Up @@ -519,7 +524,12 @@ class cm_geothermal_costs : public compute_module
int ppi_base_year = as_integer("ppi_base_year");
double stim_non_drill = as_double("geotherm.cost.stim_non_drill");
double stim_per_well = 1250000 * drilling_ppi[ppi_base_year];
double stim_num_wells = inj_wells_drilled;
int stim_type = as_integer("stimulation_type");
double stim_num_wells = inj_wells_drilled;
if (stim_type == 0) stim_num_wells = inj_wells_drilled;
else if (stim_type == 1) stim_num_wells = prod_wells_drilled;
else if (stim_type == 2) stim_num_wells = inj_wells_drilled + prod_wells_drilled;
else stim_num_wells = 0;
double stim_total_cost = stim_per_well * stim_num_wells + stim_non_drill;
assign("stim_total_cost", stim_total_cost);

Expand Down Expand Up @@ -599,6 +609,7 @@ class cm_geothermal_costs : public compute_module
double design_temp = as_double("design_temp") - as_double("dt_prod_well");
double eff = as_double("eff_secondlaw"); // w-h/lb
double unit_plant = as_double("gross_output");
unit_plant *= 1000.0; //convert to kW, brought from cmod_geothermal as MW

//Geofluid Heat Exchangers Equipment Cost Calculations:
size_ratio = unit_plant / ref_plant_size;
Expand Down Expand Up @@ -691,6 +702,7 @@ class cm_geothermal_costs : public compute_module
else if (conversion_type == 1) {
//geo_inputs.me_ct = FLASH;
double unit_plant = as_double("gross_output");
unit_plant *= 1000.0; //kW, comes from cmod_geothermal as MW
double gross_cost = as_double("gross_cost_output");
double GF_flowrate = as_double("GF_flowrate");
double qRejectTotal = (as_double("qRejectTotal")*GF_flowrate / 1000) / 1000000; // Converting from btu/h to MMBTU/h
Expand Down Expand Up @@ -851,7 +863,11 @@ class cm_geothermal_costs : public compute_module
double other_pump_install_cost = 5750 * pow(prod_pump_power, 0.2) * pump_ppi[ppi_base_year];
double prod_pump_cost_per_well = workover_casing_cost + installation_cost_per_foot * pump_set_depth * pump_ppi[ppi_base_year] + other_pump_install_cost;
double production_pump_cost = prod_pump_cost_per_well * num_prod_wells;
if ((conversion_type + 1) == FLASH) production_pump_cost = 0;
if ((conversion_type + 1) == FLASH) {
production_pump_cost = 0;
prod_pump_cost_per_well = 0;
workover_casing_cost = 0;
}
//Calculated injection pump cost
double inj_pump_power = as_double("inj_pump_hp");
double num_injection_pumps = std::ceil(inj_pump_power / 2000.0);
Expand All @@ -860,7 +876,8 @@ class cm_geothermal_costs : public compute_module
double injection_pump_cost = num_injection_pumps * inj_pump_cost_per_pump * pump_ppi[ppi_base_year];

double indirect_pump_cost = (production_pump_cost + injection_pump_cost) * (1.0 / (1.0 - 0.12) - 1.0);
assign("pump_only_cost", production_pump_cost);
assign("pump_only_cost", prod_pump_cost_per_well);
assign("pump_cost_install", prod_pump_cost_per_well - workover_casing_cost);
double total_pump_cost = production_pump_cost + injection_pump_cost + indirect_pump_cost;
assign("total_pump_cost", var_data(static_cast<ssc_number_t>(total_pump_cost)));

Expand All @@ -885,6 +902,9 @@ class cm_geothermal_costs : public compute_module
double indirect_pump_gathering_cost = (total_pump_cost + gathering_cost_total) * (1.0 / (1 - 0.12) - 1);
assign("indirect_pump_gathering_cost", var_data(static_cast<ssc_number_t>(indirect_pump_gathering_cost)));

double total_pump_gathering_cost = total_pump_cost + gathering_cost_total + indirect_pump_gathering_cost;
assign("total_pump_gathering_cost", var_data(static_cast<ssc_number_t>(total_pump_gathering_cost)));

//OM Cost calculations
/*
double unit_plant = as_double("gross_output");
Expand Down

0 comments on commit dfefcd9

Please sign in to comment.