Code Monkey home page Code Monkey logo

raft's Introduction

WISDEM®

Actions Status Coverage Status Documentation Status

The Wind-Plant Integrated System Design and Engineering Model (WISDEM®) is a set of models for assessing overall wind plant cost of energy (COE). The models use wind turbine and plant cost and energy production as well as financial models to estimate COE and other wind plant system attributes. WISDEM® is accessed through Python, is built using OpenMDAO, and uses several sub-models that are also implemented within OpenMDAO. These sub-models can be used independently but they are required to use the overall WISDEM® turbine design capability. Please install all of the pre-requisites prior to installing WISDEM® by following the directions below. For additional information about the NWTC effort in systems engineering that supports WISDEM® development, please visit the official NREL systems engineering for wind energy website.

Author: NREL WISDEM Team

Documentation

See local documentation in the docs-directory or access the online version at https://wisdem.readthedocs.io/en/master/

Packages

WISDEM® is a family of modules. The core modules are:

  • CommonSE includes several libraries shared among modules
  • FloatingSE works with the floating platforms
  • DrivetrainSE sizes the drivetrain and generator systems (formerly DriveSE and GeneratorSE)
  • TowerSE is a tool for tower (and monopile) design
  • RotorSE is a tool for rotor design
  • NREL CSM is the regression-based turbine mass, cost, and performance model
  • ORBIT is the process-based balance of systems cost model for offshore plants
  • LandBOSSE is the process-based balance of systems cost model for land-based plants
  • Plant_FinanceSE runs the financial analysis of a wind plant

The core modules draw upon some utility packages, which are typically compiled code with python wrappers:

  • Airfoil Preppy is a tool to handle airfoil polar data
  • CCBlade is the BEM module of WISDEM
  • pyFrame3DD brings libraries to handle various coordinate transformations
  • MoorPy is a quasi-static mooring line model
  • pyOptSparse provides some additional optimization algorithms to OpenMDAO

Installation

Installation with Anaconda is the recommended approach because of the ability to create self-contained environments suitable for testing and analysis. WISDEM® 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 WISDEM package dependencies.

Installation as a "library"

To use WISDEM's modules as a library for incorporation into other scripts or tools, WISDEM is available via conda install wisdem or pip install wisdem, assuming that you have already setup your python environment. Note that on Windows platforms, we suggest using conda exclusively.

Installation for direct use

These instructions are for interaction with WISDEM directly, the use of its examples, and the direct inspection of its source code.

The installation instructions below use the environment name, "wisdem-env," but any name is acceptable. For those working behind company firewalls, you may have to change the conda authentication with conda config --set ssl_verify no. Proxy servers can also be set with conda config --set proxy_servers.http http://id:pw@address:port and conda config --set proxy_servers.https https://id:pw@address:port. To setup an environment based on a different Github branch of WISDEM, simply substitute the branch name for master in the setup line.

  1. Setup and activate the Anaconda environment from a prompt (Anaconda3 Power Shell on Windows or Terminal.app on Mac)

    conda config --add channels conda-forge
    conda env create --name wisdem-env -f https://raw.githubusercontent.com/WISDEM/WISDEM/master/environment.yml
    conda activate wisdem-env
    
  2. In order to directly use the examples in the repository and peek at the code when necessary, we recommend all users install WISDEM in developer / editable mode using the instructions here. If you really just want to use WISDEM as a library and lean on the documentation, you can always do conda install wisdem and be done. Note the differences between Windows and Mac/Linux build systems. For Linux, we recommend using the native compilers (for example, gcc and gfortran in the default GNU suite).

    conda install -y petsc4py mpi4py                 # (Mac / Linux only)
    conda install -y gfortran                        # (Mac only without Homebrew or Macports compilers)
    conda install -y m2w64-toolchain libpython       # (Windows only)
    git clone https://github.com/WISDEM/WISDEM.git
    cd WISDEM
    pip install --no-deps -e . -v
    

NOTE: To use WISDEM again after installation is complete, you will always need to activate the conda environment first with conda activate wisdem-env

Run Unit Tests

Each package has its own set of unit tests. These can be run in batch with the test_all.py script located in the top level test-directory.

Feedback

For software issues please use https://github.com/WISDEM/WISDEM/issues. For functionality and theory related questions and comments please use the NWTC forum for Systems Engineering Software Questions.

raft's People

Contributors

