Skip to content

Commit

Permalink
Merge branch 'develop' into getem-reservoir-replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
mjprilliman committed Oct 16, 2024
2 parents 8fb8454 + 5dba747 commit 03429b9
Show file tree
Hide file tree
Showing 38 changed files with 332 additions and 201 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# System Advisor Model (SAM)
![Build](https://github.com/NREL/SAM/actions/workflows/ci.yml/badge.svg)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNREL%2FSAM.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FNREL%2FSAM?ref=badge_shield)

The SAM Open Source Project repository contains the source code, tools, and instructions to build a desktop version of the National Renewable Energy Laboratory's System Advisor Model™ (SAM™). SAM is a simulation program for electricity generation projects. It has models for different kinds of renewable energy systems and financial models for residential, commercial, and utility-scale projects. For more details about SAM's capabilities, see the SAM website at [https://sam.nrel.gov/](https://sam.nrel.gov/).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@
"decline_type": 0,
"delta_pressure_equip": 40,
"design_temp": 200,
"drilling_success_rate": 76,
"dt_prod_well": 0,
"eta_ref": 0.17,
"excess_pressure_pump": 50,
"exploration_wells_production": 0,
"failed_prod_flow_ratio": 0.3,
"fracture_angle": 15,
"fracture_aperature": 0.0004,
"fracture_length": 1000,
"fracture_spacing": 50,
"fracture_width": 175,
"geotherm_cost_inj_cost_curve_welldiam": 0,
"geotherm_cost_inj_cost_curve_welltype": 0,
"geotherm_cost_inj_prod_well_ratio": 0.5,
"geotherm_cost_prod_cost_curve_welldiam": 0,
"geotherm_cost_prod_cost_curve_welltype": 0,
"geothermal_analysis_period": 30,
Expand Down Expand Up @@ -168,6 +171,7 @@
"specify_pump_work": 0,
"startup_frac": 0.2,
"startup_time": 1,
"stim_success_rate": 0,
"subsurface_water_loss": 2,
"system_use_lifetime_output": 0,
"temp_decline_max": 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"load_escalation": [0.000000]
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"load_escalation": [0.000000]
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"load_escalation": [0.000000]
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@
"load_escalation": [0.000000]
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
"run_resiliency_calcs": 0
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
"run_resiliency_calcs": 0
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
"run_resiliency_calcs": 0
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@
"run_resiliency_calcs": 0
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
"constant": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,8 @@
"Load": {
},
"PVLosses": {
"enable_subhourly_clipping": 0
"enable_subhourly_clipping": 0,
"enable_subinterval_distribution": 0
},
"AdjustmentFactors": {
},
Expand Down
6 changes: 6 additions & 0 deletions api/include/SAM_Battery.h
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,8 @@ extern "C"

SAM_EXPORT double* SAM_Battery_Outputs_batt_dispatch_sched_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err);

SAM_EXPORT double SAM_Battery_Outputs_batt_grid_charge_percent_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_batt_power_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_batt_power_dc_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down Expand Up @@ -2467,6 +2469,10 @@ extern "C"

SAM_EXPORT double* SAM_Battery_Outputs_batt_voltage_cell_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Battery_Outputs_batt_year1_charge_from_grid_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_Battery_Outputs_batt_year1_charge_from_system_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_Battery_Outputs_capacity_factor_sales_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Battery_Outputs_cdf_of_surviving_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
6 changes: 6 additions & 0 deletions api/include/SAM_Battwatts.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ extern "C"

SAM_EXPORT double* SAM_Battwatts_Outputs_batt_dispatch_sched_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err);

SAM_EXPORT double SAM_Battwatts_Outputs_batt_grid_charge_percent_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Battwatts_Outputs_batt_power_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battwatts_Outputs_batt_power_dc_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down Expand Up @@ -399,6 +401,10 @@ extern "C"

