Skip to content

Commit 024fba8

Browse files
committed
Add visualization examples detailed
1 parent 0cddc40 commit 024fba8

15 files changed

+1472
-31
lines changed

examples/01_Visualization/02_visual_moorings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
# plot
2020
project.plot2d()
2121

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+
2227
plt.show()
2328

24-
project.unload()

examples/01_Visualization/03_visual_cables.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@
1919
# plot
2020
project.plot2d()
2121

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+
2227
plt.show()
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Simple driver file to create a 2d plot of bathymetry.
4+
The input file only contains the bare minimum information to build a 2d and 3d plot
5+
of the bathymetry (no platforms, moorings, cables, platform design, turbines,
6+
site condition information, etc.)
7+
"""
8+
9+
from famodel import Project
10+
import matplotlib.pyplot as plt
11+
12+
# define name of ontology input file
13+
input_file = '04_visual_bathymetry.yaml'
14+
15+
# initialize Project class with input file, we don't need RAFT for this so mark False
16+
project = Project(file=input_file,raft=False)
17+
18+
# plot
19+
project.plot2d()
20+
21+
project.plot3d()
22+
23+
plt.show()
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Site condition information
2+
site:
3+
general: {}
4+
bathymetry:
5+
file: './bathymetry200m_sample.txt'
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Site condition information
2+
site:
3+
general: {}
4+
seabed:
5+
# file : './soil_sample.txt' # soil info can also be added with moorpy soil file type
6+
x : [-10901, 0, 10000]
7+
y : [-10900, 0, 10000]
8+
9+
type_array:
10+
- [mud_hard , mud_hard , mud_hard]
11+
- [mud_hard , mud_hard , mud_hard]
12+
- [mud_hard , mud_hard , mud_hard]
13+
14+
soil_types:
15+
mud_hard:
16+
Su0: [50]
17+
k: [1.0]
18+
gamma: [9.5]
19+
depth: [0]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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 = '06_visual_lease_boundaries.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+
project.plot3d()
23+
24+
plt.show()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Site condition information
2+
site:
3+
general: {}
4+
boundaries: # project or lease area boundary, via file or vertex list
5+
file: # filename of x-y vertex coordinates [m] (alternative to x_y method below)
6+
x_y: # list of polygon vertices in order [m]
7+
- [-2500, -2500]
8+
- [-2500, -800]
9+
- [2500, -800]
10+
- [2500, -2500]
11+
- [-2500, -2500]
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 = '07_3D-visual_platform.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=True)
16+
17+
# plot
18+
project.plot3d(fowt=True)
19+
20+
plt.show()
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
2+
# Site inputs
3+
site:
4+
general:
5+
water_depth: 200
6+
7+
8+
# ----- Array-level inputs -----
9+
10+
# Wind turbine array layout
11+
array:
12+
keys : [ID, topsideID, platformID, mooringID, x_location, y_location, heading_adjust]
13+
data : # ID# ID# ID# [m] [m] [deg]
14+
- [fowt0, 0, 1, 0, -1600, -1600, 180 ]
15+
- [fowt1, 0, 1, 0, 0, -1600, 0 ] # 2 array, shared moorings
16+
- [fowt2, 0, 1, 0, 1600, -1600, 0 ]
17+
- [fowt3, 0, 1, 0, -1600, 0, 0 ]
18+
- [fowt4, 0, 1, 0, 0, 0, 45 ]
19+
- [fowt5, 0, 1, 0, 1600, 0, 0 ]
20+
- [fowt6, 0, 1, 0, -1600, 1600, 0 ]
21+
- [fowt7, 0, 1, 0, 0, 1600, 0 ]
22+
- [fowt8, 0, 1, 0, 1600, 1600, 0 ]
23+
24+
platform:
25+
# RAFT platform description needed for 3d visual of platform
26+
potModMaster : 1 # [int] master switch for potMod variables; 0=keeps all member potMod vars the same, 1=turns all potMod vars to False (no HAMS), 2=turns all potMod vars to True (no strip)
27+
dlsMax : 5.0 # maximum node splitting section amount for platform members; can't be 0
28+
qtfPath : 'IEA-15-240-RWT-UMaineSemi.12d' # path to the qtf file for the platform
29+
rFair : 58
30+
zFair : -14
31+
type : FOWT
32+
z_location : 0 # optional to put the depth of this platform type
33+
34+
members: # list all members here
35+
36+
- name : center_column # [-] an identifier (no longer has to be number)
37+
type : 2 # [-]
38+
rA : [ 0, 0, -20] # [m] end A coordinates
39+
rB : [ 0, 0, 15] # [m] and B coordinates
40+
shape : circ # [-] circular or rectangular
41+
gamma : 0.0 # [deg] twist angle about the member's z-axis
42+
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
43+
# --- outer shell including hydro---
44+
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
45+
d : 10.0 # [m] diameters if circular or side lengths if rectangular (can be pairs)
46+
t : 0.05 # [m] wall thicknesses (scalar or list of same length as stations)
47+
Cd : 0.6 # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
48+
Ca : 0.93 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
49+
CdEnd : 0.6 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
50+
CaEnd : 1.0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
51+
rho_shell : 7850 # [kg/m3]
52+
# --- handling of end caps or any internal structures if we need them ---
53+
cap_stations : [ 0 ] # [m] location along member of any inner structures (in same scaling as set by 'stations')
54+
cap_t : [ 0.001 ] # [m] thickness of any internal structures
55+
cap_d_in : [ 0 ] # [m] inner diameter of internal structures (0 for full cap/bulkhead, >0 for a ring shape)
56+
57+
58+
- name : outer_column # [-] an identifier (no longer has to be number)
59+
type : 2 # [-]
60+
rA : [51.75, 0, -20] # [m] end A coordinates
61+
rB : [51.75, 0, 15] # [m] and B coordinates
62+
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
63+
shape : circ # [-] circular or rectangular
64+
gamma : 0.0 # [deg] twist angle about the member's z-axis
65+
potMod : True # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
66+
# --- outer shell including hydro---
67+
stations : [0, 35] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
68+
d : 12.5 # [m] diameters if circular or side lengths if rectangular (can be pairs)
69+
t : 0.05 # [m] wall thicknesses (scalar or list of same length as stations)
70+
Cd : 0.6 # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
71+
Ca : 0.93 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
72+
CdEnd : 1.0 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
73+
CaEnd : 0.7 # value of 3.0 gives more heave response # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
74+
rho_shell : 7850 # [kg/m3]
75+
# --- ballast ---
76+
l_fill : 1.4 # [m]
77+
rho_fill : 5000 # [kg/m3]
78+
# --- handling of end caps or any internal structures if we need them ---
79+
cap_stations : [ 0 ] # [m] location along member of any inner structures (in same scaling as set by 'stations')
80+
cap_t : [ 0.001 ] # [m] thickness of any internal structures
81+
cap_d_in : [ 0 ] # [m] inner diameter of internal structures (0 for full cap/bulkhead, >0 for a ring shape)
82+
83+
84+
- name : pontoon # [-] an identifier (no longer has to be number)
85+
type : 2 # [-]
86+
rA : [ 5 , 0, -16.5] # [m] end A coordinates
87+
rB : [ 45.5, 0, -16.5] # [m] and B coordinates
88+
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
89+
shape : rect # [-] circular or rectangular
90+
gamma : 0.0 # [deg] twist angle about the member's z-axis
91+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
92+
# --- outer shell including hydro---
93+
stations : [0, 40.5] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
94+
d : [12.4, 7.0] # [m] diameters if circular or side lengths if rectangular (can be pairs)
95+
t : 0.05 # [m] wall thicknesses (scalar or list of same length as stations)
96+
Cd : [1.5, 2.2 ] # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
97+
Ca : [2.2, 0.2 ] # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
98+
CdEnd : 0.0 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
99+
CaEnd : 0.0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
100+
rho_shell : 7850 # [kg/m3]
101+
l_fill : 40.5 # [m]
102+
rho_fill : 1025.0 # [kg/m3]
103+
104+
105+
- name : upper_support # [-] an identifier (no longer has to be number)
106+
type : 2 # [-]
107+
rA : [ 5 , 0, 14.545] # [m] end A coordinates
108+
rB : [ 45.5, 0, 14.545] # [m] and B coordinates
109+
heading : [ 60, 180, 300] # [deg] heading rotation of column about z axis (for repeated members)
110+
shape : circ # [-] circular or rectangular
111+
gamma : 0.0 # [deg] twist angle about the member's z-axis
112+
potMod : False # [bool] Whether to model the member with potential flow (BEM model) plus viscous drag or purely strip theory
113+
# --- outer shell including hydro---
114+
stations : [0, 1] # [-] location of stations along axis. Will be normalized such that start value maps to rA and end value to rB
115+
d : 0.91 # [m] diameters if circular or side lengths if rectangular (can be pairs)
116+
t : 0.01 # [m] wall thicknesses (scalar or list of same length as stations)
117+
Cd : 0.0 # [-] transverse drag coefficient (optional, scalar or list of same length as stations)
118+
Ca : 0.0 # [-] transverse added mass coefficient (optional, scalar or list of same length as stations)
119+
CdEnd : 0.0 # [-] end axial drag coefficient (optional, scalar or list of same length as stations)
120+
CaEnd : 0.0 # [-] end axial added mass coefficient (optional, scalar or list of same length as stations)
121+
rho_shell : 7850 # [kg/m3]
122+
123+
124+
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 = '08_3D-visual_turbine.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=True)
16+
17+
# plot
18+
project.plot3d(fowt=True)
19+
20+
plt.show()

0 commit comments

Comments
 (0)