Hydrodynamic sphere with gravity, buoyancy, drag, and external forces.
HydroBall is a SimObject that models a hydrodynamic ball completely submerged in water. The ball is under the influence of gravity, buoyancy, hydrodynamic drag, and external forces. The SimObject is primarily created to illustrate the use of KalmanObject in FhSim. The buoyancy and the drag are those of fhsim_environment's sphere law (environment::sphere_hydro) with its defaults: water density 1025 kg/m^3 and drag coefficient 0.5 (owner ruling 2026-10-21, BASE-0085). There is no added mass.
- Author
- Joakim Haugen
Example file input:
<Lib
LibName = "fhsim_base"
SimObject = "Example/HydroBall"
Name = "Ball"
Radius = "1"
Density = "2000"
/>
...
<Connection
Ball.ExternForce = "Cable.ForceB"
Ball.Current = "Current.Out"
/>
...
<InitialCondition
Ball.Position = "0,6.15,18.9"
Ball.Velocity = "0,0,0"
/>
Input Ports
| Name | Width | Description |
| ExternForce | 3 | External forces acting on the ball, e.g. from other SimObjects. |
| Current | 3 | The uniform current of the surrounding water. |
Output Ports
| Name | Width | Description |
| Position | 3 | The position of the centroid of the ball. |
| Velocity | 3 | The linear velocity of the ball. |
Configuration parameters
| Name | Width | Description |
| Radius | 1 | Radius of the ball [meter]. |
| Density | 1 | Density of the ball [kg/m^3]. |
Initial conditions
| Name | Width | Description |
| Position | 3 | -. |
| Velocity | 3 | -. |
Full example file
<Contents>
<OBJECTS>
<Lib
LibName = "fhsim_base"
SimObject = "Example/HydroBall"
Name = "Ball"
Radius = "1.0"
Density = "1100"
/>
<Lib
LibName = "fhsim_base"
SimObject = "Example/HydroCable"
Name = "Cable"
Diameter = "0.02"
Density = "2000"
Modulus = "20"
Length = "20"
InternalPoints = "7"
/>
<Lib
LibName = "fhsim_base"
SimObject = "Src/Sine"
Name = "NorthCurrent"
PortWidth = "1"
PhaseRad = "0"
PeriodS = "200"
StartTime = "0"
StopTime = "-1"
Bias = "0.7"
Amplitude = "0.3"
/>
<Lib
LibName = "fhsim_base"
SimObject = "Signal/Mux"
Name = "Current"
NumInput = "3"
PortWidth = "3"
InPortWidth1 = "1"
InPortWidth2 = "1"
InPortWidth3 = "1"
/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
Ball.ExternForce = "Cable.ForceB"
Ball.Current = "Current.Out"
Current.In1 = "NorthCurrent.Out"
Current.In2 = "0.5"
Current.In3 = "0.1"
/>
<Connection
Cable.PositionA = "0,0,0"
Cable.PositionB = "Ball.Position"
Cable.VelocityA = "0,0,0"
Cable.VelocityB = "Ball.Velocity"
Cable.Current = "Current.Out"
/>
</INTERCONNECTIONS>
<INITIALIZATION>
<InitialCondition
Ball.Position = "0,6.15,18.9"
Ball.Velocity = "0,0,0"
/>
</INITIALIZATION>
<SIMULATION>
<Timing TStart="0" TEnd="1000"/>
<Integrator Method="Euler_i" NumCores="1">
<StepControl Step="2e-5"/>
</Integrator>
</SIMULATION>
</Contents>
This SimObject is referred to as Example/HydroBall