The ship type is different, whether the code is still viable?
I know that this code is based on data from YD-41. If I design a new sail and use it on a new boat, does that still work? Especially for the resistance part, I looked at the code, is this similar to the Four-Rud coefficient? Is this feasible if the ships are not similar?
@yongleizhou The YD-41 is only used as an example; the aero and hydrodynamic model are taken from the ORC VPP method, as detailed on the README.
Internally, we throw a warning to the user if their boat doesn't fit the resistance surfaces for the hydrodynamic model
# print warning if yacht is close to boundaries for Rr
if (self.btr < 3.0) or (self.btr > 8.5) or (self.lvr < 3.5) or (self.lvr > 8.5):
warnings.warn(
"Yacht dimensions are close to boundaries of resistance surfaces, "
+ "extrapolation will be used if values (fn, btr, lvr) are outside of "
+ "range, but resistance might be affected.",
UserWarning,
stacklevel=2,
)
The aerodynamic model is much more general, and as long as you have a classic rig, you should be fine.
Thanks for your reply!!! I looked at the code more closely, and the drag seemed to be measured by the Fn number, the dimensionless coefficient lvr of the captain, and the dimensionless coefficient btr of the beam. I'm currently going to calculate VPP for a trimaran, will it not be suitable for this algorithm, or will there be a deviation in resistance.
def __load_data(self):
surf = np.genfromtxt("dat/ORCi_Drag_Surfaces.csv", delimiter=",", skip_header=1)
surf = surf.reshape((24, 43, 42))
# x is Fn := [0.,0.7], y is btr := [2.5,9], z is lvr := [3,9]
# we add zero Fn resistance (0.)
fn = np.hstack((0.0, np.linspace(0.125, 0.7, 24)))
btr = surf[0, 2:, 0]
lvr = surf[0, 1, 1:]
# build interpolation function for 3D data
data = np.zeros(((25, 41, 41)))
data[1:, :, :] = surf[:, 2:, 1:]
# extrapolate if outside range
# https://github.com/scipy/scipy/blob/v0.16.1/scipy/interpolate/interpolate.py#L1528
self._interp_Rr = RegularGridInterpolator(
(fn, btr, lvr), data, method="linear", bounds_error=False, fill_value=None )
In addition, the 3-DOF Velocity Prediction Program with three degrees of freedom may also include the influence of factors such as heel on the results, which is beyond my understanding. After that, I don't plan to take into account factors such as heel, and only consider VPP with one variable of speed. This may simply require iterating the driving force at the relative wind and the drag generated at that speed to equilibrium. This should be easy to implement. Although I may not use your code, I am very grateful and have learned a lot!!