Skip to content

Conversation

@lilnguy
Copy link
Contributor

@lilnguy lilnguy commented Aug 28, 2020

Update Morison Element block to decompose the fluid and body motion to tangential and normal components to consider the magnitude in the calculation for the Morison force.

@kmruehl kmruehl requested a review from nathanmtom September 16, 2020 22:37
@kmruehl kmruehl added Drag/Morison related to drag body (body(i).nhBody = 2) or morison element (simu.morisonElement) Feature new feature request labels Sep 16, 2020
@nathanmtom
Copy link

@lilnguy Thank you for this pull request! The changes you made to the Body and Response classes look good. Unfortunately, I cannot open your WECSim library block as it has been saved as a Matlab 2020 version. We save the WECSim library block as a 2015b version to allow use with past versions of Matlab. If possible can you export the library block as a 2015b version and add to the pull request for review?

@kmruehl kmruehl changed the base branch from master to dev October 9, 2020 21:29
@kmruehl
Copy link
Collaborator

kmruehl commented Oct 9, 2020

@lilnguy I just created a dev branch and modified this PR so that it submits change to 'dev' instead of 'master'

@kmruehl
Copy link
Collaborator

kmruehl commented Oct 9, 2020

@lilnguy Can you let @nathanmtom push to your fork so that he can make revisions too? see info here. @nathanmtom this gives you the option to make minor changes to the PR, like saving the *.slx file to 2015b.

@kmruehl kmruehl added the Body Class Body Class (bodyClass.m) label Oct 14, 2020
@kmruehl
Copy link
Collaborator

kmruehl commented Oct 15, 2020

@lilnguy my apologies! I misspoke, I thought this PR was from your fork, not from a branch on the main repository. @nathanmtom should be able to save the *.slx file to a previous version of MATLAB by pushing directly to the Morison branch.

This commit has verified the implementatino of the normal and tangential Morison Element written by the initial pull request developer. The WEC-Sim team has chosen to keep both implementations active for users. Therefore, additional code development was needed to make this possible for the end user.
@nathanmtom
Copy link

@kmruehl and @yuyihsiang I've realized that I need to make an update to the WEC-Sim library. So wait until the next push before taking a deeper dive into the Morison Element update.

nathanmtom added 3 commits October 29, 2020 13:42
Updating the WECSim_Lib.slx.

It appears that the conflict resolution over wrote the updates in the Morison Element block. Therefore, had to reconfigure the ME and make a correction in the calculation as well.
Adding to the documentation after being able to compile locally.
Update the WECSim_Lib.slx to fix broken links in the Flex Body block.
@nathanmtom
Copy link

@kmruehl @yuyihsiang I've updated the WECSim_Lib.slx to fix the broken links in the Flex Body block. With this last commit, the update is now ready for review.

@kmruehl
Copy link
Collaborator

kmruehl commented Oct 30, 2020

@nathanmtom I get an error when I run simu.morisonElement = 1; with the Free_Decay 1m-ME application case. Do you also get this error?

Error using wecSim (line 316)
Derivative of state 'sphere.Floating_3DOF.CONSTRAINT_Planar_Joint.Px.v' in block
'sphere/Floating (3DOF)/CONSTRAINT (Planar Joint)' at time 0.0 is not finite. The simulation
will be stopped. There may be a singularity in the solution.  If not, try reducing the step
size (either by reducing the fixed step size or by tightening the error tolerances)

@nathanmtom
Copy link

@kmruehl Yes, because the application case hasn't been updated to include the following:

body(1).morisonElement.z = [0 1 0];

with

simu.morisonElement = 1;

without defining the .z vector to be a normal vector, not [0 0 0] which is the default initialization, there will be a situation where there will be a division by 0 and thus a singularity in the solution.

I'll see if I can have the code check the variable is non zero and is a unit normal.

I did edit the applications case to show how you need to run both option 1 and option 2, but haven't pushed it since this pull request is not yet incorporated into master branch.

Code updates were made to the bodyClass.m and wecSim.m files to check when using option 1 for the Morison Element that the body(i).morisonElement.z vector is a unit normal vector.
@nathanmtom
Copy link

@kmruehl I've updated the body(ii).checkinputs function to check to make sure the body(i).morisonElement.z vectors are unit normal vectors.

Updated the attached files to keep simu.morisonElement = 1 the same as the past implementation which setting simu.morisonElement = 2 for the new normal and tangential formulation.
@nathanmtom
Copy link

@kmruehl @yuyihsiang The updates to the Morison Element calculation which has set simu.morisonElement = 1 option to the original formulation have been completed. The WEC-Sim_Applications Free Decay example now works with backwards compatibility.

@kmruehl
Copy link
Collaborator

kmruehl commented Oct 30, 2020

@nathanmtom thanks for adding the warning glad related to not defining body(1).morisonElement.z = [0 1 0];

kmruehl and others added 2 commits October 30, 2020 13:42
Update the WECSim_Lib.slx Flex Body block. The wave diffraction and excitation block as well as the hydrostatic restoring block cannot be linked to their equivalent block in the rigid body block.
@nathanmtom
Copy link

@kmruehl The update library with the corrected Flex Body block links has been uploaded to the Morison branch.

@kmruehl kmruehl merged commit 28dcf1c into dev Oct 30, 2020
@kmruehl kmruehl deleted the Morison branch October 30, 2020 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Body Class Body Class (bodyClass.m) Drag/Morison related to drag body (body(i).nhBody = 2) or morison element (simu.morisonElement) Feature new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants