feat: AR-Shipdesign initial commit
This commit is contained in:
@@ -22,6 +22,19 @@ from arshipdesign.core.hull import Hull
|
||||
from arshipdesign.core.offsets import OffsetsTable
|
||||
|
||||
|
||||
def _standard_sheer_z(
|
||||
x_sta: np.ndarray, lpp: float, depth: float,
|
||||
fwd_rise_frac: float = 0.04, aft_rise_frac: float = 0.020,
|
||||
) -> np.ndarray:
|
||||
"""Línea de cubierta parabólica: mínimo en cuaderna maestra, sube hacia proa/popa."""
|
||||
xi = x_sta / lpp # 0=AP, 1=FP, 0.5=midship
|
||||
return np.where(
|
||||
xi >= 0.5,
|
||||
depth * (1.0 + fwd_rise_frac * ((xi - 0.5) / 0.5) ** 2),
|
||||
depth * (1.0 + aft_rise_frac * ((0.5 - xi) / 0.5) ** 2),
|
||||
)
|
||||
|
||||
|
||||
def make_merchant_hull(
|
||||
name: str = "Buque Mercante / Supply",
|
||||
lpp: float = 20.0,
|
||||
@@ -49,9 +62,10 @@ def make_merchant_hull(
|
||||
flat_bottom_frac : float
|
||||
Ancho del fondo plano / manga (0.85–0.94).
|
||||
"""
|
||||
x_sta = np.linspace(0.0, lpp, n_stations)
|
||||
z_wl = np.linspace(0.0, draft, n_waterlines)
|
||||
xi = (x_sta / lpp - 0.5) * 2.0
|
||||
x_sta = np.linspace(0.0, lpp, n_stations)
|
||||
sheer_z = _standard_sheer_z(x_sta, lpp, depth, fwd_rise_frac=0.04, aft_rise_frac=0.020)
|
||||
z_wl = np.linspace(0.0, float(sheer_z.max()), n_waterlines)
|
||||
xi = (x_sta / lpp - 0.5) * 2.0
|
||||
|
||||
lcb_shift = 2.0 * (lcb_frac - 0.5)
|
||||
f_plan = _merchant_plan_form(xi, cb, lcb_shift)
|
||||
@@ -91,7 +105,8 @@ def make_merchant_hull(
|
||||
lpp=lpp, beam=beam, draft=draft,
|
||||
)
|
||||
return Hull(
|
||||
name=name, lpp=lpp, beam=beam, depth=depth, draft=draft, offsets=offsets
|
||||
name=name, lpp=lpp, beam=beam, depth=depth, draft=draft,
|
||||
offsets=offsets, sheer_z=sheer_z,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user