Skip to content

Commit

Permalink
Update main (#104)
Browse files Browse the repository at this point in the history
* minor change to warning text

* shift gauss cyld by RD

* fixed cyld, converted point to expression

* fixed jit problem

* added sharpness param to point blockage

* fixed u_k update for constraints

* fixed taylor test convergence

* Added check_totals option

* fixed constraint derivatives, and taylor test inputs

* ALM DEL method

* default params

* updating yaml params

* moving example to demo folder

* renaming example folder

* starting on acuator disks

* fixed inflow angle bug

* made the multiangle solver more robust

* fixing what the fix broke

* yep

* Added fatpack to the install script

* added pandas

* got dolfin actuator disks working

* gotta fix a form_compiler issue, but it seems all good up to the gradient

* got numpy disks working

* added stop_annotation to the debug, and changed how boundary HH velocity calculated

* updated some demos/test, fixed objectives

* initial commit to compare to refactored ALM output to dev

* test push upstream

* minor cleaning after verifying results match

* adding power calc and more cleanup

* getting ready for optimization test

* adding test file for collaborating on optimization

* storing before opt testing original branch

* pushing latest mpi_u_fluid deriv testing

* adding latest test updates

* cleaning up ALM block tests

* syncing print statements for jeff

* refactored imported wind farms

* added empty farm, updated demos/test/docs

* fixed alm adjoint bug, got all test running

* moved test_alm_refactor.yaml to other folder so it doesn't get picked up by pytest

* fixing conflicts before factoring out trans/rots

* wrap values e.g. self.mz as float to avoid jit error

* factoring translation/rotation out of u-fluid and alm

* consistent var names prev vs behind

* fix alm gradients

* take two

* fixing merge conflicts

* fixing mz dijitso error

* added missing input file"

* added verbose to pytest

* added some debug printing

* moar debug

* arg

* arg2

* trying to project tf first

* maybe with stop_annotating'

* quick test of new environment

* adding conda list to the enviroment build

* check if it's the Quadrature space

* now check if it's dolfin adjoint

* updated tfsc, coffee, finat versions

* disabling actuator disk block

* use disk instead of numpy disk

* whoops typo

* remove tsfc from dolfin adjoint helper

* revert back to original skew steady

* attempt tmate session

* rename input csv and txt files

* attempt 2

* reduce skew mesh size

* iea15 rwt

* yaml file case 10 iea15 floating

* reduce number of turbines

* removed some print statements

* bug fix, clean up, update truth

* missed an instance of stop_annotating

* reverting install.sh to see if that helps the parallel stall

* trying restricted scipy

* maybe pip install openmdao and pyoptsparse

* nope

* maybe newer scipy

* reordered tests

* revert to scipy 1.7.0

* alphabetizing packages

* touch ALM unsteady

* untouch ALM unsteady

* adding translation function and consolidating calls

* removing merged orphan

* adding test_alm_refactor and inital motion test

* initial commit of saving data along blade

* remove my test case

* fixing parallel bug caused by hmin disagreement

* wobbling turbines don't pass regression tests

* add nrel5mw files

* added commas to blade_data.csv and the converters output

* Delete windse.egg-info directory

* make global hmin calculation a part of domain finalization

* syncing None boundary fixes from eagle

* fix typo

* fixing typo (correctly)

* updating parallel test

* revert to taking a fixed first dt

* temporary test of smaller dt through cfl_target

* changing ALM truth values for smaller timestep size

* make saving along blade data work in parallel

* changing lift-drag interpolator to handle unstructured data

* update truth values to reflect LinearNDInterpolator calculation

* add axial velocity to saved along-blade data

* add option to turn off tip loss model from yaml file

* create a regular grid interpolation if it doesn't exist

* remove print statement

* limit maximum size of interpolation

* added mpi_eval block

* forgot to add files

* adding code for mpi communication of point evaluations

* quick test for dimension agreement

* generate csv from outb files for floating ptfm

* add option for nacelle rad specification and corresponding lookup adjustments

* change nacelle label to hub for clarity

* Update environment.yaml

* Update environment.yaml

* swapping out old mpi_u_fluid building with mpi_eval function

* switch how parallel tests are ran

* modified the actuater line block to account for the new mpi_u_fluid

* fixed alm for multi turbines

* build no longer exists

* pin to different build

* newer build?

* used wildcards to make compatable between osx and linux

* had to recast a list of coeffs

* removed parallel test

* hunting for parallel bug

* needed repr

* run 10 parallel test

* copied the wrong one

* made fprint

* try python call

* switching to python -u driver.py run

* added stream and spanwise periodic bcs and body force

* updated the opt_test

* forgot key files

* fixed inflow_unit_vector for 2d

* allow imported csv to have comments

* got template working

* fixing mangled commit

* adding draft studies

* testing thickness param

* add skeleton of ALM study

* added disk mesh convergence study

* update study text and references

* forgot to add wind_farm.png

* updated truth value now that disks power measured in MWs

* switched requirement to dolfin_adjoint

* Updated tag number

* Updated tag version

* Update alm_validation.rst

* Update disk_mesh_convergence.rst

* updated alm_validation.yaml with eagle settings

* adding a work around for the 60 turbine limit

* fixing truth values to account for returning to approximate gauss vol

* fixed check for periodic bc

* changed snes linesearch

* Dolfinizing the ALM Code (#94)

* updated version number

* fixed inflow_angle bug and power sum bug

* Pin OM version until bug resolved

* initial commmit of notebook code

* renaming, organizing, and adding better comments

* begin merging notebook with windse

* fixing import errors

* adding very rough time stepping and integrating with solver manager

* use old method to pass tests

* placeholder cl cd values for testing

* added ufl_eval, and dolfin_adjoint friendly lookup tables

* got aoa, cl, cd dolfin adjoint friendly

* syncing changes from force verification testing

* added da tester and listified

* restructured vel_fluid, and ufl_eval

* made a tweak to test_dolfin_adjoint()

* added the new blocks

* adding x_0_prev changes

* adding data save of along-blade quantities

* project per turbine tf, add twist as control

* syncing fx, fy, fz lists

* chunking UFL form into per-blade pieces and adding projection solver

* fix scaling of 2x of actuator width

* removing tip_loss debugging hack

* use Constant method only on Constant type

* rename truth key num_actuator_nodes

* add gha print statements

* saving update_turbine_force call from dev branch

* add option to pass a hard-coded objective scaling value from command line

* fixed path to new option and wrap as float

* adding option to force linear interpolation by changing general:name

* syncing from eagle

* added control updater

* added velocity save during df forward solve

* even more print statements

* add option to perturb single chord values for finite differencing

* try except probing of points to avoid parallel fail

* save chord as csv file

* only save from rank 0

* fix typo

* allow option to specify chord explicitly from CSV file

* commented blade projections to fix forward problem

* fixed adjoint mpi

* fixed one mpi bug

* sync with ethan

* switched to gauss kernel based local vel

* added mpi_eval lines as comments in case we need to switch back

* reverse theta to correct spin direction

* switch to gauss_vel_eval and add motion functions

* use vector of zeros to match shape

* moved the platform_theta outside the blade loop

* syncing eagle changes

* fixed problems with steady optimzer and adjusted alm truth to account for hub node missing

* adding mshr back for the time being, we need to make a pr that completely removes it

* sync power calc change for eagle run

* cleaning up power calc

* scale power calc

* loop over all controls vs skipping first one

* twist too

* point to correct save files for unsteady problem

* syncing output dir change for avg quantity

* allow other platform motions specified via input

* fix list comparison typo

* convert degrees to radians

* swap order of translations and rotations for floating

* save from rank 0 and change twist bounds

* add twist_range as option for twist constraint and parse multiple strings from command line

* cleaned up dolfin alm for merge

* attempting to fix mpi hang by doing a dummy refine

* fixed cu_tag in control updater

* unpin openmdao

* fixed Updater Bug and added floating_alm truth

* misnamed file

---------

Co-authored-by: Jeff Allen <[email protected]>
Co-authored-by: John Jasa <[email protected]>
Co-authored-by: jefalon <[email protected]>

* Disk hybrid (#103)

* changed snes linesearch

* create hybrid disks

* added a save file for the velocity profile

* switched back to old def of WTGbase

* added support for blade_segments input

* moved to custom refine first

* hybrid can now import profile from file

* fixed multiturbine and dolfin_line yaw

* switching ci to mac

* adding some more ci cases

* fix truth data

* add input refactoring changes to doc yaml demos

* add jsonschema package to environment.yaml recipe

* update regression tests with new input format

* provide x_range, y_range, z_range as separate inputs for clarity

* validate using yaml schema, set defaults from schema, refactor custom refine

* make inputs to all refinements kwargs for unpacking from dictionary

* add postprocessing functions

* call post processing functions

* the new windse schema file

* the new postprocessingmanager with routines like write_to_floris

* reconcile merge conflict from is custom_refine none test

* add hybrid_disk as a valid option to the yaml scheme

* add a readthedocs file, move conf.py, add new type for vel_height

* modify calls to constraint when keys are integers

* extract constraint and objective name when keys are ints

* allow non integer keys for non repeated refinements, sort only when necessary

* separate out objective name when key is int

* rename 'type' to 'orientation' to avoid problems with type being cyld_kernel

* move conf back to source

* change path to configuration file

* Update sphinx_requirements.txt to <7.0

* Update sphinx_requirements.txt

* Update environment.yaml to sphinx <7.0.0

* fake the subdomain class to avoid a doc build error

* add pre_build option to yaml, change index to point to new rst file

* add the script to scrape the schema to build params.rst

* add note about paths to rst generating script

* remove reference to old params file

* edit title of parameters.rst

* add units to numeric params

* change nesting formatting, include units where possible

* many changes to schema descriptions, add enum items where possible

* enumerate options for functionspace, problem, and solver

* add units to turb_id, capitalize Newton

* add top level descriptions

* refactored old param file

* cleaned up addtiional parameter notes, added table references

* returned the index to maxdepth 1

* use integer vs number type in schema for integer inputs

* rename write_floris option to write_floris_input

* forgot to rename regression file option

* forgot to delete IntegralPower.py

* Added 2023.07.01 features, bugs and fixed formatting

---------

Co-authored-by: Jeffery M. Allen <[email protected]>
Co-authored-by: John Jasa <[email protected]>
Co-authored-by: Julian Quick <[email protected]>
Co-authored-by: pibo <[email protected]>
Co-authored-by: jefalon <[email protected]>
  • Loading branch information
6 people authored Jul 11, 2023
1 parent 4af71c2 commit bec7100
Show file tree
Hide file tree
Showing 414 changed files with 192,567 additions and 6,266 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ _Put an `x` in the boxes that apply._

- [ ] I have run existing tests which pass locally with my changes
- [ ] I have added new tests or examples that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation
- [ ] I have verified my code additions work in parallel
- [ ] I have added necessary documentation
34 changes: 25 additions & 9 deletions .github/workflows/CI_every_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on: [pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: CI_every_commit
runs-on: ubuntu-latest
name: CI_every_PR
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -17,33 +17,49 @@ jobs:
miniconda-version: "latest"
channels: conda-forge
auto-update-conda: true
python-version: 3.8
# environment-file: environment.yml
# python-version: 3.8
# environment-file: environment.yml

- name: Install test environment
shell: pwsh # putting in a shell command makes for compile linking problems later
# (if you use the shell here, cannot use 'compiler' package, but mpi only seems to work with it)
run: |
bash ./install.sh test-environment
conda activate test-environment
conda list
- name: Run all documented demos within WindSE
# - name: Run parallel regression tests within WindSE
# shell: pwsh
# run: |
# conda activate test-environment
# pytest -sv --cov=windse tests/test_regression_parallel.py

# - name: Run parallel regression tests within WindSE
# shell: pwsh
# run: |
# conda activate test-environment
# cd tests/9-Regression
# mpirun -n 2 windse run ALM_Unsteady.yaml -p general:name:ALM_Unsteady_np_2

- name: Run parallel regression tests within WindSE
shell: pwsh
run: |
conda activate test-environment
pytest -sv --cov=windse tests/test_demos.py
cd tests/9-Regression
mpirun -n 2 python -u ../../windse_driver/driver.py run ALM_Unsteady.yaml -p general:name:ALM_Unsteady_np_2
# mpirun -n 2 python -u ../../windse_driver/driver.py run Floating_ALM.yaml -p general:name:Floating_ALM_np_2
- name: Run all regression tests within WindSE
shell: pwsh
run: |
conda activate test-environment
pytest -sv --cov=windse --cov-append tests/test_regression.py
- name: Run parallel regression tests within WindSE
- name: Run all documented demos within WindSE
shell: pwsh
run: |
conda activate test-environment
pytest -sv --cov=windse --cov-append tests/test_regression_parallel.py
pytest -sv --cov=windse --cov-append tests/test_demos.py
# Run coveralls
- name: Run coveralls
Expand All @@ -52,4 +68,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
conda activate test-environment
coveralls --service=github
coveralls --service=github
9 changes: 7 additions & 2 deletions .github/workflows/CI_every_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: [push]
jobs:
build:
name: CI_every_commit
runs-on: ubuntu-latest
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -20,19 +20,24 @@ jobs:
python-version: 3.8
# environment-file: environment.yml

# can be used to ssh into the github actions node
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Install test environment
shell: pwsh # putting in a shell command makes for compile linking problems later
# (if you use the shell here, cannot use 'compiler' package, but mpi only seems to work with it)
run: |
bash ./install.sh test-environment
conda activate test-environment
conda list
# Run all tests within WindSE, but not computationally expensive examples
- name: Run tests within WindSE
shell: pwsh
run: |
conda activate test-environment
pytest -v --cov=windse tests/test_regression.py
pytest -sv --cov=windse tests/test_regression.py
# Run coveralls
- name: Run coveralls
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ output/

# Ignore compiled python
*__pycache__*
*.egg-info*

17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# .readthedocs.yaml

version: 2

build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"
jobs:
pre_build:
- python doc/source/build_parameters_rst_from_schema.py

sphinx:
configuration: doc/source/conf.py

conda:
environment: environment.yaml
48 changes: 42 additions & 6 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
ChangeLog:
==========

2023.07.01:
-----------

Versions:
~~~~~~~~~

* FEniCS: 2019.1.0, build: py38_9
* Dolfin-Adjoint: 2019.1.0

New Features:
~~~~~~~~~~~~~

* Add yaml schema to validate inputs and generate parameter documentation
* Added new actuator disk option, `hybrid_disk`, with force distributed to match time-averaged ALM case
* Added a new category of documentation, studies, to collect verification and validation outcomes
* Added stream and spanwise periodic boundary conditions and body force
* Refactored a new, dolfin-adjoint-friendly version of the ALM Code
* Added ability to organize and save CSV files of floating platform motion
* Adding Floating Platform Functions
* Overhauled how wind farms and turbined are implemented
* Add damage equivalent load (DEL) objective function
* Updated blockage objectives (modified point blockaged, shifted cyld kernels, refactored plane blockage)

Bug Fixes
~~~~~~~~~

* Specify Python 3.8 to fix dependencies
* Fixed simulations for multiple turbines and large farms
* Fixed inflow_angle bug and power sum bug
* Fix constraints and objective output to preserve dolfin-adjoint linking


2021.08.01:
----------
-----------

Versions:
~~~~~~~~~
Expand All @@ -13,15 +45,21 @@ Versions:
New Features:
~~~~~~~~~~~~~

* Refactored how wind farms and turbines work
* Added DELs for the actuator line
* Added small yaw optimization regression test

Bug Fixes
~~~~~~~~~

* Change boundary velocity reference height to be based on mean(turbines.z)
* Reduced the size of 3D_Skew_Steady.yaml problem
* No longer annotate debug functions
* Fixed a bug where the forward problem was not recomputed correctly during optimization

2021.08.0:
----------

2021.08.00:
-----------

Versions:
~~~~~~~~~
Expand All @@ -48,15 +86,13 @@ New Features:
* Added example scripts for small jobs
* Added ability to maximize or minimize


Bug Fixes
~~~~~~~~~

* Fixed mpi optimizations
* Normalized blockage objective functions to report in m/s



2020.5.0:
---------

Expand All @@ -83,4 +119,4 @@ Bug Fixes

* Fixed import for Jupyter
* Fixed boundary label typo
* Fixed free slip boundary assignment
* Fixed free slip boundary assignment
17 changes: 8 additions & 9 deletions demo/documented/Driver_Example/2D_Grid_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
params["wind_farm"]["grid_cols"] = 6
params["wind_farm"]["ex_x"] = [-1800,1800]
params["wind_farm"]["ex_y"] = [-1800,1800]
params["wind_farm"]["HH"] = 90
params["wind_farm"]["RD"] = 126
params["wind_farm"]["thickness"] = 10
params["wind_farm"]["yaw"] = 0
params["wind_farm"]["axial"] = 0.33

### Edit the turbine settings
params["turbines"]["type"] = "2D_disk"
params["turbines"]["HH"] = 90
params["turbines"]["RD"] = 126
params["turbines"]["thickness"] = 10
params["turbines"]["yaw"] = 0
params["turbines"]["axial"] = 0.33

### Edit the domain settings ###
params["domain"]["type"] = "rectangle"
Expand All @@ -50,10 +53,6 @@
### Initialize the parameters object ###
params = df.Initialize(params)





### Build the domain and wind-farm ###
dom, farm = df.BuildDomain(params)
dom.Save()
Expand Down
36 changes: 19 additions & 17 deletions demo/documented/Yaml_Examples/0-wind_farm_2D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ wind_farm:

####################### Imported Wind Farm #######################
type: imported # |
path: Input_Data/wind_farm.txt # location of wind farm | -
force: sine # radial force distribution| -
path: Input_Data/nrel_5mw/wind_farm.csv # location of wind farm | -
###################################################################


Expand All @@ -19,14 +18,8 @@ wind_farm:
# grid_cols: 4 # Number of columns | -
# ex_x: [-600, 600] # x-extent of the farm | m
# ex_y: [-600, 600] # y-extent of the farm | m
# HH: 90 # Hub Height | m
# RD: 126.0 # Turbine Diameter | m
# thickness: 20.0 # Effective Thickness | m
# yaw: 0.0 # Yaw | rads
# axial: 0.33 # Axial Induction | -
# jitter: 50 # Randomly perturb turbines| m
# seed: 8675309 # random seed for repeats | -
# force: constant # radial force distribution| -
###################################################################


Expand All @@ -36,15 +29,22 @@ wind_farm:
# ex_x: [-600, 600] # x-extent of the farm | m
# ex_y: [-600, 600] # y-extent of the farm | m
# seed: 5555555 # random seed for repeats | -
# HH: 90 # Hub Height | m
# RD: 126.0 # Turbine Diameter | m
# thickness: 10.5 # Effective Thickness | m
# yaw: 0.0 # Yaw | rads
# axial: 0.33 # Axial Induction | -
# force: sine # radial force distribution| -
###################################################################

# The Turbine properties can be overwritten in the wind_farm.csv file
turbines:

######################### Turbine Properties ########################
type: 2D_disk
RD: 126.0 # Turbine Diameter | m
thickness: 20.0 # Effective Thickness | m
axial: 0.33 # Axial Induction | -
force: sine # radial force distribution| -

# These two are left off because they are supplied in the wind_farm.csv file
# HH: 90 # Hub Height | m
# yaw: 0.0 # Yaw | rads
###################################################################

# Domain Parameters: Uncomment a set to change domain shape
domain:
Expand Down Expand Up @@ -76,9 +76,11 @@ refine:
# farm_factor: 1.25 # farm radius multiplier | -
turbine_num: 1 # number of turbine refinements| -
turbine_factor: 1.25 # turbine radius multiplier | -
refine_custom: [
[box, [ [[-1000,1200],[-200,200]]] ]
]
refine_custom:
1:
type: box
x_range: [-1000, 1200]
y_range: [-200, 200]
function_space:
type: taylor_hood

Expand Down
27 changes: 10 additions & 17 deletions demo/documented/Yaml_Examples/1-wind_farm_2D_layout_opt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ wind_farm:

# ####################### Imported Wind Farm #######################
# type: imported # |
# path: Input_Data/wind_farm.txt # location of wind farm | -
# path: Input_Data/nrel_5mw/wind_farm.csv # location of wind farm | -
# force: constant # radial force distribution| -
# ###################################################################

Expand All @@ -20,17 +20,8 @@ wind_farm:
grid_cols: 3 # Number of columns | -
ex_x: [-882, 882] # x-extent of the farm | m
ex_y: [-882, 882] # y-extent of the farm | m
HH: 90 # Hub Height | m
RD: 126.0 # Turbine Diameter | m
thickness: 12.0 # Effective Thickness | m
yaw: 0.0 # Yaw | rads
axial: 0.25 # Axial Induction | -
jitter: 0 # Randomly perturb turbines| m
seed: 8675309 # random seed for repeats | -
force: constant # radial force distribution| -
turbine_method: dolfin


##################################################################


Expand All @@ -40,15 +31,17 @@ wind_farm:
# ex_x: [-600, 600] # x-extent of the farm | m
# ex_y: [-600, 600] # y-extent of the farm | m
# seed: 5555555 # random seed for repeats | -
# HH: 90 # Hub Height | m
# RD: 126.0 # Turbine Diameter | m
# thickness: 10.5 # Effective Thickness | m
# yaw: 0.0 # Yaw | rads
# axial: 0.33 # Axial Induction | -
# force: sine # radial force distribution| -
###################################################################


# Turbine properties
turbines:
type: 2D_disk
force: constant # radial force distribution| -
HH: 90 # Hub Height | m
RD: 126.0 # Turbine Diameter | m
thickness: 12.0 # Effective Thickness | m
yaw: 0.0 # Yaw | rads
axial: 0.25 # Axial Induction | -

# Domain Parameters: Uncomment a set to change domain shape
domain:
Expand Down
Loading

0 comments on commit bec7100

Please sign in to comment.