Skip to content

Conversation

@dforbush2
Copy link
Contributor

@dforbush2 dforbush2 commented Aug 11, 2021

This PR consists of 3 new additions:

  • 1 DOF cable block
  • 3 DOF cable block
  • Spherical constraint

Significant modifications are to:

  • wecSim.m
  • wecSim_lib.slx (only the added blocks)
  • responseClass
  • simulationClass
  • postprocess

Added files:

  • cableClass

The 3 DOF cable uses a modification of the spherical constraint: the included block is distinct from the /constraint/spherical constraint.

To facilitate testing, I have also added ./examples/cable which runs a quick example, but this is intended to be deleted upon PR approval and re-uploaded to the applications repo.

@dforbush2 dforbush2 requested a review from akeeste August 11, 2021 18:30
@akeeste
Copy link
Contributor

akeeste commented Aug 13, 2021

@dforbush2 This PR is showing a lot of updates that are actually trying to change files back to a point in v4.2 (wecSim.m, simulationClass.m, responseClass.m line 56-59). Can you update your branch to avoid these extra changes? In the meantime I'll review the cable implementation.

@akeeste akeeste added the Feature new feature request label Aug 13, 2021
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dforbush2 I'm still going through some of the class and block details, but my main thought so far is on the end constraints. What is the reasoning for putting the end constraints (spherical or fixed) in the cable block? I suggest we make users define 2 extra constraints or ptos outside of the cableClass. The cable can be used in Simulink with the following connections:
Body -- Constraint/PTO -- Cable -- Constraint/PTO -- body

This will make the cableClass more like a body-pto combination, instead of body-ptox3, and will clean up the class properties. This would eliminate the need for separate 1DOF and 3DOF cables and allow users to create whatever end constraints they want. The top/bottom joint motion can be calculated with our motion sensor block. There will be a lot less class properties that users need to define.

sphere_out.stl -- since this is required in the cable's drag bodies and users can't change it, move to the source folder. However if users won't input an .stl file, we can turn the 'Body Properties' (mesh input) into a Simscape Inertia with a generic sphere shape. Then no .stl file is necessary.

WECSim_Lib.slx:

  • Add the cable on top of the v4.3 changes. Right now this can't run from Simulink. I can help set-up the callbacks for the cable once the implementation is finalized.
  • move calcCableTens() to a .m file per #654 #661
  • set cable1_out decimation to round(simu.dtOut/simu.dt,0) per other to workspace blocks

RM3_cable.slx -- Link the 3dof Cable to the library. Maybe make this an application? We can likely move the RM3_runFromSimulink to an application case too.

'color', [1 0 0.5], ... %
'opacity', 1) % Structure defining visualization properties in either SimScape or Paraview. ``color`` (`3x1 float vector`) is defined as the body visualization color, Default = [``1 1 0``]. ``opacity`` (`integer`) is defined as the body opacity, Default = ``1``.
bodyparaview = 1; % (`integer`) Flag for visualisation in Paraview either 0 (no) or 1 (yes). Default = ``1`` since only called in paraview.
bodyInertia = [ 1 1 1]; % (`1 x 3 float vector`) body inertia kg-m^2, default [1 1 1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--> momOfInertia see mass comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I prefer keeping it somewhat clear, whether here or in the documentation, that this is the inertia/mass of the low-order lumped capacitance nodes rather than the cable itself, since the MOI of a flexible cable is complicated. That was my justification for not calling these cable.mass and cable.inertia, but this may not have been a better solution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I see your reasoning. I guess if I was a user implementing a cable in WEC-Sim for the first time, I wouldn't know about the dummy bodies being used behind the scenes. I would probably approach this with a total mass or mass/length of the cable, but might be confused if the input file requires the mass or inertia of half the cable.

@kmruehl kmruehl self-requested a review August 25, 2021 23:03
@akeeste
Copy link
Contributor

akeeste commented Aug 25, 2021

@dforbush2 There are a few library updates that we'll need before I can review this again. I can't run the example right now because its not linked to the library. When I replaced the example with the library cable, I get the error::
Failed to load library 'WECSim_Lib_dev' referenced by 'RM3_cable/3DOF Cable/Drag Body1/Structure/Motion Sensor'.

It looks like the motion sensors are tied to the wrong library. Can you go through the library and check for these issues? (and save in 2019b).

We should also look at getting a section in the advanced features documentation and a CI test for the cable. Whether that is here or in the Applications repo will depend on where the example ends up.

@kmruehl kmruehl added the Constraint Class Constraint Class (constraintClass.m) label Aug 27, 2021
@akeeste akeeste self-requested a review September 1, 2021 22:46
@akeeste
Copy link
Contributor

akeeste commented Sep 2, 2021

@dforbush2 @kmruehl a few more comments below. I didn't have time to write out all my thoughts before I'm off work next week, but I didn't want to hold up your development. I think it would be easier to discuss this live when I'm back rather then trading comments over github.

  1. I'm having trouble envisioning what the 1 DOF cable physically represents. If the cable ends are fixed to the body without rotation, then the cable becomes a type of telescoping pendulum. What kind of cable would this represent? I can't picture the kind of real body that results in these constraints.

  2. The cableClass.setL0() method uses rotloc1 and rotloc2 (spherical joints) to define the equilibrium length, but the simulink model uses the dummy drag body positions for the cable length. This is going to result in strange behavior if rotloc1 ~= cg1 or rotloc2 ~= cg2. Also with regards to the dummy bodies: I feel that the cable is currently halfway between two models:

    • simplified model that only takes the position of the spherical joints and applies stiffness/damping when in tension
    • a complex lumped capacitance model with a series of nodes (dummy drag bodies with drag, buoyancy, mass)

    This combination of the two above is making this difficult to understand. I think if we committed to one or the other (or had a separate cable block for each), this would be more clear.

  3. Why does the translational PTO allow for bidirectional stiffness/damping? Seems counterintuitive.

@akeeste
Copy link
Contributor

akeeste commented Sep 22, 2021

@dforbush2 @kmruehl Just looked back on this in preparation for v4.4 release--
In addition to an advanced features section, we need to:

  • merge with other dev library changes
  • move the example to the applications repo and set-up a CI test there
  • complete the Run from Simulink capability
  • finish discussing naming/implementation
  • any items from Kelley's review

I can do the run from Simulink capability, but need to completely hammer out the implementation before doing that (see items in previous comment). I think there's some renaming we can do to clarify things and that we can probably reduce the number of user-defined options. IMO the number of options makes the implementation a bit overwhelming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Constraint Class Constraint Class (constraintClass.m) Feature new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants