diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d5118d..4308e25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,14 @@ All notable changes to CableDyn are recorded in this file. The format follows
### Added
+- A finite-EI line may end on a `Free` point: the line's free End B, its position free in the
+ static equilibrium and the dynamics, with the point's Mass/Vol/CdA/Ca acting on the end node as
+ an attachment (a free-hanging cable or riser with a clump). The static solve holds the end on
+ the stretched chord first and then releases it; `Point
p…` channels read the end node.
+ Standalone decks of finite-EI lines without bodies, rods or Connect points, every Free point
+ such an end (pinned in bending at both ends, net heavy, from a Coupled/Vessel End A; a torsion
+ restraint at one end is noted and not solved); any other deck,
+ and host-driven decks, keep their behaviour. The Python deck reader takes the same rule.
- Bending damping of finite-EI cables: the LINE TYPES EI column takes `EI|Bb`, a Kelvin-Voigt
damping moment `Bb` [N m^2 s] times the curvature rate (in the frame carried with the tangent),
or `EI|-zeta|f`, the damping ratio of a pure bending mode of frequency `f` (Bb = zeta EI/(pi f)).
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b2474f..24c5931 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1362,6 +1362,9 @@ set_tests_properties(viv_amplitude_deck PROPERTIES LABELS "fortran;integration;d
add_executable(test_viv_diameter_deck tests/test_viv_diameter_deck.f90)
target_link_libraries(test_viv_diameter_deck PRIVATE cabledyn_core)
add_test(NAME viv_diameter_deck COMMAND test_viv_diameter_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+add_executable(test_free_end_deck tests/test_free_end_deck.f90)
+target_link_libraries(test_free_end_deck PRIVATE cabledyn_core)
+add_test(NAME free_end_deck COMMAND test_free_end_deck WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_tests_properties(viv_diameter_deck PROPERTIES LABELS "fortran;integration;dynamic;viv" TIMEOUT 1200)
add_executable(test_hermite_viv tests/test_hermite_viv.f90)
diff --git a/doc/capabilities.rst b/doc/capabilities.rst
index 7bcb038..f1526d5 100644
--- a/doc/capabilities.rst
+++ b/doc/capabilities.rst
@@ -128,6 +128,12 @@ Line and constitutive capability
- Supported
- lumped at nodes of a finite-EI cable, standalone and coupled, also on a line restrained in
torsion (they add no polar inertia to its twist)
+ * - Free end of a finite-EI cable (a ``Free`` End B)
+ - Supported with limits
+ - a free-hanging cable or riser with a clump or a bare end, its static rest position solved
+ before the march, on a standalone deck of finite-EI lines without bodies, rods or
+ Connect points, from a Coupled/Vessel End A; host-driven decks refuse it
+ (:ref:`theory-free-cable-end`)
* - Bend stiffeners (``STIFFENERS``)
- Supported with limits
- tapered linear-elastic sleeve over a finite-EI line end, adding bending stiffness, mass,
diff --git a/doc/driver_format.md b/doc/driver_format.md
index 538fb97..51a9812 100644
--- a/doc/driver_format.md
+++ b/doc/driver_format.md
@@ -727,7 +727,7 @@ A POINTS row has 9 columns, `ID Type X Y Z Mass Vol CdA Ca`, or the short 5-colu
| `Body` | line end on body N; (X,Y,Z) is the attachment offset in the body frame | X,Y,Z offset; the body supplies Mass/Vol/CdA/Ca |
| `RodA` / `RodB` | line end on rod N End A / End B; coordinates come from the `RODS` row | X,Y,Z placeholders; zero Mass/Vol/CdA/Ca |
| `Connect` | free internal point where ≥ 2 lines meet; its static position is solved from force balance (lines, weight/buoyancy, current drag) starting at the deck seed, and the march starts there | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
-| `Free` | free line end (clump or float terminal); a one-line `Connect`, solved the same way | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
+| `Free` | free line end (clump or float terminal); a one-line `Connect`, solved the same way; as the End B of a finite-EI line, that line's free end ([below](#free-cable-end)) | X,Y,Z seed; Mass, Vol, CdA, Ca ≥ 0 |
| `Turbine` / `T` | FAST.Farm coupled point on turbine J (turbine-local coordinates) | X,Y,Z; zero Mass/Vol/CdA/Ca |
For dynamic `Connect`/`Free` points, `Mass` is inertial mass and `(rhoW·Vol − Mass)·g` is a
@@ -742,6 +742,30 @@ of its BODY `Mass`/`Vol` (see the theory manual, Seabed contact).
standalone driver. Non-zero `Mass`/`Vol`/`CdA`/`Ca` on `Fixed`, `Coupled`, `Vessel`, `Body`,
`RodA/B`, or `Turbine` points is rejected.
+(free-cable-end)=
+**A free finite-EI cable end.** A `Free` point that ends exactly one finite-EI line, as its End B
+with a `Coupled` or `Vessel` End A (a still hang-off is a `Coupled` point without motion), is that
+line's free end on a standalone deck whose lines are all finite-EI and that has no BODIES,
+RODS or other `Connect`/`Free` point (a free-hanging cable or riser with a clump or a bare end).
+The point's `Mass`, `Vol`, `CdA` and `Ca` act on the line's End B node as an
+[ATTACHMENTS](#attachments-optional-finite-ei-lines) row at the line's full arc length (weight
+and buoyancy, added mass, and drag against current and waves), with the point's isotropic drag
+`½ rhoW CdA ‖w‖ w` on the whole relative velocity rather than the attachment's normal/axial split. The static equilibrium is solved
+with the end first held on the chord from End A towards the deck position, at the line's length
+stretched by its hanging weight, then released, so the run starts at the end's rest position
+(the theory manual, Free cable ends); the dynamics leave the end's position free. `Pointp…`
+channels read the line's End B node, and the End B force (`AnchTen`, `Point
F…`) is the line load
+the point balances, without the point's own loads (a clump at rest reads its submerged weight). The line must be pinned in bending at both ends (no
+non-pinned `END CONNECTIONS` row), with at most one end restrained in torsion, which is then not
+solved (a free end carries no moment or torque; the initialisation note says why), and the point
+and the line must be net heavy (the end hangs). A deck in which any `Free` point is not such an end
+(a clamped or buoyant end, a second `Free` point, a `Connect` point), and a host-driven deck
+(OpenFAST, the C API) or a `bathymetryFile` deck, is left as it was: the routes that take `Free`
+points run it or refuse a finite-EI cable on a `Free` point by name. On a flat seabed a seed below
+the seabed is placed on it at the same stretched length; an end that comes to rest on the seabed
+with a net-heavy point is refused by name (the point has no seabed contact of its own on a
+finite-EI line), while a bare end rests on the line's own contact.
+
`Turbine` points (J ≥ 1) need the turbine reference positions from one of two sources: the
OpenFAST/FAST.Farm aggregate route, where the host supplies them, or a
[TURBINES](#turbines-standalone-farm-decks) section, with which the standalone driver runs the
@@ -789,6 +813,8 @@ rod end, and `Free`/`Connect`-to-`Coupled` lines are left as written.
fails with `LINE End A fairlead (NodeA) must not be below End B anchor (NodeB)`. The exceptions
are a FAST.Farm shared line with both ends on `Turbine` points and a finite-EI line whose End
B is also a `Coupled`/`Vessel` point (a line between two moving points, driven at both ends).
+- A finite-EI line may end on a `Free` point as its End B on a standalone deck of finite-EI lines
+ (its [free end](#free-cable-end)); that point does not count as a dynamic point.
- In a deck with dynamic points, line ends may be `Fixed`, `Coupled`, `Vessel`, `Connect`, `Free`,
`Body`, or `RodA/B`.
diff --git a/doc/theory.rst b/doc/theory.rst
index 97f6de3..0ad2c0a 100644
--- a/doc/theory.rst
+++ b/doc/theory.rst
@@ -229,6 +229,42 @@ as closely. The local value is floored at 0.1 % of the root curvature, as the cu
sign near the tip. On the same hang-off, the curvature along the stiffener follows OrcaFlex
11.6d with its stiffener given as a line attachment within 0.5 % of the root curvature.
+.. _theory-free-cable-end:
+
+Free cable ends
+~~~~~~~~~~~~~~~
+
+A finite-EI line whose End B is a ``Free`` point (:doc:`driver_format`) has that end's position
+free: the dynamic march holds only End A's three positions, and the point's mass, volume, drag
+area and added-mass coefficient act on the End B node as a discrete attachment (the weight
+:math:`(M - \rho V)g`, the added mass :math:`C_a \rho V`, the fluid inertia), with the point's
+isotropic drag :math:`\tfrac12 \rho\, C_dA\, |\mathbf w|\,\mathbf w` on the whole relative velocity,
+as a ``Free`` point carries it, rather than the attachment's normal/axial split. The point's loads
+stay out of the End B force (``AnchTen``, ``PointF``): it is the force the line exerts on the
+point, the line load the point balances, as on the ``EI = 0`` route. The end carries no moment (it is pinned, a natural boundary condition of the
+cubic-Hermite element) and no torque: the line is pinned in bending at both ends, and a torsion
+restraint at its other end is not solved (it is noted, as for a line with two moving ends).
+
+The static equilibrium starts from a held seed: the end is placed on the chord from End A towards
+the point's deck position, at the line's length stretched by its hanging weight,
+:math:`L\,(1 + (W_B + \sum w_i L_i)/EA_{\min})`, so that the seed is the taut straight line (a
+vertical span of exactly the line's length has no catenary seed). The line's static solve (with
+its attachments' homotopy) runs with that end held; the end is then released and the full-load
+equilibrium is solved again with its position free, by the attachment polish's warm-started
+Newton solve with its fallbacks, repeated to the drag and surface fixed point. The run starts at
+that rest position. The line and the point must be net heavy, so that the end hangs. On a flat
+seabed a seed that would lie below the seabed (a line longer than the depth below End A) is placed
+on the seabed at the same stretched length, out along the deck chord's horizontal direction; an end
+whose point is net heavy and that comes to rest on the seabed is refused, since an attachment has no
+seabed contact of its own on a finite-EI line (a bare end rests on the line's contact).
+
+On a 7 m cable (2.8 kg/m, EA 1e8 N) with a 200 kg clump the top tension is the submerged weight
+of both to 1e-6 relative and the end hangs one stretched length below the top to 1e-7 m; in a
+0.5 m/s current the end rests where the ``EI = 0`` route puts the same deck's ``Free`` point
+(within 2e-5 m at EI 3 N m², and converging to it as EI falls); and a 0.05 m sway of the top at
+0.05 Hz moves the end in phase with an amplitude ratio within 1 % of the Rayleigh estimate of the
+hanging string with its end mass (``tests/test_free_end_deck.f90``).
+
.. _theory-output-recovery:
Node tension, curvature and bend moment
diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py
index 2e0aaa0..b59704e 100644
--- a/python/cabledyn/deck_file.py
+++ b/python/cabledyn/deck_file.py
@@ -3720,6 +3720,102 @@ def validate(self) -> None:
raise DeckFormatError(f"{exc}{_STATIC_CHECK_HINT}") from None
raise
+ def _free_cable_ends(
+ self,
+ point_types: dict[str, str],
+ line_type_meta: dict[str, tuple[float, float, float, float]],
+ effective: Callable[[str, float], float],
+ ) -> set[str]:
+ """The Free points native promote_free_cable_ends makes free finite-EI cable ends."""
+ if (
+ self.caller_driven
+ or self._rows("BODIES")
+ or any(segments != 0 for _, segments in self._rod_rows_by_id().values())
+ or any(_option_key(option.keyword) == "bathymetry" for option in self.options)
+ ):
+ return set()
+ sections: dict[str, list[tuple[str, float]]] = {}
+ ends: dict[str, tuple[str, str]] = {}
+ try:
+ for section in self._rows("SECTIONS"):
+ sections.setdefault(str(_native_int(section.tokens[0])), []).append(
+ (section.tokens[1].lower(), _native_float(section.tokens[2]))
+ )
+ for row in self.lines:
+ line_key = str(_native_int(row.tokens[0]))
+ a_tok, b_tok = (
+ (row.tokens[2], row.tokens[3]) if len(row.tokens) == 7 else row.tokens[1:3]
+ )
+ ends[line_key] = (str(_native_int(a_tok)), str(_native_int(b_tok)))
+ if len(row.tokens) == 7:
+ sections[line_key] = [(row.tokens[1].lower(), _native_float(row.tokens[4]))]
+ except (ValueError, IndexError):
+ return set()
+ if not ends or not all(
+ any(
+ line_type_meta.get(name, (0.0, 0.0, 0.0, 0.0))[3] > 0.0
+ for name, _ in sections.get(k, [])
+ )
+ for k in ends
+ ):
+ return set()
+
+ # pinned in bending at both ends, at most one end restrained in torsion; a numeric zero
+ # stiffness is pinned / free, as native append_end_connection reads it
+ def zero_or(token: str, keywords: frozenset[str]) -> bool:
+ word = _strip_quotes(token).lower()
+ if word in keywords:
+ return True
+ try:
+ return _native_float(word) == 0.0
+ except ValueError:
+ return False
+
+ clamped: set[str] = set()
+ twisted: dict[str, int] = {}
+ for row in self.end_connections:
+ with contextlib.suppress(ValueError, IndexError):
+ line_key = str(_native_int(row.tokens[0]))
+ if not zero_or(row.tokens[2], _PINNED_END_CONNECTIONS):
+ clamped.add(line_key)
+ if len(row.tokens) >= 10 and not zero_or(row.tokens[6], _FREE_TORSION_KEYWORDS):
+ twisted[line_key] = twisted.get(line_key, 0) + 1
+ clamped |= {line_key for line_key, count in twisted.items() if count > 1}
+ rho_w, grav = effective("water_density", 1025.0), effective("gravity", 9.80665)
+ rows = {str(_native_int(row.tokens[0])): row for row in self.points}
+ promoted: set[str] = set()
+ for point_id, point_type in point_types.items():
+ if point_type == "connect":
+ return set()
+ if point_type != "free":
+ continue
+ refs = [k for k, pair in ends.items() if point_id in pair]
+ if len(refs) != 1 or ends[refs[0]][1] != point_id:
+ return set()
+ line_key = refs[0]
+ if (
+ point_types.get(ends[line_key][0], "") not in {"coupled", "vessel"}
+ or line_key in clamped
+ ):
+ return set()
+ if any(name not in line_type_meta for name, _ in sections.get(line_key, [])):
+ return set()
+ values = [_native_float(tok) for tok in rows[point_id].tokens[2:]]
+ mass, vol = (values[3], values[4]) if len(values) == 7 else (0.0, 0.0)
+ w_line = sum(
+ (line_type_meta[name][1] - rho_w * 0.25 * math.pi * line_type_meta[name][0] ** 2)
+ * grav
+ * length
+ for name, length in sections.get(line_key, [])
+ )
+ w_point = (mass - rho_w * vol) * grav
+ if not (w_line + w_point > 0.0 and w_point >= 0.0):
+ return set()
+ if not any(line_type_meta[name][2] > 0.0 for name, _ in sections.get(line_key, [])):
+ return set()
+ promoted.add(point_id)
+ return promoted
+
def _validate(self) -> None:
required = {"LINE TYPES", "POINTS", "LINES"}
if not self._rows("LINES") and (self._rows("RODS") or self._rows("BODIES")):
@@ -4383,6 +4479,15 @@ def end_key(token: str) -> str:
f"z = -WtrDpth = {z_floor:.10g} m by more than the {tolerance:.2e} m "
"seabed tolerance; place the anchor on (or above) the seabed"
)
+ # Native promote_free_cable_ends: a Free point that ends exactly one finite-EI line as its
+ # End B (from a Coupled/Vessel End A, pinned and free in torsion, net heavy), on a
+ # standalone deck of finite-EI lines with no BODIES, RODS or Connect point, is the line's
+ # free End B (its loads an end attachment) and reads Fixed from here on, when every Free
+ # point of the deck is such an end; otherwise the deck is left as it is.
+ free_cable_ends = self._free_cable_ends(point_types, line_type_meta, effective)
+ self._free_cable_end_points = free_cable_ends
+ for point_id in free_cable_ends:
+ point_types[point_id] = "fixed"
has_dynamic_points = any(
point_type in {"connect", "free"} or point_type.startswith(("body", "rod"))
for point_type in point_types.values()
@@ -6379,6 +6484,8 @@ def _check_torsion_lines(
"its LINE TYPES rows give no GJ (the 14-column row; torsion has no "
"EI/1.3 default)"
)
+ elif end_b in getattr(self, "_free_cable_end_points", set()):
+ note = "its End B is a free end (a Free point)"
elif point_types[end_b] != "fixed":
note = "it has two moving ends (torsion needs a Fixed End B)"
elif dynamic and not force_blend:
diff --git a/python/tests/test_deck_native_parity.py b/python/tests/test_deck_native_parity.py
index 8cd8743..47bfe11 100644
--- a/python/tests/test_deck_native_parity.py
+++ b/python/tests/test_deck_native_parity.py
@@ -2141,7 +2141,8 @@ def test_torsion_scope_rules_follow_the_native_checks():
'point; line 1 ends on a "free" point',
)
# one restrained end only, or none, is ignored: the same verdict as the six-column rows (here
- # the multibody march's, which ends no finite-EI cable on a Free point)
+ # both run: the Free End B is the line's free end, promote_free_cable_ends, and the one-end
+ # restraint is noted, not solved)
one_end = _edit(_torsion_two_moving("1 A Pinned 1 0 0 Free 0 0 1 0\n"), _NO_TORSION_OUTPUTS)
six = _edit(
_torsion_two_moving("1 A Pinned 1 0 0\n"),
@@ -2149,7 +2150,7 @@ def test_torsion_scope_rules_follow_the_native_checks():
_NO_TORSION_OUTPUTS,
)
for deck in (six, one_end):
- _rejects(deck, "a cable end on a Free/Connect point or a Point3 buoy")
+ DeckFile.from_text(deck)
both_free = _edit(
_TORSION,
(_TORSION_ROW_A, "1 A Rigid 1 0 0 Free 0 0 1 0\n"),
@@ -2985,3 +2986,87 @@ def test_dtm_bound_matches_the_driver(dt, accepted, ei, tmp_path):
assert _accepted(deck) == accepted
if not accepted:
assert "dtM must be at least 1e-100 s" in completed.stderr
+
+
+# ------------------------------------------------------------------ a free cable end
+
+_FREE_END_DECK = """--------------------- CableDyn Input File ---------------------------------
+free cable end
+----------------------- LINE TYPES ------------------------------------------
+TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t
+(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-)
+cable 0.048 2.8 1.0e8 0.0 3000 1.2 0.0 1.0 0.0
+----------------------- POINTS ----------------------------------------------
+ID Attachment X Y Z M V CdA CA
+(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
+1 Coupled 0.0 0.0 -0.5 0 0 0 0
+2 Free 0.0 0.0 -7.5 {clump}
+{extra}----------------------- LINES -----------------------------------------------
+ID LineType AttachA AttachB UnstrLen NumSegs Outputs
+(-) (-) (-) (-) (m) (-) (-)
+1 cable 1 2 7.0 70 -
+{endconn}---------------------- OPTIONS ----------------------------------------------
+1025 rhoW
+9.80665 g
+20 WtrDpth
+0.005 dtM
+0.1 TMax
+---------------------- OUTPUTS -----------------------------------------------
+FairTen1
+Point2pz
+END
+------------------------- need this line --------------------------------------
+"""
+_CLAMPED_B = (
+ "--------------------- END CONNECTIONS ----------------------------------\n"
+ "LineID End Stiffness EzX EzY EzZ\n(-) (-) (N-m/rad) (-) (-) (-)\n1 B Rigid 0 0 1\n"
+)
+
+
+@pytest.mark.parametrize(
+ ("clump", "extra", "endconn", "message"),
+ [
+ ("200 0.02548 0.06 1.0", "", "", None),
+ ("0 0 0 0", "", "", None),
+ (
+ "200 0.02548 0.06 1.0",
+ "",
+ _CLAMPED_B.replace("1 B Rigid 0 0 1", "1 B 0.0 0 0 1"),
+ None,
+ ),
+ ("200 0.02548 0.06 1.0", "", _CLAMPED_B, "non-pinned END CONNECTIONS need End B"),
+ ("10 0.5 0.06 1.0", "", "", "not supported on the multibody march"),
+ (
+ "200 0.02548 0.06 1.0",
+ "3 Free 5.0 0.0 -5.0 10 0 0 0\n",
+ "",
+ "not supported on the multibody march",
+ ),
+ ],
+)
+def test_free_cable_end_matches_the_driver(clump, extra, endconn, message, tmp_path):
+ # a finite-EI line on a Free End B: the line's free end, the point's loads an end attachment
+ text = _FREE_END_DECK.format(clump=clump, extra=extra, endconn=endconn)
+ if message is None:
+ DeckFile.from_text(text)
+ else:
+ _rejects(text, message)
+ if not _PARITY_DRIVER or not Path(_PARITY_DRIVER).is_file():
+ return
+ deck = tmp_path / "free_end.dat"
+ deck.write_text(text, encoding="utf-8")
+ completed = subprocess.run(
+ [_PARITY_DRIVER, str(deck), str(tmp_path / "free_end")],
+ capture_output=True,
+ text=True,
+ errors="replace",
+ cwd=tmp_path,
+ timeout=600,
+ env={**os.environ, "OMP_NUM_THREADS": "1", "OPENBLAS_NUM_THREADS": "1"},
+ check=False,
+ )
+ if message is None:
+ assert completed.returncode == 0, completed.stderr[-600:]
+ else:
+ assert completed.returncode == 1, completed.stderr[-600:]
+ assert message in completed.stderr
diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90
index 372f8d0..ae0033a 100644
--- a/src/CableDyn_DeckDriver.f90
+++ b/src/CableDyn_DeckDriver.f90
@@ -499,6 +499,10 @@ MODULE CableDyn_DeckDriver
! the Body attachment of a Point3 BODY: stepped as a Free point with the BODY Mass/Vol/CdA/Ca
! (copied into mass, vol, cda, ca above), its seabed contact included
LOGICAL :: point3 = .FALSE.
+ ! a Free point that ends exactly one finite-EI line (its End B) on a standalone deck of
+ ! finite-EI lines: the line's End B is free and the point's Mass/Volume/CdA/CA ride on it as
+ ! an end attachment (promote_free_cable_ends); ptype reads 'fixed' for the static seed only
+ LOGICAL :: free_cable_end = .FALSE.
INTEGER :: deck_line = 0 ! deck file line of the row, for error messages
END TYPE
@@ -596,6 +600,9 @@ MODULE CableDyn_DeckDriver
! the deck's written NodeB (MoorDyn's AttachB) is then End A, otherwise End B. Active line
! control reads it for a line with no single host-driven end.
LOGICAL :: ends_swapped = .FALSE.
+ ! End B on a Free point (promote_free_cable_ends): its position is free in the static
+ ! equilibrium and the dynamics, the point's loads acting as an end attachment
+ LOGICAL :: free_end_b = .FALSE.
! ATTACHMENTS (finite-EI lines): one column per discrete attachment -- arc length from
! End A [m], mass [kg], displaced volume [m^3], drag area CdA [m^2], added-mass Ca [-],
! axial drag area CdAx [m^2] (rows 1-6).
@@ -3385,8 +3392,14 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
! collapse of the endpoint tangent norm. Release the interior and tangent DOFs at
! dynamic hand-off; only the two endpoint translations remain constrained. The
! planar equilibrium is still an exact three-dimensional initial state by symmetry.
- ALLOCATE (dynamic_fixed_dofs(6))
- dynamic_fixed_dofs = [1, 2, 3, ndof - 5, ndof - 4, ndof - 3]
+ IF (ln%free_end_b) THEN
+ ! a free End B (a Free point, promote_free_cable_ends): End A alone is held
+ ALLOCATE (dynamic_fixed_dofs(3))
+ dynamic_fixed_dofs = [ndof - 5, ndof - 4, ndof - 3]
+ ELSE
+ ALLOCATE (dynamic_fixed_dofs(6))
+ dynamic_fixed_dofs = [1, 2, 3, ndof - 5, ndof - 4, ndof - 3]
+ END IF
IF (has_att) THEN
w_bare = w_bare_deck
IF (SIZE(l0) /= SIZE(l0_deck_att)) CALL remap_elem_by_reference_arc(w_bare, l0_deck_att, l0)
@@ -3475,6 +3488,45 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
' attachment(s) lumped at the nearest nodes (largest arc offset ', att_offset, ' m)'
CALL report_note(note_text)
END IF
+ IF (ln%free_end_b) THEN
+ ! The static solve held End B at the Free point's deck position (the seed); release it: the
+ ! full-load equilibrium with End B's position free, its loads the end attachment's (the
+ ! point's weight, buoyancy and current drag) and the line's own.
+ BLOCK
+ INTEGER, ALLOCATABLE :: fixed_rel(:), node_rel(:)
+ REAL(wp), ALLOCATABLE :: att_rel(:, :)
+ REAL(wp) :: rel_floor
+ fixed_rel = PACK(fixed_dofs, fixed_dofs > 3)
+ IF (has_att) THEN
+ node_rel = att_node
+ att_rel = ln%att
+ ELSE
+ ALLOCATE (node_rel(0), att_rel(6, 0))
+ END IF
+ CALL attachment_static_polish(l0, ea, ei, w, w, diam, node_rel, att_rel, q_static, fixed_rel, &
+ contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0_local, &
+ endconn_mode, opts, static_tol, ErrStat, ErrMsg, bathymetry, cur_obj, &
+ tol_floor=COUPLED_STATIC_TOL, floor_res=rel_floor, release=.TRUE.)
+ IF (ErrStat /= CD_DECKDRV_OK) THEN
+ ErrMsg = 'CableDyn_DeckDriver: line '//TRIM(int_to_str(ln%id))//': static equilibrium of the free '// &
+ 'End B (released from the Free point''s deck position): '//TRIM(ErrMsg)
+ RETURN
+ END IF
+ fixed_dofs = fixed_rel
+ ! a net-heavy point at a free end that comes to rest on the seabed would sink into the line's
+ ! contact (an attachment has no seabed contact of its own): refused by name
+ IF (contact_enabled .AND. q_static(3) <= contact_z) THEN
+ IF (ANY(node_rel == 1 .AND. att_rel(2, :) - opts%rhoW*att_rel(3, :) > CD_ZERO)) THEN
+ CALL fail(ErrStat, ErrMsg, 'line '//TRIM(int_to_str(ln%id))//': the free End B comes to rest on '// &
+ 'the seabed with the net weight of its Free point, which has no seabed contact of its '// &
+ 'own on a finite-EI line; shorten the line, or end it on a Fixed point there'); RETURN
+ END IF
+ END IF
+ WRITE (note_text, '(A,I0,A,3ES12.4,A)') 'line ', ln%id, ': free End B at rest at (', &
+ q_static(1:3), ') m in the line frame'
+ CALL report_note(note_text)
+ END BLOCK
+ END IF
! Dynamic step controls: the deck's dynamic_solver relative tolerance and iteration budget
! (default 1e-8 and 30) on every route, standalone or coupled, so that a cable driven by the
! same motion steps to the same state on each. The tolerance is not a coupling-force accuracy
@@ -3689,8 +3741,9 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts,
CALL fail(ErrStat, ErrMsg, 'finite-EI cable added-mass wiring failed: '//TRIM(em)); RETURN
END IF
IF (has_att) THEN
- CALL CD_HFMF_Set_Attachments(cable, att_node, ln%att(2, :), ln%att(3, :), ln%att(4, :), ln%att(6, :), &
- ln%att(5, :), opts%rhoW, opts%g, es, em)
+ CALL CD_HFMF_Set_Attachments(cable, att_node, ln%att(2, :), ln%att(3, :), ln%att(4, :), &
+ MAX(ln%att(6, :), CD_ZERO), ln%att(5, :), opts%rhoW, opts%g, es, em, &
+ isotropic=ln%att(6, :) < CD_ZERO, point_load=ln%att(6, :) < CD_ZERO)
IF (es /= CD_HFMF_OK) THEN
CALL fail(ErrStat, ErrMsg, 'finite-EI cable attachment wiring failed: '//TRIM(em)); RETURN
END IF
@@ -5722,14 +5775,15 @@ SUBROUTINE add_share(e, share)
INTEGER, INTENT(IN) :: e
REAL(wp), INTENT(IN) :: share
cdn(e) = cdn(e) + share*att(4, k)/(diam(e)*l0(e))
- cdt(e) = cdt(e) + share*att(6, k)/(4.0_wp*QUARTER_PI*diam(e)*l0(e))
+ ! (a point's isotropic drag, CdAx < 0, smears with CdAx = CdA for the continuation start)
+ cdt(e) = cdt(e) + share*MERGE(att(4, k), att(6, k), att(6, k) < CD_ZERO)/(4.0_wp*QUARTER_PI*diam(e)*l0(e))
END SUBROUTINE add_share
END SUBROUTINE smear_attachment_drag
SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att, q, fixed_dofs, &
contact_enabled, contact_z, frame_cs, endconn_k, endconn_d0, endconn_mode, &
opts, tol, ErrStat, ErrMsg, bathymetry, cur_obj, fell_back, cdn_bare, &
- cdt_bare, tol_floor, floor_res)
+ cdt_bare, tol_floor, floor_res, release)
!! Homotopy from the smeared-attachment equilibrium q to the discrete one: in warm-started
!! Newton solves the element weights move from w_smear to w_bare while the lumped nodal
!! forces -(m - rho V) g e_z (-m g e_z for an attachment above the still-water level,
@@ -5771,6 +5825,9 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
!! the next update rule, as the line's own static solve accepts a floor at the coupled static
!! tolerance; floor_res (optional out) is the relative residual of the returned state when it
!! lies above tol, and 0 otherwise.
+ !! release (optional, default false) skips the homotopy: q is an equilibrium of the full loads
+ !! with more DOFs held than fixed_dofs holds (a free end seeded held), and the full-load solve
+ !! runs at once, at least once, then to the fixed point as above.
REAL(wp), INTENT(IN) :: l0(:), ea(:), ei(:), w_bare(:), w_smear(:), diam(:), att(:, :)
INTEGER, INTENT(IN) :: node(:), fixed_dofs(:), endconn_mode(2)
REAL(wp), INTENT(INOUT) :: q(:)
@@ -5784,6 +5841,7 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
LOGICAL, INTENT(OUT), OPTIONAL :: fell_back
REAL(wp), INTENT(IN), OPTIONAL :: cdn_bare(:), cdt_bare(:), tol_floor
REAL(wp), INTENT(OUT), OPTIONAL :: floor_res
+ LOGICAL, INTENT(IN), OPTIONAL :: release
INTEGER, PARAMETER :: NSTEP = 8, MAX_FIXED_POINT = 60
! the update rules of a solve (solve_with, static_solve)
INTEGER, PARAMETER :: NEWTON = 1, PSEUDO_TRANSIENT = 2, MERIT = 3
@@ -5797,7 +5855,7 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
REAL(wp), ALLOCATABLE :: f_att(:), f_drag(:), dry(:), knnode(:), wl(:), q_out(:), curv(:)
REAL(wp) :: lam, lam_done, dlam, res, change
INTEGER :: i, ne, fp, n_failed, n_ok, grow_after
- LOGICAL :: has_drag, converged, newton_failed, grown
+ LOGICAL :: has_drag, converged, newton_failed, grown, release_
! which attachments are above the still-water level: in the state the last solve took its
! loads at, and in the state it returned
LOGICAL, ALLOCATABLE :: att_dry(:), att_dry_now(:)
@@ -5855,6 +5913,10 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
n_ok = 0
grow_after = 2
grown = .FALSE.
+ release_ = .FALSE.
+ IF (PRESENT(release)) release_ = release
+ IF (release_) lam_done = CD_ONE
+ wl = w_bare ! the full-load weights (the homotopy sets its own per step)
DO WHILE (lam_done < CD_ONE)
lam = MIN(CD_ONE, lam_done + dlam)
wl = w_bare + (CD_ONE - lam)*(w_smear - w_bare)
@@ -5902,7 +5964,7 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att
! the weight of the other side: the full-load solve is repeated (below) until none does. A
! line below the surface (or wholly above it) without attachment drag is done.
CALL attachment_static_weight(q, node, att, opts, f_att, att_dry_now)
- IF (.NOT. has_drag .AND. ALL(att_dry_now .EQV. att_dry)) RETURN
+ IF (.NOT. release_ .AND. .NOT. has_drag .AND. ALL(att_dry_now .EQV. att_dry)) RETURN
DO fp = 1, MAX_FIXED_POINT
CALL solve_with(CD_ONE, converged, change)
IF (ErrStat /= CD_DECKDRV_OK) RETURN
@@ -6071,7 +6133,8 @@ SUBROUTINE attachment_static_drag(q, node, att, opts, frame_cs, f, ErrStat, ErrM
CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN
END IF
ul = [frame_cs(1)*ug(1) + frame_cs(2)*ug(2), -frame_cs(2)*ug(1) + frame_cs(1)*ug(2), ug(3)]
- CALL CD_HermiteCable_Attachment_Drag(ul, q(base + 4:base + 6), opts%rhoW, att(4, k), att(6, k), fd, es, em)
+ CALL CD_HermiteCable_Attachment_Drag(ul, q(base + 4:base + 6), opts%rhoW, att(4, k), MAX(att(6, k), CD_ZERO), &
+ fd, es, em, isotropic=att(6, k) < CD_ZERO)
IF (es /= CD_HCDYN_OK) THEN
CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN
END IF
@@ -14403,6 +14466,7 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti
END IF
END DO
CALL normalize_stock_endpoint_order(points, lines, sections, types)
+ CALL promote_free_cable_ends(points, lines, sections, types, opts, SIZE(bodies), SIZE(rods), ext_march)
tors_marched = ext_march
IF (PRESENT(static_run)) tors_marched = ext_march .AND. .NOT. static_run
! A static check marches no step, so it needs no dtM: on the routes no caller marches
@@ -19309,6 +19373,139 @@ LOGICAL FUNCTION finite_ei_by_name(line_id) RESULT(fin)
END FUNCTION finite_ei_by_name
END SUBROUTINE normalize_stock_endpoint_order
+ SUBROUTINE promote_free_cable_ends(points, lines, sections, types, opts, n_bodies, n_rods, caller_driven)
+ !! A Free point that ends exactly one finite-EI line, as its End B, from a Coupled or Vessel
+ !! End A, on a standalone deck whose lines are all finite-EI and that has no other dynamic
+ !! object (BODIES, RODS, other Free/Connect points), becomes the line's free End B: the line's
+ !! End B position is free in the static equilibrium and the dynamics, and the point's Mass,
+ !! Volume, CdA and CA ride on it as an end attachment (ATTACHMENTS at the line's full arc
+ !! length). The line must be pinned in bending at both ends with at most one end restrained in
+ !! torsion, which is then not solved (a free end carries no moment or torque), and the end must
+ !! hang (the point and the line net heavy). The point's type reads 'fixed' from here
+ !! on, so the builder seeds the static solve with the end held, then releases it
+ !! (build_one_hermite_cable): the seed is on the chord from End A towards the deck position, at
+ !! the line's length stretched by its hanging weight (the taut straight line; a vertical span of
+ !! exactly the line's length has no catenary seed). A deck with any Free point that is not such
+ !! an end is left as it is, to the routes that take Free points or refuse them by name.
+ TYPE(DeckPoint), INTENT(INOUT) :: points(:)
+ TYPE(DeckLine), INTENT(INOUT) :: lines(:)
+ TYPE(DeckSection), INTENT(IN) :: sections(:)
+ TYPE(DeckLineType), INTENT(IN) :: types(:)
+ TYPE(DeckOptions), INTENT(IN) :: opts
+ INTEGER, INTENT(IN) :: n_bodies, n_rods
+ LOGICAL, INTENT(IN) :: caller_driven
+ INTEGER :: ip, j, nref, jl, ia, k, it
+ INTEGER :: cand_line(SIZE(points))
+ REAL(wp) :: seed(3, SIZE(points)), arc, wline, wpt, ea_min, chord(3), cl
+ REAL(wp), ALLOCATABLE :: att_new(:, :)
+ IF (caller_driven .OR. n_bodies > 0 .OR. n_rods > 0 .OR. SIZE(lines) < 1) RETURN
+ ! (a bathymetry deck keeps its behaviour: the seed is placed against the flat seabed only)
+ IF (opts%has_bathymetry_file) RETURN
+ DO j = 1, SIZE(lines)
+ IF (.NOT. finite_ei_line(lines(j)%id)) RETURN
+ END DO
+ cand_line = 0
+ DO ip = 1, SIZE(points)
+ IF (TRIM(points(ip)%ptype) == 'connect') RETURN
+ IF (TRIM(points(ip)%ptype) /= 'free') CYCLE
+ nref = 0
+ jl = 0
+ DO j = 1, SIZE(lines)
+ IF (lines(j)%nodeA == points(ip)%id .OR. lines(j)%nodeB == points(ip)%id) THEN
+ nref = nref + 1
+ jl = j
+ END IF
+ END DO
+ IF (nref /= 1) RETURN
+ IF (lines(jl)%nodeB /= points(ip)%id) RETURN
+ ia = find_point(points, lines(jl)%nodeA)
+ IF (ia < 1) RETURN
+ ! End A must be the driven (or still) fairlead of a deck without dynamic points
+ IF (TRIM(points(ia)%ptype) /= 'coupled' .AND. TRIM(points(ia)%ptype) /= 'vessel') RETURN
+ ! pinned in bending at both ends; a torsion restraint at one end is not solved (a free end
+ ! carries no torque; resolve_one_end_torsion notes it), at both ends the deck is left as it is
+ IF (ANY(lines(jl)%endconn_mode /= CD_ENDCONN_PINNED) .OR. COUNT(lines(jl)%tors_mode /= TORS_FREE) > 1) RETURN
+ ! the hanging weight (line and point, in water) and the softest section
+ wline = CD_ZERO
+ ea_min = HUGE(CD_ONE)
+ arc = CD_ZERO
+ DO k = 1, SIZE(sections)
+ IF (sections(k)%line_id /= lines(jl)%id) CYCLE
+ it = find_type(types, sections(k)%ltype_name)
+ IF (it < 1) RETURN
+ wline = wline + (types(it)%mass - opts%rhoW*QUARTER_PI*types(it)%diam**2)*opts%g*sections(k)%length
+ IF (types(it)%ea > CD_ZERO) ea_min = MIN(ea_min, types(it)%ea)
+ arc = arc + sections(k)%length
+ END DO
+ wpt = (points(ip)%mass - opts%rhoW*points(ip)%vol)*opts%g
+ IF (.NOT. (wline + wpt > CD_ZERO .AND. wpt >= CD_ZERO) .OR. .NOT. ea_min < HUGE(CD_ONE)) RETURN
+ chord = points(ip)%pos - points(ia)%pos
+ cl = NORM2(chord)
+ IF (cl > CD_ZERO) THEN
+ chord = chord/cl
+ ELSE
+ chord = [CD_ZERO, CD_ZERO, -CD_ONE]
+ END IF
+ seed(:, ip) = points(ia)%pos + chord*arc*(CD_ONE + (wline + wpt)/ea_min + 1.0e-9_wp)
+ ! a seed below a flat seabed (a line longer than the depth below End A) goes onto the seabed at
+ ! the same stretched length, out along the deck chord's horizontal direction (+x without one),
+ ! so the held seed is still the taut straight line; the release lays the end on the seabed
+ IF (opts%has_wtrdpth .AND. .NOT. opts%has_bathymetry_file) THEN
+ IF (seed(3, ip) < -opts%wtrdpth) THEN
+ BLOCK
+ REAL(wp) :: dlen, dz, hz(2), hn
+ dlen = NORM2(seed(:, ip) - points(ia)%pos)
+ dz = -opts%wtrdpth - points(ia)%pos(3)
+ hz = points(ip)%pos(1:2) - points(ia)%pos(1:2)
+ hn = NORM2(hz)
+ IF (hn > CD_ZERO) THEN
+ hz = hz/hn
+ ELSE
+ hz = [CD_ONE, CD_ZERO]
+ END IF
+ seed(1:2, ip) = points(ia)%pos(1:2) + hz*SQRT(MAX(dlen**2 - dz**2, CD_ZERO))
+ seed(3, ip) = -opts%wtrdpth
+ END BLOCK
+ END IF
+ END IF
+ cand_line(ip) = jl
+ END DO
+ ! every Free point of the deck is a free cable end: promote them
+ DO ip = 1, SIZE(points)
+ jl = cand_line(ip)
+ IF (jl < 1) CYCLE
+ points(ip)%pos = seed(:, ip)
+ points(ip)%free_cable_end = .TRUE.
+ points(ip)%ptype = 'fixed'
+ lines(jl)%free_end_b = .TRUE.
+ IF (points(ip)%mass > CD_ZERO .OR. points(ip)%vol > CD_ZERO .OR. points(ip)%cda > CD_ZERO) THEN
+ arc = SUM(sections%length, MASK=sections%line_id == lines(jl)%id)
+ IF (ALLOCATED(lines(jl)%att)) THEN
+ ALLOCATE (att_new(6, SIZE(lines(jl)%att, 2) + 1))
+ att_new(:, 1:SIZE(lines(jl)%att, 2)) = lines(jl)%att
+ ELSE
+ ALLOCATE (att_new(6, 1))
+ END IF
+ ! CdAx -1: the internal marker of a point's isotropic drag rho CdA |w| w / 2 (a deck
+ ! ATTACHMENTS row cannot give a negative CdAx)
+ att_new(:, SIZE(att_new, 2)) = [arc, points(ip)%mass, points(ip)%vol, points(ip)%cda, points(ip)%ca, -CD_ONE]
+ CALL MOVE_ALLOC(att_new, lines(jl)%att)
+ END IF
+ END DO
+ CONTAINS
+ LOGICAL FUNCTION finite_ei_line(line_id) RESULT(fin)
+ INTEGER, INTENT(IN) :: line_id
+ INTEGER :: kk, itt
+ fin = .FALSE.
+ DO kk = 1, SIZE(sections)
+ IF (sections(kk)%line_id /= line_id) CYCLE
+ itt = find_type(types, sections(kk)%ltype_name)
+ IF (itt < 1) CYCLE
+ IF (types(itt)%ei > CD_ZERO) fin = .TRUE.
+ END DO
+ END FUNCTION finite_ei_line
+ END SUBROUTINE promote_free_cable_ends
+
SUBROUTINE reverse_line_sections(sections, line_id)
!! Reverse the in-deck order of the SECTIONS rows belonging to one line (their
!! positions in the global array are kept; only the payloads swap).
@@ -19353,6 +19550,8 @@ SUBROUTINE check_fixed_point_above_seabed(pt, z_floor, what, ErrStat, ErrMsg, z_
REAL(wp) :: tol
ErrStat = 0; ErrMsg = ''
+ ! a free cable end's position is a static seed, not an anchor (promote_free_cable_ends)
+ IF (pt%free_cable_end) RETURN
tol = CD_Static_Anchor_Seabed_Tolerance(z_floor)
! (a relative round-off margin keeps an anchor written exactly one tolerance off inside)
IF (ABS(pt%pos(3) - z_floor) <= tol*(CD_ONE + 1.0e-9_wp)) THEN
@@ -20045,9 +20244,11 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio
CASE ('fixed', 'coupled', 'vessel')
! Mass/Vol/CdA/Ca (clump weight, buoyancy, drag area, added mass) apply only to
! Connect/Free points; non-zero values on a held point would be silently ignored,
- ! so fail closed rather than solve as if they were zero.
- IF (ABS(points(i)%mass) > CD_ZERO .OR. ABS(points(i)%vol) > CD_ZERO .OR. &
- ABS(points(i)%cda) > CD_ZERO .OR. ABS(points(i)%ca) > CD_ZERO) THEN
+ ! so fail closed rather than solve as if they were zero. (A free cable end keeps its Free
+ ! point's columns: they act as its end attachment, promote_free_cable_ends.)
+ IF ((ABS(points(i)%mass) > CD_ZERO .OR. ABS(points(i)%vol) > CD_ZERO .OR. &
+ ABS(points(i)%cda) > CD_ZERO .OR. ABS(points(i)%ca) > CD_ZERO) .AND. &
+ .NOT. points(i)%free_cable_end) THEN
CALL fail(ErrStat, ErrMsg, 'POINT '//'(Fixed/Coupled/Vessel) must not carry '// &
'Mass/Vol/CdA/Ca load columns (those apply to Connect/Free points)'); RETURN
END IF
@@ -33892,6 +34093,22 @@ SUBROUTINE write_hermite_model_row(unit, time, channels, lines, points, cables,
CALL fail(ErrStat, ErrMsg, 'Hermite motion OUTPUT is missing its point'); RETURN
END IF
val = motion%q(comp, mi, motion_time_index)
+ ELSE IF (points(pp)%free_cable_end) THEN
+ ! a free cable end (promote_free_cable_ends): the End B node of its line
+ BLOCK
+ INTEGER :: lf
+ CHARACTER(NAMELEN) :: chf
+ CHARACTER(3), PARAMETER :: AXES = 'xyz'
+ DO lf = 1, SIZE(lines)
+ IF (lines(lf)%free_end_b .AND. lines(lf)%nodeB == pidx) EXIT
+ END DO
+ IF (lf > SIZE(lines)) THEN
+ CALL fail(ErrStat, ErrMsg, 'Hermite Point OUTPUT: free cable end without its line'); RETURN
+ END IF
+ WRITE (chf, '(A,I0,A,I0,A)') 'L', lines(lf)%id, 'N', cables(lf)%line%nn, 'p'//AXES(comp:comp)
+ CALL eval_cable_channel(cables(lf), chf, val, ErrStat, ErrMsg, mesh_node=.TRUE.)
+ IF (ErrStat /= CD_DECKDRV_OK) RETURN
+ END BLOCK
ELSE
val = points(pp)%pos(comp)
END IF
@@ -41187,6 +41404,8 @@ SUBROUTINE resolve_one_end_torsion(types, bodies, rods, points, lines, sections,
why = 'its LINE TYPES rows give no GJ (the 14-column row; torsion has no EI/1.3 default)'
ELSE IF (j < 1) THEN
why = 'its End B point is undefined'
+ ELSE IF (points(j)%free_cable_end) THEN
+ why = 'its End B is a free end (a Free point)'
ELSE IF (TRIM(points(j)%ptype) /= 'fixed') THEN
why = 'it has two moving ends (torsion needs a Fixed End B)'
ELSE IF (.NOT. opts%alpha_force_blend .AND. (caller_driven .OR. (opts%has_tmax .AND. opts%tmax > CD_ZERO))) THEN
diff --git a/src/CableDyn_HermiteCableDynamic.f90 b/src/CableDyn_HermiteCableDynamic.f90
index 1bb731e..7546323 100644
--- a/src/CableDyn_HermiteCableDynamic.f90
+++ b/src/CableDyn_HermiteCableDynamic.f90
@@ -506,6 +506,10 @@ MODULE CableDyn_HermiteCableDynamic
LOGICAL :: a_restored = .FALSE.
INTEGER, ALLOCATABLE :: att_node(:)
REAL(wp), ALLOCATABLE :: att_w(:), att_b(:), att_fk(:), att_cda(:), att_cdax(:)
+ ! a point's isotropic drag (a Free point ending the line) in place of the normal/axial split
+ LOGICAL, ALLOCATABLE :: att_iso(:)
+ ! the point a free end carries: in the equations of motion, not in the end force
+ LOGICAL, ALLOCATABLE :: att_point(:)
! The two nodal mass terms each attachment adds to Mgb, the dry mass m and the added mass
! Ca rho V, kept so that a length change rebuilds Mgb in the order initialisation used.
REAL(wp), ALLOCATABLE :: att_mass(:), att_madd(:)
@@ -2218,7 +2222,7 @@ END SUBROUTINE fail_fr
END SUBROUTINE CD_HermiteCable_Dyn_Set_Friction_Anchors
SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, cdax, ca, rho_w, gravity, &
- ErrStat, ErrMsg)
+ ErrStat, ErrMsg, isotropic, point_load)
!! Install discrete point attachments (clumps, buoyancy modules) lumped at nodes. Each
!! carries its weight and buoyancy (m - rho V) g downward, isotropic added mass
!! Ca rho V (with the dry mass m, a constant nodal mass on the translational DOFs), the
@@ -2229,12 +2233,18 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
!! surface an attachment loses its buoyancy and fluid loads. Called once, after Init and
!! never together with internal waves; the initial acceleration is refreshed. The
!! kinetic energy (CD_HermiteCable_Dyn_Energy) then includes the attachment mass and its
- !! added mass Ca rho V.
+ !! added mass Ca rho V. isotropic (optional, default false) makes an attachment's drag a
+ !! point's, rho CdA |w| w / 2 on the whole relative velocity (CdAx unused), as a Free point
+ !! that ends the line carries it. point_load (optional, default false) marks the attachment
+ !! that is the point itself on a free end: it stays in the equations of motion, but
+ !! CD_HermiteCable_Dyn_End_Force leaves its loads out, so the end force is the line load
+ !! the point balances (its submerged weight for a clump at rest).
TYPE(CD_HermiteCableDynType), INTENT(INOUT) :: model
INTEGER, INTENT(IN) :: node(:)
REAL(wp), INTENT(IN) :: mass(:), volume(:), cda(:), cdax(:), ca(:), rho_w, gravity
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic(:), point_load(:)
INTEGER :: n, k, d, dof, es
REAL(wp), ALLOCATABLE :: a_old(:), mgb_old(:, :)
CHARACTER(1024) :: em
@@ -2259,6 +2269,20 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: node/mass/volume/cda/ca must share one length >= 1'
RETURN
END IF
+ IF (PRESENT(isotropic)) THEN
+ IF (SIZE(isotropic) /= n) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: isotropic must have one entry per attachment'
+ RETURN
+ END IF
+ END IF
+ IF (PRESENT(point_load)) THEN
+ IF (SIZE(point_load) /= n) THEN
+ ErrStat = CD_HCDYN_BADINPUT
+ ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: point_load must have one entry per attachment'
+ RETURN
+ END IF
+ END IF
IF (ANY(node < 1) .OR. ANY(node > model%nn)) THEN
ErrStat = CD_HCDYN_BADINPUT; ErrMsg = 'CD_HermiteCable_Dyn_Set_Attachments: node out of range'; RETURN
END IF
@@ -2279,7 +2303,12 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
a_old = model%a
mgb_old = model%Mgb
ALLOCATE (model%att_node(n), model%att_w(n), model%att_b(n), model%att_fk(n), model%att_cda(n), &
- model%att_cdax(n), model%att_mass(n), model%att_madd(n))
+ model%att_cdax(n), model%att_mass(n), model%att_madd(n), model%att_iso(n), &
+ model%att_point(n))
+ model%att_iso = .FALSE.
+ IF (PRESENT(isotropic)) model%att_iso = isotropic
+ model%att_point = .FALSE.
+ IF (PRESENT(point_load)) model%att_point = point_load
model%att_node = node
model%att_w = (mass - rho_w*volume)*gravity
model%att_b = rho_w*gravity*volume
@@ -2299,7 +2328,7 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
CALL solve_consistent_acceleration(model, es, em)
IF (es /= CD_HCDYN_OK) THEN
DEALLOCATE (model%att_node, model%att_w, model%att_b, model%att_fk, model%att_cda, model%att_cdax, &
- model%att_mass, model%att_madd)
+ model%att_mass, model%att_madd, model%att_iso, model%att_point)
model%has_attach = .FALSE.
model%Mgb = mgb_old
model%a = a_old
@@ -2309,17 +2338,40 @@ SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments(model, node, mass, volume, cda, c
END SUBROUTINE CD_HermiteCable_Dyn_Set_Attachments
SUBROUTINE CD_HermiteCable_Attachment_Drag(rel_velocity, tangent, rho, cda, cdax, force, ErrStat, ErrMsg, &
- jac_rel, jac_tan)
+ jac_rel, jac_tan, isotropic)
!! Quadratic drag of a line attachment: f = rho [CdA |w_n| w_n + CdAx |w_t| w_t] / 2 with
!! w the relative fluid velocity split normal and axial to the line tangent (any non-zero
!! vector; normalised internally). Optional Jacobians d f/d w and d f/d tangent, as a pair.
!! Shared by the dynamic residual and the deck static solve, so both use one law.
+ !! isotropic (optional, default false): a point's drag f = rho CdA |w| w / 2 on the whole
+ !! relative velocity (CdAx unused; d f/d tangent = 0), the law of a Free point.
REAL(wp), INTENT(IN) :: rel_velocity(3), tangent(3), rho, cda, cdax
REAL(wp), INTENT(OUT) :: force(3)
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
REAL(wp), INTENT(OUT), OPTIONAL :: jac_rel(3, 3), jac_tan(3, 3)
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic
REAL(wp), PARAMETER :: PI_A = 3.14159265358979323846_wp
+ REAL(wp) :: wn
+ INTEGER :: i
+ IF (PRESENT(isotropic)) THEN
+ IF (isotropic) THEN
+ ErrStat = CD_HCDYN_OK; ErrMsg = ''
+ wn = NORM2(rel_velocity)
+ force = 0.5_wp*rho*cda*wn*rel_velocity
+ IF (PRESENT(jac_rel) .AND. PRESENT(jac_tan)) THEN
+ jac_tan = CD_ZERO
+ jac_rel = CD_ZERO
+ IF (wn > CD_ZERO) THEN
+ jac_rel = 0.5_wp*rho*cda*SPREAD(rel_velocity, 2, 3)*SPREAD(rel_velocity, 1, 3)/wn
+ DO i = 1, 3
+ jac_rel(i, i) = jac_rel(i, i) + 0.5_wp*rho*cda*wn
+ END DO
+ END IF
+ END IF
+ RETURN
+ END IF
+ END IF
! The Morison per-length primitive with unit diameter is 1/2 rho Cdn |w_n| w_n +
! 1/2 rho pi Cdt |w_t| w_t, so Cdn = CdA and Cdt = CdAx/pi.
IF (PRESENT(jac_rel) .AND. PRESENT(jac_tan)) THEN
@@ -2414,11 +2466,12 @@ SUBROUTINE attachment_residual(model, k, q_cfg, v_cfg, want_jac, rk, has_jac, jr
wrel = u - v_cfg(base + 1:base + 3)
IF (want_jac) THEN
CALL CD_HermiteCable_Attachment_Drag(wrel, q_cfg(base + 4:base + 6), model%att_rho, model%att_cda(k), &
- model%att_cdax(k), f, ErrStat, ErrMsg, jrel, jtan)
+ model%att_cdax(k), f, ErrStat, ErrMsg, jrel, jtan, &
+ isotropic=model%att_iso(k))
has_jac = .TRUE.
ELSE
CALL CD_HermiteCable_Attachment_Drag(wrel, q_cfg(base + 4:base + 6), model%att_rho, model%att_cda(k), &
- model%att_cdax(k), f, ErrStat, ErrMsg)
+ model%att_cdax(k), f, ErrStat, ErrMsg, isotropic=model%att_iso(k))
END IF
IF (ErrStat /= CD_HCDYN_OK) RETURN
rk = rk - f
@@ -7519,9 +7572,10 @@ SUBROUTINE CD_HermiteCable_Dyn_End_Force(model, node, force, ErrStat, ErrMsg)
END IF
IF (model%has_attach) THEN
! A clump or buoy on the end node loads the point holding it, exactly as it loads the
- ! end node in the residual (assemble_attachments).
+ ! end node in the residual (assemble_attachments). The point a free end carries
+ ! (att_point) is the body this force acts on, so its own loads stay out.
DO k = 1, SIZE(model%att_node)
- IF (model%att_node(k) /= node) CYCLE
+ IF (model%att_node(k) /= node .OR. model%att_point(k)) CYCLE
CALL attachment_residual(model, k, model%q, model%v, .FALSE., rk, has_jac, jrel, jtan, es, em2)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = es; ErrMsg = 'CD_HermiteCable_Dyn_End_Force: '//TRIM(em2); RETURN
@@ -9247,6 +9301,8 @@ SUBROUTINE CD_HermiteCable_Dyn_End(model)
IF (ALLOCATED(model%att_node)) DEALLOCATE (model%att_node, model%att_w, model%att_b, model%att_fk, &
model%att_cda, model%att_cdax)
IF (ALLOCATED(model%att_mass)) DEALLOCATE (model%att_mass, model%att_madd)
+ IF (ALLOCATED(model%att_iso)) DEALLOCATE (model%att_iso)
+ IF (ALLOCATED(model%att_point)) DEALLOCATE (model%att_point)
model%has_attach = .FALSE.
IF (ALLOCATED(model%l0_dot)) DEALLOCATE (model%l0_dot, model%l0_c, model%l0_dot_c, model%ws_recovery_l0_c, &
model%ws_recovery_l0_dot_c)
diff --git a/src/CableDyn_OpenFAST_HermiteFMF.f90 b/src/CableDyn_OpenFAST_HermiteFMF.f90
index bb28e17..1dd2aca 100644
--- a/src/CableDyn_OpenFAST_HermiteFMF.f90
+++ b/src/CableDyn_OpenFAST_HermiteFMF.f90
@@ -330,7 +330,8 @@ SUBROUTINE CD_HFMF_Set_Drag(self, rho_w, diam, cdn, cdt, waterline_z, current, E
END IF
END SUBROUTINE CD_HFMF_Set_Drag
- SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_w, gravity, ErrStat, ErrMsg)
+ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_w, gravity, ErrStat, ErrMsg, &
+ isotropic, point_load)
!! Install discrete point attachments lumped at cable nodes (internal node order,
!! anchor = node 1); see CD_HermiteCable_Dyn_Set_Attachments.
TYPE(CD_HFMF_ModuleType), INTENT(INOUT) :: self
@@ -338,6 +339,7 @@ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_
REAL(wp), INTENT(IN) :: mass(:), volume(:), cda(:), cdax(:), ca(:), rho_w, gravity
INTEGER, INTENT(OUT) :: ErrStat
CHARACTER(*), INTENT(OUT) :: ErrMsg
+ LOGICAL, INTENT(IN), OPTIONAL :: isotropic(:), point_load(:)
INTEGER :: es
CHARACTER(1024) :: em
ErrStat = CD_HFMF_OK; ErrMsg = ''
@@ -345,7 +347,7 @@ SUBROUTINE CD_HFMF_Set_Attachments(self, node, mass, volume, cda, cdax, ca, rho_
ErrStat = CD_HFMF_BADINPUT; ErrMsg = 'CD_HFMF_Set_Attachments: module not initialised'; RETURN
END IF
CALL CD_HermiteCable_Dyn_Set_Attachments(self%line, node, mass, volume, cda, cdax, ca, rho_w, gravity, &
- es, em)
+ es, em, isotropic=isotropic, point_load=point_load)
IF (es /= CD_HCDYN_OK) THEN
ErrStat = CD_HFMF_BADINPUT; ErrMsg = TRIM(em)
END IF
diff --git a/tests/test_free_end_deck.f90 b/tests/test_free_end_deck.f90
new file mode 100644
index 0000000..ef2d6dd
--- /dev/null
+++ b/tests/test_free_end_deck.f90
@@ -0,0 +1,357 @@
+! File: tests/test_free_end_deck.f90
+! SPDX-License-Identifier: Apache-2.0
+! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University
+PROGRAM test_free_end_deck
+ !! A finite-EI line ending on a Free point (a free end): a 7 m cable (Diam 0.048 m, 2.8 kg/m,
+ !! EA 1e8 N) hanging from a Coupled point at z = -0.5 m with a 200 kg clump (0.02548 m^3, CdA
+ !! 0.06 m^2, CA 1) on its Free End B, 70 elements:
+ !! F1 in still water the run holds the static state: the top tension is the submerged weight of
+ !! the line and the clump (to 1e-6 relative), the end hangs one stretched line length below
+ !! the top (the stretch (W_B L + w L^2/2)/EA, to 1e-7 m), nothing moves over the run, and
+ !! the force the line exerts on the point (AnchTen1, Point2Fz) is the clump's submerged weight
+ !! (to 1e-6 relative), as the EI = 0 Free point reads it: the point's own loads stay out;
+ !! F2 in a 0.5 m/s current along x the end rests where the same deck as an EI = 0 line on the
+ !! point-system route puts its Free point (EI 3 N m^2: within 2e-5 m), and the Point
+ !! channels of the free end read its line's End B node;
+ !! F3 a prescribed 0.05 m sway of the top at 0.05 Hz moves the end in phase with an amplitude
+ !! ratio within 1 % of the Rayleigh estimate for a hanging string with a heavy end mass
+ !! (1.104: the end mass with its added mass, a third of the line's, the mean tension);
+ !! F6 the point keeps its isotropic drag rho CdA |w| w / 2: in a vertical 0.5 m/s current along
+ !! the hanging line (axial flow at the end) the top tension grows by the clump's drag
+ !! rho CdA w^2 / 2 = 7.69 N (to 1e-3 N; the line's own axial drag is zero here);
+ !! F5 on a flat seabed above which the vertical seed would lie (7.3 m deep, the line 7 m from
+ !! z = -0.5 m), a 5 kg end in a 0.8 m/s current rests above the seabed (the seed is placed on
+ !! it, the release lifts the end), and the 200 kg clump, which comes to rest on the seabed
+ !! (6 m deep), is refused by name (a Free point has no seabed contact on a finite-EI line);
+ !! F4 a Free point that is not such an end leaves the deck as it was, refused by the routes'
+ !! own messages: a clamped End B, a net-buoyant end, a second Free point.
+ USE CableDyn_Precision, ONLY: wp
+ USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK
+ IMPLICIT NONE
+ REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, G = 9.80665_wp, RHO = 1025.0_wp
+ REAL(wp), PARAMETER :: L = 7.0_wp, D = 0.048_wp, M = 2.8_wp, EA = 1.0e8_wp
+ REAL(wp), PARAMETER :: MB = 200.0_wp, VB = 0.02548_wp
+ INTEGER :: nfail = 0
+
+ CALL check_still()
+ CALL check_current()
+ CALL check_sway()
+ CALL check_refusals()
+ CALL check_seabed()
+ CALL check_axial_drag()
+ IF (nfail > 0) THEN
+ WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed'
+ ERROR STOP 1
+ END IF
+ WRITE (*, '(A)') 'PASS: free cable end deck gates'
+
+CONTAINS
+
+ SUBROUTINE require(cond, label)
+ LOGICAL, INTENT(IN) :: cond
+ CHARACTER(*), INTENT(IN) :: label
+ IF (cond) RETURN
+ nfail = nfail + 1
+ WRITE (*, '(A)') 'FAIL: '//TRIM(label)
+ END SUBROUTINE require
+
+ SUBROUTINE write_profile(path, u)
+ CHARACTER(*), INTENT(IN) :: path
+ REAL(wp), INTENT(IN) :: u
+ INTEGER :: k
+ OPEN (NEWUNIT=k, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (k, '(A)') 'z ux uy uz'
+ WRITE (k, '(A)') '(m) (m/s) (m/s) (m/s)'
+ WRITE (k, '(A,F6.3,A)') '-20 ', u, ' 0 0'
+ WRITE (k, '(A,F6.3,A)') '0 ', u, ' 0 0'
+ CLOSE (k)
+ END SUBROUTINE write_profile
+
+ SUBROUTINE write_deck(path, ei, pt2, extra_pts, endconn, opts_extra, outs, dt, tmax)
+ !! ei: the type's EI; pt2: the Free point row of End B (after 'ID'); extra_pts: more POINTS rows
+ !! (';'-separated, '' for none); endconn: an END CONNECTIONS data row ('' for none);
+ !! opts_extra: more OPTIONS rows (';'-separated); outs: OUTPUTS channels (';'-separated).
+ CHARACTER(*), INTENT(IN) :: path, ei, pt2, extra_pts, endconn, opts_extra, outs
+ REAL(wp), INTENT(IN) :: dt, tmax
+ INTEGER :: u
+ OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '--------------------- CableDyn Input File ---------------------------------'
+ WRITE (u, '(A)') 'free cable end gate'
+ WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------'
+ WRITE (u, '(A)') 'TypeName Diam Mass EA BA EI Cd_n Cd_t Ca_n Ca_t'
+ WRITE (u, '(A)') '(-) (m) (kg/m) (N) (N-s) (N-m^2) (-) (-) (-) (-)'
+ WRITE (u, '(A)') 'cable 0.048 2.8 1.0e8 0.0 '//ei//' 1.2 0.0 1.0 0.0'
+ WRITE (u, '(A)') '----------------------- POINTS ----------------------------------------------'
+ WRITE (u, '(A)') 'ID Attachment X Y Z M V CdA CA'
+ WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)'
+ WRITE (u, '(A)') '1 Coupled 0.0 0.0 -0.5 0 0 0 0'
+ WRITE (u, '(A)') '2 '//pt2
+ CALL put_rows(u, extra_pts)
+ WRITE (u, '(A)') '----------------------- LINES -----------------------------------------------'
+ WRITE (u, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs Outputs'
+ WRITE (u, '(A)') '(-) (-) (-) (-) (m) (-) (-)'
+ WRITE (u, '(A)') '1 cable 1 2 7.0 70 -'
+ IF (LEN_TRIM(endconn) > 0) THEN
+ WRITE (u, '(A)') '--------------------- END CONNECTIONS ----------------------------------'
+ WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ'
+ WRITE (u, '(A)') '(-) (-) (N-m/rad) (-) (-) (-)'
+ WRITE (u, '(A)') endconn
+ END IF
+ WRITE (u, '(A)') '---------------------- OPTIONS ----------------------------------------------'
+ WRITE (u, '(A)') '1025 rhoW'
+ WRITE (u, '(A)') '9.80665 g'
+ IF (INDEX(opts_extra, 'WtrDpth') == 0) WRITE (u, '(A)') '20 WtrDpth'
+ WRITE (u, '(ES12.5,A)') dt, ' dtM'
+ WRITE (u, '(ES12.5,A)') tmax, ' TMax'
+ CALL put_rows(u, opts_extra)
+ WRITE (u, '(A)') '---------------------- OUTPUTS -----------------------------------------------'
+ CALL put_rows(u, outs)
+ WRITE (u, '(A)') 'END'
+ WRITE (u, '(A)') '------------------------- need this line --------------------------------------'
+ CLOSE (u)
+ END SUBROUTINE write_deck
+
+ SUBROUTINE put_rows(u, rows)
+ INTEGER, INTENT(IN) :: u
+ CHARACTER(*), INTENT(IN) :: rows
+ INTEGER :: i0, i1
+ i0 = 1
+ DO WHILE (i0 <= LEN_TRIM(rows))
+ i1 = INDEX(rows(i0:), ';')
+ IF (i1 == 0) THEN
+ WRITE (u, '(A)') TRIM(rows(i0:))
+ EXIT
+ END IF
+ WRITE (u, '(A)') rows(i0:i0 + i1 - 2)
+ i0 = i0 + i1
+ END DO
+ END SUBROUTINE put_rows
+
+ SUBROUTINE run(deck, root, ok, msg)
+ CHARACTER(*), INTENT(IN) :: deck, root
+ LOGICAL, INTENT(OUT) :: ok
+ CHARACTER(*), INTENT(OUT) :: msg
+ LOGICAL :: conv
+ INTEGER :: es
+ CALL CD_Run_Deck_Driver(deck, root, conv, es, msg)
+ ok = es == CD_DECKDRV_OK
+ END SUBROUTINE run
+
+ SUBROUTINE read_out(path, ncol, tab, n)
+ CHARACTER(*), INTENT(IN) :: path
+ INTEGER, INTENT(IN) :: ncol
+ REAL(wp), ALLOCATABLE, INTENT(OUT) :: tab(:, :)
+ INTEGER, INTENT(OUT) :: n
+ CHARACTER(2048) :: rec
+ INTEGER :: u, ios
+ ALLOCATE (tab(ncol, 20000))
+ n = 0
+ OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios)
+ IF (ios /= 0) RETURN
+ READ (u, '(A)') rec
+ READ (u, '(A)') rec
+ DO
+ READ (u, '(A)', IOSTAT=ios) rec
+ IF (ios /= 0) EXIT
+ IF (LEN_TRIM(rec) == 0) CYCLE
+ IF (n == SIZE(tab, 2)) EXIT
+ n = n + 1
+ READ (rec, *) tab(:, n)
+ END DO
+ CLOSE (u)
+ END SUBROUTINE read_out
+
+ SUBROUTINE check_still()
+ REAL(wp), ALLOCATABLE :: tab(:, :), t0(:, :)
+ REAL(wp) :: w, wb, stretch
+ INTEGER :: n, n0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('fed_still.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '', &
+ 'FairTen1;Point2px;Point2pz;AnchTen1;Point2Fz;Point2Fx', 0.005_wp, 2.0_wp)
+ CALL run('fed_still.dat', 'fed_still', ok, msg)
+ CALL require(ok, 'F1 still-water run: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_still.out', 7, tab, n)
+ CALL require(n > 10, 'F1 output rows')
+ IF (n <= 10) RETURN
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ stretch = (wb*L + 0.5_wp*w*L**2)/EA
+ CALL require(ABS(tab(2, 1)/(w*L + wb) - 1.0_wp) < 1.0e-6_wp, 'F1 top tension = submerged weight')
+ CALL require(ABS(tab(4, 1) - (-0.5_wp - L - stretch)) < 1.0e-7_wp, 'F1 end one stretched length below')
+ CALL require(MAXVAL(ABS(tab(3:4, 1:n) - SPREAD(tab(3:4, 1), 2, n))) < 1.0e-10_wp, 'F1 nothing moves')
+ CALL require(ABS(tab(5, n)/wb - 1.0_wp) < 1.0e-6_wp, 'F1 AnchTen = the clump''s submerged weight')
+ CALL require(ABS(tab(6, n)/wb - 1.0_wp) < 1.0e-6_wp .AND. ABS(tab(7, n)) < 1.0e-6_wp*wb, &
+ 'F1 Point2Fz = the clump''s submerged weight')
+ CALL write_deck('fed_still0.dat', '0', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '', &
+ 'AnchTen1;Point2Fz', 0.005_wp, 0.1_wp)
+ CALL run('fed_still0.dat', 'fed_still0', ok, msg)
+ CALL require(ok, 'F1 EI = 0 still-water run: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_still0.out', 3, t0, n0)
+ IF (n0 > 0) CALL require(ABS(tab(5, n) - t0(2, n0)) < 1.0e-6_wp*wb .AND. &
+ ABS(tab(6, n) - t0(3, n0)) < 1.0e-6_wp*wb, 'F1 the end force = the EI = 0 Free point''s')
+ END SUBROUTINE check_still
+
+ SUBROUTINE check_current()
+ REAL(wp), ALLOCATABLE :: tf(:, :), t0(:, :)
+ INTEGER :: nf, n0
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_profile('current_profile.txt', 0.5_wp)
+ CALL write_deck('fed_cur.dat', '3', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'Point2px;Con2pz;L1N71px;L1N71pz', 0.005_wp, 0.5_wp)
+ CALL run('fed_cur.dat', 'fed_cur', ok, msg)
+ CALL require(ok, 'F2 finite-EI free end in current: '//TRIM(msg))
+ CALL write_deck('fed_cur0.dat', '0', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'Point2px;Point2pz', 0.005_wp, 0.5_wp)
+ CALL run('fed_cur0.dat', 'fed_cur0', ok, msg)
+ CALL require(ok, 'F2 EI = 0 Free point in current: '//TRIM(msg))
+ CALL read_out('fed_cur.out', 5, tf, nf)
+ CALL read_out('fed_cur0.out', 3, t0, n0)
+ IF (nf < 1 .OR. n0 < 1) THEN
+ CALL require(.FALSE., 'F2 output rows')
+ RETURN
+ END IF
+ CALL require(ABS(tf(2, 1) - t0(2, 1)) < 2.0e-5_wp .AND. ABS(tf(3, 1) - t0(3, 1)) < 2.0e-5_wp, &
+ 'F2 rest position = the EI = 0 Free point''s')
+ CALL require(tf(2, 1) > 0.1_wp, 'F2 the end is carried downstream')
+ CALL require(ABS(tf(2, nf) - tf(4, nf)) < 1.0e-12_wp .AND. ABS(tf(3, nf) - tf(5, nf)) < 1.0e-12_wp, &
+ 'F2 Point channels read the End B node')
+ END SUBROUTINE check_current
+
+ SUBROUTINE check_sway()
+ REAL(wp), PARAMETER :: A = 0.05_wp, F = 0.05_wp, DT = 0.01_wp, TMAX = 120.0_wp, TR = 20.0_wp
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: t, r, dr, ddr, om, s, c, ata(3, 3), atb(3), coef(3), w, wb, ma, tmean, om2, ratio
+ INTEGER :: u, k, n, i
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ om = 2.0_wp*PI*F
+ OPEN (NEWUNIT=u, FILE='fed_motion.txt', STATUS='REPLACE', ACTION='WRITE')
+ WRITE (u, '(A)') '# time point x y z vx vy vz ax ay az'
+ DO k = 0, NINT(TMAX/DT)
+ t = REAL(k, wp)*DT
+ IF (t < TR) THEN
+ r = 0.5_wp*(1.0_wp - COS(PI*t/TR))
+ dr = 0.5_wp*PI/TR*SIN(PI*t/TR)
+ ddr = 0.5_wp*(PI/TR)**2*COS(PI*t/TR)
+ ELSE
+ r = 1.0_wp; dr = 0.0_wp; ddr = 0.0_wp
+ END IF
+ s = SIN(om*t); c = COS(om*t)
+ WRITE (u, '(F12.6,A,3ES17.9,A,ES17.9,A,ES17.9,A)') t, ' 1', A*r*s, 0.0_wp, -0.5_wp, ' ', &
+ A*(dr*s + r*om*c), ' 0 0 ', A*(ddr*s + 2.0_wp*dr*om*c - r*om*om*s), ' 0 0'
+ END DO
+ CLOSE (u)
+ CALL write_deck('fed_sway.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', &
+ 'fed_motion.txt motionFile', 'Point2px', DT, TMAX)
+ CALL run('fed_sway.dat', 'fed_sway', ok, msg)
+ CALL require(ok, 'F3 prescribed sway: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_sway.out', 2, tab, n)
+ ata = 0.0_wp; atb = 0.0_wp
+ DO i = 1, n
+ IF (tab(1, i) < 40.0_wp) CYCLE
+ coef = [SIN(om*tab(1, i)), COS(om*tab(1, i)), 1.0_wp]
+ ata = ata + SPREAD(coef, 2, 3)*SPREAD(coef, 1, 3)
+ atb = atb + coef*tab(2, i)
+ END DO
+ CALL solve3(ata, atb, coef)
+ ! Rayleigh estimate, shape s/L from the top: omega_p^2 = (mean tension / L)/(end mass with
+ ! added mass + a third of the line's mass with added mass)
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ tmean = wb + 0.5_wp*w*L
+ ma = (MB + RHO*VB) + (M + RHO*0.25_wp*PI*D**2)*L/3.0_wp
+ om2 = (tmean/L)/ma
+ ratio = 1.0_wp/(1.0_wp - om**2/om2)
+ CALL require(ABS(HYPOT(coef(1), coef(2))/A/ratio - 1.0_wp) < 0.01_wp, 'F3 sway amplitude ratio')
+ CALL require(ABS(coef(2)) < 0.05_wp*ABS(coef(1)) .AND. coef(1) > 0.0_wp, 'F3 the end moves in phase')
+ END SUBROUTINE check_sway
+
+ SUBROUTINE solve3(a, b, x)
+ REAL(wp), INTENT(IN) :: a(3, 3), b(3)
+ REAL(wp), INTENT(OUT) :: x(3)
+ REAL(wp) :: m(3, 4), f
+ INTEGER :: i, j
+ m(:, 1:3) = a
+ m(:, 4) = b
+ DO i = 1, 3
+ DO j = i + 1, 3
+ f = m(j, i)/m(i, i)
+ m(j, :) = m(j, :) - f*m(i, :)
+ END DO
+ END DO
+ DO i = 3, 1, -1
+ x(i) = (m(i, 4) - SUM(m(i, i + 1:3)*x(i + 1:3)))/m(i, i)
+ END DO
+ END SUBROUTINE solve3
+
+ SUBROUTINE check_axial_drag()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ REAL(wp) :: w, wb
+ INTEGER :: n, k
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ OPEN (NEWUNIT=k, FILE='current_profile.txt', STATUS='REPLACE', ACTION='WRITE')
+ WRITE (k, '(A)') 'z ux uy uz'
+ WRITE (k, '(A)') '(m) (m/s) (m/s) (m/s)'
+ WRITE (k, '(A)') '-20 0 0 -0.5'
+ WRITE (k, '(A)') '0 0 0 -0.5'
+ CLOSE (k)
+ CALL write_deck('fed_axial.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', '1 Currents', &
+ 'FairTen1', 0.005_wp, 0.05_wp)
+ CALL run('fed_axial.dat', 'fed_axial', ok, msg)
+ CALL require(ok, 'F6 axial current: '//TRIM(msg))
+ IF (.NOT. ok) RETURN
+ CALL read_out('fed_axial.out', 2, tab, n)
+ w = (M - RHO*0.25_wp*PI*D**2)*G
+ wb = (MB - RHO*VB)*G
+ IF (n > 0) CALL require(ABS(tab(2, 1) - (w*L + wb + 0.5_wp*RHO*0.06_wp*0.25_wp)) < 1.0e-3_wp, &
+ 'F6 the clump''s isotropic drag in axial flow')
+ END SUBROUTINE check_axial_drag
+
+ SUBROUTINE check_seabed()
+ REAL(wp), ALLOCATABLE :: tab(:, :)
+ INTEGER :: n
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_profile('current_profile.txt', 0.8_wp)
+ CALL write_deck('fed_lift.dat', '3000', 'Free 0.0 0.0 -7.5 5 0.000637 0.01 1.0', '', '', &
+ '1 Currents;7.3 WtrDpth', 'Point2px;Point2pz', 0.005_wp, 0.2_wp)
+ CALL run('fed_lift.dat', 'fed_lift', ok, msg)
+ CALL require(ok, 'F5 a seed below the seabed, the end at rest above it: '//TRIM(msg))
+ IF (ok) THEN
+ CALL read_out('fed_lift.out', 3, tab, n)
+ IF (n > 0) CALL require(tab(3, n) > -7.3_wp + 0.5_wp .AND. tab(2, n) > 1.0_wp, 'F5 the end lifted and carried')
+ END IF
+ CALL write_profile('current_profile.txt', 0.5_wp)
+ CALL write_deck('fed_ground.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '', &
+ '1 Currents;6.0 WtrDpth', 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_ground.dat', 'fed_ground', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'comes to rest on the seabed') > 0, &
+ 'F5 a clump at rest on the seabed refused: '//TRIM(msg))
+ END SUBROUTINE check_seabed
+
+ SUBROUTINE check_refusals()
+ LOGICAL :: ok
+ CHARACTER(1024) :: msg
+ CALL write_deck('fed_r1.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', '', '1 B Rigid 0 0 -1', '', &
+ 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_r1.dat', 'fed_r1', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'non-pinned END CONNECTIONS need End B') > 0, &
+ 'F4 clamped End B refused: '//TRIM(msg))
+ CALL write_deck('fed_r2.dat', '3000', 'Free 0.0 0.0 -7.5 10 0.5 0.06 1.0', '', '', '', 'FairTen1', &
+ 0.005_wp, 0.1_wp)
+ CALL run('fed_r2.dat', 'fed_r2', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'not supported on the multibody march') > 0, &
+ 'F4 net-buoyant end refused: '//TRIM(msg))
+ CALL write_deck('fed_r3.dat', '3000', 'Free 0.0 0.0 -7.5 200 0.02548 0.06 1.0', &
+ '3 Free 5.0 0.0 -5.0 10 0 0 0', '', '', 'FairTen1', 0.005_wp, 0.1_wp)
+ CALL run('fed_r3.dat', 'fed_r3', ok, msg)
+ CALL require(.NOT. ok .AND. INDEX(msg, 'not supported on the multibody march') > 0, &
+ 'F4 a second Free point refused: '//TRIM(msg))
+ END SUBROUTINE check_refusals
+END PROGRAM test_free_end_deck