@@ -62,50 +62,14 @@ or link to another software.
6262Running from Simulink
6363"""""""""""""""""""""
6464
65- WEC-Sim can also be run directly from Simulink.
66- The Run From Simulink advanced feature allows users to initialize WEC-Sim from the command window and then begin the simulation from Simulink.
67- This allows greater compatibility with other models or hardware-in-the-loop simulations that must start in Simulink.
68- The WEC-Sim library contains mask options that allow users to either:
69-
70- 1. Define an standard input file to use in WEC-Sim or
71- 2. Define custom parameters inside the block masks.
72-
73- The Global Reference Frame mask controls whether an input file or custom
74- parameters are used for WEC-Sim. Note that when the Custom Parameters options is
75- selected, WEC-Sim will only use those variable in the block masks. Certain options
76- become visible when the correct flag is set. For example, ``body.morisonElement.cd ``
77- will not be visible unless ``body.morisonElement.on > 0 ``. This method of running
78- WEC-Sim may help some users visualize the interplay between the blocks and classes.
79- For more information on how the blocks and classes are related, see the
80- :ref: `user-code-structure ` section.
81-
82- To run WEC-Sim from Simulink, open the Simulink ``.slx `` file and choose whether to
83- use an input file or custom parameters in the Global Reference Frame. Next type
84- ``initializeWecSim `` in the MATLAB Command Window. Then, run the model from the
85- Simulink interface. Lastly, after the simulation has completed, type ``stopWecSim ``
86- in the MATLAB Command Window to run post-processing.
87-
88- * Run from Simulink with a wecSimInputFile.m
89- * Open the WEC-Sim Simulink file (``.slx ``).
90- * Set the Global Reference Frame to use an input file
91- * Type ``initializeWecSim `` in the Command Window
92- * Run the model from Simulink
93- * Wait for the simulation to complete, then type ``stopWecSim `` in the Command Window
94- * Run from Simulink with custom parameters
95- * Open the Simulink file (``.slx ``).
96- * Set the Global Reference Frame to use custom parameters
97- * (Optional) prefill parameters by loading an input file.
98- * Edit custom parameters as desired
99- * Type ``initializeWecSim `` in the Command Window
100- * Run the model from Simulink
101- * Wait for the simulation to complete, then type ``stopWecSim `` in the Command Window
102-
103- After running WEC-Sim from Simulink with custom parameters, a
104- ``wecSimInputFile_simulinkCustomParameters.m `` file is written to the ``$CASE ``
105- directory. This file specifies all non-default WEC-Sim parameters used for the
106- WEC-Sim simulation. This file serves as a record of how the case was run for
107- future reference. It may be used in the same manner as other input files when
108- renamed to ``wecSimInputFile.m ``
65+ WEC-Sim can also be run directly from Simulink with the following steps:
66+
67+ * Type ``initializeWecSim `` in the Command Window
68+ * Run the model from Simulink and wait for the simulation to complete
69+ * Type ``stopWecSim `` in the Command Window
70+
71+ This allows users to initialize WEC-Sim from the command window and then start the simulation from Simulink,
72+ allowing for greater compatibility with other models or hardware-in-the-loop simulations.
10973
11074
11175.. _user-advanced-features-mcr :
@@ -797,8 +761,8 @@ To enable second-order excitation forces in WEC-Sim, use the following flag in y
797761
798762.. _user-advanced-features-non-hydro-body :
799763
800- Non-Hydrodynamic Bodies
801- ^^^^^^^^^^^^^^^^^^^^^^^
764+ Drag Bodies
765+ ^^^^^^^^^^^
802766
803767For some simulations, it might be important to model bodies that do not have
804768hydrodynamic forces acting on them. This could be bodies that are completely
@@ -807,52 +771,32 @@ or it could be bodies deeply submerged to the point where the hydrodynamics may
807771be neglected. WEC-Sim allows for bodies which have no hydrodynamic forces
808772acting on them and for which no BEM data is provided.
809773
810- To do this, use a Body Block from the WEC-Sim Library and initialize it in the
774+ To do this, use the Drag Body block from the WECSim_Lib_Body_Drag Library and initialize it in the
811775WEC-Sim input file as any other body but leave the name of the ``h5 `` file as
812- an empty string. Specify :code: `body(i).nonHydro = 1; ` and specify body name,
776+ an empty string. Specify :code: `body(i).nonHydro; `, body name,
813777mass, moments of inertia, center of gravity, center of buoyancy, geometry file,
814778location, and displaced volume. You can also specify visualization options and
815779initial displacement.
816780
817- To use non-hydrodynamic bodies, the following body class variable must be
781+ To use drag bodies, the following body class variable must be
818782defined in the WEC-Sim input file, for example::
819783
820- body(i).nonHydro = 1
784+ body(i).nonHydro = 1; % or
785+ body(i).nonHydro = 2;
821786
822- Non-hydrodynamic bodies require the following properties to be defined::
787+ Drag bodies require the following properties to be defined::
823788
824789 body(i).mass
825790 body(i).inertia
826791 body(i).centerGravity
827792 body(i).volume
828-
829- In the case where only non-hydrodynamic and drag bodies are used, WEC-Sim does
830- not read an ``*.h5 `` file. Users must define these additional parameters to
831- account for certain wave settings as there is no hydrodynamic body present in
832- the simulation to define them::
833793
834- waves.bem.range
835- waves.waterDepth
836-
837-
838- For more information, refer to :ref: `webinar2 `, and the **Nonhydro_Body **
839- example on the `WEC-Sim Applications
840- <https://github.com/WEC-Sim/WEC-Sim_Applications> `_ repository.
841-
842- Drag Bodies
843- ^^^^^^^^^^^
844-
845- A body may be subjected to viscous drag or Morison forces, but does not
846- experience significant wave excitation or radiation. And example may be a
794+ Drag bodies with no additional forces acting on them become non-hydrodynamic, no fluid forces act on them,
795+ but they still couple other bodies together, and influence the multibody simulation.
796+ If a drag body is not subject to wave excitation, but damping, added mass, or viscous drag are still a concern,
797+ viscous drag, linear damping, or Morison element forces may be defined. An example of this body type is a
847798deeply-submerged heave plate of large surface area tethered to a float. In
848- these instances, the drag body implementation can be utilized by defining the
849- following body class variable::
850-
851- body(i).nonHydro = 2
852-
853-
854- Drag bodies have zero wave excitation or radiation forces, but viscous forces
855- can be applied in the same manner as a hydrodynamic body via the parameters::
799+ these instances, the additional forces can be specified by the parameters:
856800
857801 body(i).quadDrag.drag
858802 body(i).quadDrag.cd
@@ -867,17 +811,22 @@ or if using Morison Elements::
867811 body(i).morisonElement.VME
868812 body(i).morisonElement.rgME
869813
870- which are described in more detail in the forthcoming section. At a minimum, it
871- is necessary to define::
872-
873- body(i).mass
874- body(i).inertia
875- body(i).centerGravity
876- body(i).volume
877-
878- to resolve drag body dynamics. One can additionally describe initial body
814+ One can additionally describe initial body
879815displacement in the manner of a hydrodynamic body.
880816
817+ In the case where only drag bodies are used, WEC-Sim does
818+ not read an ``*.h5 `` file. Users must define these additional parameters to
819+ account for certain wave settings as there is no hydrodynamic body present in
820+ the simulation to define them::
821+
822+ waves.bem.range
823+ waves.waterDepth
824+
825+ For more information, refer to :ref: `webinar2 `, and the **Nonhydro_Body **
826+ example on the `WEC-Sim Applications
827+ <https://github.com/WEC-Sim/WEC-Sim_Applications> `_ repository.
828+
829+
881830.. _user-advanced-features-b2b :
882831
883832Body-To-Body Interactions
0 commit comments