Skip to content
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

Stand-in AMR-wind uses stop time defined in amr_input.inp #47

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

misi9170
Copy link
Collaborator

@brookeslawski raised the issue that the stop time is hardcoded in launch_dummy_amr_wind() (in dummy_amr_wind.py). As we are reading in other information from the amr_input file, this change also reads in the stop time and uses that.

Additionally, the while loop in DummyAMRWind.run() now uses sim_time_s as its counter to meet the stopping condition, rather than absolute_helics_time, because absolute_helics_time is counting twice as fast as sim_time_s and therefore ends the simulation at (approximately) half the intended runtime. This is likely related to #42 .

Ready for review and merge.

@misi9170 misi9170 added the enhancement New feature or request label Dec 13, 2023
@misi9170 misi9170 added this to the v1.0 milestone Dec 14, 2023
@misi9170
Copy link
Collaborator Author

misi9170 commented Dec 14, 2023

This PR will likely have merge conflicts once #48 is merged---I'll merge develop back once #48 is in.

Copy link
Collaborator

@brookeslawski brookeslawski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reviewing the changes, I checked out this branch locally and ran the code successfully. It all looks good to me!

@brookeslawski brookeslawski merged commit 7cd276d into NREL:develop Dec 14, 2023
3 checks passed
genevievestarke added a commit that referenced this pull request Dec 20, 2023
* Updating controller to align with WHOC (#41)

* Skeleton for a turbine yaw simulator.

* Implementation mostly in place.

* Simple yaw controller running on dummy. Need to make back compatible.

* Handling case where no yaw simulator specified (or specified as none)

* Removing input_dict.echo from git repo. Can indo if needed.

* Removing previous, more realistic implementation that has not yet been fleshed out.

* Clean up commit.

* Running, but seems theres a timing issue.

* Small updates to installation procedure; also updated intstuctions for running locally.;

* Updates to allow example_06 to run

* Renaming dummy example for clarity.

* Reverting; plan to use one directory only, if possible.

* Runs on eagle and local.

* Revert, take 2.

* Removing old yaw simulator from pysims.

* Removing temporary examples.

* Starting renaming to hercules.

* More name updates.

* Cleaning up, renaming more.

* AMR wind version now runs.

* Removing controller.py in favor of controllers/controller_base.py

* Switching helicsport (not sure if needed?)

* Updates to read in time step.

* Reorganizing emulator somewhat to allow clearer execution of main loop and swap send and receive to AMRwind. Removes KAFKA pieces (were not being used?)

* Commiting to change branch.

* Removing unneded controllers in favor of whoc.

* Emulator controller set up as desired; still tbd where time should come from

* Adding back a pass-through controller in case WHOC not available.

* Replacing controllers/control_base with controller_standin.

* Adding comment about time issue.

* Reinstating nominal yaw control in pass-through.

* Add comments to explain temporary AD connection.

* Copying in old controller code for possible later use.

* Aligning with develop branch.

* Add KAFKA code back in, commented out, in case needed later.

* Changing helicsport to sidestep bug with not connecting on correct port.

* put sim_tim_s_amr_wind in emulator main_dict in init

* Change back to 32000.

---------

Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Zachary <ztully@nrel.gov>

* Update to public seas (#39) (#43)

* update ci to install seas

* Update install docs

* Add a test of seas and convert to pytest

Co-authored-by: paulf81 <paul.fleming@nrel.gov>

* Feature/battery example (#30)

* Skeleton for a turbine yaw simulator.

* Implementation mostly in place.

* Simple yaw controller running on dummy. Need to make back compatible.

* Handling case where no yaw simulator specified (or specified as none)

* Removing input_dict.echo from git repo. Can indo if needed.

* Removing previous, more realistic implementation that has not yet been fleshed out.

* Clean up commit.

* Running, but seems theres a timing issue.

* Small updates to installation procedure; also updated intstuctions for running locally.;

* Updates to allow example_06 to run

* Renaming dummy example for clarity.

* Reverting; plan to use one directory only, if possible.

* Runs on eagle and local.

* Revert, take 2.

* Removing old yaw simulator from pysims.

* Removing temporary examples.

* Starting renaming to hercules.

* More name updates.

* Cleaning up, renaming more.

* AMR wind version now runs.

* Removing controller.py in favor of controllers/controller_base.py

* Switching helicsport (not sure if needed?)

* Updates to read in time step.

* Reorganizing emulator somewhat to allow clearer execution of main loop and swap send and receive to AMRwind. Removes KAFKA pieces (were not being used?)

* save commit

* zct battery model

* battery example first commit

* Copy over battery example

* git ignore vscode settings

* remove vscode settings

* clean up controller and comments

* small change in high-level controller organization

* generate_amr_standin_data can read amr-wind actuator outputs and moved to tools

* delete unneeded comments

* update battery example branch to match NREL/develop

* Commiting to change branch.

* Removing unneded controllers in favor of whoc.

* Emulator controller set up as desired; still tbd where time should come from

* Adding back a pass-through controller in case WHOC not available.

* Replacing controllers/control_base with controller_standin.

* Adding comment about time issue.

* Reinstating nominal yaw control in pass-through.

* small change in batch script

* save before merging emulator from Misha's branch

* whoc battery controller

* troubleshooting WHOC format battery controller

* delete obsolete control_methods folder

* delete duplicate lines

* delete unused controller import

* add exmple 06 readme file for amr standin data instructions

* fix example 06 jupyter notebook

---------

Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: misha <misi9170@colorado.edu>
Co-authored-by: Zachary <ztully@nrel.gov>

* Stand-in AMR-wind uses stop time defined in amr_input.inp (#47)

* Set stand-in stop time from amr_input file.

* Controlling amr standin stop time via endtime rather than absolute_helics_time.

* Setting stop_time to 100.0 to mimic earlier behavior.

* Updating stop times in other dummy amr_input files.

---------

Co-authored-by: misi9170 <msinner@nrel.gov>

* Improved PV solar model (#58)

* created dummy example for amr wind dummy + solar

* final commit before creating feature branch

* standalone solar pysam example

* working standalone example of solar pysam model

* removed time as explicit input in step

* working example of solar pysam and hercules (but pysam has a bug)

* changing hardcoded stoptime of 100 s to 1000 s to demo solar module

* cleaning before pull request review of misha's changes

* working solar pysam example with test amr wind

* adding updated results in jupyter notebook

* trying to run after git pull of develop

* solar model runs successfully, but there is a time issue

* correcting irradiance field and removing unnecessary comments

* removing unnecessary files

* removing test amr wind and solar example, saving for separate PR

* adding environment yaml file needed for pysam

* updating setup and docs to include pysam and restrict python version

* adding missing csv weather file

* Minor changes for running the code

* Minor cleanup in example.

* remove environment.yml

---------

Co-authored-by: Genevieve Starke <Genevieve.Starke@nrel.gov>
Co-authored-by: misi9170 <michael.sinner@nrel.gov>

* Fix documentation download command

* Feature/rename dummyamr (#48)

* Renaming AMR dummy to AMR standin

* Delete previous example 02

* Ignoring logstandin.

* A few extra references in text.

* Renaming solar updates.

---------

Co-authored-by: misi9170 <msinner@nrel.gov>

* Add WHOC installation instructions to Hercules documentation (#59)

* Add WHOC installation instructions to Hercules documentation

* Add note about develop branch on WHOC

* Fix cd command

* Add ruff and pre-commit files (#46)

* Feature/add ruff (#60)

* Ruff changes and updates to CI

* Ruff reformatting changes

* py_sims_test update

* Final ruff edits to files

---------

Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: misi9170 <39596329+misi9170@users.noreply.github.com>
Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Zachary <ztully@nrel.gov>
Co-authored-by: Zachary Tully <107644545+ZackTully@users.noreply.github.com>
Co-authored-by: misha <misi9170@colorado.edu>
Co-authored-by: Brooke Stanislawski <34248707+brookeslawski@users.noreply.github.com>
Co-authored-by: misi9170 <michael.sinner@nrel.gov>
@misi9170 misi9170 deleted the enhancement/amr-standin-stoptime branch January 3, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants