Skip to content

Commit

Permalink
Merge pull request #1267 from NREL/develop
Browse files Browse the repository at this point in the history
Develop to main for 2024.12.12
  • Loading branch information
brtietz authored Dec 13, 2024
2 parents 9d76d0c + ee3823e commit 5c8c654
Show file tree
Hide file tree
Showing 600 changed files with 381,131 additions and 123,685 deletions.
13 changes: 9 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@

doc/* linguist-documentation=true
doc/** linguist-documentation=true
tcsdata/docs/* linguist-documentation=true


*.c linguist-vendored
lpsolve/* linguist-vendored=true
nlopt/* linguist-vendored=true
examples/* linguist-vendored=true
lpsolve/** linguist-vendored=true
nlopt/** linguist-vendored=true
samples/** linguist-vendored=true
test/input_docs/** linguist-vendored=true
splinter/** linguist-vendored=true
rapidjson/** linguist-vendored=true

build_*/* linguist_generated=true

Expand All @@ -24,6 +28,7 @@ build_*/* linguist_generated=true
*.h text
*.csv text
*.lk text
*.json text

# Ensure those won't be messed up with
*.jpg binary
Expand Down
129 changes: 116 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
GTEST_REF: b85864c64758dec007208e56af933fc3f52044ee

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

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
Expand All @@ -27,14 +28,23 @@ jobs:
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
- name: Get cached GTest
uses: actions/cache@v4
id: cachedgtest
with:
path: ${{env.GTEST}}/
key: gtest-ubuntu

- name: Clone Gtest
uses: actions/checkout@v2
if: steps.cachedgtest.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
ref: b85864c64758dec007208e56af933fc3f52044ee
ref: ${{env.GTEST_REF}}

- name: build Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
run: |
export
mkdir ${GTEST}/build
Expand All @@ -43,7 +53,7 @@ jobs:
make
- name: Checkout SSC
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ssc

Expand All @@ -68,19 +78,22 @@ jobs:
${SSCDIR}/build/test/Test
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SSC Linux Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.so
${{env.SSCDIR}}/build/ssc/ssc.so
build-on-mac:
runs-on: macos-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14-large, macos-latest]

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
Expand All @@ -93,14 +106,22 @@ jobs:
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
- name: Get cached GTest
uses: actions/cache@v4
id: cachedgtest
with:
path: ${{env.GTEST}}/
key: gtest-${{ matrix.os }}
- name: Clone Gtest
uses: actions/checkout@v2
if: steps.cachedgtest.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
ref: b85864c64758dec007208e56af933fc3f52044ee
ref: ${{env.GTEST_REF}}

- name: build Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
run: |
export
mkdir ${GTEST}/build
Expand All @@ -109,7 +130,7 @@ jobs:
make
- name: Checkout SSC
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ssc

Expand All @@ -124,7 +145,7 @@ jobs:
# Build your program with the given configuration
run: |
cd ${SSCDIR}/build
make -j4
make -j3
- name: Test
# Turn off fast fail for when the landbosse tests write to cerr
Expand All @@ -134,10 +155,92 @@ jobs:
shell: bash

- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: SSC Mac Shared Libraries
name: SSC Mac Arm Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.dylib
${{env.SSCDIR}}/build/ssc/ssc.dylib
- name: Upload Artifacts
if: ${{ matrix.os != 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: SSC Mac Intel Shared Libraries
path: |
${{env.SSCDIR}}/build/ssc/libssc.dylib
${{env.SSCDIR}}/build/ssc/ssc.dylib
build-on-windows:
runs-on: windows-2019

steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Test cmake version
run: cmake --version

- name: Set relative paths
shell: bash
run: |
GTEST=$GITHUB_WORKSPACE/googletest
echo "GTEST=$GTEST" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
- name: Get cached GTest
uses: actions/cache@v4
id: cachedgtest
with:
path: ${{env.GTEST}}/
key: gtest-windows

- name: Clone Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
ref: ${{env.GTEST_REF}}

- name: build Gtest
if: steps.cachedgtest.outputs.cache-hit != 'true'
shell: bash
run: |
export
mkdir ${GTEST}/build
cd ${GTEST}/build
cmake -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release -j4
- name: Checkout SSC
uses: actions/checkout@v4
with:
path: ssc

- name: Configure CMake
shell: bash
# Configure cmake to build ssc tests but not tools
run: |
mkdir ${SSCDIR}/build
cd ${SSCDIR}/build
cmake .. -DSAM_SKIP_TOOLS=1 -DCMAKE_CONFIGURATION_TYPES="Release"
cmake --build . --config Release -j4
cp ssc/Release/* test/Release
- name: Test
shell: bash
# Turn off fast fail for when the landbosse tests write to cerr
run: |
cd ${SSCDIR}/build/test/Release
./Test.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: SSC Windows Shared Libraries
path: |
${{env.SSCDIR}}\build\ssc\Release\ssc.dll
15 changes: 5 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,14 @@ option(SAMAPI_EXPORT "Export of ssc binaries to the SAM_api directory; for Unix,
#

if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
set(CMAKE_OSX_DEPLOYMENT_TARGET "12" CACHE STRING "Minimum OS X deployment version")
endif()

if (UNIX AND NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
endif()
set(CMAKE_CXX_STANDARD 11)

if ( NOT APPLE)
set(CURL_DIR build_resources/libcurl_ssl_x64)
endif()

Project(sam_simulation_core VERSION 1.0.0)
Project(sam_simulation_core VERSION 1.0.0 LANGUAGES CXX C)


#####################################################################################################################
Expand Down Expand Up @@ -82,14 +76,15 @@ function(set_default_compile_options target)
set(MAIN_CFLAGS "")
endif()
set(MAIN_CFLAGS "${MAIN_CFLAGS} -D__64BIT__")
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
if(MSVC)
set(MAIN_CFLAGS "${MAIN_CFLAGS} /bigobj /MP")
set(MAIN_CFLAGS "${MAIN_CFLAGS} /D__WINDOWS__ /D_WINDOWS /D_CRT_SECURE_NO_WARNINGS /DLPWINAPP")
foreach (flag_var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG)
set(${flag_var} "${${flag_var}} /D_DEBUG" CACHE STRING "compile flags" FORCE)
endforeach()
else(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if (APPLE)
set(MAIN_CFLAGS "${MAIN_CFLAGS} -fno-common -DWX_PRECOMP -D__MACOSX__")
else()
Expand All @@ -102,7 +97,7 @@ function(set_default_compile_options target)
endif()
endif()
if (SAMAPI_EXPORT AND APPLE)
SET(MAIN_CFLAGS "${MAIN_CFLAGS} -mmacosx-version-min=10.15" )
SET(MAIN_CFLAGS "${MAIN_CFLAGS} -mmacosx-version-min=12" )
endif()
set_target_properties(${target} PROPERTIES COMPILE_FLAGS ${MAIN_CFLAGS})
endfunction()
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# SSC (SAM Simulation Core)
![Build](https://github.com/NREL/ssc/actions/workflows/ci.yml/badge.svg)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FNREL%2Fssc.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FNREL%2Fssc?ref=badge_shield)

The SSC Open Source Project repository contains the source code for the technology and financial models contained within the National Renewable Energy Laboratory's System Advisor Model (SAM). For more details about SAM's capabilities, see the SAM website at [https://sam.nrel.gov/](https://sam.nrel.gov).
The SSC Open Source Project repository contains the source code for the technology and financial models contained within the National Renewable Energy Laboratory's System Advisor Model (SAM). For more details about SAM's capabilities, see the SAM website at [https://sam.nrel.gov/](https://sam.nrel.gov).

You could think of SSC as the home for the algorithms behind the SAM desktop program. Most people run the code through the desktop user interface, but SSC can also be run directly using the [SAM Sofware Develoment Kit](https://sam.nrel.gov/sdk).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ class cm_trough_physical_csp_solver : public compute_module
as_double("W_pb_design") / as_double("eta_ref"), //[MWt]
as_double("solar_mult"), //[-]
0.0, //[MWht]
true, //Use fixed tank height
as_double("h_tank"), //[m]
0.0, // No input diameter (it is calculated)
as_double("u_tank"), //[W/m^2-K]
as_integer("tank_pairs"), //[-]
as_double("hot_tank_Thtr"), //[C]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,9 @@ class cm_trough_physical_process_heat : public compute_module
c_heat_sink.ms_params.m_q_dot_des / 1.0, //[MWt]
as_double("solar_mult"), //[-]
c_heat_sink.ms_params.m_q_dot_des / 1.0 * as_double("tshours"), //[hr]
true,
as_double("h_tank"), //[m]
0.0,
as_double("u_tank"), //[W/m^2-K]
as_integer("tank_pairs"), //[-]
as_double("hot_tank_Thtr"), //[C]
Expand Down
Loading

0 comments on commit 5c8c654

Please sign in to comment.