Skip to content

Commit

Permalink
Add input capacity factor for lcoefcr calculations for geothermal
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Apr 29, 2024
1 parent 38b4f6b commit 524c02c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion shared/lib_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ bool CGeothermalAnalyzer::RunAnalysis(bool(*update_function)(float, void*), void
}//years

double power_after_drawdown = actualpowertotal / powersalestotal;
double adjusted_capacity_factor = power_after_drawdown * mo_geo_in.md_CapacityFactor / 100.0;
double adjusted_capacity_factor = (PlantGrossPowerkW() - mp_geo_out->md_PumpWorkKW) * power_after_drawdown * mo_geo_in.md_CapacityFactor / 100.0;
mp_geo_out->AdjustedCapacityFactor = adjusted_capacity_factor;

if (!ms_ErrorString.empty()) return false;
Expand Down
5 changes: 3 additions & 2 deletions ssc/cmod_geothermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static var_info _cm_vtab_geothermal[] = {
{ SSC_INPUT, SSC_NUMBER, "geothermal_analysis_period", "Analysis Lifetime", "years", "", "GeoHourly", "*", "INTEGER", "" },
{ SSC_INPUT, SSC_NUMBER, "model_choice", "Which model to run (0,1,2)", "", "", "GeoHourly", "*", "INTEGER", "" },
{ SSC_INPUT, SSC_MATRIX, "reservoir_model_inputs", "Reservoir temperatures over time", "", "", "GeoHourly", "reservoir_pressure_change_type=3", "", "" },
{ SSC_INPUT, SSC_NUMBER, "geothermal_capacity_factor", "Capacity Factor", "%", "", "GeoHourly", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "geothermal_capacity_factor", "Input capacity Factor", "%", "", "GeoHourly", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "discount_rate", "Discount Rate", "%", "", "GeoHourly", "*", "", "" },

// geothermal plant and equipment
Expand Down Expand Up @@ -212,6 +212,7 @@ static var_info _cm_vtab_geothermal[] = {
{ SSC_OUTPUT, SSC_NUMBER, "first_year_output", "First Year Output", "kWh", "", "GeoHourly", "ui_calculations_only=0", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "annual_energy", "Annual Energy", "kWh", "", "GeoHourly", "ui_calculations_only=0", "", "" },

{ SSC_OUTPUT, SSC_NUMBER, "adjusted capacity_factor", "Adjusted capacity factor (financial)", "", "", "", "", "", "" },

{ SSC_OUTPUT, SSC_NUMBER, "capacity_factor", "Capacity factor", "", "", "", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "kwh_per_kw", "First year kWh/kW", "", "", "", "*", "", "" },
Expand Down Expand Up @@ -545,7 +546,7 @@ class cm_geothermal : public compute_module
double eff_secondlaw = geo_outputs.eff_secondlaw;
assign("eff_secondlaw", (ssc_number_t)eff_secondlaw);

assign("adjusted_capacity_factor", geo_outputs.AdjustedCapacityFactor);

//Assign HP & LP Flash Pressures:
double hp_flash_pressure = geo_outputs.md_PressureHPFlashPSI;
Expand Down
9 changes: 9 additions & 0 deletions ssc/cmod_lcoefcr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ static var_info vtab_lcoefcr_design[] =

{ SSC_INPUT, SSC_NUMBER, "variable_operating_cost", "Annual variable operating cost", "$/kWh", "", "Simple LCOE", "sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "annual_energy", "Annual energy production", "kWh", "", "Simple LCOE", "sim_type=1", "", "SIMULATION_PARAMETER" },
{ SSC_INPUT, SSC_NUMBER, "ui_fixed_charge_rate", "Input fixed charge rate", "", "", "Simple LCOE", "ui_fcr_input_option=0", "", ""},

{ SSC_INPUT, SSC_NUMBER, "adjusted capacity_factor", "Adjusted capacity factor (financial)", "", "", "", "?", "", "" },

// "Design" outputs
{ SSC_OUTPUT, SSC_NUMBER, "crf", "Capital recovery factor", "", "", "Simple LCOE", "*", "", "" },
Expand Down Expand Up @@ -212,6 +215,12 @@ class cm_lcoefcr_design : public compute_module

double lcoe = (fixed_charge_rate * icc + foc) / aep + voc; //$/kWh

//Geothermal - input capacity factor for used in capex calculation rather than annual_energy
if (is_assigned("adjusted_capacity_factor")) {
double adjusted_capacity_factor = as_double("adjusted_capacity_factor");
lcoe = (fixed_charge_rate * icc) / adjusted_capacity_factor + foc / aep + voc;
}

assign("lcoe_fcr", var_data((ssc_number_t)lcoe));

// For reference: code from UI page 7/25/23
Expand Down

0 comments on commit 524c02c

Please sign in to comment.