Skip to content

Commit b5d69b0

Browse files
committed
Merge remote-tracking branch 'origin/main' into new_base
2 parents 023d627 + 831d651 commit b5d69b0

File tree

134 files changed

+20938
-14902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+20938
-14902
lines changed

.github/workflows/CI_FAModel.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI_FAModel
2+
3+
# We run CI on push commits and pull requests on all branches
4+
on: [push, pull_request]
5+
6+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
7+
jobs:
8+
build_conda:
9+
name: Conda Build (${{ matrix.os }}) - ${{ matrix.python-version }}
10+
runs-on: ${{ matrix.os }}
11+
defaults:
12+
run:
13+
shell: bash -el {0}
14+
15+
strategy:
16+
fail-fast: false #true
17+
matrix:
18+
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
19+
python-version: ["3.11", "3.12"]
20+
21+
22+
steps:
23+
- name: checkout repository
24+
uses: actions/checkout@v4
25+
26+
- uses: conda-incubator/setup-miniconda@v3
27+
# https://github.com/marketplace/actions/setup-miniconda
28+
with:
29+
# To use mamba, uncomment here, comment out the miniforge line
30+
#mamba-version: "*"
31+
miniforge-version: "latest"
32+
auto-update-conda: true
33+
python-version: ${{ matrix.python-version }}
34+
environment-file: famodel-env.yaml
35+
activate-environment: test
36+
auto-activate-base: false
37+
channels: conda-forge
38+
channel-priority: true
39+
40+
- name: Extras
41+
run: |
42+
conda install -y pytest meson ninja nlopt
43+
conda info
44+
45+
- name: Conda Install famodel
46+
run: |
47+
pip install -e .
48+
49+
- name: Overwrite MoorPy
50+
run: |
51+
pip install git+https://github.com/NREL/MoorPy@dev
52+
53+
- name: Example run
54+
run: |
55+
cd examples
56+
python example_driver.py false
57+
58+
- name: Test run
59+
run: |
60+
cd tests
61+
pytest .
62+

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ the array's behavior considering the site conditions. For example, it combines
77
information about site soil conditions and an array's anchor characteristics to
88
estimate the holding capacity of each anchor.
99

10-
The library works in conjunction with the tools RAFT and MoorPy to model floating
11-
wind turbines and mooring systems, respectively.
10+
The library works in conjunction with the tools RAFT, MoorPy, and FLORIS to model floating
11+
wind turbines, mooring systems, and array wakes respectively.
1212

