This section describes the backstage operation principles of Hydrostatics Calculator. Hydrostatics Calculator works as an external executable that interfaces with SOLIDWORKS API, and makes use of Virtual Bodies to manipulate and analyze the currently opened SOLIDWORKS model. It takes a single SOLIDWORKS body, makes a Virtual Body copy of it, rotates and translates it vertically to a desired position, and slices it in two at the waterline (Top Plane of SOLIDWORKS Feature Tree). Then, it measures and analyzes the properties of the underwater body, and repeats the previous steps until a desired solution is found. Finally, it analyzes the underwater body once again, runs the user-defined calculations, and outputs them for a textual or graphical representation. In some cases, there might be multiple underwater bodies (in case of multi-hulls, hulls with concave surfaces, yachts with keel bulbs at high heel angle). Hydrostatics Calculator allows you to either combine their hydrostatics, or display the hydrostatics of the largest body only.
Hydrostatics Calculator creates a separate .cfg file for every model, which contains some properties of the hull, as well as all the user inputs. This configuration file is referred to when checking the model for user-made changes, and to avoid the necessity of repeating time-consuming calculations every time the program is run. Configuration file is tied to the model name; therefore, opening a new model or renaming an existing one will make Hydrostatics Calculator revert to default settings. Configuration file should not be tampered with at any time, unless you know what you're doing. Doing so may break the functionality of Hydrostatics Calculator, produce inaccurate results, or cause crashes. If Hydrostatics Calculator detects that the configuration file is corrupt, it will prompt the user to fix it, or delete in the executable directory, and allow the program to re-create it.
Due to the nature of SOLIDWORKS and the external interfacing that Hydrostatics Calculator does, creating and manipulating Virtual Bodies is the ultimate limiting factor of Hydrostatics Calculator performance. Some operations are simple: for example, if the user knows the draft of the hull, and wants to find out the displacement, Hydrostatics Calculator only has to create one Virtual Body at that draft, and analyze the volume of an underwater body to determine the displacement. However, when the requirement is reversed (e.g. set the waterline height at a correct value to meet a certain displacement) it is nearly impossible to find a parametric solution. Therefore, Hydrostatics Calculator must take at least 2 guesses of the waterline height, observe the change in displacement, and interpolate to make the next guess. Ship hulls are often complicated and unpredictable shapes, requiring many guesses to arrive within desired error margin.
To circumvent this issue, Hydrostatics Calculator features a highly developed learning algorithm, which memorizes the hydrostatic properties every time a SOLIDWORKS Virtual Body is created, and uses that data to make the next interpolation, rather than creating a new Virtual Body. Using Hydrostatics Calculator fills the gaps in the learning algorithm memory bank, until few, if any, Virtual Bodies are needed anymore for interpolation. In case the user makes changes to the hull (size, proportions, etc.), the learning algorithm automatically detects the mismatch, and rewrites it's memory with the new observations.
Memory storage file is tied to the model name, and stored in a .mem file in the Memory folder next to the Hydrostatics Calculator executable. This file should not be tampered with at any time. If you suspect that the memory is corrupt or causing problems, you can delete this file at any time, and it will be automatically recreated.
When Hydrostatics Calculator starts any of the calculations it creates a Virtual Body copy of the model, and positions it so that the aft-most point at the stern touches the Front Plane (0 on Z axis), the bottom-most point of the hull touches the Top Plane (0 on the Y axis), and the Right Plane intersects the hull on the Centerline (mid-point between the extreme port and starboard points of the model). Afterwards, it only moves it up or down for correct immersion, or rotates to simulate various heel and trim angles.
The CoG and CoB coordinates entered and displayed in Hydrostatics Calculator always match those of SOLIDWORKS, regardless of how the visual representation of the hull appears to be.
- If you close the SOLIDWORKS model while Hydrostatics Calculator is open, it will lose the connection to the model, and will quit as soon as you try to run any of the calculations, even if you open the model again. This is a protective measure to prevent program crashes. In such a case, restart Hydrostatics Calculator to restore the connection.