Skip to content

Commit

Permalink
Merge pull request #1117 from NREL/develop
Browse files Browse the repository at this point in the history
Develop to main for 2023.12.17
  • Loading branch information
brtietz committed Dec 13, 2023
2 parents 404bc11 + 91b0178 commit 9d76d0c
Show file tree
Hide file tree
Showing 459 changed files with 467,362 additions and 68,306 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
BUILD_TYPE: Release

jobs:
build-on-ubuntu1804:
runs-on: ubuntu-18.04
build-on-ubuntu:
runs-on: ubuntu-latest

steps:
- name: Setup cmake
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
${{env.SSCDIR}}/build/ssc/ssc.so
build-on-mac:
runs-on: macos-11
runs-on: macos-latest

steps:
- name: Setup cmake
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ SSC is licensed with BSD-3-Clause terms, found [here](https://github.com/NREL/SA

# Citing this package

System Advisor Model Version 2022.11.21 (2022). SSC source code. National Renewable Energy Laboratory. Golden, CO. Accessed November 28, 2022. https://github.com/NREL/ssc
System Advisor Model Version 2023.12.17 (2023). SSC source code. National Renewable Energy Laboratory. Golden, CO. Accessed November 28, 2023. https://github.com/NREL/ssc
12 changes: 4 additions & 8 deletions ssc/cmod_annualoutput.cpp → code_attic/cmod_annualoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@ static var_info _cm_vtab_annualoutput[] = {
{ SSC_INPUT, SSC_ARRAY, "energy_degradation", "Annual energy degradation", "%", "", "AnnualOutput", "*", "", "" },
{ SSC_INPUT, SSC_MATRIX, "energy_curtailment", "First year energy curtailment", "", "(0..1)", "AnnualOutput", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "system_use_lifetime_output", "Lifetime hourly system outputs", "0/1", "0=hourly first year,1=hourly lifetime", "AnnualOutput", "*", "INTEGER,MIN=0", "" },
// { SSC_INPUT, SSC_ARRAY, "energy_net", "Hourly energy produced by the system", "kW", "", "AnnualOutput", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "system_hourly_energy", "Hourly energy produced by the system", "kW", "", "AnnualOutput", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "system_hourly_energy", "Hourly energy produced by the system", "kW", "", "AnnualOutput", "*", "", "" },


/* output */
// { SSC_OUTPUT, SSC_ARRAY, "annual_e_net_delivered", "Annual energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "annual_energy", "Annual energy", "kWh", "", "AnnualOutput", "*", "", "" },
// { SSC_OUTPUT, SSC_ARRAY, "monthly_e_net_delivered", "Monthly energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "monthly_energy", "Monthly energy", "kWh", "", "AnnualOutput", "*", "", "" },
// { SSC_OUTPUT, SSC_ARRAY, "hourly_e_net_delivered", "Hourly energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "hourly_energy", "Hourly energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "annual_energy", "Annual energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "monthly_energy", "Monthly energy gross", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "hourly_energy", "Hourly energy", "kWh", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "annual_availability", "Annual availability", "", "", "AnnualOutput", "*", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "annual_degradation", "Annual degradation", "", "", "AnnualOutput", "*", "", "" },

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ssc/cmod_pvwattsv0.cpp → code_attic/cmod_pvwattsv0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ static double perez( double dn,double df,double alb,double inc,double tilt,doubl

static var_info _cm_vtab_pvwattsv0[] = {
/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/
{ SSC_INPUT, SSC_STRING, "file_name", "local weather file path", "", "", "Weather", "*", "LOCAL_FILE", "" },
{ SSC_INPUT, SSC_STRING, "file_name", "local weather file path", "", "", "weather", "*", "LOCAL_FILE", "" },

{ SSC_INPUT, SSC_NUMBER, "system_size", "Nameplate capacity", "kW", "", "PVWatts", "*", "", "" },
{ SSC_INPUT, SSC_NUMBER, "derate", "System derate value", "frac", "", "PVWatts", "*", "MIN=0,MAX=1", "" },
Expand Down
18 changes: 13 additions & 5 deletions ssc/cmod_pvwattsv1.cpp → code_attic/cmod_pvwattsv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

static var_info _cm_vtab_pvwattsv1[] = {
/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/
{ SSC_INPUT, SSC_STRING, "solar_resource_file", "local weather file path", "", "", "Weather", "*", "LOCAL_FILE", "" },
{ SSC_INPUT, SSC_STRING, "solar_resource_file", "local weather file path", "", "", "weather", "*", "LOCAL_FILE", "" },

{ SSC_INPUT, SSC_NUMBER, "albedo", "Albedo (ground reflectance)", "frac", "", "PVWatts", "?", "", "" },
{ SSC_INPUT, SSC_NUMBER, "system_size", "Nameplate capacity", "kW", "", "PVWatts", "*", "", "" },
Expand All @@ -55,10 +55,18 @@ static var_info _cm_vtab_pvwattsv1[] = {
{ SSC_INPUT, SSC_NUMBER, "tilt_eq_lat", "Tilt=latitude override", "0/1", "", "PVWatts", "na:tilt", "BOOLEAN", "" },

/* shading inputs */
{ SSC_INPUT, SSC_MATRIX, "shading:timestep", "Time step beam shading factors", "", "", "PVWatts", "?", "", "" },
{ SSC_INPUT, SSC_MATRIX, "shading:mxh", "Month x Hour beam shading factors", "", "", "PVWatts", "?", "", "" },
{ SSC_INPUT, SSC_MATRIX, "shading:azal", "Azimuth x altitude beam shading factors", "", "", "PVWatts", "?", "", "" },
{ SSC_INPUT, SSC_NUMBER, "shading:diff", "Diffuse shading factor", "", "", "PVWatts", "?", "", "" },
// { SSC_INPUT, SSC_TABLE, "shading", "Shading loss table", "", "", "PVWatts", "?", "", "" },
{SSC_INPUT, SSC_NUMBER, "shading_en_string_option", "Enable shading string option", "0/1", "0=false,1=true", "Shading", "?=0", "BOOLEAN", "" },
{SSC_INPUT, SSC_NUMBER, "shading_string_option", "Shading string option", "", "0=shadingdb,1=average,2=maximum,3=minimum", "Shading", "?=-1", "INTEGER,MIN=-1,MAX=4","" },
{SSC_INPUT, SSC_NUMBER, "shading_en_timestep", "Enable timestep beam shading losses", "0/1", "0=false,1=true", "Shading", "?=0", "BOOLEAN", "" },
{SSC_INPUT, SSC_MATRIX, "shading_timestep", "Timestep beam shading losses", "%", "", "Shading", "?", "", "" },
{SSC_INPUT, SSC_NUMBER, "shading_en_mxh", "Enable month x Hour beam shading losses", "0/1", "0=false,1=true", "Shading", "?=0", "BOOLEAN", "" },
{SSC_INPUT, SSC_MATRIX, "shading_mxh", "Month x Hour beam shading losses", "%", "", "Shading", "?", "", "" },
{SSC_INPUT, SSC_NUMBER, "shading_en_azal", "Enable azimuth x altitude beam shading losses", "0/1", "0=false,1=true", "Shading", "?=0", "BOOLEAN", "" },
{SSC_INPUT, SSC_MATRIX, "shading_azal", "Azimuth x altitude beam shading losses", "%", "", "Shading", "?", "", "" },
{SSC_INPUT, SSC_NUMBER, "shading_en_diff", "Enable diffuse shading loss", "0/1", "0=false,1=true", "Shading", "?=0", "BOOLEAN", "" },
{SSC_INPUT, SSC_NUMBER, "shading_diff", "Diffuse shading loss", "%", "", "Shading", "?", "", "" },


/* advanced parameters */
{ SSC_INPUT, SSC_NUMBER, "enable_user_poa", "Enable user-defined POA irradiance input", "0/1", "", "PVWatts", "?=0", "BOOLEAN", "" },
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions ssc/cmod_pvwattsv1_poa.cpp → code_attic/cmod_pvwattsv1_poa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static var_info _cm_vtab_pvwatts[] = {

/* VARTYPE DATATYPE NAME LABEL UNITS META GROUP REQUIRED_IF CONSTRAINTS UI_HINTS*/
{ SSC_INPUT, SSC_ARRAY, "beam", "Direct normal radiation", "W/m2", "", "Weather", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_beam", "Incident direct normal radiation","W/m2", "", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_skydiff", "Incident sky diffuse radiation", "W/m2", "", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_gnddiff", "Incident ground diffuse irradiance","W/m2","", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "tdry", "Dry bulb temperature", "'C", "", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "wspd", "Wind speed", "m/s", "", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "incidence", "Incidence angle to surface", "deg", "", "Weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "beam", "Direct normal radiation", "W/m2", "", "weather", "*", "", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_beam", "Incident direct normal radiation","W/m2", "", "weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_skydiff", "Incident sky diffuse radiation", "W/m2", "", "weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "poa_gnddiff", "Incident ground diffuse irradiance","W/m2","", "weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "tdry", "Dry bulb temperature", "'C", "", "weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "wspd", "Wind speed", "m/s", "", "weather", "*", "LENGTH_EQUAL=beam", "" },
{ SSC_INPUT, SSC_ARRAY, "incidence", "Incidence angle to surface", "deg", "", "weather", "*", "LENGTH_EQUAL=beam", "" },

{ SSC_INPUT, SSC_NUMBER, "step", "Time step of input data", "sec", "", "PVWatts", "?=3600", "POSITIVE", "" },
{ SSC_INPUT, SSC_NUMBER, "system_size", "Nameplate capacity", "kW", "", "PVWatts", "*", "MIN=0.5,MAX=100000", "" },
Expand Down
3 changes: 3 additions & 0 deletions nlopt/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
# include <windows.h>
#endif

// header needed to build on MacOS "Call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations" compile error
int gettimeofday(struct timeval * __restrict, void * __restrict);

/* return time in seconds since some arbitrary point in the past */
double nlopt_seconds(void)
{
Expand Down
30 changes: 30 additions & 0 deletions samples/PTES_lk/ptes_design_point.lk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Inputs
var( 'N_panels', 20 );

// Run PTES
run("ptes_design_point");

// Collect Outputs
num_pts = var('N_pts_charge');
temp_series_charge = var('temp_series_charge');
s_series_charge = var('s_series_charge');

num_pts_discharge = var('N_pts_discharge');
temp_series_discharge = var('temp_series_discharge');
s_series_discharge = var('s_series_discharge');

// Plot
newplot();
plot(s_series_charge, temp_series_charge);
axis('x1', {'label'='Entropy (kJ/kg K)'});
axis('y1', {'label'='Temperature (C)'});
plotopt({'title'='PTES T-s Charge Diagram'});

newplot();
plot(s_series_discharge, temp_series_discharge);
axis('x1', {'label'='Entropy (kJ/kg K)'});
axis('y1', {'label'='Temperature (C)'});
plotopt({'title'='PTES T-s Disharge Diagram'});


outln('Finished');

0 comments on commit 9d76d0c

Please sign in to comment.