1313
In addition to the code, this repository defines a
1414
[Floating Array Ontology](https://github.com/FloatingArrayDesign/FAModel/tree/main/famodel/ontology),
@@ -19,19 +19,16 @@ of the Humboldt lease area is shown below.
1919

2020
![Humboldt](famodel/seabed/images/slopeview4.PNG)
2121

22+
See example use cases in our [examples](https://github.com/FloatingArrayDesign/FAModel/tree/main/examples/README.md) folder.
2223

23-
## Installation
24-
25-
To install FAModel itself, clone the FAModel repository and then enter the
26-
following in the command line from its directory.
27-
28-
For development use:
29-
30-
run ```python setup.py develop``` or ```pip install -e .``` from the command line in the main FAModel directory.
24+
## Pre-installation Requirements
25+
The FAModel package is built entirely in Python. It is recommended that users familiarize themselves with basic Python commands before use.
26+
It is important to understand the general structure of FAModel and how to access models and stored information. Please see the model structure
27+
document (./famodel/README.md).
3128

32-
For non-development use:
3329

34-
run ```python setup.py``` or ```pip install .``` from the command line in the main FAModel directory.
30+
## Installation
31+
To install FAModel itself, first clone the FAModel repository.
3532

3633
The dependencies required by FAModel depend on how it is used. To install all
3734
possible required dependencies, you can create a
@@ -47,6 +44,17 @@ run the following command:
4744
This command will install all the dependencies required to run FAModel.
4845
Activate your virtual environment before using FAModel with ```conda activate famodel-env```
4946

47+
To install the FAModel package in your environment, enter the
48+
following in the command line from the FAModel directory.
49+
50+
For development use:
51+
52+
run ```python setup.py develop``` or ```pip install -e .``` from the command line in the main FAModel directory.
53+
54+
For non-development use:
55+
56+
run ```python setup.py``` or ```pip install .``` from the command line in the main FAModel directory.
57+
5058
** At this time, FAModel requires the latest MoorPy development branch version to be used. **
5159
Therefore, you must install MoorPy with ```git clone https://github.com/NREL/MoorPy.git```
5260
then navigate to the MoorPy folder and checkout the development branch with ```git checkout dev```
@@ -57,7 +65,7 @@ Make sure your virtual enviroment is activated before installing MoorPy.
5765
## Subpackages
5866

5967
The library has a core Project class for organizing information, classes for each component of an array and an evolving
60-
collection of subpackages for specific functions. The two current subpackages are:
68+
collection of subpackages for specific functions. The current subpackages are:
6169

6270
- anchors: contains modules for anchor capacity calculations, in addition to the anchor class
6371
- failures: contains modules for failure modeling with graph theory, and allows for enactment of a failure mode in integrated FAModel tools such as MoorPy and RAFT.
@@ -66,10 +74,12 @@ collection of subpackages for specific functions. The two current subpackages ar
6674
Please navigate into the subfolders above for additional information.
6775

6876
## Getting Started
69-
The easiest way to create an FAModel project is to provide the array information in a yaml file. FAModel has been designed to work with a specific ontology yaml setup, which is described in detail in the [Ontology ReadMe](./famodel/ontology/README.md).
77+
The easiest way to create an FAModel project is to provide the array information in an ontology yaml file. FAModel has been designed to work with a specific ontology yaml setup, which is described in detail in the [Ontology ReadMe](./famodel/ontology/README.md).
7078

7179
The [example driver file](./famodel/example_driver.py) creates an FAModel project from a pre-set ontology file and shows the syntax and outputs of various capabilities. For guidance on creating your own ontology yaml file, it is recommended to read through the [Ontology ReadMe](./famodel/ontology/README.md), then either adapt one of the ontology samples or fill in the ontology template.
7280

81+
The [FAModel core readme](./famodel/README.md) describes the FAModel class structure, as well as the properties and methods of each component class.
82+
7383
There are some limited helper functions to auntomatically fill in sections of a yaml from a moorpy system or a list of platform locations. See [FAModel helpers](./famodel/helpers.py) for the full list of yaml writing capabilities. Many of these are a work in progress.
7484

7585

environment_droplet.yml

-18 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
Simple driver file to create a 2d plot of an platform locations in an array.
3+
The input file only contains the bare minimum information to build a 2d plot
4+
of the turbine locations (no moorings, cables, anchors, platform design, turbines,
5+
site condition information, etc.)
6+
"""
7+
8+
from famodel import Project
9+
import matplotlib.pyplot as plt
10+
11+
# define name of ontology input file
12+
input_file = '01_2D-visual_turbine_locations.yaml'
13+
14+
# initialize Project class with input file, we don't need RAFT for this so mark False
15+
project = Project(file=input_file,raft=False)
16+
17+
# plot
18+
project.plot2d()
19+
20+
plt.show()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
# ----- Array-level inputs -----
3+
4+
# Wind turbine array layout
5+
array:
6+
keys : [ID, topsideID, platformID, mooringID, x_location, y_location, heading_adjust]
7+
data : # ID# ID# ID# [m] [m] [deg]
8+
- [fowt0, 0, 1, 0, -1600, -1600, 0 ]
9+
- [fowt1, 0, 1, 0, 0, -1600, 0 ]
10+
- [fowt2, 0, 1, 0, 1600, -1600, 0 ]
11+
- [fowt3, 0, 1, 0, -1600, 0, 0 ]
12+
- [fowt4, 0, 1, 0, 0, 0, 0 ]
13+
- [fowt5, 0, 1, 0, 1600, 0, 0 ]
14+
- [fowt6, 0, 1, 0, -1600, 1600, 0 ]
15+
- [fowt7, 0, 1, 0, 0, 1600, 0 ]
16+
- [fowt8, 0, 1, 0, 1600, 1600, 0 ]
17+
18+
platform:
19+
type : FOWT
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Simple driver file to create a 2d plot of an platform locations with
4+
mooring lines in an array.
5+
The input file only contains the bare minimum information to build a 2d plot
6+
of the turbine locations and moorings (no cables, platform design, turbines,
7+
site condition information, etc.)
8+
"""
9+
10+
from famodel import Project
11+
import matplotlib.pyplot as plt
12+
13+
# define name of ontology input file
14+
input_file = '02_visual_moorings.yaml'
15+
16+
# initialize Project class with input file, we don't need RAFT for this so mark False
17+
project = Project(file=input_file,raft=False)
18+
19+
# plot
20+
project.plot2d()
21+
22+
# to moorings plot in 3d, we'll need to add depth and create a moorpy model of the system
23+
project.depth = 200 # depth added because we did not include the site conditions section of the yaml
24+
project.getMoorPyArray()
25+
project.plot3d()
26+
27+
plt.show()
28+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
# ----- Array-level inputs -----
3+
4+
# Wind turbine array layout
5+
array:
6+
keys : [ID, topsideID, platformID, mooringID, x_location, y_location, heading_adjust]
7+
data : # ID# ID# ID# [m] [m] [deg]
8+
- [fowt0, 0, 1, ms1, -1600, -1600, 180 ]
9+
- [fowt1, 0, 1, ms1, 0, -1600, 0 ]
10+
- [fowt2, 0, 1, ms1, 1600, -1600, 0 ]
11+
- [fowt3, 0, 1, ms1, -1600, 0, 0 ]
12+
- [fowt4, 0, 1, ms1, 0, 0, 45 ]
13+
- [fowt5, 0, 1, ms1, 1600, 0, 0 ]
14+
- [fowt6, 0, 1, ms1, -1600, 1600, 0 ]
15+
- [fowt7, 0, 1, ms1, 0, 1600, 0 ]
16+
- [fowt8, 0, 1, ms1, 1600, 1600, 0 ]
17+
18+
platform:
19+
type : FOWT
20+
rFair : 58
21+
zFair : -14
22+
23+
24+
25+
# ----- Mooring system -----
26+
27+
# Mooring system descriptions (each for an individual FOWT with no sharing)
28+
mooring_systems:
29+
30+
ms1:
31+
name: 2-line semi-taut polyester mooring system with a third line shared
32+
33+
keys: [MooringConfigID, heading, anchorType, lengthAdjust]
34+
data:
35+
- [ semitaut-poly_1, 150 , drag-embedment1, 0 ]
36+
- [ semitaut-poly_1, 270 , drag-embedment1, 0 ]
37+
- [ semitaut-poly_1, 30 , drag-embedment1, 0 ]
38+
39+
40+
# Mooring line configurations
41+
mooring_line_configs:
42+
43+
semitaut-poly_1: # mooring line configuration identifier, matches MooringConfigID
44+
45+
name: Semitaut polyester configuration 1 # descriptive name
46+
47+
span: 642 # 2D x-y distance from fairlead to anchor
48+
49+
sections: #in order from anchor to fairlead
50+
- mooringFamily: chain # ID of a mooring line section type
51+
d_nom: .1549 # nominal diameter of material [m]
52+
length: 497.7 # [m] usntretched length of line section
53+
- mooringFamily: polyester # ID of a mooring line section type
54+
d_nom: .182 # nominal diameter of material [m]
55+
length: 199.8 # [m] length (unstretched)
56+
57+
58+
59+
# Anchor type properties
60+
anchor_types:
61+
62+
drag-embedment1:
63+
type : DEA # type of anchor (drag-embedment anchor)
64+
65+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Simple driver file to create a 2d plot of an platform locations with
4+
mooring lines in an array.
5+
The input file only contains the bare minimum information to build a 2d plot
6+
of the turbine locations and moorings (no cables, platform design, turbines,
7+
site condition information, etc.)
8+
"""
9+
10+
from famodel import Project
11+
import matplotlib.pyplot as plt
12+
13+
# define name of ontology input file
14+
input_file = '03_visual_cables.yaml'
15+
16+
# initialize Project class with input file, we don't need RAFT for this so mark False
17+
project = Project(file=input_file,raft=False)
18+
19+
# plot
20+
project.plot2d()
21+
22+
# to plot cables in 3d, we'll need to add depth and create a moorpy model of the system
23+
project.depth = 200 # depth added because we did not include the site conditions section of the yaml
24+
project.getMoorPyArray()
25+
project.plot3d()
26+
27+
plt.show()
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
# ----- Array-level inputs -----
3+
4+
# Wind turbine array layout
5+
array:
6+
keys : [ID, topsideID, platformID, mooringID, x_location, y_location, heading_adjust]
7+
data : # ID# ID# ID# [m] [m] [deg]
8+
- [fowt0, 0, 1, 0, -1600, -1600, 0 ]
9+
- [fowt1, 0, 1, 0, 0, -1600, 0 ]
10+
- [fowt2, 0, 1, 0, 1600, -1600, 0 ]
11+
- [fowt3, 0, 1, 0, -1600, 0, 0 ]
12+
- [fowt4, 0, 1, 0, 0, 0, 0 ]
13+
- [fowt5, 0, 1, 0, 1600, 0, 0 ]
14+
- [fowt6, 0, 1, 0, -1600, 1600, 0 ]
15+
- [fowt7, 0, 1, 0, 0, 1600, 0 ]
16+
- [fowt8, 0, 1, 0, 1600, 1600, 0 ]
17+
18+
platform:
19+
type : FOWT
20+
21+
# Array cables
22+
array_cables:
23+
keys: [ AttachA, AttachB, DynCableA, DynCableB, headingA, headingB, cableType]
24+
data:
25+
- [ fowt0, fowt1, suspended_1, None, 90, 270, None] # suspended cable, so only one dynamic cable configuration, no static cable
26+
- [ fowt1, fowt2, lazy_wave1, lazy_wave1, 90, 270, static_cable_66]
27+
28+
# Dynamic and cable configurations
29+
dynamic_cable_configs:
30+
# contains the subsections that make up each section of the subsea cable (i.e., what sections make up the lazywave cable in array_cable_1)
31+
lazy_wave1:
32+
name: Lazy wave configuration 1 (simpler approach)
33+
voltage: 66 # [kV]
34+
span : 195 # [m] horizontal distance to end of dynamic cable from attachment point
35+
A: 300 # cable conductor area [mm^2]
36+
cable_type: dynamic_cable_66 # ID of a cable section type from famodel/cables/cableProps_default.yaml. Cable props loaded automatically from this!
37+
length: 353.505 # [m] length (unstretched)
38+
rJTube : 5 # [m] radial distance from center of platform that J-tube is located
39+
40+
sections:
41+
- type: Buoyancy_750m # name of buoy type from famodel/cables/cableProps_default.yaml - buoy design info read in automatically from this!
42+
L_mid: 200 # [m] from platform connection
43+
N_modules: 6
44+
spacing: 11.23 # [m]
45+
V: 1 # [m^3]
46+
47+
48+
suspended_1:
49+
name: Dynamic suspended cable configuration 1
50+
voltage: 33 # [kV]
51+
span: 1512 # [m]
52+
cable_type: dynamic_cable_66 # ID of a cable section type from famodel/cables/cableProps_default.yaml. Cable props loaded automatically from this!
53+
A: 300 # cable conductor area [mm^2]
54+
length: 1550 # [m] length (unstretched)
55+
rJTube : 58 # [m] radial distance from center of platform that J-tube is located
56+
57+
sections:
58+
- type: Buoyancy_750m
59+
L_mid: 510 # [m] from end A
60+
N_modules: 6
61+
spacing: 18 # [m]
62+
V: 2 # [m^3]
63+
64+
- type: Buoyancy_750m
65+
L_mid: 1040 # [m] from end A
66+
N_modules: 6
67+
spacing: 18 # [m]
68+
V: 2 # [m^3]

0 commit comments

Comments
 (0)