-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from WISDEM/hydro_2nd_order
Second-order wave loads in RAFT
- Loading branch information
Showing
8 changed files
with
12,563 additions
and
9,638 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# example script for running RAFT with QTFs precomputed with a frequency-domain hydrodynamics code (in WAMIT format) | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import yaml | ||
import raft | ||
import os.path as path | ||
|
||
# open the design YAML file and parse it into a dictionary for passing to raft | ||
flNm = 'OC3spar-WAMITQTF' | ||
with open('./examples/' + flNm + '.yaml') as file: | ||
design = yaml.load(file, Loader=yaml.FullLoader) | ||
|
||
# Create the RAFT model (will set up all model objects based on the design dict) | ||
model = raft.Model(design) | ||
|
||
# Evaluate the system properties and equilibrium position before loads are applied | ||
model.analyzeUnloaded() | ||
|
||
# Compute natural frequencie | ||
model.solveEigen() | ||
|
||
# Simule the different load cases | ||
model.analyzeCases(display=1) | ||
|
||
# Plot the power spectral densities from the load cases | ||
model.plotResponses() | ||
|
||
# Visualize the system in its most recently evaluated mean offset position | ||
model.plot(hideGrid=True) | ||
|
||
model.saveResponses(path.join(model.fowtList[0].outFolderQTF, flNm)) | ||
|
||
plt.show() | ||
|
||
# 0.02 | ||
# 12.37 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# example script for running RAFT with second-order loads computed internally with the slender-body approximation based on Rainey's equation | ||
|
||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
import yaml | ||
import raft | ||
import os.path as path | ||
|
||
# open the design YAML file and parse it into a dictionary for passing to raft | ||
flNm = 'OC3spar-SlenderBodyQTF' | ||
with open('./examples/' + flNm + '.yaml') as file: | ||
design = yaml.load(file, Loader=yaml.FullLoader) | ||
|
||
# Create the RAFT model (will set up all model objects based on the design dict) | ||
model = raft.Model(design) | ||
|
||
# Evaluate the system properties and equilibrium position before loads are applied | ||
model.analyzeUnloaded() | ||
|
||
# Compute natural frequencie | ||
model.solveEigen() | ||
|
||
# Simule the different load cases | ||
model.analyzeCases(display=1) | ||
|
||
# Plot the power spectral densities from the load cases | ||
model.plotResponses() | ||
|
||
# Visualize the system in its most recently evaluated mean offset position | ||
model.plot(hideGrid=True) | ||
|
||
# Save the response to a given output folder | ||
outFolder = './examples/' | ||
model.saveResponses(path.join(outFolder, flNm)) | ||
|
||
plt.show() | ||
|
||
# 0.02 | ||
# 12.37 |
19,152 changes: 9,576 additions & 9,576 deletions
19,152
examples/IEA-15-240-RWT-UMaineSemi.12d → examples/oc3_hywind.12d
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.