Beruflich Dokumente
Kultur Dokumente
Sandia National Laboratories is a multi-program laboratory managed and operated by Sandia Corporation, a wholly owned subsidiary of Lockheed Martin
Corporation, for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000. SAND 2010-5138P.
1
Overview
• WEC-Sim
• Theory
• Getting Started
• Workflow
• Code Structure
• Output Structure
• Tutorials
• Collaboration (optional)
2
What is WEC-Sim?
WEC-Sim (Wave Energy Converter SIMulator)
US Department of Energy funded
Joint Sandia/NREL project
Open source code developed in MATLAB/SIMULINK
Time-domain rigid body equation of motion solver based on
Cummins’ formulation
Simulates wave energy converter dynamics in operational
waves
First Release: v1.0 in June 2014
Current Release: v1.2 in July 2015
3
Why use WEC-Sim?
WEC-Sim has the ability to model devices that are comprised of rigid bodies,
power-take-off systems, and mooring systems.
WEC-Sim uses hydrodynamic coefficients derived from frequency-domain
boundary element simulations to model the relevant hydrodynamics.
Time-domain simulations are performed by solving the governing WEC
equations of motion in 6 degrees-of-freedom.
4
THEORY
5
WEC-Sim Theory
Dynamics simulated by solving time-domain equation of motion
(Cummins, 1962)
mx(t ) f hs (t ) f ex (t ) f rad (t ) f v (t ) f pto (t ) f m (t )
Mooring force
Hydrostatic
Power take-off force
restoring force
Viscous force
Wave excitation &
diffraction force (from Radiation force: added mass and
BEM simulations) radiation damping (from BEM
simulations)
f rad (t ) f ex (t )
BEM BEM BEM
State space
Constant coeff BEM
6
WEC-Sim Theory - Cont
Calculated in BEMIO
Excitation IRF: Radiation IRF:
BEM BEM
5000
Buoy
4 4000 Spar/Plate
x 10
6 Coupled
Buoy 3000
Spar/Plate
5
2000
Radiation IRF
1000
3
0
Excitation IRF
2 -1000
1 -2000
-3000
0
-4000
-1 0 5 10 15 20 25
Time [s]
-2
-25 -20 -15 -10 -5 0 5 10 15 20 25
Time [s]
7
GETTING STARTED
8
MATLAB Toolboxes
List of required toolboxes
http://wec-sim.github.io/WEC-Sim/getting_started.html
9
WEC-Sim Open Source Code
Code Download
https://github.com/WEC-Sim/WEC-Sim
Online Documentation
http://wec-sim.github.io/WEC-Sim/index.html
Online Forum
https://github.com/WEC-Sim/WEC-Sim/issues
10
Adding WEC-Sim to path
Add WEC-Sim source code to path WEC-Sim/source
Open the wecSimStartup.m file
Paste the wecSimStartup.m into the startup.m file
>> open startup.m
Set the wecSimPath variable
Verify path was added
>> path
Verify WEC-Sim Simulink library available
>> simulink
(Refresh library browser by hitting F5)
http://wec-sim.github.io/WEC-Sim/getting_started.html#step-1-add-wec-sim-source-
code-to-matlab-path
11
WORKFLOW
12
12
Workflow
• Define WEC geometry
• 3D CAD model
• Mass properties
Pre- • Run BEM code
process • BEMIO
• Check BEMIO data
13
CODE STRUCTURE
14
14
Code Structure
15
Code Structure
OBJECT
PROPERTIES METHODS
INITIALIZATION OTHER
16
Code Structure
>> doc ptoClass
WEC-Sim objects: /source/objects/ptoClass.m
bodyClass
waveClass
simulationClass
ptoClass
constraintClass
responseClass
17
Code Structure
wecSim.m
“executable”
Reads input file
Uses the object’s properties and methods for pre- and post-processing
Runs the simulation
/source/wecSim.m
18
Code Structure
/tutorials/RM3/wecSimInputFile.m
Input File
Object initialization
Object properties
Default values
Object Initialization in Input File:
>> simu = simulationClass();
>> waves = waveClass(‘type’);
>> body(i) = bodyClass(‘h5file’,i);
>> pto(i) = ptoClass(‘name’);
>> constraint(i) = constraintClass(‘name’);
19
Code Structure
20
Code Structure
Body Class
Required:
mass: value, ‘equilibrium’, ‘fixed’
momOfInertia (except for ‘fixed’ mass)
geometryFile
h5File, hydroDataBodyNum (initialization)
Optional:
mooring
viscDrag
initDisp
linearDamping
Viz
bemioFlag
Useful input information:
hydroData
hydroForce 21
21
Code Structure
Wave Class
Type:
noWave
noWaveCIC
regular
regularCIC
Irregular
irregularImport
userDefined
Different variables required for each type
of wave
22
Code Structure
Simulation Class
Contains all simulation options (time, fluid
properties, solver, visualization, etc.)
Properties:
simMechanicsFile
startTime, endTime, dt, rampT, CITime
ssCalc, nlHydro
mode, solver
explorer, paraview, domainSize
rho, g
23
Code Structure
Constraint Class
name
loc
PTO Class
name
loc
k
c
24
Code Structure
WEC-Sim Library
Drag & Drop library
Mask
Simulink Model
Made of WEC-Sim
library blocks
Bodies, PTOs, and
constraints need to be
numbered
/source/lib/WEC-Sim/WECSim_Lib.slx
25
25
OUTPUT STRUCTURE
26
26
Output Structure
`output` variable = responseClass instance
Contains all time series from simulation
Properties:
bodies
ptos
constraints
ptosim
/tutorials/RM3/output/RM3_matlabWorkspace.mat
http://wec-sim.github.io/WEC-Sim/code_structure.html#output-structure
27
TUTORIALS
28
28
Tutorial: Oscillating Surge WEC
29
OSWEC Tutorial
WEC-Sim/\tutorials\OSWEC
30
Tutorial: Two-Body Floating-Point
Absorber
31
RM3 Tutorial
WEC-Sim/\tutorials\RM3
32
WEC-Sim Code
Run WEC-Sim Input File WEC-Sim GUI
(SimMechanics Explorer)
33
WEC-Sim Demo
WEC-Sim was demonstrated by modeling a two-body
floating point absorber WEC
Float
Central Column
Reaction Plate
34
WEC-Sim Demo
WEC-Sim has a built in “library” that includes common WEC components
By selecting several components from the library, users can build the WEC
device
SimuLink/SimMechanics Model
35
WEC-Sim Demo
WEC-Sim has a built in “library” that includes common WEC components
By selecting several components from the library, users can build the WEC
device
SimuLink/SimMechanics Model
36
WEC-Sim Demo
WEC-Sim has a built in “library” that includes common WEC components
By selecting several components from the library, users can build the WEC
device
SimuLink/SimMechanics Model
37
WEC-Sim Demo
WEC-Sim has a built in “library” that includes common WEC components
By selecting several components from the library, users can build the WEC
device
SimuLink/SimMechanics Model
38
WEC-Sim Demo & output
Run WEC-Sim Device Motion & Instantaneous Power
2 Output
Float
1.5 WEC-Sim Heave Response Spar/Plate
Heave (m)
1
0.5
-0.5
0 100 200 300 400 500 600 700 800 900 1000
Time (sec)
1000
WEC-Sim Power Output Power History
800 Time-Averaged Power
Power (kW)
600
400
39
COLLABORATION
40
40
Collaboration
GitHub
Online repository and version control
Option 1: non-collab
Clone
Pull
WEC-Sim/WEC-Sim
pull
Local clone of
WEC-Sim/WEC-Sim
41
Collaboration
Option 2: collab https://help.github.com/articles/using-pull-requests/
Fork https://help.github.com/articles/syncing-a-fork/
https://github.com/WEC-Sim/WEC-Sim
Clone
https://github.com/WEC-Sim/WEC-Sim/graphs/contributors
Pull Request
Sync Fork
pull request
FORK:
WEC-Sim/WEC-Sim
username/WEC-Sim
sync fork
pull
push
Local clone of
WEC-Sim/WEC-Sim
42
Thank you! kelley.ruehl@sandia.gov
carlos.michelen@sandia.gov
Acknowledgments
U.S. Department of Energy, Wind and Water Power Technologies Office 43
43
EXTRA CONTENT
44
44
• Bonus
– PTO-Sim (Nak)
– MoorDyn (Matt)
– Non-linear (Carlos)
– Visualization (Carlos)
45
KELLEY – TUTORIAL SLIDES
46
46
Start from Scratch Example
47
File Structure Overview
48
48