dav-og avatar dzalkind avatar erickaloz avatar gbarter avatar joepvdspek avatar lucas-carmo avatar mattehall avatar shousner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raft's Issues

Error with pyHAMS

Hello,

After installing all the necessary modules I try to test RAFT with the provided example and I get the following message:
ImportError: /pyHAMS/pyhams/hams.cpython-39-x86_64-linux-gnu.so: undefined symbol: zgetrs

I tried it with both python 3.9 and 3.10 but this doesn't seem to be the problem.

Outputting results

Hi,

Thanks for creating what looks like another very useful model!

I apologize if this is a silly issue but I am struggling to write the results from the VolturnUS example to an output file as I do not have much experience with Python. Is there an existing function/command which can be added to the 'example_from_yaml.py' file to do this?

To calculate the QTFs in Nemoh V3 a linearized mooring stiffness matrix and viscous drag matrix are needed as inputs, these are primarily the outputs I want from RAFT after running 'model.analyzeCases'. Up to now I have been using MoorPY to get the linearized mooring stiffness matrix but as RAFT can calculate the linearized viscous drag matrix also it makes sense to use RAFT.

Thanks,
Tom

Massively parallel directory creation fail

When running in a massively parallel way on HPC, for instance, this line can fail. It appears that there's a race condition that can get multiple processors past the L320 if statement before this line is reached, then the "if directory exists" condition changes after evaluating the if statement on L320.

Adding a keyword argument for exists_ok=True into the os.makedirs call on L320 can be used to allow this condition to be ok, I think.

Question on raft_rotor.py, IECKaimal, Rot spectrum

I have a question regarding the definition of the rotor averaged wind speed amplitudes U(ω). In the code snippet I am attaching, a Rot variable is defined which does not use any of the spectra in the X, Y, Z directions. It is mentioned that these formulas are derived from the IEC 61400-1-2019 annex C ("Compute turbulence scale parameter Annex C3 of IEC 61400-1-2019") however said anex defines the coherence function and the PSDs in the 3 directions for the Kaimal method. Some complex math is involved in this calculation, and I would like to ask how this equation is defined if there are any sources I can look into to understand the meaning of this derived spectrum. I looked into any publications I could find using Raft, but in most cases this part was not referenced at all.
Screenshot 2024-04-25 215930

Best way to install CCBlade when using RAFT as standalone

Hi Matt, Stein, and the greater RAFT team,

What is your recommended way of installing CCBlade when using RAFT as a standalone? To use the standalone CCBlade (my hypothesis)? Install WISDEM from source? From conda install wisdem? Just use WEIS and get everything together?

This is essentially the question being asked in this WISDEM issue. Feel free to post a reply back there if that is easiest.

Cheers,
Garrett

Setting potModMaster to 0

Hello,

I am trying to run the example file for the VolturnUS floater in RAFT on linux (on HPC cluster, centOS linux 7). When potModMaster value is 1 (no BEM application), the code runs properly. However, when potModMaster is switched to 0 (BEM application) then I get the following error (see attached).

Some relevant information:
-python version: 3.9
-numpy: 1.23.5. I had to downgrade from the initial version (1.24), as the np.int in the member2pnl.py is deprecated in 1.24.

Thanks a lot!

image

Example not working: Error: No module named 'pyhams'

I have recently rebooted my PC and reinstalled RAFT. However, the installation seems to be unsuccessful as when I run the example_from_yaml.py i get the following error:

