Open mancellin opened 6 years ago
Actually it seems that the x
and y
coordinates given in the cog
argument have no influence on the results.
Looking at this a bit more, here's my current understanding:
stiffness: I think there was a bit of a problem here, which I've submitted a fix for with #22 (note however that what I've done is not yet propagated back to the Hydrostatics
class; if you think it looks good we can finish doing this).
hydrostatics: these look like they are currently calculated relative to a point on a vertical line passing through origin but with the correct vertical position:
This section uses the x and y location of the origin (xi, yi = polyverts[0, :2]
)
https://github.com/LHEEA/meshmagick/blob/0d214f94d444c55cfc2ecce830e57de08793bf2f/meshmagick/hydrostatics.py#L605-L621
This section uses the vertical location of the cog (self.zg
)
https://github.com/LHEEA/meshmagick/blob/0d214f94d444c55cfc2ecce830e57de08793bf2f/meshmagick/hydrostatics.py#L653-L655
Thus, it might be appropriate to change this method so that it calculates based on COG, right?
This line would be changed to polyverts = clipper.clipped_crown_mesh.vertices[polygon] - self._gravity_center
related to #1
I just released v3.0 which should fix these issues.
Note however that I have totally refactored the hydrostatics module using only functions with no class. The code is far more simple and the number of lines of code has lowered.
The stiffness matrix and metacentric stuffs are now expressed on a line passing though COG/buoyancy centre.
Positions such as buoyancy centre are expressed in the initial frame. It allows to directly compare results to other commercial software such as Maat Hydro.
I'm not actually sure if this is a bug or a feature that I don't understand:
The inertia matrix is invariant when the body is translated in the
x
direction. I would have expected the same to be true for the stiffness matrix. Are the rotation dofs defined around the same axis in both cases ?