feat: AR-Shipdesign initial commit
This commit is contained in:
@@ -22,6 +22,21 @@ 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.05, aft_rise_frac: float = 0.025,
|
||||
) -> np.ndarray:
|
||||
"""Línea de cubierta parabólica: mínimo en cuaderna maestra, sube hacia proa/popa.
|
||||
El puntal de trazado (depth) es el valor en cuaderna maestra.
|
||||
"""
|
||||
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_workboat_hull(
|
||||
name: str = "Workboat / Supply",
|
||||
lpp: float = 15.0,
|
||||
@@ -44,9 +59,10 @@ def make_workboat_hull(
|
||||
flat_bottom_frac : float
|
||||
Anchura del fondo plano como fracción de la manga (0.80–0.92).
|
||||
"""
|
||||
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.035, 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)
|
||||
|
||||
@@ -91,7 +107,8 @@ def make_workboat_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