cd RAFT
cd examples
(raft-env) PS C:\Users\hfleh\RAFT\examples> python example_from_yaml.py
Traceback (most recent call last):
File "C:\Users\hfleh\RAFT\examples\example_from_yaml.py", line 6, in
import raft
File "c:\users\hfleh\raft\raft_init_.py", line 3, in
import raft.raft_model as model
File "c:\users\hfleh\raft\raft\raft_model.py", line 15, in
import raft.raft_fowt as fowt
File "c:\users\hfleh\raft\raft\raft_fowt.py", line 7, in
import pyhams.pyhams as ph
ModuleNotFoundError: No module named 'pyhams'
(raft-env) PS C:\Users\hfleh\RAFT\examples>`

I have cloned and setup all relevant repositories: WISDEM, MoorPy, PyHAMS, RAFT.
Can you help me?

Weird behavior

I modeled a floater with WTG+tower on one of the columns. (similar to PPI or Technip INO15 floater.
We have used the example floater from the RAFT package (VolturnUS-S_example.yaml) and kept the turbine + tower at (X,Y) = (0, 0). Basically we translated floater column + mooring + anchor coordinates in X direction.
(all Columns have nearly same mass…meaning we would expect the weight of the turbine would result in pitch forward, but the opposite is the case).
Running RAFT we now get this weird behavior(see picture below) in steady state (no wind, no waves).

What can be cause of this? Coordinate system of RAFT and pyHAMS not matching?

Thanks in advance
Jasper Koot
Siemens Gamesa

Weird behavior RAFT

Matrix inverse

Hi @gbarter, thanks for this nice code! By skimming through it I noticed that you have computed a couple of matrix inverses. Generally, this has bad numerical properties, as it's both slow and inaccurate. You should instead solve a linear system.

I suggest to:

  • At raft_model L399 replace np.matmul(np.linalg.inv(M_tot), C_tot) with np.linalg.solve(M_tot, C_tot).
  • At raft_model L540 replace np.matmul(np.linalg.inv(Z[:,:,ii]), F_tot[:,ii] ) with np.linalg.solve(Z[:,:,ii], F_tot[:,ii]).

Furthermore, if M_tot and Z are reasonably sparse, you might get an even faster solution using spsolve.

By the way, the routines from scipy.linalg might be faster than the ones from numpy on some architectures.

Wrong Definition of control gains in calcAero function of Rotor.py

I've been looking into the code of the aerodynamics calculations of raft because I am trying to understand if some results on the OC4 platform I am getting are reasonable, and I believe I've stumbled on a small error in the calcAero function of the rotor.py file. In line 872, where the torque control gains are defined, in both the integral and proportional gains, the kp_tau value is used, when it should be ki_tau for the integral term and kp_tau for the proportional term. The results I am getting after correcting this are very different from the original code (for cases where wind speed is below the rated speed).
image

Missing SharedMooring2.dat

Hello,

Thank you for creating this excellent tool. I understand that it is possible to simulate shared mooring configuration with RAFT.

I was trying to run the example file for a farm configuration provided here RAFT/designs/VolturnUS-S_farm.yaml. It comes up with the following error :
image

I could not find the file called 'SharedMooring2.dat' in the repository. Can you please help with this.

Definitions of yaw misalignment and wind speed height in cases

I haven't been able to find a satisfying answer in documentation or source code regarding the attributes 'yaw_misalign' and 'wind_speed' of each case, and just wanted to check their definitions.

For 'wind_speed' - is this the wind speed at 10 m above mean sea level or at equilibrium hub height?

For 'yaw_misalign' - is this angle relative to the wind vector or to the overall coordinate system of the FOWT?

Many thanks

Options for analysis of semi-taut mooring systems

Hi,

In order to evaluate the feasibility of FOWTs with semi-taut mooring systems, it would be nice to be able to assess whether the connection point between the synthetic line and chain makes contact with the seabed and assess whether the loads on the anchor are purely horizontal. Does RAFT have any options for this? I saw that MoorPy has some methods to do this (getForces, getPositions, getAnchorLoads), but these all only work with MoorDyn output files, rather than RAFT simulation data. Is there anything that can be used?

Many thanks

Question: VolturnUs example not working when setting potModMaster to 0

Dear all,
I've followed all the instructions to install RAFT, and I am able to successfully run the example script in https://openraft.readthedocs.io/en/latest/starting.html using the VolturnUS-S.yaml default file.
Nonetheless, the setting for potModMaster is 1, i.e. "1=turns all potMod vars to False (no HAMS)", although some of the elements (center_column and outer_column are defined as "potMod : True".
When I change potModMaster to 0 (0=keeps all member potMod vars the same), I obtain the following error:
`Found mean offets with with surge = 0.02 m and pitch = 0.00 deg.

--------- Natural frequencies and mode shapes -------------
Mode 1 2 3 4 5 6
Fn (Hz) 0.0087 0.0087 0.0611 0.0405 0.0405 0.0150

DOF 1 -1.0000 -0.0129 0.0000 0.0003 -0.9889 -0.0000
DOF 2 0.0000 -0.9999 0.0000 -0.9889 0.0001 0.0888
DOF 3 -0.0000 -0.0000 -1.0000 -0.0000 0.0000 -0.0000
DOF 4 0.0000 -0.0006 -0.0000 0.1487 -0.0000 0.0002
DOF 5 0.0006 0.0000 0.0000 0.0000 -0.1486 0.0000
DOF 6 -0.0000 0.0001 0.0000 0.0000 -0.0000 0.9960

