Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into moorDynTen
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-carmo committed Sep 12, 2024
2 parents f8e6c47 + f3f9db1 commit 5b8e0a5
Show file tree
Hide file tree
Showing 32 changed files with 129,947 additions and 1,175 deletions.
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,22 @@ RAFT uses a number of prerequisites, or other python package dependencies, to ru

\* CCBlade is a module of WISDEM, but can be used separately. RAFT only requires CCBlade (and some additional related functions) out of the larger WISDEM code. Power users installing from source can install either CCBlade or WISDEM, but for highest efficiency, we recommend installing CCBlade, without the entire WISDEM installation.

Note that conda is required for the following installations.

## Installing All Dependencies with `conda`

To install all required python packages to run RAFT using `conda`, follow the steps below.

1. Navigate to a directory of your choosing on your local machine and clone this RAFT repository to that new directory (if you don't have the `git` command, start with `conda install git` in your "base" environment.
1. Navigate to a directory of your choosing on your local machine and clone this RAFT repository to that new directory (if you don't have the `git` command, start with `conda install git` in your "base" environment).

(base) YOUR_PATH> git clone https://github.com/WISDEM/RAFT.git
(base) YOUR_PATH> cd RAFT

This will create new folder called "RAFT" that is a copy from the GitHub repository, located in your "YOUR_PATH" directory

2. Create a new python virtual environment based on the "environment.yaml" file, which lists all the packages needed to run RAFT
2. Create a new python virtual environment based on the "environment.yml" file, which lists all the packages needed to run RAFT

(base) YOUR_PATH/RAFT> conda env create --name raft-env -f environment.yaml
(base) YOUR_PATH/RAFT> conda env create --name raft-env -f environment.yml

This will create a new python virtual environment called "raft-env"

Expand All @@ -60,6 +62,12 @@ To install all required python packages to run RAFT using `conda`, follow the st
(raft-env) YOUR_PATH/RAFT> pip install -e .

This installs RAFT and all of its modules directly from your working directory in "editable" mode, meaning, if you save a change to your source code in the files in "YOUR_PATH/RAFT", future calls to RAFT modules will include those changes.

5. Test the installation

(raft-env) YOUR_PATH/RAFT> pytest

Running pytest should ensure everything was installed correctly



Expand All @@ -74,9 +82,9 @@ To install all external python packages using `conda` and NREL packages from sou

This will create new folder called "RAFT" that is a copy from the GitHub repository, located in your "YOUR_PATH" directory

2. Create a new python virtual environment based on the "environment.yaml" file, which lists all the packages needed to run RAFT
2. Create a new python virtual environment based on the "environment-source.yml" file, which lists all the packages needed to run RAFT

(base) YOUR_PATH/RAFT> conda env create --name raft-env -f environment-source.yaml
(base) YOUR_PATH/RAFT> conda env create --name raft-env -f environment-source.yml

This will create a new python virtual environment called "raft-env"

Expand All @@ -86,22 +94,15 @@ To install all external python packages using `conda` and NREL packages from sou

This will activate the newly created virtual environment, in which we will install the remaining dependencies. After install is complete, when opening a new conda terminal that starts in the "base" environment, you can start with this "raft-env" activation command.

4. Install the RAFT package into the virtual environment

(raft-env) YOUR_PATH/RAFT> pip install -e .

This installs RAFT and all of its modules directly from your working directory in "editable" mode, meaning, if you save a change to your source code in the files in "YOUR_PATH/RAFT", future calls to RAFT modules will include those changes.


5. Install the necessary compilers and build tools for your system
4. Install the necessary compilers and build tools for your system

(raft-env) YOUR_PATH/RAFT> cd ..
(raft-env) YOUR_PATH> pip install meson-python meson ninja cmake
(raft-env) YOUR_PATH> conda install gfortran (Mac / Linux)
(raft-env) YOUR_PATH> conda install m2w64-toolchain libpython (Windows)


6. Install the NREL packages from source one at a time.
5. Install the NREL packages from source one at a time.

(raft-env) YOUR_PATH> git clone https://github.com/WISDEM/CCBlade.git
(raft-env) YOUR_PATH> git clone https://github.com/NREL/MoorPy.git
Expand All @@ -118,13 +119,22 @@ To install all external python packages using `conda` and NREL packages from sou

This installs MoorPy, CCBlade, and pyHAMS in "editable" mode, meaning, if you save a change to your source code in the files, future calls to RAFT modules will include those changes.


7. Install RAFT to complete the process
6. Install the RAFT package into the virtual environment

(raft-env) YOUR_PATH> cd RAFT
(raft-env) YOUR_PATH/RAFT> pip install -e .

This installs RAFT and all of its modules directly from your working directory in "editable" mode, meaning, if you save a change to your source code in the files in "YOUR_PATH/RAFT", future calls to RAFT modules will include those changes.

This new "raft-env" should now be compatible to run RAFT standalone.

This new "raft-env" should now be compatible to run RAFT standalone.
7. Test the installation

(raft-env) YOUR_PATH/RAFT> pip install pytest
(raft-env) YOUR_PATH/RAFT> cd tests
(raft-env) YOUR_PATH/RAFT/tests> pytest test_fowt.py test_helpers.py test_member.py test_model.py test_rotor.py

Running these specific test files should prove that the installation was successful. Other tests that include 'omdao' are only used for installations with WISDEM.

If you need to remove any virtual environment for any reason, you can run

Expand Down
3 changes: 2 additions & 1 deletion designs/VolturnUS-S.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,8 @@ turbine:
Fl_Kp: -9.35
wt_ops: # operating points: wind speed [m/s], blade pitch [deg], rotor speed [rpm]
v: [3.0, 3.266896551724138, 3.533793103448276, 3.800689655172414, 4.067586206896552, 4.334482758620689, 4.601379310344828, 4.868275862068966, 5.135172413793104, 5.402068965517241, 5.6689655172413795, 5.935862068965518, 6.2027586206896554, 6.469655172413793, 6.736551724137931, 7.00344827586207, 7.270344827586207, 7.537241379310345, 7.804137931034483, 8.071034482758622, 8.337931034482759, 8.604827586206897, 8.871724137931036, 9.138620689655173, 9.405517241379311, 9.672413793103448, 9.939310344827586, 10.206206896551725, 10.473103448275863, 10.74, 11.231724137931035, 11.723448275862069, 12.215172413793104, 12.706896551724139, 13.198620689655172, 13.690344827586207, 14.182068965517242, 14.673793103448276, 15.16551724137931, 15.657241379310346, 16.14896551724138, 16.640689655172416, 17.13241379310345, 17.624137931034483, 18.11586206896552, 18.607586206896553, 19.099310344827586, 19.591034482758623, 20.082758620689653, 20.57448275862069, 21.066206896551726, 21.557931034482756, 22.049655172413793, 22.54137931034483, 23.03310344827586, 23.524827586206897, 24.016551724137933, 24.508275862068963, 25.0]
pitch_op: [-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 3.57152, 5.12896, 6.36736, 7.43866, 8.40197, 9.28843, 10.1161, 10.8974, 11.641, 12.3529, 13.038, 13.6997, 14.3409, 14.9642, 15.5713, 16.1639, 16.7435, 17.3109, 17.8673, 18.4136, 18.9506, 19.4788, 19.9989, 20.5112, 21.0164, 21.5147, 22.0067, 22.4925, 22.9724]
#pitch_op: [-0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, -0.25, 3.57152, 5.12896, 6.36736, 7.43866, 8.40197, 9.28843, 10.1161, 10.8974, 11.641, 12.3529, 13.038, 13.6997, 14.3409, 14.9642, 15.5713, 16.1639, 16.7435, 17.3109, 17.8673, 18.4136, 18.9506, 19.4788, 19.9989, 20.5112, 21.0164, 21.5147, 22.0067, 22.4925, 22.9724]
pitch_op: [3.44, 3.44, 3.44, 3.44, 3.44, 3.44, 3.19, 2.94, 2.65, 2.32, 1.97, 1.59, 1.19, 0.79, 0.38, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.46, 1.27, 1.99, 2.61, 3.05, 3.69, 5.13, 6.37, 7.44, 8.40, 9.29, 10.12, 10.90, 11.64, 12.35, 13.04, 13.70, 14.34, 14.96, 15.57, 16.16, 16.74, 17.31, 17.87, 18.41, 18.95, 19.48, 20.00, 20.51, 21.02, 21.51, 22.01, 22.49, 22.97] # updated with min pitch to achieve peak thrust shaving
omega_op: [2.1486, 2.3397, 2.5309, 2.722, 2.9132, 3.1043, 3.2955, 3.4866, 3.6778, 3.8689, 4.0601, 4.2512, 4.4424, 4.6335, 4.8247, 5.0159, 5.207, 5.3982, 5.5893, 5.7805, 5.9716, 6.1628, 6.3539, 6.5451, 6.7362, 6.9274, 7.1185, 7.3097, 7.5008, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56, 7.56]
gear_ratio: 1
torque_control:
Expand Down
2 changes: 1 addition & 1 deletion environment-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:

dependencies:
- matplotlib
- numpy
- numpy==1.26.4
- openmdao > 3.30
- pip
- python
Expand Down
4 changes: 2 additions & 2 deletions examples/OC4semi-RAFT_QTF.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ site:
cases:
keys : [wind_speed, wind_heading, turbulence, turbine_status, yaw_misalign, wave_spectrum, wave_period, wave_height, wave_heading, current_speed, wave_gamma ]
data : # m/s deg % or e.g. 2B_NTM string deg string (s) (m) (deg)
- [ 0, 0, 0, operating, 0, constant, 0, 5, 0, 0, 0]
- [ 0, 0, 0, operating, 0, JONSWAP, 12, 6, 0, 0, 0]



Expand All @@ -39,7 +39,7 @@ turbine:
Rhub : 1.5 # hub radius [m]
precone : 2.5 # [rad]
shaft_tilt : 5.0 # [rad]
overhang : 5.0 # [m]
overhang : -5.0 # [m]
aeroServoMod : 1 # 0 aerodynamics off; 1 aerodynamics on (no control); 2 aerodynamics and control on

env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ site:
cases:
keys : [wind_speed, wind_heading, turbulence, turbine_status, yaw_misalign, wave_spectrum, wave_period, wave_height, wave_heading, current_speed, wave_gamma ]
data : # m/s deg % or e.g. 2B_NTM string deg string (s) (m) (deg)
- [ 0, 0, 0, operating, 0, constant, 0, 5, 0, 0, 0]
- [ 0, 0, 0, operating, 0, JONSWAP, 14, 4, 0, 0, 0]



Expand All @@ -39,7 +39,7 @@ turbine:
Rhub : 1.5 # hub radius [m]
precone : 2.5 # [rad]
shaft_tilt : 5.0 # [rad]
overhang : 5.0 # [m]
overhang : -5.0 # [m]
aeroServoMod : 1 # 0 aerodynamics off; 1 aerodynamics on (no control); 2 aerodynamics and control on

env:
Expand Down Expand Up @@ -1066,8 +1066,9 @@ platform:
dz_BEM : 3.0 # [m] axial discretization panel length target for BEM analysis
da_BEM : 2.0 # [m] azimuthal discretization panel length target for BEM analysis
potModMaster : 1
potSecOrder : 2 # [int] master switch for computing second-order wave forces; 0=do not compute, 1=compute QTFs using slender body approximation, 2=read QTF file in WAMIT format (.11d or .12d)
qtfPath : './marin_semi.12d' # path to the qtf file for the platform
hydroPath : './examples/OC4semi-WAMIT_Coefs/marin_semi' # path to the hydrodynamic data file for the platform
potFirstOrder: 1 # [int] 0=do not load pre-computed first-order coefficients, 1= load pre-computed first-order coefficients in WAMIT format (.1 and .3 files)
potSecOrder : 2 # [int] master switch for computing second-order wave forces; 0=do not compute, 1=compute QTFs using slender body approximation, 2=read QTF file in WAMIT format (assuming .12d)



Expand All @@ -1085,10 +1086,10 @@ platform:
stations : [-20, 10 ] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
d : [ 6.5, 6.5] # [m] diameters if circular or side lengths if rectangular (can be pairs)
t : 0.03 # [m] wall thicknesses (scalar or list of same length as stations)
Cd : 0.56 # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
Ca : 0.63 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
CdEnd : 0.6 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
CaEnd : 1.0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
Cd : 0.56 # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
Ca : 0 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
CdEnd : 0.6 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
CaEnd : 0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
rho_shell : 7850 # [kg/m3] material density
# --- handling of end caps or any internal structures if we need them ---
# (These will only be *within* the inner diameter of the outer shell, so they don't interrupt the outer shell.)
Expand All @@ -1111,9 +1112,9 @@ platform:
d : [ 24, 24, 12, 12] # [m] diameters if circular or side lengths if rectangular (can be pairs)
t : 0.06 # [m] wall thicknesses (scalar or list of same length as stations)
Cd : [0.68, 0.68, 0.61, 0.61] # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
Ca : [0.4, 0.4, 0.63, 0.63] # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
Ca : 0 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
CdEnd : 2.3 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
CaEnd : 0.7 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
CaEnd : 0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
rho_shell : 7850 # [kg/m3] material density
# --- ballast ---
l_fill : [5.0418, 0, 7.77] # [m]
Expand Down
Loading

0 comments on commit 5b8e0a5

Please sign in to comment.