Skip to content

Commit

Permalink
Update host developer to account for thermal savings for SAM #1903
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Nov 15, 2024
1 parent b241d0e commit 7e52c1b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
24 changes: 18 additions & 6 deletions ssc/cmod_host_developer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static var_info _cm_vtab_host_developer[] = {

{ SSC_INPUT, SSC_ARRAY, "utility_bill_w_sys", "Electricity bill for system", "$", "", "Charges by Month", "*", "", "" },
{ SSC_INPUT, SSC_MATRIX, "charge_w_sys_dc_tou_ym", "Demand charge with system (TOU)", "$", "", "Charges by Month", "*", "", "COL_LABEL=MONTHS,FORMAT_SPEC=CURRENCY,GROUP=UR_AM" },
{ SSC_INPUT, SSC_ARRAY, "annual_energy_value", "Energy value", "$", "", "System Output", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "annual_thermal_value", "Energy value", "$", "", "System Output", "", "", "" },
// { SSC_INPUT, SSC_ARRAY, "annual_energy_value", "Energy value", "$", "", "System Output", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "annual_thermal_value", "Host thermal value", "$", "", "System Output", "", "", "" },
{ SSC_INPUT, SSC_ARRAY, "gen", "Power generated by renewable resource", "kW", "", "System Output", "*", "", "" },

// { SSC_OUTPUT, SSC_ARRAY, "gen_purchases", "Electricity from grid", "kW", "", "System Output", "", "", "" },
Expand Down Expand Up @@ -852,6 +852,7 @@ enum {
CF_cumulative_payback_with_expenses,
CF_nte,
CF_host_energy_value,
CF_host_thermal_value,



Expand Down Expand Up @@ -1017,6 +1018,8 @@ class cm_host_developer : public compute_module
double om_opt_fuel_1_usage = as_double("om_opt_fuel_1_usage");
double om_opt_fuel_2_usage = as_double("om_opt_fuel_2_usage");



// additional o and m sub types (e.g. batteries and fuel cells)
int add_om_num_types = as_integer("add_om_num_types");
ssc_number_t nameplate1 = 0;
Expand Down Expand Up @@ -2822,7 +2825,16 @@ class cm_host_developer : public compute_module

// ----------------------------------------------------------------------------
// Host calculations based on thirdpartyownership with PPA agreement

if (is_assigned("annual_thermal_value")) {
arrp = as_array("annual_thermal_value", &count);
if ((int)count != nyears + 1)
throw exec_error("host developer", util::format("thermal value input wrong length (%d) shouCF_host_energy_valueld be (%d)", count, nyears + 1));
i = 0;
while (i < nyears && i < (int)count) {
cf.at(CF_host_thermal_value, i + 1) = (double)arrp[i + 1];
i++;
}
}
// output from utility rate already nyears+1 - no offset
arrp = as_array("annual_energy_value", &count);
if ((int)count != nyears + 1)
Expand All @@ -2840,7 +2852,7 @@ class cm_host_developer : public compute_module

cf.at(CF_after_tax_cash_flow, i) =
cf.at(CF_after_tax_net_equity_cost_flow, i)
+ cf.at(CF_host_energy_value, i);
+ cf.at(CF_host_energy_value, i) + cf.at(CF_host_thermal_value, i);

cf.at(CF_payback_with_expenses, i) =
cf.at(CF_after_tax_cash_flow, i);
Expand Down Expand Up @@ -3346,8 +3358,8 @@ class cm_host_developer : public compute_module
save_cf( CF_debt_payment_principal, nyears, "cf_debt_payment_principal" );
save_cf( CF_debt_balance, nyears, "cf_debt_balance" );

save_cf( CF_energy_value, nyears, "cf_energy_value" );
save_cf( CF_ppa_price, nyears, "cf_ppa_price" );
save_cf(CF_energy_value, nyears, "cf_energy_value");
save_cf( CF_ppa_price, nyears, "cf_ppa_price" );
save_cf( CF_om_fixed_expense, nyears, "cf_om_fixed_expense" );
save_cf( CF_om_production_expense, nyears, "cf_om_production_expense" );
save_cf( CF_om_capacity_expense, nyears, "cf_om_capacity_expense" );
Expand Down
8 changes: 5 additions & 3 deletions ssc/cmod_thermalrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ static var_info vtab_thermal_rate[] = {
{ SSC_OUTPUT, SSC_ARRAY, "annual_thermal_value", "Thermal value", "$", "", "Annual", "*", "", "" },
// { SSC_OUTPUT, SSC_ARRAY, "annual_thermal_revenue_with_system", "Thermal value with system", "$", "", "Annual", "*", "", "" },
// { SSC_OUTPUT, SSC_ARRAY, "annual_thermal_revenue_without_system", "Thermal value without system", "$", "", "Annual", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_revenue_with_system", "Thermal revenue with system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_revenue_without_system", "Thermal revenue without system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "thermal_load_year1", "Thermal load (year 1)", "$", "", "", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_revenue_with_system", "Thermal revenue with system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_revenue_without_system", "Thermal revenue without system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_cost_with_system", "Thermal cost with system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "thermal_cost_without_system", "Thermal cost without system", "$", "", "Time Series", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "thermal_load_year1", "Thermal load (year 1)", "$", "", "", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "thermal_savings_year1", "Thermal savings (year 1)", "$", "", "", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "thermal_cost_with_system_year1", "Thermal cost with sytem (year 1)", "$", "", "", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "thermal_cost_without_system_year1", "Thermal cost without system (year 1)", "$", "", "", "*", "", "" },
Expand Down

0 comments on commit 7e52c1b

Please sign in to comment.