Of 312 generated panels, 172 were submerged and have been used in the mesh.
Of 600 generated panels, 332 were submerged and have been used in the mesh.
Of 600 generated panels, 332 were submerged and have been used in the mesh.
Of 600 generated panels, 332 were submerged and have been used in the mesh.
Traceback (most recent call last):

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec
exec(code, globals, locals)

File "c:\users\mauri\onedrive_maurizio_company\sandbox\raft\raft_example.py", line 27, in
model.analyzeCases(display=1)

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\site-packages\raft\raft_model.py", line 236, in analyzeCases
fowt.calcBEM(meshDir=meshDir)

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\site-packages\raft\raft_fowt.py", line 391, in calcBEM
ph.run_hams(meshDir)

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\site-packages\pyhams\pyhams.py", line 404, in run_hams
sub.run([f'{hamsPath}'])

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\subprocess.py", line 503, in run
with Popen(*popenargs, **kwargs) as process:

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 109, in init
super(SubprocessPopen, self).init(*args, **kwargs)

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\subprocess.py", line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,

File "C:\Users\mauri\anaconda3\envs\spyder-env-WSDM\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified`

Cannot create the raft environment on MacOS from raft-env.yaml

The error is:
`
(base) MacBook-Air-2:xxx$ conda env create -f raft-env.yaml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • m2w64-headers-git==5.0.0.4636.c0ad18a=2
  • m2w64-pkg-config==0.29.1=2
  • setuptools==68.0.0=py39haa95532_0
  • m2w64-gcc-libgfortran==5.3.0=6
  • ca-certificates==2023.05.30=haa95532_0
  • mkl==2023.1.0=h8bd8f75_46356
  • intel-openmp==2023.1.0=h59b6b97_46319
  • m2w64-libiconv==1.14=6
  • msys2-conda-epoch==20160418=1
  • m2w64-bzip2==1.0.6=6
  • pyhams==1.2.1=py39hab42cac_0
  • m2w64-gcc==5.3.0=6
  • m2w64-tools-git==5.0.0.4592.90b8472=2
  • m2w64-libwinpthread-git==5.0.0.4634.697f757=2
  • libflang==5.0.0=h6538335_20180525
  • libblas==3.9.0=1_h8933c1f_netlib
  • openmp==5.0.0=vc14_1
  • m2w64-libmangle-git==5.0.0.4509.2e5a9a2=2
  • sqlite==3.41.2=h2bbff1b_0
  • openssl==3.0.10=h2bbff1b_0
  • m2w64-gcc-ada==5.3.0=6
  • vc==14.2=h21ff451_1
  • vs2015_runtime==14.27.29016=h5e58377_2
  • m2w64-mpfr==3.1.4=4
  • m2w64-binutils==2.25.1=5
  • numpy==1.25.0=py39h055cbcc_0
  • m2w64-gcc-libs==5.3.0=7
  • mkl_random==1.2.2=py39hf11a4ad_1
  • m2w64-mpc==1.0.3=3
  • libopenblas==0.3.21=pthreads_h02691f0_2
  • openblas==0.3.21=pthreads_ha35c500_2
  • mkl-service==2.4.0=py39h2bbff1b_1
  • wheel==0.38.4=py39haa95532_0
  • m2w64-gcc-libs-core==5.3.0=7
  • m2w64-gcc-objc==5.3.0=6
  • tbb==2021.8.0=h59b6b97_0
  • pip==23.2.1=py39haa95532_0
  • m2w64-zlib==1.2.8=10
  • m2w64-windows-default-manifest==6.4=3
  • m2w64-toolchain==5.3.0=7
  • m2w64-winpthreads-git==5.0.0.4634.697f757=2
  • numpy-base==1.25.0=py39h65a83cf_0
  • libpython==2.1=py39haa95532_0
  • m2w64-isl==0.16.1=2
  • m2w64-crt-git==5.0.0.4636.2595836=2
  • m2w64-gmp==6.1.0=2
  • m2w64-gcc-fortran==5.3.0=6
  • python==3.9.17=h1aa4202_0
  • m2w64-make==4.1.2351.a80a8b8=2
  • liblapack==3.9.0=5_hd5c7e75_netlib
  • mkl_fft==1.3.6=py39hf11a4ad_1
    `
    Is this because the raft-env.yaml file only works for the linux system?

Thanks,
Ying

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.