-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding solar controller and replacing AMR-Wind standin with FLORIS standin in example 07 #104
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
31705ee
created dummy example for amr wind dummy + solar
brookeslawski 471cb76
final commit before creating feature branch
brookeslawski dead7ce
standalone solar pysam example
brookeslawski 97f0a60
working standalone example of solar pysam model
brookeslawski 79f16e6
removed time as explicit input in step
brookeslawski 58ec136
working example of solar pysam and hercules (but pysam has a bug)
brookeslawski 0957591
changing hardcoded stoptime of 100 s to 1000 s to demo solar module
brookeslawski 19299db
cleaning before pull request review of misha's changes
brookeslawski 14c4e38
working solar pysam example with test amr wind
brookeslawski 46e161e
adding updated results in jupyter notebook
brookeslawski cc4ee8c
merging NREL/develop into local branch
brookeslawski 466bbd3
trying to run after git pull of develop
brookeslawski 95618db
solar model runs successfully, but there is a time issue
brookeslawski 1c94d37
correcting irradiance field and removing unnecessary comments
brookeslawski 36e105a
removing unnecessary files
brookeslawski 44a7c6e
removing test amr wind and solar example, saving for separate PR
brookeslawski bc67bcf
adding environment yaml file needed for pysam
brookeslawski 4e43583
updating setup and docs to include pysam and restrict python version
brookeslawski 41e5a47
adding missing csv weather file
brookeslawski 1b07044
Minor changes for running the code
genevievestarke c4289bb
Minor cleanup in example.
misi9170 f8f76c0
remove environment.yml
genevievestarke a2d73ce
Merge in Misha's changes
genevievestarke 68ab725
merging NREL/hercules:develop into local branch
brookeslawski c575011
Merge branch 'solar-pysam' of github.com:brookeslawski/hercules into …
brookeslawski 0be7f2a
adding solar module unit tests
brookeslawski 74acc0a
adding relative path for pytest functionality
brookeslawski 1e38644
correcting ruff formatting and except
brookeslawski 724112c
more ruff formatting
brookeslawski ad52112
Merge branch 'develop' of github.com:NREL/hercules into solar-pysam
brookeslawski 3f8ff21
adding skeleton files for solar pv
brookeslawski 22a0051
adding solar pysam description
brookeslawski 83c84bf
removing documentation changes, saving for a separate PR
brookeslawski 829fd49
removing documentation changes, saving for a separate PR
brookeslawski c9b6b38
removing documentation changes, saving for a separate PR
brookeslawski 6c546a2
adding comments to the tests
brookeslawski 6095ba3
fix comments for PV
brookeslawski 1ad79a7
adding documentation, moving lat long to input file, correcting irrad…
brookeslawski 5fde32a
doc updates, code clean up
brookeslawski 5e905d5
docs updates
brookeslawski d2ab941
fixing merge conflicts
brookeslawski a914853
minor cleanup
brookeslawski 5fba773
merging develop branch into local feature branch
brookeslawski f819252
ruff formatting and minor cleanup
brookeslawski b7adac6
saving files before switching branches
brookeslawski 9d37846
adding default inputs - not working yet
brookeslawski 9731d41
merging upstream develop into local branch
brookeslawski 6c07727
calc max power for controls feedback optimization
brookeslawski a2666da
cleaning up code
brookeslawski 2a62a40
more code cleanup
brookeslawski b11abf8
refactored to remove nested for loop, but no speed up
brookeslawski 7542eba
fixing github vis
brookeslawski f05b8bc
starting setpoints feature, not working yet
brookeslawski e097b4b
Merge branch 'develop' of github.com:NREL/hercules into solar-pysam
brookeslawski 1d86e56
working initial pv plant controller
brookeslawski 13f1c53
first attempt at feeding in setpoints via external_data_file
brookeslawski 6acadc3
replacing amr wind standin with floris standin due to error in amrwind
brookeslawski 34c972a
trying to run without external_data_file but getting zeros and floris…
brookeslawski 5ab9a6a
Merge branch 'develop' of github.com:NREL/hercules into solar-pysam
brookeslawski a6ed26b
hercules is hanging
brookeslawski ae47268
working version of floris and solar example
brookeslawski 20c5f25
working but messy version of solar controller
brookeslawski b45ae28
adding the external data file
brookeslawski 1d4660c
cleaning up emulator.py
brookeslawski e4e2dc3
cleaning up emulator.py
brookeslawski 8cbecb9
working floris stand in and pv plant controller
brookeslawski 42ebbd7
cleanup
brookeslawski d6e4616
Ruff compatibility.
misi9170 2dc720f
cleaning up files
brookeslawski e50904e
Merge branch 'solar-pysam' of github.com:brookeslawski/hercules into …
brookeslawski d8aa1f2
fixing errors in tests
brookeslawski 908ca7a
fixing standalone example
brookeslawski 43895cc
ruff changes
brookeslawski b018ada
removing amr_wind standin run script
brookeslawski 757490d
adding external_data_file solar_power_reference.csv
brookeslawski 67cbc22
clarifing controller input in README and fixing dc_power_mw error in …
brookeslawski 10f36fa
Handling for when power_setpoints not available.
misi9170 67e6f94
Remove & on second call so that script terminates as expected.
misi9170 6f9bed1
Updating units for results plots
genevievestarke 1972e79
Make ruff compliant
genevievestarke b739314
Make ruff compliant 2
genevievestarke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
example_case_folders/07_amr_wind_standin_and_solar_pysam/README.md
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
example_case_folders/07_amr_wind_standin_and_solar_pysam/hercules_runscript_amr_standin.py
This file was deleted.
Oops, something went wrong.
512 changes: 0 additions & 512 deletions
512
example_case_folders/07_amr_wind_standin_and_solar_pysam/test_read_output.ipynb
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions
30
example_case_folders/07_floris_standin_and_solar_pysam/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Example 07: FLORIS Standin and Solar PySAM | ||
|
||
## Description | ||
|
||
This example demonstrates how to use the FLORIS Standin and a solar model using pysam. | ||
|
||
## Running | ||
|
||
To run the example, execute the following command in the terminal: | ||
|
||
```bash | ||
bash batch_script.sh | ||
``` | ||
|
||
|
||
To run `hercules` using the PV plant controller, which provides power setpoints and adjusts the PV power output accordingly, ensure the following line is uncommented in `batch_script.sh`: | ||
|
||
``` | ||
python3 hercules_runscript.py hercules_controller_input_000.yaml >> outputs/loghercules.log 2>&1 & | ||
``` | ||
|
||
To run `hercules` without the PV plant controller, ensure the folling line is uncommented `batch_script.sh`: | ||
|
||
``` | ||
python3 hercules_runscript.py hercules_input_000.yaml >> outputs/loghercules.log 2>&1 & | ||
``` | ||
|
||
## Notes | ||
|
||
Make sure hercules conda or venv is activated before running the example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
example_case_folders/07_floris_standin_and_solar_pysam/floris_runscript.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import sys | ||
|
||
from hercules.floris_standin import launch_floris | ||
|
||
# Check that one command line argument was given | ||
if len(sys.argv) != 2: | ||
raise Exception("Usage: python floris_runscript.py <amr_input_file>") | ||
|
||
# # Get the first command line argument | ||
# This is the name of the file to read | ||
amr_input_file = sys.argv[1] | ||
print(f"Running FLORIS standin with input file: {amr_input_file}") | ||
|
||
|
||
launch_floris(amr_input_file) |
63 changes: 63 additions & 0 deletions
63
example_case_folders/07_floris_standin_and_solar_pysam/hercules_controller_input_000.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Input YAML for emy_python | ||
|
||
# Name | ||
name: example_000 | ||
|
||
### | ||
# Describe this emulator setup | ||
description: Floris and Solar PV | ||
|
||
dt: 0.5 | ||
|
||
hercules_comms: | ||
|
||
amr_wind: | ||
|
||
wind_farm_0: | ||
type: amr_wind_local #options are amr_wind or amr_wind_local | ||
amr_wind_input_file: amr_input.inp | ||
|
||
helics: | ||
|
||
config: | ||
name: hercules # What is the purpose of this name | ||
use_dash_frontend: False | ||
KAFKA: False | ||
KAFKA_topics: EMUV1py | ||
helics: | ||
# deltat: 1 # This will be assigned in software | ||
subscription_topics: [status] | ||
publication_topics: [control] | ||
endpoints: [] | ||
helicsport: 32000 | ||
publication_interval: 1 | ||
endpoint_interval: 1 | ||
starttime: 0 | ||
stoptime: 100 # must be at least 2*dt smaller than last timestep in weather file | ||
Agent: ControlCenter | ||
|
||
py_sims: | ||
|
||
solar_farm_0: # The name of py_sim object 1 | ||
|
||
py_sim_type: SolarPySAM | ||
weather_file_name: NonAnnualSimulation-sample_data-interpolated-daytime.csv | ||
system_info_file_name: 100MW_1axis_pvsamv1.json | ||
lat: 39.7442 | ||
lon: -105.1778 | ||
elev: 1829 | ||
|
||
# capacity: 100 # MW | ||
|
||
initial_conditions: | ||
|
||
power: 25 # MW | ||
dni: 1000 | ||
|
||
controller: | ||
|
||
external_data_file: solar_power_reference.csv | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is missing from the repo, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!