Skip to main content

RAFT: Response Amplitudes of Floating Turbines

Project description

RAFT - Response Amplitudes of Floating Turbines

RAFT is a Python code for frequency-domain analysis of floating wind turbines. It constitutes the "Level 1" of modeling fidelity in the WEIS toolset for floating wind turbine controls co-design. RAFT provides frequency-domain modeling of full floating wind turbine systems including turbine aerodynamics, controls, rigid-body platform hydrodynamics, and mooring response. The rotor aerodynamics are provided by CCBlade and the mooring system is represented by NREL's new quasi-static mooring system model, MoorPy. Potential-flow hydrodynamics can optionally be used via pyHAMS, a Python wrapper of the HAMS (Hydrodynamic Analysis of Marine Structures) tool for boundary-element-method solution of the potential flow problem developed by Yingyi Liu.

RAFT v1.0.0 includes the capabilities described above, and further development is planned to expand these capabilities. Documentation and verification efforts are ongoing. Please see RAFT's documentation for more information.

Best Practices for Using conda

Installation with Anaconda is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis. RAFT requires Anaconda 64-bit. However, the conda command has begun to show its age and we now recommend the one-for-one replacement with the Miniforge3 distribution, which is much more lightweight and more easily solves for the RAFT package dependencies.

Using RAFT as a Library

If you would like to use RAFT as a library, without direct interaction with the source code, then you can install it directly via conda install raft (preferred) or pip install raft.

Getting Started

New users of RAFT as a standalone model are recommended to begin by looking at the input file and script provided in the examples folder, and seeking further information from the RAFT documentation. For use as part of the WEIS toolset, information will be provided once this capability is completed in the WEIS documentation. For now, the following will help get started with running RAFT as a standalone model.

RAFT uses a number of prerequisites, or other python package dependencies, to run its calculations. All of the prerequisites can be installed through the conda package manager, but power users may wish to install all of the NREL packages from source for customization and debugging. Notable dependencies are:

* 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).

     (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.yml" file, which lists all the packages needed to run RAFT

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

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

  3. Activate the new virtual environment

     (base) ANY_PATH> conda activate raft-env
    

    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. Test the installation

     (raft-env) YOUR_PATH/RAFT> pytest
    

    Running pytest should ensure everything was installed correctly

Installing NREL Dependencies from Source

To install all external python packages using conda and NREL packages from source, follow the steps below. Since the NREL dependencies are also under development, this may also help resolve issues if one code gets out-of-sync with the others.

  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-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.yml
    

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

  3. Activate the new virtual environment

     (base) ANY_PATH> conda activate raft-env
    

    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 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)
    
  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
     (raft-env) YOUR_PATH> git clone https://github.com/WISDEM/pyHAMS.git
     (raft-env) YOUR_PATH> cd MoorPy
     (raft-env) YOUR_PATH/MoorPy> pip install -e .
     (raft-env) YOUR_PATH/MoorPy> cd ..
     (raft-env) YOUR_PATH> cd CCBlade
     (raft-env) YOUR_PATH/CCBlade> pip install -e .
     (raft-env) YOUR_PATH/CCBlade> cd ..
     (raft-env) YOUR_PATH> cd pyHAMS
     (raft-env) YOUR_PATH/pyHAMS> pip install --no-build-isolation -e .
     (raft-env) YOUR_PATH/pyHAMS> cd ..
    

    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.

  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.

  1. 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

conda env remove -n "name-of-the-virtual-environment"

Documentation and Issues

Please see https://weis.readthedocs.io/en/latest/ for documentation.

Questions and issues can be posted at https://github.com/WISDEM/RAFT/issues.

License

RAFT is licensed under the Apache License, Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openraft-1.3.0.tar.gz (206.6 kB view details)

Uploaded Source

Built Distribution

OpenRAFT-1.3.0-py3-none-any.whl (146.4 kB view details)

Uploaded Python 3

File details

Details for the file openraft-1.3.0.tar.gz.

File metadata

  • Download URL: openraft-1.3.0.tar.gz
  • Upload date:
  • Size: 206.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for openraft-1.3.0.tar.gz
Algorithm Hash digest
SHA256 293b875d71ce57b018de7cd51580dccf20cee42a4a2cae68a2e834ef11ca0402
MD5 f3ef56655e2a41c30596ea176da35431
BLAKE2b-256 868535d9de873eb7d3cb8bfbe49e1dc8942d880ab206bc05ccfa70a1f17f0630

See more details on using hashes here.

File details

Details for the file OpenRAFT-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: OpenRAFT-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 146.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for OpenRAFT-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a17b33a2d1253a24ac7d819cb82693322c4dd9095e30e007814ab52445716ce
MD5 18da1486610b1667dba3001458ada126
BLAKE2b-256 d67eee5847e555425ab74b866a041b2e085edfb9122bce111501f6d32c15c460

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page