Skip to content

Commit 6c114ba

Browse files
committed
test(deck): check a TURBINES deck at TMax = 0 without dtM
The static check gains the TURBINES route: a deck on its per-turbine motionFile record runs without dtM and writes the output of the run with dtM byte for byte. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
1 parent 1cea796 commit 6c114ba

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

‎tests/test_static_check.py‎

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
give TMax = 0.
1717
1818
and on one deck of each route (EI = 0 and finite-EI lines, the mixed aggregate, the multibody
19-
march, deck current and waves, vesselMotion, vesselRAO and motionFile records):
19+
march, deck current and waves, vesselMotion, vesselRAO and motionFile records, a TURBINES deck on
20+
its per-turbine record):
2021
2122
* TMax = 0 needs no dtM: the deck runs, on records off any step, and writes the output of the
2223
run with dtM byte for byte;
@@ -44,6 +45,37 @@
4445
"lozon_gomex80_power_cable_motion")
4546

4647

48+
TURBINES = """--------------------- CableDyn Input File ---------------------
49+
a TURBINES deck on its per-turbine record, at 0.1 s
50+
--------------------- LINE TYPES ---------------------
51+
Name Diam Mass EA BA EI Cdn Cdt Can Cat
52+
chain 0.1 20.0 1.0e9 -1.0 0.0 1.2 0.2 1.0 0.0
53+
--------------------- TURBINES ---------------------
54+
J X0 Y0 Z0 PtfmSurge PtfmSway PtfmHeave PtfmRoll PtfmPitch PtfmYaw
55+
1 300.0 0.0 0 0 0 0 0 0 0
56+
--------------------- POINTS ---------------------
57+
ID Type X Y Z Mass Vol CdA Ca
58+
1 Turbine1 0 0 -10 0 0 0 0
59+
2 Fixed 0.0 0.0 -100.0 0 0 0 0
60+
--------------------- LINES ---------------------
61+
ID NodeA NodeB Outputs
62+
1 1 2 -
63+
--------------------- SECTIONS ---------------------
64+
LineID LineType Length NumSegs
65+
1 chain 380.0 20
66+
--------------------- OPTIONS ---------------------
67+
9.80665 g
68+
1025.0 rhoW
69+
100.0 WtrDpth
70+
0.1 dtM
71+
4.0 TMax
72+
turbine.motion motionFile
73+
--------------------- OUTPUTS ---------------------
74+
AnchTen1
75+
--------------------- need this line ---------------------
76+
"""
77+
78+
4779
def check(ok: bool, message: str) -> None:
4880
print(("PASS: " if ok else "FAIL: ") + message)
4981
if not ok:
@@ -174,7 +206,11 @@ def main() -> int:
174206
record = "data/vessel/vessel_surge_heave_pitch_12s_dt005.txt vesselMotion"
175207
(work / "mixed_vessel_motion.dat").write_text(
176208
set_option(mixed, "TMax", f"{record}\n0|0|0 vesselRef\n0.0"), encoding="utf-8", newline="\n")
177-
for deck_name in (*ROUTES, "mixed_vessel_motion"):
209+
# a TURBINES deck: time J x y z q0 q1 q2 q3 and the rates, at rest, every 0.1 s
210+
rows = [f"{0.1 * k:.1f} 1 300 0 0 1 0 0 0 " + " ".join(["0"] * 12) for k in range(41)]
211+
(work / "turbine.motion").write_text("\n".join(rows) + "\n", encoding="utf-8", newline="\n")
212+
(work / "turbines_motion.dat").write_text(TURBINES, encoding="utf-8", newline="\n")
213+
for deck_name in (*ROUTES, "mixed_vessel_motion", "turbines_motion"):
178214
no_dtm(args.exe, work, deck_name)
179215
print(f"{len(FAILURES)} failure(s)")
180216
return 1 if FAILURES else 0

0 commit comments

Comments
 (0)