SAM_EXPORT double* SAM_Battwatts_Outputs_batt_voltage_cell_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Battwatts_Outputs_batt_year1_charge_from_grid_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_Battwatts_Outputs_batt_year1_charge_from_system_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Battwatts_Outputs_cdf_of_surviving_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Battwatts_Outputs_crit_load_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
6 changes: 6 additions & 0 deletions api/include/SAM_Pvsamv1.h
Original file line number Diff line number Diff line change
Expand Up @@ -7515,6 +7515,8 @@ extern "C"

SAM_EXPORT double* SAM_Pvsamv1_Outputs_batt_dispatch_sched_mget(SAM_table ptr, int* nrows, int* ncols, SAM_error *err);

SAM_EXPORT double SAM_Pvsamv1_Outputs_batt_grid_charge_percent_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Pvsamv1_Outputs_batt_power_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvsamv1_Outputs_batt_power_dc_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down Expand Up @@ -7583,6 +7585,10 @@ extern "C"

SAM_EXPORT double* SAM_Pvsamv1_Outputs_batt_voltage_cell_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Pvsamv1_Outputs_batt_year1_charge_from_grid_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double SAM_Pvsamv1_Outputs_batt_year1_charge_from_system_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Pvsamv1_Outputs_bifacial_electrical_mismatch_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Pvsamv1_Outputs_capacity_factor_nget(SAM_table ptr, SAM_error *err);
Expand Down
2 changes: 2 additions & 0 deletions api/include/SAM_Pvwattsv7.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ extern "C"

SAM_EXPORT double* SAM_Pvwattsv7_Outputs_snow_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv7_Outputs_snow_cover_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Pvwattsv7_Outputs_solrad_annual_nget(SAM_table ptr, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv7_Outputs_solrad_monthly_aget(SAM_table ptr, int* length, SAM_error *err);
Expand Down
2 changes: 2 additions & 0 deletions api/include/SAM_Pvwattsv8.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,8 @@ extern "C"

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_snow_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_snow_cover_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double* SAM_Pvwattsv8_Outputs_soiling_f_aget(SAM_table ptr, int* length, SAM_error *err);

SAM_EXPORT double SAM_Pvwattsv8_Outputs_solrad_annual_nget(SAM_table ptr, SAM_error *err);
Expand Down
27 changes: 27 additions & 0 deletions api/modules/SAM_Battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3593,6 +3593,15 @@ SAM_EXPORT double* SAM_Battery_Outputs_batt_dispatch_sched_mget(SAM_table ptr, i
return result;
}

SAM_EXPORT double SAM_Battery_Outputs_batt_grid_charge_percent_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "batt_grid_charge_percent", &result))
make_access_error("SAM_Battery", "batt_grid_charge_percent");
});
return result;
}

SAM_EXPORT double* SAM_Battery_Outputs_batt_power_aget(SAM_table ptr, int* length, SAM_error *err){
double* result = nullptr;
translateExceptions(err, [&]{
Expand Down Expand Up @@ -3928,6 +3937,24 @@ SAM_EXPORT double* SAM_Battery_Outputs_batt_voltage_cell_aget(SAM_table ptr, int
return result;
}

SAM_EXPORT double SAM_Battery_Outputs_batt_year1_charge_from_grid_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "batt_year1_charge_from_grid", &result))
make_access_error("SAM_Battery", "batt_year1_charge_from_grid");
});
return result;
}

SAM_EXPORT double SAM_Battery_Outputs_batt_year1_charge_from_system_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
if (!ssc_data_get_number(ptr, "batt_year1_charge_from_system", &result))
make_access_error("SAM_Battery", "batt_year1_charge_from_system");
});
return result;
}

SAM_EXPORT double SAM_Battery_Outputs_capacity_factor_sales_nget(SAM_table ptr, SAM_error *err){
double result;
translateExceptions(err, [&]{
Expand Down
Loading

0 comments on commit 03429b9

Please sign in to comment.