Cross-validation of DAVE and Orcaflex Hydrostatics#

Build a scene with the example barge ballasted down to 4m draft by goal-seeking the mass

from DAVE import *
s = Scene('100x30x8_barge.dave')

s.goal_seek(evaluate="s['Barge'].z",
    target=-4.0,
    change="s['Barge'].mass")

s.solve_statics()
Loading c:\python\miniconda3\envs\book\Lib\site-packages\DAVE\resources\100x30x8_barge.dave
Attempting to evaluate s['Barge'].z to -4.0 (now 0.0)
By changing the value of ("s['Barge'].mass",) (now 5000.0)
setting 5000.0 results in -1.6260162601572348
setting 5000.0001 results in -1.6260162926647246
setting 12302.882412937675 results in -4.000937370083893
setting 12299.99999992974 results in -4.000000000200788
      converged: True
           flag: 'converged'
 function_calls: 4
     iterations: 3
           root: 12299.999999312318
True

Show the model

from DAVE.jupyter import *
show(s, show_global = True, camera_pos = (158.99328689012356, -83.11396799310523, 14.821261537388635), lookat = (18.24840759806191, 36.62760209655524, -6.699510976000989), force_do_normalize= True, force_scale = 1.6, cog_scale = 0.25, painters="Visual")
No actors created for node Barge Ballast system
../_images/bdccd1057c08b1d126c3fd96ae83d9b1a07a7f2d73b1f7cc543f8d5fa8732172.png

The buoyancy of the model comes from a buoyancy mesh. Unfortunately Orcaflex does not support meshes as buoyancy objects.

The DAVE.marine package provides a function to create a linearized buoayncy node (HydSpring) from a buoyancy shape.

from DAVE.marine import *
linearize_buoyancy(s, s['Buoyancy mesh'])
Buoyancy mesh <HydSpring>

The buoyancy mesh node has now been replaced with a HydSpring node. Confusingly with the same name…

node = s['Buoyancy mesh']
type(node)
DAVE.nodes.HydSpring

Lets give is another name and report its properties

node.name = "Linear buoyancy"
report(node)
Properties of Linear buoyancy (HydSpring)
PropertyValueUnitRemarksExplained
BML208.335[m]Vertical distance between cob and metacenter for pitch
BMT18.752[m]Vertical distance between cob and metacenter for roll
COFX-0.000[m]Horizontal x-position Center of Floatation (center of waterplane area), relative to cob
COFY0.000[m]Horizontal y-position Center of Floatation (center of waterplane area), relative to cob
cob(50.000,
0.000,
2.000 )
[m,
m,
m]
parent axisCenter of buoyancy in
displacement_kN120621.795[kN]Displacement when waterline is at waterline-elevation
kHeave30155.449[kN/m]Heave stiffness
nameLinear buoyancyName of the node (str), must be unique
visibleTrue[bool]Determines if this node is visible in the viewport
waterline2.000[m]which is where is normally isWaterline-elevation relative to cob for un-stretched heave-spring. Positive if cob is below the waterline

And lets double-check that it does not affect the equilibrium position of the barge, it should still be at -4.000 m and even-keel:

s.solve_statics()

report(s['Barge'],['global_position','heel','trim'])
Properties of Barge (RigidBody)
PropertyValueUnitRemarksExplained
global_position(-0.000,
0.000,
-4.000 )
[m,
m,
m]
global axisThe global position of the origin of the axis system
heel0.000[deg]Heel in degrees. SB down is positive
trim-0.000[deg]Trim in degrees. Bow-down is positive

Add cargo#

Add an cargo module on the barge. Check the induced heel and trim

s.new_rigidbody('Cargo',parent='Barge', position = (10, 30, 20), mass = 500)
Cargo <RigidBody>
s.solve_statics()

report(s['Barge'],['global_position','heel','trim'])
Properties of Barge (RigidBody)
PropertyValueUnitRemarksExplained
global_position(0.036,
-0.367,
-4.547 )
[m,
m,
m]
global axisThe global position of the origin of the axis system
heel-4.617[deg]Heel in degrees. SB down is positive
trim-0.455[deg]Trim in degrees. Bow-down is positive

Orcaflex#

This model can be exported to an orcaflex .yml model file.

from DAVE.io.orcaflex import *

export_ofx_yml(s,'barge_heel_trim.yml')
c:\python\miniconda3\envs\book\Lib\site-packages\mafredo\hyddb1.py:280: UserWarning: Guessing symmetry for c:\python\miniconda3\envs\book\Lib\site-packages\DAVE\resources\barge_100_30_4.dhyd to be XZ (PS/SB) because maximum heading = 180.0 deg
  warn(
created barge.obj
created barge_heel_trim.yml
c:\python\miniconda3\envs\book\Lib\site-packages\DAVE\io\orcaflex.py:142: UserWarning: Gimbal lock detected. Setting third angle to zero since it is not possible to uniquely determine all angles.
  eu = total.as_euler(seq='xyz', degrees=True).tolist()

Now it is possible that you, like me, do not have orcaflex. You can still download the orcaflex demo to open and view the .yml model file

screenshot

Now there is some explaining to do on how exactly this was exported.

The hydrodynamics are easy: the first order wave forces, added mass and damping were exported to the vessel-type.

The hydrostatics are a bit more complex, but in a nice way.

The mass of the vessel is exported as a 6D buoy. This 6D buoy is then connected to the vessel. The buoyancy of the vessel is exported to the vessel type. This means that the mass of the vessel-type is set to almost zero. The effect of that is that the stiffness matrix of the vessel type, which normally includes the weight components, is reduced to purely the hydrostatic matrix. So based on KM, not KG. If you have ever tried to model a vessel in orcaflex using different 6D buoys (for example a vessel with a crane) then you will certainly appreciate this method.

So:

  • Hydrodynamics and Buoyancy go into the vessel-type (everything related to water)

  • Mass and inertia go into a 6D buoy

end