Skip to content

Commit

Permalink
Standardize Examples (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulf81 authored Dec 5, 2024
1 parent 879385c commit df73086
Show file tree
Hide file tree
Showing 146 changed files with 43,289 additions and 198,456 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/check-working-examples.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/deploy-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ jobs:
- name: Make copies of example docs
run: |
mkdir -vp docs/examples
cp -v example_case_folders/05_floris_wind_standin_and_electrolyzer/README.md docs/examples/05_floris_wind_standin_and_electrolyzer.md
cp -v example_case_folders/05_floris_standin_and_electrolyzer/README.md docs/examples/05_floris_standin_and_electrolyzer.md
cp -v example_case_folders/06_amr_wind_standin_and_battery/README.md docs/examples/06_amr_wind_standin_and_battery.md
cp -v example_case_folders/07_floris_standin_and_solar_pysam/README.md docs/examples/07_floris_standin_and_solar_pysam.md
cp -v example_case_folders/08_floris_only/README.md docs/examples/08_floris_only.md
cp -v example_case_folders/09_amr_wind_openfast/README.md docs/examples/09_amr_wind_openfast.md
cp -v example_case_folders/08_floris_standin_only/README.md docs/examples/08_floris_standin_only.md
cp -v example_case_folders/09_heterogeneous_wind/README.md docs/examples/09_heterogeneous_wind.md
ls -l docs/examples
# Build the book
Expand Down
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ hercules/local_amr_wind_demo/sample_copy.nc
#Ignore csv files
*.csv
!tests/test_inputs/*.csv
!example_case_folders/10_heterogeneous_wind/floris_standin_data.csv
!example_case_folders/10_heterogeneous_wind/wind_power_reference_data.csv
!example_case_folders/10_heterogeneous_wind/inputs/floris_standin_data.csv
!example_case_folders/10_heterogeneous_wind/inputs/wind_power_reference_data.csv
!example_case_folders/07_floris_standin_and_solar_pysam/inputs/Flatirons_solar_data_precursor-tztest.csv
!example_case_folders/07_floris_standin_and_solar_pysam/inputs/Flatirons_solar_data_highDNI.csv

# Some output files to ignore
t_00*
Expand All @@ -49,3 +51,7 @@ logfloris*
*out-example.json

.vscode/*

# Doc builds
docs/_build
docs/examples
8 changes: 3 additions & 5 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ parts:
- caption: Examples
chapters:
- file: examples_overview
- file: examples/05_floris_wind_standin_and_electrolyzer
- file: examples/05_floris_standin_and_electrolyzer
- file: examples/06_amr_wind_standin_and_battery
- file: examples/07_floris_standin_and_solar_pysam
- file: examples/08_floris_only
- file: examples/09_amr_wind_openfast


- file: examples/08_floris_standin_only
- file: examples/09_heterogeneous_wind



Expand Down
23 changes: 23 additions & 0 deletions example_case_folders/01_amr_wind_only/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Example: AMR Wind Only

## Description

This first example runs AMR Wind, using Hercules, but without any additional generation simulated.

Most examples will have the pattern of having an sbatch_script.sh file which calls a run_script.sh file. The paradigm is that the run_script.sh can be run on a local machine, while the sbatch_script.sh is used to submit the job to a cluster. However, in this case since AMR-Wind can only be run on a cluster, the sbatch_script.sh is the only script provided.

## Running

To run the example, execute the following command in the terminal:

```bash
sbatch sbatch_script.sh
```
## Outputs

To plot the outputs run the following command in the terminal:

```bash
python plot_outputs.py
```

33 changes: 0 additions & 33 deletions example_case_folders/01_amr_wind_only/batch_script.sh

This file was deleted.

2 changes: 0 additions & 2 deletions example_case_folders/01_amr_wind_only/readme.txt

This file was deleted.

28 changes: 28 additions & 0 deletions example_case_folders/01_amr_wind_only/sbatch_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#SBATCH --job-name=hercules
#SBATCH --time=1:00:00
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=36
#SBATCH --account=ssc
# #SBATCH --qos=high # Uncomment for higher prioirty

# A lot of modules and conda stuff
# source /nopt/nrel/apps/anaconda/5.3/etc/profile.d/conda.sh
# module use /not/nrel/apps/modules/default/modulefiles
module purge
module load conda
# export PREFIX=~/.conda-envs/hercules
# export PATH=$PREFIX/bin:$PATH
# export FI_PROVIDER_PATH=$PREFIX/lib/libfabric/prov
# export LD_LIBRARY_PATH=$PREFIX/lib/libfabric:$PREFIX/lib/release_mt:$LD_LIBRARY_PATH
conda activate hercules
module load helics/3.4.0-gcc10.1.0-open-mpi
module load netcdf-c/4.9.2-openmpi-gcc

export HELICS_PORT=32000

# Set up the helics broker
helics_broker -t zmq -f 2 --loglevel="debug" --local_port=$HELICS_PORT &
python hercules_runscript.py hercules_input_000.yaml >> loghercules 2>&1 & # Start the controller center and pass in input file
mpirun -n 72 /home/pfleming/amr-wind/build/amr_wind amr_input.inp >> logamr 2>&1

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ helics_broker -t zmq -f 2 --loglevel="debug" --local_port=$HELICS_PORT &

# Need to set this to your hercules folder
# cd /home/pfleming/hercules/hercules
python3 hercules_runscript.py hercules_input_000.yaml >> loghercules 2>&1 & # Start the controller center and pass in input file
python hercules_runscript.py hercules_input_000.yaml >> loghercules 2>&1 & # Start the controller center and pass in input file

# Now go back to scratch folder and launch the job
# cd /scratch/pfleming/c2c/example_sim_02
Expand Down
181 changes: 0 additions & 181 deletions example_case_folders/02_amr_wind_standin_only/amr_input.inp

This file was deleted.

Loading

0 comments on commit df73086

Please sign in to comment.