Skip to content

Commit

Permalink
Update o and m and cash flow for cmod_singleowner_heat
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Oct 29, 2024
1 parent 6b419ba commit 861034c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 13 deletions.
18 changes: 9 additions & 9 deletions ssc/cmod_singleowner_heat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static var_info _cm_vtab_singleowner_heat[] = {
{ SSC_INPUT, SSC_NUMBER, "en_batt", "Enable battery storage model", "0/1", "", "BatterySystem", "?=0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "en_electricity_rates", "Enable electricity rates for grid purchase", "0/1", "", "Electricity Rates", "?=0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "batt_meter_position", "Position of battery relative to electric meter", "", "", "BatterySystem", "", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "revenue_gen", "Electricity to grid", "kW", "", "System Output", "", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "revenue_gen", "Thermal energy", "kWht", "", "System Output", "", "", "" },
// { SSC_OUTPUT, SSC_ARRAY, "gen_purchases", "Electricity from grid", "kW", "", "System Output", "", "", "" },

{ SSC_INPUT, SSC_ARRAY, "gen_heat", "Thermal power", "kWt", "", "System Output", "*", "", "" },
Expand Down Expand Up @@ -528,10 +528,10 @@ static var_info _cm_vtab_singleowner_heat[] = {
/* Production - input as energy_net above */

/* Partial Income Statement: Project */
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_net", "Electricity to grid net", "kWh", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_sales", "Electricity to grid", "kWh", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_purchases", "Electricity from grid", "kWh", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_without_battery", "Electricity generated without storage", "kWh", "", "Cash Flow Electricity", "", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_net", "Thermal energy", "kWht", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_sales", "Thermal energy to grid", "kWht", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_purchases", "Thermal energy from grid", "kWht", "", "Cash Flow Electricity", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_without_battery", "Thermal energy generated without storage", "kWht", "", "Cash Flow Electricity", "", "LENGTH_EQUAL=cf_length", "" },

{ SSC_OUTPUT, SSC_ARRAY, "cf_ppa_price", "PPA price", "cents/kWh", "", "Cash Flow Revenues", "*", "LENGTH_EQUAL=cf_length", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_energy_value", "PPA revenue", "$", "", "Cash Flow Revenues", "*", "LENGTH_EQUAL=cf_length", "" },
Expand Down Expand Up @@ -664,7 +664,7 @@ extern var_info
vtab_update_tech_outputs[],
vtab_ppa_inout[],
vtab_standard_financial[],
vtab_oandm[],
vtab_oandm_heat[],
vtab_equip_reserve[],
vtab_tax_credits[],
vtab_depreciation_inputs[],
Expand Down Expand Up @@ -922,7 +922,7 @@ class cm_singleowner_heat : public compute_module
{
add_var_info(vtab_ppa_inout );
add_var_info( vtab_standard_financial );
add_var_info( vtab_oandm );
add_var_info( vtab_oandm_heat );
add_var_info( vtab_equip_reserve );
add_var_info( vtab_tax_credits );
add_var_info(vtab_depreciation_inputs );
Expand Down Expand Up @@ -1061,8 +1061,8 @@ class cm_singleowner_heat : public compute_module
// general financial expenses and incentives - stdlib?
// precompute expenses from annual schedules or value+escalation
escal_or_annual( CF_om_fixed_expense, nyears, "om_fixed", inflation_rate, 1.0, false, as_double("om_fixed_escal")*0.01 );
escal_or_annual( CF_om_production_expense, nyears, "om_production", inflation_rate, 0.001, false, as_double("om_production_escal")*0.01 );
escal_or_annual( CF_om_capacity_expense, nyears, "om_capacity", inflation_rate, 1.0, false, as_double("om_capacity_escal")*0.01 );
escal_or_annual( CF_om_production_expense, nyears, "om_production_heat", inflation_rate, 0.001, false, as_double("om_production_escal")*0.01 );
escal_or_annual( CF_om_capacity_expense, nyears, "om_capacity_heat", inflation_rate, 1.0, false, as_double("om_capacity_escal")*0.01 );
escal_or_annual( CF_om_fuel_expense, nyears, "om_fuel_cost", inflation_rate, as_double("system_heat_rate")*0.001, false, as_double("om_fuel_cost_escal")*0.01 );

// escal_or_annual(CF_om_elec_price_for_heat_techs, nyears, "om_elec_price_for_heat_techs", inflation_rate, 1.0, false, as_double("om_elec_price_for_heat_techs_escal")*0.01 );
Expand Down
60 changes: 56 additions & 4 deletions ssc/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,62 @@ var_info vtab_standard_loan[] = {
{ SSC_INPUT,SSC_NUMBER , "debt_fraction" , "Debt percentage" , "%" , "" , "Financial Parameters" , "?=0" , "MIN=0,MAX=100" , ""},
var_info_invalid };


var_info vtab_oandm_heat[] = {
/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/

{ SSC_INPUT, SSC_ARRAY, "om_fixed", "Fixed O&M annual amount", "$/year", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_fixed_escal", "Fixed O&M escalation", "%/year", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_ARRAY, "om_production_heat", "Production-based O&M amount", "$/MWht", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_production_escal", "Production-based O&M escalation", "%/year", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_ARRAY, "om_capacity_heat", "Capacity-based O&M amount", "$/kWt-yr", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_capacity_escal", "Capacity-based O&M escalation", "%/year", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_ARRAY, "om_fuel_cost", "Fuel cost", "$/MMBtu", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_fuel_cost_escal", "Fuel cost escalation", "%/year", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "annual_fuel_usage", "Fuel usage (yr 1)", "kWht", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "?=0", "MIN=0", "" },
{ SSC_INPUT, SSC_ARRAY, "annual_fuel_usage_lifetime", "Fuel usage (lifetime)", "kWht", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "", "", "" },

{ SSC_INPUT, SSC_ARRAY, "om_elec_price_for_heat_techs", "Electricity price for purchases in heat model", "$/kWh", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_elec_price_for_heat_techs_escal", "Escalation for electricity price for purchases in heat model", "%/year", "", "System Costs", "?=0.0", "", "" },


// replacements
{ SSC_INPUT,SSC_ARRAY , "om_batt_replacement_cost" , "Replacement cost 1" , "$/kWh" , "battery" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_fuelcell_replacement_cost" , "Replacement cost 2" , "$/kW", "fuelcell" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_NUMBER , "om_replacement_cost_escal" , "Replacement cost escalation" , "%/year", "battery,fuelcell" , "System Costs" , "?=0.0" , "" , ""},

// optional fuel o and m for Biopower - usage can be in any unit and cost is in $ per usage unit
{ SSC_INPUT,SSC_NUMBER , "om_opt_fuel_1_usage" , "Biomass feedstock usage" , "unit" , "biomass" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_opt_fuel_1_cost" , "Biomass feedstock cost" , "$/unit" , "biomass" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_NUMBER , "om_opt_fuel_1_cost_escal" , "Biomass feedstock cost escalation" , "%/year" , "biomass" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_NUMBER , "om_opt_fuel_2_usage" , "Coal feedstock usage" , "unit" , "biomass" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_opt_fuel_2_cost" , "Coal feedstock cost" , "$/unit" , "biomass" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_NUMBER , "om_opt_fuel_2_cost_escal" , "Coal feedstock cost escalation" , "%/year" , "biomass" , "System Costs" , "?=0.0" , "" , ""},

// optional additional base o and m types
{ SSC_INPUT,SSC_NUMBER , "add_om_num_types" , "Number of O and M types" , "" , "battery,fuelcell" , "System Costs" , "?=0" , "INTEGER,MIN=0,MAX=2" , ""},
{ SSC_INPUT,SSC_NUMBER , "om_batt_nameplate" , "Battery capacity for System Costs values" , "kW", "battery" , "System Costs" , "?=0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_production1_values" , "Battery production for System Costs values" , "kWh", "battery" , "System Costs" , "?=0" , "" , ""},

{ SSC_INPUT,SSC_ARRAY , "om_batt_fixed_cost" , "Battery fixed System Costs annual amount" , "$/year", "battery", "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_batt_variable_cost" , "Battery production-based System Costs amount" , "$/MWh", "battery" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_batt_capacity_cost" , "Battery capacity-based System Costs amount" , "$/kWcap", "battery" , "System Costs" , "?=0.0" , "" , ""},

{ SSC_INPUT,SSC_NUMBER , "om_fuelcell_nameplate" , "Fuel cell capacity for System Costs values" , "kW", "fuelcell" , "System Costs" , "?=0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_production2_values" , "Fuel cell production for System Costs values" , "kWh", "fuelcell" , "System Costs" , "?=0" , "" , ""},

{ SSC_INPUT,SSC_ARRAY , "om_fuelcell_fixed_cost" , "Fuel cell fixed System Costs annual amount" , "$/year", "fuelcell" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_fuelcell_variable_cost" , "Fuel cell production-based System Costs amount" , "$/MWh", "fuelcell" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_fuelcell_capacity_cost" , "Fuel cell capacity-based System Costs amount" , "$/kWcap", "fuelcell" , "System Costs" , "?=0.0" , "" , ""},

// optional land lease
{ SSC_INPUT, SSC_NUMBER, "land_area", "Total land area", "acres", "", "Land Lease", "?=0", "", "" },
{ SSC_INPUT, SSC_ARRAY, "om_land_lease", "Land lease cost", "$/acre", "", "Land Lease", "?=0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_land_lease_escal", "Land lease cost escalation", "%/yr", "", "Land Lease", "?=0", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "cf_land_lease_expense", "Land lease expense", "$", "", "Land Lease", "", "LENGTH_EQUAL=cf_length", "" },

var_info_invalid };

// meta should be either a blocklist (!gen,!gen) or an allowlist. Cannot do both blocked and allowed gens
var_info vtab_oandm[] = {
/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/
Expand All @@ -114,10 +170,6 @@ var_info vtab_oandm[] = {
{ SSC_INPUT, SSC_NUMBER, "annual_fuel_usage", "Fuel usage (yr 1)", "kWht", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "?=0", "MIN=0", "" },
{ SSC_INPUT, SSC_ARRAY, "annual_fuel_usage_lifetime", "Fuel usage (lifetime)", "kWht", "generic_system,fuelcell,tcslinearfresnel,tcstroughempirical,tcsgenericsolar,fresnelphysical", "System Costs", "", "", "" },

{ SSC_INPUT, SSC_ARRAY, "om_elec_price_for_heat_techs", "Electricity price for purchases in heat model", "$/kWh", "", "System Costs", "?=0.0", "", "" },
{ SSC_INPUT, SSC_NUMBER, "om_elec_price_for_heat_techs_escal", "Escalation for electricity price for purchases in heat model", "%/year", "", "System Costs", "?=0.0", "", "" },


// replacements
{ SSC_INPUT,SSC_ARRAY , "om_batt_replacement_cost" , "Replacement cost 1" , "$/kWh" , "battery" , "System Costs" , "?=0.0" , "" , ""},
{ SSC_INPUT,SSC_ARRAY , "om_fuelcell_replacement_cost" , "Replacement cost 2" , "$/kW", "fuelcell" , "System Costs" , "?=0.0" , "" , ""},
Expand Down

0 comments on commit 861034c

Please sign in to comment.