Sie sind auf Seite 1von 48

SAND2015-10623C

WEC-Sim Training Course


DRY RUN 10/7/2015

K. Ruehl and Carlos Michelen


INORE 2015, Friday Harbor Labs

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)
mx(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)

 Use radiation and diffraction method and calculate the hydrodynamic


forces from frequency-domain Boundary Element Method (BEM)

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]

Infinite Added Mass:


BEM

7
GETTING STARTED

8
MATLAB Toolboxes
 List of required toolboxes

 Ensure required toolboxes are installed


>> ver

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

• Build Simulink model


• Write input file
• Wave conditions
• Simulation parameters
WEC-Sim • Body properties
• PTO/constraints
• Run WEC-Sim

• Analyze WEC-Sim results


Post-
Process

13
CODE STRUCTURE

14

14
Code Structure

 WEC-Sim source code:


/source
 Simulink Library
 Matlab objects .m files
 wecSim.m (“executable”)

15
Code Structure

 Object Oriented Programming

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

Initialize simulation class

Sets other simulation


class properties

Initialize wave class

Sets other wave class


properties
Initialize one instance of
body class
Sets other properties for
Initialize secondofinstance
first instance body
of body class
class
Sets other properties for
second instance of body
Initialize one instance of
class
constraint class
Initialize one instance of
Sets other properties for
pto class
first instance of
Setsconstraint class for
other properties
first instance of pto
class
20

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.)

 Contains flags for different options (state


space, non-linear hydro, 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

 loc required for rotational PTOs


& Constraints

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

Simulating a two-body floating point absorber with


slack mooring

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

Simulating a two-body floating point absorber with


slack mooring

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

Simulating a two-body floating point absorber with


slack mooring

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

Simulating a two-body floating point absorber with


slack mooring

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

200 Averaged Power = 114 kW


WEC-Sim GUI and Simulation 0
0 100 200 300 400 500 600 700 800 900 1000
Visualization Time (sec)

Power Matrix (Irregular Waves)


Energy Period, Te [sec]
4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5 12.5 13.5 14.5 15.5 16.5 17.5
0.75 5 8 10 11 13 14 15 14 13 12 10 10 8 7

Significant Wave Height, Hs [m]


1.25 14 22 27 31 37 37 38 37 33 31 26 24 20 12
1.75 28 42 52 61 70 71 71 68 61 57 48 44 36 21
2.25 45 69 84 99 114 113 113 107 96 89 75 70 57 32
2.75 66 102 124 146 167 164 162 152 137 127 108 100 82 46
3.25 91 140 171 202 230 224 218 204 185 172 145 135 110 64
3.75 119 183 226 266 301 292 282 264 239 222 188 175 142 85
4.25 151 232 287 337 380 367 353 331 299 278 235 219 179 108
4.75 186 286 355 416 468 451 432 404 365 339 287 267 218 135
5.25 224 344 429 503 563 541 518 483 437 405 343 320 262 165
5.75 265 408 510 597 666 639 610 569 515 477 404 377 309 199
5.2 6.4 7.5 8.7 9.9 11.0 12.2 13.3 14.5 15.7 16.8 18.0 19.1 20.3
Peak Period, Tp [sec]

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

Das könnte Ihnen auch gefallen