From ca57f22099cf155b3dd96abeba6bcd68aa4f418e Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 17:38:33 +0900 Subject: [PATCH 01/10] feat(bodies): CoupledPinned bodies on the coupled route Every deck refused MoorDyn-F's CoupledPinned/VesselPinned bodies. They now run in OpenFAST (CompMooring = 5) as MoorDyn-F's coupled pinned body. - The body reference point is a node of the coupling mesh that takes the platform position only; the body turns about it with its own three rotations, M_rr alpha = M - m [c]x a_p - w x (I_p w) with the CG offset and the line end-node inertia through the arms, and the node returns the body's net load less its inertia, F - (m + m_a) a_p - m (alpha x c + w x (w x c)), with no moment. As for CoupledPinned rods, the angular acceleration is solved again for the node's current acceleration, the node moves linearly within the sub-steps from the committed reference-point motion, and the 24-real body mirror carries the state (restarts and correction rewinds are bit-identical). - The sub-step estimate takes the inertia about the node, the swing of the weight and buoyancy at both node poses and the node acceleration. - PtfmInit moves and turns the deck body before the static solve, which holds the node and balances the moment about it; a body whose lines and CG lie on one axis through the node spins neutrally, so such solves take the minimum-norm Gauss-Newton step. - 14-, 15- and 18-column BODIES rows, aliases CpldPin/VesselPinned/ VesPin. Outside a coupled host (standalone, C API), without inertias, and under the linearisation probe the body is refused by name; the Python deck validator mirrors the rules. Every shipped example output is byte-identical (53 of 53). Tests: the compound pendulum against the elliptic period (1.6e-4 at dt = T/100) and the analytic pin reaction (4e-16 of m g), a constant node acceleration (mean angle -atan(a/g), effective-gravity period), a body with a CoupledPinned rod's inertia following the rod (2e-12), a symmetric mooring that does not turn the body with the node force equal to the line sum plus the body load, the output probe, snapshot/probe/ restart bit identity, PtfmInit with the static start (moment 3e-13), sub-cycling, a Coupled body beside it, and the refusals. Against the MoorDyn-F driver (inertialF 1) a pendulum with its line at the node agrees to 0.09 deg over a 120 deg swing (0.15 deg with the node surging); with the line at an arm the swings differ by up to 4.7 deg of 57 deg early on, from the line models. A pytest gate that counted every close call now collects the instances earlier tests left first, so that only the failed constructor's close is recorded. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 9 + CMakeLists.txt | 12 + VALIDATION.md | 1 + doc/capabilities.rst | 5 +- doc/capi.rst | 2 +- doc/coupling.rst | 3 +- doc/driver_format.md | 17 +- doc/migrating.rst | 6 +- doc/openfast.rst | 14 +- doc/options.rst | 6 +- doc/theory.rst | 31 +- python/cabledyn/deck_file.py | 49 +- python/tests/test_deck_file.py | 31 +- python/tests/test_native_model.py | 4 + src/CableDyn_DeckDriver.f90 | 521 +++++++++-- src/CableDyn_OpenFAST_Aggregate.f90 | 26 +- src/openfast/CableDyn_OF.f90 | 7 +- tests/test_c_api.f90 | 36 +- tests/test_openfast_pinned_body.f90 | 1296 +++++++++++++++++++++++++++ 19 files changed, 1949 insertions(+), 127 deletions(-) create mode 100644 tests/test_openfast_pinned_body.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd9b19e..68b6d352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,15 @@ All notable changes to CableDyn are recorded in this file. The format follows one turn of pretwist, in still water and in a cross-flow current, keeps its torque, twist and fairlead tension over a still 10 s run to the output precision (a torsion stage before the polish would ring by 3e-3 of the torque); neutral modules reproduce the bare line's GJ Phi / L. +- `CoupledPinned`/`VesselPinned` bodies in OpenFAST, as MoorDyn-F's coupled pinned body: the + body reference point is a node of the coupling mesh that takes the platform position only, the + body turns about it with its own three rotations, and the node returns the body's net load + less its inertia, with no moment. `PtfmInit` moves and turns the body, `bodyIC static` balances + it about its node, and the checkpoint state and correction rewind carry it. A dry compound + pendulum keeps the elliptic-integral period to 1.6e-4 at `dt = T/100`, a body with a + `CoupledPinned` rod's mass and inertia follows the rod to 2e-12, and against MoorDyn-F a + pendulum swinging through 120 deg agrees to 0.09 deg (0.15 deg when its node surges). Outside + a coupled host, without inertias, and in linearisation the body fails closed by name. - OpenFAST linearisation with the line dynamics, as MoorDyn-F's: the continuous states are the interior-node positions of every `EI = 0` line (MoorDyn's names and order) and the free degrees of freedom of every finite-EI cable (node positions and tangents), then their diff --git a/CMakeLists.txt b/CMakeLists.txt index 80bb7490..a8e8a533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1133,6 +1133,17 @@ add_test(NAME openfast_pinned_rod COMMAND test_openfast_pinned_rod WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/openfast_pinned_rod) set_tests_properties(openfast_pinned_rod PROPERTIES LABELS "fortran;dynamic;openfast;validation") +# CoupledPinned bodies on the coupled aggregate: the compound-pendulum period and pin reaction of +# a held node, a constant node acceleration against closed forms, a CoupledPinned rod of the same +# inertia as a second route, a symmetric mooring that does not turn the body, the output probe, +# snapshot/restore and restart, PtfmInit with the static start, sub-cycling, and the refusals. +add_executable(test_openfast_pinned_body tests/test_openfast_pinned_body.f90) +target_link_libraries(test_openfast_pinned_body PRIVATE cabledyn_core) +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/openfast_pinned_body) +add_test(NAME openfast_pinned_body COMMAND test_openfast_pinned_body + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/openfast_pinned_body) +set_tests_properties(openfast_pinned_body PROPERTIES LABELS "fortran;dynamic;openfast;validation") + # Maintained IEA-15 MW mixed deck: the finite-EI power cable has a genuine multi-node # grounded run and marches through the OpenFAST aggregate at 40 Hz with host current. add_executable(test_openfast_touchdown tests/test_openfast_touchdown.f90) @@ -2860,6 +2871,7 @@ if(CABLEDYN_ENABLE_COVERAGE) test_hermite_fmf test_openfast_aggregate test_openfast_pinned_rod + test_openfast_pinned_body test_of_mooring_counters test_ei0_mesh_scaling_counters test_c_api diff --git a/VALIDATION.md b/VALIDATION.md index c1eb64a6..575dabf8 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -812,6 +812,7 @@ stop with a named error. | Coupled `Rigid6` bodies + `Point3` buoys | Pass verified | 6-DOF `Rigid6` motion with hydrostatic (`C33`/`C44`/`C55`) restoring, checkpoint state (bit-identical `openfast -restart` of a 13.9 MN-swinging tethered body), and SeaState drag / Froude–Krylov / added mass. `Point3` buoys take buoyancy and drag/added-mass/FK; a submerged volume-only buoy takes FK. Tests: `case_coupled_rigid6`/`_mirror`/`_fluid`, `case_coupled_point3_buoy`/`_fluid` | | Coupled rigid rods | Pass verified | host-driven `RodA/B` endpoints, correction rewind, bit-identical 24-scalar-per-rod checkpoint state, and two Gauss fluid nodes per rod with SeaState drag/Froude–Krylov/added mass; `case_coupled_rod`, `_mirror`, and `_fluid` pass, and the OpenFAST module compiles with rod decks enabled | | Coupled pinned rods (`Pinned`, `CoupledPinned`/`VesselPinned`) | Pass verified | `openfast_pinned_rod` on the aggregate: a dry rod (10 m, 500 kg) released at 30° swings with the elliptic-integral compound-pendulum period to 1.6e-4 at `dt = T/100`, End A on the pin to 0 m; a held `CoupledPinned` node reproduces the `Pinned` rod to round-off (1e-12), returns zero moment, and its force equals the analytic pin reaction to 2.0e-13 of `mg`; a pin accelerating at 2 m/s² gives the mean angle `atan(a/g)` to 1e-6 rad and the period of `sqrt(g² + a²)` to 1.6e-4; a harmonic pin motion follows the linear base-excitation solution to 1.5e-3 / 3.7e-4 of the amplitude at `T0/100` / `T0/200` (ratio 4.03); a 0.1 s step sub-cycled 7 times reproduces a run at the sub-step size to 1e-14 rad and 4e-10 N for a drifting pin; a 1 m `Pinned` rod that carries no line (dry and hanging, or buoyant and upright under water) at a 0.6 s step (`omega0 dt` 2.29 / 3.42, beyond the explicit limit 2) sub-cycles it 6 / 9 times from its own swing stiffness `|W d_g - B d_b|`, equals the run at the sub-step size bit for bit, stays within its release angle and keeps the elliptic-integral period to 6.0e-3 / 5.9e-3 (taken whole, the step turns the rod over); a `CoupledPinned` pin crossing the free surface within one step at constant velocity (a 1 kg/m rod lifted from submerged to dry in 0.1 s, `omega dt` 2.13 wet; a 33 kg/m rod lowered from dry to submerged in 0.6 s, 2.29 dry) takes at least 6 sub-steps from its step-start wetting (more from the waterplane near the surface) and ends within 5e-5 / 3e-4 rad of a run at a sixtieth of the step, where the end-of-step wetting alone gives one sub-step and an angle error of 0.20 / 0.69 rad; on a stiff seabed (`kBot` 1e7 N/m³) a `Pinned` rod whose far end rests on the bed (0.1 s step) and a `Free` rod lying on it (0.05 s step) sub-cycle their contact mode (34–36 and 26 sub-steps), stay at rest on the bed over 5 s (angle change 3.8e-3 / 4e-15 rad, the undamped static settlement) and end within 1.9e-6 / 8e-8 of a run at a tenth of the step, where the sub-steps of the lines and swing alone (1 and 4) throw them off the bed (4.2 rad, 0.8 m); an output probe returns `-m (I_c/I_p) a_p` within 1e-10 of `mg` (not `-m a_p`), and its pin force moves by 2e-11 N when the held end acceleration of the attached tethers changes their end load by 8 N; snapshot/restore, probe restore and restart overlay are bit-identical, the restored state's loads before the next step included; a step without the staged rods (the step-start pin carried by the rod) is bit-identical to the staged one; a `Free` or `Coupled` rod with an end without a line is refused by name; with `PtfmInit` the static start leaves 1.4e-8 N·m about the pin. OpenFAST (IEA-15 UMaine, JONSWAP Hs 6 m, 60 s, `dtM = DT = 0.025 s`) with line 1 hung from a 4 m `CoupledPinned` rod at its fairlead: `openfast -restart` at 30 s reproduces every later OpenFAST output row bit for bit (`NumCrctn` 0 and 1), `NumCrctn = 1` equals `NumCrctn = 0` bit for bit, and surge/heave/pitch statistics stay within 0.2 % / 0.4 % / 1.7 % (mean) of the deck with line 1 on a `Coupled` point | +| Coupled pinned bodies (`CoupledPinned`/`VesselPinned`) | Pass verified | `openfast_pinned_body` on the aggregate: a dry compound pendulum (1000 kg, CG 2 m below the node, released at 30°) swings with the elliptic-integral period to 1.6e-4 at `dt = T/100`, its reference point stays on the held node, and the node force equals the analytic pin reaction plus the line force at the node to 4e-16 of m g; under a 2 m/s² node acceleration it swings about -atan(a/g) (-0.201184 rad) with the effective-gravity period to 1.6e-4; a body with the mass, CG and inertia of a `CoupledPinned` rod and the rod's End B line follows the rod under a harmonic surge (axis 1.5e-13, angular velocity 1.3e-12 of 0.21 rad/s, node force 2.2e-12); on four symmetric lines a heaving body does not turn (omega = 0) and its node force is the line sum plus weight, buoyancy and (m + ρ V Ca) a to 5e-16; an output probe returns -m (I_cg/I_p) a_p besides the line's change; snapshot/restore, a restored probe and a restart overlay are bit-identical; `PtfmInit` with the static start balances the moment about the node to 3e-13; a sub-cycled coarse step equals a run at the sub-step size to 1e-11. Against MoorDyn-F's driver (`inertialF 1`, `TmaxIC 0`) with the line at the node: 0.09° over a 120° swing (node force 1e-3) with the node held, 0.15° over 158° with the node surging 0.5 m (the body part of the node force 1.6e-2; the line force of the jerked slack line differs by up to half its value). With the line pulling at a 4 m arm the swings differ by up to 4.7° of 57° early on; both codes are converged in time step and the difference comes from the lines (CableDyn's initial angular acceleration is 6 % larger: its consistent line mass gives the body an end-node inertia of m l/3 of the end element, less with the interior following, against MoorDyn's lumped m l/2) | | Coupled finite-EI touchdown/contact | Pass verified | flat `WtrDpth` and equivalent constant structured bathymetry initialise and step with matching loads; friction and checkpoint restore are tested. The IEA-15 mixed example (its power cable on 248 elements, each at most half the bending length) has 149 grounded nodes and completes a 20 s aggregate trajectory at `dtM=0.025 s` with 2 m surge, 1 m heave, and 0.5 m/s host current, without fallback or stall recovery, at most 12 Newton iterations. A full-turbine run of the same model (one hour after a 200 s transient; TurbSim normal turbulence, 10.6 m/s, 17 % TI; JONSWAP Hs 8 m, Tp 12 s, aligned with the wind and the cable; AeroDyn with the rotor held at 7.55 rpm, no controller, rigid blades and tower; SeaState grid covering the lines) completes without recoveries or non-finite values. The cable's hang-off tension is 11.5 ± 1.1 kN (static 11.9 kN, maximum 17.9 kN). The 149 nodes grounded at the static state stay grounded, joined by one more once the platform has drifted (the touchdown moves 2.5 m toward the platform). The peak curvature is 0.156 1/m at the sag bend, 72 m from the hang-off, and 0.109 1/m at the touchdown. On the former 87-element mesh (10 m elements along the laid section) the peak was 0.160 1/m and the touchdown curvature 0.075 1/m, under-resolved by about 30 %. These curvatures were recorded before the `Curv` channels took the curvature recovered from nodal equilibrium: they are the geometric curvature of the centreline (the larger one-sided trace at a node), which `OutputRecovery element` reproduces. The chain-only twin of the run matches stock MoorDyn over 1200 s to 0.3 % in platform motion and fairlead tension statistics. The anchor tension of the laid cable stays at its static 1.23 kN (maximum 1.24 kN): the seabed friction of the 370 m laid section holds the tension changes at the touchdown. On the former mesh it read 1.39 kN (median) with wave-frequency stick-slip peaks up to 4.1 kN lasting under 1 s, which the resolved mesh does not show, and before the anchor-end correction of this release it locked at about 2.75 kN for the whole run. The run takes 27.1 min of wall time (18.8 min on the former mesh) | | `WaterKin` from file | Pass verified | See [WaterKin and SeaState modes](#waterkin-and-seastate-modes) | | Syrope polyester (`SYROPE:` syntax; [Falkenberg et al., 2017](https://cabledyn.readthedocs.io/en/latest/references.html#ref-falkenberg2017)) | Pass verified | MoorDyn-F/C `BA_s|BA_d` rate and force equations; analytic position/velocity tangents with finite-difference checks; projected, bracketed backward-Euler slow-state update with a strong-unloading boundary test; OWC running maximum; `SYROPE IC` `Tmax0/Tmean0` history with range/order checks; both states carried through every lifecycle stage and the coupled checkpoint. `BA_s` is kept separate from line axial damping (`BA`) and tested against double counting. The line takes the seabed, Morison loads, current, waves, host fluid and VIV of any `EI = 0` line: a taut 88.5 m polyester line in water whose fairlead sways 2 m matches MoorDyn-C v2.7.2 within 10.6 N over a 44.8 kN tension range (1.03 MN mean; t = 0 within 0.5 N), and its range grows 4.8 % without drag and added mass (`syrope_hydro`). Composite lines (a 400 m Syrope polyester section between chains, `syrope_composite`): every polyester element starts on its OWC to 2e-11 across its 1.005–1.012 MN tension range, a still run keeps the fairlead tension to the printed digits (one secant per section moved it by 1.4e-5 within 2 s), the chains keep their `BA` damping, a `SYROPE IC` history puts the section on the `Tmax0` working curve, a line split into two Syrope sections reaches the single section's tensions to 1e-8, and a tension above the OWC table stops with a named error. Finite-EI combinations stop with a named error | diff --git a/doc/capabilities.rst b/doc/capabilities.rst index 37dd07fb..ee587417 100644 --- a/doc/capabilities.rst +++ b/doc/capabilities.rst @@ -196,8 +196,9 @@ alternative discretisation of the line. Supported translations include fixed/cou attachments, free or connecting masses and clumps, ``Point3`` buoys, ``Rigid6`` bodies, and coupled rigid rods. In OpenFAST, ``Coupled``/``Vessel`` bodies and rods are platform-borne 6-DOF nodes that return a force and a moment, ``CoupledPinned``/``VesselPinned`` rods turn about a platform-borne -node that takes the platform position only and returns a force with zero moment, and ``Pinned`` -rods turn about a fixed End A; ``CoupledPinned`` bodies are not supported. The C API and Python +node that takes the platform position only and returns a force with zero moment, as do +``CoupledPinned``/``VesselPinned`` bodies about a node at their reference point, and ``Pinned`` +rods turn about a fixed End A. The C API and Python run free, fixed and pinned rods and free bodies in still water. The coupled body/rod routes carry checkpoint state and SeaState drag, Froude–Krylov, and added mass. ``Rigid6`` also carries the documented hydrostatic restoring terms. Consult :doc:`driver_format` diff --git a/doc/capi.rst b/doc/capi.rst index 872978d8..6b4aa23a 100644 --- a/doc/capi.rst +++ b/doc/capi.rst @@ -930,7 +930,7 @@ The deck is validated under the standalone-deck rules: - Where it is supported * - ``Coupled``/``Vessel`` bodies or rods (6-DOF host nodes) - the OpenFAST module; the standalone driver with a ``motionFile`` - * - ``CoupledPinned``/``VesselPinned`` rods (a pin the host moves) + * - ``CoupledPinned``/``VesselPinned`` rods or bodies (a pin the host moves) - the OpenFAST module * - a ``motionFile`` option - the standalone driver (prescribe motion through ``CableDyn_Step`` instead) diff --git a/doc/coupling.rst b/doc/coupling.rst index f1184768..5ce5b2f1 100644 --- a/doc/coupling.rst +++ b/doc/coupling.rst @@ -30,7 +30,8 @@ integration surface: coupled time-domain analysis at a 0.1 s CableDyn step by de checkpoint-restart, quasi-static linearisation (``dYdu``), FAST.Farm farm-level shared moorings (``Mod_SharedMooring = 5``), coupled ``Rigid6`` 6-DOF rigid bodies (buoyancy, ``C33``/``C44``/``C55`` hydrostatic restoring, restart state, and SeaState drag / Froude-Krylov / -added-mass), coupled ``Point3`` buoys (buoyancy and SeaState drag / Froude-Krylov / added-mass), and +added-mass), including MoorDyn-F's coupled pinned bodies (``CoupledPinned``, force only), coupled +``Point3`` buoys (buoyancy and SeaState drag / Froude-Krylov / added-mass), and coupled rigid rods with host-driven endpoints, correction rewind, checkpoint state, and two-point Gauss SeaState sampling, including MoorDyn-F's coupled pinned rods (``CoupledPinned``, force only) and rods pinned to a fixed point. diff --git a/doc/driver_format.md b/doc/driver_format.md index 93552c5b..b82eddbe 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -438,6 +438,14 @@ row. On this route: and added-mass inertia (MoorDyn-F's coupled body). They may share a deck with `Free` bodies: when the free bodies sub-cycle the coupling step, the host-driven bodies follow the host motion interpolated from the step start; +- `CoupledPinned`/`VesselPinned` bodies are pinned to the platform as `CoupledPinned` rods are: + a mesh node at the body reference point (moved and turned by `PtfmInit` with the body) that + takes the platform position only. The body turns about it with its own three rotations, the + node orientation and angular rates are ignored, and the node returns the body's net load less + its inertia, with no moment (MoorDyn-F's coupled pinned body); the angular acceleration in that + inertia is solved for the node's current acceleration. With `bodyIC static` the body starts + balanced about its node. Outside a coupled host such a body is rejected by name ("requires a + coupled host"); - cables may be suspended or use the same flat/structured seabed contact, normal damping, and stick-slip friction as the standalone Hermite route. @@ -450,7 +458,7 @@ columns, or 18 with the trailing inertias, or the 14 columns of a MoorDyn v2 row | Column | Meaning | |--------|---------| | `ID` | unique body id ≥ 1 (referenced by `Body` points) | -| `Type` | `Point3` (3-DOF translational buoy or clump), `Rigid6` (6-DOF rigid body), or `Coupled`/`Vessel` (a `Rigid6` body whose pose follows the host: the OpenFAST platform, or `motionFile` rows for its `Body` points in the standalone driver) | +| `Type` | `Point3` (3-DOF translational buoy or clump), `Rigid6` (6-DOF rigid body), `Coupled`/`Vessel` (a `Rigid6` body whose pose follows the host: the OpenFAST platform, or `motionFile` rows for its `Body` points in the standalone driver), or `CoupledPinned`/`VesselPinned` (MoorDyn aliases `CpldPin`, `VesPin`: a `Rigid6` body whose reference point follows the OpenFAST platform position while it turns about that point; OpenFAST only) | | `X,Y,Z` | reference position [m] | | `Roll,Pitch,Yaw` | reference orientation [deg] (`Rigid6`; ignored for `Point3`) | | `Mass` | body mass [kg]; > 0 | @@ -458,14 +466,15 @@ columns, or 18 with the trailing inertias, or the 14 columns of a MoorDyn v2 row | `C33` | heave hydrostatic restoring ρ_w·g·A_wp [N/m] | | `C44/55` | roll/pitch restoring [N·m/rad] (`Rigid6`) | | `CdA`, `Ca` | drag area and added-mass coefficient (dynamic); ≥ 0 | -| `Ixx,Iyy,Izz` | trailing diagonal rotational inertias [kg·m²]; required and > 0 for `Rigid6` (≥ 0, like `Mass`, for `Coupled`/`Vessel`) | +| `Ixx,Iyy,Izz` | trailing diagonal rotational inertias [kg·m²]; required and > 0 for `Rigid6` and `CoupledPinned`/`VesselPinned` (≥ 0, like `Mass`, for `Coupled`/`Vessel`) | Every body value must be finite. Both body types require a dynamic deck (`dtM`/`TMax`) in the standalone driver. The MoorDyn v2 row `ID Attachment X0 Y0 Z0 r0 p0 y0 Mass CG* I* Volume CdA* Ca*` defines a -`Rigid6` body with a centre of gravity: `Attachment` is `Free`, or `Coupled`/`Vessel` for a -host-driven body (`CoupledPinned` fails closed); `CG` is `z` or `x|y|z` in +`Rigid6` body with a centre of gravity: `Attachment` is `Free`, `Coupled`/`Vessel` for a +host-driven body, or `CoupledPinned`/`VesselPinned` for a body pinned to a host node; `CG` is `z` +or `x|y|z` in the body frame from the reference point (it is also the centre of buoyancy, as in MoorDyn); `I` is one value or `Ixx|Iyy|Izz` about the CG; `CdA` is one value, `CdA|CdA_rot`, or 3 or 6 entries, and `Ca` one value or 3 entries. The body model is isotropic, so direction-dependent diff --git a/doc/migrating.rst b/doc/migrating.rst index 39010cfa..2772a9c6 100644 --- a/doc/migrating.rst +++ b/doc/migrating.rst @@ -115,9 +115,9 @@ Keyword map ``Body`` points and at rod ends (``RA``/``RB`` in ``LINES``, or ``RodA``/``RodB`` points) (:doc:`tutorial_bodies`); ``ROD TYPES`` ``Cd Ca CdEnd CaEnd`` as in MoorDyn, with optional axial side ``CdAx CaAx`` columns. - ``CoupledPinned``/``VesselPinned`` rods run in OpenFAST as in MoorDyn-F (End A follows - the platform position, the rod turns about it, a force is returned without moment); - ``CoupledPinned`` bodies are rejected + ``CoupledPinned``/``VesselPinned`` rods and bodies run in OpenFAST as in MoorDyn-F (End A + or the body reference point follows the platform position, the object turns about it, a + force is returned without moment) * - ``dtM``, ``TMax`` (standalone), ``WtrDpth``, ``rhoW``/``WtrDnsty``, ``g`` - same * - ``kBot``, ``cBot``, seabed friction coefficient diff --git a/doc/openfast.rst b/doc/openfast.rst index 767dd668..4a85a509 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -394,8 +394,9 @@ without an auxiliary process: CONTROL. * **Rigid6 bodies, Point3 bodies, and rigid rods** are translated at the deck boundary; their supported loads and restrictions in coupled runs are listed in :doc:`capabilities`. Free - Rigid6 bodies, free rods and pinned rods start at their static equilibrium with the platform - at ``PtfmInit`` (``bodyIC static``, the default), as in standalone runs; one that carries no + Rigid6 bodies, free and pinned rods and pinned bodies start at their static equilibrium with + the platform at ``PtfmInit`` (``bodyIC static``, the default), as in standalone runs; one that + carries no line is not part of that solve and starts at rest in its deck pose. ``Coupled``/``Vessel`` rods are platform-borne: each is a node of the coupling mesh at its End A that follows the platform position and orientation and returns a force and a moment (MoorDyn-F's coupled rod, @@ -410,7 +411,14 @@ without an auxiliary process: the platform before the static solve balances it about its pin. ``Pinned`` rods turn about a fixed End A. ``Coupled``/``Vessel`` bodies are platform-borne the same way as ``Coupled`` rods, with the node at the body reference point, and may share a deck with ``Free`` bodies. - ``CoupledPinned`` bodies are not supported on this route. + ``CoupledPinned``/``VesselPinned`` bodies are pinned to the platform like ``CoupledPinned`` rods: + the node at the body reference point follows the platform position only, the body turns about + it with its own three rotations (its inertia about the node, its weight and buoyancy at the + centre of gravity, the node acceleration and the moments of its lines; MoorDyn-F's coupled pinned + body), and the node returns the body's net load less its inertia, with zero moment, the angular + acceleration again solved for the node's current acceleration. ``PtfmInit`` moves and turns such + a body with the platform before the static solve balances it about its node. Its inertias + ``Ixx``/``Iyy``/``Izz`` must be positive. Linearisation fails closed on decks with bodies. Each is a separate qualification: a successful ordinary run does not qualify restart, linearisation, control, failure, or farm behaviour for a new model. diff --git a/doc/options.rst b/doc/options.rst index 5c304764..64dd1293 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -802,9 +802,9 @@ These names exist so a migrated MoorDyn deck fails less often at the syntax boun ``frictionMu``, ``frictionMuLateral`` and ``frictionMuAxial``, with no static-to-kinetic ratio or friction damping. Remove the row. -Other MoorDyn constructs that fail by name rather than as unknown input: ``CoupledPinned`` bodies, -and ``CoupledPinned``/``VesselPinned`` rods outside a coupled host (they run in OpenFAST, see -:doc:`openfast`). Line-node output channels start at node 1 (``N0`` is rejected; MoorDyn numbers from 0, see +Other MoorDyn constructs that fail by name rather than as unknown input: +``CoupledPinned``/``VesselPinned`` rods and bodies outside a coupled host (they run in OpenFAST, +see :doc:`openfast`). Line-node output channels start at node 1 (``N0`` is rejected; MoorDyn numbers from 0, see :ref:`node numbering `), and a number with a sign inside its mantissa (such as ``1+2``) is rejected instead of being read up to the sign. diff --git a/doc/theory.rst b/doc/theory.rst index faecf21e..013b9e4a 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -2303,7 +2303,15 @@ body's position and a rotation-vector increment on SO(3) (for a free rod only th normal to its axis), each pinned rod's two rotations about its pin, and each point's position. A pinned rod's residual rows are its moment about the pin; its net force acts on its parent body at the pin (a rod pinned to a fixed point has none, and a ``CoupledPinned`` rod in OpenFAST is -balanced about its pin at the platform's initial pose). A free or pinned rod that no line +balanced about its pin at the platform's initial pose). A ``CoupledPinned`` body in OpenFAST +keeps its position unknowns held at its node (their force rows carry the host's reaction, not a +residual) and balances the moment about the node with its three rotations. Its lines and its +centre of gravity may lie on one axis through the node, about which it then turns neutrally: the +Jacobian has that spin as a null vector, to which the residual is orthogonal, and the Newton +step of a deck with such a body is the minimum-norm Gauss-Newton step +:math:`(\mathbf{J}^T\mathbf{J} + 10^{-10}\mathbf{D})\,\delta\mathbf{x} = -\mathbf{J}^T\mathbf{r}` +(:math:`\mathbf{D}` the floored diagonal of :math:`\mathbf{J}^T\mathbf{J}`), which does not spin it. +A free or pinned rod that no line attaches to (nor, for a rod pinned to a body, any line of its body) is not an unknown: it keeps its deck pose and starts at rest there. A deck with pinned rods takes the central-difference Jacobian of the full residual. A finite-EI line enters with its axial @@ -2542,6 +2550,27 @@ the same pin acceleration term in its rotation equation and returns the same for call evaluates the rod's state derivative at the current input first (its lumped line mass has no interior coupling). +A ``CoupledPinned`` body is pinned the same way at its reference point, which is its node: its +translation is the host's, :math:`\mathbf{a} = \mathbf{a}_p`, and its rotation solves the moment +equation about the node, +:math:`\mathbf{M}_{rr}\boldsymbol{\alpha} = \mathbf{M} - \mathbf{M}_{rt}\mathbf{a}_p - \boldsymbol{\omega}\times(\mathbf{I}_p\boldsymbol{\omega})`, +with :math:`\mathbf{I}_p = \mathbf{R}\mathbf{J}\mathbf{R}^T - m[\mathbf{c}]_\times^2` the inertia +about the node for the centre of gravity at :math:`\mathbf{c}`, +:math:`\mathbf{M}_{rr} = \mathbf{I}_p` plus the attached lines' end-node inertia through their +arms, and :math:`\mathbf{M}_{rt} = m[\mathbf{c}]_\times` (MoorDyn-F's +:math:`\mathbf{M}_{(4:6,4:6)}\mathbf{a}_{(4:6)} = \mathbf{F}_{(4:6)} - \mathbf{M}_{(4:6,1:3)}\mathbf{a}_{(1:3)}`). +The node receives +:math:`\mathbf{F} - (m + m_a)\mathbf{a}_p - m(\boldsymbol{\alpha}\times\mathbf{c} + \boldsymbol{\omega}\times(\boldsymbol{\omega}\times\mathbf{c}))` +and no moment, :math:`m_a` the body's translational added mass, with the angular acceleration +solved again for the current node acceleration as for the rod (MoorDyn-F with ``inertialF 1``; +its default ``inertialF 0`` leaves the inertia out of the coupled force). The sub-step estimate +takes the diagonal of :math:`\mathbf{I}_p` against the line springs through their arms from the +node, the waterplane restoring, and the swing stiffness of the weight and buoyancy turning with +the body, :math:`|\mathbf{K}_{kk}|` of :math:`\mathbf{K} = -\sum_i[\mathbf{f}_i]_\times[\mathbf{p}_i]_\times` +at the step-start and end-of-step node poses, plus :math:`|\mathbf{a}_p|\,m|\mathbf{c}|`; the +node moves linearly within the sub-steps from the committed reference-point motion, and that +motion, which the body state mirror carries, starts the next step. + **Mixed topologies.** One step marches every object of a deck together: bodies with their fixed and pinned rods, free and pinned rods, the ``EI = 0`` lines with their ``Free``/``Connect`` points, and the finite-EI cables. In the monolithic scheme the points are junctions of the diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 7ec699f9..2fedcb3a 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -337,6 +337,15 @@ _PINNED_END_CONNECTIONS = frozenset({"pinned", "free", "zero"}) # Host-driven (platform-borne) BODIES types, MoorDyn aliases included (native append_body) _HOST_BODY_TYPES = frozenset({"coupled", "vessel", "cpld", "ves"}) +# Bodies pinned to a host node (MoorDyn CoupledPinned/VesselPinned): coupled hosts only +_PINNED_BODY_TYPES = frozenset({"coupledpinned", "cpldpin", "vesselpinned", "vespin"}) +_PINNED_BODY_HOST_MESSAGE = ( + "CoupledPinned/VesselPinned BODY requires a coupled host (OpenFAST CompMooring = 5); in a " + "standalone deck use a Free body, or a Coupled body with a motionFile" +) +_PINNED_BODY_VALUE_MESSAGE = ( + "CoupledPinned/VesselPinned BODY requires Ixx/Iyy/Izz > 0 and non-negative Mass/Vol/CdA/Ca" +) # MoorDyn RODS attachment aliases (native append_rod) _ROD_ATTACHMENT_ALIASES = { @@ -1858,12 +1867,14 @@ def _check_moordyn_body_row( ) -> None: """Validate a 14-column MoorDyn BODIES row as the native reader does.""" attachment = row.tokens[1].lower() - if attachment not in {"free", *_HOST_BODY_TYPES}: + if attachment not in {"free", *_HOST_BODY_TYPES, *_PINNED_BODY_TYPES}: raise DeckFormatError( f"{self._at(row)}: BODIES attachment {row.tokens[1]!r} is not supported in the " - "14-column MoorDyn row (Free, Coupled, or Vessel bodies)" + "14-column MoorDyn row (Free, Coupled, Vessel, CoupledPinned or VesselPinned " + "bodies)" ) host = attachment in _HOST_BODY_TYPES + pinned = attachment in _PINNED_BODY_TYPES if host and not (has_motion_file or self.caller_driven): raise DeckFormatError( f"{self._at(row)}: Coupled/Vessel BODY requires a motionFile (or a coupled host)" @@ -1897,6 +1908,14 @@ def _check_moordyn_body_row( coordinates + lists["CG"], [mass, volume, cda[0], *lists["I"]], ca[0] ): raise DeckFormatError(f"{self._at(row)}: {_BODY_RANGE_MESSAGE}") + if pinned: + # native finalize_checks: only a coupled host moves the reference point; the + # rotation is integrated + if not self.caller_driven: + raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_HOST_MESSAGE}") + if min(mass, volume, cda[0], ca[0]) < 0.0 or any(v <= 0.0 for v in lists["I"]): + raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_VALUE_MESSAGE}") + return if host: # a platform-borne body may be a massless attachment frame if min(mass, volume, cda[0], ca[0], *lists["I"]) < 0.0: @@ -3307,10 +3326,25 @@ def end_key(token: str) -> str: if len(row.tokens) not in {15, 18}: raise DeckFormatError(f"{self._at(row)}: BODIES row needs 14, 15 or 18 fields") body_type = row.tokens[1].lower() - if body_type in {"coupledpinned", "cpldpin"}: - raise DeckFormatError( - f"{self._at(row)}: CoupledPinned BODY is not supported (use Coupled or Free)" - ) + if body_type in _PINNED_BODY_TYPES: + # native finalize_checks: the host moves the reference point of a CoupledPinned + # body, so only a coupled host runs it; its rotation is integrated + values = [ + numeric(row.tokens[index], row, f"BODIES column {index + 1}") + for index in range(2, len(row.tokens)) + ] + if _body_outside_admissible_range( + values[:6], values[6:12] + values[13:], values[12] + ): + raise DeckFormatError(f"{self._at(row)}: {_BODY_RANGE_MESSAGE}") + if not self.caller_driven: + raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_HOST_MESSAGE}") + inertia = values[13:16] if len(values) >= 16 else [0.0, 0.0, 0.0] + if min(values[6], values[7], values[11], values[12]) < 0.0 or any( + value <= 0.0 for value in inertia + ): + raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_VALUE_MESSAGE}") + continue if body_type in _HOST_BODY_TYPES: if not (has_motion_file or self.caller_driven): raise DeckFormatError( @@ -3356,7 +3390,8 @@ def end_key(token: str) -> str: body_types = { str(_native_int(row.tokens[0])): ( "rigid6" - if len(row.tokens) == 14 or row.tokens[1].lower() in _HOST_BODY_TYPES + if len(row.tokens) == 14 + or row.tokens[1].lower() in _HOST_BODY_TYPES | _PINNED_BODY_TYPES else row.tokens[1].lower() ) for row in bodies diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 37f0bec3..166790e9 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -1535,13 +1535,40 @@ def test_coupled_rods_and_bodies_need_a_motion_file_or_a_coupled_host(tmp_path): for row, message in ( ("1 Coupled 0 0 0 0 0 0 -1 0 0 0 0 0 0\n", "requires non-negative"), ("1 Coupled 0 0 -20 0 0 0 -1 0 0 0 0 0\n", "requires non-negative"), - ("1 CoupledPinned 0 0 0 0 0 0 0 0 0 0 0 0 0\n", "CoupledPinned BODY is not supported"), ): path.write_text(source.replace(marker, bodies + row + marker), encoding="utf-8") with pytest.raises(DeckFormatError, match=message): DeckFile.read(path, caller_driven=True) +@pytest.mark.parametrize("kind", ["CoupledPinned", "CpldPin", "VesselPinned", "VesPin"]) +def test_coupled_pinned_bodies_need_a_coupled_host_and_inertia(tmp_path, kind): + # native finalize_checks: the host moves the reference point of a CoupledPinned body and + # its rotation is integrated, so the standalone driver refuses it and the coupled route + # takes it with positive inertias (18- and 14-column rows) + source = (ROOT / "examples/chain_catenary_r3_100m.dat").read_text(encoding="utf-8") + marker = "--------------------- POINTS -------------------------------------------" + bodies = "--------------------- BODIES -------------------------------------------\n" + path = tmp_path / "pinned.dat" + for row in ( + f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0 1 1 1\n", + f"1 {kind} 0 0 -20 0 0 0 10 0|0|-1 1|2|3 0 0 0\n", + ): + path.write_text(source.replace(marker, bodies + row + marker), encoding="utf-8") + with pytest.raises(DeckFormatError, match="requires a coupled host"): + DeckFile.read(path) + DeckFile.read(path, caller_driven=True) + for row in ( + f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0\n", + f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0 1 0 1\n", + f"1 {kind} 0 0 -20 0 0 0 -1 0 0 0 0 0 0 1 1 1\n", + f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0\n", + ): + path.write_text(source.replace(marker, bodies + row + marker), encoding="utf-8") + with pytest.raises(DeckFormatError, match=r"requires Ixx/Iyy/Izz > 0"): + DeckFile.read(path, caller_driven=True) + + @pytest.mark.parametrize( "rod_row, message", [ @@ -3354,7 +3381,7 @@ def test_moordyn_body_rows_are_accepted(row): @pytest.mark.parametrize( ("row", "message"), [ - (_MD_BODY.replace("Free", "Fixed"), "Free, Coupled, or Vessel bodies"), + (_MD_BODY.replace("Free", "Fixed"), "Free, Coupled, Vessel, CoupledPinned or VesselPinned"), (_MD_BODY.replace("Free", "Coupled"), "Coupled/Vessel BODY requires a motionFile"), (_MD_BODY.replace("0|0|-0.5", "0|-0.5"), "BODIES CG has 2 entries"), (_MD_BODY.replace("8|0", "8|1"), "isotropic without rotational drag"), diff --git a/python/tests/test_native_model.py b/python/tests/test_native_model.py index a742d41d..bcc67fb4 100644 --- a/python/tests/test_native_model.py +++ b/python/tests/test_native_model.py @@ -7,6 +7,7 @@ from __future__ import annotations import ctypes +import gc import importlib.util import os import sys @@ -58,6 +59,9 @@ def test_array_shapes_are_validated_before_the_library(): def test_failed_initialization_in_the_constructor_releases_the_handle(monkeypatch): + # finalise the instances earlier tests left for the collector first, so that only the + # failed constructor's close is recorded + gc.collect() closed: list[bool] = [] original = model_module.CableDyn.close diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 6ca7bfce..b329a83a 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -455,6 +455,9 @@ MODULE CableDyn_DeckDriver ! Coupled/Vessel body (MoorDyn "Coupled"): a Rigid6 body whose pose follows the host (the ! coupled platform, or motionFile rows standalone) instead of being integrated. LOGICAL :: host_coupled = .FALSE. + ! CoupledPinned/VesselPinned body (MoorDyn "CoupledPinned"): a Rigid6 body whose reference + ! point follows a host node (the coupled aggregate only) while its rotation is integrated. + LOGICAL :: host_pinned = .FALSE. END TYPE TYPE :: DeckRodType @@ -870,6 +873,14 @@ MODULE CableDyn_DeckDriver INTEGER :: body_index = 0 ! Host-driven (Coupled/Vessel) body: its state is imposed, never integrated. LOGICAL :: is_prescribed = .FALSE. + ! CoupledPinned/VesselPinned body (coupled aggregate): the reference point is pinned to a host + ! node. The host prescribes its translation (pin, pin_v, pin_a), which r, v and a always + ! equal (body_snap_pinned), and the body's rotation about it stays its own degree of freedom + ! (MoorDyn-F's coupled pinned body). pin0, pin0_v and pin0_a are the committed translation at + ! the start of the coming step (set_body_pin_start; see RodState%pin0). + LOGICAL :: is_host_pinned = .FALSE. + REAL(wp) :: pin(3) = CD_ZERO, pin_v(3) = CD_ZERO, pin_a(3) = CD_ZERO + REAL(wp) :: pin0(3) = CD_ZERO, pin0_v(3) = CD_ZERO, pin0_a(3) = CD_ZERO INTEGER, ALLOCATABLE :: point_indices(:) REAL(wp) :: r_ref(3) = CD_ZERO REAL(wp) :: rot_ref(3, 3) = CD_ZERO @@ -7408,7 +7419,7 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi n_rod = SIZE(rods) n_host_rod = COUNT(rods%rod_type == 'coupled' .OR. rods%rod_type == 'vessel' .OR. & rods%rod_type == 'coupledpinned') - n_host_body = COUNT(bodies%host_coupled) + n_host_body = COUNT(bodies%host_coupled .OR. bodies%host_pinned) IF (opts%has_motion_file) THEN CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_Aggregate: the coupled boundary is driven by the host, '// & 'not a deck motionFile; remove the motionFile OPTION'); RETURN @@ -7480,13 +7491,14 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_Aggregate: line FAILURE on a coupled Rigid6 deck is not '// & 'supported (the failure trigger is not evaluated against the post-body-march state)'); RETURN END IF - ! Coupled/Vessel bodies become 6-DOF host nodes. They may share a deck with Free bodies: when - ! the free-body march sub-cycles, the host-driven bodies follow the host path interpolated - ! from the step start (interp_host_rigid). The linearization probe places translational - ! moving points only. + ! Coupled/Vessel bodies become 6-DOF host nodes, CoupledPinned ones translational host nodes + ! with a rotation of their own. They may share a deck with Free bodies: when the body march + ! sub-cycles, the host-driven bodies follow the host path interpolated from the step start + ! (interp_host_rigid, interp_host_body_pins). The linearization probe places translational + ! moving points only and holds every body, so it carries neither. IF (n_host_body > 0 .AND. PRESENT(coupled_positions)) THEN CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_Aggregate: coupled_positions (the linearization probe) '// & - 'does not support Coupled/Vessel BODIES'); RETURN + 'does not support Coupled/Vessel or CoupledPinned BODIES'); RETURN END IF END IF @@ -13916,8 +13928,9 @@ SUBROUTINE append_body(line, bodies, nb, ErrStat, ErrMsg) CASE ('coupled', 'vessel', 'cpld', 'ves') b%btype = 'rigid6' b%host_coupled = .TRUE. - CASE ('coupledpinned', 'cpldpin') - CALL fail(ErrStat, ErrMsg, 'CoupledPinned BODY is not supported (use Coupled or Free)'); RETURN + CASE ('coupledpinned', 'cpldpin', 'vesselpinned', 'vespin') + b%btype = 'rigid6' + b%host_pinned = .TRUE. END SELECT CALL grow_bodies(bodies, nb) nb = nb + 1 @@ -13928,8 +13941,9 @@ SUBROUTINE parse_moordyn_body_row(line, b, ErrStat, ErrMsg) !! MoorDyn v2 BODIES row: ID Attachment X0 Y0 Z0 r0 p0 y0 Mass CG* I* Volume CdA* Ca*, with !! bar lists CG = z | x|y|z, I = I (all axes) | Ixx|Iyy|Izz about the CG, CdA = CdA | CdA|CdA_rot !! (or 3/6 entries) and Ca = Ca | Cax|Cay|Caz. A Free body becomes a Rigid6 body with its CG - !! (also the centre of buoyancy, as in MoorDyn). The body model is isotropic: 3-entry CdA/Ca - !! lists must be equal, and rotational drag and other attachments fail closed by name. + !! (also the centre of buoyancy, as in MoorDyn); Coupled/Vessel and CoupledPinned/VesselPinned + !! bodies are host-driven. The body model is isotropic: 3-entry CdA/Ca lists must be equal, and + !! rotational drag and other attachments fail closed by name. CHARACTER(*), INTENT(IN) :: line TYPE(DeckBody), INTENT(OUT) :: b INTEGER, INTENT(OUT) :: ErrStat @@ -13954,9 +13968,12 @@ SUBROUTINE parse_moordyn_body_row(line, b, ErrStat, ErrMsg) CASE ('coupled', 'vessel', 'cpld', 'ves') b%btype = 'rigid6' b%host_coupled = .TRUE. + CASE ('coupledpinned', 'cpldpin', 'vesselpinned', 'vespin') + b%btype = 'rigid6' + b%host_pinned = .TRUE. CASE DEFAULT CALL fail(ErrStat, ErrMsg, 'BODIES attachment "'//TRIM(tok(2))//'" is not supported in the '// & - '14-column MoorDyn row (Free, Coupled, or Vessel bodies)'); RETURN + '14-column MoorDyn row (Free, Coupled, Vessel, CoupledPinned or VesselPinned bodies)'); RETURN END SELECT READ (line, *, IOSTAT=ios) tok(1), tok(2), b%pos(1), b%pos(2), b%pos(3), b%rot(1), b%rot(2), b%rot(3), b%mass IF (ios == 0) THEN @@ -16912,6 +16929,22 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio IF (.NOT. opts%has_dtm .AND. .NOT. caller_driven) THEN CALL fail(ErrStat, ErrMsg, 'Rigid6 BODY requires a dynamic deck with dtM and TMax'); RETURN END IF + IF (bodies(i)%host_pinned) THEN + ! The host moves the reference point of a CoupledPinned body and takes its force; a + ! motionFile cannot stand in for it (its Body rows prescribe the whole pose), so the + ! body needs the coupled aggregate. Its rotation is integrated: Ixx/Iyy/Izz > 0. + IF (.NOT. opts%host_coupled_objects) THEN + CALL fail(ErrStat, ErrMsg, 'CoupledPinned/VesselPinned BODY requires a coupled host (OpenFAST '// & + 'CompMooring = 5); in a standalone deck use a Free body, or a Coupled body with a '// & + 'motionFile'); RETURN + END IF + IF (bodies(i)%mass < CD_ZERO .OR. bodies(i)%vol < CD_ZERO .OR. bodies(i)%cda < CD_ZERO .OR. & + bodies(i)%ca < CD_ZERO .OR. ANY(bodies(i)%inertia <= CD_ZERO)) THEN + CALL fail(ErrStat, ErrMsg, 'CoupledPinned/VesselPinned BODY requires Ixx/Iyy/Izz > 0 and '// & + 'non-negative Mass/Vol/CdA/Ca'); RETURN + END IF + CYCLE + END IF IF (bodies(i)%host_coupled) THEN IF (.NOT. (opts%has_motion_file .OR. opts%host_coupled_objects)) THEN CALL fail(ErrStat, ErrMsg, 'Coupled/Vessel BODY requires a motionFile (or a coupled host)'); RETURN @@ -19484,11 +19517,12 @@ SUBROUTINE rigid_coupled_acceleration(dload_da, dt, a_points, bases, arms, mass_ REAL(wp), INTENT(OUT) :: acc(3), alpha(3) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - ! pin_arm: the reference point turns about a pin at -pin_arm from it (a pinned rod): with + ! pin_arm: the reference point turns about a pin at -pin_arm from it (a pinned rod; zero for + ! a CoupledPinned body, which turns about its reference point): with ! x = T y + b, T = [-[r]x; I], b = [a_p + w x (w x r); 0], the rotational acceleration y ! solves T^T m6 T y = T^T (rhs - m6 b). a_p is pin_acc, the pin acceleration (zero when - ! absent: a fixed pin); a moving pin (a CoupledPinned rod) thus loads the rotation with the - ! inertia of its acceleration. + ! absent: a fixed pin); a moving pin (a CoupledPinned rod or body) thus loads the rotation with + ! the inertia of its acceleration. REAL(wp), INTENT(IN), OPTIONAL :: pin_arm(3), pin_acc(3) ! m6_out/rhs_out: return the assembled system m6 x = rhs instead of solving it (the pinned- ! child group solve of mb_group_solve); acc and alpha are then zero @@ -19566,7 +19600,7 @@ SUBROUTINE rigid_coupled_acceleration(dload_da, dt, a_points, bases, arms, mass_ CALL solve_sym3(MATMUL(TRANSPOSE(t63), MATMUL(m6, t63)), MATMUL(TRANSPOSE(t63), rhs - MATMUL(m6, b6)), y, ok) IF (.NOT. ok) THEN ErrStat = CD_DECKDRV_SOLVEFAIL - ErrMsg = 'CableDyn_DeckDriver: pinned rod rotational inertia is singular' + ErrMsg = 'CableDyn_DeckDriver: pinned rod or body rotational inertia is singular' RETURN END IF alpha = y @@ -23263,18 +23297,117 @@ END SUBROUTINE step_rod_system SUBROUTINE save_host_end_rigid(rigid, hk) !! Record the t + dt kinematics of the host-driven bodies (columns: r, v, a, omega, alpha, - !! rot_mat) before sub-stepping moves them along the interpolated host path. + !! rot_mat; rows 25 to 33 the pin, pin velocity and pin acceleration of a host-pinned body) + !! before sub-stepping moves them along the interpolated host path. TYPE(RigidBodyState), INTENT(IN) :: rigid(:) REAL(wp), ALLOCATABLE, INTENT(INOUT) :: hk(:, :) INTEGER :: ib IF (ALLOCATED(hk)) DEALLOCATE (hk) - ALLOCATE (hk(24, SIZE(rigid))) + ALLOCATE (hk(33, SIZE(rigid))) DO ib = 1, SIZE(rigid) hk(:, ib) = [rigid(ib)%r, rigid(ib)%v, rigid(ib)%a, rigid(ib)%omega, rigid(ib)%alpha, & - RESHAPE(rigid(ib)%rot_mat, [9])] + RESHAPE(rigid(ib)%rot_mat, [9]), rigid(ib)%pin, rigid(ib)%pin_v, rigid(ib)%pin_a] END DO END SUBROUTINE save_host_end_rigid + SUBROUTINE interp_host_body_pins(rigid, hk, s) + !! Place the node of every host-pinned body at fraction s of its step and move the body's + !! reference point with it (body_snap_pinned); the body keeps its own rotation. Position, + !! velocity and acceleration are each linear between the step-start pin (pin0, the committed + !! reference-point motion) and the t + dt host values in hk (rows 25 to 33), as for the pins + !! of host-pinned rods (interp_host_pins); s = 1 restores the t + dt pin. + TYPE(RigidBodyState), INTENT(INOUT) :: rigid(:) + REAL(wp), INTENT(IN) :: hk(:, :), s + INTEGER :: ib + DO ib = 1, SIZE(rigid) + IF (.NOT. rigid(ib)%is_host_pinned) CYCLE + IF (s >= CD_ONE) THEN + rigid(ib)%pin = hk(25:27, ib) + rigid(ib)%pin_v = hk(28:30, ib) + rigid(ib)%pin_a = hk(31:33, ib) + ELSE + rigid(ib)%pin = rigid(ib)%pin0 + s*(hk(25:27, ib) - rigid(ib)%pin0) + rigid(ib)%pin_v = rigid(ib)%pin0_v + s*(hk(28:30, ib) - rigid(ib)%pin0_v) + rigid(ib)%pin_a = rigid(ib)%pin0_a + s*(hk(31:33, ib) - rigid(ib)%pin0_a) + END IF + CALL body_snap_pinned(rigid(ib)) + END DO + END SUBROUTINE interp_host_body_pins + + SUBROUTINE body_snap_pinned(body) + !! A host-pinned body keeps its reference point on the host node: its position, velocity and + !! acceleration are the node's (pin, pin_v, pin_a). Every other body is left unchanged. + TYPE(RigidBodyState), INTENT(INOUT) :: body + IF (.NOT. body%is_host_pinned) RETURN + body%r = body%pin + body%v = body%pin_v + body%a = body%pin_a + END SUBROUTINE body_snap_pinned + + SUBROUTINE set_body_pin_start(body) + !! Record the committed reference-point motion of a host-pinned body as the pin kinematics its + !! next step starts from (RigidBodyState%pin0). The checkpoint mirror carries it (r, v, a), + !! so a restored run takes the same values bit for bit. + TYPE(RigidBodyState), INTENT(INOUT) :: body + body%pin0 = body%r + body%pin0_v = body%v + body%pin0_a = body%a + END SUBROUTINE set_body_pin_start + + SUBROUTINE pinned_body_estimate_terms(body, opts, time, mass6, k6, ErrStat, ErrMsg) + !! The sub-step estimate terms of a host-pinned body (step_rigid6_system), whose rotation is + !! its only degree of freedom: mass6(1:3) = 0 (the host prescribes the translation) and + !! mass6(4:6) the diagonal of its rotational inertia about the pin (its reference point), + !! I_p = R J R^T - m [c]x [c]x for the CG at c = R cg; k6(4:6) the diagonal of its swing + !! stiffness about the pin. Vertical loads f_i at p_i from the pin that turn with the body + !! have the rotational stiffness K = -sum_i [f_i]x [p_i]x: the weight -m g e3 at c and the + !! buoyancy rhoW g phi V e3 at the centre of buoyancy (|K_kk| taken, so an upright buoyant + !! body counts too). The pin acceleration a_p loads the body with -m a_p at c, a stiffness + !! of at most |a_p| m |c|, |a_p| the larger of the step-start and end-of-step host values. + !! The buoyancy is taken at the larger of the body at its step-start pin and at the t + dt + !! pin the host has placed (a straight pin path crosses the surface monotonically; see + !! pinned_swing_omega2). The waterplane restoring C44/C55 is added as for a free body. + TYPE(RigidBodyState), INTENT(INOUT) :: body + TYPE(DeckOptions), INTENT(IN) :: opts + REAL(wp), INTENT(IN) :: time + REAL(wp), INTENT(OUT) :: mass6(6), k6(6) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: c(3), cb(3), ip(3, 3), kg(3, 3), kd(3), phi, a_pin, r_end(3) + INTEGER :: k, pose + + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + c = MATMUL(body%rot_mat, body%cg) + cb = MATMUL(body%rot_mat, body%cb) + ip = CD_ZERO + DO k = 1, 3 + ip(k, k) = body%inertia(k) + END DO + ip = MATMUL(body%rot_mat, MATMUL(ip, TRANSPOSE(body%rot_mat))) - body%mass*MATMUL(skew3(c), skew3(c)) + mass6(1:3) = CD_ZERO + DO k = 1, 3 + mass6(3 + k) = ip(k, k) + END DO + k6 = [CD_ZERO, CD_ZERO, CD_ZERO, body%c44, body%c55, CD_ZERO] + kd = CD_ZERO + r_end = body%r + DO pose = 1, 2 + ! pose 1: the body at its step-start pin (the state is put back exactly after it) + IF (pose == 1) body%r = body%pin0 + CALL rigid6_wet_fraction(body, opts, time, phi, ErrStat, ErrMsg) + body%r = r_end + IF (ErrStat /= CD_DECKDRV_OK) RETURN + kg = -MATMUL(skew3([CD_ZERO, CD_ZERO, -body%mass*opts%g]), skew3(c)) - & + MATMUL(skew3([CD_ZERO, CD_ZERO, opts%rhoW*phi*body%vol*opts%g]), skew3(cb)) + DO k = 1, 3 + kd(k) = MAX(kd(k), ABS(kg(k, k))) + END DO + END DO + a_pin = MAX(NORM2(body%pin_a), NORM2(body%pin0_a)) + k6(4:6) = k6(4:6) + kd + a_pin*body%mass*NORM2(c) + END SUBROUTINE pinned_body_estimate_terms + SUBROUTINE interp_host_rigid(rigid, start, hk, s) !! Place every host-driven body at fraction s of its step: position, velocity, acceleration !! and angular rates linear between the staged step start and the t + dt values in hk, the @@ -24653,7 +24786,9 @@ SUBROUTINE init_rigid6_states(bodies, points, rigid, ErrStat, ErrMsg, rod_types, rigid(ir)%body_id = bodies(i)%id rigid(ir)%body_index = i rigid(ir)%is_prescribed = bodies(i)%host_coupled - ! a host-driven body starts at rest in the host's Init pose; its a/alpha are the host's + rigid(ir)%is_host_pinned = bodies(i)%host_pinned + ! a host-driven body starts at rest in the host's Init pose; its a/alpha are the host's (a + ! host-pinned body solves its own at the first step, like a free body) rigid(ir)%accel_valid = bodies(i)%host_coupled rigid(ir)%r_ref = bodies(i)%pos rigid(ir)%r = bodies(i)%pos @@ -24678,6 +24813,11 @@ SUBROUTINE init_rigid6_states(bodies, points, rigid, ErrStat, ErrMsg, rod_types, rigid(ir)%ext_f = bodies(i)%ext_f rigid(ir)%ext_blin = bodies(i)%ext_blin rigid(ir)%ext_bquad = bodies(i)%ext_bquad + ! a host-pinned body starts its first step from its pin at rest in its start pose + IF (rigid(ir)%is_host_pinned) THEN + rigid(ir)%pin = rigid(ir)%r + CALL set_body_pin_start(rigid(ir)) + END IF CALL collect_body_point_indices(points, bodies(i)%id, rigid(ir)%point_indices) no_pts = .FALSE. IF (PRESENT(allow_no_points)) no_pts = allow_no_points @@ -24804,7 +24944,8 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l ErrMsg, bathymetry, points_only, jac_check_err, ext_pt, ext_fm, & end_force_a, quiet, skipped, ext_km, ext_rot) !! Static equilibrium of the free objects of a deck: free Rigid6 bodies (six DOFs: position - !! and a rotation-vector increment on SO(3)), free rods (position and the two rotations + !! and a rotation-vector increment on SO(3); a CoupledPinned body holds its position at its + !! host node and balances its moment about it), free rods (position and the two rotations !! normal to the axis; the rod is symmetric about it) and, jointly with them, the !! Free/Connect points. With points_only the bodies and rods are held and only the points !! move (the point initial condition, solve_point_equilibrium); otherwise the bodies and rods @@ -24899,9 +25040,9 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l INTEGER :: ibp REAL(wp), ALLOCATABLE :: lsc(:), base_r(:, :), base_rot(:, :, :), e1(:, :), e2(:, :) REAL(wp), ALLOCATABLE :: x(:), r(:), r_try(:), x_try(:), jac(:, :), a(:, :), g(:), dx(:), dxn(:) - REAL(wp), ALLOCATABLE :: dxc(:), jtry(:, :), rmask(:), base_rot0(:, :, :), e1_0(:, :), e2_0(:, :) + REAL(wp), ALLOCATABLE :: dxc(:), jtry(:, :), rmask(:), base_rot0(:, :, :), e1_0(:, :), e2_0(:, :), hold(:) INTEGER :: phase, kbad - LOGICAL :: unstable, silent + LOGICAL :: unstable, silent, pinned_body TYPE(LineStaticCache), ALLOCATABLE :: lc(:) LOGICAL, ALLOCATABLE :: lmove(:) TYPE(DeckOptions) :: opts_calm @@ -25081,6 +25222,17 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l ALLOCATE (x(n), r(n), r_try(n), x_try(n), jac(n, n), a(n, n), g(n), dx(n), dxn(n), dxc(n), jtry(n, n)) ALLOCATE (rmask(n)) rmask = CD_ONE + ! a CoupledPinned body turns about its host node, held at its initial pose: its translation + ! is held (the force rows carry the host's reaction, not a residual) and its three rotations + ! balance the moment about the node (min_norm_step) + pinned_body = .FALSE. + DO k = 1, nobj + IF (okind(k) /= OBJ_BODY) CYCLE + IF (.NOT. bodies(idx(k))%host_pinned) CYCLE + rmask(off(k) + 1:off(k) + 3) = CD_ZERO + pinned_body = .TRUE. + END DO + hold = rmask x = CD_ZERO IF (PRESENT(jac_check_err)) THEN CALL jacobian_check(jac_check_err) @@ -25120,7 +25272,11 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l ! rejected one (a warm line solve that cannot follow a long trial step counts as rejected) dxn = -r rnorm_try = rnorm - CALL CD_Solve_Dense_As_Banded(jac, dxn, info, lin_msg) + IF (pinned_body) THEN + CALL min_norm_step(jac, dxn, info) + ELSE + CALL CD_Solve_Dense_As_Banded(jac, dxn, info, lin_msg) + END IF IF (info == CD_LINALG_OK .AND. ALL(IEEE_IS_FINITE(dxn))) THEN IF (trust < CD_ZERO) trust = MIN(NORM2(dxn), step_cap) DO inner = 1, 8 @@ -25145,7 +25301,11 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l CALL analytic_jacobian(x_try, jtry, ok) IF (ok) THEN dxc = -r_try - CALL CD_Solve_Dense_As_Banded(jtry, dxc, info, lin_msg) + IF (pinned_body) THEN + CALL min_norm_step(jtry, dxc, info) + ELSE + CALL CD_Solve_Dense_As_Banded(jtry, dxc, info, lin_msg) + END IF ok = info == CD_LINALG_OK IF (ok) ok = ALL(IEEE_IS_FINITE(dxc)) IF (ok) ok = NORM2(dxc) <= 0.5_wp*NORM2(dxn) @@ -25210,7 +25370,7 @@ SUBROUTINE solve_body_equilibrium_core(types, bodies, rod_types, rods, points, l END IF END DO IF (phase == 2) THEN - rmask = CD_ONE + rmask = hold phase = 3 CYCLE END IF @@ -25649,6 +25809,29 @@ SUBROUTINE mask_jacobian(jm) END DO END SUBROUTINE mask_jacobian + SUBROUTINE min_norm_step(jm, step, info_s) + !! The Newton step of a solve with a CoupledPinned body, J step = -r (step holds -r on + !! entry): the minimum-norm Gauss-Newton step (J^T J + 1e-10 D) step = J^T (-r), D the + !! diagonal of J^T J floored at 1e-12 of its largest entry. Such a body may turn neutrally + !! (its lines and its CG on one axis through the node: the spin about the axis meets no + !! load, so J has that spin as a null vector); J^T r has no component along it, so the step + !! does not spin the body, where an LU solve of the near-singular J would (and the rotation + !! cap of the step would then leave the useful part of the step negligible). For a regular J + !! the step is the Newton step. + REAL(wp), INTENT(IN) :: jm(:, :) + REAL(wp), INTENT(INOUT) :: step(:) + INTEGER, INTENT(OUT) :: info_s + REAL(wp) :: nm(SIZE(step), SIZE(step)), dm + INTEGER :: ii + nm = MATMUL(TRANSPOSE(jm), jm) + step = MATMUL(TRANSPOSE(jm), step) + dm = MAX(MAXVAL([(nm(ii, ii), ii=1, SIZE(step))]), TINY(CD_ONE)) + DO ii = 1, SIZE(step) + nm(ii, ii) = nm(ii, ii) + 1.0e-10_wp*MAX(nm(ii, ii), 1.0e-12_wp*dm) + END DO + CALL CD_Solve_Dense_As_Banded(nm, step, info_s, lin_msg) + END SUBROUTINE min_norm_step + LOGICAL FUNCTION equilibrium_stable(kb) RESULT(stable) !! Whether the converged equilibrium x is statically stable: the symmetric part of the !! stiffness -dR/dx (analytic Jacobian, scaled unknowns: a congruence, so definiteness is @@ -25666,6 +25849,10 @@ LOGICAL FUNCTION equilibrium_stable(kb) RESULT(stable) ErrMsg = '' IF (.NOT. gd) RETURN s = -0.5_wp*(jtry + TRANSPOSE(jtry)) + ! a held unknown (the node translation of a CoupledPinned body) is no mode of the solve + DO ii = 1, n + IF (rmask(ii) <= CD_ZERO) s(ii, ii) = CD_ONE + END DO shift = CD_ZERO DO ii = 1, n shift = MAX(shift, ABS(s(ii, ii))) @@ -26511,10 +26698,12 @@ END SUBROUTINE solve_body_equilibrium SUBROUTINE CD_Init_Deck_Aggregate_Rigid6(bodies, points, opts, rt, ErrStat, ErrMsg, ptfm_init) !! Populate the opaque Rigid6 runtime for the coupled aggregate: build the body states and !! retain the deck options + points the per-step marcher needs (the aggregate keeps neither). - !! Coupled/Vessel bodies become host nodes (one per body, in deck BODY order) at their - !! reference point; ptfm_init (the host's initial platform displacement) moves them rigidly - !! with the platform (reference pose included), and the body frame in platform axes, O0 R, - !! then follows the host orientation. + !! Coupled/Vessel and CoupledPinned/VesselPinned bodies become host nodes (one per body, in + !! deck BODY order) at their reference point; ptfm_init (the host's initial platform + !! displacement) moves a Coupled body rigidly with the platform (reference pose included), and + !! the body frame in platform axes, O0 R, then follows the host orientation. A CoupledPinned + !! body takes only the position of its node and turns about it; its PtfmInit pose was set on + !! the deck body before the static solve (apply_ptfm_host_bodies). TYPE(DeckBody), INTENT(IN) :: bodies(:) TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(DeckOptions), INTENT(IN) :: opts @@ -26535,14 +26724,14 @@ SUBROUTINE CD_Init_Deck_Aggregate_Rigid6(bodies, points, opts, rt, ErrStat, ErrM rt%host_o0(3, 3) = CD_ONE IF (PRESENT(ptfm_init)) rt%host_o0 = ptfm_zyx_dcm(ptfm_init(4:6)) mt = TRANSPOSE(rt%host_o0) - nh = COUNT(rt%rigid%is_prescribed) + nh = COUNT(rt%rigid%is_prescribed .OR. rt%rigid%is_host_pinned) ALLOCATE (rt%host_body(nh), rt%host_rrel(3, 3, nh)) k = 0 DO ib = 1, SIZE(rt%rigid) - IF (.NOT. rt%rigid(ib)%is_prescribed) CYCLE + IF (.NOT. (rt%rigid(ib)%is_prescribed .OR. rt%rigid(ib)%is_host_pinned)) CYCLE k = k + 1 rt%host_body(k) = ib - IF (PRESENT(ptfm_init)) THEN + IF (PRESENT(ptfm_init) .AND. rt%rigid(ib)%is_prescribed) THEN rt%rigid(ib)%r_ref = ptfm_init(1:3) + MATMUL(mt, rt%rigid(ib)%r_ref) rt%rigid(ib)%r = rt%rigid(ib)%r_ref rt%rigid(ib)%rot_ref = MATMUL(mt, rt%rigid(ib)%rot_ref) @@ -26556,30 +26745,40 @@ SUBROUTINE CD_Init_Deck_Aggregate_Rigid6(bodies, points, opts, rt, ErrStat, ErrM END SUBROUTINE CD_Init_Deck_Aggregate_Rigid6 PURE INTEGER FUNCTION CD_Rigid6_NHost(rt) RESULT(n) - !! Number of host-driven (Coupled/Vessel) bodies, i.e. the body host nodes (0 if unpopulated). + !! Number of host-driven (Coupled/Vessel and CoupledPinned/VesselPinned) bodies, i.e. the body + !! host nodes (0 if unpopulated). TYPE(CD_Rigid6RuntimeType), INTENT(IN) :: rt n = 0 IF (ALLOCATED(rt%host_body)) n = SIZE(rt%host_body) END FUNCTION CD_Rigid6_NHost PURE LOGICAL FUNCTION CD_Rigid6_AllHost(rt) RESULT(all_host) - !! Whether every body of the runtime is host-driven (no body is integrated). + !! Whether every body of the runtime is host-prescribed (no body is integrated; a + !! CoupledPinned body integrates its rotation). TYPE(CD_Rigid6RuntimeType), INTENT(IN) :: rt - all_host = CD_Rigid6_NBodies(rt) > 0 .AND. CD_Rigid6_NHost(rt) == CD_Rigid6_NBodies(rt) + all_host = .FALSE. + IF (CD_Rigid6_NBodies(rt) > 0) all_host = ALL(rt%rigid%is_prescribed) END FUNCTION CD_Rigid6_AllHost SUBROUTINE CD_Rigid6_SetHostKinematics(rt, position, velocity, acceleration, ErrStat, ErrMsg, orientation, & - angular_velocity, angular_acceleration) + angular_velocity, angular_acceleration, step_start) !! Impose the host node kinematics (reference-point position/velocity/acceleration, the host !! orientation and angular rates, all global; arrays shaped (3[,3], NHost)) on every !! Coupled/Vessel body: R = O^T (O0 R0). Without an orientation the Init orientation is held; - !! without angular rates they are zero. Validates every shape before any change. + !! without angular rates they are zero. A CoupledPinned body takes the node translation as + !! the motion of its reference point and ignores the orientation and angular rates: it keeps + !! its own rotation (body_snap_pinned). Validates every shape before any change. + !! + !! step_start: the kinematics are those of the committed time (a transfer that does not + !! advance), not the t + dt input of a coming step; the next step of a CoupledPinned body + !! then starts from them (RigidBodyState%pin0). Default .FALSE. TYPE(CD_Rigid6RuntimeType), INTENT(INOUT) :: rt REAL(wp), INTENT(IN) :: position(:, :), velocity(:, :), acceleration(:, :) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg REAL(wp), INTENT(IN), OPTIONAL :: orientation(:, :, :) REAL(wp), INTENT(IN), OPTIONAL :: angular_velocity(:, :), angular_acceleration(:, :) + LOGICAL, INTENT(IN), OPTIONAL :: step_start INTEGER :: k, ib, nh REAL(wp) :: o(3, 3) @@ -26608,6 +26807,16 @@ SUBROUTINE CD_Rigid6_SetHostKinematics(rt, position, velocity, acceleration, Err END IF DO k = 1, nh ib = rt%host_body(k) + IF (rt%rigid(ib)%is_host_pinned) THEN + rt%rigid(ib)%pin = position(:, k) + rt%rigid(ib)%pin_v = velocity(:, k) + rt%rigid(ib)%pin_a = acceleration(:, k) + CALL body_snap_pinned(rt%rigid(ib)) + IF (PRESENT(step_start)) THEN + IF (step_start) CALL set_body_pin_start(rt%rigid(ib)) + END IF + CYCLE + END IF o = rt%host_o0 IF (PRESENT(orientation)) o = orientation(:, :, k) rt%rigid(ib)%rot_mat = MATMUL(TRANSPOSE(o), rt%host_rrel(:, :, k)) @@ -26628,7 +26837,9 @@ END SUBROUTINE CD_Rigid6_SetHostKinematics SUBROUTINE CD_Rigid6_GetHostKinematics(rt, k, position, velocity, acceleration, orientation, angular_velocity, & angular_acceleration) !! The committed kinematics of host node k (the k-th Coupled/Vessel body's reference point) - !! and the host orientation O = (O0 R0) R^T it implies. + !! and the host orientation O = (O0 R0) R^T it implies. A CoupledPinned body implies no host + !! orientation or angular rates: its node reports the Init orientation and zero rates, which + !! CD_Rigid6_SetHostKinematics ignores for it. TYPE(CD_Rigid6RuntimeType), INTENT(IN) :: rt INTEGER, INTENT(IN) :: k REAL(wp), INTENT(OUT) :: position(3), velocity(3), acceleration(3), orientation(3, 3) @@ -26652,6 +26863,10 @@ SUBROUTINE CD_Rigid6_GetHostKinematics(rt, k, position, velocity, acceleration, position = rt%rigid(ib)%r velocity = rt%rigid(ib)%v acceleration = rt%rigid(ib)%a + IF (rt%rigid(ib)%is_host_pinned) THEN + orientation = rt%host_o0 + RETURN + END IF orientation = MATMUL(rt%host_rrel(:, :, k), TRANSPOSE(rt%rigid(ib)%rot_mat)) angular_velocity = rt%rigid(ib)%omega angular_acceleration = rt%rigid(ib)%alpha @@ -26690,16 +26905,28 @@ SUBROUTINE CD_Rigid6_HostWrench(system, rt, loads, k, force, moment, ErrStat, Er !! seabed contact and external loads -- the loads rigid6_body_acceleration integrates for a !! free body -- minus the rigid-body and added-mass inertia M a (CG offset, velocity and !! gyroscopic terms included) at the host-prescribed acceleration. - TYPE(CD_SystemType), INTENT(IN) :: system - TYPE(CD_Rigid6RuntimeType), INTENT(IN) :: rt + !! + !! A CoupledPinned body returns a force and no moment (MoorDyn-F's coupled pinned body): the + !! load it exerts on its node, its net load less its inertia, F - (m + m_a) a_p + !! - m (alpha x c + w x (w x c)) for the CG at c (pin_load of rigid_coupled_acceleration). As + !! for a CoupledPinned rod (CD_Rod_HostWrench) the node acceleration a_p is the reference-point + !! acceleration of the body state (the host's, an output probe's included), the rotation and + !! angular velocity are the committed ones, the angular acceleration is solved again for a_p + !! (rigid6_body_acceleration at dt = 0), and the attached lines' end-node inertia moves to the + !! re-solved end accelerations with their coupled mass block at a frozen interior. The force + !! thereby depends on the checkpointed body state and the line states only. + TYPE(CD_SystemType), INTENT(INOUT) :: system + TYPE(CD_Rigid6RuntimeType), INTENT(INOUT) :: rt REAL(wp), INTENT(IN) :: loads(:, :) INTEGER, INTENT(IN) :: k REAL(wp), INTENT(OUT) :: force(3), moment(3) INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - INTEGER :: ib, ip, pidx, base, j + INTEGER :: ib, ip, pidx, base, j, n, es REAL(wp) :: f_env(3), mass_eff, drag3(3, 3), f_h(3), m_h(3), cg6(6, 6), f_bias(3), m_bias(3) REAL(wp) :: f_sb(3), m_sb(3), load_dv(6, 6), f_ext(3), arm(3), ig(3, 3), m6(6, 6), acc6(6), w6(6) + REAL(wp) :: acc(3), alpha(3) + CHARACTER(1024) :: em force = CD_ZERO moment = CD_ZERO @@ -26709,6 +26936,27 @@ SUBROUTINE CD_Rigid6_HostWrench(system, rt, loads, k, force, moment, ErrStat, Er CALL fail(ErrStat, ErrMsg, 'CD_Rigid6_HostWrench: host node index out of range'); RETURN END IF ib = rt%host_body(k) + IF (rt%rigid(ib)%is_host_pinned) THEN + n = system%n_system_coupled_dof + IF (3*SIZE(loads, 2) /= n .OR. SIZE(loads, 1) /= 3) THEN + CALL fail(ErrStat, ErrMsg, 'CD_Rigid6_HostWrench: load array does not cover the coupled points'); RETURN + END IF + ! the step workspace serves as scratch between steps (a step refills it before use) + CALL ensure_rigid_step_workspace(rt%work, n, SIZE(rt%rigid), SIZE(system%points)) + rt%work%loads(1:n) = RESHAPE(loads, [n]) + CALL CD_Get_System_CoupledMotion(system, rt%work%q(1:n), rt%work%v(1:n), rt%work%a(1:n), es, em) + ! the end-node inertia moves with the line interior held (an output evaluation keeps the + ! committed interior state, accelerations included) + IF (es == CD_SYSTEM_OK) CALL CD_Calc_System_CoupledAccelDerivative(system, rt%work%dload_da, es, em, & + frozen_interior=.TRUE.) + IF (es /= CD_SYSTEM_OK) THEN + CALL fail_solve(ErrStat, ErrMsg, 'CD_Rigid6_HostWrench: pinned-body line query failed: '//TRIM(em)); RETURN + END IF + CALL rigid6_body_acceleration(system, rt%points, rt%opts, rt%rigid(ib), CD_ZERO, CD_ZERO, & + [CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO], rt%work, ib, acc, & + alpha, ErrStat, ErrMsg, pin_load=force) + RETURN + END IF CALL rigid6_environment_force(rt%rigid(ib), rt%opts, CD_ZERO, f_env, mass_eff, drag3, ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) RETURN CALL rigid6_hydrostatics(rt%rigid(ib), rt%opts, CD_ZERO, f_h, m_h, ErrStat, ErrMsg) @@ -27692,6 +27940,15 @@ SUBROUTINE CD_Rigid6_Set_States(rt, states, ErrStat, ErrMsg) rt%rigid(ib)%rot_mat = RESHAPE(states(k + 16:k + 24), [3, 3]) rt%rigid(ib)%eta = CD_Log_SO3(MATMUL(rt%rigid(ib)%rot_mat, TRANSPOSE(rt%rigid(ib)%rot_ref))) rt%rigid(ib)%accel_valid = .TRUE. + ! A CoupledPinned body's node is its reference point, whose motion the mirror carries: the + ! pin and the step-start pin are that motion, as the continuing run has them (the pin is + ! replaced by the host transfer before the next step or output evaluation). + IF (rt%rigid(ib)%is_host_pinned) THEN + rt%rigid(ib)%pin = rt%rigid(ib)%r + rt%rigid(ib)%pin_v = rt%rigid(ib)%v + rt%rigid(ib)%pin_a = rt%rigid(ib)%a + CALL set_body_pin_start(rt%rigid(ib)) + END IF END DO END SUBROUTINE CD_Rigid6_Set_States @@ -27699,7 +27956,8 @@ SUBROUTINE step_rigid6_system(system, points, opts, rigid, time, dt, converged, work, bathymetry, host_mask, host_q, host_v, host_a, host_start) !! Advance Rigid6 bodies and lines from time - dt to time: step_rigid6_once, sub-cycled so !! that the explicit central-difference body position resolves the stiffest body-mooring - !! mode (rigid_substep_count). converged is the AND and stalled the OR over the sub-steps. + !! mode and the swing of a CoupledPinned body about its node (rigid_substep_count). converged + !! is the AND and stalled the OR over the sub-steps. TYPE(CD_SystemType), INTENT(INOUT) :: system TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(DeckOptions), INTENT(IN) :: opts @@ -27718,12 +27976,13 @@ SUBROUTINE step_rigid6_system(system, points, opts, rigid, time, dt, converged, LOGICAL, INTENT(IN), OPTIONAL :: host_mask(:) REAL(wp), INTENT(IN), OPTIONAL :: host_q(:), host_v(:), host_a(:) ! host_start: the step-start state of the host-driven (is_prescribed) bodies, which hold their - ! t + dt pose on entry; sub-steps then move them along the interpolated host path + ! t + dt pose on entry; sub-steps then move them along the interpolated host path (a + ! host-pinned body carries its step-start pin itself, RigidBodyState%pin0) TYPE(RigidBodyState), INTENT(IN), OPTIONAL :: host_start(:) REAL(wp), ALLOCATABLE :: q0h(:), v0h(:), a0h(:) INTEGER :: ib, ip, nsub, isub, it REAL(wp), ALLOCATABLE :: hk_end(:, :) - LOGICAL :: conv_s, stall_s + LOGICAL :: conv_s, stall_s, host_pins REAL(wp) :: omega2, mass6(6), k6c(6) converged = .TRUE. @@ -27739,12 +27998,22 @@ SUBROUTINE step_rigid6_system(system, points, opts, rigid, time, dt, converged, att_base(ip) = system_point_base(system, points(rigid(ib)%point_indices(ip))%id) att_arm(:, ip) = MATMUL(rigid(ib)%rot_mat, points(rigid(ib)%point_indices(ip))%body_offset) END DO - ! structural mass and inertia plus the submerged body's translational added mass - mass6(1:3) = rigid(ib)%mass - IF (rigid(ib)%r(3) < CD_ZERO) mass6(1:3) = mass6(1:3) + opts%rhoW*rigid(ib)%vol*MAX(CD_ZERO, rigid(ib)%ca) - mass6(4:6) = global_inertia_diag(rigid(ib)%rot_mat, rigid(ib)%inertia) - ! hydrostatic restoring plus the seabed contact that acts within the step - k6c = [CD_ZERO, CD_ZERO, rigid(ib)%c33, rigid(ib)%c44, rigid(ib)%c55, CD_ZERO] + IF (rigid(ib)%is_host_pinned) THEN + ! a host-pinned body only turns about its reference point: its line ends act through + ! their arms on its rotational inertia about the pin (the translational entries stay + ! zero, so rigid_omega2_estimate skips them), and its weight, buoyancy and pin + ! acceleration make it a compound pendulum (pinned_body_estimate_terms) + CALL pinned_body_estimate_terms(rigid(ib), opts, time - dt, mass6, k6c, ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + ELSE + ! structural mass and inertia plus the submerged body's translational added mass + mass6(1:3) = rigid(ib)%mass + IF (rigid(ib)%r(3) < CD_ZERO) mass6(1:3) = mass6(1:3) + opts%rhoW*rigid(ib)%vol*MAX(CD_ZERO, rigid(ib)%ca) + mass6(4:6) = global_inertia_diag(rigid(ib)%rot_mat, rigid(ib)%inertia) + ! hydrostatic restoring + k6c = [CD_ZERO, CD_ZERO, rigid(ib)%c33, rigid(ib)%c44, rigid(ib)%c55, CD_ZERO] + END IF + ! plus the seabed contact that acts within the step CALL rigid6_contact_stiffness(rigid(ib), opts, time - dt, dt, k6c, ErrStat, ErrMsg, bathymetry) IF (ErrStat /= CD_DECKDRV_OK) RETURN omega2 = MAX(omega2, rigid_omega2_estimate(system, att_base, att_arm, mass6, k6c)) @@ -27753,10 +28022,23 @@ SUBROUTINE step_rigid6_system(system, points, opts, rigid, time, dt, converged, nsub = rigid_substep_count(omega2, dt) CALL host_substep_start(system, nsub, q0h, v0h, a0h, ErrStat, ErrMsg, host_mask) IF (ErrStat /= CD_DECKDRV_OK) RETURN + ! A host-pinned body without a committed acceleration (the first step) takes its starting + ! acceleration with its pin at the step start: the host has already placed the pin at + ! t + dt, so the bodies go back to their step-start pin (pin0) for it, together with every + ! other body without one, and return to t + dt after it (see step_rod_system). + host_pins = ANY(rigid%is_host_pinned) + IF (ANY(rigid%is_host_pinned .AND. .NOT. rigid%accel_valid)) THEN + CALL save_host_end_rigid(rigid, hk_end) + CALL interp_host_body_pins(rigid, hk_end, CD_ZERO) + CALL rigid_start_accelerations(system, points, opts, rigid, time - dt, work, ErrStat, ErrMsg, bathymetry) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + CALL interp_host_body_pins(rigid, hk_end, CD_ONE) + END IF DO isub = 1, nsub - IF (nsub > 1 .AND. PRESENT(host_start)) THEN + IF (nsub > 1 .AND. (PRESENT(host_start) .OR. host_pins)) THEN IF (isub == 1) CALL save_host_end_rigid(rigid, hk_end) - CALL interp_host_rigid(rigid, host_start, hk_end, REAL(isub, wp)/REAL(nsub, wp)) + IF (PRESENT(host_start)) CALL interp_host_rigid(rigid, host_start, hk_end, REAL(isub, wp)/REAL(nsub, wp)) + IF (host_pins) CALL interp_host_body_pins(rigid, hk_end, REAL(isub, wp)/REAL(nsub, wp)) END IF IF (.NOT. PRESENT(host_mask)) THEN CALL step_rigid6_once(system, points, opts, rigid, time - dt + REAL(isub, wp)*dt/REAL(nsub, wp), & @@ -27777,6 +28059,10 @@ SUBROUTINE step_rigid6_system(system, points, opts, rigid, time, dt, converged, n_iter = n_iter + it IF (ErrStat /= CD_DECKDRV_OK) RETURN END DO + ! the committed pin of a host-pinned body starts its next step + DO ib = 1, SIZE(rigid) + IF (rigid(ib)%is_host_pinned) CALL set_body_pin_start(rigid(ib)) + END DO END SUBROUTINE step_rigid6_system SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & @@ -27795,7 +28081,9 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st !! never displaced from the positions the lines were solved with. Position-dependent body !! loads (hydrostatic restoring, seabed springs) act explicitly: stable for !! dt*SQRT(k/m) < 2. The Body point records are finally set to the corrected motion (the - !! same map a checkpoint restore applies). + !! same map a checkpoint restore applies). A host-pinned (CoupledPinned) body advances its + !! rotation only: its reference point follows the host node (body_snap_pinned) and the + !! corrector solves its angular acceleration about it. TYPE(CD_SystemType), INTENT(INOUT) :: system TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(DeckOptions), INTENT(IN) :: opts @@ -27834,22 +28122,8 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st END DO ! 0. a body without a committed acceleration (the first step) gets the instantaneous one ! from the current line loads, so the predictor starts from the actual a_0 - IF (.NOT. ALL(rigid%accel_valid)) THEN - CALL rigid_start_loads(system, work%q(1:system%n_system_coupled_dof), work%v(1:system%n_system_coupled_dof), & - work%a(1:system%n_system_coupled_dof), work%loads(1:system%n_system_coupled_dof), & - work%dload_da, ErrStat, ErrMsg) - IF (ErrStat /= CD_DECKDRV_OK) RETURN - DO ib = 1, SIZE(rigid) - IF (rigid(ib)%accel_valid) CYCLE - CALL rigid6_body_acceleration(system, points, opts, rigid(ib), time - dt, CD_ZERO, & - [CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO], work, ib, & - acc, alpha, ErrStat, ErrMsg, bathymetry) - IF (ErrStat /= CD_DECKDRV_OK) RETURN - rigid(ib)%a = acc - rigid(ib)%alpha = alpha - rigid(ib)%accel_valid = .TRUE. - END DO - END IF + CALL rigid_start_accelerations(system, points, opts, rigid, time - dt, work, ErrStat, ErrMsg, bathymetry) + IF (ErrStat /= CD_DECKDRV_OK) RETURN work%old_rigid = rigid work%old_points = system%points CALL CD_Get_System_CoupledMotion(system, work%q(1:system%n_system_coupled_dof), & @@ -27863,7 +28137,8 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st CALL overlay_host_motion(work%q(1:system%n_system_coupled_dof), work%v(1:system%n_system_coupled_dof), & work%a(1:system%n_system_coupled_dof), host_mask, host_q, host_v, host_a) ! 1. predictor (previous acceleration held) and the line step to t + dt; a host-driven - ! body already carries its t + dt state + ! body already carries its t + dt state, and a host-pinned body advances its rotation only + ! (its reference point stays on the t + dt pin the host has placed) DO ib = 1, SIZE(rigid) IF (rigid(ib)%is_prescribed) CYCLE CALL CD_Rigid_Advance_Newmark(rigid(ib)%r, rigid(ib)%v, rigid(ib)%rot_mat, rigid(ib)%omega, rigid(ib)%a, & @@ -27875,6 +28150,7 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st ErrMsg = 'CableDyn_DeckDriver: Rigid6 finite-rotation update failed: '//TRIM(em) RETURN END IF + CALL body_snap_pinned(rigid(ib)) rigid(ib)%eta = CD_Log_SO3(MATMUL(rigid(ib)%rot_mat, TRANSPOSE(rigid(ib)%rot_ref))) END DO CALL scatter_rigid6_point_motion(system, points, rigid, work%q(1:system%n_system_coupled_dof), & @@ -27934,6 +28210,8 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st END IF DO ib = 1, SIZE(rigid) IF (rigid(ib)%is_prescribed) CYCLE + ! (a host-pinned body: old_rigid%a is the t + dt pin acceleration, so the translational + ! velocity change dv0 + gamma dt a_p of the reduced solve is zero, as it is) dv0(1:3) = -CD_RIGID_NEWMARK_GAMMA*dt*work%old_rigid(ib)%a dv0(4:6) = -CD_RIGID_NEWMARK_GAMMA*dt*work%old_rigid(ib)%alpha CALL rigid6_body_acceleration(system, points, opts, rigid(ib), time, dt, dv0, work, ib, acc, alpha, & @@ -27957,6 +28235,7 @@ SUBROUTINE step_rigid6_once(system, points, opts, rigid, time, dt, converged, st END IF rigid(ib)%a = acc rigid(ib)%alpha = alpha + CALL body_snap_pinned(rigid(ib)) rigid(ib)%eta = CD_Log_SO3(MATMUL(rigid(ib)%rot_mat, TRANSPOSE(rigid(ib)%rot_ref))) END DO ! the Body point records follow the corrected bodies @@ -27996,13 +28275,56 @@ SUBROUTINE rigid_start_loads(system, q, v, a, loads, dload_da, ErrStat, ErrMsg) END IF END SUBROUTINE rigid_start_loads + SUBROUTINE rigid_start_accelerations(system, points, opts, rigid, time, work, ErrStat, ErrMsg, bathymetry) + !! The instantaneous acceleration of every Rigid6 body without a committed one (the first + !! step) from the current line loads at time, so the predictor starts from the actual a_0 + !! (rigid6_body_acceleration at dt = 0; a host-pinned body keeps its pin acceleration and + !! solves its angular one). + TYPE(CD_SystemType), INTENT(INOUT) :: system + TYPE(DeckPoint), INTENT(IN) :: points(:) + TYPE(DeckOptions), INTENT(IN) :: opts + TYPE(RigidBodyState), INTENT(INOUT) :: rigid(:) + REAL(wp), INTENT(IN) :: time + TYPE(RigidStepWorkspace), INTENT(INOUT) :: work + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry + INTEGER :: ib + REAL(wp) :: acc(3), alpha(3) + + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + IF (ALL(rigid%accel_valid)) RETURN + CALL ensure_rigid_step_workspace(work, system%n_system_coupled_dof, SIZE(rigid), SIZE(system%points)) + CALL rigid_start_loads(system, work%q(1:system%n_system_coupled_dof), work%v(1:system%n_system_coupled_dof), & + work%a(1:system%n_system_coupled_dof), work%loads(1:system%n_system_coupled_dof), & + work%dload_da, ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + DO ib = 1, SIZE(rigid) + IF (rigid(ib)%accel_valid) CYCLE + CALL rigid6_body_acceleration(system, points, opts, rigid(ib), time, CD_ZERO, & + [CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO, CD_ZERO], work, ib, & + acc, alpha, ErrStat, ErrMsg, bathymetry) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + rigid(ib)%a = acc + rigid(ib)%alpha = alpha + rigid(ib)%accel_valid = .TRUE. + END DO + END SUBROUTINE rigid_start_accelerations + SUBROUTINE rigid6_body_acceleration(system, points, opts, body, time, dt, dv0, work, ib, acc, alpha, & - ErrStat, ErrMsg, bathymetry) + ErrStat, ErrMsg, bathymetry, pin_load) !! The acceleration of Rigid6 body ib at its current state and time from every body load !! and the line loads in work%loads (evaluated with the attachment accelerations work%a, !! end-node inertia derivative work%dload_da): rigid_coupled_acceleration with the step dt !! and velocity offset dv0 (dt = 0, dv0 = 0: the instantaneous acceleration). Stores the - !! environment force and effective mass in work%f_env(:, ib) / work%mass_eff(ib). + !! environment force and effective mass in work%f_env(:, ib) / work%mass_eff(ib). A + !! host-pinned body turns about its reference point, which moves with body%a (the host's pin + !! acceleration): acc = body%a, and alpha solves the moment equation about the pin, + !! M_rr alpha = M_ext - M_rt a_p - w x (I_p w), + !! with M_rr = R J R^T - m [c]x [c]x plus the line end-node inertia through the arms (I_p the + !! inertia about the pin) and M_rt = m [c]x for the CG at c = R cg (MoorDyn-F's + !! M(4:6,4:6) a(4:6) = F(4:6) - M(4:6,1:3) a(1:3)). TYPE(CD_SystemType), INTENT(IN) :: system TYPE(DeckPoint), INTENT(IN) :: points(:) TYPE(DeckOptions), INTENT(IN) :: opts @@ -28014,6 +28336,8 @@ SUBROUTINE rigid6_body_acceleration(system, points, opts, body, time, dt, dv0, w INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg TYPE(CD_BathymetryType), INTENT(IN), OPTIONAL :: bathymetry + ! pin_load (a host-pinned body): the force the body exerts on its node (rigid_coupled_acceleration) + REAL(wp), INTENT(OUT), OPTIONAL :: pin_load(3) ! Rigid6 added mass is the isotropic translational rhoW*phi*Vol*Ca already folded into ! mass_eff (MoorDyn Body semantics: no rotational added inertia); body%inertia is about the CG. @@ -28065,9 +28389,16 @@ SUBROUTINE rigid6_body_acceleration(system, points, opts, body, time, dt, dv0, w f_body = f_body + f_attach m_global = m_global + cross3(arm, f_attach) END DO - CALL rigid_coupled_acceleration(work%dload_da, dt, work%a(1:system%n_system_coupled_dof), att_base, att_arm, & - work%mass_eff(ib), cg6, body%inertia, body%rot_mat, body%omega, & - f_body, m_global, dv0, load_dv, acc, alpha, ErrStat, ErrMsg) + IF (body%is_host_pinned) THEN + CALL rigid_coupled_acceleration(work%dload_da, dt, work%a(1:system%n_system_coupled_dof), att_base, att_arm, & + work%mass_eff(ib), cg6, body%inertia, body%rot_mat, body%omega, & + f_body, m_global, dv0, load_dv, acc, alpha, ErrStat, ErrMsg, & + pin_arm=[CD_ZERO, CD_ZERO, CD_ZERO], pin_acc=body%a, pin_load=pin_load) + ELSE + CALL rigid_coupled_acceleration(work%dload_da, dt, work%a(1:system%n_system_coupled_dof), att_base, att_arm, & + work%mass_eff(ib), cg6, body%inertia, body%rot_mat, body%omega, & + f_body, m_global, dv0, load_dv, acc, alpha, ErrStat, ErrMsg) + END IF END SUBROUTINE rigid6_body_acceleration SUBROUTINE step_prescribed_rigid6_system(system, points, opts, motion, rigid, time_index, time, dt, converged, & @@ -36470,21 +36801,53 @@ SUBROUTINE apply_ptfm_init(points, ptfm_init) END SUBROUTINE apply_ptfm_init SUBROUTINE apply_ptfm_host_bodies(bodies, points, ptfm_init) - !! Rigid-transform the Body attachment points of every Coupled/Vessel BODY by the initial - !! platform displacement (the body pose itself moves in CD_Init_Deck_Aggregate_Rigid6). - TYPE(DeckBody), INTENT(IN) :: bodies(:) + !! Rigid-transform the Body attachment points of every Coupled/Vessel and CoupledPinned BODY + !! by the initial platform displacement (the pose of a Coupled body moves in + !! CD_Init_Deck_Aggregate_Rigid6). The pose of a CoupledPinned body moves here, before the + !! static solve turns it about its node: its reference point to r + M^T p and its orientation + !! to M^T R (MoorDyn-F also turns a coupled pinned body with PtfmInit), written back as the + !! deck's x-y'-z'' angles (body_rotation_angles). + TYPE(DeckBody), INTENT(INOUT) :: bodies(:) TYPE(DeckPoint), INTENT(INOUT) :: points(:) REAL(wp), INTENT(IN) :: ptfm_init(6) INTEGER :: i, j + REAL(wp) :: dcm(3, 3) + dcm = ptfm_zyx_dcm(ptfm_init(4:6)) DO i = 1, SIZE(bodies) - IF (.NOT. bodies(i)%host_coupled) CYCLE + IF (.NOT. (bodies(i)%host_coupled .OR. bodies(i)%host_pinned)) CYCLE DO j = 1, SIZE(points) IF (points(j)%body_id == bodies(i)%id .AND. starts_with(TRIM(points(j)%ptype), 'body')) & CALL apply_ptfm_point(points(j), ptfm_init) END DO + IF (.NOT. bodies(i)%host_pinned) CYCLE + bodies(i)%pos = ptfm_init(1:3) + MATMUL(TRANSPOSE(dcm), bodies(i)%pos) + bodies(i)%rot = body_rotation_angles(MATMUL(TRANSPOSE(dcm), CD_Body_Rotation(bodies(i)%rot(1), & + bodies(i)%rot(2), & + bodies(i)%rot(3)))) END DO END SUBROUTINE apply_ptfm_host_bodies + PURE FUNCTION body_rotation_angles(rot) RESULT(ang) + !! The deck angles [deg] of a body rotation, the inverse of CD_Body_Rotation: for + !! R = Rx(a) Ry(b) Rz(c), R13 = sin b, (R23, R33) = cos b (-sin a, cos a) and + !! (R12, R11) = cos b (-sin c, cos c); at cos b = 0 only a + c (b = 90 deg) or a - c (b = -90 + !! deg) is defined, taken with c = 0 from R32 = sin a, R22 = cos a. + REAL(wp), INTENT(IN) :: rot(3, 3) + REAL(wp) :: ang(3) + REAL(wp), PARAMETER :: R2D = 180.0_wp/3.14159265358979323846264338327950288_wp + REAL(wp) :: sb + sb = MAX(-CD_ONE, MIN(CD_ONE, rot(1, 3))) + ang(2) = ASIN(sb) + IF (SQRT(rot(2, 3)**2 + rot(3, 3)**2) > 1.0e-12_wp) THEN + ang(1) = ATAN2(-rot(2, 3), rot(3, 3)) + ang(3) = ATAN2(-rot(1, 2), rot(1, 1)) + ELSE + ang(1) = ATAN2(rot(3, 2), rot(2, 2)) + ang(3) = CD_ZERO + END IF + ang = ang*R2D + END FUNCTION body_rotation_angles + SUBROUTINE apply_ptfm_host_rods(rods, points, ptfm_init) !! Rigid-transform every Coupled/Vessel and CoupledPinned ROD (its End A/B and its RodA/B !! attachment points) by the initial platform displacement, p' = r + M^T p (apply_ptfm_init). diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index 81fb7426..1bf412d0 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -20,7 +20,10 @@ MODULE CableDyn_OpenFAST_Aggregate !! (translation in, force out, zero moment; the rod !! turns about it on its own), !! last nhost_body columns -> the k-th Coupled/Vessel BODY's reference point - !! (6-DOF host node, force and moment about it), + !! (6-DOF host node, force and moment about it) or + !! CoupledPinned BODY's reference point (translation + !! in, force out, zero moment; the body turns about + !! it on its own), !! with ncp_total = ncp_sys + ncable + nhost_rod + nhost_body. All facade arrays are shaped !! (3, ncp_total). !! @@ -235,7 +238,7 @@ MODULE CableDyn_OpenFAST_Aggregate ! the full EI=0 coupled-block scratch (3, n_system_coupled_dof/3) their RodA/B points are ! overlaid on. INTEGER :: nhost_rod = 0 - INTEGER :: nhost_body = 0 ! Coupled/Vessel bodies: the trailing host nodes after the rods + INTEGER :: nhost_body = 0 ! Coupled/Vessel and CoupledPinned bodies: the trailing host nodes ! Body/rod marches: the host fairleads' t + dt motion as a flat coupled-DOF overlay ! (hf_mask marks the moving DOFs), passed into the march as the line step's end motion. LOGICAL, ALLOCATABLE :: hf_mask(:) @@ -717,7 +720,8 @@ SUBROUTINE CD_AGG_GetMovingPointMesh(self, position, velocity, acceleration, loa IF (PRESENT(moment)) moment(:, col) = y_fair END DO END IF - ! Host body nodes: the reference-point kinematics and the wrench about it. + ! Host body nodes: the reference-point kinematics and the wrench about it (a CoupledPinned + ! body: its force, with zero moment). IF (self%nhost_body > 0) THEN CALL CD_FMF_GetPointMesh(self%sys, self%hb_pos, self%hb_vel, self%hb_acc, self%hb_load, es, em) IF (es /= CD_FMF_OK) THEN @@ -863,7 +867,7 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er END IF IF (self%nhost_rod + self%nhost_body > 0) THEN ! a transfer without advancing: the host kinematics of the committed time, from which the - ! next step of a CoupledPinned rod starts (an output probe is restored by its caller) + ! next step of a CoupledPinned rod or body starts (an output probe is restored by its caller) IF (PRESENT(orientation)) THEN CALL set_host_objects(self, position, velocity, acceleration, ErrStat, ErrMsg, orientation=orientation, & angular_velocity=self%mv_omega, angular_acceleration=self%mv_alpha, step_start=.TRUE.) @@ -1044,7 +1048,8 @@ SUBROUTINE CD_AGG_Step_Moving(self, dt, position, velocity, acceleration, conver ! start the generalized-alpha step from the t + dt end state and corrupt the ends' history. CALL host_fairlead_motion(self, position, velocity, acceleration) ! The step-start bodies are staged before anything moves them: host-driven - ! (Coupled/Vessel) bodies take the t+dt host kinematics before the march, and a check + ! (Coupled/Vessel) bodies take the t+dt host kinematics before the march (CoupledPinned ones + ! their t+dt node translation), and a check ! after a successful march (plausibility, FAILURE rows) can still reject the step, so ! every failure path below un-stages them together with the system rewind. CALL CD_Rigid6_Stage(self%rigid6) @@ -2420,9 +2425,11 @@ END SUBROUTINE overlay_host_objects SUBROUTINE set_host_objects(self, position, velocity, acceleration, ErrStat, ErrMsg, orientation, & angular_velocity, angular_acceleration, step_start) - !! Impose the host-rod columns (the trailing nhost_rod moving columns) on the rod runtime. + !! Impose the host-rod and host-body columns (the trailing nhost_rod + nhost_body moving + !! columns) on the rod and Rigid6 runtimes. !! step_start: a transfer that does not advance (CD_AGG_UpdateStates_Moving), whose host - !! kinematics the next step of a CoupledPinned rod starts from (CD_Rod_SetHostKinematics). + !! kinematics the next step of a CoupledPinned rod or body starts from + !! (CD_Rod_SetHostKinematics, CD_Rigid6_SetHostKinematics). TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self REAL(wp), INTENT(IN) :: position(:, :), velocity(:, :), acceleration(:, :) INTEGER, INTENT(OUT) :: ErrStat @@ -2443,12 +2450,13 @@ SUBROUTINE set_host_objects(self, position, velocity, acceleration, ErrStat, Err IF (PRESENT(orientation)) THEN CALL CD_Rigid6_SetHostKinematics(self%rigid6, position(:, c0:c1), velocity(:, c0:c1), & acceleration(:, c0:c1), es, em, orientation(:, :, c0:c1), & - angular_velocity(:, c0:c1), angular_acceleration(:, c0:c1)) + angular_velocity(:, c0:c1), angular_acceleration(:, c0:c1), & + step_start=at_start) ELSE CALL CD_Rigid6_SetHostKinematics(self%rigid6, position(:, c0:c1), velocity(:, c0:c1), & acceleration(:, c0:c1), es, em, & angular_velocity=angular_velocity(:, c0:c1), & - angular_acceleration=angular_acceleration(:, c0:c1)) + angular_acceleration=angular_acceleration(:, c0:c1), step_start=at_start) END IF IF (es /= CD_DECKDRV_OK) THEN CALL map_deck_status(es, em, ErrStat, ErrMsg) diff --git a/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90 index 14916202..01d7957a 100644 --- a/src/openfast/CableDyn_OF.f90 +++ b/src/openfast/CableDyn_OF.f90 @@ -40,9 +40,10 @@ MODULE CableDyn !! construct is routed into the corresponding CableDyn feature (bodies and rods, !! viscoelastic and Syrope ropes, line failures, active tension through the CONTROL !! section, SeaState water kinematics), or, where CableDyn has no counterpart (for - !! example a CoupledPinned body), fails closed with a named error. A CoupledPinned rod - !! is a coupling-mesh node like a Coupled rod but takes only the translation of its - !! node and returns force with zero moment: it turns about the node on its own. + !! example a rotational body drag area), fails closed with a named error. A CoupledPinned + !! rod or body is a coupling-mesh node like a Coupled rod or body but takes only the + !! translation of its node and returns force with zero moment: it turns about the node on + !! its own. !! !! Supported coupled surface (each verified against stock MoorDyn or a named gate): !! Fixed/Coupled(Vessel) points, EI=0 mooring lines (BA damping + the Morison set), diff --git a/tests/test_c_api.f90 b/tests/test_c_api.f90 index 4384b5e4..8e2e742f 100644 --- a/tests/test_c_api.f90 +++ b/tests/test_c_api.f90 @@ -543,11 +543,11 @@ SUBROUTINE case_deck_bodies_rods() !! deck dtM, and 20 driven steps reproduce CD_AGG driven directly bit-for-bit (loads and !! coupled motion), also across a SaveState / three trial steps / RestoreState rewind half !! way. A mismatched dt, load derivatives and point fluid fields fail closed by name; a - !! Coupled rod (a 6-DOF host node) and a CoupledPinned rod (a host-driven pin) are rejected - !! by the standalone deck rules. + !! Coupled rod (a 6-DOF host node), a CoupledPinned rod (a host-driven pin) and a + !! CoupledPinned body (a host-driven reference point) are rejected by the standalone deck rules. CHARACTER(*), PARAMETER :: ROD_DECK = 'capi_rod_deck.dat', BODY_DECK = 'capi_body_deck.dat', & HOST_DECK = 'capi_hostrod_deck.dat', PIN_DECK = 'capi_pinrod_deck.dat', & - HOST_PIN_DECK = 'capi_hostpin_deck.dat' + HOST_PIN_DECK = 'capi_hostpin_deck.dat', PIN_BODY_DECK = 'capi_pinbody_deck.dat' CHARACTER(KIND=C_CHAR), TARGET :: c_path(64) CHARACTER(KIND=C_CHAR), TARGET :: msg(300) TYPE(C_PTR) :: handle @@ -566,6 +566,7 @@ SUBROUTINE case_deck_bodies_rods() CALL write_capi_object_deck(HOST_DECK, 3) CALL write_capi_object_deck(PIN_DECK, 4) CALL write_capi_object_deck(HOST_PIN_DECK, 5) + CALL write_capi_object_deck(PIN_BODY_DECK, 6) DO ideck = 1, 3 SELECT CASE (ideck) CASE (1) @@ -670,12 +671,25 @@ SUBROUTINE case_deck_bodies_rods() CALL require(es == 3_C_INT .AND. INDEX(c_text(msg), 'requires a coupled host') > 0, & 'c-api-objects:host-pinned-rod-rejected') CALL CableDyn_Close(handle, es) + ! and a CoupledPinned body, whose reference point a coupled host moves + path = PIN_BODY_DECK + c_path = C_NULL_CHAR + DO i = 1, LEN_TRIM(path) + c_path(i) = path(i:i) + END DO + CALL CableDyn_Create(handle, es) + CALL CableDyn_InitDeck(handle, C_LOC(c_path), INT(LEN_TRIM(path), C_INT), es) + CALL CableDyn_GetLastError(handle, C_LOC(msg), INT(SIZE(msg), C_INT)) + CALL require(es == 3_C_INT .AND. INDEX(c_text(msg), 'BODY requires a coupled host') > 0, & + 'c-api-objects:host-pinned-body-rejected') + CALL CableDyn_Close(handle, es) END SUBROUTINE case_deck_bodies_rods SUBROUTINE write_capi_object_deck(path, kind) !! kind 1: a submerged free rod between a Fixed anchor and a Coupled fairlead; kind 2: the same !! with a free Rigid6 body; kind 3: a Coupled rod (a 6-DOF host node); kind 4: a Pinned rod - !! (End A on a fixed pin); kind 5: a CoupledPinned rod (its pin a host node). + !! (End A on a fixed pin); kind 5: a CoupledPinned rod (its pin a host node); kind 6: the + !! body of kind 2 as a CoupledPinned body (its reference point a host node). CHARACTER(*), INTENT(IN) :: path INTEGER, INTENT(IN) :: kind INTEGER :: u @@ -685,12 +699,16 @@ SUBROUTINE write_capi_object_deck(path, kind) WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' WRITE (u, '(A)') 'line 0.10 80.0 1.0e5 0.0 0.0 1.0 0.0 1.0 0.0' - IF (kind == 2) THEN + IF (kind == 2 .OR. kind == 6) THEN WRITE (u, '(A)') '--- BODIES ---' WRITE (u, '(A)') 'ID Type X Y Z Rot1 Rot2 Rot3 Mass Vol C33 C44 C55 CdA Ca Ixx Iyy Izz' WRITE (u, '(A)') '(-) (-) (m) (m) (m) (deg) (deg) (deg) (kg) (m3) (N/m) (Nm/rad) (Nm/rad) (m2) (-) '// & '(kgm2) (kgm2) (kgm2)' - WRITE (u, '(A)') '1 Rigid6 0.0 0.0 -4.0 0.0 0.0 0.0 100.0 0.05 0.0 100.0 100.0 0.0 0.0 20.0 20.0 20.0' + IF (kind == 2) THEN + WRITE (u, '(A)') '1 Rigid6 0.0 0.0 -4.0 0.0 0.0 0.0 100.0 0.05 0.0 100.0 100.0 0.0 0.0 20.0 20.0 20.0' + ELSE + WRITE (u, '(A)') '1 CoupledPinned 0.0 0.0 -4.0 0.0 0.0 0.0 100.0 0.05 0.0 0.0 0.0 0.0 0.0 20.0 20.0 20.0' + END IF ELSE WRITE (u, '(A)') '--- ROD TYPES ---' WRITE (u, '(A)') 'Name Diam Mass Cd Ca CdEnd CaEnd' @@ -714,7 +732,7 @@ SUBROUTINE write_capi_object_deck(path, kind) WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' WRITE (u, '(A)') '1 Fixed 2.0 0.0 -5.0 0.0 0.0 0.0 0.0' - IF (kind == 2) THEN + IF (kind == 2 .OR. kind == 6) THEN WRITE (u, '(A)') '2 Body1 0.0 0.0 0.0 0.0 0.0 0.0 0.0' WRITE (u, '(A)') '3 Coupled 0.0 0.0 -1.0 0.0 0.0 0.0 0.0' ELSE @@ -726,7 +744,7 @@ SUBROUTINE write_capi_object_deck(path, kind) WRITE (u, '(A)') 'ID NodeA NodeB Outputs' WRITE (u, '(A)') '(-) (-) (-) (-)' WRITE (u, '(A)') '1 2 1 -' - IF (kind == 2) THEN + IF (kind == 2 .OR. kind == 6) THEN WRITE (u, '(A)') '2 3 2 -' ELSE WRITE (u, '(A)') '2 3 4 -' @@ -734,7 +752,7 @@ SUBROUTINE write_capi_object_deck(path, kind) WRITE (u, '(A)') '--- SECTIONS ---' WRITE (u, '(A)') 'LineID LineType Length NumSegs' WRITE (u, '(A)') '(-) (-) (m) (-)' - IF (kind == 2) THEN + IF (kind == 2 .OR. kind == 6) THEN WRITE (u, '(A)') '1 line 2.5 3' WRITE (u, '(A)') '2 line 2.95 3' ELSE diff --git a/tests/test_openfast_pinned_body.f90 b/tests/test_openfast_pinned_body.f90 new file mode 100644 index 00000000..f7cc9d83 --- /dev/null +++ b/tests/test_openfast_pinned_body.f90 @@ -0,0 +1,1296 @@ +! File: tests/test_openfast_pinned_body.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_openfast_pinned_body + !! CoupledPinned/VesselPinned BODIES on the OpenFAST CompMooring = 5 aggregate (MoorDyn-F's coupled + !! pinned body: the host prescribes the translation of the body reference point and takes its + !! force; the body's rotation about it is integrated). Gates: + !! 1) a dry compound pendulum (CG 2 m below the node, a line attached at the node) whose node is + !! held swings with the period of the complete elliptic integral (1e-3 at dt = T/100), its + !! reference point stays on the node, the node moment is zero and the node force is the + !! analytic pin reaction plus the line force at the node (1e-10 of m g); + !! 2) under a constant node acceleration a it swings about -atan(a/g) with the period of the + !! effective gravity sqrt(g^2 + a^2); + !! 3) a second route: a body with the mass, CG and inertia of a CoupledPinned ROD, carrying the + !! rod's End B line at the same arm, follows the rod (axis, angular velocity and node force) + !! under a harmonic node surge to 1e-9; + !! 4) a body on four symmetric lines whose node heaves does not turn (|omega| <= 1e-12 rad/s) + !! and its node force is the sum of the line forces plus weight, buoyancy and the + !! translational inertia (m + rhoW V Ca) a (1e-10); + !! 5) an output probe returns -m (I_cg/I_p) a_p for a node acceleration a_p (the re-solved + !! rotation) besides the change of the line force at the node, with zero moment; + !! 6) snapshot / step / restore / step is bit-identical, a probe restored as the shell + !! restores it leaves the march bit-identical, and a fresh instance overlaid with the + !! checkpoint state returns the same loads before the next step and continues bit for bit; + !! 7) PtfmInit moves the node and turns the body with the platform, and the static initial + !! condition balances the moment about the node (1e-6); + !! 8) a body held by stiff tethers sub-cycles a coarse coupling step it could not take + !! explicitly and matches a run at the sub-step size; the node orientation and angular + !! rates are ignored; + !! 9) beside a Coupled body (a 6-DOF host node, deck BODY order) the pinned body keeps its own + !! motion: the same as alone to 1e-12; + !! 10) a CoupledPinned body outside a coupled host, without inertia, or under the linearisation + !! probe (coupled_positions) is refused by name. + USE CableDyn_Precision, ONLY: wp + USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK + USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, & + CD_AGG_GetMovingPointMesh, CD_AGG_UpdateStates_Moving, & + CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_Snapshot, CD_AGG_Restore, & + CD_AGG_End, CD_AGG_OK, CD_AGG_HasRigid6, CD_AGG_HasRod, & + CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, & + CD_AGG_Set_Rigid6_States, CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States + USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_Get_System_Line_State, & + CD_Update_System_Line_Interior_State, CD_SYSTEM_OK, CD_System_NSystemCoupledDOF, & + CD_Get_System_CoupledMotion, CD_Update_System_CoupledMotion, CD_Calc_System_CoupledLoads + USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE + IMPLICIT NONE + REAL(wp), PARAMETER :: PI = 3.141592653589793_wp, G = 9.80665_wp, RHO = 1025.0_wp + ! the dry compound pendulum: mass MB, CG HCG below the node at z = ZPIN, Iyy about the CG + REAL(wp), PARAMETER :: MB = 1000.0_wp, HCG = 2.0_wp, IYY = 500.0_wp, ZPIN = 20.0_wp + ! the arm of the second route: a 4 m rod, 0.3 m diameter, 75 kg/m, pinned at z = 5 m, 20 deg + REAL(wp), PARAMETER :: LA = 4.0_wp, DA = 0.3_wp, MA = 300.0_wp, ZA = 5.0_wp, THA = 20.0_wp + INTEGER :: nfail + + nfail = 0 + CALL case_pendulum_held() + CALL case_constant_acceleration() + CALL case_rod_second_route() + CALL case_symmetric_heave() + CALL case_probe() + CALL case_state() + CALL case_ptfm_static() + CALL case_substep() + CALL case_mixed_hosts() + CALL case_refusals() + IF (nfail > 0) THEN + WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' + ERROR STOP 1 + END IF + WRITE (*, '(A)') 'PASS: CoupledPinned bodies on the coupled aggregate' + +CONTAINS + + INCLUDE 'nan_max_abs.inc' + + SUBROUTINE require(cond, msg) + LOGICAL, INTENT(IN) :: cond + CHARACTER(*), INTENT(IN) :: msg + IF (.NOT. cond) THEN + WRITE (*, '(A)') 'MISMATCH: '//msg + nfail = nfail + 1 + END IF + END SUBROUTINE require + + ! --------------------------------------------------------------------------------------------- ! + ! decks ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE write_header(u, title) + INTEGER, INTENT(IN) :: u + CHARACTER(*), INTENT(IN) :: title + WRITE (u, '(A)') title + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'line 0.10 80.0 1.0e6 0.0 0.0 1.0 0.0 1.0 0.0' + WRITE (u, '(A)') 'tether 0.05 4.0 2.0e5 0.0 0.0 1.0 0.0 1.0 0.0' + END SUBROUTINE write_header + + SUBROUTINE write_md_body(u, attachment, pos, rot_deg, mass, cg, inertia, vol) + !! A MoorDyn v2 14-column BODIES section with one body (no drag, no added mass). + INTEGER, INTENT(IN) :: u + CHARACTER(*), INTENT(IN) :: attachment + REAL(wp), INTENT(IN) :: pos(3), rot_deg(3), mass, cg(3), inertia(3), vol + WRITE (u, '(A)') '--- BODIES ---' + WRITE (u, '(A)') 'ID Attachment X0 Y0 Z0 r0 p0 y0 Mass CG* I* Volume CdA* Ca*' + WRITE (u, '(A)') '(#) (word) (m) (m) (m) (deg) (deg) (deg) (kg) (m) (kg-m^2) (m^3) (m^2) (-)' + WRITE (u, '(A)') '1 '//attachment//' '//num(pos(1))//' '//num(pos(2))//' '//num(pos(3))//' '// & + num(rot_deg(1))//' '//num(rot_deg(2))//' '//num(rot_deg(3))//' '//num(mass)//' '//bar3(cg)//' '// & + bar3(inertia)//' '//num(vol)//' 0 0' + END SUBROUTINE write_md_body + + FUNCTION num(x) RESULT(s) + !! A real as a token without blanks (14 digits: a bar list of three stays within a deck token). + REAL(wp), INTENT(IN) :: x + CHARACTER(:), ALLOCATABLE :: s + CHARACTER(32) :: buf + WRITE (buf, '(ES20.13)') x + s = TRIM(ADJUSTL(buf)) + END FUNCTION num + + FUNCTION bar3(x) RESULT(s) + !! A MoorDyn bar list x1|x2|x3. + REAL(wp), INTENT(IN) :: x(3) + CHARACTER(:), ALLOCATABLE :: s + s = num(x(1))//'|'//num(x(2))//'|'//num(x(3)) + END FUNCTION bar3 + + SUBROUTINE write_options(u, depth, body_ic, extra) + INTEGER, INTENT(IN) :: u + REAL(wp), INTENT(IN) :: depth + CHARACTER(*), INTENT(IN) :: body_ic + CHARACTER(*), INTENT(IN), OPTIONAL :: extra + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(F8.2,A)') depth, ' WtrDpth' + WRITE (u, '(A)') '1.0e5 kBot' + WRITE (u, '(A)') body_ic//' bodyIC' + IF (PRESENT(extra)) WRITE (u, '(A)') extra + WRITE (u, '(A)') '--- end ---' + END SUBROUTINE write_options + + SUBROUTINE write_pendulum_deck(path, phi_deg, standalone) + !! A dry CoupledPinned body (MB kg, CG HCG below the reference point in the body frame, Iyy + !! about the CG) whose node is at (0, 0, ZPIN), above the water, released with its CG at phi_deg + !! from the downward vertical towards +x (deck pose, bodyIC deck). A line hangs from a Body1 + !! point at the node to a Coupled point: it loads the node, but has no arm about it. + !! standalone adds the dtM/TMax clock of a standalone run. + CHARACTER(*), INTENT(IN) :: path + REAL(wp), INTENT(IN) :: phi_deg + LOGICAL, INTENT(IN), OPTIONAL :: standalone + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + CALL write_header(u, 'CoupledPinned body pendulum on the coupled aggregate') + ! R = Ry(p) carries the body -z axis to (-sin p, 0, -cos p): p = -phi + CALL write_md_body(u, 'CoupledPinned', [0.0_wp, 0.0_wp, ZPIN], [0.0_wp, -phi_deg, 0.0_wp], MB, & + [0.0_wp, 0.0_wp, -HCG], [IYY, IYY, IYY], 0.0_wp) + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Body1 0.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '2 Coupled 4.0 0.0 12.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 line 9.5 6' + IF (PRESENT(standalone)) THEN + CALL write_options(u, 10.0_wp, 'deck', '0.01 dtM'//NEW_LINE('a')//'0.1 TMax') + ELSE + CALL write_options(u, 10.0_wp, 'deck') + END IF + CLOSE (u) + END SUBROUTINE write_pendulum_deck + + SUBROUTINE write_arm_deck(path, as_rod, body_ic) + !! The arm of the second route, pinned at (0, 0, ZA) and hanging at THA from the downward + !! vertical towards +x, above the water: as_rod a CoupledPinned ROD (LA long, DA diameter, MA kg, + !! no drag or added mass), else a CoupledPinned BODY with the rod's mass, its CG at the rod + !! centre and the rod's inertia about it (body x axis along the rod). A slack line runs from + !! End B (the body point at LA along x) to an anchor at (30, 0, -20) and pulls the arm round. + CHARACTER(*), INTENT(IN) :: path, body_ic + LOGICAL, INTENT(IN) :: as_rod + REAL(wp) :: th, xb, zb, r, i1, i2 + INTEGER :: u + th = THA*PI/180.0_wp + xb = LA*SIN(th) + zb = ZA - LA*COS(th) + r = 0.5_wp*DA + i1 = 0.5_wp*MA*r*r + i2 = MA*(3.0_wp*r*r + LA*LA)/12.0_wp + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + CALL write_header(u, 'CoupledPinned arm on the coupled aggregate') + IF (as_rod) THEN + WRITE (u, '(A)') '--- ROD TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass Cd Ca CdEnd CaEnd' + WRITE (u, '(A)') '(-) (m) (kg/m) (-) (-) (-) (-)' + WRITE (u, '(A,ES24.16,1X,ES24.16,A)') 'arm ', DA, MA/LA, ' 0 0 0 0' + WRITE (u, '(A)') '--- RODS ---' + WRITE (u, '(A)') 'ID RodType Type XA YA ZA XB YB ZB NumSegs Outputs' + WRITE (u, '(A)') '(-) (-) (-) (m) (m) (m) (m) (m) (m) (-) (-)' + WRITE (u, '(A,ES24.16,A,ES24.16,A,ES24.16,A)') '1 arm CoupledPinned 0 0 ', ZA, ' ', xb, ' 0 ', zb, ' 4 -' + ELSE + ! R = Ry(p) carries the body x axis to (cos p, 0, -sin p) = (sin th, 0, -cos th): p = 90 - th + CALL write_md_body(u, 'CoupledPinned', [0.0_wp, 0.0_wp, ZA], [0.0_wp, 90.0_wp - THA, 0.0_wp], MA, & + [0.5_wp*LA, 0.0_wp, 0.0_wp], [i1, i2, i2], 0.0_wp) + END IF + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Fixed 30.0 0.0 -20.0 0 0 0 0' + IF (.NOT. as_rod) WRITE (u, '(A,ES24.16,A)') '2 Body1 ', LA, ' 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + IF (as_rod) THEN + WRITE (u, '(A)') '1 R1B 1 -' + ELSE + WRITE (u, '(A)') '1 2 1 -' + END IF + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 line 40.0 20' + CALL write_options(u, 20.0_wp, body_ic) + CLOSE (u) + END SUBROUTINE write_arm_deck + + SUBROUTINE write_symmetric_deck(path) + !! A submerged VesselPinned body (18-column row: 200 kg, 0.1 m^3, Ca 0.5, inertia 50 kg m^2, + !! CG at the reference point) at (0, 0, -5) on four identical lines from (+-3, 0, 0) and + !! (0, +-3, 0) in the body frame to anchors 40 m out on the 50 m seabed. + CHARACTER(*), INTENT(IN) :: path + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + CALL write_header(u, 'symmetric VesselPinned body on the coupled aggregate') + WRITE (u, '(A)') '--- BODIES ---' + WRITE (u, '(A)') 'ID Type X Y Z Rot1 Rot2 Rot3 Mass Vol C33 C44 C55 CdA Ca Ixx Iyy Izz' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (deg) (deg) (deg) (kg) (m3) (N/m) (Nm/rad) (Nm/rad) (m2) (-) '// & + '(kgm2) (kgm2) (kgm2)' + WRITE (u, '(A)') '1 VesselPinned 0.0 0.0 -5.0 0.0 0.0 0.0 200.0 0.1 0.0 0.0 0.0 0.0 0.5 50.0 50.0 50.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Body1 3.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '2 Body1 -3.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '3 Body1 0.0 3.0 0.0 0 0 0 0' + WRITE (u, '(A)') '4 Body1 0.0 -3.0 0.0 0 0 0 0' + WRITE (u, '(A)') '5 Fixed 40.0 0.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '6 Fixed -40.0 0.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '7 Fixed 0.0 40.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '8 Fixed 0.0 -40.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 5 -' + WRITE (u, '(A)') '2 2 6 -' + WRITE (u, '(A)') '3 3 7 -' + WRITE (u, '(A)') '4 4 8 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 line 62.0 12' + WRITE (u, '(A)') '2 line 62.0 12' + WRITE (u, '(A)') '3 line 62.0 12' + WRITE (u, '(A)') '4 line 62.0 12' + CALL write_options(u, 50.0_wp, 'deck') + CLOSE (u) + END SUBROUTINE write_symmetric_deck + + SUBROUTINE write_tethered_deck(path, body_ic) + !! A submerged CoupledPinned body (100 kg, 0.0628 m^3, inertia 10 kg m^2, CG 1 m below the + !! reference point) at (0, 0, -10), held at its Body1 point 2 m below the node by two horizontal + !! tethers to anchors at x = +-10 m (EA 2e5 N, 0.5 % pretension): the rotation about y meets + !! their axial stiffness, a mode of about 38 rad/s. body_ic: the bodyIC option. + CHARACTER(*), INTENT(IN) :: path, body_ic + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + CALL write_header(u, 'tethered CoupledPinned body on the coupled aggregate') + CALL write_md_body(u, 'CoupledPinned', [0.0_wp, 0.0_wp, -10.0_wp], [0.0_wp, 0.0_wp, 0.0_wp], 100.0_wp, & + [0.0_wp, 0.0_wp, -1.0_wp], [10.0_wp, 10.0_wp, 10.0_wp], 0.0628_wp) + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Body1 0.0 0.0 -2.0 0 0 0 0' + WRITE (u, '(A)') '2 Fixed 10.0 0.0 -12.0 0 0 0 0' + WRITE (u, '(A)') '3 Fixed -10.0 0.0 -12.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '2 1 3 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 tether 9.95 10' + WRITE (u, '(A)') '2 tether 9.95 10' + CALL write_options(u, 20.0_wp, body_ic) + CLOSE (u) + END SUBROUTINE write_tethered_deck + + ! --------------------------------------------------------------------------------------------- ! + ! helpers ! + ! --------------------------------------------------------------------------------------------- ! + + REAL(wp) FUNCTION body_angle(s) RESULT(th) + !! Angle of the pendulum's CG direction (the body -z axis) from the downward vertical, + !! positive towards +x: atan2(-R13, R33) for the mirror s (R column-major at 16:24). + REAL(wp), INTENT(IN) :: s(:) + th = ATAN2(-s(22), s(24)) + END FUNCTION body_angle + + REAL(wp) FUNCTION ellip_k(k) RESULT(kk) + !! Complete elliptic integral of the first kind by the arithmetic-geometric mean. + REAL(wp), INTENT(IN) :: k + REAL(wp) :: a, b, c + INTEGER :: i + a = 1.0_wp + b = SQRT(1.0_wp - k*k) + DO i = 1, 30 + c = 0.5_wp*(a + b) + b = SQRT(a*b) + a = c + END DO + kk = PI/(2.0_wp*a) + END FUNCTION ellip_k + + SUBROUTINE crossings(t, x, xm, period, mean) + !! Mean period between the up-crossings of x through xm and the mean of x over those whole + !! periods (trapezoidal); period = -1 with fewer than three crossings. + REAL(wp), INTENT(IN) :: t(:), x(:), xm + REAL(wp), INTENT(OUT) :: period, mean + REAL(wp) :: tc, t0, t1, area + INTEGER :: i, n, i0, i1 + n = 0 + t0 = 0.0_wp + t1 = 0.0_wp + i0 = 0 + i1 = 0 + DO i = 1, SIZE(x) - 1 + IF (x(i) - xm < 0.0_wp .AND. x(i + 1) - xm >= 0.0_wp) THEN + tc = t(i) + (xm - x(i))*(t(i + 1) - t(i))/(x(i + 1) - x(i)) + IF (n == 0) THEN + t0 = tc + i0 = i + END IF + t1 = tc + i1 = i + n = n + 1 + END IF + END DO + period = -1.0_wp + mean = 0.0_wp + IF (n < 3) RETURN + period = (t1 - t0)/REAL(n - 1, wp) + area = 0.5_wp*(xm + x(i0 + 1))*(t(i0 + 1) - t0) + 0.5_wp*(x(i1) + xm)*(t1 - t(i1)) + DO i = i0 + 1, i1 - 1 + area = area + 0.5_wp*(x(i) + x(i + 1))*(t(i + 1) - t(i)) + END DO + mean = area/(t1 - t0) + END SUBROUTINE crossings + + FUNCTION solve3(a, b) RESULT(x) + !! x = a^-1 b by Cramer's rule (a 3x3, well conditioned here). + REAL(wp), INTENT(IN) :: a(3, 3), b(3) + REAL(wp) :: x(3), d, c(3, 3) + INTEGER :: k + d = det3(a) + DO k = 1, 3 + c = a + c(:, k) = b + x(k) = det3(c)/d + END DO + END FUNCTION solve3 + + PURE REAL(wp) FUNCTION det3(m) RESULT(d) + REAL(wp), INTENT(IN) :: m(3, 3) + d = m(1, 1)*(m(2, 2)*m(3, 3) - m(2, 3)*m(3, 2)) - m(1, 2)*(m(2, 1)*m(3, 3) - m(2, 3)*m(3, 1)) + & + m(1, 3)*(m(2, 1)*m(3, 2) - m(2, 2)*m(3, 1)) + END FUNCTION det3 + + PURE FUNCTION cross(x, y) RESULT(z) + REAL(wp), INTENT(IN) :: x(3), y(3) + REAL(wp) :: z(3) + z = [x(2)*y(3) - x(3)*y(2), x(3)*y(1) - x(1)*y(3), x(1)*y(2) - x(2)*y(1)] + END FUNCTION cross + + PURE FUNCTION skew(a) RESULT(s) + REAL(wp), INTENT(IN) :: a(3) + REAL(wp) :: s(3, 3) + s(1, :) = [0.0_wp, -a(3), a(2)] + s(2, :) = [a(3), 0.0_wp, -a(1)] + s(3, :) = [-a(2), a(1), 0.0_wp] + END FUNCTION skew + + FUNCTION pendulum_reaction(s, a_pin) RESULT(f) + !! The force the dry pendulum body exerts on its node at state s (body mirror) for a node + !! acceleration a_pin: Euler's equation about the node, I_p alpha + w x (I_p w) = c x m (g - a_pin) + !! with I_p = R J R^T - m [c]x [c]x, then f = m g - m (a_pin + alpha x c + w x (w x c)). + REAL(wp), INTENT(IN) :: s(:), a_pin(3) + REAL(wp) :: f(3), rot(3, 3), ip(3, 3), c(3), w(3), alpha(3), gv(3) + INTEGER :: k + rot = RESHAPE(s(16:24), [3, 3]) + ip = 0.0_wp + DO k = 1, 3 + ip(k, k) = IYY + END DO + c = -HCG*rot(:, 3) + ip = MATMUL(rot, MATMUL(ip, TRANSPOSE(rot))) - MB*MATMUL(skew(c), skew(c)) + w = s(10:12) + gv = [0.0_wp, 0.0_wp, -G] + alpha = solve3(ip, cross(c, MB*(gv - a_pin)) - cross(w, MATMUL(ip, w))) + f = MB*gv - MB*(a_pin + cross(alpha, c) + cross(w, cross(w, c))) + END FUNCTION pendulum_reaction + + INTEGER FUNCTION coupled_block(agg, x) RESULT(ib) + !! The coupled 3-DOF block of the line system whose committed position is x (0: none). + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + REAL(wp), INTENT(IN) :: x(3) + REAL(wp), ALLOCATABLE :: q(:), v(:), a(:) + INTEGER :: ncd, k, es + CHARACTER(512) :: em + ncd = CD_System_NSystemCoupledDOF(agg%sys%fast%system) + ALLOCATE (q(ncd), v(ncd), a(ncd)) + CALL CD_Get_System_CoupledMotion(agg%sys%fast%system, q, v, a, es, em) + ib = 0 + DO k = 1, ncd/3 + IF (nan_max_abs(q(3*k - 2:3*k) - x) <= 1.0e-9_wp) ib = k + END DO + END FUNCTION coupled_block + + FUNCTION line_loads(agg) RESULT(l) + !! The line loads on the coupled points of the line system (CD_Calc_System_CoupledLoads). + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + REAL(wp), ALLOCATABLE :: l(:) + INTEGER :: es + CHARACTER(512) :: em + ALLOCATE (l(CD_System_NSystemCoupledDOF(agg%sys%fast%system))) + CALL CD_Calc_System_CoupledLoads(agg%sys%fast%system, l, es, em) + CALL require(es == CD_SYSTEM_OK, 'line loads: '//TRIM(em)) + END FUNCTION line_loads + + SUBROUTINE march(agg, dt, nstep, host, ang, t, ok, force, states) + !! March nstep coupling steps with every moving column translated rigidly by host(t) = + !! [displacement, velocity, acceleration] from its initial position; ang(0:nstep) the pendulum + !! angle (body_angle), t the times. Before the first step the host kinematics at t = 0 are + !! transferred (the start of the run, as the coupled shell does). force: the node force (the + !! last column) after each step; states: the body mirror after each step. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + REAL(wp), INTENT(IN) :: dt + INTEGER, INTENT(IN) :: nstep + INTERFACE + FUNCTION host(time) RESULT(k) + IMPORT :: wp + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9) + END FUNCTION host + END INTERFACE + REAL(wp), INTENT(OUT) :: ang(0:nstep), t(0:nstep) + LOGICAL, INTENT(OUT) :: ok + REAL(wp), INTENT(OUT), OPTIONAL :: force(3, 0:nstep), states(24, 0:nstep) + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), p0(:, :), s(:) + INTEGER :: n, es, it, step + LOGICAL :: cv, st + CHARACTER(512) :: em + + ok = .FALSE. + n = CD_AGG_NMovingPoints(agg, es, em) + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), p0(3, n), s(CD_AGG_Rigid6_MirrorSize(agg))) + CALL CD_AGG_GetMovingPointMesh(agg, p0, v, a, f, es, em) + DO step = 0, nstep + t(step) = REAL(step, wp)*dt + CALL host_columns(host(t(step)), p0, p, v, a) + IF (step == 0) THEN + CALL CD_AGG_UpdateStates_Moving(agg, p, v, a, es, em) + CALL require(es == CD_AGG_OK, 'march:start-transfer: '//TRIM(em)) + ELSE + CALL CD_AGG_Step_Moving(agg, dt, p, v, a, cv, st, it, es, em, t_committed=t(step)) + CALL require(es == CD_AGG_OK .AND. cv, 'march:step: '//TRIM(em)) + END IF + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Get_Rigid6_States(agg, s, es, em) + ang(step) = body_angle(s) + IF (PRESENT(states)) states(:, step) = s + IF (PRESENT(force)) THEN + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em) + force(:, step) = f(:, n) + END IF + END DO + ok = ALL(IEEE_IS_FINITE(ang)) + END SUBROUTINE march + + SUBROUTINE host_columns(k, p0, p, v, a) + !! Every moving column translated rigidly by k = [displacement, velocity, acceleration]. + REAL(wp), INTENT(IN) :: k(9), p0(:, :) + REAL(wp), INTENT(OUT) :: p(:, :), v(:, :), a(:, :) + INTEGER :: i + DO i = 1, SIZE(p0, 2) + p(:, i) = p0(:, i) + k(1:3) + v(:, i) = k(4:6) + a(:, i) = k(7:9) + END DO + END SUBROUTINE host_columns + + FUNCTION host_rest(time) RESULT(k) + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9) + k = 0.0_wp*time + END FUNCTION host_rest + + FUNCTION host_const(time) RESULT(k) + !! The node accelerating uniformly along +x from rest: a = 2 m/s^2. + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9) + REAL(wp), PARAMETER :: AX = 2.0_wp + k = 0.0_wp + k(1) = 0.5_wp*AX*time*time + k(4) = AX*time + k(7) = AX + END FUNCTION host_const + + FUNCTION host_surge(time) RESULT(k) + !! x_p = X (1 - cos W t), X = 0.2 m, a 5 s period. + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9), w + REAL(wp), PARAMETER :: X = 0.2_wp + w = 2.0_wp*PI/5.0_wp + k = 0.0_wp + k(1) = X*(1.0_wp - COS(w*time)) + k(4) = X*w*SIN(w*time) + k(7) = X*w*w*COS(w*time) + END FUNCTION host_surge + + FUNCTION host_heave(time) RESULT(k) + !! z_p = Z sin W t, Z = 0.5 m, a 6 s period. + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9), w + REAL(wp), PARAMETER :: Z = 0.5_wp + w = 2.0_wp*PI/6.0_wp + k = 0.0_wp + k(3) = Z*SIN(w*time) + k(6) = Z*w*COS(w*time) + k(9) = -Z*w*w*SIN(w*time) + END FUNCTION host_heave + + FUNCTION host_drift(time) RESULT(k) + !! The node drifting along +x at a constant 0.05 m/s from t = 0. + REAL(wp), INTENT(IN) :: time + REAL(wp) :: k(9) + k = 0.0_wp + k(1) = 0.05_wp*time + k(4) = 0.05_wp + END FUNCTION host_drift + + ! --------------------------------------------------------------------------------------------- ! + ! 1: the held compound pendulum ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_pendulum_held() + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), PARAMETER :: TH0 = 30.0_wp + INTEGER, PARAMETER :: NSTEP = 500 + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), mo(:, :), p0(:, :), l(:) + REAL(wp) :: ang(0:NSTEP), t(0:NSTEP), s(24), ip, t_ref, dt, period, mean, err_pin, err_force, fref(3) + INTEGER :: es, n, step, it, ib + LOGICAL :: cv, st + CHARACTER(512) :: em + + ip = IYY + MB*HCG*HCG + t_ref = 4.0_wp*SQRT(ip/(MB*G*HCG))*ellip_k(SIN(0.5_wp*TH0*PI/180.0_wp)) + dt = t_ref/100.0_wp + CALL write_pendulum_deck('pinbody_pendulum.dat', TH0) + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_pendulum.dat', dt, es, em) + CALL require(es == CD_AGG_OK, 'pendulum:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(agg, es, em) + CALL require(CD_AGG_HasRigid6(agg) .AND. n == 2, 'pendulum:one host node for the body after the fairlead') + IF (n /= 2) RETURN + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), mo(3, n), p0(3, n)) + CALL CD_AGG_GetMovingPointMesh(agg, p0, v, a, f, es, em) + CALL require(nan_max_abs(p0(:, 2) - [0.0_wp, 0.0_wp, ZPIN]) <= 0.0_wp, 'pendulum:host node at the reference point') + ib = coupled_block(agg, [0.0_wp, 0.0_wp, ZPIN]) + CALL require(ib > 0, 'pendulum:the node line end is a coupled point') + IF (ib == 0) RETURN + p = p0 + v = 0.0_wp + a = 0.0_wp + err_pin = 0.0_wp + err_force = 0.0_wp + DO step = 0, NSTEP + IF (step > 0) THEN + CALL CD_AGG_Step_Moving(agg, dt, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*dt) + CALL require(es == CD_AGG_OK .AND. cv, 'pendulum:step: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + END IF + CALL CD_AGG_Get_Rigid6_States(agg, s, es, em) + t(step) = REAL(step, wp)*dt + ang(step) = body_angle(s) + err_pin = MAX(err_pin, nan_max_abs(s(1:3) - [0.0_wp, 0.0_wp, ZPIN]), nan_max_abs(s(4:9))) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em, moment=mo) + CALL require(es == CD_AGG_OK, 'pendulum:mesh: '//TRIM(em)) + CALL require(nan_max_abs(mo(:, 2)) <= 0.0_wp, 'pendulum:node moment is zero') + l = line_loads(agg) + fref = pendulum_reaction(s, [0.0_wp, 0.0_wp, 0.0_wp]) + l(3*ib - 2:3*ib) + err_force = MAX(err_force, nan_max_abs(f(:, 2) - fref)/(MB*G)) + p = p0 + v = 0.0_wp + a = 0.0_wp + END DO + CALL crossings(t, ang, 0.0_wp, period, mean) + WRITE (*, '(A,2F12.6,A,ES10.3)') 'CoupledPinned body pendulum period got/analytic [s]: ', period, t_ref, & + '; rel. error ', ABS(period - t_ref)/t_ref + WRITE (*, '(A,ES10.3,A,ES10.3)') 'max |reference point motion off the held node| ', err_pin, & + '; node force vs pin reaction + line force / mg ', err_force + CALL require(ABS(period - t_ref) <= 1.0e-3_wp*t_ref, 'pendulum:period (elliptic integral)') + CALL require(err_pin <= 0.0_wp, 'pendulum:the reference point stays on the held node') + CALL require(err_force <= 1.0e-10_wp, 'pendulum:node force is the pin reaction plus the line force') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_pendulum_held + + ! --------------------------------------------------------------------------------------------- ! + ! 2: constant node acceleration ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_constant_acceleration() + !! In the frame of a node accelerating at a along x the body is a pendulum in the effective + !! gravity (-a, 0, -g): it swings about phi_eq = -atan(a/g) (trailing) with the period + !! 4 sqrt(I_p/(m h g_eff)) K(sin(delta/2)), g_eff = sqrt(g^2 + a^2), for an amplitude delta. + !! The line at the node moves with it (its Coupled end takes the same translation). + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), PARAMETER :: AX = 2.0_wp, DELTA = 5.0_wp + INTEGER, PARAMETER :: NSTEP = 500 + REAL(wp) :: ang(0:NSTEP), t(0:NSTEP), ip, th_eq, geff, t_ref, dt, period, mean + INTEGER :: es + LOGICAL :: ok + CHARACTER(512) :: em + + th_eq = -ATAN(AX/G) + geff = SQRT(G*G + AX*AX) + ip = IYY + MB*HCG*HCG + t_ref = 4.0_wp*SQRT(ip/(MB*geff*HCG))*ellip_k(SIN(0.5_wp*DELTA*PI/180.0_wp)) + dt = t_ref/100.0_wp + CALL write_pendulum_deck('pinbody_accel.dat', th_eq*180.0_wp/PI + DELTA) + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_accel.dat', dt, es, em) + CALL require(es == CD_AGG_OK, 'accel:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL march(agg, dt, NSTEP, host_const, ang, t, ok) + CALL require(ok, 'accel:march finite') + IF (.NOT. ok) RETURN + CALL crossings(t, ang, th_eq, period, mean) + WRITE (*, '(A,2F12.6,A,2F10.6)') 'constant node acceleration: period got/analytic [s] ', period, t_ref, & + '; mean angle got/-atan(a/g) [rad] ', mean, th_eq + CALL require(ABS(period - t_ref) <= 1.0e-3_wp*t_ref, 'accel:period with g_eff') + CALL require(ABS(mean - th_eq) <= 1.0e-4_wp, 'accel:mean angle -atan(a/g)') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_constant_acceleration + + ! --------------------------------------------------------------------------------------------- ! + ! 3: the second route, a CoupledPinned rod ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_rod_second_route() + !! The body with the rod's mass, CG and inertia, its line at the rod's End B, follows the + !! CoupledPinned rod (an independent route: the rod's pinned solve about End A with its mass at + !! the centre, against the body's CG coupling blocks about its reference point) under a + !! harmonic node surge: same axis, angular velocity and node force to 1e-9. + TYPE(CD_AGG_ModuleType) :: rod, body + REAL(wp), PARAMETER :: DT = 0.01_wp + INTEGER, PARAMETER :: NSTEP = 600 + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), p0(:, :), pr0(:, :), fr(:, :) + REAL(wp) :: sr(24), sb(24), k(9), err_axis, err_w, err_f, famp, wamp, turn + INTEGER :: es, n, nr, step, it + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_arm_deck('pinbody_arm_rod.dat', .TRUE., 'deck') + CALL write_arm_deck('pinbody_arm_body.dat', .FALSE., 'deck') + CALL CD_AGG_Init_From_Deck(rod, 'pinbody_arm_rod.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'route:rod init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Init_From_Deck(body, 'pinbody_arm_body.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'route:body init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL require(CD_AGG_HasRod(rod) .AND. CD_AGG_HasRigid6(body), 'route:a rod deck and a body deck') + n = CD_AGG_NMovingPoints(body, es, em) + nr = CD_AGG_NMovingPoints(rod, es, em) + CALL require(n == 1 .AND. nr == 1, 'route:one host node each') + IF (n /= 1 .OR. nr /= 1) RETURN + ALLOCATE (p(3, 1), v(3, 1), a(3, 1), f(3, 1), p0(3, 1), pr0(3, 1), fr(3, 1)) + CALL CD_AGG_GetMovingPointMesh(body, p0, v, a, f, es, em) + CALL CD_AGG_GetMovingPointMesh(rod, pr0, v, a, fr, es, em) + CALL require(nan_max_abs(p0 - pr0) <= 1.0e-14_wp, 'route:the same node') + err_axis = 0.0_wp + err_w = 0.0_wp + err_f = 0.0_wp + famp = 0.0_wp + wamp = 0.0_wp + turn = 0.0_wp + DO step = 0, NSTEP + k = host_surge(REAL(step, wp)*DT) + CALL host_columns(k, p0, p, v, a) + IF (step == 0) THEN + CALL CD_AGG_UpdateStates_Moving(body, p, v, a, es, em) + CALL CD_AGG_UpdateStates_Moving(rod, p, v, a, es, em) + ELSE + CALL CD_AGG_Step_Moving(body, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK .AND. cv, 'route:body step: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Step_Moving(rod, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK .AND. cv, 'route:rod step: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + END IF + CALL CD_AGG_Get_Rigid6_States(body, sb, es, em) + CALL CD_AGG_Get_Rod_States(rod, sr, es, em) + CALL CD_AGG_CalcOutput(body, es, em) + CALL CD_AGG_GetMovingPointMesh(body, p, v, a, f, es, em) + CALL CD_AGG_CalcOutput(rod, es, em) + CALL CD_AGG_GetMovingPointMesh(rod, p, v, a, fr, es, em) + err_axis = MAX(err_axis, nan_max_abs(sb(16:18) - sr(16:18))) + err_w = MAX(err_w, nan_max_abs(sb(10:12) - sr(10:12))) + err_f = MAX(err_f, nan_max_abs(f(:, 1) - fr(:, 1))) + famp = MAX(famp, nan_max_abs(fr(:, 1))) + wamp = MAX(wamp, nan_max_abs(sr(10:12))) + turn = MAX(turn, ABS(ATAN2(sr(16), -sr(18)) - THA*PI/180.0_wp)) + END DO + WRITE (*, '(A,ES10.3,A,ES10.3,A,ES10.3,A,ES10.3,A,F8.4,A)') 'body vs CoupledPinned rod: axis ', err_axis, & + '; omega ', err_w, ' of ', wamp, ' rad/s; node force ', err_f/famp, ' rel. (arm turned ', turn, ' rad)' + CALL require(turn > 0.05_wp, 'route:the line and the surge turn the arm') + CALL require(err_axis <= 1.0e-9_wp .AND. err_w <= 1.0e-9_wp*wamp .AND. err_f <= 1.0e-9_wp*famp, & + 'route:the body follows the CoupledPinned rod') + CALL CD_AGG_End(rod, es, em) + CALL CD_AGG_End(body, es, em) + END SUBROUTINE case_rod_second_route + + ! --------------------------------------------------------------------------------------------- ! + ! 4: symmetric mooring under heave ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_symmetric_heave() + !! Four identical lines at 90 deg about a body with its CG at the node: a heaving node gives + !! no moment, so the body keeps its pose (|omega| and the turn below 1e-12), and the node force + !! is the line force sum plus the net weight and the translational inertia, rhoW g V - m g + !! along z less (m + rhoW V Ca) a. + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), PARAMETER :: DT = 0.02_wp, M = 200.0_wp, VOL = 0.1_wp, CA = 0.5_wp + INTEGER, PARAMETER :: NSTEP = 300 + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), mo(:, :), p0(:, :), l(:) + REAL(wp) :: s(24), k(9), fref(3), err_w, err_turn, err_f, famp, lamp + INTEGER :: es, n, step, it, ip, ib(4) + REAL(wp), PARAMETER :: ARMS(3, 4) = RESHAPE([3.0_wp, 0.0_wp, 0.0_wp, -3.0_wp, 0.0_wp, 0.0_wp, & + 0.0_wp, 3.0_wp, 0.0_wp, 0.0_wp, -3.0_wp, 0.0_wp], [3, 4]) + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_symmetric_deck('pinbody_sym.dat') + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_sym.dat', DT, es, em, external_fluid=.TRUE.) + CALL require(es == CD_AGG_OK, 'sym:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(agg, es, em) + CALL require(n == 1, 'sym:one host node (the VesselPinned body)') + IF (n /= 1) RETURN + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), mo(3, n), p0(3, n)) + CALL CD_AGG_GetMovingPointMesh(agg, p0, v, a, f, es, em) + err_w = 0.0_wp + err_turn = 0.0_wp + err_f = 0.0_wp + famp = 0.0_wp + lamp = 0.0_wp + DO step = 0, NSTEP + k = host_heave(REAL(step, wp)*DT) + CALL host_columns(k, p0, p, v, a) + IF (step == 0) THEN + CALL CD_AGG_UpdateStates_Moving(agg, p, v, a, es, em) + ELSE + CALL CD_AGG_Step_Moving(agg, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK .AND. cv, 'sym:step: '//TRIM(em)) + END IF + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Get_Rigid6_States(agg, s, es, em) + err_w = MAX(err_w, nan_max_abs(s(10:12))) + err_turn = MAX(err_turn, nan_max_abs(s(16:24) - [1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 0.0_wp, & + 0.0_wp, 0.0_wp, 1.0_wp])) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em, moment=mo) + l = line_loads(agg) + fref = [0.0_wp, 0.0_wp, (RHO*VOL - M)*G] - (M + RHO*VOL*CA)*k(7:9) + DO ip = 1, 4 + IF (step == 0) THEN + ib(ip) = coupled_block(agg, p0(:, 1) + ARMS(:, ip)) + CALL require(ib(ip) > 0, 'sym:the line ends are coupled points') + IF (ib(ip) == 0) RETURN + END IF + fref = fref + l(3*ib(ip) - 2:3*ib(ip)) + lamp = MAX(lamp, nan_max_abs(l(3*ib(ip) - 2:3*ib(ip)))) + END DO + err_f = MAX(err_f, nan_max_abs(f(:, 1) - fref)) + famp = MAX(famp, nan_max_abs(f(:, 1))) + CALL require(nan_max_abs(mo(:, 1)) <= 0.0_wp, 'sym:zero node moment') + END DO + WRITE (*, '(A,ES10.3,A,ES10.3,A,ES10.3,A,ES10.3,A)') 'symmetric heave: max |omega| ', err_w, & + ' rad/s, max |R - I| ', err_turn, '; |node force - (line sum + weight, buoyancy, inertia)| ', & + err_f/famp, ' rel. (line force ', lamp, ' N)' + CALL require(err_w <= 1.0e-12_wp .AND. err_turn <= 1.0e-12_wp, 'sym:the body does not turn') + CALL require(err_f <= 1.0e-10_wp*famp, 'sym:node force is the line sum plus the body load') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_symmetric_heave + + ! --------------------------------------------------------------------------------------------- ! + ! 5: the output probe ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_probe() + !! On the hanging dry pendulum at rest, a probe node acceleration a_p along x returns the rest + !! force plus -M_eff a_p, M_eff = m I_cg/I_p (the rotation re-solved at a_p; the committed + !! angular acceleration would give -m a_p), besides the change of the line force at the node. + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), f0(:, :), mo(:, :), p0(:, :), l0(:), l1(:) + REAL(wp) :: ap, ip, df, dl + INTEGER :: es, n, ib + CHARACTER(512) :: em + + CALL write_pendulum_deck('pinbody_probe.dat', 0.0_wp) + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_probe.dat', 0.01_wp, es, em) + CALL require(es == CD_AGG_OK, 'probe:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(agg, es, em) + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), f0(3, n), mo(3, n), p0(3, n)) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p0, v, a, f0, es, em) + ib = coupled_block(agg, p0(:, n)) + l0 = line_loads(agg) + ap = 1.5_wp + p = p0 + v = 0.0_wp + a = 0.0_wp + a(1, n) = ap + CALL CD_AGG_UpdateStates_Moving(agg, p, v, a, es, em, output_probe=.TRUE.) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em, moment=mo) + l1 = line_loads(agg) + ip = IYY + MB*HCG*HCG + df = f(1, n) - f0(1, n) + dl = l1(3*ib - 2) - l0(3*ib - 2) + WRITE (*, '(A,F11.4,A,F11.4,A,F11.4,A,F11.4)') 'probe node acceleration: dF_x got ', df, ' N (line ', dl, & + ' N); body part ', df - dl, ' N; -m (I_cg/I_p) a_p ', -MB*IYY/ip*ap + CALL require(ib > 0 .AND. ABS(dl) > 1.0_wp, 'probe:the node line carries the node acceleration') + CALL require(ABS(df - dl + MB*IYY/ip*ap) <= 1.0e-10_wp*MB*G, 'probe:-M_eff a_p (re-solved rotation)') + CALL require(nan_max_abs(f(2:3, n) - f0(2:3, n) - (l1(3*ib - 1:3*ib) - l0(3*ib - 1:3*ib))) <= 1.0e-10_wp*MB*G & + .AND. nan_max_abs(mo(:, n)) <= 0.0_wp, 'probe:no other force change, zero moment') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_probe + + ! --------------------------------------------------------------------------------------------- ! + ! 6: snapshot / restore, probe restore and the restart overlay ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE overlay_state(src, dst, p, v, a, so, sw, sal) + !! What the coupled shell restores, src -> dst: the host kinematics, the line interiors, the + !! body states and finally the committed line-end motion. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: src, dst + REAL(wp), INTENT(IN) :: p(:, :), v(:, :), a(:, :) + REAL(wp), INTENT(IN), OPTIONAL :: so(:, :, :), sw(:, :), sal(:, :) + REAL(wp), ALLOCATABLE :: lq(:), lv(:), la(:), bs(:), cq(:), cvv(:), ca(:) + INTEGER :: es, nl, il, ndof, ncd + CHARACTER(512) :: em + IF (PRESENT(so)) THEN + CALL CD_AGG_UpdateStates_Moving(dst, p, v, a, es, em, output_probe=.TRUE., orientation=so, & + angular_velocity=sw, angular_acceleration=sal) + ELSE + CALL CD_AGG_UpdateStates_Moving(dst, p, v, a, es, em) + END IF + CALL require(es == CD_AGG_OK, 'overlay:host: '//TRIM(em)) + nl = CD_System_NLines(src%sys%fast%system, es, em) + DO il = 1, nl + ndof = CD_System_Line_NDOF(src%sys%fast%system, il, es, em) + ALLOCATE (lq(ndof), lv(ndof), la(ndof)) + CALL CD_Get_System_Line_State(src%sys%fast%system, il, lq, lv, la, es, em) + CALL CD_Update_System_Line_Interior_State(dst%sys%fast%system, il, lq(4:ndof - 3), lv(4:ndof - 3), es, em, & + a_interior=la(4:ndof - 3)) + CALL require(es == CD_SYSTEM_OK, 'overlay:interior: '//TRIM(em)) + DEALLOCATE (lq, lv, la) + END DO + ALLOCATE (bs(CD_AGG_Rigid6_MirrorSize(src))) + CALL CD_AGG_Get_Rigid6_States(src, bs, es, em) + CALL CD_AGG_Set_Rigid6_States(dst, bs, es, em) + CALL require(es == CD_AGG_OK, 'overlay:body states: '//TRIM(em)) + ncd = CD_System_NSystemCoupledDOF(src%sys%fast%system) + ALLOCATE (cq(ncd), cvv(ncd), ca(ncd)) + CALL CD_Get_System_CoupledMotion(src%sys%fast%system, cq, cvv, ca, es, em) + CALL CD_Update_System_CoupledMotion(dst%sys%fast%system, cq, cvv, ca, es, em) + CALL require(es == CD_SYSTEM_OK, 'overlay:coupled motion: '//TRIM(em)) + END SUBROUTINE overlay_state + + SUBROUTINE case_state() + !! On the arm body under the harmonic surge: snapshot / step / restore / step is bit-identical; + !! a probe (node moved, accelerated) restored as the shell restores it leaves the march + !! bit-identical to a twin that was never probed; a fresh instance overlaid with the checkpoint + !! state returns the same loads before the next step and continues bit for bit. + TYPE(CD_AGG_ModuleType) :: agg, twin, agg_b + REAL(wp), PARAMETER :: DT = 0.02_wp + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), fb(:, :), mo(:, :), mb(:, :), p0(:, :) + REAL(wp), ALLOCATABLE :: sp(:, :), sv(:, :), sa(:, :), so(:, :, :), sw(:, :), sal(:, :) + REAL(wp) :: bs(24), bs2(24), k(9), err + INTEGER :: es, n, step, it + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_arm_deck('pinbody_state.dat', .FALSE., 'deck') + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_state.dat', DT, es, em) + CALL CD_AGG_Init_From_Deck(twin, 'pinbody_state.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'state:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(agg, es, em) + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), fb(3, n), mo(3, n), mb(3, n), p0(3, n)) + ALLOCATE (sp(3, n), sv(3, n), sa(3, n), so(3, 3, n), sw(3, n), sal(3, n)) + CALL CD_AGG_GetMovingPointMesh(agg, p0, v, a, f, es, em) + DO step = 0, 40 + CALL host_columns(host_surge(REAL(step, wp)*DT), p0, p, v, a) + IF (step == 0) THEN + CALL CD_AGG_UpdateStates_Moving(agg, p, v, a, es, em) + CALL CD_AGG_UpdateStates_Moving(twin, p, v, a, es, em) + CYCLE + END IF + CALL CD_AGG_Step_Moving(agg, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL CD_AGG_Step_Moving(twin, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK, 'state:march: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + IF (step /= 20) CYCLE + ! the shell's probe: save the committed host kinematics and the state, probe, restore + CALL CD_AGG_GetMovingPointMesh(agg, sp, sv, sa, f, es, em, orientation=so, angular_velocity=sw, & + angular_acceleration=sal) + CALL CD_AGG_Snapshot(twin, es, em) + p(1, n) = p(1, n) + 0.3_wp + a(1, n) = a(1, n) + 4.0_wp + v(1, n) = v(1, n) - 0.5_wp + CALL CD_AGG_UpdateStates_Moving(agg, p, v, a, es, em, output_probe=.TRUE.) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em, moment=mo) + CALL require(ALL(IEEE_IS_FINITE(f)) .AND. nan_max_abs(mo(:, n)) <= 0.0_wp, 'state:probe force, zero moment') + CALL overlay_state(twin, agg, sp, sv, sa, so, sw, sal) + CALL CD_AGG_Get_Rigid6_States(agg, bs, es, em) + CALL CD_AGG_Get_Rigid6_States(twin, bs2, es, em) + CALL require(nan_max_abs(bs - bs2) <= 0.0_wp, 'state:probe restored the body state') + END DO + CALL CD_AGG_Get_Rigid6_States(agg, bs, es, em) + CALL CD_AGG_Get_Rigid6_States(twin, bs2, es, em) + CALL require(nan_max_abs(bs - bs2) <= 0.0_wp, 'state:probed run equals the twin bit for bit') + ! snapshot -> step A -> restore -> step B reproduces step A + k = host_surge(41.0_wp*DT) + CALL host_columns(k, p0, p, v, a) + CALL CD_AGG_Snapshot(agg, es, em) + CALL CD_AGG_Step_Moving(agg, DT, p, v, a, cv, st, it, es, em, t_committed=41.0_wp*DT) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, sp, sv, sa, fb, es, em, moment=mb) + CALL CD_AGG_Get_Rigid6_States(agg, bs, es, em) + CALL CD_AGG_Restore(agg, es, em) + CALL CD_AGG_Step_Moving(agg, DT, p, v, a, cv, st, it, es, em, t_committed=41.0_wp*DT) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, sp, sv, sa, f, es, em, moment=mo) + CALL CD_AGG_Get_Rigid6_States(agg, bs2, es, em) + CALL require(nan_max_abs(f - fb) <= 0.0_wp .AND. nan_max_abs(mo - mb) <= 0.0_wp .AND. & + nan_max_abs(bs - bs2) <= 0.0_wp, 'state:snapshot-step-restore-step bit-identical') + CALL require(nan_max_abs(mo(:, n)) <= 0.0_wp .AND. nan_max_abs(f(:, n)) > 0.0_wp, 'state:force only at the node') + ! restart: a fresh instance takes the host kinematics, the line interiors and the body states + CALL CD_AGG_Init_From_Deck(agg_b, 'pinbody_state.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'restart:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL overlay_state(agg, agg_b, p, v, a) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, sp, sv, sa, f, es, em, moment=mo) + CALL CD_AGG_CalcOutput(agg_b, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_b, sp, sv, sa, fb, es, em, moment=mb) + WRITE (*, '(A,ES10.3)') 'CoupledPinned body restart overlay: |node force difference| before the next step = ', & + nan_max_abs(f - fb) + CALL require(nan_max_abs(f - fb) <= 0.0_wp .AND. nan_max_abs(mo - mb) <= 0.0_wp, & + 'restart:bit-identical loads of the restored state before the next step') + err = 0.0_wp + DO step = 42, 70 + CALL host_columns(host_surge(REAL(step, wp)*DT), p0, p, v, a) + CALL CD_AGG_Step_Moving(agg, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL CD_AGG_Step_Moving(agg_b, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK, 'restart:march: '//TRIM(em)) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, sp, sv, sa, f, es, em, moment=mo) + CALL CD_AGG_CalcOutput(agg_b, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_b, sp, sv, sa, fb, es, em, moment=mb) + err = MAX(err, nan_max_abs(f - fb), nan_max_abs(mo - mb)) + END DO + CALL CD_AGG_Get_Rigid6_States(agg, bs, es, em) + CALL CD_AGG_Get_Rigid6_States(agg_b, bs2, es, em) + WRITE (*, '(A,ES10.3,A,ES10.3)') 'CoupledPinned body restart overlay: max |load difference| over 29 steps = ', & + err, '; body state ', nan_max_abs(bs - bs2) + CALL require(err <= 0.0_wp .AND. nan_max_abs(bs - bs2) <= 0.0_wp, 'restart:bit-identical continuation') + CALL CD_AGG_End(agg_b, es, em) + CALL CD_AGG_End(agg, es, em) + CALL CD_AGG_End(twin, es, em) + END SUBROUTINE case_state + + ! --------------------------------------------------------------------------------------------- ! + ! 7: PtfmInit and the static initial condition ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_ptfm_static() + !! PtfmInit (surge 1 m, sway 0.5 m, yaw 10 deg) moves the node and turns the tethered body with + !! the platform (deck pose: the body frame is M^T R0); with bodyIC static the body is then + !! turned about the displaced node, held, against the now unequal tethers until the moment + !! about the node of its weight, buoyancy and tethers vanishes. Its CG and both tethers lie on + !! one body axis through the node, so the spin about that axis is neutral. + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), mo(:, :), l(:) + REAL(wp) :: ptfm(6), dcm(3, 3), node(3), s(24), rot(3, 3), mom(3), c(3), arm(3), fsc, tilt + INTEGER :: es, n, ib, ic + CHARACTER(512) :: em + + ptfm = [1.0_wp, 0.5_wp, 0.0_wp, 0.0_wp, 0.0_wp, 10.0_wp*PI/180.0_wp] + dcm = 0.0_wp + dcm(1, 1) = COS(ptfm(6)) + dcm(1, 2) = SIN(ptfm(6)) + dcm(2, 1) = -SIN(ptfm(6)) + dcm(2, 2) = COS(ptfm(6)) + dcm(3, 3) = 1.0_wp + node = ptfm(1:3) + MATMUL(TRANSPOSE(dcm), [0.0_wp, 0.0_wp, -10.0_wp]) + DO ic = 1, 2 + IF (ic == 1) THEN + CALL write_tethered_deck('pinbody_ptfm.dat', 'deck') + ELSE + CALL write_tethered_deck('pinbody_ptfm.dat', 'static') + END IF + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_ptfm.dat', 0.02_wp, es, em, ptfm_init=ptfm) + CALL require(es == CD_AGG_OK, 'ptfm:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(agg, es, em) + IF (.NOT. ALLOCATED(p)) ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), mo(3, n)) + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, p, v, a, f, es, em, moment=mo) + CALL CD_AGG_Get_Rigid6_States(agg, s, es, em) + rot = RESHAPE(s(16:24), [3, 3]) + CALL require(nan_max_abs(p(:, n) - node) <= 1.0e-12_wp .AND. nan_max_abs(s(1:3) - node) <= 1.0e-12_wp, & + 'ptfm:node and reference point at the displaced pin') + IF (ic == 1) THEN + WRITE (*, '(A,ES10.3,A,ES10.3)') 'PtfmInit, deck pose: |node - displaced pin| ', nan_max_abs(p(:, n) - node), & + '; |R - M^T R0| ', nan_max_abs(rot - TRANSPOSE(dcm)) + CALL require(nan_max_abs(rot - TRANSPOSE(dcm)) <= 1.0e-12_wp, 'ptfm:the body turns with the platform') + ELSE + arm = -2.0_wp*rot(:, 3) + c = -1.0_wp*rot(:, 3) + ib = coupled_block(agg, s(1:3) + arm) + CALL require(ib > 0, 'ptfm:the tether end is a coupled point') + IF (ib == 0) RETURN + l = line_loads(agg) + mom = cross(c, [0.0_wp, 0.0_wp, (RHO*0.0628_wp - 100.0_wp)*G]) + cross(arm, l(3*ib - 2:3*ib)) + fsc = 2.0_wp*MAX(100.0_wp*G, nan_max_abs(l(3*ib - 2:3*ib))) + tilt = ACOS(MIN(1.0_wp, rot(3, 3))) + WRITE (*, '(A,F8.4,A,ES10.3,A,ES10.3)') 'PtfmInit + static IC: body tilted ', tilt, & + ' rad; |moment about the node| / (arm max(mg, |f|)) ', nan_max_abs(mom)/fsc, '; |omega| ', & + nan_max_abs(s(10:12)) + CALL require(tilt > 1.0e-3_wp, 'ptfm:the static solve turned the body') + CALL require(nan_max_abs(mom) <= 1.0e-6_wp*fsc, 'ptfm:net moment about the node vanishes') + END IF + CALL require(nan_max_abs(mo(:, n)) <= 0.0_wp, 'ptfm:no node moment') + CALL CD_AGG_End(agg, es, em) + END DO + END SUBROUTINE case_ptfm_static + + ! --------------------------------------------------------------------------------------------- ! + ! 8: sub-stepping and the ignored node rotation ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_substep() + !! The tethered body's stiff mode (about 38 rad/s) makes omega dt about 3.8 at a 0.1 s + !! coupling step, beyond the explicit limit of 2: the march must sub-cycle it. Against a run at + !! the sub-step size, a node drifting at constant velocity (which the linear interpolation of + !! the node motion inside a step represents exactly) gives the same body motion and node force. + !! The node orientation and angular rates do not reach the body. + TYPE(CD_AGG_ModuleType) :: coarse, fine, turned + REAL(wp), PARAMETER :: DTC = 0.1_wp + INTEGER, PARAMETER :: NSUB = 10, NC = 40 + REAL(wp), ALLOCATABLE :: angc(:), tc(:), angf(:), tf(:), fc(:, :), ff(:, :), sc(:, :), sf(:, :) + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), p0(:, :), orr(:, :, :), w(:, :), al(:, :) + REAL(wp) :: err_s, err_f, famp, samp, bs(24), bs2(24), th, err + INTEGER :: es, i, n, step, it + LOGICAL :: ok, cv, st + CHARACTER(512) :: em + + CALL write_tethered_deck('pinbody_tether.dat', 'deck') + ALLOCATE (angc(0:NC), tc(0:NC), angf(0:NC*NSUB), tf(0:NC*NSUB), fc(3, 0:NC), ff(3, 0:NC*NSUB)) + ALLOCATE (sc(24, 0:NC), sf(24, 0:NC*NSUB)) + CALL CD_AGG_Init_From_Deck(coarse, 'pinbody_tether.dat', DTC, es, em) + CALL require(es == CD_AGG_OK, 'substep:coarse-init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Init_From_Deck(fine, 'pinbody_tether.dat', DTC/REAL(NSUB, wp), es, em) + CALL require(es == CD_AGG_OK, 'substep:fine-init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL march(coarse, DTC, NC, host_drift, angc, tc, ok, force=fc, states=sc) + CALL require(ok, 'substep:coarse march finite (the stiff mode is sub-cycled)') + CALL march(fine, DTC/REAL(NSUB, wp), NC*NSUB, host_drift, angf, tf, ok, force=ff, states=sf) + CALL require(ok, 'substep:fine march finite') + IF (.NOT. ok) RETURN + err_s = 0.0_wp + err_f = 0.0_wp + DO i = 0, NC + err_s = MAX(err_s, nan_max_abs(sc(10:24, i) - sf(10:24, NSUB*i))) + err_f = MAX(err_f, nan_max_abs(fc(:, i) - ff(:, NSUB*i))) + END DO + famp = nan_max_abs(ff) + samp = nan_max_abs(sf(10:12, :)) + WRITE (*, '(A,ES10.3,A,ES10.3,A,ES10.3,A,ES10.3)') 'sub-cycled coarse step vs sub-step run: rotation state ', & + err_s, ' (|omega| up to ', samp, '); node force ', err_f, ' of ', famp + CALL require(samp > 1.0e-3_wp, 'substep:the drift turns the body') + CALL require(err_s <= 1.0e-8_wp*MAX(1.0_wp, samp) .AND. err_f <= 1.0e-8_wp*famp, & + 'substep:drifting node: coarse equals fine') + CALL CD_AGG_End(fine, es, em) + CALL CD_AGG_End(coarse, es, em) + + ! the node orientation and angular rates do not reach a CoupledPinned body + CALL CD_AGG_Init_From_Deck(turned, 'pinbody_tether.dat', DTC, es, em) + CALL CD_AGG_Init_From_Deck(fine, 'pinbody_tether.dat', DTC, es, em) + n = CD_AGG_NMovingPoints(turned, es, em) + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), p0(3, n), orr(3, 3, n), w(3, n), al(3, n)) + CALL CD_AGG_GetMovingPointMesh(turned, p0, v, a, f, es, em) + err = 0.0_wp + DO step = 0, 20 + CALL host_columns(host_surge(REAL(step, wp)*DTC), p0, p, v, a) + th = 0.3_wp*SIN(REAL(step, wp)) + orr = 0.0_wp + DO i = 1, n + orr(1, 1, i) = COS(th) + orr(1, 3, i) = -SIN(th) + orr(2, 2, i) = 1.0_wp + orr(3, 1, i) = SIN(th) + orr(3, 3, i) = COS(th) + END DO + w = 0.0_wp + al = 0.0_wp + w(2, :) = 0.3_wp*COS(REAL(step, wp)) + al(2, :) = -0.3_wp*SIN(REAL(step, wp)) + IF (step == 0) THEN + CALL CD_AGG_UpdateStates_Moving(turned, p, v, a, es, em, orientation=orr, angular_velocity=w, & + angular_acceleration=al) + CALL CD_AGG_UpdateStates_Moving(fine, p, v, a, es, em) + ELSE + CALL CD_AGG_Step_Moving(turned, DTC, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DTC, & + orientation=orr, angular_velocity=w, angular_acceleration=al) + CALL require(es == CD_AGG_OK, 'orient:turned step: '//TRIM(em)) + CALL CD_AGG_Step_Moving(fine, DTC, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DTC) + END IF + CALL CD_AGG_Get_Rigid6_States(turned, bs, es, em) + CALL CD_AGG_Get_Rigid6_States(fine, bs2, es, em) + err = MAX(err, nan_max_abs(bs - bs2)) + END DO + CALL require(err <= 0.0_wp, 'orient:node orientation and rates ignored by the pinned body') + CALL CD_AGG_End(turned, es, em) + CALL CD_AGG_End(fine, es, em) + END SUBROUTINE case_substep + + ! --------------------------------------------------------------------------------------------- ! + ! 9: beside a Coupled body ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_mixed_hosts() + !! The pendulum deck with a Coupled body (body 2, at (0, 10, -2), on its own line) added after + !! it: the host nodes follow the deck BODY order (the pinned body's node, then the Coupled + !! body's 6-DOF node), and with every node held the pendulum swings as it does alone (its lines + !! are independent of the Coupled body's) while the Coupled body returns a finite wrench. + TYPE(CD_AGG_ModuleType) :: alone, mixed + REAL(wp), PARAMETER :: DT = 0.01_wp + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), mo(:, :), pa(:, :), fa(:, :) + REAL(wp) :: sa(24), sm(48), err + CHARACTER(512) :: rows(200), line + INTEGER :: es, n, na, step, it, u, ios, nr, i + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_pendulum_deck('pinbody_alone.dat', 25.0_wp) + nr = 0 + OPEN (NEWUNIT=u, FILE='pinbody_alone.dat', STATUS='OLD', ACTION='READ') + DO + READ (u, '(A)', IOSTAT=ios) line + IF (ios /= 0) EXIT + nr = nr + 1 + rows(nr) = line + END DO + CLOSE (u) + OPEN (NEWUNIT=u, FILE='pinbody_mixed.dat', STATUS='REPLACE', ACTION='WRITE') + DO i = 1, nr + WRITE (u, '(A)') TRIM(rows(i)) + IF (INDEX(rows(i), '1 CoupledPinned') == 1) & + WRITE (u, '(A)') '2 Coupled 0.0 10.0 -2.0 0.0 0.0 0.0 200.0 0.0|0.0|0.0 30.0 0.1 0.0 0.0' + IF (INDEX(rows(i), '2 Coupled 4.0') == 1) THEN + WRITE (u, '(A)') '3 Body2 1.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '4 Fixed 8.0 10.0 -8.0 0 0 0 0' + END IF + IF (TRIM(rows(i)) == '1 1 2 -') WRITE (u, '(A)') '2 3 4 -' + IF (TRIM(rows(i)) == '1 line 9.5 6') WRITE (u, '(A)') '2 line 9.5 6' + END DO + CLOSE (u) + CALL CD_AGG_Init_From_Deck(alone, 'pinbody_alone.dat', DT, es, em) + CALL CD_AGG_Init_From_Deck(mixed, 'pinbody_mixed.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'mixed:init: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(mixed, es, em) + na = CD_AGG_NMovingPoints(alone, es, em) + CALL require(n == 3 .AND. na == 2 .AND. CD_AGG_Rigid6_MirrorSize(mixed) == 48, 'mixed:layout') + IF (n /= 3) RETURN + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), mo(3, n), pa(3, na), fa(3, na)) + CALL CD_AGG_GetMovingPointMesh(mixed, p, v, a, f, es, em) + CALL CD_AGG_GetMovingPointMesh(alone, pa, v(:, 1:na), a(:, 1:na), fa, es, em) + CALL require(nan_max_abs(p(:, 2) - [0.0_wp, 0.0_wp, ZPIN]) <= 0.0_wp .AND. & + nan_max_abs(p(:, 3) - [0.0_wp, 10.0_wp, -2.0_wp]) <= 0.0_wp, 'mixed:host nodes in deck BODY order') + v = 0.0_wp + a = 0.0_wp + err = 0.0_wp + DO step = 1, 300 + CALL CD_AGG_Step_Moving(mixed, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK .AND. cv, 'mixed:step: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Step_Moving(alone, DT, pa, v(:, 1:na), a(:, 1:na), cv, st, it, es, em, & + t_committed=REAL(step, wp)*DT) + CALL CD_AGG_Get_Rigid6_States(mixed, sm, es, em) + CALL CD_AGG_Get_Rigid6_States(alone, sa, es, em) + err = MAX(err, nan_max_abs(sm(1:24) - sa)) + END DO + CALL CD_AGG_CalcOutput(mixed, es, em) + CALL CD_AGG_GetMovingPointMesh(mixed, p, v, a, f, es, em, moment=mo) + WRITE (*, '(A,ES10.3,A,ES10.3)') 'beside a Coupled body: pendulum state vs alone ', err, & + '; Coupled body moment ', nan_max_abs(mo(:, 3)) + CALL require(err <= 1.0e-12_wp, 'mixed:the pinned body moves as alone') + CALL require(ALL(IEEE_IS_FINITE(f)) .AND. nan_max_abs(mo(:, 3)) > 0.0_wp .AND. nan_max_abs(mo(:, 2)) <= 0.0_wp, & + 'mixed:a moment at the Coupled node only') + CALL CD_AGG_End(alone, es, em) + CALL CD_AGG_End(mixed, es, em) + END SUBROUTINE case_mixed_hosts + + ! --------------------------------------------------------------------------------------------- ! + ! 10: refusals ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_refusals() + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: cp(3, 2) + INTEGER :: es + LOGICAL :: conv + CHARACTER(1024) :: em + + ! a standalone deck has no host to move the node + CALL write_pendulum_deck('pinbody_standalone.dat', 10.0_wp, standalone=.TRUE.) + CALL CD_Run_Deck_Driver('pinbody_standalone.dat', 'pinbody_standalone', conv, es, em) + CALL require(es /= CD_DECKDRV_OK .AND. INDEX(em, 'CoupledPinned/VesselPinned BODY requires a coupled host') > 0, & + 'refusal:standalone: '//TRIM(em)) + ! the linearisation probe holds every body + CALL write_pendulum_deck('pinbody_probe_pos.dat', 0.0_wp) + cp(:, 1) = [4.0_wp, 0.0_wp, 12.0_wp] + cp(:, 2) = [0.0_wp, 0.0_wp, ZPIN] + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_probe_pos.dat', 0.01_wp, es, em, coupled_positions=cp) + CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'Coupled/Vessel or CoupledPinned BODIES') > 0, & + 'refusal:coupled_positions: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) + ! its rotation is integrated: the inertias must be positive + CALL write_symmetric_deck('pinbody_noinertia.dat') + CALL write_zero_inertia('pinbody_noinertia.dat') + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_noinertia.dat', 0.01_wp, es, em, external_fluid=.TRUE.) + CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'requires Ixx/Iyy/Izz > 0') > 0, 'refusal:inertia: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_refusals + + SUBROUTINE write_zero_inertia(path) + !! The symmetric deck with a 15-column BODIES row (no inertias) for its VesselPinned body. + CHARACTER(*), INTENT(IN) :: path + CHARACTER(512), ALLOCATABLE :: rows(:) + CHARACTER(512) :: line + INTEGER :: u, ios, n, i + ALLOCATE (rows(200)) + n = 0 + OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ') + DO + READ (u, '(A)', IOSTAT=ios) line + IF (ios /= 0) EXIT + n = n + 1 + rows(n) = line + IF (INDEX(line, '1 VesselPinned') == 1) rows(n) = '1 VesselPinned 0.0 0.0 -5.0 0.0 0.0 0.0 200.0 0.1 0.0 0.0 '// & + '0.0 0.0 0.5' + END DO + CLOSE (u) + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + DO i = 1, n + WRITE (u, '(A)') TRIM(rows(i)) + END DO + CLOSE (u) + END SUBROUTINE write_zero_inertia + +END PROGRAM test_openfast_pinned_body From b3a8b959090891a315a895e52a22b43a18bbd1b8 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 18:57:30 +0900 Subject: [PATCH 02/10] fix(bodies): start accelerations through the OpenFAST shell, inertialF In the OpenFAST shell the module restores its state mirror after the output call at t = 0. The restore marked the accelerations of Free Rigid6 bodies and of Free, Pinned and CoupledPinned rods as committed, so their first step started from zero acceleration instead of the solved start acceleration. The aggregate now solves the start accelerations of its bodies and rods when it initialises, and again at a committed step-start transfer before the first step; the line ends on a CoupledPinned object move with the solved acceleration. A new gate runs the shell order (Get/Set of the mirror before the first step) against the direct order for pinned and free bodies and rods; on the previous code the mirrored states of the two orders differed by up to 87 within 1 s; now they are identical. An object in static equilibrium changes at round-off; one released out of balance (bodyIC deck) changes by the first step's velocity error, up to 0.6 m/s for bodies and rods far from balance. Named in CHANGELOG. MoorDyn-F's inertialF option is accepted as 1 (CableDyn always returns the inertia of coupled bodies and rods); 0 and 2 are rejected by name, in the native reader and in DeckFile. inertialF_rampT is parsed and ignored. Docs state the remaining differences from MoorDyn-F's coupled pinned body with inertialF 1 (centripetal force of the structural mass only, wetted buoyancy, consistent end-node inertia of EI = 0 lines) and that MoorDyn-F's driver keeps a coupled pinned body's deck orientation under a PtfmInit rotation, where CableDyn turns it with the platform. The MoorDyn-F comparison in VALIDATION.md is re-run in the shell's order. DeckFile follows the native message order for a pinned body in a deck without dtM, and its docstring notes that the C API rejects the pinned bodies and rods caller_driven accepts. The BODIES Mass row in driver_format.md gives the zero mass coupled bodies accept. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 17 ++- CMakeLists.txt | 3 +- VALIDATION.md | 2 +- doc/driver_format.md | 13 ++- doc/openfast.rst | 9 +- doc/options.rst | 7 ++ doc/theory.rst | 15 ++- python/cabledyn/deck_file.py | 40 ++++++- python/tests/test_deck_file.py | 29 ++++- src/CableDyn_DeckDriver.f90 | 99 ++++++++++++++++- src/CableDyn_OpenFAST_Aggregate.f90 | 65 ++++++++++- tests/test_openfast_pinned_body.f90 | 164 ++++++++++++++++++++++++++-- 12 files changed, 433 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68b6d352..b0b0de70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,8 +31,9 @@ All notable changes to CableDyn are recorded in this file. The format follows less its inertia, with no moment. `PtfmInit` moves and turns the body, `bodyIC static` balances it about its node, and the checkpoint state and correction rewind carry it. A dry compound pendulum keeps the elliptic-integral period to 1.6e-4 at `dt = T/100`, a body with a - `CoupledPinned` rod's mass and inertia follows the rod to 2e-12, and against MoorDyn-F a - pendulum swinging through 120 deg agrees to 0.09 deg (0.15 deg when its node surges). Outside + `CoupledPinned` rod's mass and inertia follows the rod to 2e-12, and against MoorDyn-F + (`inertialF 1`) a pendulum swinging through 120 deg agrees to 0.09 deg (0.15 deg when its node + surges). Outside a coupled host, without inertias, and in linearisation the body fails closed by name. - OpenFAST linearisation with the line dynamics, as MoorDyn-F's: the continuous states are the interior-node positions of every `EI = 0` line (MoorDyn's names and order) and the free @@ -174,6 +175,18 @@ All notable changes to CableDyn are recorded in this file. The format follows ### Fixed +- In OpenFAST, Free Rigid6 bodies and Free, Pinned and CoupledPinned rods started their first + step from zero acceleration: the module restores its state mirror after the output call at + `t = 0`, which marked the objects' accelerations as committed before the start accelerations + were solved. They are now solved when the module initialises (and at a committed step-start + transfer before the first step), and the line ends on a CoupledPinned object move with them. + An object in its static equilibrium changes at round-off (1e-12 m and 1e-6 deg over 10 s); one + started out of balance (`bodyIC deck`) changes by the first step's velocity error, 0.02 m/s and + 0.05 deg for a hanging Pinned rod and up to 0.6 m/s for bodies and rods released far out of + balance. The committed host kinematics at the first step are those of the initial state, so a + host acceleration at `t = 0` enters neither version. +- MoorDyn-F's `inertialF` option was an unknown keyword; `inertialF 1` (CableDyn's behaviour) + is now accepted, and `0` and `2` are rejected by name. - A deck with a WaterKin elevation history (`WaveKinMod 1`) at `TMax = 0`, a check of the static start, reduces the record over its own length instead of failing for want of a positive `TMax`. diff --git a/CMakeLists.txt b/CMakeLists.txt index a8e8a533..ad1463d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1136,7 +1136,8 @@ set_tests_properties(openfast_pinned_rod PROPERTIES LABELS "fortran;dynamic;open # CoupledPinned bodies on the coupled aggregate: the compound-pendulum period and pin reaction of # a held node, a constant node acceleration against closed forms, a CoupledPinned rod of the same # inertia as a second route, a symmetric mooring that does not turn the body, the output probe, -# snapshot/restore and restart, PtfmInit with the static start, sub-cycling, and the refusals. +# snapshot/restore and restart, PtfmInit with the static start, sub-cycling, the OpenFAST shell's +# state-mirror restore before the first step, and the refusals. add_executable(test_openfast_pinned_body tests/test_openfast_pinned_body.f90) target_link_libraries(test_openfast_pinned_body PRIVATE cabledyn_core) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/openfast_pinned_body) diff --git a/VALIDATION.md b/VALIDATION.md index 575dabf8..ffa88d62 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -812,7 +812,7 @@ stop with a named error. | Coupled `Rigid6` bodies + `Point3` buoys | Pass verified | 6-DOF `Rigid6` motion with hydrostatic (`C33`/`C44`/`C55`) restoring, checkpoint state (bit-identical `openfast -restart` of a 13.9 MN-swinging tethered body), and SeaState drag / Froude–Krylov / added mass. `Point3` buoys take buoyancy and drag/added-mass/FK; a submerged volume-only buoy takes FK. Tests: `case_coupled_rigid6`/`_mirror`/`_fluid`, `case_coupled_point3_buoy`/`_fluid` | | Coupled rigid rods | Pass verified | host-driven `RodA/B` endpoints, correction rewind, bit-identical 24-scalar-per-rod checkpoint state, and two Gauss fluid nodes per rod with SeaState drag/Froude–Krylov/added mass; `case_coupled_rod`, `_mirror`, and `_fluid` pass, and the OpenFAST module compiles with rod decks enabled | | Coupled pinned rods (`Pinned`, `CoupledPinned`/`VesselPinned`) | Pass verified | `openfast_pinned_rod` on the aggregate: a dry rod (10 m, 500 kg) released at 30° swings with the elliptic-integral compound-pendulum period to 1.6e-4 at `dt = T/100`, End A on the pin to 0 m; a held `CoupledPinned` node reproduces the `Pinned` rod to round-off (1e-12), returns zero moment, and its force equals the analytic pin reaction to 2.0e-13 of `mg`; a pin accelerating at 2 m/s² gives the mean angle `atan(a/g)` to 1e-6 rad and the period of `sqrt(g² + a²)` to 1.6e-4; a harmonic pin motion follows the linear base-excitation solution to 1.5e-3 / 3.7e-4 of the amplitude at `T0/100` / `T0/200` (ratio 4.03); a 0.1 s step sub-cycled 7 times reproduces a run at the sub-step size to 1e-14 rad and 4e-10 N for a drifting pin; a 1 m `Pinned` rod that carries no line (dry and hanging, or buoyant and upright under water) at a 0.6 s step (`omega0 dt` 2.29 / 3.42, beyond the explicit limit 2) sub-cycles it 6 / 9 times from its own swing stiffness `|W d_g - B d_b|`, equals the run at the sub-step size bit for bit, stays within its release angle and keeps the elliptic-integral period to 6.0e-3 / 5.9e-3 (taken whole, the step turns the rod over); a `CoupledPinned` pin crossing the free surface within one step at constant velocity (a 1 kg/m rod lifted from submerged to dry in 0.1 s, `omega dt` 2.13 wet; a 33 kg/m rod lowered from dry to submerged in 0.6 s, 2.29 dry) takes at least 6 sub-steps from its step-start wetting (more from the waterplane near the surface) and ends within 5e-5 / 3e-4 rad of a run at a sixtieth of the step, where the end-of-step wetting alone gives one sub-step and an angle error of 0.20 / 0.69 rad; on a stiff seabed (`kBot` 1e7 N/m³) a `Pinned` rod whose far end rests on the bed (0.1 s step) and a `Free` rod lying on it (0.05 s step) sub-cycle their contact mode (34–36 and 26 sub-steps), stay at rest on the bed over 5 s (angle change 3.8e-3 / 4e-15 rad, the undamped static settlement) and end within 1.9e-6 / 8e-8 of a run at a tenth of the step, where the sub-steps of the lines and swing alone (1 and 4) throw them off the bed (4.2 rad, 0.8 m); an output probe returns `-m (I_c/I_p) a_p` within 1e-10 of `mg` (not `-m a_p`), and its pin force moves by 2e-11 N when the held end acceleration of the attached tethers changes their end load by 8 N; snapshot/restore, probe restore and restart overlay are bit-identical, the restored state's loads before the next step included; a step without the staged rods (the step-start pin carried by the rod) is bit-identical to the staged one; a `Free` or `Coupled` rod with an end without a line is refused by name; with `PtfmInit` the static start leaves 1.4e-8 N·m about the pin. OpenFAST (IEA-15 UMaine, JONSWAP Hs 6 m, 60 s, `dtM = DT = 0.025 s`) with line 1 hung from a 4 m `CoupledPinned` rod at its fairlead: `openfast -restart` at 30 s reproduces every later OpenFAST output row bit for bit (`NumCrctn` 0 and 1), `NumCrctn = 1` equals `NumCrctn = 0` bit for bit, and surge/heave/pitch statistics stay within 0.2 % / 0.4 % / 1.7 % (mean) of the deck with line 1 on a `Coupled` point | -| Coupled pinned bodies (`CoupledPinned`/`VesselPinned`) | Pass verified | `openfast_pinned_body` on the aggregate: a dry compound pendulum (1000 kg, CG 2 m below the node, released at 30°) swings with the elliptic-integral period to 1.6e-4 at `dt = T/100`, its reference point stays on the held node, and the node force equals the analytic pin reaction plus the line force at the node to 4e-16 of m g; under a 2 m/s² node acceleration it swings about -atan(a/g) (-0.201184 rad) with the effective-gravity period to 1.6e-4; a body with the mass, CG and inertia of a `CoupledPinned` rod and the rod's End B line follows the rod under a harmonic surge (axis 1.5e-13, angular velocity 1.3e-12 of 0.21 rad/s, node force 2.2e-12); on four symmetric lines a heaving body does not turn (omega = 0) and its node force is the line sum plus weight, buoyancy and (m + ρ V Ca) a to 5e-16; an output probe returns -m (I_cg/I_p) a_p besides the line's change; snapshot/restore, a restored probe and a restart overlay are bit-identical; `PtfmInit` with the static start balances the moment about the node to 3e-13; a sub-cycled coarse step equals a run at the sub-step size to 1e-11. Against MoorDyn-F's driver (`inertialF 1`, `TmaxIC 0`) with the line at the node: 0.09° over a 120° swing (node force 1e-3) with the node held, 0.15° over 158° with the node surging 0.5 m (the body part of the node force 1.6e-2; the line force of the jerked slack line differs by up to half its value). With the line pulling at a 4 m arm the swings differ by up to 4.7° of 57° early on; both codes are converged in time step and the difference comes from the lines (CableDyn's initial angular acceleration is 6 % larger: its consistent line mass gives the body an end-node inertia of m l/3 of the end element, less with the interior following, against MoorDyn's lumped m l/2) | +| Coupled pinned bodies (`CoupledPinned`/`VesselPinned`) | Pass verified | `openfast_pinned_body` on the aggregate: a dry compound pendulum (1000 kg, CG 2 m below the node, released at 30°) swings with the elliptic-integral period to 1.6e-4 at `dt = T/100`, its reference point stays on the held node, and the node force equals the analytic pin reaction plus the line force at the node to 4e-16 of m g; under a 2 m/s² node acceleration it swings about -atan(a/g) (-0.201184 rad) with the effective-gravity period to 1.6e-4; a body with the mass, CG and inertia of a `CoupledPinned` rod and the rod's End B line follows the rod under a harmonic surge (axis 1.5e-13, angular velocity 1.3e-12 of 0.21 rad/s, node force 2.2e-12); on four symmetric lines a heaving body does not turn (omega = 0) and its node force is the line sum plus weight, buoyancy and (m + ρ V Ca) a to 5e-16; an output probe returns -m (I_cg/I_p) a_p besides the line's change; snapshot/restore, a restored probe and a restart overlay are bit-identical; `PtfmInit` with the static start balances the moment about the node to 3e-13; a sub-cycled coarse step equals a run at the sub-step size to 1e-11. Against MoorDyn-F's driver (`inertialF 1`, `TmaxIC 0`), CableDyn run in the OpenFAST shell's order (a state-mirror restore after the output call at t = 0), with the line at the node: 0.09° over a 120° swing (node force 1.5e-3) with the node held, 0.15° over 158° with the node surging 0.5 m (the body part of the node force 1.4e-2; the line force of the jerked slack line differs by up to 0.4 of its peak). With the line pulling at a 4 m arm the swings differ by up to 4.7° of 57° early on; both codes are converged in time step and the difference comes from the lines (CableDyn's initial angular acceleration is 6 % larger: its consistent line mass gives the body an end-node inertia of m l/3 of the end element, less with the interior following, against MoorDyn's lumped m l/2) | | Coupled finite-EI touchdown/contact | Pass verified | flat `WtrDpth` and equivalent constant structured bathymetry initialise and step with matching loads; friction and checkpoint restore are tested. The IEA-15 mixed example (its power cable on 248 elements, each at most half the bending length) has 149 grounded nodes and completes a 20 s aggregate trajectory at `dtM=0.025 s` with 2 m surge, 1 m heave, and 0.5 m/s host current, without fallback or stall recovery, at most 12 Newton iterations. A full-turbine run of the same model (one hour after a 200 s transient; TurbSim normal turbulence, 10.6 m/s, 17 % TI; JONSWAP Hs 8 m, Tp 12 s, aligned with the wind and the cable; AeroDyn with the rotor held at 7.55 rpm, no controller, rigid blades and tower; SeaState grid covering the lines) completes without recoveries or non-finite values. The cable's hang-off tension is 11.5 ± 1.1 kN (static 11.9 kN, maximum 17.9 kN). The 149 nodes grounded at the static state stay grounded, joined by one more once the platform has drifted (the touchdown moves 2.5 m toward the platform). The peak curvature is 0.156 1/m at the sag bend, 72 m from the hang-off, and 0.109 1/m at the touchdown. On the former 87-element mesh (10 m elements along the laid section) the peak was 0.160 1/m and the touchdown curvature 0.075 1/m, under-resolved by about 30 %. These curvatures were recorded before the `Curv` channels took the curvature recovered from nodal equilibrium: they are the geometric curvature of the centreline (the larger one-sided trace at a node), which `OutputRecovery element` reproduces. The chain-only twin of the run matches stock MoorDyn over 1200 s to 0.3 % in platform motion and fairlead tension statistics. The anchor tension of the laid cable stays at its static 1.23 kN (maximum 1.24 kN): the seabed friction of the 370 m laid section holds the tension changes at the touchdown. On the former mesh it read 1.39 kN (median) with wave-frequency stick-slip peaks up to 4.1 kN lasting under 1 s, which the resolved mesh does not show, and before the anchor-end correction of this release it locked at about 2.75 kN for the whole run. The run takes 27.1 min of wall time (18.8 min on the former mesh) | | `WaterKin` from file | Pass verified | See [WaterKin and SeaState modes](#waterkin-and-seastate-modes) | | Syrope polyester (`SYROPE:` syntax; [Falkenberg et al., 2017](https://cabledyn.readthedocs.io/en/latest/references.html#ref-falkenberg2017)) | Pass verified | MoorDyn-F/C `BA_s|BA_d` rate and force equations; analytic position/velocity tangents with finite-difference checks; projected, bracketed backward-Euler slow-state update with a strong-unloading boundary test; OWC running maximum; `SYROPE IC` `Tmax0/Tmean0` history with range/order checks; both states carried through every lifecycle stage and the coupled checkpoint. `BA_s` is kept separate from line axial damping (`BA`) and tested against double counting. The line takes the seabed, Morison loads, current, waves, host fluid and VIV of any `EI = 0` line: a taut 88.5 m polyester line in water whose fairlead sways 2 m matches MoorDyn-C v2.7.2 within 10.6 N over a 44.8 kN tension range (1.03 MN mean; t = 0 within 0.5 N), and its range grows 4.8 % without drag and added mass (`syrope_hydro`). Composite lines (a 400 m Syrope polyester section between chains, `syrope_composite`): every polyester element starts on its OWC to 2e-11 across its 1.005–1.012 MN tension range, a still run keeps the fairlead tension to the printed digits (one secant per section moved it by 1.4e-5 within 2 s), the chains keep their `BA` damping, a `SYROPE IC` history puts the section on the `Tmax0` working curve, a line split into two Syrope sections reaches the single section's tensions to 1e-8, and a tension above the OWC table stops with a named error. Finite-EI combinations stop with a named error | diff --git a/doc/driver_format.md b/doc/driver_format.md index b82eddbe..52f8960a 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -444,8 +444,11 @@ row. On this route: node orientation and angular rates are ignored, and the node returns the body's net load less its inertia, with no moment (MoorDyn-F's coupled pinned body); the angular acceleration in that inertia is solved for the node's current acceleration. With `bodyIC static` the body starts - balanced about its node. Outside a coupled host such a body is rejected by name ("requires a - coupled host"); + balanced about its node. `PtfmInit` turns the body with the platform, as it turns the body's + attachment points (M^T R0 for the deck orientation R0 and the platform's global-to-local DCM + M); MoorDyn-F's driver instead starts a coupled pinned body at its deck orientation, so with + `bodyIC deck` and a rotation in `PtfmInit` the two start from different poses. Outside a + coupled host such a body is rejected by name ("requires a coupled host"); - cables may be suspended or use the same flat/structured seabed contact, normal damping, and stick-slip friction as the standalone Hermite route. @@ -461,7 +464,7 @@ columns, or 18 with the trailing inertias, or the 14 columns of a MoorDyn v2 row | `Type` | `Point3` (3-DOF translational buoy or clump), `Rigid6` (6-DOF rigid body), `Coupled`/`Vessel` (a `Rigid6` body whose pose follows the host: the OpenFAST platform, or `motionFile` rows for its `Body` points in the standalone driver), or `CoupledPinned`/`VesselPinned` (MoorDyn aliases `CpldPin`, `VesPin`: a `Rigid6` body whose reference point follows the OpenFAST platform position while it turns about that point; OpenFAST only) | | `X,Y,Z` | reference position [m] | | `Roll,Pitch,Yaw` | reference orientation [deg] (`Rigid6`; ignored for `Point3`) | -| `Mass` | body mass [kg]; > 0 | +| `Mass` | body mass [kg]; > 0 (≥ 0 for `Coupled`/`Vessel` and `CoupledPinned`/`VesselPinned`) | | `Vol` | displaced volume [m³] (buoyancy ρ_w·g·Vol); ≥ 0 | | `C33` | heave hydrostatic restoring ρ_w·g·A_wp [N/m] | | `C44/55` | roll/pitch restoring [N·m/rad] (`Rigid6`) | @@ -1203,7 +1206,9 @@ in, so keys such as `staticRelTol` or `staticMaxIter` are rejected like any othe set the dynamic Newton controls with `dynamic_solver`. The stock MoorDyn keywords `dtIC`, `TmaxIC`, `CdScaleIC`, `threshIC`, `TScheme`, `WriteLog`, and `dtOut` are accepted and ignored, because CableDyn uses a Newton static initial condition, an implicit integrator, and -caller-controlled output cadence. +caller-controlled output cadence. MoorDyn-F's `inertialF` is accepted as `1` only (CableDyn +always returns the inertia of coupled bodies and rods; `0` and `2` are rejected by name), and +`inertialF_rampT` is accepted and ignored. (moordyn-c-wavekin)= ### MoorDyn-C `WaveKin` and `Currents` modes diff --git a/doc/openfast.rst b/doc/openfast.rst index 4a85a509..0bb67586 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -417,8 +417,13 @@ without an auxiliary process: centre of gravity, the node acceleration and the moments of its lines; MoorDyn-F's coupled pinned body), and the node returns the body's net load less its inertia, with zero moment, the angular acceleration again solved for the node's current acceleration. ``PtfmInit`` moves and turns such - a body with the platform before the static solve balances it about its node. Its inertias - ``Ixx``/``Iyy``/``Izz`` must be positive. Linearisation fails closed on decks with bodies. + a body with the platform before the static solve balances it about its node (MoorDyn-F's + driver keeps the deck orientation of a coupled pinned body: with ``bodyIC deck`` and a + ``PtfmInit`` rotation the start poses differ). Its inertias ``Ixx``/``Iyy``/``Izz`` must be + positive. Linearisation fails closed on decks with bodies. The force follows MoorDyn-F's + coupled pinned body with ``inertialF 1`` (CableDyn always includes the inertia), with the + differences given in :doc:`theory` (the centripetal force of the structural mass only, the + wetted buoyancy, the lines' consistent end-node inertia). Each is a separate qualification: a successful ordinary run does not qualify restart, linearisation, control, failure, or farm behaviour for a new model. diff --git a/doc/options.rst b/doc/options.rst index 64dd1293..707c1e18 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -788,6 +788,13 @@ These names exist so a migrated MoorDyn deck fails less often at the syntax boun * - ``WriteLog`` - plain number - Parsed strictly and ignored; reporting uses the normal CableDyn/OpenFAST diagnostics. + * - ``inertialF``, ``inertialF_rampT`` + - plain number + - ``inertialF 1`` is accepted without effect: CableDyn always returns the inertia of coupled + bodies and rods (``Coupled``/``Vessel`` and ``CoupledPinned``/``VesselPinned``) with + their coupled loads, as MoorDyn-F's ``inertialF 1``. ``0`` (MoorDyn-F's default, no + inertia) and ``2`` (the inertia ramped in) are rejected by name. ``inertialF_rampT``, the + ramp time of ``inertialF 2``, is parsed strictly and ignored. * - ``dtOut`` - plain number - Parsed strictly and ignored. Standalone output follows ``dtM``; coupled ``.CD.out`` diff --git a/doc/theory.rst b/doc/theory.rst index 013b9e4a..fb9ad00b 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -2562,8 +2562,19 @@ arms, and :math:`\mathbf{M}_{rt} = m[\mathbf{c}]_\times` (MoorDyn-F's The node receives :math:`\mathbf{F} - (m + m_a)\mathbf{a}_p - m(\boldsymbol{\alpha}\times\mathbf{c} + \boldsymbol{\omega}\times(\boldsymbol{\omega}\times\mathbf{c}))` and no moment, :math:`m_a` the body's translational added mass, with the angular acceleration -solved again for the current node acceleration as for the rod (MoorDyn-F with ``inertialF 1``; -its default ``inertialF 0`` leaves the inertia out of the coupled force). The sub-step estimate +solved again for the current node acceleration as for the rod. This is MoorDyn-F's coupled pinned +body with ``inertialF 1`` (its default ``inertialF 0`` leaves the inertia out of the coupled +force; CableDyn always includes it) but for three modelling differences, where CableDyn keeps the +consistent form: MoorDyn-F's centripetal force :math:`-\mathbf{M}_{(1:3,1:3)}\,\boldsymbol{\omega}\times(\boldsymbol{\omega}\times\mathbf{c})` +takes its translational mass block, with the added mass :math:`\rho V C_a` and the attached +points' masses, at the centre of gravity, where CableDyn takes the structural mass there and the +added mass and line ends at their own points; MoorDyn-F applies the full buoyancy +:math:`\rho g V` at any elevation, CableDyn the wetted one (``bodyWetting moordyn`` restores +MoorDyn's); and the attached ``EI = 0`` lines carry their consistent end-node inertia +(:math:`m l/3` of the end element, less with the interior following in a step) against +MoorDyn-F's lumped :math:`m l/2`. The aggregate solves the start accelerations of its bodies and +rods at initialisation and at a committed transfer of the step-start kinematics, so the state +mirror the OpenFAST shell restores after its first output call already carries them. The sub-step estimate takes the diagonal of :math:`\mathbf{I}_p` against the line springs through their arms from the node, the waterplane restoring, and the swing stiffness of the weight and buoyancy turning with the body, :math:`|\mathbf{K}_{kk}|` of :math:`\mathbf{K} = -\sum_i[\mathbf{f}_i]_\times[\mathbf{p}_i]_\times` diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 2fedcb3a..3131c4de 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -294,6 +294,8 @@ "writelog", "dtout", "currents", + "inertialf", + "inertialf_rampt", } # Native CD_DECK_NAMELEN: the longest OUTPUTS channel name the reader stores. _NATIVE_NAME_LENGTH = 64 @@ -337,12 +339,19 @@ _PINNED_END_CONNECTIONS = frozenset({"pinned", "free", "zero"}) # Host-driven (platform-borne) BODIES types, MoorDyn aliases included (native append_body) _HOST_BODY_TYPES = frozenset({"coupled", "vessel", "cpld", "ves"}) +# native apply_option: MoorDyn-F's inertialF other than 1 +_INERTIAL_F_MESSAGE = ( + "CableDyn returns the inertia of coupled bodies and rods with their coupled loads, as " + "MoorDyn-F's inertialF 1; inertialF 0 (MoorDyn-F's default: no inertia) and 2 (the inertia " + "ramped in) are not supported: use 1 or remove the row" +) # Bodies pinned to a host node (MoorDyn CoupledPinned/VesselPinned): coupled hosts only _PINNED_BODY_TYPES = frozenset({"coupledpinned", "cpldpin", "vesselpinned", "vespin"}) _PINNED_BODY_HOST_MESSAGE = ( "CoupledPinned/VesselPinned BODY requires a coupled host (OpenFAST CompMooring = 5); in a " "standalone deck use a Free body, or a Coupled body with a motionFile" ) +_RIGID6_DYNAMIC_MESSAGE = "Rigid6 BODY requires a dynamic deck with dtM and TMax" _PINNED_BODY_VALUE_MESSAGE = ( "CoupledPinned/VesselPinned BODY requires Ixx/Iyy/Izz > 0 and non-negative Mass/Vol/CdA/Ca" ) @@ -1156,7 +1165,16 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None: lower, upper = 0.0, None elif key == "rhoinf": lower, upper = 0.0, 1.0 - elif raw in {"dtic", "tmaxic", "cdscaleic", "threshic", "writelog", "dtout"}: + elif raw in { + "dtic", + "tmaxic", + "cdscaleic", + "threshic", + "writelog", + "dtout", + "inertialf", + "inertialf_rampt", + }: lower, upper = None, None else: lower = upper = None @@ -1189,6 +1207,8 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None: "dtout", "dtwave", "wvhicoff", + "inertialf", + "inertialf_rampt", }: try: numeric = _native_float(value) @@ -1576,7 +1596,9 @@ class DeckFile: rule depends on the host and is checked when OpenFAST initialises the module: the current is kept as a steady field when SeaState carries no waves or current and is rejected otherwise. The native C API (:class:`cabledyn.CableDyn`) reads decks with the - standalone rules. + standalone rules, so it rejects the ``CoupledPinned``/``VesselPinned`` bodies and rods + that ``caller_driven=True`` accepts; FAST.Farm, in turn, refuses bodies and rods when it + initialises the module. """ def __init__( @@ -1864,6 +1886,7 @@ def _check_moordyn_body_row( row: DeckRecord, numeric: Callable[[str, DeckRecord, str], float], has_motion_file: bool = False, + has_dtm: bool = True, ) -> None: """Validate a 14-column MoorDyn BODIES row as the native reader does.""" attachment = row.tokens[1].lower() @@ -1909,8 +1932,10 @@ def _check_moordyn_body_row( ): raise DeckFormatError(f"{self._at(row)}: {_BODY_RANGE_MESSAGE}") if pinned: - # native finalize_checks: only a coupled host moves the reference point; the - # rotation is integrated + # native finalize_checks: the Rigid6 dynamic-deck rule first, then only a coupled + # host moves the reference point; the rotation is integrated + if not (has_dtm or self.caller_driven): + raise DeckFormatError(f"{self._at(row)}: {_RIGID6_DYNAMIC_MESSAGE}") if not self.caller_driven: raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_HOST_MESSAGE}") if min(mass, volume, cda[0], ca[0]) < 0.0 or any(v <= 0.0 for v in lists["I"]): @@ -2312,6 +2337,9 @@ def _option_row(self, index: int) -> OptionRecord | None: raise DeckFormatError(f"{where}: unknown OPTION keyword {keyword!r}") if error := _scalar_option_value_error(keyword, tokens[0]): raise DeckFormatError(f"{where}: OPTION {keyword} {error}") + if keyword.lower() == "inertialf" and _native_float(tokens[0]) != 1.0: + # native apply_option: CableDyn always returns the coupled objects' inertia + raise DeckFormatError(f"{where}: OPTION inertialF {tokens[0]}: {_INERTIAL_F_MESSAGE}") _raise_option_defect(where, tokens) value = _strip_quotes(tokens[0]) if keyword.lower() in _PATH_OPTIONS else tokens[0] return OptionRecord(index, keyword, (value,), description, False, tuple(tokens[2:])) @@ -3321,7 +3349,7 @@ def end_key(token: str) -> str: bodies = self._rows("BODIES") for row in bodies: if len(row.tokens) == 14: - self._check_moordyn_body_row(row, numeric, has_motion_file) + self._check_moordyn_body_row(row, numeric, has_motion_file, has_dtm) continue if len(row.tokens) not in {15, 18}: raise DeckFormatError(f"{self._at(row)}: BODIES row needs 14, 15 or 18 fields") @@ -3337,6 +3365,8 @@ def end_key(token: str) -> str: values[:6], values[6:12] + values[13:], values[12] ): raise DeckFormatError(f"{self._at(row)}: {_BODY_RANGE_MESSAGE}") + if not (has_dtm or self.caller_driven): + raise DeckFormatError(f"{self._at(row)}: {_RIGID6_DYNAMIC_MESSAGE}") if not self.caller_driven: raise DeckFormatError(f"{self._at(row)}: {_PINNED_BODY_HOST_MESSAGE}") inertia = values[13:16] if len(values) >= 16 else [0.0, 0.0, 0.0] diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 166790e9..0aea2320 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -1546,18 +1546,26 @@ def test_coupled_pinned_bodies_need_a_coupled_host_and_inertia(tmp_path, kind): # native finalize_checks: the host moves the reference point of a CoupledPinned body and # its rotation is integrated, so the standalone driver refuses it and the coupled route # takes it with positive inertias (18- and 14-column rows) - source = (ROOT / "examples/chain_catenary_r3_100m.dat").read_text(encoding="utf-8") + static = (ROOT / "examples/chain_catenary_r3_100m.dat").read_text(encoding="utf-8") marker = "--------------------- POINTS -------------------------------------------" + clock = "--------------------- OUTPUTS ------------------------------------------" + dynamic = static.replace(clock, "0.01 dtM\n1.0 TMax\n" + clock) bodies = "--------------------- BODIES -------------------------------------------\n" path = tmp_path / "pinned.dat" for row in ( f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0 1 1 1\n", f"1 {kind} 0 0 -20 0 0 0 10 0|0|-1 1|2|3 0 0 0\n", ): - path.write_text(source.replace(marker, bodies + row + marker), encoding="utf-8") + path.write_text(dynamic.replace(marker, bodies + row + marker), encoding="utf-8") with pytest.raises(DeckFormatError, match="requires a coupled host"): DeckFile.read(path) DeckFile.read(path, caller_driven=True) + # without a clock the native Rigid6 dynamic-deck rule comes first + path.write_text(static.replace(marker, bodies + row + marker), encoding="utf-8") + with pytest.raises(DeckFormatError, match="Rigid6 BODY requires a dynamic deck"): + DeckFile.read(path) + DeckFile.read(path, caller_driven=True) + source = dynamic for row in ( f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0\n", f"1 {kind} 0 0 -20 0 0 0 10 0 0 0 0 0 0 1 0 1\n", @@ -1569,6 +1577,23 @@ def test_coupled_pinned_bodies_need_a_coupled_host_and_inertia(tmp_path, kind): DeckFile.read(path, caller_driven=True) +@pytest.mark.parametrize( + "value, accepted", [("1", True), ("1.0", True), ("0", False), ("2", False)] +) +def test_moordyn_inertial_f_option(tmp_path, value, accepted): + # native apply_option: CableDyn always returns the coupled objects' inertia (inertialF 1) + source = (ROOT / "examples/chain_catenary_r3_100m.dat").read_text(encoding="utf-8") + clock = "--------------------- OUTPUTS ------------------------------------------" + path = tmp_path / "inertial.dat" + text = source.replace(clock, f"{value} inertialF\n30.0 inertialF_rampT\n" + clock) + path.write_text(text, encoding="utf-8") + if accepted: + DeckFile.read(path) + else: + with pytest.raises(DeckFormatError, match=r"inertialF 0 \(MoorDyn-F's default"): + DeckFile.read(path) + + @pytest.mark.parametrize( "rod_row, message", [ diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index b329a83a..bb4bb89a 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -212,6 +212,7 @@ MODULE CableDyn_DeckDriver PUBLIC :: CD_Rigid6_GetRefPositions, CD_Rigid6_SetHeldFluid PUBLIC :: CD_Rigid6_NHost, CD_Rigid6_AllHost, CD_Rigid6_SetHostKinematics, CD_Rigid6_GetHostKinematics PUBLIC :: CD_Rigid6_ScatterHostPoints, CD_Rigid6_HostWrench, CD_Rigid6_Stage, CD_Rigid6_Unstage + PUBLIC :: CD_Rigid6_StartAccelerations, CD_Rod_StartAccelerations PUBLIC :: CD_RodRuntimeType PUBLIC :: CD_Init_Deck_Aggregate_Rod, CD_Step_Aggregate_Rod PUBLIC :: CD_Rod_NRods, CD_Rod_Snapshot, CD_Rod_Restore, CD_Rod_End @@ -15920,6 +15921,23 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) CASE ('writelog') ! Stock MoorDyn log-verbosity switch; CableDyn reports through ErrStat/ErrMsg. CALL rd(val, x1, ErrStat, ErrMsg) + CASE ('inertialf') + ! MoorDyn-F's switch for the inertia of the coupled objects in their coupled loads: 0 none + ! (its default), 1 included, 2 ramped in over inertialF_rampT. CableDyn always includes it + ! (the coupled body, rod and pinned object loads net of their inertia): 1 is accepted + ! without effect, 0 and 2 are refused by name. + CALL rd(val, x1, ErrStat, ErrMsg) + IF (ErrStat /= 0) RETURN + IF (ABS(x1 - CD_ONE) > CD_ZERO) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION inertialF '//TRIM(val)//': CableDyn returns the inertia of '// & + 'coupled bodies and rods with their coupled loads, as MoorDyn-F''s inertialF 1; '// & + 'inertialF 0 (MoorDyn-F''s default: no inertia) and 2 (the inertia ramped in) are not '// & + 'supported: use 1 or remove the row') + RETURN + END IF + CASE ('inertialf_rampt') + ! the ramp time of MoorDyn-F's inertialF 2 (refused above): accepted without effect + CALL rd(val, x1, ErrStat, ErrMsg) CASE ('dtout') ! Stock MoorDyn output-file cadence; CableDyn's output cadence is governed by ! the caller (driver print interval / OpenFAST glue), not the deck. @@ -16125,7 +16143,8 @@ SUBROUTINE check_option_row_value(kw, val, ErrStat, ErrMsg) rule = 'finite' CASE ('rhoinf', 'rho_inf') rule = 'unit' - CASE ('kbot', 'kb', 'cbot', 'cb', 'dtic', 'tmaxic', 'cdscaleic', 'threshic', 'writelog', 'dtout') + CASE ('kbot', 'kb', 'cbot', 'cb', 'dtic', 'tmaxic', 'cdscaleic', 'threshic', 'writelog', 'dtout', 'inertialf', & + 'inertialf_rampt') rule = 'finite' CASE DEFAULT RETURN @@ -27008,6 +27027,84 @@ SUBROUTINE CD_Rigid6_Unstage(rt) IF (ALLOCATED(rt%stage_rigid)) rt%rigid = rt%stage_rigid END SUBROUTINE CD_Rigid6_Unstage + SUBROUTINE CD_Rigid6_StartAccelerations(system, rt, ErrStat, ErrMsg, pinned) + !! Solve the accelerations of every integrated (Free and CoupledPinned) body at the current + !! state, as the start of the first step does (rigid_start_accelerations from the current line + !! loads; a CoupledPinned body with its node at its step-start pose, pin0), and mark them + !! committed. The aggregate calls it at Init and at a transfer of the step-start host + !! kinematics before the first step, so the state mirror carries the start accelerations from + !! t = 0: a mirror restore (the OpenFAST shell restores it after every CalcOutput) marks the + !! accelerations committed, and the first step would otherwise start from zero. Only the + !! accelerations change; the state is solved on a copy. pinned: a CoupledPinned body was + !! solved (its line ends then move with it). + TYPE(CD_SystemType), INTENT(INOUT) :: system + TYPE(CD_Rigid6RuntimeType), INTENT(INOUT) :: rt + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + LOGICAL, INTENT(OUT), OPTIONAL :: pinned + TYPE(RigidBodyState), ALLOCATABLE :: trial(:) + REAL(wp), ALLOCATABLE :: hk(:, :) + INTEGER :: ib + + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + IF (PRESENT(pinned)) pinned = .FALSE. + IF (.NOT. ALLOCATED(rt%rigid)) RETURN + IF (PRESENT(pinned)) pinned = ANY(rt%rigid%is_host_pinned) + IF (ALL(rt%rigid%is_prescribed)) RETURN + trial = rt%rigid + DO ib = 1, SIZE(trial) + IF (.NOT. trial(ib)%is_prescribed) trial(ib)%accel_valid = .FALSE. + END DO + CALL save_host_end_rigid(trial, hk) + CALL interp_host_body_pins(trial, hk, CD_ZERO) + CALL rigid_start_accelerations(system, rt%points, rt%opts, trial, CD_ZERO, rt%work, ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + DO ib = 1, SIZE(trial) + IF (rt%rigid(ib)%is_prescribed) CYCLE + rt%rigid(ib)%a = trial(ib)%a + rt%rigid(ib)%alpha = trial(ib)%alpha + rt%rigid(ib)%accel_valid = .TRUE. + END DO + END SUBROUTINE CD_Rigid6_StartAccelerations + + SUBROUTINE CD_Rod_StartAccelerations(system, rt, ErrStat, ErrMsg, pinned) + !! Rod twin of CD_Rigid6_StartAccelerations for the Free, Pinned and CoupledPinned rods + !! (rod_start_accelerations; a CoupledPinned rod with its pin at its step-start pose, pin0, as + !! the first step of step_rod_system takes it). A pinned rod keeps its centre acceleration of + !! that pose with the solved angular one, consistent with its committed End A motion. pinned: + !! a CoupledPinned rod was solved. + TYPE(CD_SystemType), INTENT(INOUT) :: system + TYPE(CD_RodRuntimeType), INTENT(INOUT) :: rt + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + LOGICAL, INTENT(OUT), OPTIONAL :: pinned + TYPE(RodState), ALLOCATABLE :: trial(:) + REAL(wp), ALLOCATABLE :: hk(:, :) + INTEGER :: ir + + ErrStat = CD_DECKDRV_OK + ErrMsg = '' + IF (PRESENT(pinned)) pinned = .FALSE. + IF (.NOT. ALLOCATED(rt%rods)) RETURN + IF (PRESENT(pinned)) pinned = ANY(rt%rods%is_host_pinned) + IF (.NOT. ANY(rt%rods%is_free .OR. rt%rods%is_pinned)) RETURN + trial = rt%rods + DO ir = 1, SIZE(trial) + IF (trial(ir)%is_free .OR. trial(ir)%is_pinned) trial(ir)%accel_valid = .FALSE. + END DO + CALL save_host_end_rod(trial, hk) + CALL interp_host_pins(trial, hk, CD_ZERO) + CALL rod_start_accelerations(system, rt%points, rt%opts, trial, CD_ZERO, rt%work, ErrStat, ErrMsg) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + DO ir = 1, SIZE(trial) + IF (.NOT. (trial(ir)%is_free .OR. trial(ir)%is_pinned)) CYCLE + rt%rods(ir)%a = trial(ir)%a + rt%rods(ir)%alpha = trial(ir)%alpha + rt%rods(ir)%accel_valid = .TRUE. + END DO + END SUBROUTINE CD_Rod_StartAccelerations + SUBROUTINE CD_Step_Aggregate_Rigid6(system, rt, time, dt, converged, stalled, n_iter, ErrStat, ErrMsg, host_mask, & host_q, host_v, host_a, interp_hosts) !! Advance the aggregate's Rigid6 bodies one mooring step over its EI=0 system (flat seabed; diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index 1bf412d0..b6f0ff47 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -81,6 +81,7 @@ MODULE CableDyn_OpenFAST_Aggregate CD_Rod_GetFluidPositions, CD_Rod_SetHeldFluid, & CD_Rod_NHost, CD_Rod_SetHostKinematics, CD_Rod_GetHostKinematics, & CD_Rod_ScatterHostPoints, CD_Rod_HostWrench, CD_Rod_Stage, CD_Rod_Unstage, & + CD_Rigid6_StartAccelerations, CD_Rod_StartAccelerations, & CD_Deck_Range_Sample_Aggregate, CD_Deck_Range_Write USE CableDyn_RangeOutput, ONLY: CD_RangeSet, CD_Range_End USE CableDyn_System, ONLY: CD_Get_System_Substep_Counts, CD_System_NLines, CD_System_Line_NDOF, & @@ -244,6 +245,10 @@ MODULE CableDyn_OpenFAST_Aggregate LOGICAL, ALLOCATABLE :: hf_mask(:) REAL(wp), ALLOCATABLE :: hf_q(:), hf_v(:), hf_a(:) REAL(wp), ALLOCATABLE :: hb_pos(:, :), hb_vel(:, :), hb_acc(:, :), hb_load(:, :) + ! The bodies and rods carry the accelerations of a committed step or of a restored state mirror; + ! until then a transfer of the step-start host kinematics re-solves their start accelerations + ! (start_object_accelerations), so the mirror carries them from t = 0. + LOGICAL :: objects_committed = .FALSE. LOGICAL :: initialized = .FALSE. END TYPE CD_AGG_ModuleType @@ -521,6 +526,13 @@ SUBROUTINE CD_AGG_Init_From_Deck(self, deck_path, dt, ErrStat, ErrMsg, env_gravi CALL CD_AGG_End(candidate, es, em) RETURN END IF + ! the bodies and rods start from their accelerations at the initial state, the host at rest in its + ! Init pose (the first step's start; the state mirror then carries them from t = 0) + CALL start_object_accelerations(candidate, ErrStat, ErrMsg) + IF (ErrStat /= CD_AGG_OK) THEN + CALL CD_AGG_End(candidate, es, em) + RETURN + END IF candidate%dt = dt ! freeze the coupling step for the fixed-dt Step_Moving guard candidate%initialized = .TRUE. CALL CD_AGG_End(self, es, em) @@ -879,6 +891,12 @@ SUBROUTINE CD_AGG_UpdateStates_Moving(self, position, velocity, acceleration, Er CALL overlay_host_objects(self, is_output_probe, ErrStat, ErrMsg) IF (ErrStat /= CD_AGG_OK) RETURN END IF + ! before the first step, a committed (non-probe) transfer of the step-start kinematics moves + ! the start of the first step: the start accelerations follow it + IF (.NOT. (is_output_probe .OR. self%objects_committed)) THEN + CALL start_object_accelerations(self, ErrStat, ErrMsg) + IF (ErrStat /= CD_AGG_OK) RETURN + END IF DO c = 1, self%ncable col = self%ncp_sys + c IF (PRESENT(orientation)) THEN @@ -1235,6 +1253,7 @@ SUBROUTINE CD_AGG_Step_Moving(self, dt, position, velocity, acceleration, conver RETURN END IF END IF + IF (self%has_rigid6 .OR. self%has_rod) self%objects_committed = .TRUE. ErrStat = CD_AGG_OK ErrMsg = '' @@ -2423,6 +2442,47 @@ SUBROUTINE overlay_host_objects(self, output_probe, ErrStat, ErrMsg) IF (es /= CD_FMF_OK) CALL map_fmf_status(es, em, ErrStat, ErrMsg) END SUBROUTINE overlay_host_objects + SUBROUTINE start_object_accelerations(self, ErrStat, ErrMsg) + !! Solve the start accelerations of the integrated bodies and rods at the current state + !! (CD_Rigid6_StartAccelerations, CD_Rod_StartAccelerations): at Init and at a committed + !! transfer of the step-start kinematics before the first step. The OpenFAST shell restores + !! the state mirror after every CalcOutput, which marks the object accelerations committed; + !! solved here, the mirror carries the start accelerations, and the first step starts from them + !! instead of from zero. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + INTEGER :: es + LOGICAL :: pin_b, pin_r + CHARACTER(1024) :: em + ErrStat = CD_AGG_OK + ErrMsg = '' + pin_b = .FALSE. + pin_r = .FALSE. + IF (.NOT. self%has_sys) RETURN + IF (self%has_rigid6) THEN + CALL CD_Rigid6_StartAccelerations(self%sys%fast%system, self%rigid6, es, em, pinned=pin_b) + IF (es /= CD_DECKDRV_OK) THEN + CALL map_deck_status(es, em, ErrStat, ErrMsg) + RETURN + END IF + END IF + IF (self%has_rod) THEN + CALL CD_Rod_StartAccelerations(self%sys%fast%system, self%rod, es, em, pinned=pin_r) + IF (es /= CD_DECKDRV_OK) THEN + CALL map_deck_status(es, em, ErrStat, ErrMsg) + RETURN + END IF + END IF + ! the line ends on a CoupledPinned rod or body move with its solved acceleration (a mirror + ! restore puts them there too, CD_AGG_Set_Rigid6_States, CD_AGG_Set_Rod_States), and the line + ! interior accelerations follow them (a committed transfer); Coupled/Vessel objects keep the + ! host's (Init) motion + IF (.NOT. (pin_b .OR. pin_r)) RETURN + CALL overlay_host_objects(self, .FALSE., ErrStat, ErrMsg) + IF (ErrStat == CD_AGG_OK) CALL CD_FMF_Refresh_PointMesh(self%sys, ErrStat, ErrMsg) + END SUBROUTINE start_object_accelerations + SUBROUTINE set_host_objects(self, position, velocity, acceleration, ErrStat, ErrMsg, orientation, & angular_velocity, angular_acceleration, step_start) !! Impose the host-rod and host-body columns (the trailing nhost_rod + nhost_body moving @@ -2655,7 +2715,9 @@ SUBROUTINE CD_AGG_Set_Rigid6_States(self, states, ErrStat, ErrMsg) ErrMsg = '' IF (.NOT. self%has_rigid6) RETURN CALL CD_Rigid6_Set_States(self%rigid6, states, ErrStat, ErrMsg) - IF (ErrStat /= CD_AGG_OK .OR. self%nhost_body == 0) RETURN + IF (ErrStat /= CD_AGG_OK) RETURN + self%objects_committed = .TRUE. + IF (self%nhost_body == 0) RETURN ! Host-driven bodies: their Body line ends follow the restored body state exactly. CALL overlay_host_objects(self, .TRUE., ErrStat, ErrMsg) IF (ErrStat == CD_AGG_OK) CALL CD_FMF_Refresh_PointMesh(self%sys, ErrStat, ErrMsg) @@ -2689,6 +2751,7 @@ SUBROUTINE CD_AGG_Set_Rod_States(self, states, ErrStat, ErrMsg) IF (.NOT. self%has_rod) RETURN CALL CD_Rod_Set_States(self%rod, states, ErrStat, ErrMsg) IF (ErrStat /= CD_AGG_OK) RETURN + self%objects_committed = .TRUE. CALL CD_Rod_Apply_States(self%sys%fast%system, self%rod, ErrStat, ErrMsg) IF (ErrStat /= CD_AGG_OK) RETURN ! Host-driven rods: their RodA/B line ends follow the restored rod state exactly (an diff --git a/tests/test_openfast_pinned_body.f90 b/tests/test_openfast_pinned_body.f90 index f7cc9d83..d172a749 100644 --- a/tests/test_openfast_pinned_body.f90 +++ b/tests/test_openfast_pinned_body.f90 @@ -29,8 +29,13 @@ PROGRAM test_openfast_pinned_body !! rates are ignored; !! 9) beside a Coupled body (a 6-DOF host node, deck BODY order) the pinned body keeps its own !! motion: the same as alone to 1e-12; - !! 10) a CoupledPinned body outside a coupled host, without inertia, or under the linearisation - !! probe (coupled_positions) is refused by name. + !! 10) the OpenFAST shell's order (a state-mirror restore after the output call at t = 0, before + !! the first step) starts every integrated object from its solved start acceleration: the + !! pinned body (line at the node, and at an arm), a Free Rigid6 body, and Free, Pinned and + !! CoupledPinned rods march bit for bit as without the restore; + !! 11) a CoupledPinned body outside a coupled host, without inertia, or under the linearisation + !! probe (coupled_positions) is refused by name, and so is MoorDyn-F's inertialF 0 (CableDyn + !! always returns the inertia; inertialF 1 is accepted). USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, & @@ -38,7 +43,8 @@ PROGRAM test_openfast_pinned_body CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_Snapshot, CD_AGG_Restore, & CD_AGG_End, CD_AGG_OK, CD_AGG_HasRigid6, CD_AGG_HasRod, & CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, & - CD_AGG_Set_Rigid6_States, CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States + CD_AGG_Set_Rigid6_States, CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States, & + CD_AGG_Set_Rod_States USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_Get_System_Line_State, & CD_Update_System_Line_Interior_State, CD_SYSTEM_OK, CD_System_NSystemCoupledDOF, & CD_Get_System_CoupledMotion, CD_Update_System_CoupledMotion, CD_Calc_System_CoupledLoads @@ -61,6 +67,7 @@ PROGRAM test_openfast_pinned_body CALL case_ptfm_static() CALL case_substep() CALL case_mixed_hosts() + CALL case_shell_start() CALL case_refusals() IF (nfail > 0) THEN WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' @@ -176,16 +183,22 @@ SUBROUTINE write_pendulum_deck(path, phi_deg, standalone) CLOSE (u) END SUBROUTINE write_pendulum_deck - SUBROUTINE write_arm_deck(path, as_rod, body_ic) + SUBROUTINE write_arm_deck(path, as_rod, body_ic, rod_type) !! The arm of the second route, pinned at (0, 0, ZA) and hanging at THA from the downward !! vertical towards +x, above the water: as_rod a CoupledPinned ROD (LA long, DA diameter, MA kg, !! no drag or added mass), else a CoupledPinned BODY with the rod's mass, its CG at the rod !! centre and the rod's inertia about it (body x axis along the rod). A slack line runs from !! End B (the body point at LA along x) to an anchor at (30, 0, -20) and pulls the arm round. + !! rod_type replaces CoupledPinned for the rod; a Free rod takes a second line from End A to an + !! anchor at (-30, 0, -20). CHARACTER(*), INTENT(IN) :: path, body_ic LOGICAL, INTENT(IN) :: as_rod + CHARACTER(*), INTENT(IN), OPTIONAL :: rod_type REAL(wp) :: th, xb, zb, r, i1, i2 INTEGER :: u + CHARACTER(16) :: rt + rt = 'CoupledPinned' + IF (PRESENT(rod_type)) rt = rod_type th = THA*PI/180.0_wp xb = LA*SIN(th) zb = ZA - LA*COS(th) @@ -202,7 +215,7 @@ SUBROUTINE write_arm_deck(path, as_rod, body_ic) WRITE (u, '(A)') '--- RODS ---' WRITE (u, '(A)') 'ID RodType Type XA YA ZA XB YB ZB NumSegs Outputs' WRITE (u, '(A)') '(-) (-) (-) (m) (m) (m) (m) (m) (m) (-) (-)' - WRITE (u, '(A,ES24.16,A,ES24.16,A,ES24.16,A)') '1 arm CoupledPinned 0 0 ', ZA, ' ', xb, ' 0 ', zb, ' 4 -' + WRITE (u, '(A,ES24.16,A,ES24.16,A,ES24.16,A)') '1 arm '//TRIM(rt)//' 0 0 ', ZA, ' ', xb, ' 0 ', zb, ' 4 -' ELSE ! R = Ry(p) carries the body x axis to (cos p, 0, -sin p) = (sin th, 0, -cos th): p = 90 - th CALL write_md_body(u, 'CoupledPinned', [0.0_wp, 0.0_wp, ZA], [0.0_wp, 90.0_wp - THA, 0.0_wp], MA, & @@ -213,11 +226,13 @@ SUBROUTINE write_arm_deck(path, as_rod, body_ic) WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' WRITE (u, '(A)') '1 Fixed 30.0 0.0 -20.0 0 0 0 0' IF (.NOT. as_rod) WRITE (u, '(A,ES24.16,A)') '2 Body1 ', LA, ' 0.0 0.0 0 0 0 0' + IF (TRIM(rt) == 'Free') WRITE (u, '(A)') '3 Fixed -30.0 0.0 -20.0 0 0 0 0' WRITE (u, '(A)') '--- LINES ---' WRITE (u, '(A)') 'ID NodeA NodeB Outputs' WRITE (u, '(A)') '(-) (-) (-) (-)' IF (as_rod) THEN WRITE (u, '(A)') '1 R1B 1 -' + IF (TRIM(rt) == 'Free') WRITE (u, '(A)') '2 R1A 3 -' ELSE WRITE (u, '(A)') '1 2 1 -' END IF @@ -225,23 +240,33 @@ SUBROUTINE write_arm_deck(path, as_rod, body_ic) WRITE (u, '(A)') 'LineID LineType Length NumSegs' WRITE (u, '(A)') '(-) (-) (m) (-)' WRITE (u, '(A)') '1 line 40.0 20' + IF (TRIM(rt) == 'Free') WRITE (u, '(A)') '2 line 38.0 20' CALL write_options(u, 20.0_wp, body_ic) CLOSE (u) END SUBROUTINE write_arm_deck - SUBROUTINE write_symmetric_deck(path) + SUBROUTINE write_symmetric_deck(path, free_body) !! A submerged VesselPinned body (18-column row: 200 kg, 0.1 m^3, Ca 0.5, inertia 50 kg m^2, !! CG at the reference point) at (0, 0, -5) on four identical lines from (+-3, 0, 0) and - !! (0, +-3, 0) in the body frame to anchors 40 m out on the 50 m seabed. + !! (0, +-3, 0) in the body frame to anchors 40 m out on the 50 m seabed. free_body: a Free + !! Rigid6 body instead, started 1 m above the pose, pitched 10 deg (out of balance). CHARACTER(*), INTENT(IN) :: path + LOGICAL, INTENT(IN), OPTIONAL :: free_body INTEGER :: u + LOGICAL :: fb + fb = .FALSE. + IF (PRESENT(free_body)) fb = free_body OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') CALL write_header(u, 'symmetric VesselPinned body on the coupled aggregate') WRITE (u, '(A)') '--- BODIES ---' WRITE (u, '(A)') 'ID Type X Y Z Rot1 Rot2 Rot3 Mass Vol C33 C44 C55 CdA Ca Ixx Iyy Izz' WRITE (u, '(A)') '(-) (-) (m) (m) (m) (deg) (deg) (deg) (kg) (m3) (N/m) (Nm/rad) (Nm/rad) (m2) (-) '// & '(kgm2) (kgm2) (kgm2)' - WRITE (u, '(A)') '1 VesselPinned 0.0 0.0 -5.0 0.0 0.0 0.0 200.0 0.1 0.0 0.0 0.0 0.0 0.5 50.0 50.0 50.0' + IF (fb) THEN + WRITE (u, '(A)') '1 Rigid6 0.0 0.0 -4.0 0.0 10.0 0.0 200.0 0.1 0.0 0.0 0.0 0.0 0.5 50.0 50.0 50.0' + ELSE + WRITE (u, '(A)') '1 VesselPinned 0.0 0.0 -5.0 0.0 0.0 0.0 200.0 0.1 0.0 0.0 0.0 0.0 0.5 50.0 50.0 50.0' + END IF WRITE (u, '(A)') '--- POINTS ---' WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' @@ -1237,7 +1262,93 @@ SUBROUTINE case_mixed_hosts() END SUBROUTINE case_mixed_hosts ! --------------------------------------------------------------------------------------------- ! - ! 10: refusals ! + ! 10: the shell's state-mirror restore before the first step ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE case_shell_start() + !! The OpenFAST shell evaluates its outputs at t = 0 before the first step and restores the + !! state mirror afterwards, which marks every object's acceleration committed. The mirror must + !! then already carry the start accelerations (solved at Init): with every node held, each deck + !! (out of balance at its deck pose) marches bit for bit with and without that restore. + CHARACTER(32) :: deck(6) + INTEGER :: k + CALL write_pendulum_deck('pinbody_shell1.dat', 30.0_wp) + CALL write_symmetric_deck('pinbody_shell2.dat', free_body=.TRUE.) + CALL write_arm_deck('pinbody_shell3.dat', .TRUE., 'deck', rod_type='Free') + CALL write_arm_deck('pinbody_shell4.dat', .TRUE., 'deck', rod_type='Pinned') + CALL write_arm_deck('pinbody_shell5.dat', .TRUE., 'deck') + CALL write_arm_deck('pinbody_shell6.dat', .FALSE., 'deck') + deck = ['pinbody_shell1.dat', 'pinbody_shell2.dat', 'pinbody_shell3.dat', 'pinbody_shell4.dat', & + 'pinbody_shell5.dat', 'pinbody_shell6.dat'] + DO k = 1, 6 + CALL shell_start_one(TRIM(deck(k)), k >= 3 .AND. k <= 5, k == 2) + END DO + END SUBROUTINE case_shell_start + + SUBROUTINE shell_start_one(path, rod, extf) + !! One deck of case_shell_start: rod selects the rod mirror, extf the host fluid field. + CHARACTER(*), INTENT(IN) :: path + LOGICAL, INTENT(IN) :: rod, extf + REAL(wp), PARAMETER :: DT = 0.01_wp + TYPE(CD_AGG_ModuleType) :: direct, shell + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :), ms(:), s1(:), s2(:) + REAL(wp) :: err, amp, w0 + INTEGER :: es, n, step, it, nm + LOGICAL :: cv, st + CHARACTER(512) :: em + CALL CD_AGG_Init_From_Deck(direct, path, DT, es, em, external_fluid=extf) + CALL CD_AGG_Init_From_Deck(shell, path, DT, es, em, external_fluid=extf) + CALL require(es == CD_AGG_OK, 'shell-start:init '//path//': '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + n = CD_AGG_NMovingPoints(shell, es, em) + IF (rod) THEN + nm = CD_AGG_Rod_MirrorSize(shell) + ELSE + nm = CD_AGG_Rigid6_MirrorSize(shell) + END IF + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n), ms(nm), s1(nm), s2(nm)) + ! the shell's output call at t = 0: evaluate, then restore the state mirror + CALL CD_AGG_CalcOutput(shell, es, em) + CALL CD_AGG_GetMovingPointMesh(shell, p, v, a, f, es, em) + IF (rod) THEN + CALL CD_AGG_Get_Rod_States(shell, ms, es, em) + CALL CD_AGG_Set_Rod_States(shell, ms, es, em) + ELSE + CALL CD_AGG_Get_Rigid6_States(shell, ms, es, em) + CALL CD_AGG_Set_Rigid6_States(shell, ms, es, em) + END IF + CALL require(es == CD_AGG_OK, 'shell-start:mirror '//path//': '//TRIM(em)) + v = 0.0_wp + a = 0.0_wp + err = 0.0_wp + amp = 0.0_wp + w0 = 0.0_wp + DO step = 1, 100 + CALL CD_AGG_Step_Moving(direct, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL CD_AGG_Step_Moving(shell, DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*DT) + CALL require(es == CD_AGG_OK, 'shell-start:step '//path//': '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + IF (rod) THEN + CALL CD_AGG_Get_Rod_States(direct, s1, es, em) + CALL CD_AGG_Get_Rod_States(shell, s2, es, em) + ELSE + CALL CD_AGG_Get_Rigid6_States(direct, s1, es, em) + CALL CD_AGG_Get_Rigid6_States(shell, s2, es, em) + END IF + IF (step == 1) w0 = MAXVAL(ABS([s1(4:6), s1(10:12)])) + err = MAX(err, nan_max_abs(s1 - s2)) + amp = MAX(amp, nan_max_abs(s1)) + END DO + WRITE (*, '(A,A,A,ES10.3,A,ES10.3)') 'shell order (mirror restore at t = 0), ', path, & + ': |state difference| ', err, '; first-step velocity ', w0 + CALL require(w0 > 0.0_wp, 'shell-start:the deck starts out of balance '//path) + CALL require(err <= 0.0_wp, 'shell-start:the restore keeps the start acceleration '//path) + CALL CD_AGG_End(direct, es, em) + CALL CD_AGG_End(shell, es, em) + END SUBROUTINE shell_start_one + + ! --------------------------------------------------------------------------------------------- ! + ! 11: refusals ! ! --------------------------------------------------------------------------------------------- ! SUBROUTINE case_refusals() @@ -1266,8 +1377,43 @@ SUBROUTINE case_refusals() CALL CD_AGG_Init_From_Deck(agg, 'pinbody_noinertia.dat', 0.01_wp, es, em, external_fluid=.TRUE.) CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'requires Ixx/Iyy/Izz > 0') > 0, 'refusal:inertia: '//TRIM(em)) CALL CD_AGG_End(agg, es, em) + ! MoorDyn-F's inertialF: CableDyn always returns the inertia (inertialF 1, accepted); 0 and 2 + ! are refused by name + CALL write_pendulum_deck('pinbody_inertialf.dat', 0.0_wp) + CALL add_option_row('pinbody_inertialf.dat', '1 inertialF') + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_inertialf.dat', 0.01_wp, es, em) + CALL require(es == CD_AGG_OK, 'refusal:inertialF 1 is accepted: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) + CALL write_pendulum_deck('pinbody_inertialf.dat', 0.0_wp) + CALL add_option_row('pinbody_inertialf.dat', '0 inertialF') + CALL CD_AGG_Init_From_Deck(agg, 'pinbody_inertialf.dat', 0.01_wp, es, em) + CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'inertialF 0 (MoorDyn-F''s default') > 0, & + 'refusal:inertialF 0: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) END SUBROUTINE case_refusals + SUBROUTINE add_option_row(path, row) + !! Insert an OPTIONS row before the end marker of a deck. + CHARACTER(*), INTENT(IN) :: path, row + CHARACTER(512) :: rows(200), line + INTEGER :: u, ios, n, i + n = 0 + OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ') + DO + READ (u, '(A)', IOSTAT=ios) line + IF (ios /= 0) EXIT + n = n + 1 + rows(n) = line + END DO + CLOSE (u) + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + DO i = 1, n + IF (TRIM(rows(i)) == '--- end ---') WRITE (u, '(A)') row + WRITE (u, '(A)') TRIM(rows(i)) + END DO + CLOSE (u) + END SUBROUTINE add_option_row + SUBROUTINE write_zero_inertia(path) !! The symmetric deck with a 15-column BODIES row (no inertias) for its VesselPinned body. CHARACTER(*), INTENT(IN) :: path From 573f0fd2bd9d15b48321635871243e1decf71d16 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 16:54:59 +0900 Subject: [PATCH 03/10] feat(syrope): active line control of a Syrope segment, as MoorDyn CONTROL (the OpenFAST CableDeltaL/CableDeltaLdot route) on a Syrope polyester segment stopped at initialisation. MoorDyn-F and MoorDyn-C keep the slow stretch dl_1 = eps_slow*l of a Syrope segment as its state and leave it as it is when the unstretched length changes (MoorDyn-F sets l(N), ld(N) of a controlled line; MoorDyn-C's setUnstretchedLength sets every l[i]); the mean tension reads the slow strain dl_1/l at the new length, and the slow-strain rate takes the chord rate without the paid-out term. CableDyn keeps the committed slow strain, a strain of the length the committed state was reached with (l0_c), and an element reads it at its present length, eps_slow*l0_c/l0 (model_syrope_slow). The in-step backward-Euler update from it is MoorDyn's d(dl_1)/dt = l0 d(eps_slow)/dt; the force blend's committed force reads the state at l0_c as it is, so the step-start force, sub-steps, rollbacks, snapshots and the checkpoint mirror need no new state. The running maximum is kept. An uncontrolled element (l0 = l0_c bit for bit) reads its state as before, so every other deck is unchanged. The Syrope backward-Euler solve also finishes by bisection when the safeguarded Newton step stalls: next to the top sample of the working curve, where T_mean(eps_slow) clamps at T_max, the difference quotient straddles the kink and the step crept along one side of the bracket for 80 iterations, which stopped a line hauled in and held at its running maximum under False alpha_force_blend. A solve that converged before is untouched. Gates (tests/test_syrope_control.f90, new; all stopped at init before): - a taut 100 m polyester line, its fairlead segment paid out 0.5 m, hauled in to -1 m and paid back: every element follows the rest curve of its load history (working curve, OWC with the ratchet, the working curve of the new maximum) to 2.5e-4 of T0 along the ramps and 5.8e-7 at rest, with and without the force blend; - a 5 cm pay-out and 4 cm haul-in step: the tension is MoorDyn's at the carried stretch to 6e-16 and the slow strain after one step the backward-Euler step of the stretch to 1.4e-16 (carrying the strain instead is off by 2.4 % and 0.39 %, and fails the gate); - a restart in the ramp and in the hold continues bit for bit; - a polyester-chain line (Syrope fairlead segment) takes the step oracle to 4e-16 and runs a ramp; a chain-polyester-chain line keeps its Syrope states on a chain command and runs a ramp. tests/test_syrope.f90 gains the stalled solve (fails before). Docs: driver_format, theory (active line control, the Syrope solve), capabilities, openfast; CHANGELOG. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 12 + CMakeLists.txt | 8 + doc/capabilities.rst | 7 +- doc/driver_format.md | 11 +- doc/openfast.rst | 4 +- doc/theory.rst | 27 +- python/tests/test_deck_file.py | 14 + src/CableDyn_DeckDriver.f90 | 12 +- src/CableDyn_Model.f90 | 73 ++-- src/CableDyn_Syrope.f90 | 25 ++ tests/test_syrope.f90 | 44 +- tests/test_syrope_control.f90 | 732 +++++++++++++++++++++++++++++++++ 12 files changed, 929 insertions(+), 40 deletions(-) create mode 100644 tests/test_syrope_control.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index b0b0de70..d4ef4d50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,18 @@ All notable changes to CableDyn are recorded in this file. The format follows (`inertialF 1`) a pendulum swinging through 120 deg agrees to 0.09 deg (0.15 deg when its node surges). Outside a coupled host, without inertias, and in linearisation the body fails closed by name. +- Active line control (`CONTROL`, OpenFAST `CableDeltaL`/`CableDeltaLdot`) of a Syrope + polyester segment, which stopped at initialisation before. As in MoorDyn-F and MoorDyn-C the + segment's slow stretch carries over the length change (its slow strain is read at the new + length) and the running maximum is kept. On a taut 100 m line whose fairlead segment is paid + out by 0.5 m, hauled in to -1 m and paid back, the tension follows the rest curve of its load + history (working curve, OWC, then the working curve of the new maximum) to 2.5e-4 along the + ramps and 6e-7 at rest; after a length step it is MoorDyn's at the carried stretch to 1e-15 + (carrying the strain instead would be off by 0.4 to 2.4 %); a restart in the ramp continues + bit for bit; a polyester-chain line with a Syrope fairlead segment and a + chain-polyester-chain line run. The Syrope state solve also finishes by bisection when its + root sits next to the top of the working curve, where the Newton step alone stopped a run + held at its running maximum under `False alpha_force_blend`. - OpenFAST linearisation with the line dynamics, as MoorDyn-F's: the continuous states are the interior-node positions of every `EI = 0` line (MoorDyn's names and order) and the free degrees of freedom of every finite-EI cable (node positions and tangents), then their diff --git a/CMakeLists.txt b/CMakeLists.txt index ad1463d0..e3529411 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2124,6 +2124,13 @@ target_link_libraries(test_syrope_composite PRIVATE cabledyn_core) add_test(NAME syrope_composite COMMAND test_syrope_composite) set_tests_properties(syrope_composite PROPERTIES LABELS "fortran;driver;integration;static;dynamic") +# Active line control of Syrope segments on the coupled route (the slow stretch carried over a +# length change, as MoorDyn-F/C carry it): quasi-static cycle, length step, restart, composites +add_executable(test_syrope_control tests/test_syrope_control.f90) +target_link_libraries(test_syrope_control PRIVATE cabledyn_core) +add_test(NAME syrope_control COMMAND test_syrope_control) +set_tests_properties(syrope_control PROPERTIES LABELS "fortran;integration;dynamic;openfast") + add_executable(test_torsion_coupling tests/test_torsion_coupling.f90) target_link_libraries(test_torsion_coupling PRIVATE cabledyn_core) add_test(NAME torsion_coupling COMMAND test_torsion_coupling) @@ -2793,6 +2800,7 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") -Wno-maybe-uninitialized) target_compile_options(test_torsion_deck PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) target_compile_options(test_hermite_cable_control PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) + target_compile_options(test_syrope_control PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) endif() if(CABLEDYN_ENABLE_COVERAGE) diff --git a/doc/capabilities.rst b/doc/capabilities.rst index ee587417..8af5e0d3 100644 --- a/doc/capabilities.rst +++ b/doc/capabilities.rst @@ -79,8 +79,9 @@ Line and constitutive capability - Supported with limits - dynamic line with OWC and two history states, single-section and taut or between linear-elastic ``EI = 0`` sections (chain–polyester–chain), with the seabed, Morison loads, - current, waves, host fluid fields and VIV of any ``EI = 0`` line; finite-EI combinations - fail closed by name + current, waves, host fluid fields and VIV of any ``EI = 0`` line, and active line control + of a Syrope segment in coupled OpenFAST runs (its slow stretch carried over the length + change, as in MoorDyn); finite-EI combinations fail closed by name * - Torsion of finite-EI lines - Supported with limits - isotropic torsion of a finite-EI line restrained in torsion at both ends @@ -210,7 +211,7 @@ OpenFAST coverage The ``CompMooring = 5`` shell covers normal coupled time-domain stepping with its own ``dtM``, nonzero ``PtfmInit``, correction iterations, SeaState fields, checkpoint/restart, scoped quasi-static ``dYdu`` linearisation, line failures, active-tension control of ``EI = 0`` lines -and finite-EI cables, and FAST.Farm shared moorings. Restart and linearisation do not arise under +(linear-elastic or Syrope segments) and finite-EI cables, and FAST.Farm shared moorings. Restart and linearisation do not arise under FAST.Farm, which does not call those module operations, and active-tension control is rejected there. See :doc:`openfast` for setup and :doc:`coupling_boundary` for the interface contract. diff --git a/doc/driver_format.md b/doc/driver_format.md index 52f8960a..49421a57 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -302,7 +302,8 @@ and `BA = BA_s|BA_d`: initialisation, or a composite line whose other sections are linear-elastic `EI = 0` sections (a chain–polyester–chain mooring), with every Syrope element in tension at initialisation. It runs on a dynamic deck (`dtM`/`TMax`) and takes the seabed, `bathymetryFile`, Morison loads, current, - waves, host fluid fields and VIV of any `EI = 0` line. + waves, host fluid fields and VIV of any `EI = 0` line, and active line control of a Syrope + segment on the OpenFAST route ([CONTROL](#control-optional-openfast-line-control)). - The static start solves each Syrope element on the rest curve of its load history (the OWC, or the `Tmax0` working curve under `SYROPE IC`). A single-section line takes one secant EA from the curve at its mean strain; on a composite line, where the tension varies along a sagging Syrope @@ -1111,6 +1112,14 @@ bounds that would make it zero or negative (possible when it is shorter than hal advance (with the force blend, the default, the step-start force; under `False alpha_force_blend`, lengths blended with the configuration), so a length ramp is followed without lag at any `rhoInf`. +- A Syrope polyester segment (a Syrope line, or a composite line whose fairlead-side section is + Syrope) carries its slow stretch over the length change, as MoorDyn-F and MoorDyn-C carry it: + they keep the stretch `dl_1` of the segment as its state and read its slow strain as `dl_1` + over the new length. The running maximum tension is kept, and the slow-strain rate takes the + chord rate without the paid-out term, as MoorDyn's Syrope rate does. A slow pay-out therefore + unloads the segment along the working curve of its load history, and a haul-in beyond the + running maximum follows the OWC and raises it. A viscoelastic segment cannot be controlled: + initialisation stops with a message. - On a finite-EI cable, which runs from a `Fixed` anchor to a host-driven fairlead, the segment is the fairlead segment of the deck mesh (the length of the `SECTIONS` row at the fairlead over its `NumSegs`). Where the static initialisation refined the mesh, it is the cable elements that diff --git a/doc/openfast.rst b/doc/openfast.rst index 0bb67586..2c25b6fe 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -385,7 +385,9 @@ without an auxiliary process: * **Active tensioning** maps ServoDyn ``CableDeltaL``/``CableDeltaLdot`` control onto the fairlead-side segment of ``EI = 0`` lines and finite-EI cables, the segment at the line's end on a host-driven point, or at the ``NodeB`` written in the deck when both or neither ends are - (:doc:`driver_format`, CONTROL). On a finite-EI cable the command scales every cable element + (:doc:`driver_format`, CONTROL). A Syrope polyester segment carries its slow stretch over + the length change, as MoorDyn-F and MoorDyn-C do; a viscoelastic segment cannot be controlled. + On a finite-EI cable the command scales every cable element of that segment, and needs the force-blended generalised-α (the default). On both kinds a command outside MoorDyn-F's bounds, from minus half to plus one ``UnstrLen``/N of the line (the controlled segment's initial length on a line of one section), stops the run with a diff --git a/doc/theory.rst b/doc/theory.rst index fb9ad00b..edc15a9e 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -757,7 +757,8 @@ The slow strain is eliminated implicitly in every in-step evaluation: a projecte backward-Euler solve, :math:`\varepsilon_\text{slow}^{n+1} = \varepsilon_\text{slow}^{n} + \Delta t\,\dot\varepsilon_\text{slow}(\varepsilon_\text{slow}^{n+1}, \varepsilon, \dot\varepsilon)` constrained to :math:`\varepsilon_\text{slow} \ge 0`, gives the slow strain that the force -uses. The tangent carries :math:`\partial\varepsilon_\text{slow}^{n+1}/\partial(\varepsilon, \dot\varepsilon)` +uses (safeguarded Newton steps, finished by bisection where they stall next to a kink of the +interpolated curves, as at the top of the working curve). The tangent carries :math:`\partial\varepsilon_\text{slow}^{n+1}/\partial(\varepsilon, \dot\varepsilon)` from the implicit-function theorem. The step commits that same slow strain, so the force applied to the nodes equals the reported tension. The working curve is the one regenerated at the committed :math:`T_\text{max}`. The branch follows the evaluated slow strain: the working curve @@ -2793,6 +2794,30 @@ of the step to 3e-8 N, where applying the whole change in the first sub-step dep line-system step halved after a failure, which take their sub-steps as given, apply the whole change in their first part. +A Syrope segment keeps its states over a length change as MoorDyn-F and MoorDyn-C keep them. +Their state is the segment's slow stretch :math:`\Delta l_1 = \varepsilon_\text{slow} L_0`, which a +change of :math:`L_0` leaves as it is, and the mean tension reads the slow strain +:math:`\Delta l_1/L_0` at the new length. CableDyn stores the slow strain of the committed state, +a strain of :math:`L_{0,c}`, and reads it at the present length, + +.. math:: + + \varepsilon_\text{slow}(L_0) = \varepsilon_\text{slow}\,\frac{L_{0,c}}{L_0}, + +so the step's backward-Euler update +:math:`\varepsilon_\text{slow}^{n+1} = \varepsilon_\text{slow}^{n} L_{0,c}/L_0 + \Delta t\,\dot\varepsilon_\text{slow}` +is that of MoorDyn's :math:`\mathrm{d}\Delta l_1/\mathrm{d}t = L_0\,\dot\varepsilon_\text{slow}`; the +committed force of the force blend reads the state at :math:`L_{0,c}` as it is. The running +maximum, a tension, is kept, and the slow-strain rate takes the chord rate +:math:`\dot\varepsilon = \mathbf{t}\cdot\Delta\mathbf{v}/L_0` without the paid-out term, as +MoorDyn's Syrope rate does. A slow pay-out therefore unloads the segment along the working curve +of its load history, and a haul-in beyond :math:`T_\text{max}` follows the OWC and raises it. On a +taut 100 m polyester line whose fairlead segment is paid out by 0.5 m, hauled in to −1 m and paid +back over 80 s, every element's tension follows the rest curve of its history at the line strain +to 2.5e-4 of the initial tension along the ramps and to 6e-7 at rest; after a length step it is +MoorDyn's at the carried stretch to round-off, where carrying the strain instead would be off by +0.4 to 2.4 %. A viscoelastic segment cannot be controlled. + On a finite-EI cable, whose fairlead is End A, the command acts on the cable elements that make up the End-A segment of the deck mesh, of initial length :math:`S`. Each element scales by :math:`\lambda = (S + \Delta L)/S`, :math:`L_{0,e} = \lambda L_{0,e,\text{base}}`, with rate diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 0aea2320..5afee88f 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -3562,6 +3562,20 @@ def test_control_rows_may_name_finite_ei_cables_on_the_coupled_route(): assert [row.tokens for row in deck._rows("CONTROL")] == [("1", "4"), ("2", "1,3")] +def test_control_rows_may_name_syrope_lines_on_the_coupled_route(): + # native CD_Init_Deck_Aggregate controls a Syrope segment too (its slow stretch carries over + # the length change, as in MoorDyn-F/C), so the mirror accepts the row + source = (ROOT / "examples/syrope_polyester_mooring.dat").read_text(encoding="utf-8") + marker = "--------------------- OPTIONS" + assert source.count(marker) == 1 + block = ( + "--------------------- CONTROL ----------------------------------------\n" + "ChannelID Lines\n(-) (-)\n1 1\n" + ) + deck = DeckFile.from_text(source.replace(marker, block + marker, 1), caller_driven=True) + assert [row.tokens for row in deck._rows("CONTROL")] == [("1", "1")] + + # --------------------------------------------------------------------------- # Editing API error contract # --------------------------------------------------------------------------- diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index bb4bb89a..eac38597 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -7907,7 +7907,8 @@ SUBROUTINE build_aggregate_control_table(ctrls, lines, points, rods, sections, t !! UnstrLen and N, summed over the line's sections), from which the apply takes !! MoorDyn-F's command bounds. Every capability check runs here (a finite-EI line also !! needs the force-blended generalised-alpha), so the apply loop cannot fail for input - !! reasons after its prevalidation. + !! reasons after its prevalidation. An EI = 0 segment may be linear-elastic or Syrope (its + !! slow stretch carries over the length change); a viscoelastic one fails closed. TYPE(DeckControl), INTENT(IN) :: ctrls(:) TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) @@ -8003,13 +8004,8 @@ SUBROUTINE build_aggregate_control_table(ctrls, lines, points, rods, sections, t 'segment; active line control is not supported on the viscoelastic model'); RETURN END IF END IF - IF (agg%sys%lines(obj)%has_syrope) THEN - IF (agg%sys%lines(obj)%syrope_is(e)) THEN - ! the same rule for the Syrope working-curve states - CALL fail(ErrStat, ErrMsg, 'CONTROL line '//TRIM(lid)//' targets a Syrope segment; active '// & - 'line control is not supported on the Syrope model'); RETURN - END IF - END IF + ! A Syrope controlled segment carries its slow stretch over each length change, as + ! MoorDyn-F/C do (CD_Update_Model_SegmentLength), so it needs no check here. ELSE ! the coupled cable builder makes End A the host-driven fairlead and End B the ! Fixed anchor; any other arrangement would control a segment that is not the diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index 90d7b613..bf74b813 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -328,7 +328,9 @@ MODULE CableDyn_Model ! load-history-dependent alternative to the series-Kelvin law. syrope_is(:) marks the Syrope ! elements; syrope_type(:) holds each element's constitutive data (OWC ! table + working-curve shape + spring/dashpot constants -- immutable after - ! init). syrope_slow is the committed slow-spring static strain (the STATE) + ! init). syrope_slow is the committed slow-spring static strain (the STATE), a strain of + ! the unstretched length the committed state was reached with (l0_c; after a length change + ! by active line control the element reads it at its present length, model_syrope_slow), ! and syrope_tmax the running maximum mean tension (a second, monotone STATE ! whose growth regenerates the working curve on demand). Syrope elements ! share the ea_dyn/ba_dyn masking with the viscoelastic path (their elastic @@ -3773,7 +3775,9 @@ END FUNCTION CD_Model_Has_Syrope SUBROUTINE CD_Get_Model_Syrope_State(model, slow, tmax, ErrStat, ErrMsg) !! Copy the per-element Syrope committed states -- the slow-spring static strain !! slow and the running-maximum tension tmax (each size n_elem) -- for the coupled - !! checkpoint mirror. A non-Syrope model returns zeros (total accessor). + !! checkpoint mirror. A non-Syrope model returns zeros (total accessor). The slow strain + !! is that of the lengths the committed state was reached with (l0_c), the lengths a + !! checkpoint restart re-applies as committed (CD_Update_Model_SegmentLength, restored). TYPE(CD_ModelType), INTENT(IN) :: model REAL(wp), INTENT(OUT) :: slow(:), tmax(:) INTEGER, INTENT(OUT) :: ErrStat @@ -4936,7 +4940,8 @@ SUBROUTINE CD_Update_Model_SegmentLength(model, elem, l0_new, l0_dot, ErrStat, E !! term. restored = .TRUE. (a checkpoint restart re-applying the command of !! the committed state) makes the new length and rate the committed ones as well. A rate !! of -0 is stored as +0, so a zero command of either sign leaves an uncontrolled model - !! bit-identical (the committed-length test compares bits). + !! bit-identical (the committed-length test compares bits). On a Syrope element the slow + !! stretch eps_slow*l0 is carried over the change (model_syrope_slow). TYPE(CD_ModelType), INTENT(INOUT) :: model INTEGER, INTENT(IN) :: elem REAL(wp), INTENT(IN) :: l0_new, l0_dot @@ -4977,16 +4982,10 @@ SUBROUTINE CD_Update_Model_SegmentLength(model, elem, l0_new, l0_dot, ErrStat, E RETURN END IF END IF - IF (model%has_syrope) THEN - IF (model%syrope_is(elem)) THEN - ! the Syrope strain states partition against the INIT-time natural - ! length; no rescaling law for a controlled Syrope segment, so this - ! composition fails closed by name (same rule as the viscoelastic path) - CALL fail(ErrStat, ErrMsg, 'segment-length update on a Syrope element is not supported: '// & - 'the working-curve strain states have no length-rescaling law') - RETURN - END IF - END IF + ! A Syrope element keeps its states as they are: the slow strain stays the committed state's, + ! a strain of l0_c, and the element reads it at its present length (model_syrope_slow), so + ! its slow STRETCH carries over the length change as MoorDyn-F/C carry it; the running + ! maximum, a tension, does not depend on the length. ! The update is atomic: every length-dependent quantity is built from a trial ! length vector first, and the committed fields are mutated only once all builds ! succeeded. @@ -5643,9 +5642,9 @@ SUBROUTINE CD_Get_Model_Internal_Rates(model, ve_rate, syrope_rate, ErrStat, Err END IF slow_at = CD_Syrope_Branch_Divider(model%syrope_type(e), model%syrope_tmax(e)) CALL CD_Syrope_Element_Load(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), model%syrope_type(e), & - ws, wt, wsl, model%syrope_slow(e) < slow_at, model%syrope_slow(e), & - model%tension_only, f6, jq6, t_mean, dslow, es, em, dt=CD_ZERO, & - divider=slow_at) + ws, wt, wsl, model_syrope_slow(model, e) < slow_at, & + model_syrope_slow(model, e), model%tension_only, f6, jq6, t_mean, dslow, & + es, em, dt=CD_ZERO, divider=slow_at) IF (es /= CD_SYROPE_OK) THEN CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN END IF @@ -7449,14 +7448,15 @@ SUBROUTINE model_syrope_element(model, e, q2, v2, force, jac_q, jac_v, t_mean, d !! selects the branch by the evaluated slow strain vs the branch divider at !! that maximum, and calls the element load. Inside a step (ve_dt > 0) the !! slow strain is eliminated by the same backward-Euler solve the commit makes; - !! outside (ve_dt = 0) the committed state is used as is. + !! outside (ve_dt = 0) the committed state is used as is. The slow strain is the committed + !! one at the element's present length (model_syrope_slow). TYPE(CD_ModelType), INTENT(IN) :: model INTEGER, INTENT(IN) :: e REAL(wp), INTENT(IN) :: q2(6), v2(6) REAL(wp), INTENT(OUT) :: force(6), jac_q(6, 6), jac_v(6, 6), t_mean, dslow INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg - REAL(wp) :: ws(CD_SYROPE_NWC), wt(CD_SYROPE_NWC), wsl(CD_SYROPE_NWC), slow_at + REAL(wp) :: ws(CD_SYROPE_NWC), wt(CD_SYROPE_NWC), wsl(CD_SYROPE_NWC), slow_at, slow LOGICAL :: on_wc INTEGER :: es CHARACTER(200) :: em @@ -7471,9 +7471,10 @@ SUBROUTINE model_syrope_element(model, e, q2, v2, force, jac_q, jac_v, t_mean, d END IF ! the branch follows the evaluated slow strain against the continuous divider slow_at = CD_Syrope_Branch_Divider(model%syrope_type(e), model%syrope_tmax(e)) - on_wc = model%syrope_slow(e) < slow_at + slow = model_syrope_slow(model, e) + on_wc = slow < slow_at CALL CD_Syrope_Element_Load(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), model%syrope_type(e), & - ws, wt, wsl, on_wc, model%syrope_slow(e), model%tension_only, & + ws, wt, wsl, on_wc, slow, model%tension_only, & force, jac_q, t_mean, dslow, es, em, jac_v=jac_v, dt=model%ve_dt, & divider=slow_at) IF (es /= CD_SYROPE_OK) THEN @@ -7488,7 +7489,9 @@ SUBROUTINE model_syrope_state_next(model, e, q2, v2, dt, slow_next, t_mean, ErrS !! caller invokes this for every element before the atomic commit pass. The !! candidate comes from the element load's own implicit elimination, so the !! committed slow strain is bit-identical to the one the converged in-step - !! force was evaluated at. A candidate beyond the OWC table fails the step. + !! force was evaluated at. A candidate beyond the OWC table fails the step. The advance + !! starts from the committed slow strain at the element's present length + !! (model_syrope_slow), so after a length change it integrates MoorDyn's slow stretch. TYPE(CD_ModelType), INTENT(IN) :: model INTEGER, INTENT(IN) :: e REAL(wp), INTENT(IN) :: q2(6), v2(6), dt @@ -7496,12 +7499,13 @@ SUBROUTINE model_syrope_state_next(model, e, q2, v2, dt, slow_next, t_mean, ErrS INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg REAL(wp) :: ws(CD_SYROPE_NWC), wt(CD_SYROPE_NWC), wsl(CD_SYROPE_NWC) - REAL(wp) :: chord(3), length, eps, slow_at, f6(6), jq6(6, 6), dslow + REAL(wp) :: chord(3), length, eps, slow_at, f6(6), jq6(6, 6), dslow, slow LOGICAL :: on_wc INTEGER :: es CHARACTER(200) :: em - slow_next = model%syrope_slow(e) + slow = model_syrope_slow(model, e) + slow_next = slow t_mean = CD_ZERO chord = q2(4:6) - q2(1:3) length = NORM2(chord) @@ -7519,9 +7523,9 @@ SUBROUTINE model_syrope_state_next(model, e, q2, v2, dt, slow_next, t_mean, ErrS CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN END IF slow_at = CD_Syrope_Branch_Divider(model%syrope_type(e), model%syrope_tmax(e)) - on_wc = model%syrope_slow(e) < slow_at + on_wc = slow < slow_at CALL CD_Syrope_Element_Load(q2(1:3), q2(4:6), v2(1:3), v2(4:6), model%l0(e), model%syrope_type(e), & - ws, wt, wsl, on_wc, model%syrope_slow(e), model%tension_only, & + ws, wt, wsl, on_wc, slow, model%tension_only, & f6, jq6, t_mean, dslow, es, em, dt=dt, slow_next=slow_next, divider=slow_at) IF (es /= CD_SYROPE_OK) THEN CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN @@ -7547,6 +7551,25 @@ SUBROUTINE model_syrope_state_next(model, e, q2, v2, dt, slow_next, t_mean, ErrS ErrMsg = '' END SUBROUTINE model_syrope_state_next + PURE REAL(wp) FUNCTION model_syrope_slow(model, e) RESULT(slow) + !! The slow strain of Syrope element e at its present unstretched length l0(e). The state + !! syrope_slow is a strain of the length the committed state was reached with, l0_c(e). + !! MoorDyn-F and MoorDyn-C keep the slow STRETCH of a segment, dl_1 = eps_slow*l, as its + !! state, and an unstretched-length change leaves it as it is (MoorDyn-F sets l(N) and ld(N) + !! of a controlled line; MoorDyn-C's setUnstretchedLength sets every l[i]); their mean + !! tension reads the slow strain dl_1/l at the new length. So after a length change + !! eps_slow(l0) = eps_slow*l0_c/l0, + !! the stretch carried over, and a step from it, eps_slow^{n+1} = eps_slow^n l0_c/l0 + dt + !! d(eps_slow)/dt, is the backward-Euler step of MoorDyn's d(dl_1)/dt = l0 d(eps_slow)/dt + !! (with the chord rate, no paid-out term, as MoorDyn's Syrope rate takes it). The running + !! maximum, a tension, does not depend on the length. An element whose length is the + !! committed one (bit for bit, every element of an uncontrolled line) reads the state as is. + TYPE(CD_ModelType), INTENT(IN) :: model + INTEGER, INTENT(IN) :: e + slow = model%syrope_slow(e) + IF (.NOT. bits_equal(model%l0(e), model%l0_c(e))) slow = slow*(model%l0_c(e)/model%l0(e)) + END FUNCTION model_syrope_slow + SUBROUTINE model_contributor_load(model, q, v, force, jac_q, jac_v, ErrStat, ErrMsg) !! Assemble all configured non-structural model load contributors and tangents. TYPE(CD_ModelType), INTENT(INOUT) :: model diff --git a/src/CableDyn_Syrope.f90 b/src/CableDyn_Syrope.f90 index 511ef818..e77fb5f6 100644 --- a/src/CableDyn_Syrope.f90 +++ b/src/CableDyn_Syrope.f90 @@ -597,6 +597,31 @@ SUBROUTINE CD_Syrope_State_Advance(td, on_wc, wc_strain, wc_tension, wc_slow, sl END IF x = trial END DO + ! The safeguarded Newton step can creep along one side of the bracket when the root lies + ! closer to a kink of the rate than its difference interval h, where the slope of + ! T_mean(eps_slow) changes (the top sample of the working curve, beyond which its + ! interpolation clamps at T_max, as when a rope rests on its OWC at its running maximum): + ! the difference quotient straddles the kink, and every step lands inside the bracket and + ! moves only that end. Finish then by bisection, which halves the bracket every iteration + ! (R is continuous on it, so the bracket closes on its root) until the residual test is met. + ! A solve that converged above never gets here, so its result is unchanged. + DO iter = 1, 200 + x = 0.5_wp*(lo + hi) + IF (.NOT. (x > lo .AND. x < hi)) EXIT + CALL eval_rate(x, rate, tension, t_mean) + IF (ErrStat /= CD_SYROPE_OK) RETURN + residual = x - slow_old - dt*rate + tol = RTOL*MAX(CD_ONE, ABS(x), ABS(slow_old), ABS(dt*rate)) + IF (ABS(residual) <= tol) THEN + slow_next = x + RETURN + END IF + IF (residual < CD_ZERO) THEN + lo = x + ELSE + hi = x + END IF + END DO CALL fail(ErrStat, ErrMsg, 'Syrope backward-Euler state solve did not converge') CONTAINS diff --git a/tests/test_syrope.f90 b/tests/test_syrope.f90 index 31658bc6..d8a1c621 100644 --- a/tests/test_syrope.f90 +++ b/tests/test_syrope.f90 @@ -7,7 +7,9 @@ PROGRAM test_syrope !! constants -- working-curve generation for all three shapes, the static strain split, the !! rate/tension evaluation on !! both branches, the running-max regeneration event, and the fail-closed - !! battery. + !! battery. The backward-Euler state solve also converges when its root sits at the top + !! sample of the working curve (a rope at rest on its OWC at its running maximum), where the + !! safeguarded Newton step alone crept along one side of the bracket and the solve failed. USE CableDyn_Precision, ONLY: wp USE CableDyn_Syrope, ONLY: CD_SyropeType, CD_Syrope_Init, CD_Syrope_End, & CD_Syrope_Working_Curve, CD_Syrope_Find_Strains, & @@ -68,6 +70,7 @@ PROGRAM test_syrope CALL case_owc_branch_and_running_max() CALL case_interp_clamps() CALL case_projected_state_advance() + CALL case_state_advance_at_wc_top() CALL case_element_load() CALL case_model_legacy_ba_mask() CALL case_model_held() @@ -353,6 +356,45 @@ SUBROUTINE case_projected_state_advance() CALL CD_Syrope_End(td) END SUBROUTINE case_projected_state_advance + SUBROUTINE case_state_advance_at_wc_top() + !! A rope held at rest on its OWC at its running maximum: the backward-Euler root lies just + !! above the top sample of the working curve's slow strains, where T_mean(eps_slow) stops + !! rising (it clamps at T_max up to the branch divider), closer to it than the Newton + !! step's difference interval. The state of a run (LINEAR, k1 = 0.5, BA_s|BA_d = 1e6|1e5, + !! a line hauled in and held) on which the safeguarded Newton step crept 80 iterations + !! along that kink and the solve failed; the bisection that finishes the solve meets the + !! residual test, between the kink and the divider, at the curve's top tension. + TYPE(CD_SyropeType) :: td + REAL(wp), PARAMETER :: TMAX = 1.7790941510791376e6_wp, SLOW0 = 2.0004433178640910e-2_wp, & + EPS = 3.0303024894996432e-2_wp, DEPS = -1.4208693414705444e-13_wp, DT = 5.0e-2_wp + REAL(wp) :: ws(CD_SYROPE_NWC), wt(CD_SYROPE_NWC), wsl(CD_SYROPE_NWC) + REAL(wp) :: slow_next, t_mean, divider, rate, tension, mean, residual + INTEGER :: es + CHARACTER(200) :: em + CALL CD_Syrope_Init(td, OWC_EPS, OWC_TEN, CD_SYROPE_WC_LINEAR, 0.5_wp, 0.0_wp, & + ALPHA, BETA, 1.0e6_wp, 1.0e5_wp, es, em) + CALL require(es == CD_SYROPE_OK, 'wc-top:init') + CALL CD_Syrope_Working_Curve(td, TMAX, ws, wt, wsl, es, em) + CALL require(es == CD_SYROPE_OK, 'wc-top:wc') + divider = CD_Syrope_Branch_Divider(td, TMAX) + CALL CD_Syrope_State_Advance(td, SLOW0 < divider, ws, wt, wsl, SLOW0, EPS, DEPS, DT, slow_next, t_mean, & + es, em, divider=divider) + CALL require(es == CD_SYROPE_OK, 'wc-top:the solve converges: '//TRIM(em)) + CALL CD_Syrope_Rate_And_Tension(td, slow_next < divider, ws, wt, wsl, slow_next, EPS, DEPS, rate, tension, & + mean, es, em) + residual = slow_next - SLOW0 - DT*rate + WRITE (*, '(A,ES16.9,A,ES10.3,A,ES12.5,A)') ' wc-top: slow strain ', slow_next, ', residual ', residual, & + ', mean tension ', mean, ' N' + CALL require(ABS(residual) <= 5.0e-13_wp .AND. slow_next > wsl(CD_SYROPE_NWC) .AND. slow_next < divider .AND. & + bits_same(mean, wt(CD_SYROPE_NWC)) .AND. bits_same(mean, t_mean), 'wc-top:root at the curve top') + CALL CD_Syrope_End(td) + END SUBROUTINE case_state_advance_at_wc_top + + LOGICAL FUNCTION bits_same(a, b) RESULT(same) + REAL(wp), INTENT(IN) :: a, b + same = TRANSFER(a, 0_8) == TRANSFER(b, 0_8) + END FUNCTION bits_same + SUBROUTINE case_element_load() !! The element load wraps the kernel: a colinear element stretched to a !! chosen total strain reports the MoorDyn tension along its tangent, the diff --git a/tests/test_syrope_control.f90 b/tests/test_syrope_control.f90 new file mode 100644 index 00000000..43ca728f --- /dev/null +++ b/tests/test_syrope_control.f90 @@ -0,0 +1,732 @@ +! File: tests/test_syrope_control.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_syrope_control + !! Active line control (CONTROL, the OpenFAST CableDeltaL route of CD_Init_Deck_Aggregate) of a + !! Syrope polyester segment. MoorDyn-F and MoorDyn-C keep each segment's slow STRETCH + !! dl_1 = eps_slow*l as its state and leave it as it is when the unstretched length l changes; + !! the slow strain after a change is dl_1/l at the new length. The oracles below evaluate the + !! MoorDyn law from the shipped OWC table and the working-curve formula, independently of the + !! CableDyn_Syrope kernel. The decks are written here: 100 m of polyester (10 segments) held + !! taut between a Coupled fairlead and a Fixed anchor 102 m apart at mid-depth, nearly neutrally + !! buoyant so that the tension is uniform, with a LINEAR working curve (k1 = 0.5) and a light + !! BA_s|BA_d = 1e6|1e5 N s (slow-spring relaxation time (BA_s + BA_d)/K1 of about 6 ms). + !! 1. Quasi-static pay-out and haul-in: the fairlead segment is paid out by 0.5 m over 20 s, + !! hauled in to -1 m over 40 s and paid back to 0 over 20 s, with 4 s holds. Every element's + !! tension follows the rest curve of its load history at the line's strain D/L(t) - 1: the + !! working curve of the static tension while unloading, the OWC beyond it (the running + !! maximum ratchets), then the working curve of the new maximum, which ends the cycle below + !! the initial tension. Gated over the ramps (the lag of the slow spring) and at the ends + !! of the holds (the rest point). + !! 2. A length step from rest (pay-out 5 cm, haul-in 4 cm): the tension right after the + !! change is MoorDyn's at the carried stretch, T = T_mean + BA_s d(eps_slow)/dt with + !! eps_slow = eps_slow,0 l_1/l_2, and the slow strain after one step is the backward-Euler + !! step of d(dl_1)/dt = l_2 d(eps_slow)/dt from the carried stretch; the other elements are + !! untouched. The strain-carrying alternative (eps_slow kept) is printed for contrast. + !! 3. Checkpoint restart in the middle of a pay-out ramp and in the hold after it: a fresh + !! instance takes the coupled kinematics, the line interior [q; v; a] and the Syrope states + !! of the first, re-applies the command as the committed one (restored), and both continue + !! bit for bit. + !! 4. Composite lines: a polyester-chain line (the controlled segment is Syrope) takes the + !! oracle of 2 at its fairlead element and runs a ramp; a chain-polyester-chain line (the + !! controlled segment is chain) leaves its Syrope states untouched and runs the ramp. + !! Gates 1-3 and the polyester-chain line of 4 stopped at initialisation before (CONTROL on a + !! Syrope segment was refused). + USE CableDyn_Precision, ONLY: wp + USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_GetMovingPointMesh, & + CD_AGG_UpdateStates_Moving, CD_AGG_Step_Moving, CD_AGG_CalcOutput, & + CD_AGG_Apply_LineControl, CD_AGG_Get_Substep_Counts, CD_AGG_End, & + CD_AGG_OK + USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_System_Line_NElem, & + CD_Get_System_Line_State, CD_Get_System_Line_Tension, & + CD_Get_System_Line_Syrope_State, CD_Set_System_Line_Syrope_State, & + CD_Update_System_Line_Interior_State, CD_SYSTEM_OK + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: INT64 + IMPLICIT NONE + + INTEGER, PARAMETER :: NOWC = 30, NWC = 30 + ! the shipped data/syrope/syrope_owc.dat table + REAL(wp), PARAMETER :: OWC_EPS(NOWC) = [ & + 0.00000e+00_wp, 2.06897e-03_wp, 4.13793e-03_wp, 6.20690e-03_wp, 8.27586e-03_wp, & + 1.03448e-02_wp, 1.24138e-02_wp, 1.44828e-02_wp, 1.65517e-02_wp, 1.86207e-02_wp, & + 2.06897e-02_wp, 2.27586e-02_wp, 2.48276e-02_wp, 2.68966e-02_wp, 2.89655e-02_wp, & + 3.10345e-02_wp, 3.31034e-02_wp, 3.51724e-02_wp, 3.72414e-02_wp, 3.93103e-02_wp, & + 4.13793e-02_wp, 4.34483e-02_wp, 4.55172e-02_wp, 4.75862e-02_wp, 4.96552e-02_wp, & + 5.17241e-02_wp, 5.37931e-02_wp, 5.58621e-02_wp, 5.79310e-02_wp, 6.00000e-02_wp] + REAL(wp), PARAMETER :: OWC_TEN(NOWC) = [ & + 0.00000e+00_wp, 1.71768e+05_wp, 3.30952e+05_wp, 4.78788e+05_wp, 6.16510e+05_wp, & + 7.45355e+05_wp, 8.66556e+05_wp, 9.81351e+05_wp, 1.09097e+06_wp, 1.19666e+06_wp, & + 1.29964e+06_wp, 1.40116e+06_wp, 1.50245e+06_wp, 1.60474e+06_wp, 1.70927e+06_wp, & + 1.81728e+06_wp, 1.93000e+06_wp, 2.04866e+06_wp, 2.17450e+06_wp, 2.30876e+06_wp, & + 2.45267e+06_wp, 2.60747e+06_wp, 2.77439e+06_wp, 2.95467e+06_wp, 3.14954e+06_wp, & + 3.36024e+06_wp, 3.58800e+06_wp, 3.83406e+06_wp, 4.09965e+06_wp, 4.38601e+06_wp] + ! the polyester constants of the decks: alpha|beta of the EA column, BA_s|BA_d, the LINEAR k1 + REAL(wp), PARAMETER :: ALPHA = 1.53e8_wp, BETA = 23.12_wp, BA_S = 1.0e6_wp, BA_D = 1.0e5_wp, K1W = 0.5_wp + REAL(wp), PARAMETER :: PI = 3.141592653589793_wp, DT = 0.05_wp + INTEGER :: nfail = 0 + + CALL write_owc('sctl_owc.dat') + CALL write_settings('sctl_settings.dat', 'sctl_owc.dat') + CALL write_deck('sctl_single.dat', 'single') + CALL write_deck('sctl_poly_chain.dat', 'poly_chain') + CALL write_deck('sctl_chain_poly_chain.dat', 'chain_poly_chain') + CALL write_deck('sctl_single_noblend.dat', 'single', no_force_blend=.TRUE.) + + CALL case_quasi_static('sctl_single.dat', 'quasi-static') + CALL case_quasi_static('sctl_single_noblend.dat', 'quasi-static, False alpha_force_blend') + CALL case_length_step('sctl_single.dat', 0.05_wp, 'pay-out step') + CALL case_length_step('sctl_single.dat', -0.04_wp, 'haul-in step') + CALL case_restart() + CALL case_composite() + + IF (nfail > 0) THEN + PRINT '(I0,A)', nfail, ' assertion(s) failed' + ERROR STOP 1 + END IF + PRINT '(A)', 'all Syrope line-control checks passed' + +CONTAINS + + ! --------------------------------------------------------------------------------------------- + ! 1. quasi-static pay-out and haul-in + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_quasi_static(deck, what) + CHARACTER(*), INTENT(IN) :: deck, what + TYPE(CD_AGG_ModuleType) :: agg + INTEGER, PARAMETER :: NSTEP = 1840 + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), dl, dldot, t, chord, l_tot, eps, t_o, tmax_o + REAL(wp) :: t0, err_ramp, err_hold, hold_at(3), t_end, wc_lo + REAL(wp), ALLOCATABLE :: ten(:) + INTEGER :: es, ni, s, il, ec, ne, k, n_hold + LOGICAL :: cv, st, ok + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//': the controlled Syrope deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (ten(ne)) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + CALL require(md%has_syrope .AND. md%syrope_is(ec), what//': the controlled segment is Syrope') + chord = NORM2(md%q(3*md%elem_conn(2, ne) - 2:3*md%elem_conn(2, ne)) - & + md%q(3*md%elem_conn(1, 1) - 2:3*md%elem_conn(1, 1))) + l_tot = SUM(md%l0) + END ASSOCIATE + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + t0 = ten(ec) + ! a virgin rope: the static tension on the OWC, and the running maximum starts there + tmax_o = owc_t(chord/l_tot - 1.0_wp) + PRINT '(A,F9.4,A,F9.4,A,ES12.5,A,ES12.5,A)', ' line chord ', chord, ' m, unstretched ', l_tot, & + ' m: static tension ', t0, ' N, OWC ', tmax_o, ' N' + CALL require(ABS(t0 - tmax_o) <= 1.0e-8_wp*tmax_o .AND. MAXVAL(ABS(ten - t0)) <= 1.0e-8_wp*t0, & + what//': the line starts on its OWC with a uniform tension') + hold_at = [24.0_wp, 68.0_wp, 92.0_wp] + err_ramp = 0.0_wp + err_hold = 0.0_wp + n_hold = 0 + wc_lo = HUGE(1.0_wp) + ok = .TRUE. + DO s = 1, NSTEP + t = REAL(s, wp)*DT + CALL cycle_command(t, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg, [dl], [dldot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + ok = .FALSE. + CALL require(.FALSE., what//': step at t = '//TRIM(fmt_real(t))//': '//TRIM(em)) + EXIT + END IF + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + ! the oracle: the rest curve of the load history at the line's strain + eps = chord/(l_tot + dl) - 1.0_wp + t_o = rest_tension(eps, tmax_o) + wc_lo = MIN(wc_lo, t_o) + err_ramp = MAX(err_ramp, MAXVAL(ABS(ten - t_o))/t0) + DO k = 1, 3 + IF (ABS(t - hold_at(k)) < 0.5_wp*DT) THEN + err_hold = MAX(err_hold, MAXVAL(ABS(ten - t_o))/t_o) + n_hold = n_hold + 1 + PRINT '(A,F6.1,A,F7.3,A,ES12.5,A,ES12.5,A,ES10.3)', ' '//what//', end of hold t = ', t, ' s, DeltaL = ', dl, & + ' m: tension ', ten(ec), ' N, rest curve ', t_o, ' N, rel. difference ', ABS(ten(ec) - t_o)/t_o + END IF + END DO + END DO + IF (ok) THEN + t_end = ten(ec) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + PRINT '(A,ES12.5,A,ES12.5,A)', ' running maximum after the haul-in ', md%syrope_tmax(ec), ' N (oracle ', & + tmax_o, ' N)' + CALL require(ABS(md%syrope_tmax(ec) - tmax_o) <= 1.0e-6_wp*tmax_o, & + what//': the haul-in ratchets the running maximum to the OWC tension at its top') + CALL require(bits_eq(md%l0(ec), agg%ctrl_base_l0(1)), & + what//': the cycle returns the segment to its base length') + END ASSOCIATE + PRINT '(A,ES10.3,A,ES10.3)', ' max |T - T_rest| / T0 over the ramps ', err_ramp, & + '; at the ends of the holds / T_rest ', err_hold + PRINT '(A,ES12.5,A,ES12.5,A)', ' back at the base length: tension ', t_end, ' N, initial ', t0, & + ' N (the working curve of the new maximum)' + CALL require(n_hold == 3 .AND. err_hold <= 1.0e-6_wp, & + what//': at rest the tension is the rest-curve tension of the load history') + CALL require(err_ramp <= 3.0e-3_wp, what//': along the ramps the tension follows the rest curve') + CALL require(t_end < 0.6_wp*t0, what//': the cycle ends on the lower working curve of the new maximum') + END IF + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_quasi_static + + SUBROUTINE cycle_command(t, dl, dldot) + !! The command of gate 1: pay out 0.5 m on a half-cosine over 20 s, hold 4 s, haul in to + !! -1 m over 40 s, hold 4 s, pay back to 0 over 20 s, hold. + REAL(wp), INTENT(IN) :: t + REAL(wp), INTENT(OUT) :: dl, dldot + IF (t < 20.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 20.0_wp, 0.0_wp, 0.5_wp, dl, dldot) + ELSE IF (t < 24.0_wp) THEN + dl = 0.5_wp + dldot = 0.0_wp + ELSE IF (t < 64.0_wp) THEN + CALL half_cosine(t, 24.0_wp, 40.0_wp, 0.5_wp, -1.0_wp, dl, dldot) + ELSE IF (t < 68.0_wp) THEN + dl = -1.0_wp + dldot = 0.0_wp + ELSE IF (t < 88.0_wp) THEN + CALL half_cosine(t, 68.0_wp, 20.0_wp, -1.0_wp, 0.0_wp, dl, dldot) + ELSE + dl = 0.0_wp + dldot = 0.0_wp + END IF + END SUBROUTINE cycle_command + + SUBROUTINE half_cosine(t, t_start, span, a, b, x, xdot) + !! From a to b on a half-cosine over [t_start, t_start + span]. + REAL(wp), INTENT(IN) :: t, t_start, span, a, b + REAL(wp), INTENT(OUT) :: x, xdot + x = a + (b - a)*0.5_wp*(1.0_wp - COS(PI*(t - t_start)/span)) + xdot = (b - a)*0.5_wp*(PI/span)*SIN(PI*(t - t_start)/span) + END SUBROUTINE half_cosine + + REAL(wp) FUNCTION rest_tension(eps, tmax) RESULT(t) + !! The rest (quasi-static) tension at strain eps of a rope with running maximum tmax: the OWC + !! beyond the curve's top eps_owc(tmax), where tmax ratchets to it, else the LINEAR working + !! curve tmax (eps - eps_min)/(eps_max - eps_min), eps_min = eps_0 + k1 (eps_max - eps_0), + !! zero below eps_min. + REAL(wp), INTENT(IN) :: eps + REAL(wp), INTENT(INOUT) :: tmax + REAL(wp) :: e_max, e_min + e_max = owc_e(tmax) + IF (eps >= e_max) THEN + t = owc_t(eps) + tmax = MAX(tmax, t) + RETURN + END IF + e_min = OWC_EPS(1) + K1W*(e_max - OWC_EPS(1)) + t = 0.0_wp + IF (eps > e_min) t = tmax*(eps - e_min)/(e_max - e_min) + END FUNCTION rest_tension + + ! --------------------------------------------------------------------------------------------- + ! 2. a length step from rest + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_length_step(deck, step_dl, what) + CHARACTER(*), INTENT(IN) :: deck, what + REAL(wp), INTENT(IN) :: step_dl + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), l1, l2, eps, deps, t_md, t_alt, s_carry, s_be + REAL(wp), ALLOCATABLE :: slow0(:), tmax0(:), slow1(:), tmax1(:), ten0(:), ten1(:) + INTEGER :: es, ni, il, ec, ne, others + INTEGER(INT64) :: calls, events, capped, fallbacks + INTEGER :: max_used + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//': the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (slow0(ne), tmax0(ne), slow1(ne), tmax1(ne), ten0(ne), ten1(ne)) + CALL CD_Get_System_Line_Syrope_State(agg%sys%fast%system, il, slow0, tmax0, es, em) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten0, es, em) + l1 = agg%sys%fast%system%lines(il)%l0(ec) + CALL CD_AGG_Apply_LineControl(agg, [step_dl], [0.0_wp], es, em) + CALL require(es == CD_AGG_OK, what//': the command applies: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + l2 = md%l0(ec) + CALL require(md%syrope_is(ec) .AND. bits_eq(l2, l1 + step_dl), what//': the Syrope segment takes l1 + DeltaL') + CALL element_kinematics(md%q, md%v, md%elem_conn(:, ec), l2, eps, deps) + END ASSOCIATE + ! right after the change: MoorDyn's tension at the carried stretch, and the strain-carrying + ! alternative for contrast + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten1, es, em) + s_carry = slow0(ec)*l1/l2 + t_md = kernel_tension(s_carry, eps, deps, tmax0(ec)) + t_alt = kernel_tension(slow0(ec), eps, deps, tmax0(ec)) + others = COUNT(.NOT. bits_eq_v(ten1, ten0)) - MERGE(1, 0,.NOT. bits_eq(ten1(ec), ten0(ec))) + PRINT '(A,A,F6.3,A,ES12.5,A,ES12.5,A,ES12.5,A,ES10.3)', ' ', what, step_dl, ' m: tension ', ten0(ec), & + ' -> ', ten1(ec), ' N, MoorDyn (stretch carried) ', t_md, ' N, rel. difference ', ABS(ten1(ec) - t_md)/t_md + PRINT '(A,ES12.5,A,ES10.3,A)', ' strain carried instead: ', t_alt, ' N (', ABS(t_alt - t_md)/t_md, & + ' off MoorDyn)' + CALL require(ABS(ten1(ec) - t_md) <= 1.0e-10_wp*t_md, & + what//': the tension after the change is MoorDyn''s at the carried slow stretch') + CALL require(ABS(t_alt - t_md) > 1.0e-4_wp*t_md, what//': the oracle tells the stretch from the strain carry') + CALL require(others == 0, what//': the other elements keep their tension') + ! one step from the carried stretch: the backward-Euler step of d(dl_1)/dt = l2 d(eps_slow)/dt + CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + CALL require(es == CD_AGG_OK .AND. cv, what//': the step after the change converges: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Get_Substep_Counts(agg, calls, events, max_used, capped, fallbacks) + CALL CD_Get_System_Line_Syrope_State(agg%sys%fast%system, il, slow1, tmax1, es, em) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + CALL element_kinematics(md%q, md%v, md%elem_conn(:, ec), l2, eps, deps) + END ASSOCIATE + s_be = backward_euler(s_carry, eps, deps, tmax0(ec), DT) + PRINT '(A,ES16.9,A,ES16.9,A,ES10.3,A,I0,A)', ' slow strain after one step ', slow1(ec), ', oracle ', s_be, & + ' (rel. ', ABS(slow1(ec) - s_be)/s_be, '; ', events, ' sub-stepped steps)' + CALL require(events == 0 .AND. ABS(slow1(ec) - s_be) <= 1.0e-9_wp*s_be, & + what//': the step advances the carried slow stretch (backward Euler at the new length)') + IF (step_dl < 0.0_wp) THEN + PRINT '(A,ES12.5,A,ES12.5,A)', ' running maximum ', tmax0(ec), ' -> ', tmax1(ec), ' N' + CALL require(tmax1(ec) > tmax0(ec), what//': the haul-in onto the OWC ratchets the running maximum') + ELSE + CALL require(bits_eq(tmax1(ec), tmax0(ec)), what//': the pay-out leaves the running maximum') + END IF + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_length_step + + SUBROUTINE element_kinematics(q, v, conn, l0, eps, deps) + !! Strain and strain rate of one element, MoorDyn's dl/l and lstrd/l (the chord rate). + REAL(wp), INTENT(IN) :: q(:), v(:), l0 + INTEGER, INTENT(IN) :: conn(2) + REAL(wp), INTENT(OUT) :: eps, deps + REAL(wp) :: chord(3), length + chord = q(3*conn(2) - 2:3*conn(2)) - q(3*conn(1) - 2:3*conn(1)) + length = NORM2(chord) + eps = (length - l0)/l0 + deps = DOT_PRODUCT(chord/length, v(3*conn(2) - 2:3*conn(2)) - v(3*conn(1) - 2:3*conn(1)))/l0 + END SUBROUTINE element_kinematics + + REAL(wp) FUNCTION backward_euler(s0, eps, deps, tmax, h) RESULT(s) + !! The projected backward-Euler step s = max(0, root of s - s0 - h r(s)), by bisection. + REAL(wp), INTENT(IN) :: s0, eps, deps, tmax, h + REAL(wp) :: lo, hi, mid, rate, ten + INTEGER :: it + lo = 0.0_wp + CALL kernel_rate(lo, eps, deps, tmax, rate, ten) + s = 0.0_wp + IF (lo - s0 - h*rate >= 0.0_wp) RETURN + hi = 0.2_wp + DO it = 1, 200 + mid = 0.5_wp*(lo + hi) + CALL kernel_rate(mid, eps, deps, tmax, rate, ten) + IF (mid - s0 - h*rate < 0.0_wp) THEN + lo = mid + ELSE + hi = mid + END IF + END DO + s = 0.5_wp*(lo + hi) + END FUNCTION backward_euler + + REAL(wp) FUNCTION kernel_tension(slow, eps, deps, tmax) RESULT(t) + REAL(wp), INTENT(IN) :: slow, eps, deps, tmax + REAL(wp) :: rate + CALL kernel_rate(slow, eps, deps, tmax, rate, t) + END FUNCTION kernel_tension + + SUBROUTINE kernel_rate(slow, eps, deps, tmax, rate, ten) + !! MoorDyn's Syrope segment law (MoorDyn-C Line::getStateDeriv, MoorDyn-F Line_GetStateDeriv, + !! ElasticMod 4) in strain form: the mean tension from the slow strain on the working curve + !! of tmax (30 samples) below the OWC's slow strain at tmax and on the OWC from it, + !! K1 = alpha + beta T_mean, d(eps_slow)/dt = (K1 (eps - eps_curve(T_mean)) + BA_d deps)/(BA_s + + !! BA_d) and T = T_mean (eps >= 0) + BA_s d(eps_slow)/dt, clamped at zero (a line cannot push). + REAL(wp), INTENT(IN) :: slow, eps, deps, tmax + REAL(wp), INTENT(OUT) :: rate, ten + REAL(wp) :: we(NWC), wt(NWC), ws(NWC), os(NOWC), e_max, e_min, t_mean, e_curve + INTEGER :: k + DO k = 1, NOWC + os(k) = OWC_EPS(k) - fast_strain(OWC_TEN(k)) + END DO + e_max = owc_e(tmax) + e_min = OWC_EPS(1) + K1W*(e_max - OWC_EPS(1)) + DO k = 1, NWC + we(k) = e_min + (e_max - e_min)*REAL(k - 1, wp)/REAL(NWC - 1, wp) + wt(k) = tmax*(we(k) - e_min)/(e_max - e_min) + ws(k) = we(k) - fast_strain(wt(k)) + END DO + IF (slow < lin(tmax, OWC_TEN, os)) THEN + t_mean = lin(slow, ws, wt) + e_curve = lin(t_mean, wt, we) + ELSE + t_mean = lin(slow, os, OWC_TEN) + e_curve = lin(t_mean, OWC_TEN, OWC_EPS) + END IF + rate = ((ALPHA + BETA*t_mean)*(eps - e_curve) + BA_D*deps)/(BA_S + BA_D) + ten = BA_S*rate + IF (eps >= 0.0_wp) ten = ten + t_mean + ten = MAX(ten, 0.0_wp) + END SUBROUTINE kernel_rate + + REAL(wp) FUNCTION fast_strain(t) RESULT(e) + !! The exponential fast spring, eps_fast = ln(1 + (beta/alpha) T)/beta. + REAL(wp), INTENT(IN) :: t + e = LOG(1.0_wp + BETA/ALPHA*t)/BETA + END FUNCTION fast_strain + + ! --------------------------------------------------------------------------------------------- + ! 3. checkpoint restart + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_restart() + !! The shell's rebuild recipe (CableDyn_OF): a fresh instance B takes A's coupled kinematics, + !! re-applies the restored command, then reloads the line interior and the Syrope mirror. + TYPE(CD_AGG_ModuleType) :: agg_a, agg_b + INTEGER, PARAMETER :: NPOST = 12 + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), pa(3, 1), la(3, 1), pb(3, 1), lb(3, 1), v2(3, 1), a2(3, 1) + REAL(wp) :: dl, dldot, dmax + REAL(wp), ALLOCATABLE :: qL(:), vL(:), aL(:), slow(:), tmax(:), slow_b(:), tmax_b(:) + INTEGER :: es, ni, s, il, ndof, ne, npre, pass + LOGICAL :: cv, st, same + CHARACTER(512) :: em + + DO pass = 1, 2 + npre = MERGE(15, 50, pass == 1) + CALL CD_AGG_Init_From_Deck(agg_a, 'sctl_single.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'restart: A initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg_a, r0, vel, acc, la, es, em) + vel = 0.0_wp + acc = 0.0_wp + DO s = 1, npre + CALL restart_command(s, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_a, [dl], [dldot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg_a, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + CALL require(.FALSE., 'restart: A marches: '//TRIM(em)) + RETURN + END IF + END DO + CALL CD_AGG_Init_From_Deck(agg_b, 'sctl_single.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'restart: B initialises: '//TRIM(em)) + CALL CD_AGG_GetMovingPointMesh(agg_a, pa, v2, a2, la, es, em) + CALL CD_AGG_UpdateStates_Moving(agg_b, pa, v2, a2, es, em) + ! the restored command is the one A's committed state was reached with + CALL restart_command(npre, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_b, [dl], [dldot], es, em, restored=.TRUE.) + CALL require(es == CD_AGG_OK, 'restart: B re-applies the command: '//TRIM(em)) + il = agg_a%ctrl_line(1) + ndof = CD_System_Line_NDOF(agg_a%sys%fast%system, il, es, em) + ne = CD_System_Line_NElem(agg_a%sys%fast%system, il, es, em) + IF (ALLOCATED(qL)) DEALLOCATE (qL, vL, aL, slow, tmax, slow_b, tmax_b) + ALLOCATE (qL(ndof), vL(ndof), aL(ndof), slow(ne), tmax(ne), slow_b(ne), tmax_b(ne)) + CALL CD_Get_System_Line_State(agg_a%sys%fast%system, il, qL, vL, aL, es, em) + CALL CD_Update_System_Line_Interior_State(agg_b%sys%fast%system, il, qL(4:ndof - 3), vL(4:ndof - 3), & + es, em, a_interior=aL(4:ndof - 3)) + CALL require(es == CD_SYSTEM_OK, 'restart: B takes the line interior: '//TRIM(em)) + CALL CD_Get_System_Line_Syrope_State(agg_a%sys%fast%system, il, slow, tmax, es, em) + CALL CD_Set_System_Line_Syrope_State(agg_b%sys%fast%system, il, slow, tmax, es, em) + CALL require(es == CD_SYSTEM_OK, 'restart: B takes the Syrope mirror: '//TRIM(em)) + ASSOCIATE (ma => agg_a%sys%fast%system%lines(il), mb => agg_b%sys%fast%system%lines(il)) + same = ALL(bits_eq_v(ma%l0, mb%l0)) .AND. ALL(bits_eq_v(ma%l0_c, mb%l0_c)) + END ASSOCIATE + CALL require(same, 'restart: B carries the lengths and the committed lengths of A') + dmax = 0.0_wp + DO s = npre + 1, npre + NPOST + CALL restart_command(s, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_a, [dl], [dldot], es, em) + CALL CD_AGG_Apply_LineControl(agg_b, [dl], [dldot], es, em) + CALL CD_AGG_Step_Moving(agg_a, DT, r0, vel, acc, cv, st, ni, es, em) + same = same .AND. es == CD_AGG_OK .AND. cv + CALL CD_AGG_Step_Moving(agg_b, DT, r0, vel, acc, cv, st, ni, es, em) + same = same .AND. es == CD_AGG_OK .AND. cv + CALL CD_AGG_CalcOutput(agg_a, es, em) + CALL CD_AGG_CalcOutput(agg_b, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_a, pa, v2, a2, la, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_b, pb, v2, a2, lb, es, em) + CALL CD_Get_System_Line_Syrope_State(agg_a%sys%fast%system, il, slow, tmax, es, em) + CALL CD_Get_System_Line_Syrope_State(agg_b%sys%fast%system, il, slow_b, tmax_b, es, em) + dmax = MAX(dmax, MAXVAL(ABS(la - lb)), MAXVAL(ABS(slow - slow_b))) + same = same .AND. ALL(bits_eq_v(RESHAPE(la, [3]), RESHAPE(lb, [3]))) .AND. & + ALL(bits_eq_v(slow, slow_b)) .AND. ALL(bits_eq_v(tmax, tmax_b)) .AND. & + ALL(bits_eq_v(agg_a%sys%fast%system%lines(il)%q, agg_b%sys%fast%system%lines(il)%q)) + END DO + PRINT '(A,I0,A,F5.2,A,ES10.3)', ' restart after step ', npre, ' (DeltaL ', & + agg_a%sys%fast%system%lines(il)%l0(agg_a%ctrl_elem(1)) - agg_a%ctrl_base_l0(1), & + ' m): max difference of the fairlead load and the slow strains ', dmax + CALL require(same, 'restart: the restarted run continues bit for bit ('// & + MERGE('mid-ramp', 'hold ', pass == 1)//')') + CALL CD_AGG_End(agg_a, es, em) + CALL CD_AGG_End(agg_b, es, em) + END DO + END SUBROUTINE case_restart + + SUBROUTINE restart_command(step, dl, dldot) + !! A 0.4 m pay-out on a half-cosine over 2 s, then held (gate 3). + INTEGER, INTENT(IN) :: step + REAL(wp), INTENT(OUT) :: dl, dldot + REAL(wp) :: t + t = REAL(step, wp)*DT + IF (t < 2.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 2.0_wp, 0.0_wp, 0.4_wp, dl, dldot) + ELSE + dl = 0.4_wp + dldot = 0.0_wp + END IF + END SUBROUTINE restart_command + + ! --------------------------------------------------------------------------------------------- + ! 4. composite lines + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_composite() + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1) + REAL(wp), ALLOCATABLE :: slow0(:), tmax0(:), slow1(:), tmax1(:), ten0(:), ten1(:) + INTEGER :: es, il, ec, ne + CHARACTER(512) :: em + + ! the polyester at the fairlead: the controlled segment is Syrope (the oracle of gate 2) + CALL case_length_step('sctl_poly_chain.dat', 0.04_wp, 'polyester-chain pay-out step') + CALL ramp_runs('sctl_poly_chain.dat', 'polyester-chain') + + ! chain at the fairlead: the controlled segment is chain and the Syrope states stay as they are + CALL CD_AGG_Init_From_Deck(agg, 'sctl_chain_poly_chain.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'chain-polyester-chain: the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (slow0(ne), tmax0(ne), slow1(ne), tmax1(ne), ten0(ne), ten1(ne)) + CALL require(.NOT. agg%sys%fast%system%lines(il)%syrope_is(ec) .AND. & + COUNT(agg%sys%fast%system%lines(il)%syrope_is) == 8, & + 'chain-polyester-chain: the controlled segment is chain, the polyester Syrope') + CALL CD_Get_System_Line_Syrope_State(agg%sys%fast%system, il, slow0, tmax0, es, em) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten0, es, em) + CALL CD_AGG_Apply_LineControl(agg, [0.2_wp], [0.0_wp], es, em) + CALL CD_Get_System_Line_Syrope_State(agg%sys%fast%system, il, slow1, tmax1, es, em) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten1, es, em) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + CALL require(ALL(bits_eq_v(slow1, slow0)) .AND. ALL(bits_eq_v(tmax1, tmax0)) .AND. & + ALL(bits_eq_v(PACK(ten1, md%syrope_is), PACK(ten0, md%syrope_is))) .AND. ten1(ec) < ten0(ec), & + 'chain-polyester-chain: a chain command leaves the Syrope states and tensions as they are') + END ASSOCIATE + CALL CD_AGG_End(agg, es, em) + CALL ramp_runs('sctl_chain_poly_chain.dat', 'chain-polyester-chain') + END SUBROUTINE case_composite + + SUBROUTINE ramp_runs(deck, what) + !! Pay the fairlead segment out 0.4 m over 2 s, hold 1 s, haul it in to -0.4 m over 4 s and + !! hold 1 s: every step converges and the fairlead tension falls and rises with the command. + CHARACTER(*), INTENT(IN) :: deck, what + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), dl, dldot, t, t_lo, t_hi, t0 + REAL(wp), ALLOCATABLE :: ten(:) + INTEGER :: es, ni, s, il, ec, ne + LOGICAL :: cv, st, ok + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//' ramp: the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (ten(ne)) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + t0 = ten(ec) + t_lo = t0 + t_hi = t0 + ok = .TRUE. + DO s = 1, 160 + t = REAL(s, wp)*DT + IF (t < 2.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 2.0_wp, 0.0_wp, 0.4_wp, dl, dldot) + ELSE IF (t < 3.0_wp) THEN + dl = 0.4_wp + dldot = 0.0_wp + ELSE IF (t < 7.0_wp) THEN + CALL half_cosine(t, 3.0_wp, 4.0_wp, 0.4_wp, -0.4_wp, dl, dldot) + ELSE + dl = -0.4_wp + dldot = 0.0_wp + END IF + CALL CD_AGG_Apply_LineControl(agg, [dl], [dldot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + ok = .FALSE. + EXIT + END IF + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + t_lo = MIN(t_lo, ten(ec)) + t_hi = MAX(t_hi, ten(ec)) + END DO + PRINT '(A,A,A,ES12.5,A,ES12.5,A,ES12.5,A)', ' ', what, ' ramp: fairlead-segment tension ', t0, & + ' N, from ', t_lo, ' to ', t_hi, ' N' + CALL require(ok .AND. t_lo < 0.9_wp*t0 .AND. t_hi > 1.05_wp*t0, & + what//' ramp: every step converges and the tension follows the command: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE ramp_runs + + ! --------------------------------------------------------------------------------------------- + ! the OWC table, files and helpers + ! --------------------------------------------------------------------------------------------- + + REAL(wp) FUNCTION owc_t(eps) RESULT(t) + REAL(wp), INTENT(IN) :: eps + t = lin(eps, OWC_EPS, OWC_TEN) + END FUNCTION owc_t + + REAL(wp) FUNCTION owc_e(t) RESULT(eps) + REAL(wp), INTENT(IN) :: t + eps = lin(t, OWC_TEN, OWC_EPS) + END FUNCTION owc_e + + REAL(wp) FUNCTION lin(x, xp, fp) RESULT(y) + !! Piecewise-linear interpolation, constant beyond the ends. + REAL(wp), INTENT(IN) :: x, xp(:), fp(:) + INTEGER :: k, n + n = SIZE(xp) + y = fp(n) + IF (x <= xp(1)) THEN + y = fp(1) + RETURN + END IF + DO k = 2, n + IF (x <= xp(k)) THEN + y = fp(k - 1) + (fp(k) - fp(k - 1))*(x - xp(k - 1))/(xp(k) - xp(k - 1)) + RETURN + END IF + END DO + END FUNCTION lin + + SUBROUTINE write_owc(path) + CHARACTER(*), INTENT(IN) :: path + INTEGER :: u, k + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Strain Tension' + WRITE (u, '(A)') '(-) (N)' + DO k = 1, NOWC + WRITE (u, '(ES14.6,1X,ES14.6)') OWC_EPS(k), OWC_TEN(k) + END DO + CLOSE (u) + END SUBROUTINE write_owc + + SUBROUTINE write_settings(path, owc_path) + CHARACTER(*), INTENT(IN) :: path, owc_path + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') owc_path//' OWC - Original working-curve table file' + WRITE (u, '(A)') 'LINEAR WCType - Working-curve formulation' + WRITE (u, '(A)') '0.5 k1 - First working-curve shape parameter' + WRITE (u, '(A)') '0.0 k2 - Second working-curve shape parameter' + CLOSE (u) + END SUBROUTINE write_settings + + SUBROUTINE write_deck(path, kind, no_force_blend) + !! A Coupled fairlead at x = 0 and a Fixed anchor at mid-depth, the line written fairlead first + !! (its only host-driven end at NodeA, the controlled end), with a CONTROL row on channel 1: + !! single: 100 m of polyester in 10 segments, the anchor 102 m away; + !! poly_chain: 80 m of polyester (8 segments) then 20 m of chain (2), 101.6 m; + !! chain_poly_chain: 10 m of chain, 80 m of polyester, 10 m of chain (1, 8, 1), 101.6 m. + !! The polyester is nearly neutrally buoyant (0.05 kg/m above the displaced water's). + !! no_force_blend writes False alpha_force_blend. + CHARACTER(*), INTENT(IN) :: path, kind + LOGICAL, INTENT(IN), OPTIONAL :: no_force_blend + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Syrope line-control test deck ('//kind//')' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'chain 0.2791 480.93 2.058e9 -1.0 0.0 1.37 0.64 1.0 0.0' + WRITE (u, '(A)') 'poly 0.1438 16.70 "SYROPE:sctl_settings.dat|1.53e8|23.12" 1.0e6|1.0e5 0.0 1.2 0.2 1.0 0.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Coupled 0.0 0.0 -100.0 0 0 0 0' + IF (kind == 'single') THEN + WRITE (u, '(A)') '2 Fixed 102.0 0.0 -100.0 0 0 0 0' + ELSE + WRITE (u, '(A)') '2 Fixed 101.6 0.0 -100.0 0 0 0 0' + END IF + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + SELECT CASE (kind) + CASE ('single') + WRITE (u, '(A)') '1 poly 100.0 10' + CASE ('poly_chain') + WRITE (u, '(A)') '1 poly 80.0 8' + WRITE (u, '(A)') '1 chain 20.0 2' + CASE DEFAULT + WRITE (u, '(A)') '1 chain 10.0 1' + WRITE (u, '(A)') '1 poly 80.0 8' + WRITE (u, '(A)') '1 chain 10.0 1' + END SELECT + WRITE (u, '(A)') '--- CONTROL ---' + WRITE (u, '(A)') 'ChannelID Lines' + WRITE (u, '(A)') '(-) (-)' + WRITE (u, '(A)') '1 1' + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '200.0 WtrDpth' + IF (PRESENT(no_force_blend)) THEN + IF (no_force_blend) WRITE (u, '(A)') 'False alpha_force_blend' + END IF + WRITE (u, '(A)') '--- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1' + WRITE (u, '(A)') '--- end ---' + CLOSE (u) + END SUBROUTINE write_deck + + ELEMENTAL LOGICAL FUNCTION bits_eq(x, y) RESULT(same) + REAL(wp), INTENT(IN) :: x, y + same = TRANSFER(x, 0_INT64) == TRANSFER(y, 0_INT64) + END FUNCTION bits_eq + + FUNCTION bits_eq_v(x, y) RESULT(same) + REAL(wp), INTENT(IN) :: x(:), y(:) + LOGICAL :: same(SIZE(x)) + same = bits_eq(x, y) + END FUNCTION bits_eq_v + + FUNCTION fmt_real(x) RESULT(s) + REAL(wp), INTENT(IN) :: x + CHARACTER(24) :: s + WRITE (s, '(F10.3)') x + s = ADJUSTL(s) + END FUNCTION fmt_real + + SUBROUTINE require(ok, what) + LOGICAL, INTENT(IN) :: ok + CHARACTER(*), INTENT(IN) :: what + IF (ok) THEN + PRINT '(A)', 'PASS: '//what + ELSE + PRINT '(A)', 'FAIL: '//what + nfail = nfail + 1 + END IF + END SUBROUTINE require + +END PROGRAM test_syrope_control From 62e5a5f71c51b44f5ad8c8938d1cc7872e3c584b Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 17:47:33 +0900 Subject: [PATCH 04/10] feat(viscoelastic): active line control of a viscoelastic segment, as MoorDyn CONTROL on a viscoelastic segment (ElasticMod 2, Es|Ed, and 3, Es|alphaMBL|vbeta) stopped at initialisation, on the ground that the dl_1 state had no length-rescaling law. It needs none: dl_1 is a stretch, and MoorDyn-F (MD_CalcContStateDeriv sets l(N), ld(N) of a controlled line; Line_GetStateDeriv reads Line%dl_1 against Line%l) and MoorDyn-C (Line::setUnstretchedLength sets every l[i]; Line::getStateDeriv reads dl_1[i] against l[i]) leave it as it is and read it at the new length: MagT = EA_1 dl_1/l, MagTd = BA ld_1/l, the ODE with dl = lstr - l and the chord rate lstrd, and the ElasticMod 3 EA_D(dl_1, l). CableDyn's viscoelastic law already takes the present l0 everywhere and its committed force (force blend) l0_c, so the refusal and its stale comment go and nothing else changes; uncontrolled decks are untouched (53 of 53 examples identical). Gates (tests/test_viscoelastic_control.f90, new; all stopped at init before), on a taut 100 m line, Es = 1e8 N, Ed = 3e8 N (or alphaMBL = 3e8 N, vbeta = 20), BA = 1e6|1e5 N s: - the fairlead segment paid out 0.5 m, hauled in to -1 m and paid back: the tension follows the static law Es (D/L - 1) to 1.7e-4 of T0 along the ramps (1.7e-4 without the force blend, 4.6e-4 for ElasticMod 3) and 3.5e-9 at rest; - 5 cm pay-out and 4 cm haul-in steps from rest: the tension is MoorDyn's at the carried stretch to 3.7e-16 and dl_1 after one step the backward-Euler step of MoorDyn's ODE at the new length to 0; carrying the strain instead is off by 0.45 to 4.6 % and, built as a variant, fails these gates (dl_1 off by 1.8e-4 to 4.5e-4); - a restart in the ramp and in the hold continues bit for bit. tests/test_viscoelastic.f90 now checks that the length change keeps dl_1 bit for bit instead of the refusal. test_syrope_control gains a rope held at its running maximum without CONTROL under False alpha_force_blend: on dev it stops at t = 44.4 s with "Syrope backward-Euler state solve did not converge" (the kernel fix of the previous commit), so the CHANGELOG lists that fix under Fixed. test_native_model's handle-release test now records only an instance's first close: an instance an earlier test closed could be finalized during the constructor and recorded first, which failed the combined Python run depending on the collected test count. Docs: driver_format, theory, capabilities, openfast; CHANGELOG. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 16 +- CMakeLists.txt | 8 + doc/capabilities.rst | 7 +- doc/driver_format.md | 9 +- doc/openfast.rst | 4 +- doc/theory.rst | 17 +- python/tests/test_deck_file.py | 11 +- python/tests/test_native_model.py | 5 +- src/CableDyn_DeckDriver.f90 | 18 +- src/CableDyn_Model.f90 | 23 +- tests/test_syrope_control.f90 | 84 ++++- tests/test_viscoelastic.f90 | 16 +- tests/test_viscoelastic_control.f90 | 469 ++++++++++++++++++++++++++++ 13 files changed, 636 insertions(+), 51 deletions(-) create mode 100644 tests/test_viscoelastic_control.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ef4d50..0685747f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,9 +44,14 @@ All notable changes to CableDyn are recorded in this file. The format follows ramps and 6e-7 at rest; after a length step it is MoorDyn's at the carried stretch to 1e-15 (carrying the strain instead would be off by 0.4 to 2.4 %); a restart in the ramp continues bit for bit; a polyester-chain line with a Syrope fairlead segment and a - chain-polyester-chain line run. The Syrope state solve also finishes by bisection when its - root sits next to the top of the working curve, where the Newton step alone stopped a run - held at its running maximum under `False alpha_force_blend`. + chain-polyester-chain line run. +- Active line control of a viscoelastic segment (`Es|Ed` and `Es|alphaMBL|vbeta`), which + stopped at initialisation before. As in MoorDyn-F and MoorDyn-C the slow-branch stretch + `dl_1` is left as it is and read at the new length. On the same taut line and cycle the + tension follows the static law `Es` times the strain to 1.7e-4 along the ramps (4.6e-4 + load-dependent) and 4e-9 at rest; after a length step it is MoorDyn's at the carried stretch + to 4e-16 (carrying the strain instead would be off by 0.4 to 4.6 %); a restart in the ramp + continues bit for bit. - OpenFAST linearisation with the line dynamics, as MoorDyn-F's: the continuous states are the interior-node positions of every `EI = 0` line (MoorDyn's names and order) and the free degrees of freedom of every finite-EI cable (node positions and tangents), then their @@ -199,6 +204,11 @@ All notable changes to CableDyn are recorded in this file. The format follows host acceleration at `t = 0` enters neither version. - MoorDyn-F's `inertialF` option was an unknown keyword; `inertialF 1` (CableDyn's behaviour) is now accepted, and `0` and `2` are rejected by name. +- A Syrope line held at its running maximum (the fairlead pulled out and held) under + `False alpha_force_blend` stopped with "Syrope backward-Euler state solve did not converge": + next to the top sample of the working curve the Newton step's difference quotient straddled + the kink and crept along one side of the bracket. The solve now finishes by bisection there; + solves that converged before are unchanged. - A deck with a WaterKin elevation history (`WaveKinMod 1`) at `TMax = 0`, a check of the static start, reduces the record over its own length instead of failing for want of a positive `TMax`. diff --git a/CMakeLists.txt b/CMakeLists.txt index e3529411..1e1e3c7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2131,6 +2131,13 @@ target_link_libraries(test_syrope_control PRIVATE cabledyn_core) add_test(NAME syrope_control COMMAND test_syrope_control) set_tests_properties(syrope_control PROPERTIES LABELS "fortran;integration;dynamic;openfast") +# Active line control of viscoelastic (ElasticMod 2/3) segments on the coupled route (the dl_1 +# stretch carried over a length change, as MoorDyn-F/C carry it): quasi-static cycle, step, restart +add_executable(test_viscoelastic_control tests/test_viscoelastic_control.f90) +target_link_libraries(test_viscoelastic_control PRIVATE cabledyn_core) +add_test(NAME viscoelastic_control COMMAND test_viscoelastic_control) +set_tests_properties(viscoelastic_control PROPERTIES LABELS "fortran;integration;dynamic;openfast") + add_executable(test_torsion_coupling tests/test_torsion_coupling.f90) target_link_libraries(test_torsion_coupling PRIVATE cabledyn_core) add_test(NAME torsion_coupling COMMAND test_torsion_coupling) @@ -2801,6 +2808,7 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") target_compile_options(test_torsion_deck PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) target_compile_options(test_hermite_cable_control PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) target_compile_options(test_syrope_control PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) + target_compile_options(test_viscoelastic_control PRIVATE -Wno-uninitialized -Wno-maybe-uninitialized) endif() if(CABLEDYN_ENABLE_COVERAGE) diff --git a/doc/capabilities.rst b/doc/capabilities.rst index 8af5e0d3..157af367 100644 --- a/doc/capabilities.rst +++ b/doc/capabilities.rst @@ -74,7 +74,9 @@ Line and constitutive capability * - Viscoelastic rope (MoorDyn ``ElasticMod`` 2/3) - Supported - per-element series-Kelvin state (standard linear solid only when ``BA_D = 0``), - including load-dependent dynamic stiffness; ``EI = 0`` lines + including load-dependent dynamic stiffness; ``EI = 0`` lines, with active line control + in coupled OpenFAST runs (the slow-branch stretch carried over the length change, as in + MoorDyn) * - Syrope polyester - Supported with limits - dynamic line with OWC and two history states, single-section and taut or between @@ -211,7 +213,8 @@ OpenFAST coverage The ``CompMooring = 5`` shell covers normal coupled time-domain stepping with its own ``dtM``, nonzero ``PtfmInit``, correction iterations, SeaState fields, checkpoint/restart, scoped quasi-static ``dYdu`` linearisation, line failures, active-tension control of ``EI = 0`` lines -(linear-elastic or Syrope segments) and finite-EI cables, and FAST.Farm shared moorings. Restart and linearisation do not arise under +(linear-elastic, viscoelastic or Syrope segments) and finite-EI cables, and FAST.Farm shared +moorings. Restart and linearisation do not arise under FAST.Farm, which does not call those module operations, and active-tension control is rejected there. See :doc:`openfast` for setup and :doc:`coupling_boundary` for the interface contract. diff --git a/doc/driver_format.md b/doc/driver_format.md index 49421a57..308455a8 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1118,8 +1118,13 @@ bounds that would make it zero or negative (possible when it is shorter than hal over the new length. The running maximum tension is kept, and the slow-strain rate takes the chord rate without the paid-out term, as MoorDyn's Syrope rate does. A slow pay-out therefore unloads the segment along the working curve of its load history, and a haul-in beyond the - running maximum follows the OWC and raises it. A viscoelastic segment cannot be controlled: - initialisation stops with a message. + running maximum follows the OWC and raises it. +- A viscoelastic segment (`Es|Ed` or `Es|alphaMBL|vbeta`) keeps its slow-branch stretch `dl_1` + as it is over the length change and reads it at the new length, as MoorDyn-F and MoorDyn-C do: + the tension `EA_1 dl_1/L0 + BA ld_1/L0`, the rate `ld_1` with `dl` = stretched length − `L0`, + and the load-dependent `EA_D` all take the new `L0`, and the rate takes the chord rate without + the paid-out term. A slow pay-out or haul-in therefore follows the static law `Es` times the + strain; a fast change first meets the dynamic stiffness and relaxes to it. - On a finite-EI cable, which runs from a `Fixed` anchor to a host-driven fairlead, the segment is the fairlead segment of the deck mesh (the length of the `SECTIONS` row at the fairlead over its `NumSegs`). Where the static initialisation refined the mesh, it is the cable elements that diff --git a/doc/openfast.rst b/doc/openfast.rst index 2c25b6fe..cad5ffc3 100644 --- a/doc/openfast.rst +++ b/doc/openfast.rst @@ -385,8 +385,8 @@ without an auxiliary process: * **Active tensioning** maps ServoDyn ``CableDeltaL``/``CableDeltaLdot`` control onto the fairlead-side segment of ``EI = 0`` lines and finite-EI cables, the segment at the line's end on a host-driven point, or at the ``NodeB`` written in the deck when both or neither ends are - (:doc:`driver_format`, CONTROL). A Syrope polyester segment carries its slow stretch over - the length change, as MoorDyn-F and MoorDyn-C do; a viscoelastic segment cannot be controlled. + (:doc:`driver_format`, CONTROL). A viscoelastic or Syrope polyester segment carries its + slow stretch over the length change, as MoorDyn-F and MoorDyn-C do. On a finite-EI cable the command scales every cable element of that segment, and needs the force-blended generalised-α (the default). On both kinds a command outside MoorDyn-F's bounds, from minus half to plus one ``UnstrLen``/N of the line diff --git a/doc/theory.rst b/doc/theory.rst index edc15a9e..6c43ce12 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -2816,7 +2816,22 @@ taut 100 m polyester line whose fairlead segment is paid out by 0.5 m, hauled in back over 80 s, every element's tension follows the rest curve of its history at the line strain to 2.5e-4 of the initial tension along the ramps and to 6e-7 at rest; after a length step it is MoorDyn's at the carried stretch to round-off, where carrying the strain instead would be off by -0.4 to 2.4 %. A viscoelastic segment cannot be controlled. +0.4 to 2.4 %. + +A viscoelastic segment keeps its slow-branch stretch :math:`\Delta l_1` over a length change, as +MoorDyn-F (``MD_CalcContStateDeriv`` sets the controlled segment's ``l`` and ``ld``, +``Line_GetStateDeriv`` reads ``dl_1`` against ``l``) and MoorDyn-C +(``Line::setUnstretchedLength``, ``Line::getStateDeriv``) keep it: :math:`\Delta l_1` is a +stretch, so no rescaling arises, and the law reads it at the present length, +:math:`T = EA_1\,\Delta l_1/L_0 + BA\,\dot{\Delta l}_1/L_0` with +:math:`\dot{\Delta l}_1 = (EA_D (l - L_0) - (EA_D + EA_1)\Delta l_1 + BA_D\,\dot l)/(BA_D + BA)` +and, for the load-dependent stiffness, :math:`EA_D(\Delta l_1, L_0)`; the committed force of the +force blend reads the same :math:`\Delta l_1` at :math:`L_{0,c}`. The rate :math:`\dot l` is the +chord rate, without the paid-out term, as in MoorDyn. On the taut 100 m line above with +:math:`E_s = 10^8` N, the same pay-out and haul-in cycle follows the static law +:math:`E_s(D/L - 1)` to 1.7e-4 of the initial tension along the ramps (4.6e-4 with the +load-dependent stiffness) and to 4e-9 at rest; after a length step the tension is MoorDyn's at +the carried stretch to round-off, where carrying the strain instead would be off by 0.4 to 4.6 %. On a finite-EI cable, whose fairlead is End A, the command acts on the cable elements that make up the End-A segment of the deck mesh, of initial length :math:`S`. Each element scales by diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 5afee88f..14601bc6 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -3562,10 +3562,13 @@ def test_control_rows_may_name_finite_ei_cables_on_the_coupled_route(): assert [row.tokens for row in deck._rows("CONTROL")] == [("1", "4"), ("2", "1,3")] -def test_control_rows_may_name_syrope_lines_on_the_coupled_route(): - # native CD_Init_Deck_Aggregate controls a Syrope segment too (its slow stretch carries over - # the length change, as in MoorDyn-F/C), so the mirror accepts the row - source = (ROOT / "examples/syrope_polyester_mooring.dat").read_text(encoding="utf-8") +@pytest.mark.parametrize( + "example", ["syrope_polyester_mooring.dat", "ve_polyester_catenary_mooring.dat"] +) +def test_control_rows_may_name_syrope_and_viscoelastic_lines_on_the_coupled_route(example): + # native CD_Init_Deck_Aggregate controls a Syrope or viscoelastic segment too (its slow + # stretch carries over the length change, as in MoorDyn-F/C), so the mirror accepts the row + source = (ROOT / "examples" / example).read_text(encoding="utf-8") marker = "--------------------- OPTIONS" assert source.count(marker) == 1 block = ( diff --git a/python/tests/test_native_model.py b/python/tests/test_native_model.py index bcc67fb4..5f9b6dae 100644 --- a/python/tests/test_native_model.py +++ b/python/tests/test_native_model.py @@ -66,7 +66,10 @@ def test_failed_initialization_in_the_constructor_releases_the_handle(monkeypatc original = model_module.CableDyn.close def tracking_close(self: model_module.CableDyn) -> None: - closed.append(bool(self._handle)) + # only an instance's first close (generation 0): an instance an earlier test closed and + # left behind can be finalized while this one is constructed, closing it again + if self._generation == 0: + closed.append(bool(self._handle)) original(self) monkeypatch.setattr(model_module.CableDyn, "close", tracking_close) diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index eac38597..5c43fa6a 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -7907,8 +7907,8 @@ SUBROUTINE build_aggregate_control_table(ctrls, lines, points, rods, sections, t !! UnstrLen and N, summed over the line's sections), from which the apply takes !! MoorDyn-F's command bounds. Every capability check runs here (a finite-EI line also !! needs the force-blended generalised-alpha), so the apply loop cannot fail for input - !! reasons after its prevalidation. An EI = 0 segment may be linear-elastic or Syrope (its - !! slow stretch carries over the length change); a viscoelastic one fails closed. + !! reasons after its prevalidation. An EI = 0 segment may be linear-elastic, viscoelastic + !! or Syrope (the slow stretch of the last two carries over the length change). TYPE(DeckControl), INTENT(IN) :: ctrls(:) TYPE(DeckLine), INTENT(IN) :: lines(:) TYPE(DeckPoint), INTENT(IN) :: points(:) @@ -7995,17 +7995,9 @@ SUBROUTINE build_aggregate_control_table(ctrls, lines, points, rods, sections, t IF (agg%sys%lines(obj)%has_seabed .AND. .NOT. agg%sys%lines(obj)%has_seabed_recompute) THEN CALL fail(ErrStat, ErrMsg, 'CONTROL line was built without the seabed recompute inputs'); RETURN END IF - IF (agg%sys%lines(obj)%has_viscoelastic) THEN - IF (agg%sys%lines(obj)%ve_mode(e) /= 0) THEN - ! the runtime length update fails closed on a viscoelastic element (the - ! dl_1 state has no rescaling law), so a deck composing CONTROL with a - ! viscoelastic controlled segment must not start at all - CALL fail(ErrStat, ErrMsg, 'CONTROL targets a viscoelastic (ElasticMod 2) '// & - 'segment; active line control is not supported on the viscoelastic model'); RETURN - END IF - END IF - ! A Syrope controlled segment carries its slow stretch over each length change, as - ! MoorDyn-F/C do (CD_Update_Model_SegmentLength), so it needs no check here. + ! A viscoelastic or Syrope controlled segment carries its slow stretch over each + ! length change, as MoorDyn-F/C do (CD_Update_Model_SegmentLength), so it needs no + ! check here. ELSE ! the coupled cable builder makes End A the host-driven fairlead and End B the ! Fixed anchor; any other arrangement would control a segment that is not the diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index bf74b813..c3a75606 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -303,6 +303,8 @@ MODULE CableDyn_Model ! (the static-branch dashpot Bs lives inside the series law). ve_dt carries the ! active step size into the contributors; 0 = the instantaneous ! (committed-state) limit used by IC, coupled-load, and tension queries. + ! ve_dl_1 is a stretch [m], so an unstretched-length change (active line control) leaves + ! it as it is, as MoorDyn's dl_1 (CD_Update_Model_SegmentLength). ! ve_dl_1_rollback is the system-level rollback twin of q_rollback: a line ! whose step committed (advancing dl_1) can be rolled back when a sibling ! line or the coupled point solve fails. @@ -4941,7 +4943,8 @@ SUBROUTINE CD_Update_Model_SegmentLength(model, elem, l0_new, l0_dot, ErrStat, E !! the committed state) makes the new length and rate the committed ones as well. A rate !! of -0 is stored as +0, so a zero command of either sign leaves an uncontrolled model !! bit-identical (the committed-length test compares bits). On a Syrope element the slow - !! stretch eps_slow*l0 is carried over the change (model_syrope_slow). + !! stretch eps_slow*l0 is carried over the change (model_syrope_slow); on a viscoelastic + !! element the slow-branch stretch dl_1 is, as it is (both as in MoorDyn-F/C). TYPE(CD_ModelType), INTENT(INOUT) :: model INTEGER, INTENT(IN) :: elem REAL(wp), INTENT(IN) :: l0_new, l0_dot @@ -4972,16 +4975,14 @@ SUBROUTINE CD_Update_Model_SegmentLength(model, elem, l0_new, l0_dot, ErrStat, E 'recompute scalars (kBot + contact diameter) supplied at init') RETURN END IF - IF (model%has_viscoelastic) THEN - IF (model%ve_mode(elem) /= 0) THEN - ! the dl_1 state partitions the stretch against the INIT-time natural - ! length; MoorDyn defines no rescaling law for a controlled - ! viscoelastic segment, so this composition fails closed by name - CALL fail(ErrStat, ErrMsg, 'segment-length update on a viscoelastic (ElasticMod > 1) element '// & - 'is not supported: the dl_1 state has no length-rescaling law') - RETURN - END IF - END IF + ! A viscoelastic element keeps its slow-branch stretch dl_1 as it is, and every law + ! evaluation reads it with the present l0: MagT = EA_1 dl_1/l0, MagTd = BA ld_1/l0, the ODE + ! ld_1 = (EA_D dl - (EA_D + EA_1) dl_1 + BA_D lstrd)/(BA_D + BA) with dl = lstr - l0, and the + ! ElasticMod 3 EA_D(dl_1, l0). That is MoorDyn's rule: MoorDyn-F (MD_CalcContStateDeriv sets + ! l(N), ld(N) of a controlled line; Line_GetStateDeriv reads Line%dl_1 against Line%l) and + ! MoorDyn-C (Line::setUnstretchedLength sets every l[i]; Line::getStateDeriv reads dl_1[i] + ! against l[i]) never touch dl_1 on a length change. The force blend's committed force reads + ! the same dl_1 at l0_c. ! A Syrope element keeps its states as they are: the slow strain stays the committed state's, ! a strain of l0_c, and the element reads it at its present length (model_syrope_slow), so ! its slow STRETCH carries over the length change as MoorDyn-F/C carry it; the running diff --git a/tests/test_syrope_control.f90 b/tests/test_syrope_control.f90 index 43ca728f..aa85df7c 100644 --- a/tests/test_syrope_control.f90 +++ b/tests/test_syrope_control.f90 @@ -30,6 +30,11 @@ PROGRAM test_syrope_control !! 4. Composite lines: a polyester-chain line (the controlled segment is Syrope) takes the !! oracle of 2 at its fairlead element and runs a ramp; a chain-polyester-chain line (the !! controlled segment is chain) leaves its Syrope states untouched and runs the ramp. + !! 5. Without CONTROL, under False alpha_force_blend: the fairlead pulled out 1 m over 40 s and + !! held, so the rope rests on its OWC at its new running maximum. The backward-Euler root + !! then lies next to the top sample of the working curve, where the safeguarded Newton step + !! alone crept and stopped the run (CableDyn_Syrope, CD_Syrope_State_Advance); every step + !! converges and the held tension is the OWC tension at the line strain. !! Gates 1-3 and the polyester-chain line of 4 stopped at initialisation before (CONTROL on a !! Syrope segment was refused). USE CableDyn_Precision, ONLY: wp @@ -71,6 +76,7 @@ PROGRAM test_syrope_control CALL write_deck('sctl_poly_chain.dat', 'poly_chain') CALL write_deck('sctl_chain_poly_chain.dat', 'chain_poly_chain') CALL write_deck('sctl_single_noblend.dat', 'single', no_force_blend=.TRUE.) + CALL write_deck('sctl_hold_noblend.dat', 'single', no_force_blend=.TRUE., no_control=.TRUE.) CALL case_quasi_static('sctl_single.dat', 'quasi-static') CALL case_quasi_static('sctl_single_noblend.dat', 'quasi-static, False alpha_force_blend') @@ -78,6 +84,7 @@ PROGRAM test_syrope_control CALL case_length_step('sctl_single.dat', -0.04_wp, 'haul-in step') CALL case_restart() CALL case_composite() + CALL case_hold_at_maximum() IF (nfail > 0) THEN PRINT '(I0,A)', nfail, ' assertion(s) failed' @@ -583,6 +590,64 @@ SUBROUTINE ramp_runs(deck, what) CALL CD_AGG_End(agg, es, em) END SUBROUTINE ramp_runs + ! --------------------------------------------------------------------------------------------- + ! 5. a rope held at its running maximum, no CONTROL + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_hold_at_maximum() + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: r0(3, 1), pos(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), x, xdot, t, chord, l_tot, t_o + REAL(wp), ALLOCATABLE :: ten(:) + INTEGER :: es, ni, s, il, ne + LOGICAL :: cv, st, ok + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, 'sctl_hold_noblend.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'held at the maximum: the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + il = 1 + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (ten(ne)) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + l_tot = SUM(md%l0) + END ASSOCIATE + ok = .TRUE. + DO s = 1, 960 + t = REAL(s, wp)*DT + IF (t < 40.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 40.0_wp, 0.0_wp, -1.0_wp, x, xdot) + ELSE + x = -1.0_wp + xdot = 0.0_wp + END IF + pos = r0 + pos(1, 1) = r0(1, 1) + x + vel = 0.0_wp + vel(1, 1) = xdot + acc = 0.0_wp + CALL CD_AGG_Step_Moving(agg, DT, pos, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + ok = .FALSE. + CALL require(.FALSE., 'held at the maximum: step at t = '//TRIM(fmt_real(t))//': '//TRIM(em)) + EXIT + END IF + END DO + IF (ok) THEN + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + chord = NORM2(md%q(3*md%elem_conn(2, ne) - 2:3*md%elem_conn(2, ne)) - & + md%q(3*md%elem_conn(1, 1) - 2:3*md%elem_conn(1, 1))) + END ASSOCIATE + t_o = owc_t(chord/l_tot - 1.0_wp) + PRINT '(A,ES12.5,A,ES12.5,A,ES10.3)', ' held at the maximum for 8 s: tension ', MAXVAL(ten), ' N, OWC ', t_o, & + ' N, rel. difference ', MAXVAL(ABS(ten - t_o))/t_o + CALL require(MAXVAL(ABS(ten - t_o)) <= 1.0e-6_wp*t_o, & + 'held at the maximum: every step converges and the rope rests on its OWC') + END IF + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_hold_at_maximum + ! --------------------------------------------------------------------------------------------- ! the OWC table, files and helpers ! --------------------------------------------------------------------------------------------- @@ -638,16 +703,17 @@ SUBROUTINE write_settings(path, owc_path) CLOSE (u) END SUBROUTINE write_settings - SUBROUTINE write_deck(path, kind, no_force_blend) + SUBROUTINE write_deck(path, kind, no_force_blend, no_control) !! A Coupled fairlead at x = 0 and a Fixed anchor at mid-depth, the line written fairlead first !! (its only host-driven end at NodeA, the controlled end), with a CONTROL row on channel 1: !! single: 100 m of polyester in 10 segments, the anchor 102 m away; !! poly_chain: 80 m of polyester (8 segments) then 20 m of chain (2), 101.6 m; !! chain_poly_chain: 10 m of chain, 80 m of polyester, 10 m of chain (1, 8, 1), 101.6 m. !! The polyester is nearly neutrally buoyant (0.05 kg/m above the displaced water's). - !! no_force_blend writes False alpha_force_blend. + !! no_force_blend writes False alpha_force_blend, no_control leaves the CONTROL section out. CHARACTER(*), INTENT(IN) :: path, kind - LOGICAL, INTENT(IN), OPTIONAL :: no_force_blend + LOGICAL, INTENT(IN), OPTIONAL :: no_force_blend, no_control + LOGICAL :: ctrl INTEGER :: u OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') WRITE (u, '(A)') 'Syrope line-control test deck ('//kind//')' @@ -683,10 +749,14 @@ SUBROUTINE write_deck(path, kind, no_force_blend) WRITE (u, '(A)') '1 poly 80.0 8' WRITE (u, '(A)') '1 chain 10.0 1' END SELECT - WRITE (u, '(A)') '--- CONTROL ---' - WRITE (u, '(A)') 'ChannelID Lines' - WRITE (u, '(A)') '(-) (-)' - WRITE (u, '(A)') '1 1' + ctrl = .TRUE. + IF (PRESENT(no_control)) ctrl = .NOT. no_control + IF (ctrl) THEN + WRITE (u, '(A)') '--- CONTROL ---' + WRITE (u, '(A)') 'ChannelID Lines' + WRITE (u, '(A)') '(-) (-)' + WRITE (u, '(A)') '1 1' + END IF WRITE (u, '(A)') '--- OPTIONS ---' WRITE (u, '(A)') '9.80665 g' WRITE (u, '(A)') '1025.0 rhoW' diff --git a/tests/test_viscoelastic.f90 b/tests/test_viscoelastic.f90 index 18220e13..62e6c14b 100644 --- a/tests/test_viscoelastic.f90 +++ b/tests/test_viscoelastic.f90 @@ -725,7 +725,8 @@ SUBROUTINE case_model_copy_midstate() END SUBROUTINE case_model_copy_midstate SUBROUTINE case_model_fail_closed() - !! The init validation battery and the control-composition choke point. + !! The init validation battery and the control composition: a segment-length change on a + !! viscoelastic element leaves its dl_1 stretch as it is (MoorDyn-F/C), and the line steps. TYPE(CD_ModelType) :: model TYPE(GenAlphaConfig) :: cfg INTEGER :: conn(2, 2), fixed(6), es, n_iter @@ -775,15 +776,20 @@ SUBROUTINE case_model_fail_closed() ve_ea_d=ve_ead, ve_ba=ve_ba, ve_ba_d=ve_bad) CALL require(es /= CD_MODEL_OK .AND. INDEX(em, 'plain element') > 0, 'fail:plain-with-dashpots') ! MIXED line: element 1 viscoelastic, element 2 plain -- the segment-length - ! control fails closed by name on the viscoelastic element and stays - ! available on the plain one + ! control applies to both; the viscoelastic element keeps its dl_1 stretch bit for bit ve_ba = [7.0_wp, 0.0_wp] ve_bad = [3.0_wp, 0.0_wp] CALL CD_Init_Model(model, q0, v0, conn, l0, ea, rho_a, .FALSE., f_ext, fixed, cfg, es, em, & ve_ea_d=ve_ead, ve_ba=ve_ba, ve_ba_d=ve_bad) CALL require(es == CD_MODEL_OK, 'fail:mixed-init-ok') - CALL CD_Update_Model_SegmentLength(model, 1, 1.01_wp, 0.0_wp, es, em) - CALL require(es /= CD_MODEL_OK .AND. INDEX(em, 'viscoelastic') > 0, 'fail:control-on-viscoelastic') + BLOCK + REAL(wp) :: dl1_before(2), dl1_after(2) + CALL CD_Get_Model_VE_Dl1(model, dl1_before, es, em) + CALL CD_Update_Model_SegmentLength(model, 1, 1.01_wp, 0.0_wp, es, em) + CALL CD_Get_Model_VE_Dl1(model, dl1_after, es, em) + CALL require(es == CD_MODEL_OK .AND. ALL(TRANSFER(dl1_after, 0_8, 2) == TRANSFER(dl1_before, 0_8, 2)), & + 'fail:control-on-viscoelastic-keeps-dl1') + END BLOCK CALL CD_Update_Model_SegmentLength(model, 2, 1.01_wp, 0.0_wp, es, em) CALL require(es == CD_MODEL_OK, 'fail:control-on-plain-ok') ! the mixed model still steps (the plain element keeps its EA elastic force) diff --git a/tests/test_viscoelastic_control.f90 b/tests/test_viscoelastic_control.f90 new file mode 100644 index 00000000..cbd27710 --- /dev/null +++ b/tests/test_viscoelastic_control.f90 @@ -0,0 +1,469 @@ +! File: tests/test_viscoelastic_control.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_viscoelastic_control + !! Active line control (CONTROL, the OpenFAST CableDeltaL route of CD_Init_Deck_Aggregate) of a + !! viscoelastic segment (MoorDyn ElasticMod 2, Es|Ed, and 3, Es|alphaMBL|vbeta). MoorDyn-F + !! (MD_CalcContStateDeriv sets l(N) and ld(N); Line_GetStateDeriv) and MoorDyn-C + !! (Line::setUnstretchedLength; Line::getStateDeriv) keep each segment's slow-branch stretch + !! dl_1 as its state, leave it as it is when the unstretched length l changes and read it at + !! the new length: MagT = EA_1 dl_1/l, MagTd = BA ld_1/l, + !! ld_1 = (EA_D dl - (EA_D + EA_1) dl_1 + BA_D lstrd)/(BA_D + BA), dl = lstr - l, + !! EA_1 = EA_D EA/(EA_D - EA), and for ElasticMod 3 EA_D(dl_1, l). The oracles below evaluate + !! these formulas independently of CableDyn_Viscoelastic. The decks are written here: 100 m of + !! rope (10 segments) held taut between a Coupled fairlead and a Fixed anchor 102 m apart at + !! mid-depth, nearly neutrally buoyant so that the tension is uniform, with Es = 1e8 N, + !! Ed = 3e8 N (or alphaMBL = 3e8 N, vbeta = 20) and BA = Bs|Bd = 1e6|1e5 N s (a slow-branch + !! relaxation time (BA_D + BA)/(EA_D + EA_1) of about 2.4 ms). + !! 1. Quasi-static pay-out and haul-in: the fairlead segment is paid out by 0.5 m over 20 s, + !! hauled in to -1 m over 40 s and paid back to 0 over 20 s, with 4 s holds. Every element's + !! tension follows the static viscoelastic law, the composite EA times the line's strain + !! D/L(t) - 1: gated over the ramps (the lag of the slow branch) and at the ends of the + !! holds (the rest point), for ElasticMod 2 with and without the force blend and for 3. + !! 2. A length step from rest (pay-out 5 cm, haul-in 4 cm; ElasticMod 2 and 3): the tension + !! right after the change is MoorDyn's at the carried stretch dl_1, and dl_1 after one step + !! is the backward-Euler step of MoorDyn's ODE at the new length (EA_D at the step-start + !! state, as CableDyn lags it); the other elements are untouched. The strain-carrying + !! alternative (dl_1 l_2/l_1) is printed for contrast and must differ. + !! 3. Checkpoint restart in the middle of a pay-out ramp and in the hold after it: a fresh + !! instance takes the coupled kinematics, the line interior [q; v; a] and the dl_1 mirror of + !! the first, re-applies the command as the committed one (restored), and both continue + !! bit for bit. + !! Every gate stopped at initialisation before (CONTROL on a viscoelastic segment was refused). + USE CableDyn_Precision, ONLY: wp + USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_GetMovingPointMesh, & + CD_AGG_UpdateStates_Moving, CD_AGG_Step_Moving, CD_AGG_CalcOutput, & + CD_AGG_Apply_LineControl, CD_AGG_Get_Substep_Counts, CD_AGG_End, & + CD_AGG_OK + USE CableDyn_System, ONLY: CD_System_Line_NDOF, CD_System_Line_NElem, CD_Get_System_Line_State, & + CD_Get_System_Line_Tension, CD_Get_System_Line_VE_Dl1, CD_Set_System_Line_VE_Dl1, & + CD_Update_System_Line_Interior_State, CD_SYSTEM_OK + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: INT64 + IMPLICIT NONE + + ! the deck constants: Es, Ed (ElasticMod 2), alphaMBL|vbeta (ElasticMod 3), Bs|Bd + REAL(wp), PARAMETER :: EA_S = 1.0e8_wp, EA_D2 = 3.0e8_wp, AMBL = 3.0e8_wp, VBETA = 20.0_wp + REAL(wp), PARAMETER :: BA_S = 1.0e6_wp, BA_D = 1.0e5_wp + REAL(wp), PARAMETER :: PI = 3.141592653589793_wp, DT = 0.05_wp + INTEGER :: nfail = 0 + + CALL write_deck('vctl_mod2.dat', '1.0e8|3.0e8', .FALSE.) + CALL write_deck('vctl_mod2_noblend.dat', '1.0e8|3.0e8', .TRUE.) + CALL write_deck('vctl_mod3.dat', '1.0e8|3.0e8|20.0', .FALSE.) + + CALL case_quasi_static('vctl_mod2.dat', 'ElasticMod 2 quasi-static') + CALL case_quasi_static('vctl_mod2_noblend.dat', 'ElasticMod 2 quasi-static, False alpha_force_blend') + CALL case_quasi_static('vctl_mod3.dat', 'ElasticMod 3 quasi-static') + CALL case_length_step('vctl_mod2.dat', 2, 0.05_wp, 'ElasticMod 2 pay-out step') + CALL case_length_step('vctl_mod2.dat', 2, -0.04_wp, 'ElasticMod 2 haul-in step') + CALL case_length_step('vctl_mod3.dat', 3, 0.05_wp, 'ElasticMod 3 pay-out step') + CALL case_length_step('vctl_mod3.dat', 3, -0.04_wp, 'ElasticMod 3 haul-in step') + CALL case_restart('vctl_mod2.dat', 'ElasticMod 2') + CALL case_restart('vctl_mod3.dat', 'ElasticMod 3') + + IF (nfail > 0) THEN + PRINT '(I0,A)', nfail, ' assertion(s) failed' + ERROR STOP 1 + END IF + PRINT '(A)', 'all viscoelastic line-control checks passed' + +CONTAINS + + ! --------------------------------------------------------------------------------------------- + ! 1. quasi-static pay-out and haul-in + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_quasi_static(deck, what) + CHARACTER(*), INTENT(IN) :: deck, what + TYPE(CD_AGG_ModuleType) :: agg + INTEGER, PARAMETER :: NSTEP = 1840 + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), dl, dldot, t, chord, l_tot, t_o, t0 + REAL(wp) :: err_ramp, err_hold, hold_at(3) + REAL(wp), ALLOCATABLE :: ten(:) + INTEGER :: es, ni, s, il, ec, ne, k, n_hold + LOGICAL :: cv, st, ok + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//': the controlled viscoelastic deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (ten(ne)) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + CALL require(md%has_viscoelastic .AND. md%ve_mode(ec) /= 0, what//': the controlled segment is viscoelastic') + chord = NORM2(md%q(3*md%elem_conn(2, ne) - 2:3*md%elem_conn(2, ne)) - & + md%q(3*md%elem_conn(1, 1) - 2:3*md%elem_conn(1, 1))) + l_tot = SUM(md%l0) + END ASSOCIATE + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + t0 = ten(ec) + t_o = EA_S*(chord/l_tot - 1.0_wp) + CALL require(ABS(t0 - t_o) <= 1.0e-6_wp*t_o .AND. MAXVAL(ABS(ten - t0)) <= 1.0e-6_wp*t0, & + what//': the line starts on the static law with a uniform tension') + hold_at = [24.0_wp, 68.0_wp, 92.0_wp] + err_ramp = 0.0_wp + err_hold = 0.0_wp + n_hold = 0 + ok = .TRUE. + DO s = 1, NSTEP + t = REAL(s, wp)*DT + CALL cycle_command(t, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg, [dl], [dldot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + ok = .FALSE. + CALL require(.FALSE., what//': step at t = '//TRIM(fmt_real(t))//': '//TRIM(em)) + EXIT + END IF + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + ! the oracle: the static (composite EA) law at the line's strain + t_o = EA_S*(chord/(l_tot + dl) - 1.0_wp) + err_ramp = MAX(err_ramp, MAXVAL(ABS(ten - t_o))/t0) + DO k = 1, 3 + IF (ABS(t - hold_at(k)) < 0.5_wp*DT) THEN + err_hold = MAX(err_hold, MAXVAL(ABS(ten - t_o))/t_o) + n_hold = n_hold + 1 + END IF + END DO + END DO + IF (ok) THEN + PRINT '(A,A,A,ES12.5,A,ES10.3,A,ES10.3)', ' ', what, ': T0 ', t0, ' N; max |T - EA eps| / T0 over the ramps ', & + err_ramp, ', at the ends of the holds / T ', err_hold + CALL require(n_hold == 3 .AND. err_hold <= 1.0e-6_wp, what//': at rest the tension is the static law''s') + CALL require(err_ramp <= 3.0e-3_wp, what//': along the ramps the tension follows the static law') + CALL require(bits_eq(agg%sys%fast%system%lines(il)%l0(ec), agg%ctrl_base_l0(1)), & + what//': the cycle returns the segment to its base length') + END IF + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_quasi_static + + SUBROUTINE cycle_command(t, dl, dldot) + !! Pay out 0.5 m on a half-cosine over 20 s, hold 4 s, haul in to -1 m over 40 s, hold 4 s, + !! pay back to 0 over 20 s, hold. + REAL(wp), INTENT(IN) :: t + REAL(wp), INTENT(OUT) :: dl, dldot + IF (t < 20.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 20.0_wp, 0.0_wp, 0.5_wp, dl, dldot) + ELSE IF (t < 24.0_wp) THEN + dl = 0.5_wp + dldot = 0.0_wp + ELSE IF (t < 64.0_wp) THEN + CALL half_cosine(t, 24.0_wp, 40.0_wp, 0.5_wp, -1.0_wp, dl, dldot) + ELSE IF (t < 68.0_wp) THEN + dl = -1.0_wp + dldot = 0.0_wp + ELSE IF (t < 88.0_wp) THEN + CALL half_cosine(t, 68.0_wp, 20.0_wp, -1.0_wp, 0.0_wp, dl, dldot) + ELSE + dl = 0.0_wp + dldot = 0.0_wp + END IF + END SUBROUTINE cycle_command + + SUBROUTINE half_cosine(t, t_start, span, a, b, x, xdot) + REAL(wp), INTENT(IN) :: t, t_start, span, a, b + REAL(wp), INTENT(OUT) :: x, xdot + x = a + (b - a)*0.5_wp*(1.0_wp - COS(PI*(t - t_start)/span)) + xdot = (b - a)*0.5_wp*(PI/span)*SIN(PI*(t - t_start)/span) + END SUBROUTINE half_cosine + + ! --------------------------------------------------------------------------------------------- + ! 2. a length step from rest + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_length_step(deck, mode, step_dl, what) + CHARACTER(*), INTENT(IN) :: deck, what + INTEGER, INTENT(IN) :: mode + REAL(wp), INTENT(IN) :: step_dl + TYPE(CD_AGG_ModuleType) :: agg + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), l1, l2, length, lstrd, t_md, t_alt, dl1_be + REAL(wp), ALLOCATABLE :: dl1_0(:), dl1_1(:), ten0(:), ten1(:) + INTEGER :: es, ni, il, ec, ne, others, max_used + INTEGER(INT64) :: calls, events, capped, fallbacks + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//': the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (dl1_0(ne), dl1_1(ne), ten0(ne), ten1(ne)) + CALL CD_Get_System_Line_VE_Dl1(agg%sys%fast%system, il, dl1_0, es, em) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten0, es, em) + l1 = agg%sys%fast%system%lines(il)%l0(ec) + CALL CD_AGG_Apply_LineControl(agg, [step_dl], [0.0_wp], es, em) + CALL require(es == CD_AGG_OK, what//': the command applies: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + l2 = md%l0(ec) + CALL require(md%ve_mode(ec) == mode .AND. bits_eq(l2, l1 + step_dl), & + what//': the viscoelastic segment takes l1 + DeltaL') + CALL element_kinematics(md%q, md%v, md%elem_conn(:, ec), length, lstrd) + END ASSOCIATE + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten1, es, em) + t_md = md_tension(mode, dl1_0(ec), length, lstrd, l2) + t_alt = md_tension(mode, dl1_0(ec)*l2/l1, length, lstrd, l2) + others = COUNT(.NOT. bits_eq_v(ten1, ten0)) - MERGE(1, 0,.NOT. bits_eq(ten1(ec), ten0(ec))) + PRINT '(A,A,F6.3,A,ES12.5,A,ES12.5,A,ES12.5,A,ES10.3)', ' ', what, step_dl, ' m: tension ', ten0(ec), & + ' -> ', ten1(ec), ' N, MoorDyn (stretch carried) ', t_md, ' N, rel. difference ', ABS(ten1(ec) - t_md)/t_md + PRINT '(A,ES12.5,A,ES10.3,A)', ' strain carried instead: ', t_alt, ' N (', ABS(t_alt - t_md)/t_md, & + ' off MoorDyn)' + CALL require(t_md > 0.0_wp .AND. ABS(ten1(ec) - t_md) <= 1.0e-10_wp*t_md, & + what//': the tension after the change is MoorDyn''s at the carried stretch') + CALL require(ABS(t_alt - t_md) > 1.0e-3_wp*t_md, what//': the oracle tells the stretch from the strain carry') + CALL require(others == 0, what//': the other elements keep their tension') + CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + CALL require(es == CD_AGG_OK .AND. cv, what//': the step after the change converges: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Get_Substep_Counts(agg, calls, events, max_used, capped, fallbacks) + CALL CD_Get_System_Line_VE_Dl1(agg%sys%fast%system, il, dl1_1, es, em) + ASSOCIATE (md => agg%sys%fast%system%lines(il)) + CALL element_kinematics(md%q, md%v, md%elem_conn(:, ec), length, lstrd) + END ASSOCIATE + dl1_be = md_backward_euler(mode, dl1_0(ec), length, lstrd, l2, DT) + PRINT '(A,ES16.9,A,ES16.9,A,ES10.3,A,I0,A)', ' dl_1 after one step ', dl1_1(ec), ' m, oracle ', dl1_be, & + ' (rel. ', ABS(dl1_1(ec) - dl1_be)/ABS(dl1_be), '; ', events, ' sub-stepped steps)' + CALL require(events == 0 .AND. ABS(dl1_1(ec) - dl1_be) <= 1.0e-10_wp*ABS(dl1_be), & + what//': the step advances the carried stretch (backward Euler at the new length)') + CALL CD_AGG_End(agg, es, em) + END SUBROUTINE case_length_step + + SUBROUTINE element_kinematics(q, v, conn, length, lstrd) + !! Stretched length and its rate (the chord rate, MoorDyn's lstr and lstrd) of one element. + REAL(wp), INTENT(IN) :: q(:), v(:) + INTEGER, INTENT(IN) :: conn(2) + REAL(wp), INTENT(OUT) :: length, lstrd + REAL(wp) :: chord(3) + chord = q(3*conn(2) - 2:3*conn(2)) - q(3*conn(1) - 2:3*conn(1)) + length = NORM2(chord) + lstrd = DOT_PRODUCT(chord/length, v(3*conn(2) - 2:3*conn(2)) - v(3*conn(1) - 2:3*conn(1))) + END SUBROUTINE element_kinematics + + SUBROUTINE md_coeffs(mode, dl_1, l, ea_d, ea_1) + !! MoorDyn's EA_D (ElasticMod 2: Ed; ElasticMod 3: the mean-load-dependent root of + !! MoorDyn-F Line_GetStateDeriv / MoorDyn-C Line::getStateDeriv at dl_1 > 0) and + !! EA_1 = EA_D EA/(EA_D - EA). + INTEGER, INTENT(IN) :: mode + REAL(wp), INTENT(IN) :: dl_1, l + REAL(wp), INTENT(OUT) :: ea_d, ea_1 + REAL(wp) :: k + IF (mode == 2) THEN + ea_d = EA_D2 + ELSE IF (dl_1 > 0.0_wp) THEN + k = EA_S/l + ea_d = 0.5_wp*(AMBL + VBETA*dl_1*k + EA_S + SQRT(AMBL*AMBL + 2.0_wp*AMBL*k*(VBETA*dl_1 - l) + & + (k*(VBETA*dl_1 + l))**2)) + ELSE + ea_d = AMBL + END IF + ea_1 = ea_d*EA_S/(ea_d - EA_S) + END SUBROUTINE md_coeffs + + REAL(wp) FUNCTION md_tension(mode, dl_1, length, lstrd, l) RESULT(t) + !! MoorDyn's segment tension MagT + MagTd at the state dl_1 and unstretched length l. + INTEGER, INTENT(IN) :: mode + REAL(wp), INTENT(IN) :: dl_1, length, lstrd, l + REAL(wp) :: ea_d, ea_1, ld_1 + CALL md_coeffs(mode, dl_1, l, ea_d, ea_1) + ld_1 = (ea_d*(length - l) - (ea_d + ea_1)*dl_1 + BA_D*lstrd)/(BA_D + BA_S) + t = BA_S*ld_1/l + IF (length >= l) t = t + ea_1*dl_1/l + END FUNCTION md_tension + + REAL(wp) FUNCTION md_backward_euler(mode, dl_1, length, lstrd, l, h) RESULT(dl1_next) + !! The backward-Euler step of MoorDyn's linear dl_1 ODE at length l, EA_D at the step-start + !! dl_1 (CableDyn lags it over the step). + INTEGER, INTENT(IN) :: mode + REAL(wp), INTENT(IN) :: dl_1, length, lstrd, l, h + REAL(wp) :: ea_d, ea_1, b + CALL md_coeffs(mode, dl_1, l, ea_d, ea_1) + b = BA_D + BA_S + dl1_next = (dl_1 + h*(ea_d*(length - l) + BA_D*lstrd)/b)/(1.0_wp + h*(ea_d + ea_1)/b) + END FUNCTION md_backward_euler + + ! --------------------------------------------------------------------------------------------- + ! 3. checkpoint restart + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_restart(deck, what) + !! The shell's rebuild recipe (CableDyn_OF): a fresh instance B takes A's coupled kinematics, + !! re-applies the restored command, then reloads the line interior and the dl_1 mirror. + CHARACTER(*), INTENT(IN) :: deck, what + TYPE(CD_AGG_ModuleType) :: agg_a, agg_b + INTEGER, PARAMETER :: NPOST = 12 + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), pa(3, 1), la(3, 1), pb(3, 1), lb(3, 1), v2(3, 1), a2(3, 1) + REAL(wp) :: dl, dldot, dmax + REAL(wp), ALLOCATABLE :: qL(:), vL(:), aL(:), dl1(:), dl1_b(:) + INTEGER :: es, ni, s, il, ndof, ne, npre, pass + LOGICAL :: cv, st, same + CHARACTER(512) :: em + + DO pass = 1, 2 + npre = MERGE(15, 50, pass == 1) + CALL CD_AGG_Init_From_Deck(agg_a, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//' restart: A initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg_a, r0, vel, acc, la, es, em) + vel = 0.0_wp + acc = 0.0_wp + DO s = 1, npre + CALL restart_command(s, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_a, [dl], [dldot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg_a, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + CALL require(.FALSE., what//' restart: A marches: '//TRIM(em)) + RETURN + END IF + END DO + CALL CD_AGG_Init_From_Deck(agg_b, deck, DT, es, em) + CALL require(es == CD_AGG_OK, what//' restart: B initialises: '//TRIM(em)) + CALL CD_AGG_GetMovingPointMesh(agg_a, pa, v2, a2, la, es, em) + CALL CD_AGG_UpdateStates_Moving(agg_b, pa, v2, a2, es, em) + ! the restored command is the one A's committed state was reached with + CALL restart_command(npre, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_b, [dl], [dldot], es, em, restored=.TRUE.) + CALL require(es == CD_AGG_OK, what//' restart: B re-applies the command: '//TRIM(em)) + il = agg_a%ctrl_line(1) + ndof = CD_System_Line_NDOF(agg_a%sys%fast%system, il, es, em) + ne = CD_System_Line_NElem(agg_a%sys%fast%system, il, es, em) + IF (ALLOCATED(qL)) DEALLOCATE (qL, vL, aL, dl1, dl1_b) + ALLOCATE (qL(ndof), vL(ndof), aL(ndof), dl1(ne), dl1_b(ne)) + CALL CD_Get_System_Line_State(agg_a%sys%fast%system, il, qL, vL, aL, es, em) + CALL CD_Update_System_Line_Interior_State(agg_b%sys%fast%system, il, qL(4:ndof - 3), vL(4:ndof - 3), & + es, em, a_interior=aL(4:ndof - 3)) + CALL require(es == CD_SYSTEM_OK, what//' restart: B takes the line interior: '//TRIM(em)) + CALL CD_Get_System_Line_VE_Dl1(agg_a%sys%fast%system, il, dl1, es, em) + CALL CD_Set_System_Line_VE_Dl1(agg_b%sys%fast%system, il, dl1, es, em) + CALL require(es == CD_SYSTEM_OK, what//' restart: B takes the dl_1 mirror: '//TRIM(em)) + ASSOCIATE (ma => agg_a%sys%fast%system%lines(il), mb => agg_b%sys%fast%system%lines(il)) + same = ALL(bits_eq_v(ma%l0, mb%l0)) .AND. ALL(bits_eq_v(ma%l0_c, mb%l0_c)) + END ASSOCIATE + CALL require(same, what//' restart: B carries the lengths and the committed lengths of A') + dmax = 0.0_wp + DO s = npre + 1, npre + NPOST + CALL restart_command(s, dl, dldot) + CALL CD_AGG_Apply_LineControl(agg_a, [dl], [dldot], es, em) + CALL CD_AGG_Apply_LineControl(agg_b, [dl], [dldot], es, em) + CALL CD_AGG_Step_Moving(agg_a, DT, r0, vel, acc, cv, st, ni, es, em) + same = same .AND. es == CD_AGG_OK .AND. cv + CALL CD_AGG_Step_Moving(agg_b, DT, r0, vel, acc, cv, st, ni, es, em) + same = same .AND. es == CD_AGG_OK .AND. cv + CALL CD_AGG_CalcOutput(agg_a, es, em) + CALL CD_AGG_CalcOutput(agg_b, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_a, pa, v2, a2, la, es, em) + CALL CD_AGG_GetMovingPointMesh(agg_b, pb, v2, a2, lb, es, em) + CALL CD_Get_System_Line_VE_Dl1(agg_a%sys%fast%system, il, dl1, es, em) + CALL CD_Get_System_Line_VE_Dl1(agg_b%sys%fast%system, il, dl1_b, es, em) + dmax = MAX(dmax, MAXVAL(ABS(la - lb)), MAXVAL(ABS(dl1 - dl1_b))) + same = same .AND. ALL(bits_eq_v(RESHAPE(la, [3]), RESHAPE(lb, [3]))) .AND. ALL(bits_eq_v(dl1, dl1_b)) .AND. & + ALL(bits_eq_v(agg_a%sys%fast%system%lines(il)%q, agg_b%sys%fast%system%lines(il)%q)) + END DO + PRINT '(A,A,A,I0,A,ES10.3)', ' ', what, ' restart after step ', npre, & + ': max difference of the fairlead load and dl_1 ', dmax + CALL require(same, what//' restart: the restarted run continues bit for bit ('// & + MERGE('mid-ramp', 'hold ', pass == 1)//')') + CALL CD_AGG_End(agg_a, es, em) + CALL CD_AGG_End(agg_b, es, em) + END DO + END SUBROUTINE case_restart + + SUBROUTINE restart_command(step, dl, dldot) + !! A 0.4 m pay-out on a half-cosine over 2 s, then held. + INTEGER, INTENT(IN) :: step + REAL(wp), INTENT(OUT) :: dl, dldot + REAL(wp) :: t + t = REAL(step, wp)*DT + IF (t < 2.0_wp) THEN + CALL half_cosine(t, 0.0_wp, 2.0_wp, 0.0_wp, 0.4_wp, dl, dldot) + ELSE + dl = 0.4_wp + dldot = 0.0_wp + END IF + END SUBROUTINE restart_command + + ! --------------------------------------------------------------------------------------------- + ! decks and helpers + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE write_deck(path, ea, no_force_blend) + !! A Coupled fairlead at x = 0 and a Fixed anchor 102 m away at mid-depth, 100 m of rope in 10 + !! segments written fairlead first (its only host-driven end at NodeA, the controlled end), + !! with a CONTROL row on channel 1. The rope is nearly neutrally buoyant (0.05 kg/m above the + !! displaced water's). no_force_blend writes False alpha_force_blend. + CHARACTER(*), INTENT(IN) :: path, ea + LOGICAL, INTENT(IN) :: no_force_blend + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Viscoelastic line-control test deck' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'rope 0.1438 16.70 '//ea//' 1.0e6|1.0e5 0.0 1.2 0.2 1.0 0.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Coupled 0.0 0.0 -100.0 0 0 0 0' + WRITE (u, '(A)') '2 Fixed 102.0 0.0 -100.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 rope 100.0 10' + WRITE (u, '(A)') '--- CONTROL ---' + WRITE (u, '(A)') 'ChannelID Lines' + WRITE (u, '(A)') '(-) (-)' + WRITE (u, '(A)') '1 1' + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '200.0 WtrDpth' + IF (no_force_blend) WRITE (u, '(A)') 'False alpha_force_blend' + WRITE (u, '(A)') '--- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1' + WRITE (u, '(A)') '--- end ---' + CLOSE (u) + END SUBROUTINE write_deck + + ELEMENTAL LOGICAL FUNCTION bits_eq(x, y) RESULT(same) + REAL(wp), INTENT(IN) :: x, y + same = TRANSFER(x, 0_INT64) == TRANSFER(y, 0_INT64) + END FUNCTION bits_eq + + FUNCTION bits_eq_v(x, y) RESULT(same) + REAL(wp), INTENT(IN) :: x(:), y(:) + LOGICAL :: same(SIZE(x)) + same = bits_eq(x, y) + END FUNCTION bits_eq_v + + FUNCTION fmt_real(x) RESULT(s) + REAL(wp), INTENT(IN) :: x + CHARACTER(24) :: s + WRITE (s, '(F10.3)') x + s = ADJUSTL(s) + END FUNCTION fmt_real + + SUBROUTINE require(ok, what) + LOGICAL, INTENT(IN) :: ok + CHARACTER(*), INTENT(IN) :: what + IF (ok) THEN + PRINT '(A)', 'PASS: '//what + ELSE + PRINT '(A)', 'FAIL: '//what + nfail = nfail + 1 + END IF + END SUBROUTINE require + +END PROGRAM test_viscoelastic_control From 4e6874cdf7eb69f9b9b84316c7d32ea65b540e12 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 18:29:52 +0900 Subject: [PATCH 05/10] fix(syrope): steep state roots, a length change inside sub-steps, review items - CD_Syrope_State_Advance: a light rope (BA_s|BA_d = 1e4|1e3) has a residual R' of order 1e6, which can change sign between two adjacent reals with |R| above the test on both, so the bisection ran out and the solve failed (on dev too). When the bracket cannot be split any more the solve now returns the end with the smaller |R|, the root to machine precision. Over the reviewer's 440,000 fuzzed states every solve that dev converges is bit-identical; the 26 that dev fails (14 at the working-curve top, 12 adjacent-real roots) now converge. tests/test_syrope.f90 gains the 12 states (they fail on the previous kernel). - An earlier switch from the creeping Newton loop to bisection was tried and left out: switching after two to eight creeping iterations in a row changed 6e3 to 4e4 of the fuzzed solves that converge without it. - test_syrope_control gate 6: a length change inside sub-steps. The fairlead sways (y = 0.05 t^3) while its Syrope segment is paid out at 0.1 m/s, ei0_substep_angle 1e-5 deg and ei0_substep_max 4, so all 40 steps are solved in 4 sub-steps; against the same run in plain steps of dt/4 with the command at the sub-step times the fairlead load matches to 9.5e-14 of its peak, the tensions to 2.9e-13 and the slow strains to 5.9e-14. - doc/driver_format.md: the zero-damping-at-constant-strain sentence is scoped to linear-elastic segments (MoorDyn-F BA (lstrd - lstr ld/l)/l); the viscoelastic and Syrope laws take the plain chord rate. - python/tests/test_native_model.py: the handle-release test captures the constructor's own instance through init_deck and checks that instance's close, so instances other tests leave behind cannot satisfy or break it, whether or not the collector runs. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 6 +- doc/driver_format.md | 6 +- doc/theory.rst | 3 +- python/tests/test_native_model.py | 31 ++++--- src/CableDyn_Syrope.f90 | 21 ++++- tests/test_syrope.f90 | 77 ++++++++++++++++- tests/test_syrope_control.f90 | 134 +++++++++++++++++++++++++++++- 7 files changed, 255 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0685747f..70cd708e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -207,8 +207,10 @@ All notable changes to CableDyn are recorded in this file. The format follows - A Syrope line held at its running maximum (the fairlead pulled out and held) under `False alpha_force_blend` stopped with "Syrope backward-Euler state solve did not converge": next to the top sample of the working curve the Newton step's difference quotient straddled - the kink and crept along one side of the bracket. The solve now finishes by bisection there; - solves that converged before are unchanged. + the kink and crept along one side of the bracket. The solve now finishes by bisection there, + and where a light rope's steep residual (BA_s|BA_d = 1e4|1e3) changes sign between two + adjacent reals it returns that root to machine precision. Over 440,000 fuzzed states every + solve that converged before is bit-identical, and the 26 that failed now converge. - A deck with a WaterKin elevation history (`WaveKinMod 1`) at `TMax = 0`, a check of the static start, reduces the record over its own length instead of failing for want of a positive `TMax`. diff --git a/doc/driver_format.md b/doc/driver_format.md index 308455a8..1a8f2d53 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1094,8 +1094,10 @@ the `NodeB` written in the deck. A line written in the stock MoorDyn order, with end at `NodeB`, is therefore controlled where MoorDyn-F controls it, at its last segment N at `AttachB`; so is a line with both or no host-driven ends. A line written fairlead first, with its only host-driven end at `NodeA`, is controlled at that end. The length is held over the advance. -Axial damping on that segment acts on the strain rate, as in MoorDyn-F, so a segment paid out at -constant strain carries no damping tension. +On a linear-elastic segment the axial damping acts on the strain rate, as in MoorDyn-F +(`BA (lstrd − lstr ld/l)/l`), so a segment paid out at constant strain carries no damping +tension; the viscoelastic and Syrope laws take the plain chord rate `lstrd`, as MoorDyn-F and +MoorDyn-C do (see the bullets below). A command outside MoorDyn-F's bounds stops the run with a message that names the channel, the line, the command and the bound, as MoorDyn-F stops there. With `UnstrLen` the line's unstretched diff --git a/doc/theory.rst b/doc/theory.rst index 6c43ce12..93e94481 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -758,7 +758,8 @@ backward-Euler solve, :math:`\varepsilon_\text{slow}^{n+1} = \varepsilon_\text{slow}^{n} + \Delta t\,\dot\varepsilon_\text{slow}(\varepsilon_\text{slow}^{n+1}, \varepsilon, \dot\varepsilon)` constrained to :math:`\varepsilon_\text{slow} \ge 0`, gives the slow strain that the force uses (safeguarded Newton steps, finished by bisection where they stall next to a kink of the -interpolated curves, as at the top of the working curve). The tangent carries :math:`\partial\varepsilon_\text{slow}^{n+1}/\partial(\varepsilon, \dot\varepsilon)` +interpolated curves, as at the top of the working curve; a residual so steep that it changes +sign between two adjacent reals gives the root to machine precision). The tangent carries :math:`\partial\varepsilon_\text{slow}^{n+1}/\partial(\varepsilon, \dot\varepsilon)` from the implicit-function theorem. The step commits that same slow strain, so the force applied to the nodes equals the reported tension. The working curve is the one regenerated at the committed :math:`T_\text{max}`. The branch follows the evaluated slow strain: the working curve diff --git a/python/tests/test_native_model.py b/python/tests/test_native_model.py index 5f9b6dae..9039d5a5 100644 --- a/python/tests/test_native_model.py +++ b/python/tests/test_native_model.py @@ -7,7 +7,6 @@ from __future__ import annotations import ctypes -import gc import importlib.util import os import sys @@ -59,23 +58,31 @@ def test_array_shapes_are_validated_before_the_library(): def test_failed_initialization_in_the_constructor_releases_the_handle(monkeypatch): - # finalise the instances earlier tests left for the collector first, so that only the - # failed constructor's close is recorded - gc.collect() - closed: list[bool] = [] - original = model_module.CableDyn.close + # The constructor's own instance is captured when it calls init_deck, and only its closes + # count: instances other tests left behind may be finalized (and closed) at any point, with + # or without the cyclic collector running. + own: list[model_module.CableDyn] = [] + closes: list[tuple[model_module.CableDyn, bool]] = [] + original_init_deck = model_module.CableDyn.init_deck + original_close = model_module.CableDyn.close + + def tracking_init_deck(self: model_module.CableDyn, deck: str | os.PathLike[str]) -> None: + own.append(self) + original_init_deck(self, deck) def tracking_close(self: model_module.CableDyn) -> None: - # only an instance's first close (generation 0): an instance an earlier test closed and - # left behind can be finalized while this one is constructed, closing it again - if self._generation == 0: - closed.append(bool(self._handle)) - original(self) + closes.append((self, bool(self._handle))) + original_close(self) + monkeypatch.setattr(model_module.CableDyn, "init_deck", tracking_init_deck) monkeypatch.setattr(model_module.CableDyn, "close", tracking_close) with pytest.raises(CableDynError, match="CableDyn_InitDeck failed") as caught: cabledyn.CableDyn("no_such_deck_anywhere.dat") - assert closed[0] is True + assert len(own) == 1 + own_closes = [held for instance, held in closes if instance is own[0]] + # the failed constructor closed its instance while it still held the handle + assert own_closes and own_closes[0] is True + assert not own[0]._handle assert caught.value.status != 0 and caught.value.detail diff --git a/src/CableDyn_Syrope.f90 b/src/CableDyn_Syrope.f90 index e77fb5f6..3fd1718c 100644 --- a/src/CableDyn_Syrope.f90 +++ b/src/CableDyn_Syrope.f90 @@ -575,8 +575,10 @@ SUBROUTINE CD_Syrope_State_Advance(td, on_wc, wc_strain, wc_tension, wc_slow, sl END IF IF (residual < CD_ZERO) THEN lo = x + rlo = residual ELSE hi = x + rhi = residual END IF ! Safeguarded numerical Newton step. Near a kink or a flat derivative, @@ -604,10 +606,23 @@ SUBROUTINE CD_Syrope_State_Advance(td, on_wc, wc_strain, wc_tension, wc_slow, sl ! the difference quotient straddles the kink, and every step lands inside the bracket and ! moves only that end. Finish then by bisection, which halves the bracket every iteration ! (R is continuous on it, so the bracket closes on its root) until the residual test is met. - ! A solve that converged above never gets here, so its result is unchanged. + ! A steep R (a light BA_s + BA_d, R' = 1 - dt d(rate)/d(eps_slow) of order 1e6) can change + ! sign between two adjacent reals with |R| above the test on both: the root is then located + ! to machine precision, and the end with the smaller |R| is taken (R(lo) < 0 <= R(hi)). + ! A solve that converged above never gets here, so its result is unchanged. The switch comes + ! only after the 80 Newton iterations: many solves that converge creep for a while first, + ! and switching on creeping iterations (two to eight in a row) changed 6e3 to 4e4 of 4.4e5 + ! fuzzed solves that converge without it. DO iter = 1, 200 x = 0.5_wp*(lo + hi) - IF (.NOT. (x > lo .AND. x < hi)) EXIT + IF (.NOT. (x > lo .AND. x < hi)) THEN + x = hi + IF (ABS(rlo) < ABS(rhi)) x = lo + CALL eval_rate(x, rate, tension, t_mean) + IF (ErrStat /= CD_SYROPE_OK) RETURN + slow_next = x + RETURN + END IF CALL eval_rate(x, rate, tension, t_mean) IF (ErrStat /= CD_SYROPE_OK) RETURN residual = x - slow_old - dt*rate @@ -618,8 +633,10 @@ SUBROUTINE CD_Syrope_State_Advance(td, on_wc, wc_strain, wc_tension, wc_slow, sl END IF IF (residual < CD_ZERO) THEN lo = x + rlo = residual ELSE hi = x + rhi = residual END IF END DO CALL fail(ErrStat, ErrMsg, 'Syrope backward-Euler state solve did not converge') diff --git a/tests/test_syrope.f90 b/tests/test_syrope.f90 index d8a1c621..c9a658ce 100644 --- a/tests/test_syrope.f90 +++ b/tests/test_syrope.f90 @@ -9,7 +9,8 @@ PROGRAM test_syrope !! both branches, the running-max regeneration event, and the fail-closed !! battery. The backward-Euler state solve also converges when its root sits at the top !! sample of the working curve (a rope at rest on its OWC at its running maximum), where the - !! safeguarded Newton step alone crept along one side of the bracket and the solve failed. + !! safeguarded Newton step alone crept along one side of the bracket and the solve failed, and + !! when R is so steep (light BA) that it changes sign between two adjacent reals. USE CableDyn_Precision, ONLY: wp USE CableDyn_Syrope, ONLY: CD_SyropeType, CD_Syrope_Init, CD_Syrope_End, & CD_Syrope_Working_Curve, CD_Syrope_Find_Strains, & @@ -71,6 +72,7 @@ PROGRAM test_syrope CALL case_interp_clamps() CALL case_projected_state_advance() CALL case_state_advance_at_wc_top() + CALL case_state_advance_steep() CALL case_element_load() CALL case_model_legacy_ba_mask() CALL case_model_held() @@ -390,6 +392,79 @@ SUBROUTINE case_state_advance_at_wc_top() CALL CD_Syrope_End(td) END SUBROUTINE case_state_advance_at_wc_top + SUBROUTINE case_state_advance_steep() + !! Twelve states of a light rope (QUADRATIC, p2 = 0.5, BA_s|BA_d = 1e4|1e3) next to the top + !! of the working curve, from a fuzz of the solve, on which it failed: R' = 1 - dt + !! d(rate)/d(eps_slow) is of order 1e6, so R changes sign between two adjacent reals with |R| + !! above the residual test on both. The solve returns the root to machine precision: R + !! changes sign between the result and its neighbour on the other side, and the returned + !! mean tension is the one at the result. + INTEGER, PARAMETER :: NS = 12 + ! k1, T_max, slow_old, eps, deps, dt + REAL(wp), PARAMETER :: ST(6, NS) = RESHAPE([ & + 0.5_wp, 1.36633017834277474e6_wp, 1.39304174224812102e-2_wp, & + 2.20484956584058520e-2_wp, -2.91917316204991001e-5_wp, 5.00000000000000028e-2_wp, & + 0.5_wp, 1.37680196069096052e6_wp, 5.35760113574383894e-3_wp, & + 2.22609221334421868e-2_wp, -5.34676314308176825e-13_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.36922682379846880e6_wp, 1.39737625858687414e-2_wp, & + 2.21031832264193540e-2_wp, -1.54171755685975461e-10_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.37055211343974154e6_wp, 1.39940856061747162e-2_wp, & + 2.21297981068623792e-2_wp, -1.34624093812978118e-5_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.37527118954379787e6_wp, 6.58388926223281434e-3_wp, & + 2.22260959754430436e-2_wp, 9.20479632170825829e-10_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.37087072085890593e6_wp, 1.35832674506310615e-2_wp, & + 2.21347560532284236e-2_wp, 2.40447604051167914e-5_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.36645106216464797e6_wp, 1.39322344956098881e-2_wp, & + 2.20511942008235519e-2_wp, -2.02603337569392040e-13_wp, 5.00000000000000028e-2_wp, & + 0.5_wp, 1.36815732104760036e6_wp, 1.39584978679733341e-2_wp, & + 2.20753893183824081e-2_wp, -5.23605833892740875e-6_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.37059169344443991e6_wp, 1.39949247390703350e-2_wp, & + 2.21338733365970056e-2_wp, 0.00000000000000000e0_wp, 2.00000000000000011e-1_wp, & + 0.5_wp, 1.38033403057004604e6_wp, 1.35405334447999213e-2_wp, & + 2.23240330306617440e-2_wp, 0.00000000000000000e0_wp, 2.00000000000000011e-1_wp, & + 0.3_wp, 4.73718757443073089e5_wp, 3.14555534663941896e-3_wp, & + 6.13349734479911885e-3_wp, -1.55116580233012027e-13_wp, 2.00000000000000011e-1_wp, & + 0.3_wp, 4.71172300428577990e5_wp, 6.16859346183203398e-4_wp, & + 6.09875211747266683e-3_wp, -2.98940253643357627e-5_wp, 2.00000000000000011e-1_wp], [6, NS]) + TYPE(CD_SyropeType) :: td + REAL(wp) :: ws(CD_SYROPE_NWC), wt(CD_SYROPE_NWC), wsl(CD_SYROPE_NWC) + REAL(wp) :: slow_next, t_mean, divider, rate, tension, mean, r0, r1, other, worst + INTEGER :: es, k, n_ok + CHARACTER(200) :: em + n_ok = 0 + worst = 0.0_wp + DO k = 1, NS + CALL CD_Syrope_Init(td, OWC_EPS, OWC_TEN, CD_SYROPE_WC_QUADRATIC, ST(1, k), 0.5_wp, & + ALPHA, BETA, 1.0e4_wp, 1.0e3_wp, es, em) + CALL require(es == CD_SYROPE_OK, 'steep:init') + CALL CD_Syrope_Working_Curve(td, ST(2, k), ws, wt, wsl, es, em) + CALL require(es == CD_SYROPE_OK, 'steep:wc') + divider = CD_Syrope_Branch_Divider(td, ST(2, k)) + CALL CD_Syrope_State_Advance(td, ST(3, k) < divider, ws, wt, wsl, ST(3, k), ST(4, k), ST(5, k), ST(6, k), & + slow_next, t_mean, es, em, divider=divider) + IF (es /= CD_SYROPE_OK) THEN + CALL require(.FALSE., 'steep:the solve converges: '//TRIM(em)) + CALL CD_Syrope_End(td) + CYCLE + END IF + CALL CD_Syrope_Rate_And_Tension(td, slow_next < divider, ws, wt, wsl, slow_next, ST(4, k), ST(5, k), rate, & + tension, mean, es, em) + r0 = slow_next - ST(3, k) - ST(6, k)*rate + other = NEAREST(slow_next, MERGE(1.0_wp, -1.0_wp, r0 < 0.0_wp)) + CALL CD_Syrope_Rate_And_Tension(td, other < divider, ws, wt, wsl, other, ST(4, k), ST(5, k), rate, & + tension, mean, es, em) + r1 = other - ST(3, k) - ST(6, k)*rate + worst = MAX(worst, ABS(r0)) + CALL CD_Syrope_Rate_And_Tension(td, slow_next < divider, ws, wt, wsl, slow_next, ST(4, k), ST(5, k), rate, & + tension, mean, es, em) + IF ((r0 < 0.0_wp .NEQV. r1 < 0.0_wp) .AND. bits_same(mean, t_mean)) n_ok = n_ok + 1 + CALL CD_Syrope_End(td) + END DO + WRITE (*, '(A,I0,A,I0,A,ES10.3)') ' steep: ', n_ok, ' of ', NS, & + ' roots located to machine precision, largest |R| ', worst + CALL require(n_ok == NS, 'steep:roots to machine precision') + END SUBROUTINE case_state_advance_steep + LOGICAL FUNCTION bits_same(a, b) RESULT(same) REAL(wp), INTENT(IN) :: a, b same = TRANSFER(a, 0_8) == TRANSFER(b, 0_8) diff --git a/tests/test_syrope_control.f90 b/tests/test_syrope_control.f90 index aa85df7c..db15c97e 100644 --- a/tests/test_syrope_control.f90 +++ b/tests/test_syrope_control.f90 @@ -35,6 +35,13 @@ PROGRAM test_syrope_control !! then lies next to the top sample of the working curve, where the safeguarded Newton step !! alone crept and stopped the run (CableDyn_Syrope, CD_Syrope_State_Advance); every step !! converges and the held tension is the OWC tension at the line strain. + !! 6. A length change inside sub-steps: the fairlead sways sideways, y = 0.05 t^3, while its + !! segment is paid out at 0.1 m/s for 2 s, with ei0_substep_angle 1e-5 deg and + !! ei0_substep_max 4, so every step (0.05 s) is solved again in 4 sub-steps that spread + !! the length change over them. The oracle is the same run with ei0_substeps off in plain + !! steps of 0.0125 s with the command at the sub-step times (the + !! quintic end motion of a sub-step reproduces the cubic sway, and the interpolated lengths + !! the constant pay-out rate), compared at every 0.05 s. !! Gates 1-3 and the polyester-chain line of 4 stopped at initialisation before (CONTROL on a !! Syrope segment was refused). USE CableDyn_Precision, ONLY: wp @@ -77,6 +84,10 @@ PROGRAM test_syrope_control CALL write_deck('sctl_chain_poly_chain.dat', 'chain_poly_chain') CALL write_deck('sctl_single_noblend.dat', 'single', no_force_blend=.TRUE.) CALL write_deck('sctl_hold_noblend.dat', 'single', no_force_blend=.TRUE., no_control=.TRUE.) + CALL write_deck('sctl_sub.dat', 'single', options=[CHARACTER(24) :: '1.0e-5 ei0_substep_angle', & + '4 ei0_substep_max']) + CALL write_deck('sctl_sub_ref.dat', 'single', options=[CHARACTER(24) :: '1.0e-5 ei0_substep_angle', & + 'off ei0_substeps']) CALL case_quasi_static('sctl_single.dat', 'quasi-static') CALL case_quasi_static('sctl_single_noblend.dat', 'quasi-static, False alpha_force_blend') @@ -85,6 +96,7 @@ PROGRAM test_syrope_control CALL case_restart() CALL case_composite() CALL case_hold_at_maximum() + CALL case_substep_length_change() IF (nfail > 0) THEN PRINT '(I0,A)', nfail, ' assertion(s) failed' @@ -648,6 +660,115 @@ SUBROUTINE case_hold_at_maximum() CALL CD_AGG_End(agg, es, em) END SUBROUTINE case_hold_at_maximum + ! --------------------------------------------------------------------------------------------- + ! 6. a length change inside sub-steps + ! --------------------------------------------------------------------------------------------- + + SUBROUTINE case_substep_length_change() + INTEGER, PARAMETER :: NSTEP = 40, NSUB = 4 + REAL(wp), PARAMETER :: C_SWAY = 0.05_wp, RATE = 0.1_wp + TYPE(CD_AGG_ModuleType) :: agg, ref + REAL(wp) :: r0(3, 1), pos(3, 1), vel(3, 1), acc(3, 1), la(3, 1), lr(3, 1), v2(3, 1), a2(3, 1), t, h + REAL(wp) :: d_load, d_slow, d_ten, load_scale, rate_k + REAL(wp), ALLOCATABLE :: slow_a(:), tmax_a(:), slow_r(:), tmax_r(:), ten_a(:), ten_r(:) + INTEGER :: es, ni, s, k, il, ec, ne, max_a, max_r, n_sub, n_ref + INTEGER(INT64) :: calls, ev_a, ev_prev, ev_r, capped, fallbacks + LOGICAL :: cv, st, ok, sub + CHARACTER(512) :: em + + CALL CD_AGG_Init_From_Deck(agg, 'sctl_sub.dat', DT, es, em) + CALL require(es == CD_AGG_OK, 'sub-steps: the deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + h = DT/REAL(NSUB, wp) + CALL CD_AGG_Init_From_Deck(ref, 'sctl_sub_ref.dat', h, es, em) + CALL require(es == CD_AGG_OK, 'sub-steps: the reference deck initialises: '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, la, es, em) + il = agg%ctrl_line(1) + ec = agg%ctrl_elem(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (slow_a(ne), tmax_a(ne), slow_r(ne), tmax_r(ne), ten_a(ne), ten_r(ne)) + d_load = 0.0_wp + d_slow = 0.0_wp + d_ten = 0.0_wp + load_scale = 0.0_wp + n_sub = 0 + n_ref = 0 + ev_prev = 0 + ok = .TRUE. + DO s = 1, NSTEP + t = REAL(s, wp)*DT + CALL sway(t, r0, C_SWAY, pos, vel, acc) + CALL CD_AGG_Apply_LineControl(agg, [RATE*t], [RATE], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg, DT, pos, vel, acc, cv, st, ni, es, em) + ok = ok .AND. es == CD_AGG_OK .AND. cv + CALL CD_AGG_Get_Substep_Counts(agg, calls, ev_a, max_a, capped, fallbacks) + sub = ev_a > ev_prev + ev_prev = ev_a + ! the reference: the step in NSUB plain steps (A must have sub-stepped it) + IF (sub) THEN + n_sub = n_sub + 1 + DO k = 1, NSUB + t = (REAL(s - 1, wp) + REAL(k, wp)/REAL(NSUB, wp))*DT + CALL sway(t, r0, C_SWAY, pos, vel, acc) + ! a sub-step's rate is interpolated from the committed one as its length is (no effect + ! on a Syrope segment, whose law takes the chord rate) + rate_k = RATE + IF (s == 1) rate_k = RATE*REAL(k, wp)/REAL(NSUB, wp) + CALL CD_AGG_Apply_LineControl(ref, [RATE*t], [rate_k], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(ref, h, pos, vel, acc, cv, st, ni, es, em) + ok = ok .AND. es == CD_AGG_OK .AND. cv + n_ref = n_ref + 1 + END DO + ELSE + ok = .FALSE. + em = 'the step was not sub-stepped' + END IF + IF (.NOT. ok) THEN + CALL require(.FALSE., 'sub-steps: step at t = '//TRIM(fmt_real(t))//': '//TRIM(em)) + EXIT + END IF + CALL CD_AGG_CalcOutput(agg, es, em) + CALL CD_AGG_CalcOutput(ref, es, em) + CALL CD_AGG_GetMovingPointMesh(agg, pos, v2, a2, la, es, em) + CALL CD_AGG_GetMovingPointMesh(ref, pos, v2, a2, lr, es, em) + CALL CD_Get_System_Line_Syrope_State(agg%sys%fast%system, il, slow_a, tmax_a, es, em) + CALL CD_Get_System_Line_Syrope_State(ref%sys%fast%system, il, slow_r, tmax_r, es, em) + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten_a, es, em) + CALL CD_Get_System_Line_Tension(ref%sys%fast%system, il, ten_r, es, em) + load_scale = MAX(load_scale, NORM2(lr(:, 1))) + d_load = MAX(d_load, NORM2(la(:, 1) - lr(:, 1))) + d_slow = MAX(d_slow, MAXVAL(ABS(slow_a - slow_r))/MAXVAL(slow_r)) + d_ten = MAX(d_ten, MAXVAL(ABS(ten_a - ten_r))/MAXVAL(ten_r)) + END DO + IF (ok) THEN + CALL CD_AGG_Get_Substep_Counts(ref, calls, ev_r, max_r, capped, fallbacks) + PRINT '(A,I0,A,I0,A,I0,A,F7.4,A)', ' sub-steps: ', n_sub, ' of ', NSTEP, ' steps sub-stepped (at most ', & + max_a, '), the segment paid out to ', agg%sys%fast%system%lines(il)%l0(ec) - agg%ctrl_base_l0(1), ' m' + PRINT '(A,ES10.3,A,ES10.3,A,ES10.3)', ' against the plain reference steps: fairlead load / its peak ', & + d_load/load_scale, ', tensions ', d_ten, ', slow strains ', d_slow + CALL require(n_sub == NSTEP .AND. n_ref == NSUB*NSTEP .AND. max_a == NSUB .AND. ev_r == 0, & + 'sub-steps: every step is solved in 4 sub-steps, the reference in none') + CALL require(d_load <= 1.0e-10_wp*load_scale .AND. d_ten <= 1.0e-10_wp .AND. d_slow <= 1.0e-10_wp, & + 'sub-steps: the sub-stepped length change is the plain steps'' at the sub-step times') + END IF + CALL CD_AGG_End(agg, es, em) + CALL CD_AGG_End(ref, es, em) + END SUBROUTINE case_substep_length_change + + SUBROUTINE sway(t_s, r0, c, p, v, a) + !! The fairlead moving sideways as y = c t^3 from its static position r0 (at rest at t = 0; + !! a cubic, which the C2 quintic of a sub-stepped step reproduces). + REAL(wp), INTENT(IN) :: t_s, r0(3, 1), c + REAL(wp), INTENT(OUT) :: p(3, 1), v(3, 1), a(3, 1) + p = r0 + p(2, 1) = r0(2, 1) + c*t_s**3 + v = 0.0_wp + v(2, 1) = 3.0_wp*c*t_s**2 + a = 0.0_wp + a(2, 1) = 6.0_wp*c*t_s + END SUBROUTINE sway + ! --------------------------------------------------------------------------------------------- ! the OWC table, files and helpers ! --------------------------------------------------------------------------------------------- @@ -703,18 +824,20 @@ SUBROUTINE write_settings(path, owc_path) CLOSE (u) END SUBROUTINE write_settings - SUBROUTINE write_deck(path, kind, no_force_blend, no_control) + SUBROUTINE write_deck(path, kind, no_force_blend, no_control, options) !! A Coupled fairlead at x = 0 and a Fixed anchor at mid-depth, the line written fairlead first !! (its only host-driven end at NodeA, the controlled end), with a CONTROL row on channel 1: !! single: 100 m of polyester in 10 segments, the anchor 102 m away; !! poly_chain: 80 m of polyester (8 segments) then 20 m of chain (2), 101.6 m; !! chain_poly_chain: 10 m of chain, 80 m of polyester, 10 m of chain (1, 8, 1), 101.6 m. !! The polyester is nearly neutrally buoyant (0.05 kg/m above the displaced water's). - !! no_force_blend writes False alpha_force_blend, no_control leaves the CONTROL section out. + !! no_force_blend writes False alpha_force_blend, no_control leaves the CONTROL section out, + !! options are further OPTIONS rows. CHARACTER(*), INTENT(IN) :: path, kind LOGICAL, INTENT(IN), OPTIONAL :: no_force_blend, no_control + CHARACTER(*), INTENT(IN), OPTIONAL :: options(:) LOGICAL :: ctrl - INTEGER :: u + INTEGER :: u, k OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') WRITE (u, '(A)') 'Syrope line-control test deck ('//kind//')' WRITE (u, '(A)') '--- LINE TYPES ---' @@ -764,6 +887,11 @@ SUBROUTINE write_deck(path, kind, no_force_blend, no_control) IF (PRESENT(no_force_blend)) THEN IF (no_force_blend) WRITE (u, '(A)') 'False alpha_force_blend' END IF + IF (PRESENT(options)) THEN + DO k = 1, SIZE(options) + WRITE (u, '(A)') TRIM(options(k)) + END DO + END IF WRITE (u, '(A)') '--- OUTPUTS ---' WRITE (u, '(A)') 'FairTen1' WRITE (u, '(A)') '--- end ---' From aca7b5c544815b2cddf231c3cac3b47f8626055c Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 17:49:22 +0900 Subject: [PATCH 06/10] feat(currents): MoorDyn-C Currents 2 and 5, currents in time and space The standalone routes read the MoorDyn-C time-varying depth profile (Currents 2, current_profile_dynamic.txt) and the grid in x, y, z and time (Currents 5, current_profile_4d.txt) as MoorDyn-C v2.7.1 does (constructDynamicCurrentGrid, construct4DCurrentGrid and CurrentGrid::getCurrentKin): the table is resampled at its smallest time interval from t = 0, blended linearly in time with the upper sample index taken modulo the sample count (the grid repeats past its last sample), and trilinearly in space, held beyond the end coordinates, with no fluid acceleration. Currents 2 depths are read in single precision, as MoorDyn-C's stof. A new CD_CurrentGridType (CableDyn_Hydro) carries the grid; deck_current_velocity now takes the node position and time, so every current consumer (EI = 0 lines, finite-EI cables, points, rods, bodies) samples the grid where and when it evaluates the fluid. The static start takes the current at t = 0, as MoorDyn-C's initial condition does: the EI = 0 and finite-EI static solvers sample the grid at the iterate's node positions, the finite-EI solver through its turned and translated solve frame (CD_HermiteStaticCurrentType%origin). current_profile_4d.txt is read as MoorDyn-C documents it: a numeric line 6 is a grid point (MoorDyn-C v2.7.1 starts at line 7 and leaves that point at zero) and rows are matched to the grid by value (MoorDyn-C matches the coordinate text); a missing, repeated or off-grid point is rejected. Currents 3 and 4 still fail closed by name (no current source in MoorDyn-C v2.7.1), as do the coupled and mixed aggregate routes. Gates (test_mdc_currents, test_mdc_currents_runs, shared inputs in tests/data/currents_mdc from validation/scripts/currents_mdc_reference.py): - the current at 739 points and times, past the last sample included, identical to MoorDyn-C v2.7.1's and within 4.4e-16 m/s of an independent Python evaluation of the files; - a constant Currents 2 table equals Currents 1 (0 difference, probe and runs on both routes); a Currents 5 grid uniform in x and y equals the Currents 2 profile (2.2e-16 m/s; runs to the last printed digit); - on a 70 m rope held across the flow, the tension change of a time-varying and of a sheared current within 0.8 % and 0.9 % of MoorDyn-C's largest change over 22 s (still water within 0.12 %); - the static start in a sheared grid is an equilibrium of the march on the EI = 0, finite-EI and point-connected routes (tensions move by at most 1.4e-7 of the change the current makes; 0.8 with the grid sampled in the translated solve frame). Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 9 + CMakeLists.txt | 24 + doc/api_python.rst | 3 +- doc/capabilities.rst | 5 + doc/driver_format.md | 53 +- doc/file_formats.rst | 8 +- doc/options.rst | 9 +- doc/python.rst | 3 +- python/cabledyn/builder.py | 5 +- python/cabledyn/deck_file.py | 50 +- python/cabledyn/study.py | 10 +- python/tests/test_deck_file.py | 6 +- python/tests/test_deck_native_parity.py | 20 +- src/CableDyn_DeckDriver.f90 | 601 ++++++++++++++++-- src/CableDyn_HermiteCableStatic.f90 | 35 +- src/CableDyn_Hydro.f90 | 196 ++++++ src/CableDyn_Model.f90 | 10 +- src/CableDyn_Static.f90 | 32 +- .../data/currents_mdc/c1/current_profile.txt | 14 + tests/data/currents_mdc/c1/currents.dat | 26 + tests/data/currents_mdc/c1/points.txt | 45 ++ tests/data/currents_mdc/c1/ref_moordyn_c.csv | 46 ++ tests/data/currents_mdc/c1/ref_python.csv | 46 ++ .../c2/current_profile_dynamic.txt | 11 + tests/data/currents_mdc/c2/currents.dat | 26 + tests/data/currents_mdc/c2/points.txt | 170 +++++ tests/data/currents_mdc/c2/ref_moordyn_c.csv | 171 +++++ tests/data/currents_mdc/c2/ref_python.csv | 171 +++++ .../c2const/current_profile_dynamic.txt | 9 + tests/data/currents_mdc/c2const/currents.dat | 26 + tests/data/currents_mdc/c2const/points.txt | 45 ++ .../currents_mdc/c2const/ref_moordyn_c.csv | 46 ++ .../data/currents_mdc/c2const/ref_python.csv | 46 ++ .../c2stof/current_profile_dynamic.txt | 9 + tests/data/currents_mdc/c2stof/currents.dat | 26 + tests/data/currents_mdc/c2stof/points.txt | 64 ++ .../currents_mdc/c2stof/ref_moordyn_c.csv | 65 ++ tests/data/currents_mdc/c2stof/ref_python.csv | 65 ++ .../currents_mdc/c5/current_profile_4d.txt | 134 ++++ tests/data/currents_mdc/c5/currents.dat | 26 + tests/data/currents_mdc/c5/points.txt | 120 ++++ tests/data/currents_mdc/c5/ref_moordyn_c.csv | 121 ++++ tests/data/currents_mdc/c5/ref_python.csv | 121 ++++ .../c5uniform/current_profile_4d.txt | 105 +++ .../data/currents_mdc/c5uniform/currents.dat | 26 + tests/data/currents_mdc/c5uniform/points.txt | 340 ++++++++++ .../currents_mdc/c5uniform/ref_moordyn_c.csv | 341 ++++++++++ .../currents_mdc/c5uniform/ref_python.csv | 341 ++++++++++ .../tension_c0/ref_moordyn_c_tension.csv | 222 +++++++ .../data/currents_mdc/tension_c0/tension.dat | 25 + .../tension_c2/current_profile_dynamic.txt | 10 + .../tension_c2/ref_moordyn_c_tension.csv | 222 +++++++ .../data/currents_mdc/tension_c2/tension.dat | 25 + .../tension_c5/current_profile_4d.txt | 78 +++ .../tension_c5/ref_moordyn_c_tension.csv | 222 +++++++ .../data/currents_mdc/tension_c5/tension.dat | 25 + tests/test_mdc_currents.f90 | 273 ++++++++ tests/test_mdc_currents_runs.py | 228 +++++++ tests/test_wavekin_modes.f90 | 4 +- validation/scripts/currents_mdc_reference.py | 231 +++++++ validation/scripts/currents_mdc_tension.cpp | 81 +++ 61 files changed, 5409 insertions(+), 118 deletions(-) create mode 100644 tests/data/currents_mdc/c1/current_profile.txt create mode 100644 tests/data/currents_mdc/c1/currents.dat create mode 100644 tests/data/currents_mdc/c1/points.txt create mode 100644 tests/data/currents_mdc/c1/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c1/ref_python.csv create mode 100644 tests/data/currents_mdc/c2/current_profile_dynamic.txt create mode 100644 tests/data/currents_mdc/c2/currents.dat create mode 100644 tests/data/currents_mdc/c2/points.txt create mode 100644 tests/data/currents_mdc/c2/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c2/ref_python.csv create mode 100644 tests/data/currents_mdc/c2const/current_profile_dynamic.txt create mode 100644 tests/data/currents_mdc/c2const/currents.dat create mode 100644 tests/data/currents_mdc/c2const/points.txt create mode 100644 tests/data/currents_mdc/c2const/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c2const/ref_python.csv create mode 100644 tests/data/currents_mdc/c2stof/current_profile_dynamic.txt create mode 100644 tests/data/currents_mdc/c2stof/currents.dat create mode 100644 tests/data/currents_mdc/c2stof/points.txt create mode 100644 tests/data/currents_mdc/c2stof/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c2stof/ref_python.csv create mode 100644 tests/data/currents_mdc/c5/current_profile_4d.txt create mode 100644 tests/data/currents_mdc/c5/currents.dat create mode 100644 tests/data/currents_mdc/c5/points.txt create mode 100644 tests/data/currents_mdc/c5/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c5/ref_python.csv create mode 100644 tests/data/currents_mdc/c5uniform/current_profile_4d.txt create mode 100644 tests/data/currents_mdc/c5uniform/currents.dat create mode 100644 tests/data/currents_mdc/c5uniform/points.txt create mode 100644 tests/data/currents_mdc/c5uniform/ref_moordyn_c.csv create mode 100644 tests/data/currents_mdc/c5uniform/ref_python.csv create mode 100644 tests/data/currents_mdc/tension_c0/ref_moordyn_c_tension.csv create mode 100644 tests/data/currents_mdc/tension_c0/tension.dat create mode 100644 tests/data/currents_mdc/tension_c2/current_profile_dynamic.txt create mode 100644 tests/data/currents_mdc/tension_c2/ref_moordyn_c_tension.csv create mode 100644 tests/data/currents_mdc/tension_c2/tension.dat create mode 100644 tests/data/currents_mdc/tension_c5/current_profile_4d.txt create mode 100644 tests/data/currents_mdc/tension_c5/ref_moordyn_c_tension.csv create mode 100644 tests/data/currents_mdc/tension_c5/tension.dat create mode 100644 tests/test_mdc_currents.f90 create mode 100644 tests/test_mdc_currents_runs.py create mode 100644 validation/scripts/currents_mdc_reference.py create mode 100644 validation/scripts/currents_mdc_tension.cpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 70cd708e..b8cd9c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,6 +142,15 @@ All notable changes to CableDyn are recorded in this file. The format follows - Output channels `StfMomN`, the share of the section moment a bend stiffener carries, and `FairDefl`/`AnchDefl`, the deflection of the end force from the direction a held END CONNECTIONS row declares (with the end tension, a stiffener's load case). +- MoorDyn-C time-varying and gridded currents on the standalone routes: `Currents 2` (the depth + profile in time `current_profile_dynamic.txt`) and `Currents 5` (the grid in x, y, z and time + `current_profile_4d.txt`), read and interpolated as MoorDyn-C v2.7.1 does (resampled at the + smallest time interval, repeating past the last sample, held beyond the grid, no fluid + acceleration) at every node's position and time, the static start included. At 739 points and + times the current is identical to MoorDyn-C v2.7.1's; a constant table equals `Currents 1` and a + grid uniform in x and y equals `Currents 2`; on a 70 m rope the tension change of a time-varying + and of a sheared current matches MoorDyn-C's within 0.9 %, and the static start in a sheared grid + holds the tensions to 1.4e-7 of the change the current makes. ### Changed diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e1e3c7d..ec833d74 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1715,6 +1715,17 @@ if(Python3_Interpreter_FOUND) LABELS "python;integration;dynamic;viv;validation" TIMEOUT ${_viv_lockin_timeout} ENVIRONMENT "${_cabledyn_python_test_environment}") + # MoorDyn-C Currents 2 and 5 runs: tensions against MoorDyn-C v2.7.1, two sources of one + # field, and the static start in a sheared grid on the EI = 0 and finite-EI routes + add_test(NAME mdc_currents_runs + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_mdc_currents_runs.py + --exe $ + --data ${CMAKE_CURRENT_SOURCE_DIR}/tests/data/currents_mdc + --output ${CMAKE_BINARY_DIR}/mdc_currents_runs) + set_tests_properties(mdc_currents_runs PROPERTIES + LABELS "python;integration;dynamic;validation" + TIMEOUT ${_viv_lockin_timeout} + ENVIRONMENT "${_cabledyn_python_test_environment}") else() message(STATUS "viv_lockin: skipped (numpy not importable in ${Python3_EXECUTABLE})") endif() @@ -2097,6 +2108,19 @@ target_link_libraries(test_wavekin_modes PRIVATE cabledyn_core) add_test(NAME wavekin_modes COMMAND test_wavekin_modes WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_tests_properties(wavekin_modes PROPERTIES LABELS "fortran;driver;validation;dynamic") +# MoorDyn-C Currents 2 and 5 vs MoorDyn-C v2.7.1 and an independent evaluation on shared inputs +# (the reference rows come from validation/scripts/currents_mdc_reference.py) +file(GLOB_RECURSE CD_CURRENTS_MDC_FILES RELATIVE ${CMAKE_SOURCE_DIR}/tests/data/currents_mdc + ${CMAKE_SOURCE_DIR}/tests/data/currents_mdc/*) +foreach(f IN LISTS CD_CURRENTS_MDC_FILES) + configure_file(tests/data/currents_mdc/${f} ${CMAKE_BINARY_DIR}/currents_mdc/${f} COPYONLY) +endforeach() +add_executable(test_mdc_currents tests/test_mdc_currents.f90) +target_link_libraries(test_mdc_currents PRIVATE cabledyn_core) +add_test(NAME mdc_currents COMMAND test_mdc_currents WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/mdc_currents_work) +set_tests_properties(mdc_currents PROPERTIES LABELS "fortran;driver;validation;dynamic") +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/mdc_currents_work) + add_executable(test_clamped_cable_ends tests/test_clamped_cable_ends.f90) target_link_libraries(test_clamped_cable_ends PRIVATE cabledyn_core) add_test(NAME clamped_cable_ends COMMAND test_clamped_cable_ends) diff --git a/doc/api_python.rst b/doc/api_python.rst index cfae771e..20262612 100644 --- a/doc/api_python.rst +++ b/doc/api_python.rst @@ -336,7 +336,8 @@ Deck editing and case generation family of edited decks for a batch study. It and :meth:`DeckModel.save` (with ``rebase=True``) rewrite relative ancillary paths for the new folder and copy the fixed-name MoorDyn-C kinematics files (``wave_elevation.txt`` for ``3 WaveKin``, ``wave_frequencies.txt`` for -``7 WaveKin``, ``current_profile.txt`` for ``1 Currents``), which the solver reads from the deck's +``7 WaveKin``, ``current_profile.txt``, ``current_profile_dynamic.txt`` and ``current_profile_4d.txt`` +for ``1``, ``2`` and ``5 Currents``), which the solver reads from the deck's own folder, next to the new decks (:doc:`python`). .. autoclass:: cabledyn.DeckFile diff --git a/doc/capabilities.rst b/doc/capabilities.rst index 157af367..77f203d5 100644 --- a/doc/capabilities.rst +++ b/doc/capabilities.rst @@ -161,6 +161,11 @@ Loads and environment * - Uniform/profile current - Supported - standalone deck source; coupled runs use explicitly selected host/file sources + * - MoorDyn-C currents in time and space (``Currents 2``, ``Currents 5``) + - Standalone only + - ``current_profile_dynamic.txt`` and ``current_profile_4d.txt``, interpolated as MoorDyn-C + v2.7.1 does at every node's position and time, the static start included; see + :ref:`moordyn-c-wavekin` * - Airy and JONSWAP waves - Supported - standalone deck source or OpenFAST SeaState, never an accidental double source diff --git a/doc/driver_format.md b/doc/driver_format.md index 1a8f2d53..3eeffc9a 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -340,7 +340,7 @@ points only): the deck is partitioned through the same atomic aggregate used by `Coupled`/`Vessel` endpoints are held at their deck positions. The run writes the common `.out` and the all-line `.static.out` tables, plus the range graph of every line with the `r` flag. Mixed decks reject, by name, `motionFile`, deck wave/current OPTIONS, WaterKin `WaveKinMod 1`, -MoorDyn-C `WaveKin 3`/`7` and `Currents 1`, and per-line `p`/`t` flags. +MoorDyn-C `WaveKin 3`/`7` and `Currents 1`/`2`/`5`, and per-line `p`/`t` flags. (multibody-march)= **Multibody march** (bodies, rods, `Connect`/`Free` points, EI = 0 lines and finite-EI cables in @@ -1230,27 +1230,56 @@ always returns the inertia of coupled bodies and rods; `0` and `2` are rejected ### MoorDyn-C `WaveKin` and `Currents` modes A MoorDyn-C deck selects its water kinematics with the numeric `WaveKin` and `Currents` options -and fixed-name files in the deck folder. CableDyn reduces each file to wave components or a depth -profile and evaluates them exactly at every node, with Wheeler stretching; MoorDyn-C tabulates -them on `water_grid.txt` and interpolates, so that file is not read. Standalone decks only. +and fixed-name files in the deck folder. CableDyn reduces each wave file to wave components and +evaluates them exactly at every node, with Wheeler stretching; MoorDyn-C tabulates them on +`water_grid.txt` and interpolates, so that file is not read. The current files are evaluated at +every node's position and time as MoorDyn-C interpolates them. Standalone decks only. | Option | File | Meaning | |---|---|---| | `WaveKin 3` | `wave_elevation.txt` | `time elevation` rows from `t = 0` (no header rows), resampled linearly at `dtWave` to `floor(t_last/dtWave) + 1` samples (the last dropped when the count is odd) and reduced to its Fourier components; components above `WvHiCOff` (default 0.5 Hz, MoorDyn-C's fixed cut) are dropped and the mean is a mean-level offset, as MoorDyn-C does. Waves travel along +x | | `WaveKin 7` | `wave_frequencies.txt` | `omega Re Im [beta]` rows [rad/s, m, m, rad], the first at `omega = 0`: each row is the component `\|c\| sin(omega t - k d + arg c)`, `d = x cos(beta) + y sin(beta)`; the `omega = 0` row is a mean-level offset. All rows must share one `beta` | | `Currents 1` | `current_profile.txt` | `z ux uy uz` rows after its header rows, strictly increasing `z`; linear in `z` and held beyond the end rows | +| `Currents 2` | `current_profile_dynamic.txt` | a depth profile in time: lines 1-4 and 6 are free text, line 5 lists the depths `z1 ... zn` (strictly increasing, read in single precision as MoorDyn-C does), and each later row is `t ux1 ... uxn [uy1 ... uyn [uz1 ... uzn]]` (missing components zero), at least two rows with strictly increasing `t` | +| `Currents 5` | `current_profile_4d.txt` | a grid in x, y, z and time: line 1 is `nx ny nz nt`, lines 2-5 the x, y, z and t coordinates (each strictly increasing, at least two times), then one `x y z t ux uy uz` row per grid point, in any order, matched to the grid by value; a text line 6 is a header | + +`Currents 2` and `5` follow MoorDyn-C v2.7.1 (`constructDynamicCurrentGrid`, +`construct4DCurrentGrid` and `CurrentGrid::getCurrentKin`): + +- the table is resampled in time at its smallest time interval `dt`, from `t = 0` to + `floor(t_last/dt) dt` (a last time that is not a multiple of `dt` is not reached), linearly + between rows and held at the first and last rows; +- between samples the current is linear in time; past the last sample the grid repeats with + period `nt dt` (`nt` samples), holding its `t = 0` value over the last interval of each period, + as MoorDyn-C's index wrap does. A run longer than the last sample prints a note; +- in x, y and z the current is linear between grid coordinates and held beyond the end ones; the + node elevation is not stretched; +- the current has no fluid acceleration (MoorDyn-C sets it to zero), so its time variation adds + no Froude-Krylov or added-mass load; +- the static start takes the current at `t = 0`, as MoorDyn-C's initial condition does; +- `current_profile_4d.txt` is read as MoorDyn-C documents it, which MoorDyn-C v2.7.1 does not + quite do: it reads its rows from line 7, so a row on line 6 leaves that grid point at zero, and + it matches a row to the grid by the text of its coordinates, so a row writing `-0` for `0` or + `1.0` for `1` lands on the first grid point. CableDyn reads line 6 as a row unless it is text + and matches by value, and it rejects a missing, repeated or off-grid point. A file with a text + line 6 and its coordinates written as on lines 2-5 reads the same in both codes. + +With `WaveKin 3`, MoorDyn-C (its default `UnifyCurrentGrid 1`) adds a current to the wave grid, +where it is sampled on `water_grid.txt`; CableDyn adds the current at the nodes, as MoorDyn-C's +`UnifyCurrentGrid 0`. Rejected by name: `WaveKin 1` (kinematics set node by node through the MoorDyn-C API; a deck has no source for them), `WaveKin 2` (the FFT grid: `wave_frequencies.txt` resampled to an even spectrum; `WaveKin 7` evaluates the same file's components exactly), `WaveKin 4`-`6` and -`Currents 3`-`4` (no kinematics source in MoorDyn-C v2.7.1), `Currents 2` (the -time-varying profile `current_profile_dynamic.txt`), `Currents 5` (the 4-D current grid), and a -`wave_frequencies.txt` whose rows have different directions. A deck that also declares a `waves` -option, a WaterKin file, or a second current source is rejected as double counting. On shared -inputs the `wavekin_modes` test holds `WaveKin 7` and `Currents 1` identical to MoorDyn-C v2.7.1 -(`5e-12` relative) and `WaveKin 3` within `3e-7` m in elevation and `1e-4` in velocity and -acceleration at MoorDyn-C's grid points, the remainder being MoorDyn-C's grid interpolation and -its approximate wave number. +`Currents 3`-`4` (no kinematics source in MoorDyn-C v2.7.1), and a `wave_frequencies.txt` whose +rows have different directions. A deck that also declares a `waves` option, a WaterKin file, or a +second current source is rejected as double counting. On shared inputs the `wavekin_modes` test +holds `WaveKin 7` and `Currents 1` identical to MoorDyn-C v2.7.1 (`5e-12` relative) and `WaveKin 3` +within `3e-7` m in elevation and `1e-4` in velocity and acceleration at MoorDyn-C's grid points, +the remainder being MoorDyn-C's grid interpolation and its approximate wave number. The +`mdc_currents` test holds `Currents 2` and `5` identical to MoorDyn-C v2.7.1 at 739 points and +times (including past the last sample), and `mdc_currents_runs` matches the tension change of a +time-varying and of a sheared current to MoorDyn-C's within 0.9 % on a 70 m rope. (waterkin-file-modes)= ### MoorDyn-F `WaterKin` file modes diff --git a/doc/file_formats.rst b/doc/file_formats.rst index ce828700..430b1c13 100644 --- a/doc/file_formats.rst +++ b/doc/file_formats.rst @@ -42,15 +42,15 @@ page. - the ``OWC`` row of the Syrope settings file - the directory of the settings file * - MoorDyn-C kinematics files ``wave_elevation.txt``, ``wave_frequencies.txt``, - ``current_profile.txt`` - - OPTIONS ``3 WaveKin``, ``7 WaveKin`` and ``1 Currents`` (grammar in - :ref:`moordyn-c-wavekin`); the file names are fixed + ``current_profile.txt``, ``current_profile_dynamic.txt``, ``current_profile_4d.txt`` + - OPTIONS ``3 WaveKin``, ``7 WaveKin``, ``1 Currents``, ``2 Currents`` and ``5 Currents`` + (grammar in :ref:`moordyn-c-wavekin`); the file names are fixed - the deck directory The parser reads no other input files. Line-type properties, nonlinear ``EA`` data other than the Syrope OWC table, wave spectra, and control-channel values all come from the deck itself or from the coupling host. Because the MoorDyn-C file names are -fixed, a deck that uses ``WaveKin 3``/``7`` or ``Currents 1`` must sit in the same +fixed, a deck that uses ``WaveKin 3``/``7`` or ``Currents 1``/``2``/``5`` must sit in the same folder as its kinematics file; a copied or generated deck needs a copy of that file beside it. diff --git a/doc/options.rst b/doc/options.rst index 707c1e18..90482631 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -757,10 +757,13 @@ Ambient fluid and prescribed motion - standalone - ``6.2832 WvHiCOff`` * - ``Currents`` - - ``0`` or ``1`` + - ``0``, ``1``, ``2`` or ``5`` - ``0`` - - ``1`` reads the MoorDyn-C steady profile ``current_profile.txt`` in the deck folder; the - other MoorDyn-C modes fail closed by name. ``current`` and a WaterKin table are the other + - the MoorDyn-C current file in the deck folder: ``1`` the steady profile + ``current_profile.txt``, ``2`` the depth profile in time ``current_profile_dynamic.txt``, + ``5`` the grid in x, y, z and time ``current_profile_4d.txt``, each interpolated as + MoorDyn-C v2.7.1 does (:ref:`moordyn-c-wavekin`); ``3`` and ``4`` (no current source in + MoorDyn-C v2.7.1) fail closed by name. ``current`` and a WaterKin table are the other sources; two sources in one deck are rejected - standalone - ``1 Currents`` diff --git a/doc/python.rst b/doc/python.rst index 276ce877..a5ec813c 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -631,7 +631,8 @@ the default permissions of a newly created file. The MoorDyn-C kinematics files are read by fixed name from the folder of the deck being run: ``3 WaveKin`` reads ``wave_elevation.txt``, ``7 WaveKin`` reads ``wave_frequencies.txt`` and -``1 Currents`` reads ``current_profile.txt``. ``generate_deck_cases`` copies these files next to +``1 Currents`` reads ``current_profile.txt``, ``2 Currents`` ``current_profile_dynamic.txt`` and +``5 Currents`` ``current_profile_4d.txt``. ``generate_deck_cases`` copies these files next to the generated decks, and ``cases.json`` records their SHA-256 under ``companion_files``; ``DeckModel.save(rebase=True)`` copies them too. diff --git a/python/cabledyn/builder.py b/python/cabledyn/builder.py index 56f485e3..ae8d59fa 100644 --- a/python/cabledyn/builder.py +++ b/python/cabledyn/builder.py @@ -2615,8 +2615,9 @@ def save( Syrope files) so they still resolve from the target folder, and copy the MoorDyn-C kinematics files the solver reads by fixed name from the deck folder (``wave_elevation.txt`` for ``WaveKin 3``, - ``wave_frequencies.txt`` for ``WaveKin 7``, ``current_profile.txt`` - for ``Currents 1``) into it. + ``wave_frequencies.txt`` for ``WaveKin 7``, ``current_profile.txt``, + ``current_profile_dynamic.txt`` and ``current_profile_4d.txt`` for + ``Currents 1``, ``2`` and ``5``) into it. Returns ------- diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 3131c4de..776c5c62 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -378,9 +378,13 @@ _TORSION_NORMAL_PARALLEL_TOL = 1.0e-3 _WATERKIN_FILENAME_LETTERS = frozenset("abcdfghijklmnopqrstuvwxyzABCDFGHIJKLMNOPQRSTUVWXYZ") # MoorDyn-C kinematics files the native reader opens by fixed name in the deck folder -# (read_moordyn_c_kinematics): WaveKin 3, WaveKin 7 and Currents 1. +# (read_moordyn_c_kinematics): WaveKin 3, WaveKin 7 and Currents 1, 2 and 5. _MOORDYN_C_WAVE_FILES = {3: "wave_elevation.txt", 7: "wave_frequencies.txt"} -_MOORDYN_C_CURRENT_FILE = "current_profile.txt" +_MOORDYN_C_CURRENT_FILES = { + 1: "current_profile.txt", + 2: "current_profile_dynamic.txt", + 5: "current_profile_4d.txt", +} def _moordyn_c_wave_kin(value: str | None) -> int: @@ -397,10 +401,11 @@ def _moordyn_c_wave_kin(value: str | None) -> int: def _moordyn_c_currents(value: str | None) -> int: - """Return the MoorDyn-C ``Currents`` mode (0 or 1) of a validated row value.""" + """Return the MoorDyn-C ``Currents`` mode (0, 1, 2 or 5) of a validated row value.""" if value is None: return 0 - return 1 if round(_native_float(value)) == 1 else 0 + mode = round(_native_float(value)) + return mode if mode in _MOORDYN_C_CURRENT_FILES else 0 def _comment_position(text: str) -> int | None: @@ -1390,9 +1395,13 @@ def _scalar_option_value_error(keyword: str, value: str) -> str | None: numeric = _native_float(value) except ValueError: return "must be numeric" + # native apply_option: 0 none and the MoorDyn-C current files 1, 2 and 5; 3 and 4 + # (MoorDyn-C's node approaches) have no current source in MoorDyn-C v2.7.1 if not math.isfinite(numeric) or abs(numeric - round(numeric)) > 1.0e-9: - return "supports only mode 0 or 1" - return None if round(numeric) in {0, 1} else "supports only mode 0 or 1" + return "supports only mode 0, 1, 2 or 5" + if round(numeric) in {3, 4}: + return f"{round(numeric)} has no current source in MoorDyn-C v2.7.1; use 1, 2 or 5" + return None if round(numeric) in {0, 1, 2, 5} else "supports only mode 0, 1, 2 or 5" if key == "waterkin": lowered = value.lower() if lowered in {"none", "seastate"} or any( @@ -2398,7 +2407,7 @@ def validate(self) -> None: that depend on their contents stay with the solver: for example the anchor height on a bathymetry surface, whether a WaterKin file carries waves (``WaveKinMod``) for ``vesselRAO``, and whether its current - doubles a ``current`` row or ``Currents 1``. + doubles a ``current`` row or ``Currents 1``, ``2`` or ``5``. Raises ------ @@ -2497,7 +2506,7 @@ def effective(key: str, default: float) -> float: raise DeckFormatError( f"{self._label}: OPTION TMax must be an integer multiple of dtM" ) - # MoorDyn-C WaveKin 3/7 and Currents 1 (native read_moordyn_c_kinematics): component + # MoorDyn-C WaveKin 3/7 and Currents 1/2/5 (native read_moordyn_c_kinematics): component # waves and a steady current profile read from fixed-name files in the deck folder. # The coupled aggregate takes its water kinematics from the host and rejects both. waterkin_row = option_by_key.get("waterkin") @@ -2625,7 +2634,7 @@ def effective(key: str, default: float) -> float: ): raise DeckFormatError(f"{self._label}: a wave train needs |direction| <= 1e6 deg") # native read_moordyn_c_kinematics: WaveKin 3/7 components add to no other deck sea, - # and Currents 1 to no other current; each then needs the dynamic sea/current setup. + # and Currents 1/2/5 to no other current; each then needs the dynamic sea/current setup. if mdc_wave_kin: if has_waves or trains: raise DeckFormatError( @@ -2639,11 +2648,13 @@ def effective(key: str, default: float) -> float: if mdc_currents: if current is not None and current.values[0].lower() != "none": raise DeckFormatError( - f"{self._label}: the deck declares both a current OPTION and Currents 1 " - "(double-counting); keep one" + f"{self._label}: the deck declares both a current OPTION and Currents " + f"{mdc_currents} (double-counting); keep one" ) if not has_dtm: - raise DeckFormatError(f"{self._label}: standalone Currents 1 requires dtM and TMax") + raise DeckFormatError( + f"{self._label}: standalone Currents {mdc_currents} requires dtM and TMax" + ) friction = option_by_key.get("friction") friction_active = False iso = 0.0 @@ -4883,9 +4894,10 @@ def _companion_files(self) -> tuple[str, ...]: """Return the fixed-name kinematics files this deck reads from its own folder. MoorDyn-C ``WaveKin 3`` reads ``wave_elevation.txt``, ``WaveKin 7`` reads - ``wave_frequencies.txt`` and ``Currents 1`` reads ``current_profile.txt``; - the native reader opens them by name next to the deck, so a deck written - to another folder needs them copied there. + ``wave_frequencies.txt``, ``Currents 1`` reads ``current_profile.txt``, + ``Currents 2`` ``current_profile_dynamic.txt`` and ``Currents 5`` + ``current_profile_4d.txt``; the native reader opens them by name next to the + deck, so a deck written to another folder needs them copied there. """ effective = {_option_key(record.keyword): record for record in self.options} names: list[str] = [] @@ -4894,8 +4906,9 @@ def _companion_files(self) -> tuple[str, ...]: if mode: names.append(_MOORDYN_C_WAVE_FILES[mode]) currents = effective.get("currents") - if _moordyn_c_currents(None if currents is None else currents.values[0]): - names.append(_MOORDYN_C_CURRENT_FILE) + mode = _moordyn_c_currents(None if currents is None else currents.values[0]) + if mode: + names.append(_MOORDYN_C_CURRENT_FILES[mode]) return tuple(names) def _rebase_relative_inputs(self, target_directory: str | os.PathLike[str]) -> None: @@ -5014,7 +5027,8 @@ def generate_deck_cases( rewritten so they still resolve from the new location. The MoorDyn-C kinematics files that the solver reads by fixed name from the deck folder (``wave_elevation.txt`` for ``WaveKin 3``, ``wave_frequencies.txt`` for - ``WaveKin 7``, ``current_profile.txt`` for ``Currents 1``) are copied into + ``WaveKin 7``, ``current_profile.txt``, ``current_profile_dynamic.txt`` and + ``current_profile_4d.txt`` for ``Currents 1``, ``2`` and ``5``) are copied into ``output_directory``. A ``cases.json`` manifest records the source deck, its SHA-256 digest, and every case's changes and digest (with the digests of the copied kinematics files it reads); :func:`cabledyn.run_study` diff --git a/python/cabledyn/study.py b/python/cabledyn/study.py index c8a3fb1e..a03aaf41 100644 --- a/python/cabledyn/study.py +++ b/python/cabledyn/study.py @@ -28,7 +28,15 @@ _CASE_NAME = re.compile(r"[A-Za-z0-9][A-Za-z0-9_.-]*") # Suffixes the native driver appends to an output root (``..out``). # Fixed-name MoorDyn-C kinematics files that generate_deck_cases copies next to the cases. -_COMPANION_FILES = frozenset({"wave_elevation.txt", "wave_frequencies.txt", "current_profile.txt"}) +_COMPANION_FILES = frozenset( + { + "wave_elevation.txt", + "wave_frequencies.txt", + "current_profile.txt", + "current_profile_dynamic.txt", + "current_profile_4d.txt", + } +) _OUTPUT_SUFFIX = re.compile(r"\.(?:static|elements|Line\d+\.[pt]|Rod-?\d+\.p)$", re.IGNORECASE) diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 14601bc6..0cf7ff28 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -653,8 +653,10 @@ def test_unknown_scalar_option_keyword_fails_closed(tmp_path): ("x", "dtWave", "must be numeric"), ("0", "WvHiCOff", "must be positive"), ("off", "WvHiCOff", "must be numeric"), - ("2", "Currents", "supports only mode 0 or 1"), - ("1.5", "Currents", "supports only mode 0 or 1"), + ("3", "Currents", "no current source in MoorDyn-C v2.7.1"), + ("4", "Currents", "no current source in MoorDyn-C v2.7.1"), + ("6", "Currents", "supports only mode 0, 1, 2 or 5"), + ("1.5", "Currents", "supports only mode 0, 1, 2 or 5"), ("4", "WaterKin", "numeric mode 0, 3 or 7"), ("1", "WaterKin", "numeric mode 0"), ("1e0", "WaterKin", "numeric mode 0"), diff --git a/python/tests/test_deck_native_parity.py b/python/tests/test_deck_native_parity.py index be2879ca..1d55158f 100644 --- a/python/tests/test_deck_native_parity.py +++ b/python/tests/test_deck_native_parity.py @@ -98,9 +98,13 @@ def test_dtwave_must_be_positive(value): (("7 WaterKin",), None), (("3 WaveKin", "0.1 dtWave"), None), (("1 Currents",), None), + (("2 Currents",), None), + (("5 Currents",), None), (("airy 2 8 0 waves", "7 WaterKin"), r"both a waves \(or wavetrain\) OPTION and WaveKin 7"), (("airy 2 8 0 wavetrain", "3 WaveKin"), "double-counting"), (("uniform 0.1 0 0 current", "1 Currents"), "both a current OPTION and Currents 1"), + (("uniform 0.1 0 0 current", "2 Currents"), "both a current OPTION and Currents 2"), + (("uniform 0.1 0 0 current", "5 Currents"), "both a current OPTION and Currents 5"), ], ) def test_moordyn_c_kinematics_follow_the_native_rules(rows, message): @@ -116,9 +120,10 @@ def test_moordyn_c_kinematics_need_the_dynamic_sea_setup(): no_depth = _edit(_HELD, ("50.0 WtrDpth\n", "7 WaterKin\n")) _rejects(no_depth.replace("-50.0", "-80.0"), "WaveKin 7 waves require dtM, TMax and WtrDpth") _rejects(_options(_STATIC, "1 Currents"), "standalone Currents 1 requires dtM and TMax") + _rejects(_options(_STATIC, "5 Currents"), "standalone Currents 5 requires dtM and TMax") -@pytest.mark.parametrize("row", ["7 WaterKin", "1 Currents"]) +@pytest.mark.parametrize("row", ["7 WaterKin", "1 Currents", "2 Currents", "5 Currents"]) def test_moordyn_c_kinematics_are_not_certified_for_the_coupled_route(row): _rejects(_options(_HELD, row), "not supported on the coupled route", caller_driven=True) @@ -601,6 +606,19 @@ def test_generated_cases_carry_the_fixed_name_kinematics_files(tmp_path): run_study(out / "cases.json", executable=tmp_path / "missing.exe") +@pytest.mark.parametrize( + ("mode", "name"), [("2", "current_profile_dynamic.txt"), ("5", "current_profile_4d.txt")] +) +def test_generated_cases_carry_the_moordyn_c_current_tables(tmp_path, mode, name): + table = "a MoorDyn-C current table\n" + base = _kinematic_base(tmp_path / "src", f"{mode} Currents", files={name: table}) + out = tmp_path / "cases" + generate_deck_cases(base, out, {"a": {"option.dtM": 0.05}}) + assert (out / name).read_text(encoding="utf-8") == table + manifest = json.loads((out / "cases.json").read_text(encoding="utf-8")) + assert set(manifest["cases"][0]["companion_files"]) == {name} + + def test_study_manifest_companion_entries_are_checked(tmp_path): base = _kinematic_base( tmp_path / "src", "7 WaterKin", files={"wave_frequencies.txt": _WAVE_FREQUENCIES} diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 5c43fa6a..b3810f86 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -134,7 +134,8 @@ MODULE CableDyn_DeckDriver CD_HFMF_End, CD_HFMF_OK USE CableDyn_VIV, ONLY: CD_VIV_DEFAULT_DF, CD_VIV_DEFAULT_CF, CD_VIV_NM USE CableDyn_Hydro, ONLY: CD_Airy_Wave_Kinematics_Precomputed, CD_Component_Wave_Kinematics, & - CD_Current_Profile_Velocity, & + CD_Current_Profile_Velocity, CD_CurrentGridType, CD_Current_Grid_Resample, & + CD_Current_Grid_Velocity, & CD_JONSWAP_COMPONENTS, CD_JONSWAP_Random_Components, & CD_Solve_Dispersion_Wavenumber, & CD_Morison_Drag_Element_Load, & @@ -667,6 +668,11 @@ MODULE CableDyn_DeckDriver REAL(wp) :: vessel_ref(3) = CD_ZERO LOGICAL :: has_current = .FALSE. LOGICAL :: has_current_profile = .FALSE. + ! MoorDyn-C Currents 2 and 5 (read_moordyn_c_kinematics): a current grid in space and time + ! (CD_CurrentGridType), sampled at every node's position and time (deck_current_velocity); + ! has_current is then set and has_current_profile is not. + LOGICAL :: has_current_grid = .FALSE. + TYPE(CD_CurrentGridType), ALLOCATABLE :: current_grid ! MoorDyn WaterKin OPTION: a filename declaring file-driven water kinematics ! for STANDALONE runs (coupled runs consume SeaState). CHARACTER(CD_DECK_PATHLEN) :: waterkin_file = '' @@ -680,7 +686,8 @@ MODULE CableDyn_DeckDriver INTEGER :: waterkin_wave_mode = -1 INTEGER :: waterkin_current_mode = -1 ! MoorDyn-C numeric WaveKin / Currents OPTIONS (0: none): WaveKin 3 reads wave_elevation.txt, - ! WaveKin 7 wave_frequencies.txt, Currents 1 current_profile.txt, all in the deck folder + ! WaveKin 7 wave_frequencies.txt, Currents 1 current_profile.txt, Currents 2 + ! current_profile_dynamic.txt and Currents 5 current_profile_4d.txt, all in the deck folder ! (read_moordyn_c_kinematics); dtWave is the WaveKin 3 resampling step. INTEGER :: mdc_wave_kin = 0 INTEGER :: mdc_currents = 0 @@ -1988,7 +1995,24 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, ! of that plane, which the dynamics (endpoints held, every other DOF free) follow: the ! static equilibrium is then solved in 3D as well. IF (opts%has_current) THEN - IF (opts%has_current_profile) THEN + IF (opts%has_current_grid) THEN + ! a current grid (Currents 2 and 5): every sample of it, in space and time + BLOCK + INTEGER :: ix, iy, iz, it + DO it = 1, opts%current_grid%nt + DO iz = 1, SIZE(opts%current_grid%z) + DO iy = 1, SIZE(opts%current_grid%y) + DO ix = 1, SIZE(opts%current_grid%x) + IF (ABS(-frame_cs(2)*opts%current_grid%velocity(1, ix, iy, iz, it) + & + frame_cs(1)*opts%current_grid%velocity(2, ix, iy, iz, it)) > & + 64.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, NORM2(opts%current_grid%velocity(:, ix, iy, iz, it)))) & + require_3d_static = .TRUE. + END DO + END DO + END DO + END DO + END BLOCK + ELSE IF (opts%has_current_profile) THEN DO i = 1, SIZE(opts%current_profile_z) IF (ABS(-frame_cs(2)*opts%current_profile_velocity(1, i) + frame_cs(1)*opts%current_profile_velocity(2, i)) & > 64.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, NORM2(opts%current_profile_velocity(:, i)))) & @@ -2283,6 +2307,7 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, cur_obj%drag = .FALSE. IF (ALLOCATED(cur_obj%profile_z)) DEALLOCATE (cur_obj%profile_z) IF (ALLOCATED(cur_obj%profile_velocity)) DEALLOCATE (cur_obj%profile_velocity) + IF (ALLOCATED(cur_obj%grid)) DEALLOCATE (cur_obj%grid) END IF IF (as_laid) THEN CALL as_laid_reference(es, em) @@ -3824,6 +3849,7 @@ SUBROUTINE still_water_compression(text) opts_sw = opts opts_sw%has_current = .FALSE. opts_sw%has_current_profile = .FALSE. + opts_sw%has_current_grid = .FALSE. IF (PRESENT(bathymetry)) THEN CALL build_one_hermite_cable(ln, sections, types, points, opts_sw, dt, sw_cable, sw_node, esw, emw, & standalone_controls=.FALSE., fixed_fairlead=fixed_fairlead_ok, & @@ -4075,6 +4101,22 @@ LOGICAL FUNCTION symmetric_current_retry() RESULT(retry) cur_obj%profile_velocity(1:2, k) = cur_obj%profile_velocity(1:2, k) + SYM_BREAK*uh*nrm END DO END IF + IF (ALLOCATED(cur_obj%grid)) THEN + BLOCK + INTEGER :: ix, iy, iz, it + DO it = 1, cur_obj%grid%nt + DO iz = 1, SIZE(cur_obj%grid%z) + DO iy = 1, SIZE(cur_obj%grid%y) + DO ix = 1, SIZE(cur_obj%grid%x) + uh = NORM2(cur_obj%grid%velocity(1:2, ix, iy, iz, it)) + cur_obj%grid%velocity(1:2, ix, iy, iz, it) = cur_obj%grid%velocity(1:2, ix, iy, iz, it) + & + SYM_BREAK*uh*nrm + END DO + END DO + END DO + END DO + END BLOCK + END IF retry = .TRUE. END FUNCTION symmetric_current_retry @@ -4616,6 +4658,7 @@ SUBROUTINE still_water_reference(esr, emr) opts_sw = opts opts_sw%has_current = .FALSE. opts_sw%has_current_profile = .FALSE. + opts_sw%has_current_grid = .FALSE. IF (PRESENT(bathymetry)) THEN CALL build_one_hermite_cable(ln, sections, types, points, opts_sw, dt, sw_cable, sw_node, esr, emr, & standalone_controls=.FALSE., fixed_fairlead=fixed_fairlead_ok, & @@ -5296,7 +5339,10 @@ SUBROUTINE attachment_static_drag(q, node, att, opts, frame_cs, f, ErrStat, ErrM IF (.NOT. (att(4, k) > CD_ZERO .OR. att(6, k) > CD_ZERO)) CYCLE base = 6*(node(k) - 1) IF (q(base + 3) > CD_ZERO) CYCLE - ug = deck_current_velocity(opts, q(base + 3), es, em) + ! the node's global position (the solve frame is the global one turned by frame_cs) + ug = deck_current_velocity(opts, [frame_cs(1)*q(base + 1) - frame_cs(2)*q(base + 2), & + frame_cs(2)*q(base + 1) + frame_cs(1)*q(base + 2), q(base + 3)], & + CD_ZERO, es, em) IF (es /= CD_HYDRO_OK) THEN CALL fail(ErrStat, ErrMsg, TRIM(em)); RETURN END IF @@ -5445,6 +5491,7 @@ RECURSIVE SUBROUTINE hermite_static_primary(anchor, fairlead, l0, ea, ei, w, dia LOGICAL :: tensile, refine_all, planar_bed, walk_needed, laid REAL(wp) :: h_target REAL(wp) :: origin(2), a_l(3), f_l(3), seabed_z, seabed_slope, horizontal_tension, grounded_length + TYPE(CD_HermiteStaticCurrentType), ALLOCATABLE :: cur_s REAL(wp) :: lambda0, ratio, span(2), span_len, t, xg, yg, zf, sx, sz, sxx, sxz, xl, yl REAL(wp) :: res_cont, cont_tol, phi, penetration, zfit(NFIT), fit_misfit, fine_limit, seed_bed, anchor_bed REAL(wp), ALLOCATABLE :: pos(:), q_seed(:), q_cont(:), curv_cont(:), knnode(:), tdir(:, :), stretch(:) @@ -5480,6 +5527,12 @@ RECURSIVE SUBROUTINE hermite_static_primary(anchor, fairlead, l0, ea, ei, w, dia IF (.NOT. PRESENT(bathymetry)) origin = anchor(1:2) a_l = [anchor(1) - origin(1), anchor(2) - origin(2), anchor(3)] f_l = [fairlead(1) - origin(1), fairlead(2) - origin(2), fairlead(3)] + ! the solves below run in the frame translated to origin: the current they take knows it, so + ! a current grid is sampled at the nodes' global positions (CD_HermiteStaticCurrentType) + IF (PRESENT(cur_obj)) THEN + ALLOCATE (cur_s, SOURCE=cur_obj) + cur_s%origin = origin + END IF ! Seabed plane under the line. A structured bathymetry is represented by its ! least-squares plane along the horizontal chord; the contact solve itself always @@ -5761,7 +5814,7 @@ RECURSIVE SUBROUTINE hermite_static_primary(anchor, fairlead, l0, ea, ei, w, dia endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, & dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj) + water_weight=opts%rhoW*opts%g, current=cur_s) ELSE CALL CD_HermiteCable_Static_Solve_Continuation(l0, ea, ei, w, q_seed, fixed_dofs, contact_z, CD_ZERO, & STAGE_MAX_ITER, cont_tol, lambda0, budget_cont, & @@ -5771,7 +5824,7 @@ RECURSIVE SUBROUTINE hermite_static_primary(anchor, fairlead, l0, ea, ei, w, dia endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, & dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj) + water_weight=opts%rhoW*opts%g, current=cur_s) END IF iters = cont_iters IF (es /= CD_HCSTAT_OK) THEN @@ -6102,7 +6155,7 @@ SUBROUTINE walk_anchor() bending_quadrature_order=opts%bending_quadrature_order, & endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj, & + water_weight=opts%rhoW*opts%g, current=cur_s, & energy_minimization=energy) total_it = total_it + it_w IF (es_w /= CD_HCSTAT_OK) THEN @@ -6156,7 +6209,7 @@ SUBROUTINE walk_anchor() bending_quadrature_order=opts%bending_quadrature_order, & endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj, & + water_weight=opts%rhoW*opts%g, current=cur_s, & energy_minimization=energy) total_it = total_it + it_w IF (es_w == CD_HCSTAT_OK .AND. .NOT. folded) THEN @@ -6460,7 +6513,7 @@ SUBROUTINE polish(tol_polish) refine_non_axial=refine_all, & endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj, & + water_weight=opts%rhoW*opts%g, current=cur_s, & local_refinement=.TRUE.) ELSE IF (contact_enabled) THEN CALL CD_HermiteCable_Static_Solve_AutoMesh(l0, ea, ei, w, q_cont, fixed_dofs, contact_z, CD_ZERO, & @@ -6479,7 +6532,7 @@ SUBROUTINE polish(tol_polish) refine_non_axial=refine_all, & endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj, & + water_weight=opts%rhoW*opts%g, current=cur_s, & local_refinement=.TRUE.) ELSE CALL CD_HermiteCable_Static_Solve_AutoMesh(l0, ea, ei, w, q_cont, fixed_dofs, contact_z, CD_ZERO, & @@ -6496,7 +6549,7 @@ SUBROUTINE polish(tol_polish) refine_non_axial=refine_all, & endconn_stiffness=endconn_k, endconn_direction=endconn_d0, & endconn_mode=endconn_mode, waterline_z=CD_ZERO, dry_buoyancy=dry_b, & - water_weight=opts%rhoW*opts%g, current=cur_obj, & + water_weight=opts%rhoW*opts%g, current=cur_s, & local_refinement=.TRUE.) END IF iters = iters + polish_iters @@ -6526,7 +6579,10 @@ SUBROUTINE hermite_static_current(ln, sections, types, opts, l0, frame_cs, cur) cur%rho = opts%rhoW cur%waterline_z = CD_ZERO cur%frame_cs = frame_cs - IF (opts%has_current_profile) THEN + IF (opts%has_current_grid) THEN + ! sampled at the node positions at t = 0 (the static start) + ALLOCATE (cur%grid, SOURCE=opts%current_grid) + ELSE IF (opts%has_current_profile) THEN cur%profile_z = opts%current_profile_z cur%profile_velocity = opts%current_profile_velocity ELSE @@ -9146,7 +9202,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er ALLOCATE (fluid_velocity(3, SIZE(l0) + 1), drag_waterline(SIZE(l0) + 1)) DO i = 1, SIZE(l0) + 1 IF (opts%has_current) THEN - fluid_velocity(:, i) = deck_current_velocity(opts, line_node_z(anchor, fairlead, l0, i), es, em) + fluid_velocity(:, i) = deck_current_velocity(opts, line_node_pos(anchor, fairlead, l0, i), CD_ZERO, es, em) IF (es /= CD_HYDRO_OK) THEN CALL fail(ErrStat, ErrMsg, 'current profile for model init: '//TRIM(em)); RETURN END IF @@ -9187,7 +9243,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & fluid_acceleration=fluid_acceleration, fk_waterline_z=waterline, fk_rho=opts%rhoW, & @@ -9217,7 +9273,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & added_mass_waterline_z=waterline, added_mass_rho=opts%rhoW, & @@ -9245,7 +9301,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & added_mass_waterline_z=waterline, added_mass_rho=opts%rhoW, & @@ -9274,7 +9330,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & fluid_acceleration=fluid_acceleration, fk_waterline_z=waterline, fk_rho=opts%rhoW, & @@ -9305,7 +9361,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & added_mass_waterline_z=waterline, added_mass_rho=opts%rhoW, & @@ -9334,7 +9390,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er as_laid_tension=laid_t, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt, & added_mass_waterline_z=waterline, added_mass_rho=opts%rhoW, & @@ -9348,7 +9404,7 @@ RECURSIVE SUBROUTINE init_one_model(ln, sections, types, points, opts, model, Er syrope_tmax0=syrope_tmax0, dynamic_tension_only=.TRUE., anchor_is_end_b=.TRUE., ba=ba, & ve_ea_d=ve_ead, ve_ba=ve_bas, ve_ba_d=ve_bad, ve_alpha_mbl=ve_ambl, ve_vbeta=ve_vbet, & current_profile_z=opts%current_profile_z, & - current_profile_velocity=opts%current_profile_velocity, & + current_profile_velocity=opts%current_profile_velocity, current_grid=opts%current_grid, & fluid_velocity=fluid_velocity, drag_waterline_z=drag_waterline, drag_rho=opts%rhoW, & drag_diameter_elem=hydro_diam, drag_cdn_elem=hydro_cdn, drag_cdt_elem=hydro_cdt) ELSE @@ -11072,7 +11128,7 @@ SUBROUTINE finite_environment_node(opts, time, x, eta, fluid_velocity, fluid_acc END IF END IF IF (opts%has_current) THEN - current_velocity = deck_current_velocity(opts, x(3), es, em) + current_velocity = deck_current_velocity(opts, x, time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = es ErrMsg = em @@ -11664,8 +11720,13 @@ LOGICAL FUNCTION deck_current_on_line(opts, z) RESULT(on) CHARACTER(512) :: em on = .FALSE. IF (.NOT. opts%has_current) RETURN + IF (opts%has_current_grid) THEN + ! a current grid (Currents 2 and 5) counts wherever it is non-zero + on = ANY(ABS(opts%current_grid%velocity) > CD_ZERO) + RETURN + END IF DO k = 1, SIZE(z) - u = deck_current_velocity(opts, z(k), es, em) + u = deck_current_velocity(opts, [CD_ZERO, CD_ZERO, z(k)], CD_ZERO, es, em) IF (es /= CD_HYDRO_OK) CYCLE IF (NORM2(u) > CD_ZERO) THEN on = .TRUE. @@ -11868,7 +11929,8 @@ SUBROUTINE solve_one_line(ln, sections, types, points, opts, q, tension, converg cur%waterline_z = CD_ZERO ALLOCATE (cur%node_velocity(3, ne + 1), cur%elem_diameter(ne), cur%elem_cdn(ne), cur%elem_cdt(ne)) DO i = 1, ne + 1 - cur%node_velocity(:, i) = deck_current_velocity(opts, line_node_z(anchor, fairlead, l0, i), es, em) + cur%node_velocity(:, i) = deck_current_velocity(opts, line_node_pos(anchor, fairlead, l0, i), CD_ZERO, & + es, em) IF (es /= CD_HYDRO_OK) THEN CALL fail(ErrStat, ErrMsg, 'current profile: '//TRIM(em)); RETURN END IF @@ -11886,6 +11948,8 @@ SUBROUTINE solve_one_line(ln, sections, types, points, opts, q, tension, converg cur%profile_z = opts%current_profile_z cur%profile_velocity = opts%current_profile_velocity END IF + ! a current grid (Currents 2 and 5) at the node positions, at t = 0 + IF (opts%has_current_grid) ALLOCATE (cur%grid, SOURCE=opts%current_grid) ! file order is End A (fairlead) -> End B; the mesh runs anchor -> fairlead cur%elem_diameter = cur%elem_diameter(ne:1:-1) cur%elem_cdn = cur%elem_cdn(ne:1:-1) @@ -12342,7 +12406,7 @@ SUBROUTINE parse_deck(path, types, bodies, rod_types, rods, points, lines, secti 'driver has no host SeaState field') RETURN END IF - ! MoorDyn-C WaveKin 3/7 and Currents 1: their fixed-name files in the deck folder + ! MoorDyn-C WaveKin 3/7 and Currents 1/2/5: their fixed-name files in the deck folder IF (opts%mdc_wave_kin > 0 .OR. opts%mdc_currents > 0) THEN CALL read_moordyn_c_kinematics(deck_dir(path), opts, ErrStat, ErrMsg) IF (ErrStat /= 0) RETURN @@ -13218,6 +13282,16 @@ SUBROUTINE read_moordyn_c_kinematics(dir, opts, ErrStat, ErrMsg) !! must share one direction beta. !! - Currents 1, current_profile.txt (`z ux uy uz` rows after its header rows): the steady !! profile, linear in z and held beyond its ends, as MoorDyn-C's current grid. + !! - Currents 2, current_profile_dynamic.txt (constructDynamicCurrentGrid of MoorDyn-C's + !! source/Waves/WaveGrid.cpp): lines 1-4 and 6 are free text, line 5 lists the depths + !! z(1:nz) (read in single precision, as MoorDyn-C's stof), and every later row is + !! `t ux(1:nz) [uy(1:nz) [uz(1:nz)]]` (missing components zero). A depth profile in time. + !! - Currents 5, current_profile_4d.txt (construct4DCurrentGrid): line 1 is `nx ny nz nt`, + !! lines 2-5 the x, y, z and t coordinates, and the rows `x y z t ux uy uz` give every grid + !! point once, from line 6 (a text line 6 is a header, as MoorDyn-C reads its rows from line + !! 7). A row's coordinates are matched by value. + !! Both are resampled in time as MoorDyn-C does and evaluated at every node position and + !! time (CD_Current_Grid_Resample, CD_Current_Grid_Velocity), with no fluid acceleration. CHARACTER(*), INTENT(IN) :: dir TYPE(DeckOptions), INTENT(INOUT) :: opts INTEGER, INTENT(OUT) :: ErrStat @@ -13226,7 +13300,10 @@ SUBROUTINE read_moordyn_c_kinematics(dir, opts, ErrStat, ErrMsg) REAL(wp) :: dt, tl, frac, ca, sa, angle, scale, beta, mean_level, arg INTEGER :: n, nt, j, k, nc, bracket INTEGER(KIND=8) :: kj - CHARACTER(24) :: fname + CHARACTER(32) :: fname + ! the longest row of a MoorDyn-C current table (a time and 3 nz velocities per row) + INTEGER, PARAMETER :: LONG_ROW = 65536 + INTEGER, PARAMETER :: SP = SELECTED_REAL_KIND(6, 37) ErrStat = CD_DECKDRV_OK ErrMsg = '' @@ -13377,9 +13454,401 @@ SUBROUTINE read_moordyn_c_kinematics(dir, opts, ErrStat, ErrMsg) opts%has_current = .TRUE. opts%has_current_profile = .TRUE. END IF + IF (opts%mdc_currents == 2 .OR. opts%mdc_currents == 5) THEN + IF (opts%has_current) THEN + CALL fail(ErrStat, ErrMsg, 'the deck declares BOTH a current OPTION (or a WaterKin current) and '// & + 'Currents '//TRIM(int_to_str(opts%mdc_currents))//' (double-counting); keep one'); RETURN + END IF + IF (ALLOCATED(opts%current_grid)) DEALLOCATE (opts%current_grid) + ALLOCATE (opts%current_grid) + IF (opts%mdc_currents == 2) THEN + fname = 'current_profile_dynamic.txt' + CALL read_dynamic_profile() + ELSE + fname = 'current_profile_4d.txt' + CALL read_4d_grid() + END IF + IF (ErrStat /= CD_DECKDRV_OK) RETURN + opts%has_current = .TRUE. + opts%has_current_grid = .TRUE. + opts%has_current_profile = .FALSE. + ! past its last sample MoorDyn-C's grid repeats (CD_Current_Grid_Velocity) + IF (opts%has_tmax .AND. opts%current_grid%nt > 1) THEN + tl = REAL(opts%current_grid%nt - 1, wp)*opts%current_grid%dt + IF (opts%tmax > tl) WRITE (error_unit, '(A)') ' Note: Currents '//TRIM(int_to_str(opts%mdc_currents))// & + ': TMax outlasts the last sample of '//TRIM(fname)//' (t = '//TRIM(real_to_str(tl))//' s); as in '// & + 'MoorDyn-C the current then repeats with period '// & + TRIM(real_to_str(REAL(opts%current_grid%nt, wp)*opts%current_grid%dt))// & + ' s, holding its t = 0 value over the last interval of each period.' + END IF + END IF CONTAINS + SUBROUTINE open_table(name, unit, ok) + !! Open the kinematics file name in the deck folder. + CHARACTER(*), INTENT(IN) :: name + INTEGER, INTENT(OUT) :: unit + LOGICAL, INTENT(OUT) :: ok + INTEGER :: ios + CHARACTER(1024) :: why + CHARACTER(CD_DECK_PATHLEN) :: fpath + fpath = path_join(dir, TRIM(name)) + CALL CD_Open_Input(unit, TRIM(fpath), ios, why) + ok = ios == 0 + IF (.NOT. ok) CALL fail(ErrStat, ErrMsg, 'cannot open the MoorDyn-C kinematics file '//TRIM(fpath)// & + input_open_reason(TRIM(fpath), why)) + END SUBROUTINE open_table + + SUBROUTINE next_row(unit, buf, lineno, ios) + !! The next whole record of a current table (lineno counts every line, blank ones too, as + !! MoorDyn-C's fileToLines does); a record longer than buf fails (ios = 1, ErrStat set). + INTEGER, INTENT(IN) :: unit + CHARACTER(*), INTENT(OUT) :: buf + INTEGER, INTENT(INOUT) :: lineno + INTEGER, INTENT(OUT) :: ios + LOGICAL :: overflow + CALL read_whole_record(unit, buf, ios, overflow) + IF (ios /= 0) RETURN + lineno = lineno + 1 + IF (lineno == 1) CALL CD_Strip_BOM(buf) + IF (overflow) THEN + ios = 1 + CALL fail(ErrStat, ErrMsg, TRIM(fname)//' rows must be at most '//TRIM(int_to_str(LEN(buf)))// & + ' characters long') + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + END IF + END SUBROUTINE next_row + + SUBROUTINE row_tokens(line, lo, hi, ntok) + !! The whitespace tokens of a row as MoorDyn-C splits it (moordyn::str::split): up to the + !! first token holding '#', which starts a comment. + CHARACTER(*), INTENT(IN) :: line + INTEGER, ALLOCATABLE, INTENT(INOUT) :: lo(:), hi(:) + INTEGER, INTENT(OUT) :: ntok + INTEGER, ALLOCATABLE :: grown(:) + INTEGER :: pos, a, b + ntok = 0 + pos = 1 + DO + CALL token_bounds(line, pos, a, b) + IF (a == 0) EXIT + IF (INDEX(line(a:b), '#') > 0) EXIT + ntok = ntok + 1 + IF (ntok > SIZE(lo)) THEN + ALLOCATE (grown(2*SIZE(lo))) + grown(1:SIZE(lo)) = lo + CALL MOVE_ALLOC(grown, lo) + ALLOCATE (grown(2*SIZE(hi))) + grown(1:SIZE(hi)) = hi + CALL MOVE_ALLOC(grown, hi) + END IF + lo(ntok) = a + hi(ntok) = b + END DO + END SUBROUTINE row_tokens + + LOGICAL FUNCTION table_number(tok, x, lineno) RESULT(ok) + !! tok read as a plain finite number; otherwise fail naming the file line. + CHARACTER(*), INTENT(IN) :: tok + REAL(wp), INTENT(OUT) :: x + INTEGER, INTENT(IN) :: lineno + CALL parse_real_token(tok, x, ok) + IF (.NOT. ok) THEN + CALL fail(ErrStat, ErrMsg, TRIM(fname)//' value "'//tok//'" is not a plain finite number') + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + END IF + END FUNCTION table_number + + LOGICAL FUNCTION strictly_increasing(c) RESULT(ok) + REAL(wp), INTENT(IN) :: c(:) + INTEGER :: k + ok = .TRUE. + DO k = 2, SIZE(c) + IF (.NOT. c(k) > c(k - 1)) ok = .FALSE. + END DO + END FUNCTION strictly_increasing + + SUBROUTINE read_dynamic_profile() + !! Currents 2: current_profile_dynamic.txt into opts%current_grid (nx = ny = 1). + CHARACTER(:), ALLOCATABLE :: buf + INTEGER, ALLOCATABLE :: lo(:), hi(:) + REAL(wp), ALLOCATABLE :: zc(:), tc(:), uu(:, :, :), grow_u(:, :, :), grow_t(:), v5(:, :, :, :, :) + REAL(wp) :: x + REAL(SP) :: z4 + INTEGER :: unit, ios, lineno, nz, ntok, m, k, ncomp, rios + LOGICAL :: ok + CHARACTER(512) :: em_g + INTEGER :: es_g + ALLOCATE (CHARACTER(LONG_ROW) :: buf) + ALLOCATE (lo(64), hi(64)) + CALL open_table(fname, unit, ok) + IF (.NOT. ok) RETURN + nz = 0 + m = 0 + lineno = 0 + ALLOCATE (tc(16), zc(0), uu(3, 0, 16)) + DO + CALL next_row(unit, buf, lineno, ios) + IF (ios /= 0) EXIT + ! lines 1-4 and 6 are free text (MoorDyn-C skips them by position) + IF (lineno <= 4 .OR. lineno == 6) CYCLE + CALL row_tokens(buf, lo, hi, ntok) + IF (lineno == 5) THEN + IF (ntok < 1) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 2: line 5 of '//TRIM(fname)//' must list the depths') + RETURN + END IF + nz = ntok + DEALLOCATE (zc, uu) + ALLOCATE (zc(nz), uu(3, nz, 16)) + DO k = 1, nz + IF (.NOT. table_number(buf(lo(k):hi(k)), x, lineno)) THEN + CLOSE (unit); RETURN + END IF + ! MoorDyn-C reads the depths in single precision (stof) + READ (buf(lo(k):hi(k)), *, IOSTAT=rios) z4 + IF (rios /= 0 .OR. .NOT. IEEE_IS_FINITE(z4)) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, TRIM(fname)//' depth "'//buf(lo(k):hi(k))//'" is not a single-precision '// & + 'number') + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + RETURN + END IF + zc(k) = REAL(z4, wp) + END DO + CYCLE + END IF + IF (ntok == 0) CYCLE + IF (ntok == 1 + nz) THEN + ncomp = 1 + ELSE IF (ntok == 1 + 2*nz) THEN + ncomp = 2 + ELSE IF (ntok == 1 + 3*nz) THEN + ncomp = 3 + ELSE + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 2: a '//TRIM(fname)//' row is the time and the x, the x and y, or '// & + 'the x, y and z velocities at the '//TRIM(int_to_str(nz))//' depths ('// & + TRIM(int_to_str(1 + nz))//', '//TRIM(int_to_str(1 + 2*nz))//' or '// & + TRIM(int_to_str(1 + 3*nz))//' numbers); found '//TRIM(int_to_str(ntok))) + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + RETURN + END IF + m = m + 1 + IF (m > SIZE(tc)) THEN + ALLOCATE (grow_t(2*SIZE(tc)), grow_u(3, nz, 2*SIZE(tc))) + grow_t(1:m - 1) = tc(1:m - 1) + grow_u(:, :, 1:m - 1) = uu(:, :, 1:m - 1) + CALL MOVE_ALLOC(grow_t, tc) + CALL MOVE_ALLOC(grow_u, uu) + END IF + IF (.NOT. table_number(buf(lo(1):hi(1)), tc(m), lineno)) THEN + CLOSE (unit); RETURN + END IF + uu(:, :, m) = CD_ZERO + DO k = 1, ncomp*nz + IF (.NOT. table_number(buf(lo(k + 1):hi(k + 1)), x, lineno)) THEN + CLOSE (unit); RETURN + END IF + ! the x velocities depth by depth, then the y ones, then the z ones + uu((k - 1)/nz + 1, MOD(k - 1, nz) + 1, m) = x + END DO + END DO + CLOSE (unit) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + IF (nz == 0 .OR. lineno < 7) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 2: '//TRIM(fname)//' needs at least 7 lines (4 header lines, the '// & + 'depths, a header line and the time rows)'); RETURN + END IF + IF (m < 2) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 2: '//TRIM(fname)//' needs at least two time rows'); RETURN + END IF + IF (.NOT. strictly_increasing(zc)) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 2: '//TRIM(fname)//' depths must be strictly increasing'); RETURN + END IF + IF (.NOT. strictly_increasing(tc(1:m))) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 2: '//TRIM(fname)//' times must be strictly increasing'); RETURN + END IF + ALLOCATE (v5(3, 1, 1, nz, m)) + v5(:, 1, 1, :, :) = uu(:, :, 1:m) + CALL CD_Current_Grid_Resample([CD_ZERO], [CD_ZERO], zc, tc(1:m), v5, opts%current_grid, es_g, em_g) + IF (es_g /= CD_HYDRO_OK) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 2: '//TRIM(fname)//': '//TRIM(em_g)); RETURN + END IF + END SUBROUTINE read_dynamic_profile + + SUBROUTINE read_4d_grid() + !! Currents 5: current_profile_4d.txt into opts%current_grid. + INTEGER(int64), PARAMETER :: MAX_POINTS = 10000000_int64 + CHARACTER(:), ALLOCATABLE :: buf + INTEGER, ALLOCATABLE :: lo(:), hi(:) + REAL(wp), ALLOCATABLE :: xc(:), yc(:), zc(:), tc(:), v5(:, :, :, :, :) + LOGICAL, ALLOCATABLE :: seen(:, :, :, :) + REAL(wp) :: row(7) + INTEGER :: unit, ios, lineno, ntok, k, dims(4), ix, iy, iz, it + INTEGER(int64) :: nrow, npts + LOGICAL :: ok + CHARACTER(512) :: em_g + INTEGER :: es_g + ALLOCATE (CHARACTER(LONG_ROW) :: buf) + ALLOCATE (lo(64), hi(64)) + CALL open_table(fname, unit, ok) + IF (.NOT. ok) RETURN + lineno = 0 + nrow = 0 + npts = 0 + dims = 0 + ALLOCATE (xc(0), yc(0), zc(0), tc(0), v5(3, 0, 0, 0, 0), seen(0, 0, 0, 0)) + DO + CALL next_row(unit, buf, lineno, ios) + IF (ios /= 0) EXIT + CALL row_tokens(buf, lo, hi, ntok) + SELECT CASE (lineno) + CASE (1) + ! nx ny nz nt + ok = ntok == 4 + DO k = 1, MIN(ntok, 4) + IF (ok) CALL parse_int_token(buf(lo(k):hi(k)), dims(k), ok) + END DO + IF (ok) ok = ALL(dims >= 1) + IF (.NOT. ok) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: line 1 of '//TRIM(fname)//' must be the four positive '// & + 'grid sizes `nx ny nz nt`') + RETURN + END IF + npts = PRODUCT(INT(dims, int64)) + IF (npts > MAX_POINTS) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' declares more than 1e7 grid points') + RETURN + END IF + DEALLOCATE (xc, yc, zc, tc, v5, seen) + ALLOCATE (xc(dims(1)), yc(dims(2)), zc(dims(3)), tc(dims(4))) + ALLOCATE (v5(3, dims(1), dims(2), dims(3), dims(4)), seen(dims(1), dims(2), dims(3), dims(4))) + v5 = CD_ZERO + seen = .FALSE. + CASE (2:5) + IF (ntok /= dims(lineno - 1)) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: line '//TRIM(int_to_str(lineno))//' of '//TRIM(fname)// & + ' must list the '//TRIM(int_to_str(dims(lineno - 1)))//' '// & + axis_name(lineno - 1)//' coordinates declared on line 1; found '//TRIM(int_to_str(ntok))) + RETURN + END IF + DO k = 1, ntok + SELECT CASE (lineno) + CASE (2) + ok = table_number(buf(lo(k):hi(k)), xc(k), lineno) + CASE (3) + ok = table_number(buf(lo(k):hi(k)), yc(k), lineno) + CASE (4) + ok = table_number(buf(lo(k):hi(k)), zc(k), lineno) + CASE DEFAULT + ok = table_number(buf(lo(k):hi(k)), tc(k), lineno) + END SELECT + IF (.NOT. ok) THEN + CLOSE (unit); RETURN + END IF + END DO + CASE DEFAULT + IF (ntok == 0) CYCLE + ! a text line 6 is a header (MoorDyn-C reads its rows from line 7) + IF (lineno == 6) THEN + IF (.NOT. numeric_token_shape(buf(lo(1):hi(1)))) CYCLE + END IF + IF (ntok /= 7) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: a '//TRIM(fname)//' row is `x y z t ux uy uz` (7 numbers); '// & + 'found '//TRIM(int_to_str(ntok))) + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + RETURN + END IF + DO k = 1, 7 + IF (.NOT. table_number(buf(lo(k):hi(k)), row(k), lineno)) THEN + CLOSE (unit); RETURN + END IF + END DO + ix = FINDLOC(xc, row(1), DIM=1) + iy = FINDLOC(yc, row(2), DIM=1) + iz = FINDLOC(zc, row(3), DIM=1) + it = FINDLOC(tc, row(4), DIM=1) + IF (ix == 0 .OR. iy == 0 .OR. iz == 0 .OR. it == 0) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: a '//TRIM(fname)//' row names a point off the grid of lines '// & + '2-5 (its x, y, z and t must each equal one of the listed coordinates)') + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + RETURN + END IF + IF (seen(ix, iy, iz, it)) THEN + CLOSE (unit) + CALL fail(ErrStat, ErrMsg, 'Currents 5: a '//TRIM(fname)//' row repeats a grid point') + CALL add_file_line(TRIM(fname), lineno, ErrMsg) + RETURN + END IF + seen(ix, iy, iz, it) = .TRUE. + v5(:, ix, iy, iz, it) = row(5:7) + nrow = nrow + 1 + END SELECT + END DO + CLOSE (unit) + IF (ErrStat /= CD_DECKDRV_OK) RETURN + IF (lineno < 5) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' needs the grid sizes, the x, y, z and t '// & + 'coordinates (lines 1-5) and a row per grid point'); RETURN + END IF + IF (.NOT. (strictly_increasing(xc) .AND. strictly_increasing(yc) .AND. strictly_increasing(zc))) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' x, y and z coordinates must be strictly '// & + 'increasing'); RETURN + END IF + IF (.NOT. strictly_increasing(tc)) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' times must be strictly increasing'); RETURN + END IF + IF (SIZE(tc) < 2) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' needs at least two times (MoorDyn-C reads '// & + 'before its table with one)'); RETURN + END IF + IF (nrow < npts) THEN + ! the first missing point + DO it = 1, SIZE(tc) + DO iz = 1, SIZE(zc) + DO iy = 1, SIZE(yc) + DO ix = 1, SIZE(xc) + IF (seen(ix, iy, iz, it)) CYCLE + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' has no row for the grid point (x, y, z, '// & + 't) = ('//TRIM(real_to_str(xc(ix)))//', '//TRIM(real_to_str(yc(iy)))//', '// & + TRIM(real_to_str(zc(iz)))//', '//TRIM(real_to_str(tc(it)))//')') + RETURN + END DO + END DO + END DO + END DO + END IF + CALL CD_Current_Grid_Resample(xc, yc, zc, tc, v5, opts%current_grid, es_g, em_g) + IF (es_g /= CD_HYDRO_OK) THEN + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//': '//TRIM(em_g)); RETURN + END IF + END SUBROUTINE read_4d_grid + + FUNCTION axis_name(k) RESULT(name) + INTEGER, INTENT(IN) :: k + CHARACTER(1) :: name + CHARACTER(4), PARAMETER :: AXES = 'xyzt' + name = AXES(k:k) + END FUNCTION axis_name + + FUNCTION real_to_str(x) RESULT(t) + !! x in G0.6 (asterisks never abort: the WRITE carries IOSTAT). + REAL(wp), INTENT(IN) :: x + CHARACTER(32) :: t + INTEGER :: ios + t = '' + WRITE (t, '(G0.6)', IOSTAT=ios) x + t = ADJUSTL(t) + END FUNCTION real_to_str + SUBROUTINE install_components() !! The component waves (omega, amplitude, phase in CableDyn's cos(k d - omega t + phase) !! convention), their direction beta [rad] and the mean level. @@ -16003,29 +16472,25 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) END IF CASE ('currents') ! Stock MoorDyn-C switch selecting where current kinematics come from: 0 none, 1 the steady - ! depth table current_profile.txt in the deck folder (read_moordyn_c_kinematics); the - ! time-varying and gridded tables fail closed by name (CableDyn decks may also declare - ! current via the "current" option) + ! depth table current_profile.txt, 2 the time-varying depth table + ! current_profile_dynamic.txt, 5 the grid in x, y, z and time current_profile_4d.txt, each + ! in the deck folder (read_moordyn_c_kinematics). 3 and 4 (MoorDyn-C's node approaches) + ! have no current source in MoorDyn-C v2.7.1 and fail closed by name (CableDyn decks may + ! also declare current via the "current" option) CALL rd(val, x1, ErrStat, ErrMsg) IF (ErrStat /= 0) RETURN opts%mdc_currents = 0 IF (ABS(x1 - ANINT(x1)) > 1.0e-9_wp .OR. x1 < -0.5_wp .OR. x1 > 5.5_wp) THEN - CALL fail(ErrStat, ErrMsg, 'Currents '//TRIM(val)//' not supported (0 none, or 1 for the MoorDyn-C '// & - 'steady profile current_profile.txt)') + CALL fail(ErrStat, ErrMsg, 'Currents '//TRIM(val)//' not supported (0 none, or the MoorDyn-C current '// & + 'files: 1 current_profile.txt, 2 current_profile_dynamic.txt, 5 current_profile_4d.txt)') RETURN END IF SELECT CASE (NINT(x1)) - CASE (1) - opts%mdc_currents = 1 - CASE (2) - CALL fail(ErrStat, ErrMsg, 'Currents 2 (the MoorDyn-C time-varying profile current_profile_dynamic.txt) '// & - 'is not supported; use Currents 1 or the "current" option') + CASE (1, 2, 5) + opts%mdc_currents = NINT(x1) CASE (3, 4) CALL fail(ErrStat, ErrMsg, 'Currents '//TRIM(int_to_str(NINT(x1)))//' is not supported '// & - '(no current source in MoorDyn-C v2.7.1); use Currents 1') - CASE (5) - CALL fail(ErrStat, ErrMsg, 'Currents 5 (the MoorDyn-C 4-D current grid current_profile_4d.txt) is not '// & - 'supported; use Currents 1 or the "current" option') + '(no current source in MoorDyn-C v2.7.1); use Currents 1, 2 or 5') END SELECT CASE DEFAULT ! per-line static friction rows: layAzimuth, asLaidTension (line ID suffix) @@ -16717,6 +17182,18 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio END DO END BLOCK END IF + IF (opts%has_current_grid) THEN + IF (.NOT. ALLOCATED(opts%current_grid)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid declared without grid data'); RETURN + END IF + ! read_moordyn_c_kinematics has checked that the grid is finite and increasing + IF (ANY(ABS(opts%current_grid%x) > MAX_COORDINATE) .OR. ANY(ABS(opts%current_grid%y) > MAX_COORDINATE) & + .OR. ANY(ABS(opts%current_grid%z) > MAX_COORDINATE) .OR. & + ANY(ABS(opts%current_grid%velocity) > MAX_FLUID_SPEED)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid coordinates must be at most 1e6 m and velocities at most '// & + '1e3 m/s in magnitude'); RETURN + END IF + END IF END IF IF (opts%has_wave) THEN IF (.NOT. opts%has_dtm) THEN @@ -24752,7 +25229,7 @@ SUBROUTINE fluid_at(xq, s, uq, duq, etaq, pdq, want_pdyn) END IF END IF IF (opts%has_current) THEN - uq = uq + deck_current_velocity(opts, xq(3), es, em) + uq = uq + deck_current_velocity(opts, xq, time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = CD_DECKDRV_BADINPUT ErrMsg = 'CableDyn_DeckDriver: rod current profile failed: '//TRIM(em) @@ -25695,7 +26172,7 @@ SUBROUTINE own_loads(xs, fk, mk, cen, sc_out, good) fk(3, kk) = (opts%rhoW*pts(idx(kk))%vol - pts(idx(kk))%mass)*opts%g sc_out = MAX(sc_out, ABS(fk(3, kk))) IF (opts%has_current .AND. pts(idx(kk))%cda > CD_ZERO) THEN - u = deck_current_velocity(opts, pts(idx(kk))%pos(3), es_l, em_l) + u = deck_current_velocity(opts, pts(idx(kk))%pos, CD_ZERO, es_l, em_l) IF (es_l /= CD_HYDRO_OK) THEN CALL fail(ErrStat, ErrMsg, 'static equilibrium: current profile at point '// & TRIM(int_to_str(pts(idx(kk))%id))//': '//TRIM(em_l)); RETURN @@ -26254,8 +26731,8 @@ SUBROUTINE cached_line_solve(jl, pts, es_out, em_out, want_k, k_ok) curp%waterline_z = CD_ZERO ALLOCATE (curp%node_velocity(3, nn)) DO ii = 1, nn - curp%node_velocity(:, ii) = deck_current_velocity(opts, line_node_z(anchor, fairlead, lc(jl)%l0, ii), & - es_l, em_l) + curp%node_velocity(:, ii) = deck_current_velocity(opts, line_node_pos(anchor, fairlead, lc(jl)%l0, ii), & + CD_ZERO, es_l, em_l) IF (es_l /= CD_HYDRO_OK) THEN CALL fail(es_out, em_out, 'current profile: '//TRIM(em_l)); RETURN END IF @@ -26267,6 +26744,7 @@ SUBROUTINE cached_line_solve(jl, pts, es_out, em_out, want_k, k_ok) curp%profile_z = opts%current_profile_z curp%profile_velocity = opts%current_profile_velocity END IF + IF (opts%has_current_grid) ALLOCATE (curp%grid, SOURCE=opts%current_grid) END IF ALLOCATE (q(3*nn)) conv = .FALSE. @@ -27719,7 +28197,7 @@ SUBROUTINE CD_Deck_Fluid_Probe(deck_path, pos, times, eta, vel, acc, ErrStat, Er CALL deck_wave_kinematics(opts, pos(1, i), pos(2, i), pos(3, i), times(i), eta(i), vel(:, i), acc(:, i), & ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) RETURN - vel(:, i) = vel(:, i) + deck_current_velocity(opts, pos(3, i), ErrStat, ErrMsg) + vel(:, i) = vel(:, i) + deck_current_velocity(opts, pos(:, i), times(i), ErrStat, ErrMsg) IF (ErrStat /= CD_DECKDRV_OK) RETURN END DO END SUBROUTINE CD_Deck_Fluid_Probe @@ -29192,7 +29670,7 @@ SUBROUTINE rigid6_environment_force(body, opts, time, force, effective_mass, dra END IF END IF IF (opts%has_current) THEN - fluid_velocity = fluid_velocity + deck_current_velocity(opts, body%r(3), es, em) + fluid_velocity = fluid_velocity + deck_current_velocity(opts, body%r, time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = CD_DECKDRV_BADINPUT ErrMsg = 'CableDyn_DeckDriver: Rigid6 current profile failed: '//TRIM(em) @@ -29687,7 +30165,7 @@ SUBROUTINE update_hermite_deck_fluid(cables, opts, time, ErrStat, ErrMsg) fv = CD_ZERO; fa = CD_ZERO; wl = CD_ZERO DO j = 1, nn IF (opts%has_current) THEN - fv(:, j) = deck_current_velocity(opts, xyz(3, j), es, em_k) + fv(:, j) = deck_current_velocity(opts, xyz(:, j), time, es, em_k) IF (es /= CD_HYDRO_OK) THEN CALL hermite_fluid_fail('current profile', em_k); RETURN END IF @@ -30115,11 +30593,11 @@ SUBROUTINE write_finite_dynamic_out(out_root, channels, lines, points, opts, mod IF (ErrStat == CD_DECKDRV_OK .AND. converged) CALL range_write(output_work%rset, out_root, ErrStat, ErrMsg) END SUBROUTINE write_finite_dynamic_out - FUNCTION deck_current_velocity(opts, z, ErrStat, ErrMsg) RESULT(velocity) - !! Return the deck current velocity at elevation z, with two-point profile - !! interpolation when a profile current is active. + FUNCTION deck_current_velocity(opts, pos, time, ErrStat, ErrMsg) RESULT(velocity) + !! Return the deck current velocity at position pos and time: uniform, a depth profile at + !! pos(3), or the MoorDyn-C current grid (Currents 2 and 5) at pos and time. TYPE(DeckOptions), INTENT(IN) :: opts - REAL(wp), INTENT(IN) :: z + REAL(wp), INTENT(IN) :: pos(3), time INTEGER, INTENT(OUT) :: ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg REAL(wp) :: velocity(3) @@ -30128,24 +30606,27 @@ FUNCTION deck_current_velocity(opts, z, ErrStat, ErrMsg) RESULT(velocity) ErrMsg = '' IF (.NOT. opts%has_current) THEN velocity = CD_ZERO + ELSE IF (opts%has_current_grid) THEN + CALL CD_Current_Grid_Velocity(opts%current_grid, pos, time, velocity, ErrStat, ErrMsg) ELSE IF (.NOT. opts%has_current_profile) THEN velocity = opts%current_velocity ELSE - CALL CD_Current_Profile_Velocity(z, opts%current_profile_z, opts%current_profile_velocity, & + CALL CD_Current_Profile_Velocity(pos(3), opts%current_profile_z, opts%current_profile_velocity, & velocity, ErrStat, ErrMsg) END IF END FUNCTION deck_current_velocity - PURE REAL(wp) FUNCTION line_node_z(anchor, fairlead, l0, node_id) RESULT(z) - !! Straight-line elevation estimate for initial environment fields before + PURE FUNCTION line_node_pos(anchor, fairlead, l0, node_id) RESULT(x) + !! Straight-line position estimate for initial environment fields before !! the persistent line model exposes its static equilibrium state. REAL(wp), INTENT(IN) :: anchor(3), fairlead(3), l0(:) INTEGER, INTENT(IN) :: node_id + REAL(wp) :: x(3) REAL(wp) :: total, s total = SUM(l0) IF (total <= CD_ZERO) THEN - z = anchor(3) + x = anchor RETURN END IF IF (node_id <= 1) THEN @@ -30155,8 +30636,8 @@ PURE REAL(wp) FUNCTION line_node_z(anchor, fairlead, l0, node_id) RESULT(z) ELSE s = SUM(l0(1:node_id - 1)) END IF - z = anchor(3) + (fairlead(3) - anchor(3))*s/total - END FUNCTION line_node_z + x = anchor + (fairlead - anchor)*s/total + END FUNCTION line_node_pos SUBROUTINE deck_wave_kinematics(opts, x, y, z, time, eta, velocity, acceleration, ErrStat, ErrMsg, pdyn) !! Dispatch the active deck wave model to the hydro kinematics primitive. During the @@ -30678,7 +31159,7 @@ SUBROUTINE update_system_point_hydro(system, points, opts, time, work, ErrStat, DO i = 1, SIZE(points) IF (opts%has_current) THEN work%fluid_velocity(:, i) = work%fluid_velocity(:, i) + & - deck_current_velocity(opts, system%points(i)%q(3), es, em) + deck_current_velocity(opts, system%points(i)%q(1:3), time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = CD_DECKDRV_BADINPUT ErrMsg = 'CableDyn_DeckDriver: point current profile failed: '//TRIM(em) @@ -30785,7 +31266,8 @@ SUBROUTINE update_system_line_hydro(system, opts, time, work, ErrStat, ErrMsg, i END IF work%fluid_velocity(:, j) = wave_velocity IF (opts%has_current) THEN - work%fluid_velocity(:, j) = work%fluid_velocity(:, j) + deck_current_velocity(opts, work%q(3*j), es, em) + work%fluid_velocity(:, j) = work%fluid_velocity(:, j) + & + deck_current_velocity(opts, work%q(3*j - 2:3*j), time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = CD_DECKDRV_BADINPUT ErrMsg = 'CableDyn_DeckDriver: system-line current profile failed: '//TRIM(em) @@ -30881,7 +31363,8 @@ SUBROUTINE update_wave_models(models, opts, time, work, ErrStat, ErrMsg, initial work%waterline(j) = eta work%fluid_velocity(:, j) = wave_velocity IF (opts%has_current) THEN - work%fluid_velocity(:, j) = work%fluid_velocity(:, j) + deck_current_velocity(opts, work%q(3*j), es, em) + work%fluid_velocity(:, j) = work%fluid_velocity(:, j) + & + deck_current_velocity(opts, work%q(3*j - 2:3*j), time, es, em) IF (es /= CD_HYDRO_OK) THEN ErrStat = CD_DECKDRV_BADINPUT ErrMsg = 'CableDyn_DeckDriver: model current profile failed: '//TRIM(em) diff --git a/src/CableDyn_HermiteCableStatic.f90 b/src/CableDyn_HermiteCableStatic.f90 index eb5c46ef..29f2b3bb 100644 --- a/src/CableDyn_HermiteCableStatic.f90 +++ b/src/CableDyn_HermiteCableStatic.f90 @@ -49,7 +49,7 @@ MODULE CableDyn_HermiteCableStatic CD_Bathymetry_Rotate_Curvature USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Drag_Element, CD_HCDYN_OK USE CableDyn_Static, ONLY: CD_Static_As_Laid_Reference, CD_STATIC_OK - USE CableDyn_Hydro, ONLY: CD_Current_Profile_Velocity, CD_HYDRO_OK + USE CableDyn_Hydro, ONLY: CD_Current_Profile_Velocity, CD_CurrentGridType, CD_Current_Grid_Velocity, CD_HYDRO_OK USE CableDyn_HermiteTorsion, ONLY: CD_HermiteTorsionType, CD_HermiteTorsion_Line, CD_HermiteTorsion_Unwrap, & CD_HermiteTorsion_Coupling_Twist, & CD_HermiteTorsion_Accept, CD_HermiteTorsion_Compliance, & @@ -159,9 +159,12 @@ MODULE CableDyn_HermiteCableStatic ! static solvers): the Morison drag of the relative velocity u_f - 0 on every element, ! through CD_HermiteCable_Drag_Element with the element fluid velocity taken as the mean ! of the current at its two nodes -- the held-field drag of the dynamic path. The current - ! is uniform (velocity) or a depth profile (profile_z, profile_velocity) sampled at the - ! iterate's node elevations. frame_cs = (cos, sin) rotates the global current into the - ! solve frame (global x = c xl - s yl, y = s xl + c yl). The section properties are given + ! is uniform (velocity), a depth profile (profile_z, profile_velocity) sampled at the + ! iterate's node elevations, or a current grid (grid, MoorDyn-C Currents 2 and 5) sampled at + ! the iterate's node positions at t = 0, the static start. frame_cs = (cos, sin) rotates the + ! global current into the solve frame (global x = c xl - s yl, y = s xl + c yl), and the solve + ! frame's node positions, shifted by origin (the solve frame's horizontal origin in the turned + ! frame, where a solve translates it), into the global ones the grid is sampled at. The section properties are given ! per reference-arc interval (arc_end, the cumulative rest length at each interval end, ! with diam/cdn/cdt), so a refined or coarsened mesh of the same line looks them up by ! its element midpoints. load_factor scales the drag load (a continuation parameter; 1 is @@ -209,9 +212,11 @@ MODULE CableDyn_HermiteCableStatic REAL(wp) :: waterline_z = 0.0_wp REAL(wp) :: velocity(3) = 0.0_wp REAL(wp) :: frame_cs(2) = [1.0_wp, 0.0_wp] + REAL(wp) :: origin(2) = [0.0_wp, 0.0_wp] ! drag = .FALSE.: a zero-velocity carrier of the as-laid seabed friction in still water LOGICAL :: drag = .TRUE. REAL(wp), ALLOCATABLE :: profile_z(:), profile_velocity(:, :) + TYPE(CD_CurrentGridType), ALLOCATABLE :: grid REAL(wp), ALLOCATABLE :: arc_end(:), diam(:), cdn(:), cdt(:) ! Seabed friction held by the line against the current (allocated: active). TYPE(CD_HermiteStaticFrictionType), ALLOCATABLE :: friction @@ -2961,7 +2966,15 @@ SUBROUTINE current_element_load(current, qe, l0e, d, cn, ct, want_jac, fd, djq, ve = CD_ZERO ! no drag on a friction-only carrier (current_element_props) IF (.NOT. current%drag) RETURN - IF (ALLOCATED(current%profile_z)) THEN + IF (ALLOCATED(current%grid)) THEN + CALL CD_Current_Grid_Velocity(current%grid, global_position(qe(1:3)), 0.0_wp, ua, es, em) + IF (es == CD_HYDRO_OK) CALL CD_Current_Grid_Velocity(current%grid, global_position(qe(7:9)), 0.0_wp, ub, & + es, em) + IF (es /= CD_HYDRO_OK) THEN + ErrStat = CD_HCSTAT_NOCONVERGE; ErrMsg = TRIM(em); RETURN + END IF + ug = 0.5_wp*(ua + ub) + ELSE IF (ALLOCATED(current%profile_z)) THEN CALL CD_Current_Profile_Velocity(qe(3), current%profile_z, current%profile_velocity, ua, es, em) IF (es == CD_HYDRO_OK) CALL CD_Current_Profile_Velocity(qe(9), current%profile_z, current%profile_velocity, & ub, es, em) @@ -2986,6 +2999,18 @@ SUBROUTINE current_element_load(current, qe, l0e, d, cn, ct, want_jac, fd, djq, END IF fd = current%load_factor*fd IF (want_jac) djq = current%load_factor*djq + + CONTAINS + + PURE FUNCTION global_position(xl) RESULT(xg) + !! The global position of a solve-frame node position xl (shifted by the frame's origin, + !! then turned back by frame_cs). + REAL(wp), INTENT(IN) :: xl(3) + REAL(wp) :: xg(3), xs(2) + xs = xl(1:2) + current%origin + xg = [current%frame_cs(1)*xs(1) - current%frame_cs(2)*xs(2), & + current%frame_cs(2)*xs(1) + current%frame_cs(1)*xs(2), xl(3)] + END FUNCTION global_position END SUBROUTINE current_element_load SUBROUTINE CD_HermiteCable_Current_Load(l0, q, current, load, ErrStat, ErrMsg) diff --git a/src/CableDyn_Hydro.f90 b/src/CableDyn_Hydro.f90 index 52d069f6..cbaae55c 100644 --- a/src/CableDyn_Hydro.f90 +++ b/src/CableDyn_Hydro.f90 @@ -26,6 +26,7 @@ MODULE CableDyn_Hydro PUBLIC :: CD_Froude_Krylov_Per_Length PUBLIC :: CD_Solve_Dispersion_Wavenumber PUBLIC :: CD_Current_Profile_Velocity + PUBLIC :: CD_CurrentGridType, CD_Current_Grid_Resample, CD_Current_Grid_Velocity PUBLIC :: CD_SeaState_Steady_Current PUBLIC :: CD_Airy_Wave_Kinematics PUBLIC :: CD_Airy_Wave_Kinematics_Precomputed @@ -61,6 +62,23 @@ MODULE CableDyn_Hydro REAL(wp), PARAMETER :: DEG2RAD = PI/180.0_wp REAL(wp), PARAMETER :: MIN_TANGENT_NORM = 1.0e-12_wp INTEGER, PARAMETER :: CD_JONSWAP_COMPONENTS = 200 + ! largest resampled current grid (nx ny nz nt samples of three velocity components) + INTEGER(INT64), PARAMETER :: MAX_CURRENT_GRID_SAMPLES = 10000000_INT64 + + ! A current tabulated on a rectilinear grid in space and time, as MoorDyn-C (v2.7.1) holds its + ! time-varying currents (moordyn::waves::CurrentGrid of source/Waves.hpp): coordinates x, y, z + ! (each strictly increasing; a single coordinate makes the current uniform along that axis) and + ! velocity(:, i, j, k, n) at (x(i), y(j), z(k)) and time (n - 1) dt, n = 1..nt. The MoorDyn-C + ! tables are resampled onto this uniform time base by CD_Current_Grid_Resample and evaluated by + ! CD_Current_Grid_Velocity, which mirror constructDynamicCurrentGrid / construct4DCurrentGrid + ! (source/Waves/WaveGrid.cpp) and CurrentGrid::getCurrentKin (source/Waves.cpp). The fluid + ! acceleration of such a current is zero, as MoorDyn-C sets it. + TYPE, PUBLIC :: CD_CurrentGridType + REAL(wp), ALLOCATABLE :: x(:), y(:), z(:) + REAL(wp) :: dt = 1.0_wp + INTEGER :: nt = 1 + REAL(wp), ALLOCATABLE :: velocity(:, :, :, :, :) + END TYPE CD_CurrentGridType CONTAINS @@ -1666,6 +1684,184 @@ SUBROUTINE CD_Current_Profile_Velocity(z, z_profile, velocity_profile, velocity, velocity = (CD_ONE - alpha)*velocity_profile(:, seg) + alpha*velocity_profile(:, seg + 1) END SUBROUTINE CD_Current_Profile_Velocity + SUBROUTINE CD_Current_Grid_Resample(x, y, z, t_in, v_in, grid, ErrStat, ErrMsg) + !! Build a current grid from velocities v_in(3, nx, ny, nz, m) tabulated at the times t_in(m), + !! as MoorDyn-C v2.7.1 does (constructDynamicCurrentGrid, construct4DCurrentGrid): the time + !! step is the smallest interval of t_in, dt = min(t_in(n+1) - t_in(n)), the grid holds + !! nt = floor(t_in(m)/dt) + 1 samples at the times (n - 1) dt from t = 0, and each sample is + !! the table interpolated linearly in time, a (1 - f) + b f, held at the end rows (the value + !! of the first row before t_in(1)). x, y, z and t_in must be strictly increasing, with at + !! least two times (MoorDyn-C reads before its table with one). + REAL(wp), INTENT(IN) :: x(:), y(:), z(:), t_in(:), v_in(:, :, :, :, :) + TYPE(CD_CurrentGridType), INTENT(OUT) :: grid + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: dt, ts, f + INTEGER(INT64) :: nt64 + INTEGER :: m, n, iu + + ErrStat = CD_HYDRO_OK + ErrMsg = '' + m = SIZE(t_in) + IF (SIZE(x) < 1 .OR. SIZE(y) < 1 .OR. SIZE(z) < 1) THEN + CALL fail(ErrStat, ErrMsg, 'current grid needs at least one x, y and z coordinate'); RETURN + END IF + IF (m < 2) THEN + CALL fail(ErrStat, ErrMsg, 'current grid needs at least two times'); RETURN + END IF + IF (SIZE(v_in, 1) /= 3 .OR. SIZE(v_in, 2) /= SIZE(x) .OR. SIZE(v_in, 3) /= SIZE(y) .OR. & + SIZE(v_in, 4) /= SIZE(z) .OR. SIZE(v_in, 5) /= m) THEN + CALL fail(ErrStat, ErrMsg, 'current grid velocities must be shaped (3, nx, ny, nz, nt)'); RETURN + END IF + IF (.NOT. (CD_All_Finite(x) .AND. CD_All_Finite(y) .AND. CD_All_Finite(z) .AND. CD_All_Finite(t_in))) THEN + CALL fail(ErrStat, ErrMsg, 'current grid coordinates and times must be finite'); RETURN + END IF + IF (.NOT. (increasing(x) .AND. increasing(y) .AND. increasing(z))) THEN + CALL fail(ErrStat, ErrMsg, 'current grid x, y and z coordinates must be strictly increasing'); RETURN + END IF + IF (.NOT. increasing(t_in)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid times must be strictly increasing'); RETURN + END IF + dt = HUGE(dt) + DO n = 2, m + IF (t_in(n) - t_in(n - 1) < dt) dt = t_in(n) - t_in(n - 1) + END DO + IF (t_in(m) < CD_ZERO) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: the last time must not be negative (MoorDyn-C samples from t = 0)') + RETURN + END IF + ! range first, without dividing by dt (a tiny dt would overflow) + IF (.NOT. (t_in(m)/REAL(MAX_CURRENT_GRID_SAMPLES, wp) < dt)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: the last time over the smallest time interval exceeds the '// & + 'sample limit'); RETURN + END IF + nt64 = FLOOR(t_in(m)/dt, KIND=INT64) + 1_INT64 + IF (nt64*INT(SIZE(x), INT64)*INT(SIZE(y), INT64)*INT(SIZE(z), INT64) > MAX_CURRENT_GRID_SAMPLES) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: more than 1e7 resampled space-time samples; coarsen the grid or '// & + 'its smallest time interval'); RETURN + END IF + IF (.NOT. CD_All_Finite(RESHAPE(v_in, [SIZE(v_in)]))) THEN + CALL fail(ErrStat, ErrMsg, 'current grid velocities must be finite'); RETURN + END IF + grid%x = x + grid%y = y + grid%z = z + grid%dt = dt + grid%nt = INT(nt64) + ALLOCATE (grid%velocity(3, SIZE(x), SIZE(y), SIZE(z), grid%nt)) + DO n = 1, grid%nt + ts = REAL(n - 1, wp)*dt + CALL grid_factor(t_in, ts, iu, f) + grid%velocity(:, :, :, :, n) = v_in(:, :, :, :, iu - 1)*(CD_ONE - f) + v_in(:, :, :, :, iu)*f + END DO + + CONTAINS + + LOGICAL FUNCTION increasing(c) + REAL(wp), INTENT(IN) :: c(:) + INTEGER :: k + increasing = .TRUE. + DO k = 2, SIZE(c) + IF (.NOT. c(k) > c(k - 1)) increasing = .FALSE. + END DO + END FUNCTION increasing + END SUBROUTINE CD_Current_Grid_Resample + + SUBROUTINE CD_Current_Grid_Velocity(grid, pos, time, velocity, ErrStat, ErrMsg) + !! The current of a grid at pos and time, as MoorDyn-C v2.7.1 evaluates it + !! (CurrentGrid::getCurrentKin with interp_factor and interp4Vec, source/Util/Interp.hpp): + !! - in x, y and z, linear between the bracketing coordinates and held beyond the end ones, + !! the node elevation taken as it is (no stretching); + !! - in time, with q = time/dt, n = floor(q) and f = q - n, the samples n and n + 1 + !! (0-based) blended a (1 - f) + b f, the upper index taken modulo nt: past the last sample + !! the grid repeats with period nt dt, and over [(nt - 1) dt, nt dt) of each period it holds + !! the first sample (both indices are 0 there); + !! - blended in time at the 8 corners first, then in x, y and z, in MoorDyn-C's order. + !! A time before 0 takes the t = 0 sample (MoorDyn-C's runs start at t = 0). + TYPE(CD_CurrentGridType), INTENT(IN) :: grid + REAL(wp), INTENT(IN) :: pos(3), time + REAL(wp), INTENT(OUT) :: velocity(3) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: fx, fy, fz, ft, q + REAL(wp) :: c000(3), c001(3), c010(3), c011(3), c100(3), c101(3), c110(3), c111(3) + REAL(wp) :: c00(3), c01(3), c10(3), c11(3), c0(3), c1(3) + INTEGER :: ix, iy, iz, ix0, iy0, iz0, it, it0 + INTEGER(INT64) :: n + + velocity = CD_ZERO + ErrStat = CD_HYDRO_OK + ErrMsg = '' + IF (.NOT. (CD_All_Finite(pos) .AND. CD_Is_Finite(time))) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: position and time must be finite'); RETURN + END IF + IF (.NOT. ALLOCATED(grid%velocity)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid is not set'); RETURN + END IF + CALL grid_factor(grid%x, pos(1), ix, fx) + CALL grid_factor(grid%y, pos(2), iy, fy) + CALL grid_factor(grid%z, pos(3), iz, fz) + ! 1-based upper (it) and lower (it0) time samples + it = 1 + ft = CD_ZERO + IF (grid%nt > 1) THEN + ! range first, without dividing by dt + IF (.NOT. MAX(time, CD_ZERO)/1.0e18_wp < grid%dt) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: time beyond 1e18 grid time steps'); RETURN + END IF + q = MAX(time, CD_ZERO)/grid%dt + n = FLOOR(q, KIND=INT64) + ft = q - REAL(n, wp) + it = INT(MOD(n + 1_INT64, INT(grid%nt, INT64))) + 1 + END IF + it0 = MAX(it - 1, 1) + ix0 = MAX(ix - 1, 1) + iy0 = MAX(iy - 1, 1) + iz0 = MAX(iz - 1, 1) + c000 = grid%velocity(:, ix0, iy0, iz0, it0)*(CD_ONE - ft) + grid%velocity(:, ix0, iy0, iz0, it)*ft + c001 = grid%velocity(:, ix0, iy0, iz, it0)*(CD_ONE - ft) + grid%velocity(:, ix0, iy0, iz, it)*ft + c010 = grid%velocity(:, ix0, iy, iz0, it0)*(CD_ONE - ft) + grid%velocity(:, ix0, iy, iz0, it)*ft + c011 = grid%velocity(:, ix0, iy, iz, it0)*(CD_ONE - ft) + grid%velocity(:, ix0, iy, iz, it)*ft + c100 = grid%velocity(:, ix, iy0, iz0, it0)*(CD_ONE - ft) + grid%velocity(:, ix, iy0, iz0, it)*ft + c101 = grid%velocity(:, ix, iy0, iz, it0)*(CD_ONE - ft) + grid%velocity(:, ix, iy0, iz, it)*ft + c110 = grid%velocity(:, ix, iy, iz0, it0)*(CD_ONE - ft) + grid%velocity(:, ix, iy, iz0, it)*ft + c111 = grid%velocity(:, ix, iy, iz, it0)*(CD_ONE - ft) + grid%velocity(:, ix, iy, iz, it)*ft + c00 = c000*(CD_ONE - fx) + c100*fx + c01 = c001*(CD_ONE - fx) + c101*fx + c10 = c010*(CD_ONE - fx) + c110*fx + c11 = c011*(CD_ONE - fx) + c111*fx + c0 = c00*(CD_ONE - fy) + c10*fy + c1 = c01*(CD_ONE - fy) + c11*fy + velocity = c0*(CD_ONE - fz) + c1*fz + END SUBROUTINE CD_Current_Grid_Velocity + + PURE SUBROUTINE grid_factor(xp, x, iu, f) + !! MoorDyn-C's interp_factor (source/Util/Interp.hpp) on 1-based coordinates xp: the upper + !! bracketing index iu and the factor f of the blend a (1 - f) + b f between xp(iu - 1) and + !! xp(iu): iu = 1, f = 0 for a single coordinate; iu = 2, f = 0 at or below xp(1); iu = n, + !! f = 1 at or above xp(n); else the first iu with x <= xp(iu). + REAL(wp), INTENT(IN) :: xp(:), x + INTEGER, INTENT(OUT) :: iu + REAL(wp), INTENT(OUT) :: f + INTEGER :: n, i + n = SIZE(xp) + iu = 1 + f = CD_ZERO + IF (n == 1) RETURN + iu = 2 + IF (x <= xp(1)) RETURN + iu = n + f = CD_ONE + IF (x >= xp(n)) RETURN + DO i = 2, n + IF (x <= xp(i)) THEN + iu = i + f = (x - xp(i - 1))/(xp(i) - xp(i - 1)) + RETURN + END IF + END DO + END SUBROUTINE grid_factor + SUBROUTINE CD_JONSWAP_Wave_Kinematics(x, y, z, t, hs, tp, gamma, depth, gravity, direction_deg, & stretch, eta, velocity, acceleration, ErrStat, ErrMsg) !! Evaluate deterministic irregular-wave kinematics from a discretized diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index c3a75606..ce916d57 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -47,7 +47,7 @@ MODULE CableDyn_Model USE CableDyn_Syrope, ONLY: CD_SyropeType, CD_Syrope_Init, CD_Syrope_End, CD_Syrope_Is_Ready, & CD_Syrope_Working_Curve, CD_Syrope_Rate_And_Tension, CD_Syrope_Branch_Divider, & CD_Syrope_Element_Load, CD_Syrope_Check_Range, CD_SYROPE_OK, CD_SYROPE_NWC - USE CableDyn_Hydro, ONLY: CD_Cable_Morison_Drag_Load, CD_Cable_Morison_Drag_Force, & + USE CableDyn_Hydro, ONLY: CD_CurrentGridType, CD_Cable_Morison_Drag_Load, CD_Cable_Morison_Drag_Force, & CD_Morison_Drag_Element_Load, CD_Morison_Drag_Element_Force, & CD_Cable_Froude_Krylov_Load, CD_Cable_Froude_Krylov_Force, & CD_Froude_Krylov_Element_Load, CD_Froude_Krylov_Element_Force, & @@ -1468,7 +1468,7 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra ve_ea_d, ve_ba, ve_ba_d, ve_alpha_mbl, ve_vbeta, & syrope_is, syrope_type, syrope_slow0, syrope_tmax0, & current_profile_z, current_profile_velocity, & - static_friction, lay_azimuth, as_laid_tension) + static_friction, lay_azimuth, as_laid_tension, current_grid) !! Initialise a persistent EI=0 dynamic model from an OrcaFlex-style line object: !! line types + sections + end points. This routine builds the mesh, assembles !! submerged-weight loads, obtains a static initial condition by load continuation, @@ -1541,6 +1541,9 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra ! then samples the current at each node's own elevation, as the dynamic march does, so the ! march starts from rest. Without it the static drag uses fluid_velocity as given. REAL(wp), INTENT(IN), OPTIONAL :: current_profile_z(:), current_profile_velocity(:, :) + ! A current grid in space and time (MoorDyn-C Currents 2 and 5): the static initial condition + ! then samples it at each node's own position at t = 0, in place of the depth profile. + TYPE(CD_CurrentGridType), INTENT(IN), OPTIONAL :: current_grid ! Static seabed friction (with seabed_mu > 0 on a seabed): the policy ! (CD_STATIC_FRICTION_AS_LAID or CD_STATIC_FRICTION_NONE, the default), the lay azimuth ! [rad, from global +x toward +y; default: the horizontal direction of the chord from @@ -1744,6 +1747,9 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra cur%profile_z = current_profile_z cur%profile_velocity = current_profile_velocity END IF + IF (PRESENT(current_grid)) THEN + ALLOCATE (cur%grid, SOURCE=current_grid) + END IF IF (PRESENT(drag_waterline_z)) cur%node_waterline = drag_waterline_z ! Without the as-laid policy a frictional seabed holds the line against the current ! from its still-water laid shape: solve the line without the current first; that diff --git a/src/CableDyn_Static.f90 b/src/CableDyn_Static.f90 index e3e1af9d..439d67cf 100644 --- a/src/CableDyn_Static.f90 +++ b/src/CableDyn_Static.f90 @@ -33,7 +33,7 @@ MODULE CableDyn_Static USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Bathymetry_Is_Initialized, & CD_Bathymetry_Floor_Gradient, CD_BATHY_OK USE CableDyn_Hydro, ONLY: CD_Cable_Morison_Drag_Force, CD_Morison_Drag_Element_Load, CD_Current_Profile_Velocity, & - CD_HYDRO_OK + CD_CurrentGridType, CD_Current_Grid_Velocity, CD_HYDRO_OK USE CableDyn_Linalg, ONLY: CD_Solve_Banded USE CableDyn_Mesh, ONLY: CD_Partition_Free_Dofs USE CableDyn_Catenary, ONLY: CD_Catenary_Seed, CD_CAT_OK @@ -90,6 +90,11 @@ MODULE CableDyn_Static ! residual evaluation (the dynamic march samples it at the actual node depths too), so the ! static state is an equilibrium of the marched model. It replaces node_velocity/velocity. REAL(wp), ALLOCATABLE :: profile_z(:), profile_velocity(:, :) + ! A current grid in space and time (MoorDyn-C Currents 2 and 5, CD_CurrentGridType): when + ! allocated, each node's current is its value at the node's own position at t = 0 (the + ! static start), re-sampled in every residual evaluation like the depth profile, which it + ! replaces. + TYPE(CD_CurrentGridType), ALLOCATABLE :: grid ! drag = .FALSE.: the object carries only the static seabed friction below (a line in ! still water); the drag fields are then ignored and need not be set. LOGICAL :: drag = .TRUE. @@ -397,8 +402,8 @@ SUBROUTINE CD_Static_Cable_Solve(q0, elem_conn, l0, ea, tension_only, f_ext, fix fluidvel(:, k) = current%velocity END DO END IF - profile_active = ALLOCATED(current%profile_z) - IF (profile_active) THEN + profile_active = ALLOCATED(current%profile_z) .OR. ALLOCATED(current%grid) + IF (profile_active .AND. .NOT. ALLOCATED(current%grid)) THEN IF (.NOT. ALLOCATED(current%profile_velocity)) THEN CALL fail(ErrStat, ErrMsg, 'current profile_z requires profile_velocity') RETURN @@ -408,6 +413,8 @@ SUBROUTINE CD_Static_Cable_Solve(q0, elem_conn, l0, ea, tension_only, f_ext, fix CALL fail(ErrStat, ErrMsg, 'current profile_velocity must have shape (3, SIZE(profile_z))') RETURN END IF + END IF + IF (profile_active) THEN CALL sample_profile(q0, es, em) IF (es /= CD_HYDRO_OK) THEN CALL fail(ErrStat, ErrMsg, 'current profile: '//TRIM(em)) @@ -972,13 +979,21 @@ SUBROUTINE add_friction(qe, f_contact, add_tangent, node, normal, dnormal_dz) END SUBROUTINE add_friction SUBROUTINE sample_profile(qe, es_out, em_out) - !! Current of every node at its own elevation in state qe (depth-profile current). + !! Current of every node at its own elevation in state qe (depth-profile current), or at + !! its own position at t = 0 (current grid). REAL(wp), INTENT(IN) :: qe(:) INTEGER, INTENT(OUT) :: es_out CHARACTER(*), INTENT(OUT) :: em_out INTEGER :: i es_out = CD_HYDRO_OK em_out = '' + IF (ALLOCATED(current%grid)) THEN + DO i = 1, n_nodes + CALL CD_Current_Grid_Velocity(current%grid, qe(3*i - 2:3*i), CD_ZERO, fluidvel(:, i), es_out, em_out) + IF (es_out /= CD_HYDRO_OK) RETURN + END DO + RETURN + END IF DO i = 1, n_nodes CALL CD_Current_Profile_Velocity(qe(3*i), current%profile_z, current%profile_velocity, fluidvel(:, i), & es_out, em_out) @@ -2532,7 +2547,14 @@ SUBROUTINE CD_Static_Line_End_Forces(q, elem_conn, l0, ea, f_ext, tension_only, a = elem_conn(1, e) b = elem_conn(2, e) IF (.NOT. (ANY(ends == a) .OR. ANY(ends == b))) CYCLE - IF (ALLOCATED(current%profile_z) .AND. ALLOCATED(current%profile_velocity)) THEN + IF (ALLOCATED(current%grid)) THEN + CALL CD_Current_Grid_Velocity(current%grid, q(3*a - 2:3*a), CD_ZERO, va, es, em) + IF (es == CD_HYDRO_OK) CALL CD_Current_Grid_Velocity(current%grid, q(3*b - 2:3*b), CD_ZERO, vb, es, em) + IF (es /= CD_HYDRO_OK) THEN + CALL fail(ErrStat, ErrMsg, 'end forces: '//TRIM(em)) + RETURN + END IF + ELSE IF (ALLOCATED(current%profile_z) .AND. ALLOCATED(current%profile_velocity)) THEN CALL CD_Current_Profile_Velocity(q(3*a), current%profile_z, current%profile_velocity, va, es, em) IF (es == CD_HYDRO_OK) CALL CD_Current_Profile_Velocity(q(3*b), current%profile_z, & current%profile_velocity, vb, es, em) diff --git a/tests/data/currents_mdc/c1/current_profile.txt b/tests/data/currents_mdc/c1/current_profile.txt new file mode 100644 index 00000000..6440dce8 --- /dev/null +++ b/tests/data/currents_mdc/c1/current_profile.txt @@ -0,0 +1,14 @@ +--------------------- MoorDyn steady currents File ---------------------------------- +Tabulated file with the water currents components +z (m), ux (m/s), uy (m/s), uz (m/s) +-50.0 0.2 -0.1 0.0 +-45.0 0.22 -0.0995 0.001 +-40.0 0.24000000000000002 -0.098 0.002 +-35.0 0.26 -0.0955 0.003 +-30.0 0.28 -0.092 0.004 +-25.0 0.30000000000000004 -0.08750000000000001 0.005 +-20.0 0.32 -0.082 0.006 +-15.0 0.34 -0.07550000000000001 0.007 +-10.0 0.36 -0.068 0.008 +-5.0 0.38 -0.0595 0.009000000000000001 +0.0 0.4 -0.05 0.01 diff --git a/tests/data/currents_mdc/c1/currents.dat b/tests/data/currents_mdc/c1/currents.dat new file mode 100644 index 00000000..80f43806 --- /dev/null +++ b/tests/data/currents_mdc/c1/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 1): steady profile +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +10.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +1 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c1/points.txt b/tests/data/currents_mdc/c1/points.txt new file mode 100644 index 00000000..8fd9d0fe --- /dev/null +++ b/tests/data/currents_mdc/c1/points.txt @@ -0,0 +1,45 @@ +0.0 3.625747096391059 1.204796483183113 -61.0 +0.0 29.240222818749317 -9.25239045413613 -50.0 +0.0 23.46046359355391 1.8229666122879866 -47.5 +0.0 -19.043779590969727 -4.599139224969835 -33.3 +0.0 -12.856308645593106 -1.749412098253556 -30.0 +0.0 38.36488703383566 -7.038199728668184 -12.3 +0.0 -33.361464723920776 -4.316260942636896 -2.0 +0.0 13.865936011298075 8.422021827334497 0.0 +0.0 -4.702829992963025 -1.6717186681526446 1.5 +0.5 -14.07536799232922 9.54041437133462 -61.0 +0.5 -1.266200937440189 -2.1387238980221905 -50.0 +0.5 21.991887387430154 -6.313315647241533 -47.5 +0.5 9.065590048206033 -3.9266969732113344 -33.3 +0.5 32.59611361428382 -2.471527225465257 -30.0 +0.5 8.548136741557208 7.73235531958516 -12.3 +0.5 10.767468921776384 -9.901710084464543 -2.0 +0.5 33.170979663189556 -6.387110542603544 0.0 +0.5 -18.832109881530876 1.3939569631943698 1.5 +3.0 -23.84629742780436 -7.411284659684765 -61.0 +3.0 16.2776411086751 -7.986057426728303 -50.0 +3.0 -1.5453992830454126 -8.544058084292184 -47.5 +3.0 33.748083410629704 -2.1145711101399893 -33.3 +3.0 7.1129995867811076 8.077716999122323 -30.0 +3.0 -21.206744257784713 -8.287889299555204 -12.3 +3.0 19.018417993166082 8.575850333694412 -2.0 +3.0 -34.24034673398577 9.933110274458684 0.0 +3.0 -31.67357968747993 -1.3198406078312601 1.5 +7.7 -18.474195005654472 -5.552630906546348 -61.0 +7.7 -14.846582951132675 6.974335055539811 -50.0 +7.7 7.399286028033458 -4.889381691061896 -47.5 +7.7 26.668381073668257 0.43097649083227907 -33.3 +7.7 -23.89846830191276 0.7687996394637064 -30.0 +7.7 -18.75050881328726 8.739373633670333 -12.3 +7.7 26.194471802351387 2.9173305077171037 -2.0 +7.7 -33.4763574363689 9.123955477562177 0.0 +7.7 16.227574118222492 6.727258469164298 1.5 +10.0 -2.3242607964400293 -6.98799947972778 -61.0 +10.0 25.87157786708798 -9.163031820079166 -50.0 +10.0 26.779122526321913 4.0438763545298855 -47.5 +10.0 -10.986895134543175 6.050656948172406 -33.3 +10.0 37.52443736070754 8.039683536558893 -30.0 +10.0 -11.120433344512115 -3.612516949673248 -12.3 +10.0 16.37635004074521 -2.4287988814413364 -2.0 +10.0 -25.014363736779465 -8.657988727363897 0.0 +10.0 -33.30484432612042 4.748403474389418 1.5 diff --git a/tests/data/currents_mdc/c1/ref_moordyn_c.csv b/tests/data/currents_mdc/c1/ref_moordyn_c.csv new file mode 100644 index 00000000..0a8e60f0 --- /dev/null +++ b/tests/data/currents_mdc/c1/ref_moordyn_c.csv @@ -0,0 +1,46 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,3.6257470963910592,1.2047964831831131,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,29.240222818749317,-9.2523904541361297,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,23.460463593553911,1.8229666122879866,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0,-19.043779590969727,-4.5991392249698348,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0,-12.856308645593106,-1.7494120982535559,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0,38.364887033835657,-7.0381997286681841,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0,-33.361464723920776,-4.3162609426368963,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0,13.865936011298075,8.4220218273344969,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0,-4.7028299929630251,-1.6717186681526446,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.49999999999999994,-14.07536799232922,9.5404143713346201,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,-1.266200937440189,-2.1387238980221905,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,21.991887387430154,-6.3133156472415326,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0.5,9.0655900482060332,-3.9266969732113344,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0.5,32.596113614283823,-2.4715272254652572,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0.5,8.548136741557208,7.7323553195851602,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0.5,10.767468921776384,-9.9017100844645434,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0.5,33.170979663189556,-6.3871105426035442,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-18.832109881530876,1.3939569631943698,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +2.9999999999998335,-23.846297427804359,-7.4112846596847648,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,16.277641108675098,-7.9860574267283031,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,-1.5453992830454126,-8.5440580842921836,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +3,33.748083410629704,-2.1145711101399893,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +3,7.1129995867811076,8.0777169991223232,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +3,-21.206744257784713,-8.2878892995552036,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +3,19.018417993166082,8.5758503336944116,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +3,-34.240346733985767,9.9331102744586843,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-31.673579687479929,-1.3198406078312601,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000014222,-18.474195005654472,-5.5526309065463479,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000014222,-14.846582951132675,6.9743350555398109,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000014222,7.3992860280334583,-4.8893816910618959,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +7.7000000000014222,26.668381073668257,0.43097649083227907,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +7.7000000000014222,-23.898468301912761,0.76879963946370644,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +7.7000000000014222,-18.750508813287261,8.7393736336703327,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +7.7000000000014222,26.194471802351387,2.9173305077171037,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +7.7000000000014222,-33.4763574363689,9.123955477562177,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000014222,16.227574118222492,6.7272584691642976,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +9.9999999999990248,-2.3242607964400293,-6.9879994797277796,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,25.871577867087979,-9.1630318200791656,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,26.779122526321913,4.0438763545298855,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +10,-10.986895134543175,6.0506569481724064,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +10,37.524437360707537,8.0396835365588935,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +10,-11.120433344512115,-3.6125169496732479,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +10,16.376350040745209,-2.4287988814413364,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +10,-25.014363736779465,-8.6579887273638967,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-33.304844326120417,4.7484034743894181,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 diff --git a/tests/data/currents_mdc/c1/ref_python.csv b/tests/data/currents_mdc/c1/ref_python.csv new file mode 100644 index 00000000..cc47eeef --- /dev/null +++ b/tests/data/currents_mdc/c1/ref_python.csv @@ -0,0 +1,46 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,3.6257470963910592,1.2047964831831131,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,29.240222818749317,-9.2523904541361297,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,23.460463593553911,1.8229666122879866,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0,-19.043779590969727,-4.5991392249698348,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0,-12.856308645593106,-1.7494120982535559,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0,38.364887033835657,-7.0381997286681841,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0,-33.361464723920776,-4.3162609426368963,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0,13.865936011298075,8.4220218273344969,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0,-4.7028299929630251,-1.6717186681526446,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-14.07536799232922,9.5404143713346201,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,-1.266200937440189,-2.1387238980221905,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,21.991887387430154,-6.3133156472415326,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0.5,9.0655900482060332,-3.9266969732113344,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0.5,32.596113614283823,-2.4715272254652572,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0.5,8.548136741557208,7.7323553195851602,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0.5,10.767468921776384,-9.9017100844645434,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0.5,33.170979663189556,-6.3871105426035442,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-18.832109881530876,1.3939569631943698,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-23.846297427804359,-7.4112846596847648,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,16.277641108675098,-7.9860574267283031,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,-1.5453992830454126,-8.5440580842921836,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +3,33.748083410629704,-2.1145711101399893,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +3,7.1129995867811076,8.0777169991223232,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +3,-21.206744257784713,-8.2878892995552036,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +3,19.018417993166082,8.5758503336944116,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +3,-34.240346733985767,9.9331102744586843,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-31.673579687479929,-1.3198406078312601,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000000002,-18.474195005654472,-5.5526309065463479,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000000002,-14.846582951132675,6.9743350555398109,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000000002,7.3992860280334583,-4.8893816910618959,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +7.7000000000000002,26.668381073668257,0.43097649083227907,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +7.7000000000000002,-23.898468301912761,0.76879963946370644,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +7.7000000000000002,-18.750508813287261,8.7393736336703327,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +7.7000000000000002,26.194471802351387,2.9173305077171037,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +7.7000000000000002,-33.4763574363689,9.123955477562177,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000000002,16.227574118222492,6.7272584691642976,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-2.3242607964400293,-6.9879994797277796,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,25.871577867087979,-9.1630318200791656,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,26.779122526321913,4.0438763545298855,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +10,-10.986895134543175,6.0506569481724064,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +10,37.524437360707537,8.0396835365588935,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +10,-11.120433344512115,-3.6125169496732479,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +10,16.376350040745209,-2.4287988814413364,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +10,-25.014363736779465,-8.6579887273638967,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-33.304844326120417,4.7484034743894181,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 diff --git a/tests/data/currents_mdc/c2/current_profile_dynamic.txt b/tests/data/currents_mdc/c2/current_profile_dynamic.txt new file mode 100644 index 00000000..8e9e922f --- /dev/null +++ b/tests/data/currents_mdc/c2/current_profile_dynamic.txt @@ -0,0 +1,11 @@ +--------------------- MoorDyn dynamic currents File ---------------------------------- +a depth profile that varies in time (uneven times) + +header line 4 + -50.0 -30.0 -12.5 -5.0 0.0 +time ux... uy... uz... +0.0 0.000000 0.603832 0.838656 0.939295 1.006387 0.000000 0.210000 0.175000 0.160000 0.150000 0.000000 -0.000000 -0.000000 -0.000000 0.000000 +4.0 0.433036 0.779465 1.082590 1.212501 1.299108 0.216636 0.176636 0.141636 0.126636 0.116636 0.005440 0.002794 -0.005985 -0.008415 0.000000 +7.0 0.459627 0.827328 1.149067 1.286955 1.378881 0.155749 0.115749 0.080749 0.065749 0.055749 0.009756 0.008797 0.009436 -0.009840 0.000000 +15.0 0.353575 0.636435 0.883938 0.990010 1.060725 -0.024508 -0.064508 -0.099508 -0.114508 -0.124508 0.001978 0.004872 -0.000498 0.005716 0.000000 +30.0 0.517385 0.931293 1.293462 1.448678 1.552155 0.156697 0.116697 0.081697 0.066697 0.056697 0.003878 -0.008509 0.000994 -0.009380 0.000000 diff --git a/tests/data/currents_mdc/c2/currents.dat b/tests/data/currents_mdc/c2/currents.dat new file mode 100644 index 00000000..3386698a --- /dev/null +++ b/tests/data/currents_mdc/c2/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 2): time-varying profile +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +72.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +2 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c2/points.txt b/tests/data/currents_mdc/c2/points.txt new file mode 100644 index 00000000..0da5d957 --- /dev/null +++ b/tests/data/currents_mdc/c2/points.txt @@ -0,0 +1,170 @@ +0.0 -7.02274407112499 5.111191447569773 -70.0 +0.0 31.485198909702078 -2.714340560540456 -50.0 +0.0 -20.809732103447978 -0.11709455529188517 -41.0 +0.0 39.37280373726867 8.147073783375749 -30.0 +0.0 22.655718499009495 9.007258842943656 -20.0 +0.0 -18.7537186637282 -6.33128609556366 -12.5 +0.0 -12.854524951559121 -9.226121975251093 -7.3 +0.0 -14.582842600996724 9.948139588388933 -1.0 +0.0 36.632586546811126 8.810295057781655 0.0 +0.0 -29.96197077630681 -7.427336525682544 2.0 +0.7 -28.02076086210656 -6.523047821498196 -70.0 +0.7 -36.14628172153602 -9.284919940469585 -50.0 +0.7 3.3553280663774103 -4.097783379274052 -41.0 +0.7 -31.972033235176774 5.452151169515091 -30.0 +0.7 34.37959677019529 -8.721812201917752 -20.0 +0.7 11.16126785635651 2.5043531721859065 -12.5 +0.7 -29.348708093264236 0.9562592119631503 -7.3 +0.7 -22.203587385333094 -2.037888397728058 -1.0 +0.7 18.190400780927327 7.693202911420261 0.0 +0.7 -24.12915133518095 1.4288192371581143 2.0 +2.9999 -22.69698324330357 4.7645721603939695 -70.0 +2.9999 29.60912871286267 -4.595171802377718 -50.0 +2.9999 25.618852234935133 7.654491368813606 -41.0 +2.9999 10.53684893278772 -6.745087112276895 -30.0 +2.9999 -20.11730365275597 -8.15528754041507 -20.0 +2.9999 28.877993020518687 3.6868449410257362 -12.5 +2.9999 34.88947203636303 -8.649918397237435 -7.3 +2.9999 -17.050722524734745 6.410433238769084 -1.0 +2.9999 -16.690651040342416 -9.102290200816356 0.0 +2.9999 9.341015495959546 -0.6708157716698366 2.0 +3.0 -10.836166288895548 -2.811508683337676 -70.0 +3.0 16.77544370038276 -6.71317237580249 -50.0 +3.0 15.42782093757721 9.244832796080779 -41.0 +3.0 7.630055290347471 -3.3308172468554282 -30.0 +3.0 -27.412426819126992 9.635807381611084 -20.0 +3.0 17.20368294581285 6.804029695690261 -12.5 +3.0 -38.99039508391235 -8.600796918063523 -7.3 +3.0 -29.23184990330986 7.16677430254904 -1.0 +3.0 -35.203358965445574 -9.06927555629794 0.0 +3.0 -36.116039280277235 -3.882238256345685 2.0 +4.4 1.1124388464913793 5.20525876471501 -70.0 +4.4 34.909765359536976 4.649206520776003 -50.0 +4.4 33.38247618905423 6.2852042478643355 -41.0 +4.4 21.11808898951169 7.146451792665914 -30.0 +4.4 -16.79152348675787 1.797590082510812 -20.0 +4.4 7.904121174278195 -0.05464630281863947 -12.5 +4.4 38.84417503848353 7.184393131716664 -7.3 +4.4 -8.721368622618133 2.939017904926253 -1.0 +4.4 -31.500770648871857 -4.191686418096204 0.0 +4.4 -31.018717744515953 4.28736024868326 2.0 +6.99 25.984579991006967 6.148921133070914 -70.0 +6.99 25.581854432298712 9.711080199082648 -50.0 +6.99 36.400293065186446 -6.478819272190939 -41.0 +6.99 -16.131052630013 -9.933801481428981 -30.0 +6.99 11.949152372833652 -0.6496388177203514 -20.0 +6.99 1.7948777433545473 1.053663708101407 -12.5 +6.99 -5.967658939612022 -1.1771128513667843 -7.3 +6.99 24.096936358151595 3.474822206122692 -1.0 +6.99 34.277818838471035 0.919347914896818 0.0 +6.99 29.82452168463881 -6.78566161845475 2.0 +10.1 -38.71377810637341 -2.6909196691918824 -70.0 +10.1 21.585287827692134 -1.5231418564411054 -50.0 +10.1 33.277869171065134 -8.813343938797555 -41.0 +10.1 33.31326330797876 2.9080081138450176 -30.0 +10.1 -4.615604223592669 5.469048364129481 -20.0 +10.1 14.431288479807982 -6.086644825390774 -12.5 +10.1 -22.287438378876743 -5.993156351656794 -7.3 +10.1 24.79879938034503 -3.9029596822975527 -1.0 +10.1 -22.749879023039252 8.395813095968222 0.0 +10.1 22.027009649720995 1.515237560299898 2.0 +15.0 13.876708886608398 0.7419805953356473 -70.0 +15.0 -2.7469521472092566 -3.5314995308744734 -50.0 +15.0 29.646585258486994 9.962368830173471 -41.0 +15.0 37.053032151947576 9.81812850654958 -30.0 +15.0 21.02986346698144 -5.0995662461400215 -20.0 +15.0 32.84519682282985 -2.3039314011475254 -12.5 +15.0 36.13609205407985 7.003867378567644 -7.3 +15.0 -11.799015997376479 9.143553865208155 -1.0 +15.0 -13.440509756587147 3.6347630909713775 0.0 +15.0 0.9221939903324099 -3.9009838610955754 2.0 +22.2 36.86710835794585 4.323452802889294 -70.0 +22.2 -32.32894301793878 -1.8016757645856387 -50.0 +22.2 -35.80139720077473 -5.159978650043689 -41.0 +22.2 -26.22368089792042 8.239591500764341 -30.0 +22.2 23.990432529791548 4.278286793812818 -20.0 +22.2 2.887023810869664 6.482848982697266 -12.5 +22.2 32.434164811981134 -7.850777221993363 -7.3 +22.2 27.646650826375748 6.677775432800441 -1.0 +22.2 0.7439691736044267 5.562222983029244 0.0 +22.2 25.152845672099858 7.842833299939155 2.0 +27.0 34.17743485462587 5.976624160118602 -70.0 +27.0 22.493094807101244 -0.3077505481058491 -50.0 +27.0 25.88581939047276 -5.8243899747383665 -41.0 +27.0 -28.483027801526923 -9.30702194503688 -30.0 +27.0 9.021346610391355 -3.454486553556011 -20.0 +27.0 -7.8579344021051085 4.308805042569695 -12.5 +27.0 3.846277922265557 2.544877826817034 -7.3 +27.0 18.177235829689387 4.683102526838535 -1.0 +27.0 -0.7580107998057599 -8.798399170974848 0.0 +27.0 21.20569224848559 -8.59787987749832 2.0 +29.9 1.406890943436487 -8.376998968552357 -70.0 +29.9 35.73493492274133 1.1619742971977622 -50.0 +29.9 37.799493650061336 0.41397227450426044 -41.0 +29.9 20.183925874373905 1.0212616773877166 -30.0 +29.9 -17.81588963423217 -1.0721355449493082 -20.0 +29.9 10.672238679317502 -7.289743184122948 -12.5 +29.9 -26.973218729797495 0.3614691414785991 -7.3 +29.9 37.135747505861445 -5.539721977770158 -1.0 +29.9 14.740809994223198 9.11256286402461 0.0 +29.9 -11.677147320143256 -9.247415795948292 2.0 +30.0 -8.650754310000881 9.16934613710388 -70.0 +30.0 -21.52834483255002 -2.4498442073934967 -50.0 +30.0 -37.91365942204985 1.7869178293190444 -41.0 +30.0 8.448105983536863 -0.7104286343268011 -30.0 +30.0 -10.984575041640863 -1.482566812128896 -20.0 +30.0 17.47171695947599 -3.3085417618235073 -12.5 +30.0 -9.969297911143286 6.476991369519826 -7.3 +30.0 19.28656187456903 -9.71700139622218 -1.0 +30.0 26.75939860221601 -2.596169523828566 0.0 +30.0 -27.572206265855908 -8.028149162705635 2.0 +31.5 12.32596528400471 -4.333836550439541 -70.0 +31.5 13.765699540806267 -1.3972193507397392 -50.0 +31.5 30.07191375299493 -0.2767730234363128 -41.0 +31.5 19.43154862585076 -9.795994592560435 -30.0 +31.5 -28.793376785410032 -8.456781239044686 -20.0 +31.5 -36.30974966959437 4.593534942927555 -12.5 +31.5 -2.239900235497096 0.13376092702809217 -7.3 +31.5 -23.449608268622228 2.8363753799615417 -1.0 +31.5 37.40950389700063 4.018053153001375 0.0 +31.5 -29.032706522727636 -0.2497391911787421 2.0 +33.0 -39.85412472901931 3.8768432788161906 -70.0 +33.0 17.684325638275766 3.5714735876826005 -50.0 +33.0 -0.4594188146910767 6.52802352390988 -41.0 +33.0 38.256746798218416 -3.2436924925503297 -30.0 +33.0 -27.521341499367054 -2.7390553415641 -20.0 +33.0 -12.987076895057115 -7.1632817430584605 -12.5 +33.0 -12.696516486637286 -6.258068783689041 -7.3 +33.0 -15.027932615069012 -1.6160955882136356 -1.0 +33.0 -30.393098056862947 -6.300330717877102 0.0 +33.0 17.451886515299904 -7.455914823927974 2.0 +35.2 -12.175965967280263 6.783113370124319 -70.0 +35.2 4.618081470479673 0.8154909897060758 -50.0 +35.2 35.55926111218679 4.137211499995836 -41.0 +35.2 -5.401121673640503 9.606615354240503 -30.0 +35.2 -12.10973856338616 0.03748479100456059 -20.0 +35.2 11.75197738317857 -9.52412923600807 -12.5 +35.2 21.03837088156746 3.5302548364859625 -7.3 +35.2 -15.973711330369085 3.4445876816223553 -1.0 +35.2 -20.73709617203651 -6.918272024152479 0.0 +35.2 24.68259701174533 2.2417909878109477 2.0 +40.0 -28.53669579612899 -4.9250282768244125 -70.0 +40.0 -37.79487475670331 -3.100688797868414 -50.0 +40.0 -34.489431309685216 0.3955085003395453 -41.0 +40.0 -22.625244513000098 -1.5039685698797065 -30.0 +40.0 -8.384812969166795 -6.875514272293152 -20.0 +40.0 -24.046467454115312 9.193786772436233 -12.5 +40.0 -7.158361636532753 -9.175947291231326 -7.3 +40.0 -37.56341961594708 -7.950113084987189 -1.0 +40.0 16.627586727950444 -1.701836685221103 0.0 +40.0 -20.29979488321547 2.246366688187342 2.0 +70.3 -27.25943988546411 1.3303422268762404 -70.0 +70.3 -18.329419181105777 8.499933068799717 -50.0 +70.3 -28.279731776551642 0.4043904563369196 -41.0 +70.3 7.2620474241576645 1.7805222100826015 -30.0 +70.3 5.56942953748969 7.433773413905932 -20.0 +70.3 -32.08471351381484 5.214401425367065 -12.5 +70.3 30.99699708402197 -7.629852384347919 -7.3 +70.3 16.420688115163323 0.3052507316806885 -1.0 +70.3 -12.057577684522364 -8.488938632238991 0.0 +70.3 -7.35147907642898 0.5750754838162742 2.0 diff --git a/tests/data/currents_mdc/c2/ref_moordyn_c.csv b/tests/data/currents_mdc/c2/ref_moordyn_c.csv new file mode 100644 index 00000000..e142d6be --- /dev/null +++ b/tests/data/currents_mdc/c2/ref_moordyn_c.csv @@ -0,0 +1,171 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,-7.0227440711249898,5.1111914475697731,-70,0,0,0,0,0,0,0 +0,31.485198909702078,-2.7143405605404558,-50,0,0,0,0,0,0,0 +0,-20.809732103447978,-0.11709455529188517,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +0,39.372803737268669,8.1470737833757489,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +0,22.655718499009495,9.0072588429436564,-20,0,0.73801714285714282,0.19,0,0,0,0 +0,-18.753718663728201,-6.3312860955636596,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +0,-12.854524951559121,-9.2261219752510932,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +0,-14.582842600996724,9.9481395883889334,-1,0,0.99296859999999998,0.152,0,0,0,0 +0,36.632586546811126,8.810295057781655,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,-29.96197077630681,-7.4273365256825441,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0.69999999999999984,-28.02076086210656,-6.5230478214981957,-70,0,0.075781299999999982,0.037911299999999988,0.00095199999999999983,0,0,0 +0.69999999999999996,-36.14628172153602,-9.2849199404695852,-50,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,3.3553280663774103,-4.0977833792740519,-41,0,0.32723521375000003,0.11272379999999999,0.00074362750000000002,0,0,0 +0.69999999999999996,-31.972033235176774,5.4521511695150906,-30,0,0.63456777500000006,0.20416129999999999,0.00048894999999999993,0,0,0 +0.69999999999999996,34.379596770195292,-8.7218122019177518,-20,0,0.7755830178571429,0.18416129999999997,-0.00038894999999999999,0,0,0 +0.69999999999999996,11.16126785635651,2.5043531721859065,-12.5,0,0.88134445000000006,0.16916129999999999,-0.0010473749999999999,0,0,0 +0.69999999999999996,-29.348708093264236,0.95625921196315034,-7.2999999999999998,0,0.95467249266666676,0.15876129999999999,-0.0013422149999999999,0,0,0 +0.69999999999999996,-22.203587385333094,-2.0378883977280582,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999991,0,0,0 +0.69999999999999996,18.190400780927327,7.6932029114202614,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,-24.12915133518095,1.4288192371581143,2,0,1.057613175,0.14416129999999999,0,0,0,0 +2.9998999999998115,-22.696983243303571,4.7645721603939695,-70,0,0.3247661740999796,0.16247158409998977,0.004079863999999744,0,0,0 +2.9998999999999998,29.60912871286267,-4.5951718023777177,-50,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,25.618852234935133,7.6544913688136056,-41,0,0.50961995738374999,0.17259939659999998,0.0031868687675,0,0,0 +2.9998999999999998,10.53684893278772,-6.7450871122768952,-30,0,0.73555235917499995,0.18497783409999999,0.00209543015,0,0,0 +2.9998999999999998,-20.117303652755972,-8.1552875404150704,-20,0,0.89900838344642864,0.1649778341,-0.0016668730071428565,0,0,0 +2.9998999999999998,28.877993020518687,3.6868449410257362,-12.5,0,1.02160040165,0.14997783410000001,-0.0044886003749999995,0,0,0 +2.9998999999999998,34.889472036363031,-8.6499183972374354,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582550000006,0,0,0 +2.9998999999999998,-17.050722524734745,6.4104332387690839,-1,0,1.2095748795499999,0.12697783410000002,-0.0012622079249999998,0,0,0 +2.9998999999999998,-16.690651040342416,-9.1022902008163555,0,0,1.2259204319749999,0.1249778341,0,0,0,0 +2.9998999999999998,9.3410154959595459,-0.67081577166983664,2,0,1.2259204319749999,0.1249778341,0,0,0,0 +3,-10.836166288895548,-2.8115086833376761,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,16.775443700382759,-6.7131723758024897,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,15.427820937577209,9.2448327960807788,-41,0,0.50962788749999999,0.17260199999999998,0.0031869750000000003,0,0,0 +3,7.630055290347471,-3.3308172468554282,-30,0,0.73555674999999998,0.18497699999999997,0.0020955000000000001,0,0,0 +3,-27.412426819126992,9.6358073816110839,-20,0,0.89901374999999994,0.16497699999999998,-0.0016669285714285709,0,0,0 +3,17.203682945812851,6.8040296956902608,-12.5,0,1.0216065000000001,0.14997700000000003,-0.0044887499999999997,0,0,0 +3,-38.990395083912347,-8.6007969180635229,-7.2999999999999998,0,1.1066043133333334,0.13957700000000001,-0.0057523500000000007,0,0,0 +3,-29.231849903309861,7.1667743025490402,-1,0,1.2095820999999998,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-35.203358965445574,-9.0692755562979404,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-36.116039280277235,-3.8822382563456852,2,0,1.2259277499999999,0.124977,0,0,0,0 +4.4000000000000217,1.1124388464913793,5.2052587647150101,-70,0,0.3835706222222231,0.16880857777777786,0.0060574222222222534,0,0,0 +4.4000000000000217,34.909765359536976,4.6492065207760032,-50,0,0.3835706222222231,0.16880857777777786,0.0060574222222222534,0,0,0 +4.4000000000000217,33.382476189054231,6.2852042478643355,-41,0,0.55788593222222294,0.16580857777777769,0.0052616622222222548,0,0,0 +4.4000000000000217,21.118088989511691,7.1464517926659141,-30,0,0.77093797777777828,0.16214191111111076,0.0042890666666667004,0,0,0 +4.4000000000000217,-16.791523486757871,1.797590082510812,-20,0,0.94225753333333406,0.1421419111111108,0.0016156825396825905,0,0,0 +4.4000000000000217,7.9041211742781954,-0.054646302818639469,-12.5,0,1.0707472000000009,0.12714191111111078,-0.00038935555555549188,0,0,0 +4.4000000000000217,38.844175038483527,7.1843931317166643,-7.2999999999999998,0,1.1598334613333343,0.11674191111111076,-0.005483260148148145,0,0,0 +4.4000000000000217,-8.7213686226181331,2.9390179049262528,-1,0,1.2677648400000008,0.10414191111111076,-0.0015472666666666709,0,0,0 +4.4000000000000217,-31.500770648871857,-4.1916864180962037,0,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +4.4000000000000217,-31.018717744515953,4.2873602486832603,2,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +6.9900000000009292,25.984579991006967,6.1489211330709139,-70,0,0.44493905333332784,0.15447589416664645,0.0081504083333331784,0,0,0 +6.9900000000009292,25.581854432298712,9.7110801990826481,-50,0,0.44493905333332784,0.15447589416664645,0.0081504083333331784,0,0,0 +6.9900000000009292,36.400293065186446,-6.4788192721909388,-41,0,0.60511694520832593,0.13647589416664646,0.0076923574583333907,0,0,0 +6.9900000000009292,-16.131052630012999,-9.933801481428981,-30,0,0.80088992416665683,0.11447589416664644,0.0071325175000003151,0,0,0 +6.9900000000009292,11.949152372833652,-0.64963881772035137,-20,0,0.97886558321427375,0.094475894166646451,0.0060124627380958428,0,0,0 +6.9900000000009292,1.7948777433545473,1.0536637081014071,-12.5,0,1.1123473274999864,0.079475894166646438,0.0051724216666674885,0,0,0 +6.9900000000009292,-5.9676589396120221,-1.1771128513667843,-7.2999999999999998,0,1.2048946048333187,0.069075894166646432,-0.0041257341555545717,0,0,0 +6.9900000000009292,24.096936358151595,3.4748222061226919,-1,0,1.3170195234999837,0.056475894166646431,-0.0016476759999997884,0,0,0 +6.9900000000009292,34.277818838471035,0.919347914896818,0,0,1.3348171599999836,0.054475894166646437,0,0,0,0 +6.9900000000009292,29.82452168463881,-6.7856616184547498,2,0,1.3348171599999836,0.054475894166646437,0,0,0,0 +10.099999999999296,-38.713778106373411,-2.6909196691918824,-70,0,0.41853185000000936,0.085899412500015843,0.0067420250000006848,0,0,0 +10.1,21.585287827692134,-1.5231418564411054,-50,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,33.277869171065134,-8.813343938797555,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,33.313263307978758,2.9080081138450176,-30,0,0.75335696249999995,0.045899412500000007,0.0072760624999999995,0,0,0 +10.1,-4.6156042235926691,5.4690483641294811,-20,0,0.92076984821428576,0.025899412500000003,0.006310641071428571,0,0,0 +10.1,14.431288479807982,-6.0866448253907741,-12.5,0,1.0463295125000001,0.010899412499999999,0.0055865749999999999,0,0,0 +10.1,-22.287438378876743,-5.9931563516567943,-7.2999999999999998,0,1.1333839605,0.00049941249999999743,-0.00092980500000000013,0,0,0 +10.1,24.798799380345031,-3.9029596822975527,-1,0,1.2388542025,-0.012100587499999999,-0.00076240999999999972,0,0,0 +10.1,-22.749879023039252,8.3958130959682222,0,0,1.25559555,-0.014100587499999997,0,0,0,0 +10.1,22.027009649720995,1.515237560299898,2,0,1.25559555,-0.014100587499999997,0,0,0,0 +14.999999999997604,13.876708886608398,0.74198059533564731,-70,0,0.35357500000003173,-0.024507999999946024,0.001978000000002329,0,0,0 +15,-2.7469521472092566,-3.5314995308744734,-50,0,0.35357499999999997,-0.024507999999999999,0.0019780000000000002,0,0,0 +15,29.646585258486994,9.962368830173471,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,37.053032151947576,9.8181285065495807,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,21.029863466981439,-5.0995662461400215,-20,0,0.7778652857142857,-0.084508,0.0018034285714285715,0,0,0 +15,32.845196822829848,-2.3039314011475254,-12.5,0,0.883938,-0.099507999999999999,-0.00049799999999999996,0,0,0 +15,36.136092054079853,7.0038673785676444,-7.2999999999999998,0,0.95748125333333334,-0.10990800000000001,0.0038103733333333333,0,0,0 +15,-11.799015997376479,9.1435538652081547,-1,0,1.0465819999999999,-0.12250799999999999,0.0011431999999999996,0,0,0 +15,-13.440509756587147,3.6347630909713775,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,0.9221939903324099,-3.9009838610955754,2,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +22.200000000007591,36.867108357945853,4.3234528028892942,-70,0,0.43220380000008285,0.062470400000091728,0.0028900000000009617,0,0,0 +22.200000000007591,-32.328943017938776,-1.8016757645856387,-50,0,0.43220380000008285,0.062470400000091728,0.0028900000000009617,0,0,0 +22.200000000007591,-35.80139720077473,-5.1599786500436888,-41,0,0.58779716800011284,0.044470400000091725,0.00089160399999748123,0,0,0 +22.200000000007591,-26.223680897920421,8.239591500764341,-30,0,0.77796684000014937,0.022470400000091713,-0.0015508800000067729,0,0,0 +22.200000000007591,23.990432529791548,4.2782867938128177,-20,0,0.95084837142875389,0.0024704000000917194,-0.00054000000000247112,0,0,0 +22.200000000007591,2.887023810869664,6.4828489826972664,-12.5,0,1.0805095200002073,-0.012529599999908278,0.00021816000000075529,0,0,0 +22.200000000007591,32.434164811981134,-7.8507772219933631,-7.2999999999999998,0,1.1704078965335578,-0.02292959999990828,-0.0009939530666717327,0,0,0 +22.200000000007591,27.646650826375748,6.6777754328004413,-1,0,1.2793232480002454,-0.035529599999908276,-0.00030601600000152812,0,0,0 +22.200000000007591,0.74396917360442671,5.562222983029244,0,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +22.200000000007591,25.152845672099858,7.842833299939155,2,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +27.000000000006168,34.177434854625872,5.9766241601186021,-70,0,0.48462300000006731,0.12045600000007449,0.0034980000000007809,0,0,0 +27.000000000006168,22.493094807101244,-0.30775054810584912,-50,0,0.48462300000006731,0.12045600000007449,0.0034980000000007809,0,0,0 +27.000000000006168,25.885819390472761,-5.8243899747383665,-41,0,0.65908728000009154,0.10245600000007449,-0.00070086000000204522,0,0,0 +27.000000000006168,-28.483027801526923,-9.3070219450368796,-30,0,0.87232140000012126,0.080456000000074482,-0.0058328000000054999,0,0,0 +27.000000000006168,9.0213466103913547,-3.454486553556011,-20,0,1.0661704285715765,0.060456000000074492,-0.0021022857142877212,0,0,0 +27.000000000006168,-7.8579344021051085,4.3088050425696949,-12.5,0,1.2115572000001682,0.045456000000074492,0.00069560000000061354,0,0,0 +27.000000000006168,3.846277922265557,2.544877826817034,-7.2999999999999998,0,1.3123589920001824,0.035056000000074493,-0.0041968373333374481,0,0,0 +27.000000000006168,18.177235829689387,4.6831025268385353,-1,0,1.4344840800001994,0.022456000000074486,-0.0012721600000012408,0,0,0 +27.000000000006168,-0.75801079980575992,-8.7983991709748484,0,0,1.4538690000002021,0.020456000000074488,0,0,0,0 +27.000000000006168,21.20569224848559,-8.5978798774983201,2,0,1.4538690000002021,0.020456000000074488,0,0,0,0 +29.900000000003637,1.4068909434364869,-8.3769989685523569,-70,0,0.51629293333337301,0.15548896666671058,0.0038653333333337936,0,0,0 +29.900000000003637,35.734934922741331,1.1619742971977622,-50,0,0.51629293333337301,0.15548896666671058,0.0038653333333337936,0,0,0 +29.900000000003637,37.799493650061336,0.41397227450426044,-41,0,0.70215838933338737,0.13748896666671057,-0.0016629736666678723,0,0,0 +29.900000000003637,20.183925874373905,1.0212616773877166,-30,0,0.92932728000007148,0.11548896666671057,-0.0084197933333365754,0,0,0 +29.900000000003637,-17.815889634232171,-1.0721355449493082,-20,0,1.1358441714286587,0.095488966666710584,-0.0030461666666678497,0,0,0 +29.900000000003637,10.672238679317502,-7.2897431841229476,-12.5,0,1.2907318400000991,0.080488966666710585,0.00098405333333369499,0,0,0 +29.900000000003637,-26.973218729797495,0.3614691414785991,-7.2999999999999998,0,1.3981211121778852,0.070088966666710592,-0.0061319132444468691,0,0,0 +29.900000000003637,37.135747505861445,-5.5397219777701583,-1,0,1.5282270826667841,0.057488966666710578,-0.0018558720000007309,0,0,0 +29.900000000003637,14.740809994223198,9.1125628640246106,0,0,1.548878800000119,0.055488966666710576,0,0,0,0 +29.900000000003637,-11.677147320143256,-9.2474157959482923,2,0,1.548878800000119,0.055488966666710576,0,0,0,0 +30.000000000000121,-8.650754310000881,9.1693461371038794,-70,0,0,0,0,0,0,0 +30.000000000000121,-21.528344832550019,-2.4498442073934967,-50,0,0,0,0,0,0,0 +30.000000000000121,-37.913659422049847,1.7869178293190444,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +30.000000000000121,8.4481059835368626,-0.71042863432680114,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +30.000000000000121,-10.984575041640863,-1.482566812128896,-20,0,0.73801714285714282,0.19,0,0,0,0 +30.000000000000121,17.471716959475991,-3.3085417618235073,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +30.000000000000121,-9.9692979111432862,6.4769913695198262,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +30.000000000000121,19.286561874569031,-9.7170013962221802,-1,0,0.99296859999999998,0.152,0,0,0,0 +30.000000000000121,26.75939860221601,-2.596169523828566,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30.000000000000121,-27.572206265855908,-8.0281491627056347,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,12.32596528400471,-4.3338365504395409,-70,0,0,0,0,0,0,0 +31.500000000001826,13.765699540806267,-1.3972193507397392,-50,0,0,0,0,0,0,0 +31.500000000001826,30.071913752994931,-0.27677302343631283,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +31.500000000001826,19.431548625850759,-9.7959945925604348,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +31.500000000001826,-28.793376785410032,-8.4567812390446857,-20,0,0.73801714285714282,0.19,0,0,0,0 +31.500000000001826,-36.309749669594368,4.5935349429275547,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +31.500000000001826,-2.239900235497096,0.13376092702809217,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +31.500000000001826,-23.449608268622228,2.8363753799615417,-1,0,0.99296859999999998,0.152,0,0,0,0 +31.500000000001826,37.409503897000633,4.0180531530013752,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,-29.032706522727636,-0.2497391911787421,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +32.999999999998288,-39.854124729019311,3.8768432788161906,-70,0,0,0,0,0,0,0 +33,17.684325638275766,3.5714735876826005,-50,0,0,0,0,0,0,0 +33,-0.4594188146910767,6.5280235239098801,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +33,38.256746798218416,-3.2436924925503297,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +33,-27.521341499367054,-2.7390553415641001,-20,0,0.73801714285714282,0.19,0,0,0,0 +33,-12.987076895057115,-7.1632817430584605,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +33,-12.696516486637286,-6.2580687836890414,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +33,-15.027932615069012,-1.6160955882136356,-1,0,0.99296859999999998,0.152,0,0,0,0 +33,-30.393098056862947,-6.3003307178771024,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,17.451886515299904,-7.4559148239279738,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +35.199999999994901,-12.175965967280263,6.7831133701243189,-70,0,0.23816979999944818,0.11914979999972393,0.0029919999999930683,0,0,0 +35.200000000000003,4.6180814704796731,0.81549098970607581,-50,0,0.23816980000000029,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,35.559261112186789,4.1372114999958356,-41,0,0.44618695750000026,0.15177480000000004,0.0023371150000000033,0,0,0 +35.200000000000003,-5.4011216736405032,9.6066153542405033,-30,0,0.70043015000000008,0.19164979999999995,0.0015367000000000022,0,0,0 +35.200000000000003,-12.109738563386159,0.037484791004560591,-20,0,0.85608132142857163,0.17164979999999999,-0.0012224142857142867,0,0,0 +35.200000000000003,11.75197738317857,-9.5241292360080703,-12.5,0,0.97281970000000029,0.15664980000000001,-0.0032917500000000039,0,0,0 +35.200000000000003,21.038370881567459,3.5302548364859625,-7.2999999999999998,0,1.053758462666667,0.14624979999999999,-0.0042183900000000059,0,0,0 +35.200000000000003,-15.973711330369085,3.4445876816223553,-1,0,1.1518185000000001,0.13364979999999999,-0.00092565000000000106,0,0,0 +35.200000000000003,-20.737096172036509,-6.9182720241524791,0,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,24.682597011745329,2.2417909878109477,2,0,1.16738355,0.13164979999999998,0,0,0,0 +39.999999999989114,-28.536695796128988,-4.9250282768244125,-70,0,0.44488022222228624,0.15425802777801495,0.0081487222222240592,0,0,0 +40,-37.794874756703308,-3.1006887978684139,-50,0,0.44488022222222223,0.15425802777777775,0.0081487222222222239,0,0,0 +40,-34.489431309685216,0.39550850033954532,-41,0,0.6050369347222222,0.13625802777777773,0.0076929597222222239,0,0,0 +40,-22.625244513000098,-1.5039685698797065,-30,0,0.8007840277777778,0.11425802777777774,0.0071359166666666671,0,0,0 +40,-8.384812969166795,-6.8755142722931524,-20,0,0.9787361547619049,0.094258027777777739,0.0060189801587301603,0,0,0 +40,-24.046467454115312,9.1937867724362334,-12.5,0,1.1122002500000001,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-7.1583616365327529,-9.175947291231326,-7.2999999999999998,0,1.2047352899999999,0.068858027777777747,-0.0041151281481481465,0,0,0 +40,-37.563419615947083,-7.9501130849871888,-1,0,1.3168453833333331,0.056258027777777747,-0.0016453999999999993,0,0,0 +40,16.627586727950444,-1.7018366852211031,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,-20.299794883215469,2.2463666881873419,2,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +70.299999999980059,-27.259439885464111,1.3303422268762404,-70,0,0.37937107777694035,0.16835632222213204,0.0059161777777496137,0,0,0 +70.300000000000011,-18.329419181105777,8.4999330687997166,-50,0,0.37937107777777823,0.16835632222222227,0.0059161777777777943,0,0,0 +70.300000000000011,-28.279731776551642,0.40439045633691961,-41,0,0.55443892902777825,0.16629382222222217,0.0051134702777777949,0,0,0 +70.300000000000011,7.2620474241576645,1.7805222100826015,-30,0,0.76841074722222258,0.16377298888888869,0.0041323833333333504,0,0,0 +70.300000000000011,5.5694295374896896,7.4337734139059322,-20,0,0.93916869166666705,0.1437729888888887,0.0013812103174603439,0,0,0 +70.300000000000011,-32.08471351381484,5.2144014253670647,-12.5,0,1.0672371500000004,0.12877298888888872,-0.00068216944444441123,0,0,0 +70.300000000000011,30.99699708402197,-7.6298523843479193,-7.2999999999999998,0,1.1560313793333339,0.11837298888888871,-0.00550248085185185,0,0,0 +70.300000000000011,16.420688115163323,0.3052507316806885,-1,0,1.2636089300000006,0.10577298888888871,-0.0015269083333333353,0,0,0 +70.300000000000011,-12.057577684522364,-8.488938632238991,0,0,1.2806847250000004,0.10377298888888871,0,0,0,0 +70.300000000000011,-7.3514790764289799,0.57507548381627416,2,0,1.2806847250000004,0.10377298888888871,0,0,0,0 diff --git a/tests/data/currents_mdc/c2/ref_python.csv b/tests/data/currents_mdc/c2/ref_python.csv new file mode 100644 index 00000000..2848e7f2 --- /dev/null +++ b/tests/data/currents_mdc/c2/ref_python.csv @@ -0,0 +1,171 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,-7.0227440711249898,5.1111914475697731,-70,0,0,0,0,0,0,0 +0,31.485198909702078,-2.7143405605404558,-50,0,0,0,0,0,0,0 +0,-20.809732103447978,-0.11709455529188517,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +0,39.372803737268669,8.1470737833757489,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +0,22.655718499009495,9.0072588429436564,-20,0,0.73801714285714282,0.19,0,0,0,0 +0,-18.753718663728201,-6.3312860955636596,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +0,-12.854524951559121,-9.2261219752510932,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +0,-14.582842600996724,9.9481395883889334,-1,0,0.99296859999999998,0.152,0,0,0,0 +0,36.632586546811126,8.810295057781655,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,-29.96197077630681,-7.4273365256825441,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0.69999999999999996,-28.02076086210656,-6.5230478214981957,-70,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,-36.14628172153602,-9.2849199404695852,-50,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,3.3553280663774103,-4.0977833792740519,-41,0,0.32723521375000003,0.11272379999999999,0.00074362750000000002,0,0,0 +0.69999999999999996,-31.972033235176774,5.4521511695150906,-30,0,0.63456777500000006,0.20416129999999999,0.00048894999999999993,0,0,0 +0.69999999999999996,34.379596770195292,-8.7218122019177518,-20,0,0.77558301785714279,0.18416129999999997,-0.00038894999999999999,0,0,0 +0.69999999999999996,11.16126785635651,2.5043531721859065,-12.5,0,0.88134444999999995,0.16916129999999999,-0.0010473749999999999,0,0,0 +0.69999999999999996,-29.348708093264236,0.95625921196315034,-7.2999999999999998,0,0.95467249266666676,0.15876129999999999,-0.0013422149999999999,0,0,0 +0.69999999999999996,-22.203587385333094,-2.0378883977280582,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999991,0,0,0 +0.69999999999999996,18.190400780927327,7.6932029114202614,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,-24.12915133518095,1.4288192371581143,2,0,1.057613175,0.14416129999999999,0,0,0,0 +2.9998999999999998,-22.696983243303571,4.7645721603939695,-70,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,29.60912871286267,-4.5951718023777177,-50,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,25.618852234935133,7.6544913688136056,-41,0,0.50961995738374999,0.17259939660000001,0.0031868687675,0,0,0 +2.9998999999999998,10.53684893278772,-6.7450871122768952,-30,0,0.73555235917499995,0.18497783410000002,0.00209543015,0,0,0 +2.9998999999999998,-20.117303652755972,-8.1552875404150704,-20,0,0.89900838344642842,0.1649778341,-0.0016668730071428565,0,0,0 +2.9998999999999998,28.877993020518687,3.6868449410257362,-12.5,0,1.0216004016499998,0.14997783409999998,-0.0044886003749999995,0,0,0 +2.9998999999999998,34.889472036363031,-8.6499183972374354,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582550000006,0,0,0 +2.9998999999999998,-17.050722524734745,6.4104332387690839,-1,0,1.2095748795499999,0.12697783410000002,-0.0012622079249999998,0,0,0 +2.9998999999999998,-16.690651040342416,-9.1022902008163555,0,0,1.2259204319749999,0.1249778341,0,0,0,0 +2.9998999999999998,9.3410154959595459,-0.67081577166983664,2,0,1.2259204319749999,0.1249778341,0,0,0,0 +3,-10.836166288895548,-2.8115086833376761,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,16.775443700382759,-6.7131723758024897,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,15.427820937577209,9.2448327960807788,-41,0,0.50962788749999999,0.17260199999999998,0.0031869750000000003,0,0,0 +3,7.630055290347471,-3.3308172468554282,-30,0,0.73555674999999998,0.184977,0.0020955000000000001,0,0,0 +3,-27.412426819126992,9.6358073816110839,-20,0,0.89901374999999994,0.16497699999999998,-0.0016669285714285709,0,0,0 +3,17.203682945812851,6.8040296956902608,-12.5,0,1.0216064999999999,0.149977,-0.0044887499999999997,0,0,0 +3,-38.990395083912347,-8.6007969180635229,-7.2999999999999998,0,1.1066043133333334,0.13957700000000001,-0.0057523500000000007,0,0,0 +3,-29.231849903309861,7.1667743025490402,-1,0,1.2095820999999998,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-35.203358965445574,-9.0692755562979404,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-36.116039280277235,-3.8822382563456852,2,0,1.2259277499999999,0.124977,0,0,0,0 +4.4000000000000004,1.1124388464913793,5.2052587647150101,-70,0,0.38357062222222227,0.16880857777777775,0.0060574222222222231,0,0,0 +4.4000000000000004,34.909765359536976,4.6492065207760032,-50,0,0.38357062222222227,0.16880857777777775,0.0060574222222222231,0,0,0 +4.4000000000000004,33.382476189054231,6.2852042478643355,-41,0,0.55788593222222227,0.16580857777777774,0.0052616622222222235,0,0,0 +4.4000000000000004,21.118088989511691,7.1464517926659141,-30,0,0.77093797777777773,0.16214191111111109,0.0042890666666666674,0,0,0 +4.4000000000000004,-16.791523486757871,1.797590082510812,-20,0,0.94225753333333329,0.1421419111111111,0.0016156825396825409,0,0,0 +4.4000000000000004,7.9041211742781954,-0.054646302818639469,-12.5,0,1.0707472,0.12714191111111112,-0.00038935555555555433,0,0,0 +4.4000000000000004,38.844175038483527,7.1843931317166643,-7.2999999999999998,0,1.1598334613333334,0.11674191111111112,-0.0054832601481481485,0,0,0 +4.4000000000000004,-8.7213686226181331,2.9390179049262528,-1,0,1.2677648399999999,0.10414191111111112,-0.0015472666666666666,0,0,0 +4.4000000000000004,-31.500770648871857,-4.1916864180962037,0,0,1.2848967999999998,0.10214191111111112,0,0,0,0 +4.4000000000000004,-31.018717744515953,4.2873602486832603,2,0,1.2848967999999998,0.10214191111111112,0,0,0,0 +6.9900000000000002,25.984579991006967,6.1489211330709139,-70,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,25.581854432298712,9.7110801990826481,-50,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,36.400293065186446,-6.4788192721909388,-41,0,0.60511694520833337,0.13647589416666667,0.0076923574583333343,0,0,0 +6.9900000000000002,-16.131052630012999,-9.933801481428981,-30,0,0.80088992416666671,0.11447589416666666,0.0071325175000000003,0,0,0 +6.9900000000000002,11.949152372833652,-0.64963881772035137,-20,0,0.97886558321428574,0.094475894166666657,0.0060124627380952391,0,0,0 +6.9900000000000002,1.7948777433545473,1.0536637081014071,-12.5,0,1.1123473275,0.079475894166666658,0.005172421666666668,0,0,0 +6.9900000000000002,-5.9676589396120221,-1.1771128513667843,-7.2999999999999998,0,1.2048946048333333,0.069075894166666651,-0.0041257341555555552,0,0,0 +6.9900000000000002,24.096936358151595,3.4748222061226919,-1,0,1.3170195235,0.056475894166666665,-0.0016476759999999996,0,0,0 +6.9900000000000002,34.277818838471035,0.919347914896818,0,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +6.9900000000000002,29.82452168463881,-6.7856616184547498,2,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +10.1,-38.713778106373411,-2.6909196691918824,-70,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,21.585287827692134,-1.5231418564411054,-50,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,33.277869171065134,-8.813343938797555,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,33.313263307978758,2.9080081138450176,-30,0,0.75335696249999995,0.045899412500000007,0.0072760624999999995,0,0,0 +10.1,-4.6156042235926691,5.4690483641294811,-20,0,0.92076984821428576,0.025899412500000003,0.006310641071428571,0,0,0 +10.1,14.431288479807982,-6.0866448253907741,-12.5,0,1.0463295125000001,0.010899412499999999,0.0055865749999999999,0,0,0 +10.1,-22.287438378876743,-5.9931563516567943,-7.2999999999999998,0,1.1333839605,0.00049941250000000003,-0.00092980500000000013,0,0,0 +10.1,24.798799380345031,-3.9029596822975527,-1,0,1.2388542025,-0.012100587500000003,-0.00076240999999999972,0,0,0 +10.1,-22.749879023039252,8.3958130959682222,0,0,1.25559555,-0.014100587500000003,0,0,0,0 +10.1,22.027009649720995,1.515237560299898,2,0,1.25559555,-0.014100587500000003,0,0,0,0 +15,13.876708886608398,0.74198059533564731,-70,0,0.35357499999999997,-0.024507999999999999,0.0019780000000000002,0,0,0 +15,-2.7469521472092566,-3.5314995308744734,-50,0,0.35357499999999997,-0.024507999999999999,0.0019780000000000002,0,0,0 +15,29.646585258486994,9.962368830173471,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,37.053032151947576,9.8181285065495807,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,21.029863466981439,-5.0995662461400215,-20,0,0.7778652857142857,-0.084508,0.0018034285714285715,0,0,0 +15,32.845196822829848,-2.3039314011475254,-12.5,0,0.883938,-0.099507999999999999,-0.00049799999999999996,0,0,0 +15,36.136092054079853,7.0038673785676444,-7.2999999999999998,0,0.95748125333333334,-0.10990800000000001,0.0038103733333333333,0,0,0 +15,-11.799015997376479,9.1435538652081547,-1,0,1.0465819999999999,-0.12250799999999999,0.0011431999999999996,0,0,0 +15,-13.440509756587147,3.6347630909713775,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,0.9221939903324099,-3.9009838610955754,2,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +22.199999999999999,36.867108357945853,4.3234528028892942,-70,0,0.43220379999999997,0.062470399999999981,0.0028900000000000002,0,0,0 +22.199999999999999,-32.328943017938776,-1.8016757645856387,-50,0,0.43220379999999997,0.062470399999999981,0.0028900000000000002,0,0,0 +22.199999999999999,-35.80139720077473,-5.1599786500436888,-41,0,0.58779716800000004,0.044470399999999993,0.00089160400000000114,0,0,0 +22.199999999999999,-26.223680897920421,8.239591500764341,-30,0,0.77796683999999994,0.022470399999999988,-0.001550879999999998,0,0,0 +22.199999999999999,23.990432529791548,4.2782867938128177,-20,0,0.95084837142857137,0.0024703999999999872,-0.00053999999999999936,0,0,0 +22.199999999999999,2.887023810869664,6.4828489826972664,-12.5,0,1.0805095199999999,-0.012529600000000016,0.00021815999999999985,0,0,0 +22.199999999999999,32.434164811981134,-7.8507772219933631,-7.2999999999999998,0,1.1704078965333333,-0.022929600000000015,-0.00099395306666666535,0,0,0 +22.199999999999999,27.646650826375748,6.6777754328004413,-1,0,1.2793232479999999,-0.035529600000000015,-0.0003060159999999995,0,0,0 +22.199999999999999,0.74396917360442671,5.562222983029244,0,0,1.2966113999999997,-0.03752960000000001,0,0,0,0 +22.199999999999999,25.152845672099858,7.842833299939155,2,0,1.2966113999999997,-0.03752960000000001,0,0,0,0 +27,34.177434854625872,5.9766241601186021,-70,0,0.48462299999999997,0.12045600000000001,0.0034980000000000002,0,0,0 +27,22.493094807101244,-0.30775054810584912,-50,0,0.48462299999999997,0.12045600000000001,0.0034980000000000002,0,0,0 +27,25.885819390472761,-5.8243899747383665,-41,0,0.65908728000000005,0.10245600000000002,-0.00070085999999999955,0,0,0 +27,-28.483027801526923,-9.3070219450368796,-30,0,0.87232140000000002,0.080456000000000014,-0.0058327999999999991,0,0,0 +27,9.0213466103913547,-3.454486553556011,-20,0,1.0661704285714286,0.06045600000000001,-0.0021022857142857141,0,0,0 +27,-7.8579344021051085,4.3088050425696949,-12.5,0,1.2115571999999999,0.04545600000000001,0.00069559999999999999,0,0,0 +27,3.846277922265557,2.544877826817034,-7.2999999999999998,0,1.3123589919999998,0.035056000000000011,-0.0041968373333333324,0,0,0 +27,18.177235829689387,4.6831025268385353,-1,0,1.4344840799999998,0.022456000000000014,-0.0012721599999999994,0,0,0 +27,-0.75801079980575992,-8.7983991709748484,0,0,1.4538689999999999,0.020456000000000016,0,0,0,0 +27,21.20569224848559,-8.5978798774983201,2,0,1.4538689999999999,0.020456000000000016,0,0,0,0 +29.899999999999999,1.4068909434364869,-8.3769989685523569,-70,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,35.734934922741331,1.1619742971977622,-50,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,37.799493650061336,0.41397227450426044,-41,0,0.70215838933333341,0.13748896666666666,-0.0016629736666666666,0,0,0 +29.899999999999999,20.183925874373905,1.0212616773877166,-30,0,0.92932728000000009,0.11548896666666666,-0.0084197933333333332,0,0,0 +29.899999999999999,-17.815889634232171,-1.0721355449493082,-20,0,1.1358441714285714,0.095488966666666675,-0.0030461666666666666,0,0,0 +29.899999999999999,10.672238679317502,-7.2897431841229476,-12.5,0,1.2907318399999999,0.080488966666666675,0.00098405333333333352,0,0,0 +29.899999999999999,-26.973218729797495,0.3614691414785991,-7.2999999999999998,0,1.3981211121777775,0.070088966666666669,-0.006131913244444444,0,0,0 +29.899999999999999,37.135747505861445,-5.5397219777701583,-1,0,1.5282270826666664,0.057488966666666669,-0.0018558719999999993,0,0,0 +29.899999999999999,14.740809994223198,9.1125628640246106,0,0,1.5488787999999998,0.055488966666666667,0,0,0,0 +29.899999999999999,-11.677147320143256,-9.2474157959482923,2,0,1.5488787999999998,0.055488966666666667,0,0,0,0 +30,-8.650754310000881,9.1693461371038794,-70,0,0,0,0,0,0,0 +30,-21.528344832550019,-2.4498442073934967,-50,0,0,0,0,0,0,0 +30,-37.913659422049847,1.7869178293190444,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +30,8.4481059835368626,-0.71042863432680114,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +30,-10.984575041640863,-1.482566812128896,-20,0,0.73801714285714282,0.19,0,0,0,0 +30,17.471716959475991,-3.3085417618235073,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +30,-9.9692979111432862,6.4769913695198262,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +30,19.286561874569031,-9.7170013962221802,-1,0,0.99296859999999998,0.152,0,0,0,0 +30,26.75939860221601,-2.596169523828566,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30,-27.572206265855908,-8.0281491627056347,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.5,12.32596528400471,-4.3338365504395409,-70,0,0,0,0,0,0,0 +31.5,13.765699540806267,-1.3972193507397392,-50,0,0,0,0,0,0,0 +31.5,30.071913752994931,-0.27677302343631283,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +31.5,19.431548625850759,-9.7959945925604348,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +31.5,-28.793376785410032,-8.4567812390446857,-20,0,0.73801714285714282,0.19,0,0,0,0 +31.5,-36.309749669594368,4.5935349429275547,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +31.5,-2.239900235497096,0.13376092702809217,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +31.5,-23.449608268622228,2.8363753799615417,-1,0,0.99296859999999998,0.152,0,0,0,0 +31.5,37.409503897000633,4.0180531530013752,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.5,-29.032706522727636,-0.2497391911787421,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,-39.854124729019311,3.8768432788161906,-70,0,0,0,0,0,0,0 +33,17.684325638275766,3.5714735876826005,-50,0,0,0,0,0,0,0 +33,-0.4594188146910767,6.5280235239098801,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +33,38.256746798218416,-3.2436924925503297,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +33,-27.521341499367054,-2.7390553415641001,-20,0,0.73801714285714282,0.19,0,0,0,0 +33,-12.987076895057115,-7.1632817430584605,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +33,-12.696516486637286,-6.2580687836890414,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +33,-15.027932615069012,-1.6160955882136356,-1,0,0.99296859999999998,0.152,0,0,0,0 +33,-30.393098056862947,-6.3003307178771024,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,17.451886515299904,-7.4559148239279738,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +35.200000000000003,-12.175965967280263,6.7831133701243189,-70,0,0.23816980000000029,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,4.6180814704796731,0.81549098970607581,-50,0,0.23816980000000029,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,35.559261112186789,4.1372114999958356,-41,0,0.44618695750000026,0.15177480000000007,0.0023371150000000033,0,0,0 +35.200000000000003,-5.4011216736405032,9.6066153542405033,-30,0,0.70043015000000008,0.19164979999999998,0.0015367000000000022,0,0,0 +35.200000000000003,-12.109738563386159,0.037484791004560591,-20,0,0.85608132142857141,0.17164979999999996,-0.0012224142857142867,0,0,0 +35.200000000000003,11.75197738317857,-9.5241292360080703,-12.5,0,0.97281970000000006,0.15664979999999995,-0.0032917500000000039,0,0,0 +35.200000000000003,21.038370881567459,3.5302548364859625,-7.2999999999999998,0,1.0537584626666667,0.14624979999999999,-0.0042183900000000059,0,0,0 +35.200000000000003,-15.973711330369085,3.4445876816223553,-1,0,1.1518185000000001,0.13364979999999999,-0.00092565000000000106,0,0,0 +35.200000000000003,-20.737096172036509,-6.9182720241524791,0,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,24.682597011745329,2.2417909878109477,2,0,1.16738355,0.13164979999999998,0,0,0,0 +40,-28.536695796128988,-4.9250282768244125,-70,0,0.44488022222222223,0.15425802777777772,0.0081487222222222239,0,0,0 +40,-37.794874756703308,-3.1006887978684139,-50,0,0.44488022222222223,0.15425802777777772,0.0081487222222222239,0,0,0 +40,-34.489431309685216,0.39550850033954532,-41,0,0.6050369347222222,0.13625802777777773,0.0076929597222222239,0,0,0 +40,-22.625244513000098,-1.5039685698797065,-30,0,0.8007840277777778,0.11425802777777774,0.0071359166666666671,0,0,0 +40,-8.384812969166795,-6.8755142722931524,-20,0,0.9787361547619049,0.094258027777777739,0.0060189801587301603,0,0,0 +40,-24.046467454115312,9.1937867724362334,-12.5,0,1.1122002500000001,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-7.1583616365327529,-9.175947291231326,-7.2999999999999998,0,1.2047352899999999,0.068858027777777719,-0.0041151281481481465,0,0,0 +40,-37.563419615947083,-7.9501130849871888,-1,0,1.3168453833333331,0.05625802777777774,-0.0016453999999999993,0,0,0 +40,16.627586727950444,-1.7018366852211031,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,-20.299794883215469,2.2463666881873419,2,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +70.299999999999997,-27.259439885464111,1.3303422268762404,-70,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-18.329419181105777,8.4999330687997166,-50,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-28.279731776551642,0.40439045633691961,-41,0,0.5544389290277778,0.16629382222222222,0.0051134702777777801,0,0,0 +70.299999999999997,7.2620474241576645,1.7805222100826015,-30,0,0.76841074722222225,0.16377298888888889,0.0041323833333333348,0,0,0 +70.299999999999997,5.5694295374896896,7.4337734139059322,-20,0,0.93916869166666672,0.1437729888888889,0.0013812103174603197,0,0,0 +70.299999999999997,-32.08471351381484,5.2144014253670647,-12.5,0,1.06723715,0.12877298888888888,-0.0006821694444444418,0,0,0 +70.299999999999997,30.99699708402197,-7.6298523843479193,-7.2999999999999998,0,1.1560313793333334,0.11837298888888888,-0.0055024808518518518,0,0,0 +70.299999999999997,16.420688115163323,0.3052507316806885,-1,0,1.26360893,0.10577298888888889,-0.0015269083333333332,0,0,0 +70.299999999999997,-12.057577684522364,-8.488938632238991,0,0,1.280684725,0.10377298888888889,0,0,0,0 +70.299999999999997,-7.3514790764289799,0.57507548381627416,2,0,1.280684725,0.10377298888888889,0,0,0,0 diff --git a/tests/data/currents_mdc/c2const/current_profile_dynamic.txt b/tests/data/currents_mdc/c2const/current_profile_dynamic.txt new file mode 100644 index 00000000..56b37747 --- /dev/null +++ b/tests/data/currents_mdc/c2const/current_profile_dynamic.txt @@ -0,0 +1,9 @@ +--------------------- MoorDyn dynamic currents File ---------------------------------- +the steady profile of ../c1/current_profile.txt at three times + + +-50.0 -45.0 -40.0 -35.0 -30.0 -25.0 -20.0 -15.0 -10.0 -5.0 0.0 +t ux(z) uy(z) uz(z) +0.0 0.2 0.22 0.24000000000000002 0.26 0.28 0.30000000000000004 0.32 0.34 0.36 0.38 0.4 -0.1 -0.0995 -0.098 -0.0955 -0.092 -0.08750000000000001 -0.082 -0.07550000000000001 -0.068 -0.0595 -0.05 0.0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009000000000000001 0.01 +4.0 0.2 0.22 0.24000000000000002 0.26 0.28 0.30000000000000004 0.32 0.34 0.36 0.38 0.4 -0.1 -0.0995 -0.098 -0.0955 -0.092 -0.08750000000000001 -0.082 -0.07550000000000001 -0.068 -0.0595 -0.05 0.0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009000000000000001 0.01 +10.0 0.2 0.22 0.24000000000000002 0.26 0.28 0.30000000000000004 0.32 0.34 0.36 0.38 0.4 -0.1 -0.0995 -0.098 -0.0955 -0.092 -0.08750000000000001 -0.082 -0.07550000000000001 -0.068 -0.0595 -0.05 0.0 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009000000000000001 0.01 diff --git a/tests/data/currents_mdc/c2const/currents.dat b/tests/data/currents_mdc/c2const/currents.dat new file mode 100644 index 00000000..681f5ff5 --- /dev/null +++ b/tests/data/currents_mdc/c2const/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 2): the steady profile of c1 at every time +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +10.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +2 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c2const/points.txt b/tests/data/currents_mdc/c2const/points.txt new file mode 100644 index 00000000..8fd9d0fe --- /dev/null +++ b/tests/data/currents_mdc/c2const/points.txt @@ -0,0 +1,45 @@ +0.0 3.625747096391059 1.204796483183113 -61.0 +0.0 29.240222818749317 -9.25239045413613 -50.0 +0.0 23.46046359355391 1.8229666122879866 -47.5 +0.0 -19.043779590969727 -4.599139224969835 -33.3 +0.0 -12.856308645593106 -1.749412098253556 -30.0 +0.0 38.36488703383566 -7.038199728668184 -12.3 +0.0 -33.361464723920776 -4.316260942636896 -2.0 +0.0 13.865936011298075 8.422021827334497 0.0 +0.0 -4.702829992963025 -1.6717186681526446 1.5 +0.5 -14.07536799232922 9.54041437133462 -61.0 +0.5 -1.266200937440189 -2.1387238980221905 -50.0 +0.5 21.991887387430154 -6.313315647241533 -47.5 +0.5 9.065590048206033 -3.9266969732113344 -33.3 +0.5 32.59611361428382 -2.471527225465257 -30.0 +0.5 8.548136741557208 7.73235531958516 -12.3 +0.5 10.767468921776384 -9.901710084464543 -2.0 +0.5 33.170979663189556 -6.387110542603544 0.0 +0.5 -18.832109881530876 1.3939569631943698 1.5 +3.0 -23.84629742780436 -7.411284659684765 -61.0 +3.0 16.2776411086751 -7.986057426728303 -50.0 +3.0 -1.5453992830454126 -8.544058084292184 -47.5 +3.0 33.748083410629704 -2.1145711101399893 -33.3 +3.0 7.1129995867811076 8.077716999122323 -30.0 +3.0 -21.206744257784713 -8.287889299555204 -12.3 +3.0 19.018417993166082 8.575850333694412 -2.0 +3.0 -34.24034673398577 9.933110274458684 0.0 +3.0 -31.67357968747993 -1.3198406078312601 1.5 +7.7 -18.474195005654472 -5.552630906546348 -61.0 +7.7 -14.846582951132675 6.974335055539811 -50.0 +7.7 7.399286028033458 -4.889381691061896 -47.5 +7.7 26.668381073668257 0.43097649083227907 -33.3 +7.7 -23.89846830191276 0.7687996394637064 -30.0 +7.7 -18.75050881328726 8.739373633670333 -12.3 +7.7 26.194471802351387 2.9173305077171037 -2.0 +7.7 -33.4763574363689 9.123955477562177 0.0 +7.7 16.227574118222492 6.727258469164298 1.5 +10.0 -2.3242607964400293 -6.98799947972778 -61.0 +10.0 25.87157786708798 -9.163031820079166 -50.0 +10.0 26.779122526321913 4.0438763545298855 -47.5 +10.0 -10.986895134543175 6.050656948172406 -33.3 +10.0 37.52443736070754 8.039683536558893 -30.0 +10.0 -11.120433344512115 -3.612516949673248 -12.3 +10.0 16.37635004074521 -2.4287988814413364 -2.0 +10.0 -25.014363736779465 -8.657988727363897 0.0 +10.0 -33.30484432612042 4.748403474389418 1.5 diff --git a/tests/data/currents_mdc/c2const/ref_moordyn_c.csv b/tests/data/currents_mdc/c2const/ref_moordyn_c.csv new file mode 100644 index 00000000..0a8e60f0 --- /dev/null +++ b/tests/data/currents_mdc/c2const/ref_moordyn_c.csv @@ -0,0 +1,46 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,3.6257470963910592,1.2047964831831131,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,29.240222818749317,-9.2523904541361297,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,23.460463593553911,1.8229666122879866,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0,-19.043779590969727,-4.5991392249698348,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0,-12.856308645593106,-1.7494120982535559,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0,38.364887033835657,-7.0381997286681841,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0,-33.361464723920776,-4.3162609426368963,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0,13.865936011298075,8.4220218273344969,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0,-4.7028299929630251,-1.6717186681526446,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.49999999999999994,-14.07536799232922,9.5404143713346201,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,-1.266200937440189,-2.1387238980221905,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,21.991887387430154,-6.3133156472415326,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0.5,9.0655900482060332,-3.9266969732113344,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0.5,32.596113614283823,-2.4715272254652572,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0.5,8.548136741557208,7.7323553195851602,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0.5,10.767468921776384,-9.9017100844645434,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0.5,33.170979663189556,-6.3871105426035442,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-18.832109881530876,1.3939569631943698,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +2.9999999999998335,-23.846297427804359,-7.4112846596847648,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,16.277641108675098,-7.9860574267283031,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,-1.5453992830454126,-8.5440580842921836,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +3,33.748083410629704,-2.1145711101399893,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +3,7.1129995867811076,8.0777169991223232,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +3,-21.206744257784713,-8.2878892995552036,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +3,19.018417993166082,8.5758503336944116,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +3,-34.240346733985767,9.9331102744586843,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-31.673579687479929,-1.3198406078312601,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000014222,-18.474195005654472,-5.5526309065463479,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000014222,-14.846582951132675,6.9743350555398109,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000014222,7.3992860280334583,-4.8893816910618959,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +7.7000000000014222,26.668381073668257,0.43097649083227907,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +7.7000000000014222,-23.898468301912761,0.76879963946370644,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +7.7000000000014222,-18.750508813287261,8.7393736336703327,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +7.7000000000014222,26.194471802351387,2.9173305077171037,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +7.7000000000014222,-33.4763574363689,9.123955477562177,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000014222,16.227574118222492,6.7272584691642976,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +9.9999999999990248,-2.3242607964400293,-6.9879994797277796,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,25.871577867087979,-9.1630318200791656,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,26.779122526321913,4.0438763545298855,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +10,-10.986895134543175,6.0506569481724064,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +10,37.524437360707537,8.0396835365588935,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +10,-11.120433344512115,-3.6125169496732479,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +10,16.376350040745209,-2.4287988814413364,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +10,-25.014363736779465,-8.6579887273638967,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-33.304844326120417,4.7484034743894181,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 diff --git a/tests/data/currents_mdc/c2const/ref_python.csv b/tests/data/currents_mdc/c2const/ref_python.csv new file mode 100644 index 00000000..cc47eeef --- /dev/null +++ b/tests/data/currents_mdc/c2const/ref_python.csv @@ -0,0 +1,46 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,3.6257470963910592,1.2047964831831131,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,29.240222818749317,-9.2523904541361297,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0,23.460463593553911,1.8229666122879866,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0,-19.043779590969727,-4.5991392249698348,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0,-12.856308645593106,-1.7494120982535559,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0,38.364887033835657,-7.0381997286681841,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0,-33.361464723920776,-4.3162609426368963,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0,13.865936011298075,8.4220218273344969,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0,-4.7028299929630251,-1.6717186681526446,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-14.07536799232922,9.5404143713346201,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,-1.266200937440189,-2.1387238980221905,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +0.5,21.991887387430154,-6.3133156472415326,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +0.5,9.0655900482060332,-3.9266969732113344,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +0.5,32.596113614283823,-2.4715272254652572,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +0.5,8.548136741557208,7.7323553195851602,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +0.5,10.767468921776384,-9.9017100844645434,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +0.5,33.170979663189556,-6.3871105426035442,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +0.5,-18.832109881530876,1.3939569631943698,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-23.846297427804359,-7.4112846596847648,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,16.277641108675098,-7.9860574267283031,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +3,-1.5453992830454126,-8.5440580842921836,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +3,33.748083410629704,-2.1145711101399893,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +3,7.1129995867811076,8.0777169991223232,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +3,-21.206744257784713,-8.2878892995552036,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +3,19.018417993166082,8.5758503336944116,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +3,-34.240346733985767,9.9331102744586843,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +3,-31.673579687479929,-1.3198406078312601,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000000002,-18.474195005654472,-5.5526309065463479,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000000002,-14.846582951132675,6.9743350555398109,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +7.7000000000000002,7.3992860280334583,-4.8893816910618959,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +7.7000000000000002,26.668381073668257,0.43097649083227907,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +7.7000000000000002,-23.898468301912761,0.76879963946370644,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +7.7000000000000002,-18.750508813287261,8.7393736336703327,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +7.7000000000000002,26.194471802351387,2.9173305077171037,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +7.7000000000000002,-33.4763574363689,9.123955477562177,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +7.7000000000000002,16.227574118222492,6.7272584691642976,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-2.3242607964400293,-6.9879994797277796,-61,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,25.871577867087979,-9.1630318200791656,-50,0,0.20000000000000001,-0.10000000000000001,0,0,0,0 +10,26.779122526321913,4.0438763545298855,-47.5,0,0.21000000000000002,-0.099750000000000005,0.00050000000000000001,0,0,0 +10,-10.986895134543175,6.0506569481724064,-33.299999999999997,0,0.26680000000000004,-0.094310000000000005,0.0033400000000000005,0,0,0 +10,37.524437360707537,8.0396835365588935,-30,0,0.28000000000000003,-0.091999999999999998,0.0040000000000000001,0,0,0 +10,-11.120433344512115,-3.6125169496732479,-12.300000000000001,0,0.3508,-0.071450000000000014,0.0075399999999999998,0,0,0 +10,16.376350040745209,-2.4287988814413364,-2,0,0.39200000000000002,-0.053800000000000001,0.0096000000000000009,0,0,0 +10,-25.014363736779465,-8.6579887273638967,0,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 +10,-33.304844326120417,4.7484034743894181,1.5,0,0.40000000000000002,-0.050000000000000003,0.01,0,0,0 diff --git a/tests/data/currents_mdc/c2stof/current_profile_dynamic.txt b/tests/data/currents_mdc/c2stof/current_profile_dynamic.txt new file mode 100644 index 00000000..33ff2578 --- /dev/null +++ b/tests/data/currents_mdc/c2stof/current_profile_dynamic.txt @@ -0,0 +1,9 @@ +--------------------- MoorDyn dynamic currents File ---------------------------------- +x velocities only; depths that single precision rounds + + +-40.0 -12.3 -0.7 + +0.0 0.1 0.4 0.9 # comment +2.5 0.2 0.5 1.1 # comment +6.0 0.05 0.3 0.6 # comment diff --git a/tests/data/currents_mdc/c2stof/currents.dat b/tests/data/currents_mdc/c2stof/currents.dat new file mode 100644 index 00000000..8d6d6b1b --- /dev/null +++ b/tests/data/currents_mdc/c2stof/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 2): x velocities, single-precision depths +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +10.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +2 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c2stof/points.txt b/tests/data/currents_mdc/c2stof/points.txt new file mode 100644 index 00000000..2baeb06a --- /dev/null +++ b/tests/data/currents_mdc/c2stof/points.txt @@ -0,0 +1,64 @@ +0.0 1.0 2.0 -45.0 +0.0 1.0 2.0 -40.0 +0.0 1.0 2.0 -25.0 +0.0 1.0 2.0 -12.3 +0.0 1.0 2.0 -12.29999999 +0.0 1.0 2.0 -6.0 +0.0 1.0 2.0 -0.7 +0.0 1.0 2.0 0.4 +1.1 1.0 2.0 -45.0 +1.1 1.0 2.0 -40.0 +1.1 1.0 2.0 -25.0 +1.1 1.0 2.0 -12.3 +1.1 1.0 2.0 -12.29999999 +1.1 1.0 2.0 -6.0 +1.1 1.0 2.0 -0.7 +1.1 1.0 2.0 0.4 +2.5 1.0 2.0 -45.0 +2.5 1.0 2.0 -40.0 +2.5 1.0 2.0 -25.0 +2.5 1.0 2.0 -12.3 +2.5 1.0 2.0 -12.29999999 +2.5 1.0 2.0 -6.0 +2.5 1.0 2.0 -0.7 +2.5 1.0 2.0 0.4 +4.2 1.0 2.0 -45.0 +4.2 1.0 2.0 -40.0 +4.2 1.0 2.0 -25.0 +4.2 1.0 2.0 -12.3 +4.2 1.0 2.0 -12.29999999 +4.2 1.0 2.0 -6.0 +4.2 1.0 2.0 -0.7 +4.2 1.0 2.0 0.4 +5.9 1.0 2.0 -45.0 +5.9 1.0 2.0 -40.0 +5.9 1.0 2.0 -25.0 +5.9 1.0 2.0 -12.3 +5.9 1.0 2.0 -12.29999999 +5.9 1.0 2.0 -6.0 +5.9 1.0 2.0 -0.7 +5.9 1.0 2.0 0.4 +6.0 1.0 2.0 -45.0 +6.0 1.0 2.0 -40.0 +6.0 1.0 2.0 -25.0 +6.0 1.0 2.0 -12.3 +6.0 1.0 2.0 -12.29999999 +6.0 1.0 2.0 -6.0 +6.0 1.0 2.0 -0.7 +6.0 1.0 2.0 0.4 +7.3 1.0 2.0 -45.0 +7.3 1.0 2.0 -40.0 +7.3 1.0 2.0 -25.0 +7.3 1.0 2.0 -12.3 +7.3 1.0 2.0 -12.29999999 +7.3 1.0 2.0 -6.0 +7.3 1.0 2.0 -0.7 +7.3 1.0 2.0 0.4 +9.9 1.0 2.0 -45.0 +9.9 1.0 2.0 -40.0 +9.9 1.0 2.0 -25.0 +9.9 1.0 2.0 -12.3 +9.9 1.0 2.0 -12.29999999 +9.9 1.0 2.0 -6.0 +9.9 1.0 2.0 -0.7 +9.9 1.0 2.0 0.4 diff --git a/tests/data/currents_mdc/c2stof/ref_moordyn_c.csv b/tests/data/currents_mdc/c2stof/ref_moordyn_c.csv new file mode 100644 index 00000000..7b5e8cc4 --- /dev/null +++ b/tests/data/currents_mdc/c2stof/ref_moordyn_c.csv @@ -0,0 +1,65 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +0,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +0,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +0,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +0,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +0,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +0,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +0,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +1.0999999999999892,1,2,-45,0,0.14399999999999957,0,0,0,0,0 +1.1000000000000001,1,2,-40,0,0.14400000000000002,0,0,0,0,0 +1.1000000000000001,1,2,-25,0,0.30645487476483063,0,0,0,0,0 +1.1000000000000001,1,2,-12.300000000000001,0,0.44400000894480723,0,0,0,0,0 +1.1000000000000001,1,2,-12.29999999,0,0.44400000941377271,0,0,0,0,0 +1.1000000000000001,1,2,-6,0,0.73944827964529836,0,0,0,0,0 +1.1000000000000001,1,2,-0.69999999999999996,0,0.98799999944094974,0,0,0,0,0 +1.1000000000000001,1,2,0.40000000000000002,0,0.9880000000000001,0,0,0,0,0 +2.499999999999845,1,2,-45,0,0.19999999999999382,0,0,0,0,0 +2.5,1,2,-40,0,0.20000000000000001,0,0,0,0,0 +2.5,1,2,-25,0,0.36245487476483063,0,0,0,0,0 +2.5,1,2,-12.300000000000001,0,0.50000000986559623,0,0,0,0,0 +2.5,1,2,-12.29999999,0,0.50000001038283759,0,0,0,0,0 +2.5,1,2,-6,0,0.82586207313819671,0,0,0,0,0 +2.5,1,2,-0.69999999999999996,0,1.0999999993834004,0,0,0,0,0 +2.5,1,2,0.40000000000000002,0,1.1000000000000001,0,0,0,0,0 +4.1999999999998998,1,2,-45,0,0.12714285714286144,0,0,0,0,0 +4.1999999999999993,1,2,-40,0,0.12714285714285717,0,0,0,0,0 +4.1999999999999993,1,2,-25,0,0.27644662299815387,0,0,0,0,0 +4.1999999999999993,1,2,-12.300000000000001,0,0.40285715032680852,0,0,0,0,0 +4.1999999999999993,1,2,-12.29999999,0,0.4028571507184342,0,0,0,0,0 +4.1999999999999993,1,2,-6,0,0.64958128394749182,0,0,0,0,0 +4.1999999999999993,1,2,-0.69999999999999996,0,0.8571428566760031,0,0,0,0,0 +4.1999999999999993,1,2,0.40000000000000002,0,0.85714285714285721,0,0,0,0,0 +5.9000000000005652,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +5.9000000000005652,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +5.9000000000005652,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +5.9000000000005652,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +5.9000000000005652,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +5.9000000000005652,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +5.9000000000005652,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +5.9000000000005652,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +6.000000000000032,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +6.000000000000032,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +6.000000000000032,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +6.000000000000032,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +6.000000000000032,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +6.000000000000032,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +6.000000000000032,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +6.000000000000032,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +7.3000000000004324,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +7.3000000000004324,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +7.3000000000004324,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +7.3000000000004324,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +7.3000000000004324,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +7.3000000000004324,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +7.3000000000004324,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +7.3000000000004324,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +9.8999999999992472,1,2,-45,0,0.19599999999996989,0,0,0,0,0 +9.9000000000000004,1,2,-40,0,0.19600000000000001,0,0,0,0,0 +9.9000000000000004,1,2,-25,0,0.35845487476483062,0,0,0,0,0 +9.9000000000000004,1,2,-12.300000000000001,0,0.49600000979982556,0,0,0,0,0 +9.9000000000000004,1,2,-12.29999999,0,0.49600001031361862,0,0,0,0,0 +9.9000000000000004,1,2,-6,0,0.81968965931727533,0,0,0,0,0 +9.9000000000000004,1,2,-0.69999999999999996,0,1.0919999993875111,0,0,0,0,0 +9.9000000000000004,1,2,0.40000000000000002,0,1.0920000000000001,0,0,0,0,0 diff --git a/tests/data/currents_mdc/c2stof/ref_python.csv b/tests/data/currents_mdc/c2stof/ref_python.csv new file mode 100644 index 00000000..9b0a5f78 --- /dev/null +++ b/tests/data/currents_mdc/c2stof/ref_python.csv @@ -0,0 +1,65 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +0,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +0,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +0,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +0,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +0,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +0,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +0,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +1.1000000000000001,1,2,-45,0,0.14400000000000002,0,0,0,0,0 +1.1000000000000001,1,2,-40,0,0.14400000000000002,0,0,0,0,0 +1.1000000000000001,1,2,-25,0,0.30645487476483063,0,0,0,0,0 +1.1000000000000001,1,2,-12.300000000000001,0,0.44400000894480723,0,0,0,0,0 +1.1000000000000001,1,2,-12.29999999,0,0.44400000941377271,0,0,0,0,0 +1.1000000000000001,1,2,-6,0,0.73944827964529836,0,0,0,0,0 +1.1000000000000001,1,2,-0.69999999999999996,0,0.98799999944094974,0,0,0,0,0 +1.1000000000000001,1,2,0.40000000000000002,0,0.9880000000000001,0,0,0,0,0 +2.5,1,2,-45,0,0.20000000000000001,0,0,0,0,0 +2.5,1,2,-40,0,0.20000000000000001,0,0,0,0,0 +2.5,1,2,-25,0,0.36245487476483063,0,0,0,0,0 +2.5,1,2,-12.300000000000001,0,0.50000000986559623,0,0,0,0,0 +2.5,1,2,-12.29999999,0,0.50000001038283759,0,0,0,0,0 +2.5,1,2,-6,0,0.82586207313819671,0,0,0,0,0 +2.5,1,2,-0.69999999999999996,0,1.0999999993834004,0,0,0,0,0 +2.5,1,2,0.40000000000000002,0,1.1000000000000001,0,0,0,0,0 +4.2000000000000002,1,2,-45,0,0.12714285714285711,0,0,0,0,0 +4.2000000000000002,1,2,-40,0,0.12714285714285711,0,0,0,0,0 +4.2000000000000002,1,2,-25,0,0.27644662299815381,0,0,0,0,0 +4.2000000000000002,1,2,-12.300000000000001,0,0.40285715032680847,0,0,0,0,0 +4.2000000000000002,1,2,-12.29999999,0,0.40285715071843414,0,0,0,0,0 +4.2000000000000002,1,2,-6,0,0.64958128394749171,0,0,0,0,0 +4.2000000000000002,1,2,-0.69999999999999996,0,0.85714285667600298,0,0,0,0,0 +4.2000000000000002,1,2,0.40000000000000002,0,0.8571428571428571,0,0,0,0,0 +5.9000000000000004,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +5.9000000000000004,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +5.9000000000000004,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +5.9000000000000004,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +5.9000000000000004,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +5.9000000000000004,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +5.9000000000000004,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +5.9000000000000004,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +6,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +6,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +6,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +6,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +6,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +6,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +6,1,2,-0.69999999999999996,0,0.89999999948616705,0,0,0,0,0 +6,1,2,0.40000000000000002,0,0.90000000000000013,0,0,0,0,0 +7.2999999999999998,1,2,-45,0,0.10000000000000001,0,0,0,0,0 +7.2999999999999998,1,2,-40,0,0.10000000000000001,0,0,0,0,0 +7.2999999999999998,1,2,-25,0,0.26245487476483065,0,0,0,0,0 +7.2999999999999998,1,2,-12.300000000000001,0,0.40000000822133014,0,0,0,0,0 +7.2999999999999998,1,2,-12.29999999,0,0.40000000865236468,0,0,0,0,0 +7.2999999999999998,1,2,-6,0,0.67155172761516391,0,0,0,0,0 +7.2999999999999998,1,2,-0.69999999999999996,0,0.89999999948616694,0,0,0,0,0 +7.2999999999999998,1,2,0.40000000000000002,0,0.90000000000000002,0,0,0,0,0 +9.9000000000000004,1,2,-45,0,0.19600000000000001,0,0,0,0,0 +9.9000000000000004,1,2,-40,0,0.19600000000000001,0,0,0,0,0 +9.9000000000000004,1,2,-25,0,0.35845487476483062,0,0,0,0,0 +9.9000000000000004,1,2,-12.300000000000001,0,0.49600000979982556,0,0,0,0,0 +9.9000000000000004,1,2,-12.29999999,0,0.49600001031361862,0,0,0,0,0 +9.9000000000000004,1,2,-6,0,0.81968965931727533,0,0,0,0,0 +9.9000000000000004,1,2,-0.69999999999999996,0,1.0919999993875111,0,0,0,0,0 +9.9000000000000004,1,2,0.40000000000000002,0,1.0920000000000001,0,0,0,0,0 diff --git a/tests/data/currents_mdc/c5/current_profile_4d.txt b/tests/data/currents_mdc/c5/current_profile_4d.txt new file mode 100644 index 00000000..2fc66ccb --- /dev/null +++ b/tests/data/currents_mdc/c5/current_profile_4d.txt @@ -0,0 +1,134 @@ +4 2 4 4 +-60.0 -20.0 10.0 50.0 +-30.0 30.0 +-50.0 -25.0 -10.0 0.0 +0.0 5.0 12.0 20.0 +x y z t ux uy uz +50.0 30.0 -25.0 0.0 0.543125 -0.040229 -0.011969 +-60.0 30.0 -50.0 5.0 0.073064 -0.040229 0.001662 +10.0 30.0 0.0 5.0 0.824311 0.228060 0.003973 +10.0 30.0 -25.0 5.0 0.566714 0.228060 -0.014914 +-60.0 -30.0 -10.0 20.0 -0.037638 -0.011940 0.009292 +-60.0 30.0 -25.0 12.0 0.069600 0.074560 0.015706 +50.0 -30.0 -10.0 12.0 0.415652 -0.289620 0.019709 +10.0 -30.0 0.0 12.0 0.288134 -0.145769 0.009236 +10.0 -30.0 -10.0 20.0 0.278520 -0.280229 -0.003973 +50.0 -30.0 -50.0 0.0 0.228750 -0.280229 0.019178 +-20.0 -30.0 0.0 0.0 0.190000 -0.011940 0.000000 +50.0 30.0 -25.0 12.0 0.422953 -0.049620 -0.001997 +-60.0 -30.0 -10.0 5.0 -0.065570 -0.280229 -0.016170 +10.0 30.0 0.0 20.0 0.473161 -0.040229 0.014347 +-20.0 -30.0 -25.0 0.0 0.130625 -0.011940 -0.011969 +50.0 -30.0 -25.0 20.0 0.360785 -0.162159 0.019950 +-20.0 -30.0 -25.0 12.0 0.101723 0.076013 0.006261 +10.0 -30.0 -10.0 12.0 0.252117 -0.145769 -0.009938 +-60.0 30.0 0.0 12.0 0.101236 0.074560 -0.005172 +-60.0 30.0 -50.0 12.0 0.037964 0.074560 -0.019993 +-60.0 -30.0 -50.0 20.0 -0.016130 -0.011940 0.007330 +50.0 30.0 -10.0 12.0 0.538304 -0.049620 0.019709 +-20.0 30.0 -10.0 12.0 0.252117 0.316013 -0.018504 +-20.0 -30.0 -25.0 5.0 0.195774 0.055517 -0.004785 +10.0 30.0 -50.0 0.0 0.206250 0.295517 0.019178 +50.0 -30.0 -25.0 12.0 0.326584 -0.289620 -0.001997 +50.0 30.0 0.0 12.0 0.615204 -0.049620 0.013509 +-20.0 30.0 -50.0 5.0 0.207951 0.295517 0.015455 +50.0 30.0 -50.0 5.0 0.444004 -0.077998 0.015136 +-60.0 30.0 0.0 20.0 0.111838 0.228060 0.019923 +10.0 -30.0 -25.0 12.0 0.198092 -0.145769 -0.018016 +10.0 -30.0 0.0 0.0 0.370000 0.055517 0.000000 +50.0 30.0 -50.0 20.0 0.254862 0.077841 -0.016829 +10.0 -30.0 -10.0 5.0 0.485220 -0.011940 -0.014347 +-60.0 30.0 -25.0 0.0 0.089375 -0.077998 -0.011969 +-20.0 30.0 -50.0 12.0 0.108050 0.316013 0.006352 +-60.0 -30.0 -25.0 20.0 -0.029573 -0.011940 -0.017009 +-20.0 30.0 -25.0 12.0 0.198092 0.316013 0.006261 +50.0 30.0 -25.0 5.0 0.814007 -0.077998 -0.019950 +-60.0 30.0 0.0 5.0 0.194837 -0.040229 -0.018641 +10.0 -30.0 -25.0 20.0 0.218837 -0.280229 -0.019833 +50.0 30.0 -50.0 0.0 0.296250 -0.040229 0.019178 +-20.0 30.0 -25.0 20.0 0.218837 0.228060 0.016366 +50.0 -30.0 0.0 5.0 0.914236 -0.317998 0.016829 +50.0 -30.0 -25.0 0.0 0.419375 -0.280229 -0.011969 +10.0 30.0 -10.0 5.0 0.721272 0.228060 -0.014347 +-20.0 -30.0 -50.0 0.0 0.071250 -0.011940 0.019178 +10.0 -30.0 -25.0 0.0 0.254375 0.055517 -0.011969 +-20.0 -30.0 -10.0 12.0 0.129465 0.076013 -0.018504 +-60.0 -30.0 -25.0 5.0 -0.051519 -0.280229 0.010597 +-20.0 -30.0 -25.0 20.0 0.112376 -0.011940 0.016366 +-20.0 -30.0 -10.0 0.0 0.166250 -0.011940 -0.016829 +-20.0 30.0 0.0 0.0 0.370000 0.228060 0.000000 +-60.0 30.0 -25.0 20.0 0.076889 0.228060 -0.017009 +50.0 -30.0 0.0 12.0 0.475031 -0.289620 0.013509 +-60.0 30.0 -50.0 20.0 0.041939 0.228060 0.007330 +50.0 30.0 -10.0 20.0 0.594677 0.077841 0.002822 +-60.0 -30.0 -25.0 12.0 -0.026769 -0.165440 0.015706 +-20.0 30.0 -50.0 0.0 0.138750 0.228060 0.019178 +-60.0 -30.0 -10.0 0.0 -0.043750 -0.317998 -0.016829 +-60.0 -30.0 -50.0 5.0 -0.028102 -0.280229 0.001662 +50.0 -30.0 -50.0 20.0 0.196792 -0.162159 -0.016829 +50.0 -30.0 -10.0 5.0 0.799956 -0.317998 0.000000 +-60.0 -30.0 0.0 5.0 -0.074937 -0.280229 -0.018641 +50.0 30.0 -10.0 0.0 0.691250 -0.040229 -0.016829 +50.0 -30.0 -50.0 12.0 0.178137 -0.289620 -0.010310 +10.0 30.0 -10.0 20.0 0.414016 -0.040229 -0.003973 +50.0 -30.0 -50.0 5.0 0.342838 -0.317998 0.015136 +-20.0 30.0 0.0 20.0 0.318308 0.228060 -0.019991 +10.0 30.0 -10.0 12.0 0.374769 0.094231 -0.009938 +50.0 -30.0 0.0 0.0 0.610000 -0.280229 0.000000 +-20.0 30.0 -10.0 20.0 0.278520 0.228060 -0.010310 +-60.0 -30.0 -50.0 12.0 -0.014601 -0.165440 -0.019993 +-20.0 30.0 -25.0 0.0 0.254375 0.228060 -0.011969 +-60.0 30.0 -25.0 5.0 0.133951 -0.040229 0.010597 +-20.0 30.0 -10.0 0.0 0.323750 0.228060 -0.016829 +10.0 30.0 0.0 0.0 0.550000 0.295517 0.000000 +50.0 30.0 0.0 20.0 0.679631 0.077841 -0.015136 +-60.0 -30.0 -25.0 0.0 -0.034375 -0.317998 -0.011969 +-20.0 30.0 0.0 5.0 0.554537 0.295517 -0.007788 +50.0 30.0 -10.0 5.0 1.036009 -0.077998 0.000000 +-60.0 30.0 -10.0 20.0 0.097858 0.228060 0.009292 +10.0 30.0 0.0 12.0 0.428307 0.094231 0.009236 +-20.0 -30.0 0.0 20.0 0.163456 -0.011940 -0.019991 +50.0 -30.0 -10.0 0.0 0.533750 -0.280229 -0.016829 +10.0 30.0 -25.0 20.0 0.325298 -0.040229 -0.019833 +10.0 -30.0 0.0 20.0 0.318308 -0.280229 0.014347 +10.0 -30.0 -25.0 5.0 0.381244 -0.011940 -0.014914 +10.0 30.0 -25.0 0.0 0.378125 0.295517 -0.011969 +-20.0 -30.0 -50.0 12.0 0.055485 0.076013 0.006352 +10.0 30.0 -50.0 20.0 0.177435 -0.040229 0.017432 +-20.0 30.0 -25.0 5.0 0.381244 0.295517 -0.004785 +10.0 30.0 -10.0 0.0 0.481250 0.295517 -0.016829 +-20.0 -30.0 0.0 12.0 0.147961 0.076013 -0.016384 +-60.0 30.0 -10.0 12.0 0.088582 0.074560 0.013462 +-20.0 -30.0 -50.0 20.0 0.061296 -0.011940 -0.006231 +-60.0 -30.0 -10.0 12.0 -0.034070 -0.165440 0.013462 +10.0 30.0 -25.0 12.0 0.294461 0.094231 -0.018016 +-20.0 -30.0 -10.0 5.0 0.249167 0.055517 -0.019709 +50.0 -30.0 -10.0 20.0 0.459181 -0.162159 0.002822 +50.0 -30.0 0.0 20.0 0.524778 -0.162159 -0.015136 +50.0 30.0 0.0 5.0 1.184011 -0.077998 0.016829 +50.0 30.0 -25.0 20.0 0.467246 0.077841 0.019950 +-60.0 -30.0 0.0 12.0 -0.038937 -0.165440 -0.005172 +10.0 30.0 -50.0 12.0 0.160615 0.094231 0.019631 +-20.0 30.0 0.0 12.0 0.288134 0.316013 -0.016384 +-60.0 -30.0 0.0 0.0 -0.050000 -0.317998 0.000000 +-60.0 -30.0 -50.0 0.0 -0.018750 -0.317998 0.019178 +50.0 30.0 0.0 0.0 0.790000 -0.040229 0.000000 +-60.0 30.0 0.0 0.0 0.130000 -0.077998 0.000000 +10.0 -30.0 0.0 5.0 0.554537 -0.011940 0.003973 +50.0 30.0 -50.0 12.0 0.230702 -0.049620 -0.010310 +-20.0 30.0 -50.0 20.0 0.119366 0.228060 -0.006231 +-60.0 -30.0 0.0 20.0 -0.043015 -0.011940 0.019923 +10.0 30.0 -50.0 5.0 0.309117 0.228060 0.019923 +10.0 -30.0 -50.0 0.0 0.138750 0.055517 0.019178 +10.0 -30.0 -50.0 20.0 0.119366 -0.280229 0.017432 +10.0 -30.0 -50.0 5.0 0.207951 -0.011940 0.019923 +-20.0 -30.0 -50.0 5.0 0.106786 0.055517 0.015455 +-60.0 30.0 -50.0 0.0 0.048750 -0.077998 0.019178 +-60.0 30.0 -10.0 0.0 0.113750 -0.077998 -0.016829 +-60.0 30.0 -10.0 5.0 0.170483 -0.040229 -0.016170 +10.0 -30.0 -10.0 0.0 0.323750 0.055517 -0.016829 +-20.0 -30.0 0.0 5.0 0.284762 0.055517 -0.007788 +50.0 -30.0 -25.0 5.0 0.628537 -0.317998 -0.019950 +-20.0 -30.0 -10.0 20.0 0.143024 -0.011940 -0.010310 +-20.0 30.0 -10.0 5.0 0.485220 0.295517 -0.019709 +10.0 -30.0 -50.0 12.0 0.108050 -0.145769 0.019631 diff --git a/tests/data/currents_mdc/c5/currents.dat b/tests/data/currents_mdc/c5/currents.dat new file mode 100644 index 00000000..a0ec6476 --- /dev/null +++ b/tests/data/currents_mdc/c5/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 5): sheared in x, y, z and varying in time +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +52.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +5 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c5/points.txt b/tests/data/currents_mdc/c5/points.txt new file mode 100644 index 00000000..f17109d7 --- /dev/null +++ b/tests/data/currents_mdc/c5/points.txt @@ -0,0 +1,120 @@ +0.0 50.005736104870834 21.485148135208114 -12.03504529579837 +0.0 51.16739142159362 30.109157160400187 2.77804754336114 +0.0 6.023218242336341 1.2110045819180328 -25.537592572473756 +0.0 -43.999946793023526 -36.46357883420958 -38.8657305369626 +0.0 64.77659606874144 27.812081604590787 -44.96740181451075 +0.0 -9.396788772823712 -25.887530634381672 -36.13750087354212 +0.0 45.251982367198806 22.894432429909045 -10.025624589939213 +0.0 -47.69460592017943 -25.23463498455225 -49.737213382204075 +0.0 -20.0 30.0 -25.0 +0.0 80.0 -50.0 -60.0 +1.3 -58.899807932234665 -30.39142908919966 -8.965143194108066 +1.3 21.252373997194326 3.9151172762301627 -21.78579826961007 +1.3 -42.896718803798365 -31.6252023796892 -10.931938360694204 +1.3 40.95497251512482 -23.098472646607576 -47.04095807901918 +1.3 -58.40236409236805 -1.717741117922671 -32.240068899394885 +1.3 -39.28522613131827 -2.750033716563152 -2.764816725072336 +1.3 30.056521115539553 29.92851724372612 -8.577013349796445 +1.3 7.899360778110051 -35.74705662373262 -22.259781958060287 +1.3 -20.0 30.0 -25.0 +1.3 80.0 -50.0 -60.0 +5.0 0.7065075090763884 15.816164666472503 -53.09174711726344 +5.0 -57.270676763422955 -38.261003995975045 -55.52314392314601 +5.0 -55.58317946049503 -11.267112332013653 -3.740230508414733 +5.0 -55.75954299912635 -30.260916044615875 -4.71530844121822 +5.0 2.7409365902909713 28.60201112028858 -25.111807766941638 +5.0 -26.90563341915059 -18.420651494160794 -46.74319184047667 +5.0 -16.112072543782354 -28.66106348420395 -35.78742733945995 +5.0 47.653715716084676 -34.975665237240214 -12.915985400675432 +5.0 -20.0 30.0 -25.0 +5.0 80.0 -50.0 -60.0 +7.75 -23.782540347753034 31.640590099832778 -42.28125833560091 +7.75 50.69991606594928 21.248156177521807 -9.654421427071632 +7.75 -30.862612828868855 -29.963976322550394 -20.768673745665197 +7.75 -29.029779494510834 30.562070864728852 -24.577795503163962 +7.75 44.09726123487947 4.362778336534262 -51.969286230642126 +7.75 31.828650476772225 13.454382521358369 -37.5080521282738 +7.75 19.279805725190684 -29.432058008061055 -28.273968928784587 +7.75 -65.08849879000421 -4.109621333194227 -4.036982128899382 +7.75 -20.0 30.0 -25.0 +7.75 80.0 -50.0 -60.0 +12.0 38.748666590388865 -21.181534454098497 -53.13415238908913 +12.0 60.51738172018568 -8.000517269215315 -30.269613490802683 +12.0 45.4904736824882 -20.53496189527431 -11.965353621749735 +12.0 -30.60921802116391 -8.367142456949964 -28.048800274861485 +12.0 6.5945258766081025 0.5976011179957794 -53.35003655203993 +12.0 -45.00122797001535 2.7927463368735346 -12.885058684263356 +12.0 -57.750808960729856 14.274812330751992 -51.41621928615766 +12.0 -38.21431287489124 -5.611593819785831 -38.05239099506522 +12.0 -20.0 30.0 -25.0 +12.0 80.0 -50.0 -60.0 +14.1 52.04916595254974 0.8397829896256681 -50.5254792903469 +14.1 -50.08982512680857 17.159357032043026 0.08197299558629823 +14.1 55.566790108726224 -1.3303810172184072 -5.783035559534419 +14.1 -7.7626286311559625 -36.19363330763099 -40.13305866442997 +14.1 -38.482282748346435 -35.635152454396675 -7.835478838758128 +14.1 -32.11856910180703 32.395467883591024 -32.95814835720526 +14.1 -73.6535368892532 -5.30135437991148 2.6584938454922877 +14.1 22.808794396358067 -7.789530349394838 -20.30813130952022 +14.1 -20.0 30.0 -25.0 +14.1 80.0 -50.0 -60.0 +19.9 -22.942982304194317 30.544962591266923 -15.080061000458585 +19.9 -65.42200831328056 -17.318980426019834 -57.38657085664685 +19.9 -43.52656302826329 12.98234031670659 -19.490002308485693 +19.9 -45.75289814043507 -21.849395089813164 -14.954187063917864 +19.9 -46.40889670675177 -11.11361856588994 -11.869225071677462 +19.9 7.817324925898902 1.6818490920869351 -47.59117384546461 +19.9 64.1701804878239 36.58045738127423 -51.528910673324326 +19.9 1.046154571541365 2.3254772953772544 -41.800453413679875 +19.9 -20.0 30.0 -25.0 +19.9 80.0 -50.0 -60.0 +20.0 57.773196593431464 17.058190764761036 -24.207950794350978 +20.0 23.057160140338723 -37.34221341001789 -8.834977048711913 +20.0 -31.293205806228023 -39.39219742918535 -23.833023124277616 +20.0 40.574543650916894 -9.522886134103565 -19.788490814814573 +20.0 -35.56348448840908 -28.633726656316636 -12.438347765451326 +20.0 -14.200725792275222 8.404189797772268 -45.858535484595734 +20.0 32.4591132356357 -9.369352758588391 -28.147220365362394 +20.0 9.749103743740221 -20.448522155057933 -55.76107949098163 +20.0 -20.0 30.0 -25.0 +20.0 80.0 -50.0 -60.0 +22.5 52.955030493423436 27.395038157243647 -8.88208286321239 +22.5 43.86863288855157 11.787804359995498 -45.971185031226426 +22.5 -12.541703804709933 -29.44195004306782 -12.059168022088059 +22.5 3.2739774302568634 1.2193424360429432 -2.059393683204725 +22.5 -11.23086057249833 -30.278984685702213 -43.42321550481976 +22.5 -32.98010335458405 13.337287228011547 -49.1668254070279 +22.5 51.84530735485504 -12.92926670713549 -13.079923721627608 +22.5 -56.63621197037746 -29.049078574654985 0.6671267349769892 +22.5 -20.0 30.0 -25.0 +22.5 80.0 -50.0 -60.0 +25.0 -22.453078275656743 -8.614168218366327 -36.18129411612183 +25.0 18.544626904752903 -6.413485144547558 -3.134056229573595 +25.0 -72.79540507726888 -2.604892791153773 -17.33456187600241 +25.0 23.643734869303813 -14.318104711484274 -38.443908132957965 +25.0 54.15593720049384 -16.36815259911156 -41.970930547766 +25.0 -63.16075536328109 -31.55672696643327 -53.955593748659936 +25.0 -10.255299548027182 -11.332684738402683 -37.872136745137716 +25.0 61.98323913532661 9.271165380687961 -22.29875762275354 +25.0 -20.0 30.0 -25.0 +25.0 80.0 -50.0 -60.0 +31.4 24.450592872595692 32.49951397511472 -24.423911467133188 +31.4 -33.5130746533869 30.69218710941516 -10.399877719313537 +31.4 17.1726462947003 -28.057833796119702 -0.7198816827221464 +31.4 -16.00977467511688 7.604308980708758 -38.79594561730211 +31.4 49.56611755613564 24.29579555489832 -39.2383357640435 +31.4 38.788165897626385 -17.477565914614843 -0.5943161923928244 +31.4 -60.26063497484097 2.687179369261031 -39.94385912639674 +31.4 9.324310432071925 13.805370194256845 -52.20335890368953 +31.4 -20.0 30.0 -25.0 +31.4 80.0 -50.0 -60.0 +51.0 -14.136121752396775 -29.809806473708225 -47.36327497061714 +51.0 2.089085739222412 37.690841817195974 -19.510792555907237 +51.0 41.08115516665001 22.464695846937673 -49.82341698468653 +51.0 -53.55266041769373 -8.09311325716213 -6.87308478089318 +51.0 -58.45177522255305 -29.717639119292897 -10.922401606337985 +51.0 -54.24339530261055 -3.343601310862148 -53.34523254137063 +51.0 -22.39801804532383 -1.1037955731224685 -55.27030896441515 +51.0 -41.70627881523723 12.712612818433882 -5.202671781924252 +51.0 -20.0 30.0 -25.0 +51.0 80.0 -50.0 -60.0 diff --git a/tests/data/currents_mdc/c5/ref_moordyn_c.csv b/tests/data/currents_mdc/c5/ref_moordyn_c.csv new file mode 100644 index 00000000..861bd64b --- /dev/null +++ b/tests/data/currents_mdc/c5/ref_moordyn_c.csv @@ -0,0 +1,121 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,50.005736104870834,21.485148135208114,-12.035045295798369,0,0.6494522456551074,-0.074288407459167552,-0.01616964532416133,0,0,0 +0,51.167391421593621,30.109157160400187,2.77804754336114,0,0.79000000000000004,-0.040229000000000001,0,0,0,0 +0,6.0232182423363412,1.2110045819180328,-25.537592572473756,0,0.29938824301819683,0.17141895942678156,-0.011299224165806398,0,0,0 +0,-43.999946793023526,-36.463578834209578,-38.865730536962602,0,0.023652369088504571,-0.19557439288947986,0.0053060363613909658,0,0,0 +0,64.776596068741441,27.812081604590787,-44.967401814510751,0,0.34307258960636844,-0.048980673581636859,0.012907986572662657,0,0,0 +0,-9.3967887728237116,-25.887530634381672,-36.137500873542123,0,0.1458190555629508,0.028351904787527672,0.0019069895883286579,0,0,0 +0,45.251982367198806,22.894432429909045,-10.025624589939213,0,0.64743370257809252,-0.02879807207680209,-0.016820697632859694,0,0,0 +0,-47.694605920179427,-25.234634984552251,-49.737213382204075,0,0.014423417933480174,-0.20478243240616587,0.018850599408620414,0,0,0 +0,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +0,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +1.2999999999999667,-58.899807932234665,-30.391429089199661,-8.9651431941080659,0,-0.043532380456373761,-0.29954768913939644,-0.015450048069114644,0,0,0 +1.3,21.252373997194326,3.9151172762301627,-21.785798269610069,0,0.44329221989549045,0.081361553218357058,-0.013538302200104832,0,0,0 +1.3,-42.896718803798365,-31.625202379689199,-10.931938360694204,0,0.051320312603987527,-0.17401270471232957,-0.016477069886027169,0,0,0 +1.3,40.954972515124823,-23.098472646607576,-47.040958079019177,0,0.2682795810497054,-0.18826747268181909,0.01460242321768365,0,0,0 +1.3,-58.402364092368053,-1.7177411179226709,-32.240068899394885,0,0.029966052524806289,-0.1825164942098727,-0.00017162095013376934,0,0,0 +1.3,-39.285226131318268,-2.7500337165631521,-2.7648167250723361,0,0.17018076901868001,-0.036682767005740517,-0.0071866449499301916,0,0,0 +1.3,30.056521115539553,29.92851724372612,-8.5770133497964451,0,0.67586019929943131,0.11321517750616376,-0.011891051058805949,0,0,0 +1.3,7.8993607781100508,-35.747056623732618,-22.259781958060287,0,0.29140141425636956,0.035710934880143513,-0.013231880022575101,0,0,0 +1.3,-20,30,-25,0,0.28736094000000001,0.24559882,-0.01010116,0,0,0 +1.3,80,-50,-60,0,0.25841288000000001,-0.29004894000000003,0.01812708,0,0,0 +5.0000000000002229,0.70650750907638837,15.816164666472503,-53.091747117263438,0,0.25386219309811342,0.19222169609789505,0.018538889185018347,0,0,0 +5.0000000000002229,-57.270676763422955,-38.261003995975045,-55.523143923146009,0,-0.018898176181614594,-0.25732001601530163,0.0026031388850520166,0,0,0 +5.0000000000002229,-55.583179460495032,-11.267112332013653,-3.7402305084147329,0,0.046717367709064657,-0.16822420360663545,-0.017112782179504134,0,0,0 +5.0000000000002229,-55.759542999126353,-30.260916044615875,-4.7153084412182196,0,-0.034635512035943256,-0.24463608809461357,-0.017044727644028861,0,0,0 +5.0000000000002229,2.7409365902909713,28.60201112028858,-25.111807766941638,0,0.51646259509400116,0.23879053249544263,-0.012323092620119968,0,0,0 +5.0000000000002229,-26.90563341915059,-18.420651494160794,-46.743191840476669,0,0.1142067716651891,0.043870924074704637,0.011093208251581449,0,0,0 +5.0000000000002229,-16.112072543782354,-28.66106348420395,-35.787427339459953,0,0.18002507612677399,0.052130481982715075,0.0034520858110215717,0,0,0 +5.0000000000002229,47.653715716084676,-34.975665237240214,-12.915985400675432,0,0.74893985472186353,-0.30004552311583549,-0.0044987919875947562,0,0,0 +5.0000000000002229,-20,30,-25,0,0.38124399999999414,0.29551700000000058,-0.004784999999999648,0,0,0 +5.0000000000002229,80,-50,-60,0,0.3428379999999947,-0.31799799999999906,0.01513599999999919,0,0,0 +7.7500000000009992,-23.782540347753034,31.640590099832778,-42.28125833560091,0,0.19909993654757027,0.27532266043072745,0.0072307514105965746,0,0,0 +7.7500000000009992,50.699916065949282,21.248156177521807,-9.6544214270716324,0,0.81656011565714914,-0.10185687528990872,0.0080117469713994194,0,0,0 +7.7500000000009992,-30.862612828868855,-29.963976322550394,-20.768673745665197,0,0.11246834986653645,-0.017404097009267695,-0.0020752046858118467,0,0,0 +7.7500000000009992,-29.029779494510834,30.562070864728852,-24.577795503163962,0,0.26602890686414682,0.23613859757504346,0.0019820218823236846,0,0,0 +7.7500000000009992,44.097261234879468,4.3627783365342623,-51.969286230642126,0,0.30898976781412085,-0.13363755560770668,0.0073040284758879286,0,0,0 +7.7500000000009992,31.828650476772225,13.454382521358369,-37.508052128273803,0,0.40772739750874276,-0.022943655652622102,-0.0012734242766106957,0,0,0 +7.7500000000009992,19.279805725190684,-29.432058008061055,-28.273968928784587,0,0.33599236489156287,-0.11846418019119137,-0.011219190322896174,0,0,0 +7.7500000000009992,-65.088498790004209,-4.1096213331942266,-4.0369821288993819,0,0.031947302125072033,-0.13157180676133193,-0.0097886861315053669,0,0,0 +7.7500000000009992,-20,30,-25,0,0.3092914285714024,0.30356900000000286,-0.00044549999999842264,0,0,0 +7.7500000000009992,80,-50,-60,0,0.27813403571426221,-0.30684949999999594,0.0051393571428535101,0,0,0 +11.999999999998112,38.748666590388865,-21.181534454098497,-53.134152389089131,0,0.19509269599200257,-0.20285837903314458,0.00046557148201607172,0,0,0 +12,60.517381720185682,-8.0005172692153153,-30.269613490802683,0,0.38425095739903525,-0.18736771907686128,-0.0028666870862236161,0,0,0 +12,45.490473682488201,-20.534961895274311,-11.965353621749735,0,0.47539953906280819,-0.2225823741888657,0.0092083154199232749,0,0,0 +12,-30.609218021163912,-8.3671424569499635,-28.048800274861485,0,0.11356111033404216,0.087115973989754208,0.0062523360734655269,0,0,0 +12,6.5945258766081025,0.59760111799577942,-53.350036552039931,0,0.15134269600375758,0.002359031070255431,0.017838479320703017,0,0,0 +12,-45.00122797001535,2.7927463368735346,-12.885058684263356,0,0.10614796016930442,0.052095910868263831,0.00023866052549963287,0,0,0 +12,-57.750808960729856,14.274812330751992,-51.416219286157663,0,0.03302831981986494,0.027455382939537247,-0.011158470278916675,0,0,0 +12,-38.214312874891242,-5.6115938197858313,-38.052390995065217,0,0.073779482552374084,0.056044051364241745,0.0025077513783129421,0,0,0 +12,-20,30,-25,0,0.2326012357142857,0.29930645,0.0058831500000000002,0,0,0 +12,80,-50,-60,0,0.20916970714285715,-0.27536565000000002,-0.0069256785714285705,0,0,0 +14.099999999998847,52.049165952549743,0.83978298962566811,-50.525479290346901,0,0.22151677985593671,-0.12852605054151023,-0.011005941071426332,0,0,0 +14.099999999999998,-50.08982512680857,17.159357032043026,0.081972995586298225,0,0.12691654361572441,0.10712276023372644,-0.0028313030020003802,0,0,0 +14.099999999999998,55.566790108726224,-1.3303810172184072,-5.7830355595344187,0,0.54293066689332492,-0.13720670656887363,0.0098628800760606032,0,0,0 +14.099999999999998,-7.7626286311559625,-36.193633307630989,-40.133058664429967,0,0.11038125919679376,-0.045150281885480079,0.0048333389536111843,0,0,0 +14.099999999999998,-38.482282748346435,-35.635152454396675,-7.835478838758128,0,0.06000131236229421,-0.031586113723443721,-0.0047059041576073563,0,0,0 +14.099999999999998,-32.118569101807033,32.395467883591024,-32.95814835720526,0,0.14699059331736422,0.23578669364356092,0.004937513539957368,0,0,0 +14.099999999999998,-73.653536889253203,-5.30135437991148,2.6584938454922877,0,0.020260864434408211,-0.025347601805360262,0.0018520210714285633,0,0,0 +14.099999999999998,22.808794396358067,-7.7895303493948376,-20.30813130952022,0,0.32215795444074791,-0.11433544796613135,-0.0081790632881922135,0,0,0 +14.099999999999998,-20,30,-25,0,0.21389033321428574,0.28791337249999999,0.0088002074999999971,0,0,0 +14.099999999999998,80,-50,-60,0,0.19234374964285716,-0.25188518250000003,-0.011005941071428566,0,0,0 +19.90000000000413,-22.942982304194317,30.544962591266923,-15.080061000458585,0,0.24568816887805098,0.22893735252924668,-0.0012431259903816251,0,0,0 +19.90000000000413,-65.422008313280557,-17.318980426019834,-57.386570856646848,0,-0.0038525263084207804,0.036865328295999901,0.0069884625000141056,0,0,0 +19.90000000000413,-43.52656302826329,12.98234031670659,-19.490002308485693,0,0.11555007775630025,0.15931359900970951,-0.0015021336557131052,0,0,0 +19.90000000000413,-45.752898140435072,-21.849395089813164,-14.954187063917864,0,0.041873228265616874,0.019818671354937666,-7.4214162081936378e-05,0,0,0 +19.90000000000413,-46.408896706751769,-11.11361856588994,-11.869225071677462,0,0.064547778819663948,0.062712279693809839,0.0016252573467924903,0,0,0 +19.90000000000413,7.8173249258989017,1.6818490920869351,-47.59117384546461,0,0.15732383928080862,-0.13234355889556593,0.012573946251593863,0,0,0 +19.90000000000413,64.170180487823899,36.580457381274229,-51.528910673324326,0,0.25456000000001244,0.07624773750006579,-0.016747512500003364,0,0,0 +19.90000000000413,1.0461545715413649,2.3254772953772544,-41.800453413679875,0,0.16955712013674804,-0.069345906483920805,0.0040445175704328677,0,0,0 +19.90000000000413,-20,30,-25,0,0.21857768750001072,0.22915941249995458,0.016239687500005213,0,0,0 +19.90000000000413,80,-50,-60,0,0.19655881250000962,-0.16375226249993419,-0.016747512500003364,0,0,0 +20.000000000000117,57.773196593431464,17.058190764761036,-24.207950794350978,0,0.52386960874343758,-0.091996236940955864,-0.012225623942630283,0,0,0 +20.000000000000117,23.057160140338723,-37.342213410017891,-8.834977048711913,0,0.39882921372964608,-0.054080232211954134,-0.014868382875277279,0,0,0 +20.000000000000117,-31.293205806228023,-39.392197429185352,-23.833023124277616,0,0.08582367787700193,-0.098349399566063408,-0.012347100507734052,0,0,0 +20.000000000000117,40.574543650916894,-9.5228861341035653,-19.788490814814573,0,0.46278460853257941,-0.11920656285193283,-0.013657528976000078,0,0,0 +20.000000000000117,-35.563484488409081,-28.633726656316636,-12.438347765451326,0,0.08505835773364917,-0.12555813001410424,-0.01603897532399377,0,0,0 +20.000000000000117,-14.200725792275222,8.4041897977722684,-45.858535484595734,0,0.14510472993832618,0.15471681386543876,0.014018232189548133,0,0,0 +20.000000000000117,32.459113235635698,-9.3693527585883913,-28.147220365362394,0,0.3672775297072905,-0.050474346844647147,-0.0080479410912023021,0,0,0 +20.000000000000117,9.7491037437402213,-20.448522155057933,-55.761079490981629,0,0.14893089599897535,0.093158754421151055,0.019178000000000001,0,0,0 +20.000000000000117,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +20.000000000000117,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +22.500000000003109,52.955030493423436,27.395038157243647,-8.8820828632123892,0,0.69534220195786633,-0.050648847371025429,-0.014947657250500131,0,0,0 +22.500000000003109,43.868632888551574,11.787804359995498,-45.971185031226426,0,0.29714608221072569,-0.061613233005008941,0.014158580006704377,0,0,0 +22.500000000003109,-12.541703804709933,-29.44195004306782,-12.059168022088059,0,0.20078547878443889,0.0070626760425847911,-0.016161829560843471,0,0,0 +22.500000000003109,3.2739774302568634,1.2193424360429432,-2.0593936832047248,0,0.41240507636159257,0.16527045959459968,-0.0034657536294652306,0,0,0 +22.500000000003109,-11.230860572498329,-30.278984685702213,-43.423215504819758,0,0.11092588240464683,0.0077779946120326744,0.010984115733144839,0,0,0 +22.500000000003109,-32.980103354584053,13.337287228011547,-49.1668254070279,0,0.093320935566570007,0.062092537099614042,0.018139964438107919,0,0,0 +22.500000000003109,51.845307354855038,-12.92926670713549,-13.079923721627608,0,0.55310463565082357,-0.21194606682854197,-0.015831104714192655,0,0,0 +22.500000000003109,-56.63621197037746,-29.049078574654985,0.66712673497698916,0,-0.026964507546229716,-0.28845645837936457,0,0,0,0 +22.500000000003109,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +22.500000000003109,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +25.000000000003109,-22.453078275656743,-8.6141682183663271,-36.181294116121833,0,0.13114885304847251,0.054833721354301736,0.0019615507133953934,0,0,0 +25.000000000003109,18.544626904752903,-6.4134851445475576,-3.134056229573595,0,0.47275179045160198,0.078142451802692553,-0.0052743032287454542,0,0,0 +25.000000000003109,-72.795405077268882,-2.6048927911537731,-17.334561876002411,0,0.025211341011118087,-0.20841757116459161,-0.014452601952168149,0,0,0 +25.000000000003109,23.643734869303813,-14.318104711484274,-38.443908132957965,0,0.25915838290523485,0.0037238459682952807,0.0047804962646880323,0,0,0 +25.000000000003109,54.155937200493838,-16.368152599111561,-41.970930547766002,0,0.3094118972572793,-0.22570161039646974,0.0091747429508474074,0,0,0 +25.000000000003109,-63.160755363281091,-31.556726966433271,-53.955593748659936,0,-0.018750000000005814,-0.31799799999997652,0.01917799999998911,0,0,0 +25.000000000003109,-10.255299548027182,-11.332684738402683,-37.872136745137716,0,0.16033345976321967,0.084640869659361642,0.004068137728032625,0,0,0 +25.000000000003109,61.983239135326613,9.271165380687961,-22.298757622753541,0,0.52494678682921725,-0.12314433847727163,-0.012844202530230036,0,0,0 +25.000000000003109,-20,30,-25,0,0.2543750000000789,0.22806000000004195,-0.011968999999995534,0,0,0 +25.000000000003109,80,-50,-60,0,0.22875000000007095,-0.28022900000002349,0.019177999999997485,0,0,0 +31.400000000008301,24.450592872595692,32.499513975114724,-24.423911467133188,0,0.59922940346664688,0.10244614775531413,-0.015500010429039432,0,0,0 +31.400000000008301,-33.513074653386902,30.692187109415158,-10.399877719313537,0,0.340532321009405,0.19256312267712017,-0.01585666745889407,0,0,0 +31.400000000008301,17.1726462947003,-28.057833796119702,-0.71988168272214637,0,0.5623461839630014,-0.080001012488565379,0.0057728617842811797,0,0,0 +31.400000000008301,-16.00977467511688,7.6043089807087583,-38.79594561730211,0,0.22799700621150029,0.19695587144306304,0.0060544409604654393,0,0,0 +31.400000000008301,49.566117556135637,24.295795554898319,-39.238335764043498,0,0.53170491735409309,-0.09217128180312871,-0.0012556821051432632,0,0,0 +31.400000000008301,38.788165897626385,-17.477565914614843,-0.59431619239282441,0,0.78031385205614445,-0.18553906548709162,0.012211819395836746,0,0,0 +31.400000000008301,-60.260634974840968,2.6871793692610311,-39.943859126396738,0,0.032601393396397324,-0.12652248252281975,0.0030782051829418336,0,0,0 +31.400000000008301,9.3243104320719254,13.805370194256845,-52.203358903689526,0,0.25267479112199792,0.13873018576680027,0.019724277295129232,0,0,0 +31.400000000008301,-20,30,-25,0,0.34461359999978286,0.29961620000002426,-0.0025757999999869003,0,0,0 +31.400000000008301,80,-50,-60,0,0.30989779999980466,-0.31232239999996636,0.010046799999969824,0,0,0 +50.999999999956437,-14.136121752396775,-29.809806473708225,-47.363274970617141,0,0.10128512059791817,0.010223366803780573,0.015492908336962584,0,0,0 +51,2.089085739222412,37.690841817195974,-19.510792555907237,0,0.41787615073124457,0.27135266913421452,-0.013704080377416494,0,0,0 +51,41.081155166650007,22.464695846937673,-49.823416984686531,0,0.29614178902973093,-0.0043862680038635818,0.018357585250831317,0,0,0 +51,-53.55266041769373,-8.0931132571621305,-6.8730847808931799,0,0.0546912511121046,-0.17252811349401376,-0.012610915920695149,0,0,0 +51,-58.451775222553053,-29.717639119292897,-10.922401606337985,0,-0.037854428024012468,-0.29723877351781097,-0.016161947960753428,0,0,0 +51,-54.243395302610551,-3.3436013108621481,-53.345232541370628,0,0.026603789726054317,-0.15891772183032768,0.016071804242955477,0,0,0 +51,-22.39801804532383,-1.1037955731224685,-55.27030896441515,0,0.10817431972273717,0.098431940735969184,0.018268020685504247,0,0,0 +51,-41.706278815237233,12.712612818433882,-5.2026717819242521,0,0.19320446379057454,0.0030952642055547472,-0.010167724383337786,0,0,0 +51,-20,30,-25,0,0.27974879999999991,0.24155139999999994,-0.010532200000000005,0,0,0 +51,80,-50,-60,0,0.25156759999999989,-0.28778279999999995,0.018369600000000003,0,0,0 diff --git a/tests/data/currents_mdc/c5/ref_python.csv b/tests/data/currents_mdc/c5/ref_python.csv new file mode 100644 index 00000000..8982d040 --- /dev/null +++ b/tests/data/currents_mdc/c5/ref_python.csv @@ -0,0 +1,121 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,50.005736104870834,21.485148135208114,-12.035045295798369,0,0.64945224565510729,-0.074288407459167552,-0.016169645324161326,0,0,0 +0,51.167391421593621,30.109157160400187,2.77804754336114,0,0.79000000000000004,-0.040229000000000001,0,0,0,0 +0,6.0232182423363412,1.2110045819180328,-25.537592572473756,0,0.29938824301819678,0.17141895942678154,-0.011299224165806398,0,0,0 +0,-43.999946793023526,-36.463578834209578,-38.865730536962602,0,0.023652369088504571,-0.19557439288947984,0.0053060363613909658,0,0,0 +0,64.776596068741441,27.812081604590787,-44.967401814510751,0,0.34307258960636844,-0.048980673581636859,0.012907986572662655,0,0,0 +0,-9.3967887728237116,-25.887530634381672,-36.137500873542123,0,0.14581905556295077,0.028351904787527669,0.001906989588328659,0,0,0 +0,45.251982367198806,22.894432429909045,-10.025624589939213,0,0.64743370257809274,-0.02879807207680209,-0.016820697632859694,0,0,0 +0,-47.694605920179427,-25.234634984552251,-49.737213382204075,0,0.014423417933480176,-0.20478243240616589,0.018850599408620414,0,0,0 +0,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +0,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +1.3,-58.899807932234665,-30.391429089199661,-8.9651431941080659,0,-0.043532380456373886,-0.29954768913939617,-0.015450048069114652,0,0,0 +1.3,21.252373997194326,3.9151172762301627,-21.785798269610069,0,0.44329221989549045,0.081361553218357058,-0.013538302200104834,0,0,0 +1.3,-42.896718803798365,-31.625202379689199,-10.931938360694204,0,0.051320312603987527,-0.17401270471232957,-0.016477069886027165,0,0,0 +1.3,40.954972515124823,-23.098472646607576,-47.040958079019177,0,0.2682795810497054,-0.18826747268181912,0.014602423217683654,0,0,0 +1.3,-58.402364092368053,-1.7177411179226709,-32.240068899394885,0,0.029966052524806292,-0.18251649420987268,-0.00017162095013376936,0,0,0 +1.3,-39.285226131318268,-2.7500337165631521,-2.7648167250723361,0,0.17018076901868001,-0.036682767005740489,-0.0071866449499301916,0,0,0 +1.3,30.056521115539553,29.92851724372612,-8.5770133497964451,0,0.6758601992994312,0.11321517750616381,-0.011891051058805951,0,0,0 +1.3,7.8993607781100508,-35.747056623732618,-22.259781958060287,0,0.29140141425636956,0.035710934880143513,-0.013231880022575101,0,0,0 +1.3,-20,30,-25,0,0.28736094000000001,0.24559882,-0.01010116,0,0,0 +1.3,80,-50,-60,0,0.25841288000000001,-0.29004894000000003,0.01812708,0,0,0 +5,0.70650750907638837,15.816164666472503,-53.091747117263438,0,0.25386219309811731,0.1922216960978978,0.018538889185018444,0,0,0 +5,-57.270676763422955,-38.261003995975045,-55.523143923146009,0,-0.018898176181614885,-0.25732001601530508,0.0026031388850526792,0,0,0 +5,-55.583179460495032,-11.267112332013653,-3.7402305084147329,0,0.046717367709065385,-0.16822420360663878,-0.017112782179504668,0,0,0 +5,-55.759542999126353,-30.260916044615875,-4.7153084412182196,0,-0.034635512035943783,-0.24463608809461693,-0.017044727644029447,0,0,0 +5,2.7409365902909713,28.60201112028858,-25.111807766941638,0,0.51646259509400916,0.23879053249544574,-0.012323092620119979,0,0,0 +5,-26.90563341915059,-18.420651494160794,-46.743191840476669,0,0.11420677166519085,0.043870924074703464,0.011093208251581721,0,0,0 +5,-16.112072543782354,-28.66106348420395,-35.787427339459953,0,0.18002507612677668,0.052130481982715075,0.003452085811021517,0,0,0 +5,47.653715716084676,-34.975665237240214,-12.915985400675432,0,0.7489398547218753,-0.3000455231158361,-0.0044987919875953426,0,0,0 +5,-20,30,-25,0,0.38124400000000003,0.29551699999999997,-0.0047850000000000002,0,0,0 +5,80,-50,-60,0,0.34283799999999998,-0.317998,0.015136,0,0,0 +7.75,-23.782540347753034,31.640590099832778,-42.28125833560091,0,0.19909993654758706,0.27532266043072323,0.0072307514105971263,0,0,0 +7.75,50.699916065949282,21.248156177521807,-9.6544214270716324,0,0.81656011565721809,-0.10185687528991277,0.0080117469713967167,0,0,0 +7.75,-30.862612828868855,-29.963976322550394,-20.768673745665197,0,0.11246834986654598,-0.017404097009274287,-0.0020752046858131734,0,0,0 +7.75,-29.029779494510834,30.562070864728852,-24.577795503163962,0,0.2660289068641693,0.23613859757503752,0.0019820218823223073,0,0,0 +7.75,44.097261234879468,4.3627783365342623,-51.969286230642126,0,0.30898976781414694,-0.13363755560770732,0.0073040284758910312,0,0,0 +7.75,31.828650476772225,13.454382521358369,-37.508052128273803,0,0.40772739750877718,-0.022943655652615639,-0.0012734242766102937,0,0,0 +7.75,19.279805725190684,-29.432058008061055,-28.273968928784587,0,0.33599236489159123,-0.11846418019117765,-0.01121919032289628,0,0,0 +7.75,-65.088498790004209,-4.1096213331942266,-4.0369821288993819,0,0.031947302125074711,-0.13157180676134833,-0.0097886861315082188,0,0,0 +7.75,-20,30,-25,0,0.30929142857142855,0.30356899999999998,-0.00044550000000000015,0,0,0 +7.75,80,-50,-60,0,0.27813403571428569,-0.3068495,0.0051393571428571426,0,0,0 +12,38.748666590388865,-21.181534454098497,-53.134152389089131,0,0.19509269599198845,-0.2028583790331388,0.00046557148201333953,0,0,0 +12,60.517381720185682,-8.0005172692153153,-30.269613490802683,0,0.38425095739903531,-0.18736771907686126,-0.0028666870862236165,0,0,0 +12,45.490473682488201,-20.534961895274311,-11.965353621749735,0,0.47539953906280819,-0.2225823741888657,0.0092083154199232749,0,0,0 +12,-30.609218021163912,-8.3671424569499635,-28.048800274861485,0,0.11356111033404216,0.087115973989754181,0.0062523360734655243,0,0,0 +12,6.5945258766081025,0.59760111799577942,-53.350036552039931,0,0.1513426960037576,0.0023590310702554171,0.017838479320703017,0,0,0 +12,-45.00122797001535,2.7927463368735346,-12.885058684263356,0,0.10614796016930442,0.052095910868263852,0.00023866052549963287,0,0,0 +12,-57.750808960729856,14.274812330751992,-51.416219286157663,0,0.03302831981986494,0.027455382939537244,-0.011158470278916675,0,0,0 +12,-38.214312874891242,-5.6115938197858313,-38.052390995065217,0,0.073779482552374084,0.056044051364241752,0.0025077513783129416,0,0,0 +12,-20,30,-25,0,0.23260123571428576,0.29930645,0.0058831499999999993,0,0,0 +12,80,-50,-60,0,0.20916970714285713,-0.27536565000000002,-0.0069256785714285696,0,0,0 +14.1,52.049165952549743,0.83978298962566811,-50.525479290346901,0,0.22151677985592605,-0.12852605054149735,-0.01100594107142857,0,0,0 +14.1,-50.08982512680857,17.159357032043026,0.081972995586298225,0,0.12691654361572438,0.10712276023372647,-0.0028313030020003785,0,0,0 +14.1,55.566790108726224,-1.3303810172184072,-5.7830355595344187,0,0.5429306668933247,-0.13720670656887363,0.0098628800760606032,0,0,0 +14.1,-7.7626286311559625,-36.193633307630989,-40.133058664429967,0,0.11038125919679376,-0.045150281885480092,0.0048333389536111843,0,0,0 +14.1,-38.482282748346435,-35.635152454396675,-7.835478838758128,0,0.060001312362294196,-0.031586113723443693,-0.0047059041576073572,0,0,0 +14.1,-32.118569101807033,32.395467883591024,-32.95814835720526,0,0.14699059331736419,0.23578669364356092,0.0049375135399573672,0,0,0 +14.1,-73.653536889253203,-5.30135437991148,2.6584938454922877,0,0.02026086443440819,-0.025347601805360227,0.0018520210714285676,0,0,0 +14.1,22.808794396358067,-7.7895303493948376,-20.30813130952022,0,0.32215795444074791,-0.11433544796613135,-0.0081790632881922152,0,0,0 +14.1,-20,30,-25,0,0.21389033321428572,0.28791337249999999,0.0088002074999999989,0,0,0 +14.1,80,-50,-60,0,0.19234374964285716,-0.25188518250000003,-0.01100594107142857,0,0,0 +19.899999999999999,-22.942982304194317,30.544962591266923,-15.080061000458585,0,0.2456881688780389,0.22893735252928299,-0.0012431259903853287,0,0,0 +19.899999999999999,-65.422008313280557,-17.318980426019834,-57.386570856646848,0,-0.0038525263084205931,0.036865328295920631,0.0069884624999999919,0,0,0 +19.899999999999999,-43.52656302826329,12.98234031670659,-19.490002308485693,0,0.11555007775629458,0.15931359900968162,-0.0015021336557083501,0,0,0 +19.899999999999999,-45.752898140435072,-21.849395089813164,-14.954187063917864,0,0.04187322826561482,0.019818671354902808,-7.4214162079037709e-05,0,0,0 +19.899999999999999,-46.408896706751769,-11.11361856588994,-11.869225071677462,0,0.064547778819660798,0.062712279693772938,0.0016252573467936456,0,0,0 +19.899999999999999,7.8173249258989017,1.6818490920869351,-47.59117384546461,0,0.15732383928080093,-0.13234355889549823,0.012573946251595291,0,0,0 +19.899999999999999,64.170180487823899,36.580457381274229,-51.528910673324326,0,0.25455999999999995,0.076247737499999954,-0.016747512499999999,0,0,0 +19.899999999999999,1.0461545715413649,2.3254772953772544,-41.800453413679875,0,0.16955712013673971,-0.069345906483858549,0.0040445175704344116,0,0,0 +19.899999999999999,-20,30,-25,0,0.21857768750000001,0.22915941250000005,0.016239687499999999,0,0,0 +19.899999999999999,80,-50,-60,0,0.19655881250000001,-0.16375226250000005,-0.016747512499999999,0,0,0 +20,57.773196593431464,17.058190764761036,-24.207950794350978,0,0.52386960874343746,-0.091996236940955864,-0.012225623942630283,0,0,0 +20,23.057160140338723,-37.342213410017891,-8.834977048711913,0,0.39882921372964608,-0.054080232211954134,-0.014868382875277277,0,0,0 +20,-31.293205806228023,-39.392197429185352,-23.833023124277616,0,0.08582367787700193,-0.098349399566063395,-0.012347100507734052,0,0,0 +20,40.574543650916894,-9.5228861341035653,-19.788490814814573,0,0.46278460853257936,-0.11920656285193283,-0.01365752897600008,0,0,0 +20,-35.563484488409081,-28.633726656316636,-12.438347765451326,0,0.085058357733649184,-0.12555813001410421,-0.01603897532399377,0,0,0 +20,-14.200725792275222,8.4041897977722684,-45.858535484595734,0,0.14510472993832621,0.15471681386543873,0.014018232189548133,0,0,0 +20,32.459113235635698,-9.3693527585883913,-28.147220365362394,0,0.3672775297072905,-0.050474346844647133,-0.0080479410912023021,0,0,0 +20,9.7491037437402213,-20.448522155057933,-55.761079490981629,0,0.14893089599897533,0.093158754421151069,0.019177999999999997,0,0,0 +20,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +20,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +22.5,52.955030493423436,27.395038157243647,-8.8820828632123892,0,0.69534220195786611,-0.050648847371025416,-0.014947657250500129,0,0,0 +22.5,43.868632888551574,11.787804359995498,-45.971185031226426,0,0.29714608221072569,-0.061613233005008948,0.014158580006704379,0,0,0 +22.5,-12.541703804709933,-29.44195004306782,-12.059168022088059,0,0.20078547878443892,0.007062676042584792,-0.016161829560843468,0,0,0 +22.5,3.2739774302568634,1.2193424360429432,-2.0593936832047248,0,0.41240507636159263,0.16527045959459968,-0.003465753629465231,0,0,0 +22.5,-11.230860572498329,-30.278984685702213,-43.423215504819758,0,0.11092588240464683,0.0077779946120326727,0.010984115733144837,0,0,0 +22.5,-32.980103354584053,13.337287228011547,-49.1668254070279,0,0.093320935566570007,0.062092537099614036,0.018139964438107923,0,0,0 +22.5,51.845307354855038,-12.92926670713549,-13.079923721627608,0,0.55310463565082357,-0.21194606682854195,-0.015831104714192655,0,0,0 +22.5,-56.63621197037746,-29.049078574654985,0.66712673497698916,0,-0.026964507546229716,-0.28845645837936457,0,0,0,0 +22.5,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +22.5,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +25,-22.453078275656743,-8.6141682183663271,-36.181294116121833,0,0.13114885304843188,0.054833721354260928,0.0019615507133938703,0,0,0 +25,18.544626904752903,-6.4134851445475576,-3.134056229573595,0,0.47275179045145543,0.078142451802730578,-0.0052743032287494033,0,0,0 +25,-72.795405077268882,-2.6048927911537731,-17.334561876002411,0,0.025211341011110267,-0.2084175711646151,-0.01445260195217522,0,0,0 +25,23.643734869303813,-14.318104711484274,-38.443908132957965,0,0.25915838290515447,0.0037238459683309388,0.0047804962646896708,0,0,0 +25,54.155937200493838,-16.368152599111561,-41.970930547766002,0,0.30941189725718332,-0.22570161039644626,0.0091747429508507068,0,0,0 +25,-63.160755363281091,-31.556726966433271,-53.955593748659936,0,-0.018749999999999999,-0.317998,0.019178000000000001,0,0,0 +25,-10.255299548027182,-11.332684738402683,-37.872136745137716,0,0.16033345976316993,0.084640869659346946,0.0040681377280321783,0,0,0 +25,61.983239135326613,9.271165380687961,-22.298757622753541,0,0.52494678682905449,-0.12314433847724815,-0.012844202530227852,0,0,0 +25,-20,30,-25,0,0.25437500000000002,0.22806000000000001,-0.011969,0,0,0 +25,80,-50,-60,0,0.22875000000000001,-0.28022900000000001,0.019178000000000001,0,0,0 +31.399999999999999,24.450592872595692,32.499513975114724,-24.423911467133188,0,0.5992294034670248,0.10244614775540339,-0.015500010429045025,0,0,0 +31.399999999999999,-33.513074653386902,30.692187109415158,-10.399877719313537,0,0.34053232100961972,0.19256312267705805,-0.015856667458906838,0,0,0 +31.399999999999999,17.1726462947003,-28.057833796119702,-0.71988168272214637,0,0.56234618396335612,-0.080001012488441103,0.0057728617842764673,0,0,0 +31.399999999999999,-16.00977467511688,7.6043089807087583,-38.79594561730211,0,0.22799700621164404,0.19695587144306309,0.0060544409604657594,0,0,0 +31.399999999999999,49.566117556135637,24.295795554898319,-39.238335764043498,0,0.53170491735442826,-0.092171281803160268,-0.0012556821051353043,0,0,0 +31.399999999999999,38.788165897626385,-17.477565914614843,-0.59431619239282441,0,0.78031385205663639,-0.18553906548707136,0.012211819395836678,0,0,0 +31.399999999999999,-60.260634974840968,2.6871793692610311,-39.943859126396738,0,0.032601393396417877,-0.12652248252295595,0.0030782051829547526,0,0,0 +31.399999999999999,9.3243104320719254,13.805370194256845,-52.203358903689526,0,0.25267479112215724,0.13873018576695495,0.019724277295129815,0,0,0 +31.399999999999999,-20,30,-25,0,0.34461360000000008,0.29961619999999994,-0.0025758000000000057,0,0,0 +31.399999999999999,80,-50,-60,0,0.30989780000000006,-0.3123224,0.010046800000000012,0,0,0 +51,-14.136121752396775,-29.809806473708225,-47.363274970617141,0,0.10128512059831829,0.010223366804138486,0.015492908336945157,0,0,0 +51,2.089085739222412,37.690841817195974,-19.510792555907237,0,0.41787615073124462,0.27135266913421452,-0.013704080377416494,0,0,0 +51,41.081155166650007,22.464695846937673,-49.823416984686531,0,0.29614178902973093,-0.0043862680038635714,0.018357585250831317,0,0,0 +51,-53.55266041769373,-8.0931132571621305,-6.8730847808931799,0,0.054691251112104614,-0.1725281134940137,-0.012610915920695147,0,0,0 +51,-58.451775222553053,-29.717639119292897,-10.922401606337985,0,-0.037854428024012475,-0.29723877351781103,-0.016161947960753428,0,0,0 +51,-54.243395302610551,-3.3436013108621481,-53.345232541370628,0,0.026603789726054317,-0.15891772183032768,0.016071804242955474,0,0,0 +51,-22.39801804532383,-1.1037955731224685,-55.27030896441515,0,0.10817431972273717,0.098431940735969184,0.018268020685504247,0,0,0 +51,-41.706278815237233,12.712612818433882,-5.2026717819242521,0,0.19320446379057454,0.0030952642055547333,-0.010167724383337785,0,0,0 +51,-20,30,-25,0,0.27974879999999991,0.24155139999999994,-0.010532200000000005,0,0,0 +51,80,-50,-60,0,0.25156759999999989,-0.28778279999999995,0.018369600000000003,0,0,0 diff --git a/tests/data/currents_mdc/c5uniform/current_profile_4d.txt b/tests/data/currents_mdc/c5uniform/current_profile_4d.txt new file mode 100644 index 00000000..bb068aef --- /dev/null +++ b/tests/data/currents_mdc/c5uniform/current_profile_4d.txt @@ -0,0 +1,105 @@ +2 2 5 5 +-100.0 100.0 +-60.0 60.0 +-50.0 -30.0 -12.5 -5.0 0.0 +0.0 4.0 7.0 15.0 30.0 +-100.0 -60.0 -50.0 0.0 0.000000 0.000000 0.000000 +100.0 60.0 -5.0 30.0 1.448678 0.066697 -0.009380 +-100.0 -60.0 0.0 7.0 1.378881 0.055749 0.000000 +100.0 -60.0 -12.5 30.0 1.293462 0.081697 0.000994 +100.0 60.0 0.0 15.0 1.060725 -0.124508 0.000000 +100.0 60.0 0.0 0.0 1.006387 0.150000 0.000000 +-100.0 60.0 -5.0 0.0 0.939295 0.160000 -0.000000 +-100.0 60.0 -12.5 30.0 1.293462 0.081697 0.000994 +-100.0 60.0 -12.5 7.0 1.149067 0.080749 0.009436 +100.0 -60.0 -30.0 30.0 0.931293 0.116697 -0.008509 +-100.0 -60.0 -50.0 15.0 0.353575 -0.024508 0.001978 +100.0 -60.0 -30.0 0.0 0.603832 0.210000 -0.000000 +100.0 -60.0 -5.0 7.0 1.286955 0.065749 -0.009840 +100.0 60.0 -12.5 4.0 1.082590 0.141636 -0.005985 +-100.0 -60.0 -50.0 4.0 0.433036 0.216636 0.005440 +100.0 60.0 -5.0 4.0 1.212501 0.126636 -0.008415 +100.0 -60.0 -50.0 0.0 0.000000 0.000000 0.000000 +100.0 60.0 -50.0 4.0 0.433036 0.216636 0.005440 +-100.0 60.0 0.0 30.0 1.552155 0.056697 0.000000 +-100.0 60.0 -5.0 7.0 1.286955 0.065749 -0.009840 +-100.0 60.0 -30.0 0.0 0.603832 0.210000 -0.000000 +100.0 -60.0 -30.0 15.0 0.636435 -0.064508 0.004872 +-100.0 60.0 -30.0 7.0 0.827328 0.115749 0.008797 +-100.0 60.0 -30.0 30.0 0.931293 0.116697 -0.008509 +-100.0 60.0 -30.0 4.0 0.779465 0.176636 0.002794 +100.0 -60.0 -5.0 0.0 0.939295 0.160000 -0.000000 +-100.0 -60.0 -12.5 4.0 1.082590 0.141636 -0.005985 +-100.0 -60.0 -5.0 7.0 1.286955 0.065749 -0.009840 +-100.0 60.0 -5.0 30.0 1.448678 0.066697 -0.009380 +-100.0 -60.0 -30.0 15.0 0.636435 -0.064508 0.004872 +100.0 -60.0 -30.0 4.0 0.779465 0.176636 0.002794 +-100.0 -60.0 -5.0 30.0 1.448678 0.066697 -0.009380 +100.0 60.0 -30.0 0.0 0.603832 0.210000 -0.000000 +100.0 60.0 -12.5 30.0 1.293462 0.081697 0.000994 +100.0 -60.0 -5.0 15.0 0.990010 -0.114508 0.005716 +-100.0 60.0 -50.0 4.0 0.433036 0.216636 0.005440 +-100.0 -60.0 -30.0 0.0 0.603832 0.210000 -0.000000 +-100.0 -60.0 -12.5 30.0 1.293462 0.081697 0.000994 +100.0 60.0 -50.0 7.0 0.459627 0.155749 0.009756 +100.0 -60.0 -50.0 30.0 0.517385 0.156697 0.003878 +100.0 60.0 -5.0 0.0 0.939295 0.160000 -0.000000 +-100.0 -60.0 -5.0 15.0 0.990010 -0.114508 0.005716 +100.0 60.0 -12.5 0.0 0.838656 0.175000 -0.000000 +-100.0 -60.0 -5.0 4.0 1.212501 0.126636 -0.008415 +100.0 -60.0 -30.0 7.0 0.827328 0.115749 0.008797 +100.0 -60.0 -5.0 30.0 1.448678 0.066697 -0.009380 +-100.0 60.0 -5.0 4.0 1.212501 0.126636 -0.008415 +-100.0 -60.0 0.0 15.0 1.060725 -0.124508 0.000000 +100.0 60.0 0.0 30.0 1.552155 0.056697 0.000000 +100.0 60.0 -30.0 4.0 0.779465 0.176636 0.002794 +-100.0 -60.0 -30.0 30.0 0.931293 0.116697 -0.008509 +100.0 60.0 -5.0 15.0 0.990010 -0.114508 0.005716 +100.0 -60.0 0.0 4.0 1.299108 0.116636 0.000000 +-100.0 60.0 -12.5 4.0 1.082590 0.141636 -0.005985 +-100.0 -60.0 -5.0 0.0 0.939295 0.160000 -0.000000 +-100.0 -60.0 0.0 30.0 1.552155 0.056697 0.000000 +-100.0 -60.0 -12.5 7.0 1.149067 0.080749 0.009436 +100.0 60.0 -30.0 7.0 0.827328 0.115749 0.008797 +-100.0 60.0 -5.0 15.0 0.990010 -0.114508 0.005716 +100.0 60.0 -50.0 30.0 0.517385 0.156697 0.003878 +-100.0 60.0 -12.5 15.0 0.883938 -0.099508 -0.000498 +100.0 60.0 -12.5 7.0 1.149067 0.080749 0.009436 +-100.0 -60.0 -30.0 7.0 0.827328 0.115749 0.008797 +100.0 -60.0 -50.0 4.0 0.433036 0.216636 0.005440 +100.0 -60.0 -50.0 7.0 0.459627 0.155749 0.009756 +100.0 -60.0 -12.5 7.0 1.149067 0.080749 0.009436 +-100.0 -60.0 0.0 0.0 1.006387 0.150000 0.000000 +-100.0 60.0 -50.0 30.0 0.517385 0.156697 0.003878 +-100.0 60.0 0.0 15.0 1.060725 -0.124508 0.000000 +-100.0 60.0 -50.0 0.0 0.000000 0.000000 0.000000 +-100.0 -60.0 0.0 4.0 1.299108 0.116636 0.000000 +-100.0 60.0 -30.0 15.0 0.636435 -0.064508 0.004872 +-100.0 -60.0 -12.5 15.0 0.883938 -0.099508 -0.000498 +100.0 -60.0 -5.0 4.0 1.212501 0.126636 -0.008415 +100.0 60.0 0.0 4.0 1.299108 0.116636 0.000000 +100.0 -60.0 -12.5 4.0 1.082590 0.141636 -0.005985 +-100.0 -60.0 -30.0 4.0 0.779465 0.176636 0.002794 +100.0 -60.0 -12.5 15.0 0.883938 -0.099508 -0.000498 +-100.0 60.0 -50.0 15.0 0.353575 -0.024508 0.001978 +100.0 60.0 0.0 7.0 1.378881 0.055749 0.000000 +-100.0 60.0 0.0 0.0 1.006387 0.150000 0.000000 +100.0 -60.0 0.0 30.0 1.552155 0.056697 0.000000 +100.0 -60.0 0.0 7.0 1.378881 0.055749 0.000000 +-100.0 -60.0 -12.5 0.0 0.838656 0.175000 -0.000000 +100.0 60.0 -12.5 15.0 0.883938 -0.099508 -0.000498 +100.0 60.0 -30.0 15.0 0.636435 -0.064508 0.004872 +100.0 60.0 -5.0 7.0 1.286955 0.065749 -0.009840 +-100.0 60.0 0.0 7.0 1.378881 0.055749 0.000000 +100.0 -60.0 0.0 0.0 1.006387 0.150000 0.000000 +100.0 -60.0 -12.5 0.0 0.838656 0.175000 -0.000000 +-100.0 -60.0 -50.0 30.0 0.517385 0.156697 0.003878 +-100.0 60.0 -50.0 7.0 0.459627 0.155749 0.009756 +100.0 -60.0 0.0 15.0 1.060725 -0.124508 0.000000 +-100.0 -60.0 -50.0 7.0 0.459627 0.155749 0.009756 +-100.0 60.0 0.0 4.0 1.299108 0.116636 0.000000 +100.0 -60.0 -50.0 15.0 0.353575 -0.024508 0.001978 +100.0 60.0 -50.0 0.0 0.000000 0.000000 0.000000 +-100.0 60.0 -12.5 0.0 0.838656 0.175000 -0.000000 +100.0 60.0 -30.0 30.0 0.931293 0.116697 -0.008509 +100.0 60.0 -50.0 15.0 0.353575 -0.024508 0.001978 diff --git a/tests/data/currents_mdc/c5uniform/currents.dat b/tests/data/currents_mdc/c5uniform/currents.dat new file mode 100644 index 00000000..43203b53 --- /dev/null +++ b/tests/data/currents_mdc/c5uniform/currents.dat @@ -0,0 +1,26 @@ +--------------------- MoorDyn Input File ------------------------------------ +Shared current parity deck (MoorDyn-C WaveKin 0, Currents 5): the c2 profile, uniform in x and y +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed -30.0 0.0 -20.0 0 0 0 0 +2 Vessel 30.0 0.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 chain 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +72.0 TMax simulation length (s) +3.0e6 kBot bottom stiffness (Pa/m) +3.0e5 cBot bottom damping (Pa-s/m) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +0.0 TmaxIC max time for ic gen (s) +0 WaveKin MoorDyn-C water kinematics mode (-) +5 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/c5uniform/points.txt b/tests/data/currents_mdc/c5uniform/points.txt new file mode 100644 index 00000000..8234db01 --- /dev/null +++ b/tests/data/currents_mdc/c5uniform/points.txt @@ -0,0 +1,340 @@ +0.0 -7.02274407112499 5.111191447569773 -70.0 +0.0 -28.09097628449996 -46.00072302812796 -70.0 +0.0 31.485198909702078 -2.714340560540456 -50.0 +0.0 125.94079563880831 24.429065044864103 -50.0 +0.0 -20.809732103447978 -0.11709455529188517 -41.0 +0.0 -83.23892841379191 1.0538509976269665 -41.0 +0.0 39.37280373726867 8.147073783375749 -30.0 +0.0 157.49121494907467 -73.32366405038174 -30.0 +0.0 22.655718499009495 9.007258842943656 -20.0 +0.0 90.62287399603798 -81.06532958649291 -20.0 +0.0 -18.7537186637282 -6.33128609556366 -12.5 +0.0 -75.0148746549128 56.98157486007294 -12.5 +0.0 -12.854524951559121 -9.226121975251093 -7.3 +0.0 -51.418099806236484 83.03509777725984 -7.3 +0.0 -14.582842600996724 9.948139588388933 -1.0 +0.0 -58.331370403986895 -89.5332562955004 -1.0 +0.0 36.632586546811126 8.810295057781655 0.0 +0.0 146.5303461872445 -79.2926555200349 0.0 +0.0 -29.96197077630681 -7.427336525682544 2.0 +0.0 -119.84788310522724 66.8460287311429 2.0 +0.7 -28.02076086210656 -6.523047821498196 -70.0 +0.7 -112.08304344842624 58.70743039348376 -70.0 +0.7 -36.14628172153602 -9.284919940469585 -50.0 +0.7 -144.58512688614408 83.56427946422627 -50.0 +0.7 3.3553280663774103 -4.097783379274052 -41.0 +0.7 13.421312265509641 36.88005041346646 -41.0 +0.7 -31.972033235176774 5.452151169515091 -30.0 +0.7 -127.8881329407071 -49.069360525635815 -30.0 +0.7 34.37959677019529 -8.721812201917752 -20.0 +0.7 137.51838708078117 78.49630981725977 -20.0 +0.7 11.16126785635651 2.5043531721859065 -12.5 +0.7 44.64507142542604 -22.53917854967316 -12.5 +0.7 -29.348708093264236 0.9562592119631503 -7.3 +0.7 -117.39483237305694 -8.606332907668353 -7.3 +0.7 -22.203587385333094 -2.037888397728058 -1.0 +0.7 -88.81434954133238 18.340995579552523 -1.0 +0.7 18.190400780927327 7.693202911420261 0.0 +0.7 72.7616031237093 -69.23882620278235 0.0 +0.7 -24.12915133518095 1.4288192371581143 2.0 +0.7 -96.5166053407238 -12.859373134423029 2.0 +2.9999 -22.69698324330357 4.7645721603939695 -70.0 +2.9999 -90.78793297321428 -42.88114944354572 -70.0 +2.9999 29.60912871286267 -4.595171802377718 -50.0 +2.9999 118.43651485145068 41.35654622139946 -50.0 +2.9999 25.618852234935133 7.654491368813606 -41.0 +2.9999 102.47540893974053 -68.89042231932245 -41.0 +2.9999 10.53684893278772 -6.745087112276895 -30.0 +2.9999 42.14739573115088 60.70578401049205 -30.0 +2.9999 -20.11730365275597 -8.15528754041507 -20.0 +2.9999 -80.46921461102389 73.39758786373564 -20.0 +2.9999 28.877993020518687 3.6868449410257362 -12.5 +2.9999 115.51197208207475 -33.18160446923163 -12.5 +2.9999 34.88947203636303 -8.649918397237435 -7.3 +2.9999 139.55788814545213 77.84926557513691 -7.3 +2.9999 -17.050722524734745 6.410433238769084 -1.0 +2.9999 -68.20289009893898 -57.69389914892176 -1.0 +2.9999 -16.690651040342416 -9.102290200816356 0.0 +2.9999 -66.76260416136967 81.9206118073472 0.0 +2.9999 9.341015495959546 -0.6708157716698366 2.0 +2.9999 37.364061983838184 6.03734194502853 2.0 +3.0 -10.836166288895548 -2.811508683337676 -70.0 +3.0 -43.34466515558219 25.303578150039087 -70.0 +3.0 16.77544370038276 -6.71317237580249 -50.0 +3.0 67.10177480153104 60.418551382222404 -50.0 +3.0 15.42782093757721 9.244832796080779 -41.0 +3.0 61.71128375030884 -83.203495164727 -41.0 +3.0 7.630055290347471 -3.3308172468554282 -30.0 +3.0 30.520221161389884 29.977355221698854 -30.0 +3.0 -27.412426819126992 9.635807381611084 -20.0 +3.0 -109.64970727650797 -86.72226643449976 -20.0 +3.0 17.20368294581285 6.804029695690261 -12.5 +3.0 68.8147317832514 -61.23626726121235 -12.5 +3.0 -38.99039508391235 -8.600796918063523 -7.3 +3.0 -155.9615803356494 77.4071722625717 -7.3 +3.0 -29.23184990330986 7.16677430254904 -1.0 +3.0 -116.92739961323944 -64.50096872294137 -1.0 +3.0 -35.203358965445574 -9.06927555629794 0.0 +3.0 -140.8134358617823 81.62348000668146 0.0 +3.0 -36.116039280277235 -3.882238256345685 2.0 +3.0 -144.46415712110894 34.94014430711117 2.0 +4.4 1.1124388464913793 5.20525876471501 -70.0 +4.4 4.449755385965517 -46.84732888243509 -70.0 +4.4 34.909765359536976 4.649206520776003 -50.0 +4.4 139.6390614381479 -41.84285868698403 -50.0 +4.4 33.38247618905423 6.2852042478643355 -41.0 +4.4 133.52990475621692 -56.56683823077902 -41.0 +4.4 21.11808898951169 7.146451792665914 -30.0 +4.4 84.47235595804676 -64.31806613399323 -30.0 +4.4 -16.79152348675787 1.797590082510812 -20.0 +4.4 -67.16609394703148 -16.178310742597308 -20.0 +4.4 7.904121174278195 -0.05464630281863947 -12.5 +4.4 31.61648469711278 0.4918167253677552 -12.5 +4.4 38.84417503848353 7.184393131716664 -7.3 +4.4 155.3767001539341 -64.65953818544997 -7.3 +4.4 -8.721368622618133 2.939017904926253 -1.0 +4.4 -34.88547449047253 -26.451161144336275 -1.0 +4.4 -31.500770648871857 -4.191686418096204 0.0 +4.4 -126.00308259548743 37.72517776286583 0.0 +4.4 -31.018717744515953 4.28736024868326 2.0 +4.4 -124.07487097806381 -38.58624223814934 2.0 +6.99 25.984579991006967 6.148921133070914 -70.0 +6.99 103.93831996402787 -55.340290197638225 -70.0 +6.99 25.581854432298712 9.711080199082648 -50.0 +6.99 102.32741772919485 -87.39972179174383 -50.0 +6.99 36.400293065186446 -6.478819272190939 -41.0 +6.99 145.60117226074578 58.30937344971845 -41.0 +6.99 -16.131052630013 -9.933801481428981 -30.0 +6.99 -64.524210520052 89.40421333286083 -30.0 +6.99 11.949152372833652 -0.6496388177203514 -20.0 +6.99 47.79660949133461 5.846749359483162 -20.0 +6.99 1.7948777433545473 1.053663708101407 -12.5 +6.99 7.179510973418189 -9.482973372912664 -12.5 +6.99 -5.967658939612022 -1.1771128513667843 -7.3 +6.99 -23.87063575844809 10.594015662301059 -7.3 +6.99 24.096936358151595 3.474822206122692 -1.0 +6.99 96.38774543260638 -31.273399855104227 -1.0 +6.99 34.277818838471035 0.919347914896818 0.0 +6.99 137.11127535388414 -8.274131234071362 0.0 +6.99 29.82452168463881 -6.78566161845475 2.0 +6.99 119.29808673855524 61.07095456609275 2.0 +10.1 -38.71377810637341 -2.6909196691918824 -70.0 +10.1 -154.85511242549364 24.21827702272694 -70.0 +10.1 21.585287827692134 -1.5231418564411054 -50.0 +10.1 86.34115131076854 13.708276707969949 -50.0 +10.1 33.277869171065134 -8.813343938797555 -41.0 +10.1 133.11147668426054 79.320095449178 -41.0 +10.1 33.31326330797876 2.9080081138450176 -30.0 +10.1 133.25305323191503 -26.172073024605158 -30.0 +10.1 -4.615604223592669 5.469048364129481 -20.0 +10.1 -18.462416894370676 -49.22143527716533 -20.0 +10.1 14.431288479807982 -6.086644825390774 -12.5 +10.1 57.72515391923193 54.77980342851697 -12.5 +10.1 -22.287438378876743 -5.993156351656794 -7.3 +10.1 -89.14975351550697 53.93840716491115 -7.3 +10.1 24.79879938034503 -3.9029596822975527 -1.0 +10.1 99.19519752138012 35.12663714067797 -1.0 +10.1 -22.749879023039252 8.395813095968222 0.0 +10.1 -90.99951609215701 -75.562317863714 0.0 +10.1 22.027009649720995 1.515237560299898 2.0 +10.1 88.10803859888398 -13.637138042699082 2.0 +15.0 13.876708886608398 0.7419805953356473 -70.0 +15.0 55.50683554643359 -6.677825358020826 -70.0 +15.0 -2.7469521472092566 -3.5314995308744734 -50.0 +15.0 -10.987808588837026 31.78349577787026 -50.0 +15.0 29.646585258486994 9.962368830173471 -41.0 +15.0 118.58634103394797 -89.66131947156124 -41.0 +15.0 37.053032151947576 9.81812850654958 -30.0 +15.0 148.2121286077903 -88.36315655894623 -30.0 +15.0 21.02986346698144 -5.0995662461400215 -20.0 +15.0 84.11945386792576 45.896096215260194 -20.0 +15.0 32.84519682282985 -2.3039314011475254 -12.5 +15.0 131.3807872913194 20.73538261032773 -12.5 +15.0 36.13609205407985 7.003867378567644 -7.3 +15.0 144.5443682163194 -63.0348064071088 -7.3 +15.0 -11.799015997376479 9.143553865208155 -1.0 +15.0 -47.196063989505916 -82.2919847868734 -1.0 +15.0 -13.440509756587147 3.6347630909713775 0.0 +15.0 -53.76203902634859 -32.712867818742396 0.0 +15.0 0.9221939903324099 -3.9009838610955754 2.0 +15.0 3.6887759613296396 35.10885474986018 2.0 +22.2 36.86710835794585 4.323452802889294 -70.0 +22.2 147.4684334317834 -38.911075226003646 -70.0 +22.2 -32.32894301793878 -1.8016757645856387 -50.0 +22.2 -129.3157720717551 16.21508188127075 -50.0 +22.2 -35.80139720077473 -5.159978650043689 -41.0 +22.2 -143.20558880309892 46.4398078503932 -41.0 +22.2 -26.22368089792042 8.239591500764341 -30.0 +22.2 -104.89472359168168 -74.15632350687906 -30.0 +22.2 23.990432529791548 4.278286793812818 -20.0 +22.2 95.96173011916619 -38.50458114431536 -20.0 +22.2 2.887023810869664 6.482848982697266 -12.5 +22.2 11.548095243478656 -58.345640844275394 -12.5 +22.2 32.434164811981134 -7.850777221993363 -7.3 +22.2 129.73665924792454 70.65699499794027 -7.3 +22.2 27.646650826375748 6.677775432800441 -1.0 +22.2 110.58660330550299 -60.099978895203975 -1.0 +22.2 0.7439691736044267 5.562222983029244 0.0 +22.2 2.975876694417707 -50.060006847263196 0.0 +22.2 25.152845672099858 7.842833299939155 2.0 +22.2 100.61138268839943 -70.5854996994524 2.0 +27.0 34.17743485462587 5.976624160118602 -70.0 +27.0 136.7097394185035 -53.78961744106742 -70.0 +27.0 22.493094807101244 -0.3077505481058491 -50.0 +27.0 89.97237922840498 2.769754932952642 -50.0 +27.0 25.88581939047276 -5.8243899747383665 -41.0 +27.0 103.54327756189105 52.4195097726453 -41.0 +27.0 -28.483027801526923 -9.30702194503688 -30.0 +27.0 -113.93211120610769 83.76319750533192 -30.0 +27.0 9.021346610391355 -3.454486553556011 -20.0 +27.0 36.08538644156542 31.090378982004097 -20.0 +27.0 -7.8579344021051085 4.308805042569695 -12.5 +27.0 -31.431737608420434 -38.779245383127254 -12.5 +27.0 3.846277922265557 2.544877826817034 -7.3 +27.0 15.385111689062228 -22.903900441353308 -7.3 +27.0 18.177235829689387 4.683102526838535 -1.0 +27.0 72.70894331875755 -42.14792274154682 -1.0 +27.0 -0.7580107998057599 -8.798399170974848 0.0 +27.0 -3.0320431992230397 79.18559253877363 0.0 +27.0 21.20569224848559 -8.59787987749832 2.0 +27.0 84.82276899394236 77.38091889748488 2.0 +29.9 1.406890943436487 -8.376998968552357 -70.0 +29.9 5.627563773745948 75.39299071697121 -70.0 +29.9 35.73493492274133 1.1619742971977622 -50.0 +29.9 142.93973969096533 -10.45776867477986 -50.0 +29.9 37.799493650061336 0.41397227450426044 -41.0 +29.9 151.19797460024535 -3.725750470538344 -41.0 +29.9 20.183925874373905 1.0212616773877166 -30.0 +29.9 80.73570349749562 -9.191355096489449 -30.0 +29.9 -17.81588963423217 -1.0721355449493082 -20.0 +29.9 -71.26355853692868 9.649219904543774 -20.0 +29.9 10.672238679317502 -7.289743184122948 -12.5 +29.9 42.68895471727001 65.60768865710654 -12.5 +29.9 -26.973218729797495 0.3614691414785991 -7.3 +29.9 -107.89287491918998 -3.253222273307392 -7.3 +29.9 37.135747505861445 -5.539721977770158 -1.0 +29.9 148.54299002344578 49.85749779993142 -1.0 +29.9 14.740809994223198 9.11256286402461 0.0 +29.9 58.963239976892794 -82.0130657762215 0.0 +29.9 -11.677147320143256 -9.247415795948292 2.0 +29.9 -46.70858928057302 83.22674216353462 2.0 +30.0 -8.650754310000881 9.16934613710388 -70.0 +30.0 -34.603017240003524 -82.52411523393491 -70.0 +30.0 -21.52834483255002 -2.4498442073934967 -50.0 +30.0 -86.11337933020008 22.04859786654147 -50.0 +30.0 -37.91365942204985 1.7869178293190444 -41.0 +30.0 -151.6546376881994 -16.0822604638714 -41.0 +30.0 8.448105983536863 -0.7104286343268011 -30.0 +30.0 33.79242393414745 6.39385770894121 -30.0 +30.0 -10.984575041640863 -1.482566812128896 -20.0 +30.0 -43.93830016656345 13.343101309160064 -20.0 +30.0 17.47171695947599 -3.3085417618235073 -12.5 +30.0 69.88686783790396 29.776875856411564 -12.5 +30.0 -9.969297911143286 6.476991369519826 -7.3 +30.0 -39.877191644573145 -58.29292232567843 -7.3 +30.0 19.28656187456903 -9.71700139622218 -1.0 +30.0 77.14624749827613 87.45301256599961 -1.0 +30.0 26.75939860221601 -2.596169523828566 0.0 +30.0 107.03759440886404 23.365525714457092 0.0 +30.0 -27.572206265855908 -8.028149162705635 2.0 +30.0 -110.28882506342363 72.25334246435071 2.0 +31.5 12.32596528400471 -4.333836550439541 -70.0 +31.5 49.30386113601884 39.00452895395587 -70.0 +31.5 13.765699540806267 -1.3972193507397392 -50.0 +31.5 55.06279816322507 12.574974156657653 -50.0 +31.5 30.07191375299493 -0.2767730234363128 -41.0 +31.5 120.28765501197972 2.4909572109268154 -41.0 +31.5 19.43154862585076 -9.795994592560435 -30.0 +31.5 77.72619450340304 88.16395133304391 -30.0 +31.5 -28.793376785410032 -8.456781239044686 -20.0 +31.5 -115.17350714164013 76.11103115140217 -20.0 +31.5 -36.30974966959437 4.593534942927555 -12.5 +31.5 -145.23899867837747 -41.34181448634799 -12.5 +31.5 -2.239900235497096 0.13376092702809217 -7.3 +31.5 -8.959600941988384 -1.2038483432528295 -7.3 +31.5 -23.449608268622228 2.8363753799615417 -1.0 +31.5 -93.79843307448891 -25.527378419653875 -1.0 +31.5 37.40950389700063 4.018053153001375 0.0 +31.5 149.63801558800253 -36.16247837701238 0.0 +31.5 -29.032706522727636 -0.2497391911787421 2.0 +31.5 -116.13082609091055 2.247652720608679 2.0 +33.0 -39.85412472901931 3.8768432788161906 -70.0 +33.0 -159.41649891607724 -34.891589509345714 -70.0 +33.0 17.684325638275766 3.5714735876826005 -50.0 +33.0 70.73730255310306 -32.14326228914341 -50.0 +33.0 -0.4594188146910767 6.52802352390988 -41.0 +33.0 -1.8376752587643068 -58.75221171518892 -41.0 +33.0 38.256746798218416 -3.2436924925503297 -30.0 +33.0 153.02698719287366 29.193232432952968 -30.0 +33.0 -27.521341499367054 -2.7390553415641 -20.0 +33.0 -110.08536599746822 24.6514980740769 -20.0 +33.0 -12.987076895057115 -7.1632817430584605 -12.5 +33.0 -51.94830758022846 64.46953568752615 -12.5 +33.0 -12.696516486637286 -6.258068783689041 -7.3 +33.0 -50.786065946549144 56.32261905320137 -7.3 +33.0 -15.027932615069012 -1.6160955882136356 -1.0 +33.0 -60.11173046027605 14.54486029392272 -1.0 +33.0 -30.393098056862947 -6.300330717877102 0.0 +33.0 -121.57239222745179 56.70297646089392 0.0 +33.0 17.451886515299904 -7.455914823927974 2.0 +33.0 69.80754606119962 67.10323341535177 2.0 +35.2 -12.175965967280263 6.783113370124319 -70.0 +35.2 -48.70386386912105 -61.04802033111887 -70.0 +35.2 4.618081470479673 0.8154909897060758 -50.0 +35.2 18.472325881918692 -7.339418907354682 -50.0 +35.2 35.55926111218679 4.137211499995836 -41.0 +35.2 142.23704444874716 -37.23490349996252 -41.0 +35.2 -5.401121673640503 9.606615354240503 -30.0 +35.2 -21.604486694562013 -86.45953818816453 -30.0 +35.2 -12.10973856338616 0.03748479100456059 -20.0 +35.2 -48.43895425354464 -0.3373631190410453 -20.0 +35.2 11.75197738317857 -9.52412923600807 -12.5 +35.2 47.00790953271428 85.71716312407263 -12.5 +35.2 21.03837088156746 3.5302548364859625 -7.3 +35.2 84.15348352626984 -31.772293528373662 -7.3 +35.2 -15.973711330369085 3.4445876816223553 -1.0 +35.2 -63.89484532147634 -31.001289134601198 -1.0 +35.2 -20.73709617203651 -6.918272024152479 0.0 +35.2 -82.94838468814604 62.26444821737231 0.0 +35.2 24.68259701174533 2.2417909878109477 2.0 +35.2 98.73038804698132 -20.17611889029853 2.0 +40.0 -28.53669579612899 -4.9250282768244125 -70.0 +40.0 -114.14678318451595 44.32525449141971 -70.0 +40.0 -37.79487475670331 -3.100688797868414 -50.0 +40.0 -151.17949902681323 27.906199180815726 -50.0 +40.0 -34.489431309685216 0.3955085003395453 -41.0 +40.0 -137.95772523874086 -3.559576503055908 -41.0 +40.0 -22.625244513000098 -1.5039685698797065 -30.0 +40.0 -90.50097805200039 13.535717128917359 -30.0 +40.0 -8.384812969166795 -6.875514272293152 -20.0 +40.0 -33.53925187666718 61.87962845063837 -20.0 +40.0 -24.046467454115312 9.193786772436233 -12.5 +40.0 -96.18586981646125 -82.7440809519261 -12.5 +40.0 -7.158361636532753 -9.175947291231326 -7.3 +40.0 -28.63344654613101 82.58352562108193 -7.3 +40.0 -37.56341961594708 -7.950113084987189 -1.0 +40.0 -150.25367846378833 71.5510177648847 -1.0 +40.0 16.627586727950444 -1.701836685221103 0.0 +40.0 66.51034691180178 15.316530166989928 0.0 +40.0 -20.29979488321547 2.246366688187342 2.0 +40.0 -81.19917953286188 -20.21730019368608 2.0 +70.3 -27.25943988546411 1.3303422268762404 -70.0 +70.3 -109.03775954185645 -11.973080041886163 -70.0 +70.3 -18.329419181105777 8.499933068799717 -50.0 +70.3 -73.31767672442311 -76.49939761919745 -50.0 +70.3 -28.279731776551642 0.4043904563369196 -41.0 +70.3 -113.11892710620657 -3.6395141070322765 -41.0 +70.3 7.2620474241576645 1.7805222100826015 -30.0 +70.3 29.048189696630658 -16.024699890743413 -30.0 +70.3 5.56942953748969 7.433773413905932 -20.0 +70.3 22.27771814995876 -66.90396072515338 -20.0 +70.3 -32.08471351381484 5.214401425367065 -12.5 +70.3 -128.33885405525936 -46.92961282830358 -12.5 +70.3 30.99699708402197 -7.629852384347919 -7.3 +70.3 123.98798833608788 68.66867145913128 -7.3 +70.3 16.420688115163323 0.3052507316806885 -1.0 +70.3 65.68275246065329 -2.7472565851261965 -1.0 +70.3 -12.057577684522364 -8.488938632238991 0.0 +70.3 -48.23031073808946 76.40044769015091 0.0 +70.3 -7.35147907642898 0.5750754838162742 2.0 +70.3 -29.40591630571592 -5.175679354346467 2.0 diff --git a/tests/data/currents_mdc/c5uniform/ref_moordyn_c.csv b/tests/data/currents_mdc/c5uniform/ref_moordyn_c.csv new file mode 100644 index 00000000..8b63bf6a --- /dev/null +++ b/tests/data/currents_mdc/c5uniform/ref_moordyn_c.csv @@ -0,0 +1,341 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,-7.0227440711249898,5.1111914475697731,-70,0,0,0,0,0,0,0 +0,-28.090976284499959,-46.000723028127958,-70,0,0,0,0,0,0,0 +0,31.485198909702078,-2.7143405605404558,-50,0,0,0,0,0,0,0 +0,125.94079563880831,24.429065044864103,-50,0,0,0,0,0,0,0 +0,-20.809732103447978,-0.11709455529188517,-41,0,0.27172440000000009,0.094500000000000001,0,0,0,0 +0,-83.238928413791911,1.0538509976269665,-41,0,0.27172440000000003,0.094499999999999987,0,0,0,0 +0,39.372803737268669,8.1470737833757489,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +0,157.49121494907467,-73.323664050381737,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +0,22.655718499009495,9.0072588429436564,-20,0,0.73801714285714293,0.19,0,0,0,0 +0,90.622873996037981,-81.065329586492908,-20,0,0.73801714285714282,0.19,0,0,0,0 +0,-18.753718663728201,-6.3312860955636596,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +0,-75.014874654912802,56.981574860072939,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +0,-12.854524951559121,-9.2261219752510932,-7.2999999999999998,0,0.90843237333333327,0.16460000000000002,0,0,0,0 +0,-51.418099806236484,83.035097777259836,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +0,-14.582842600996724,9.9481395883889334,-1,0,0.99296859999999998,0.15199999999999997,0,0,0,0 +0,-58.331370403986895,-89.533256295500394,-1,0,0.99296859999999998,0.152,0,0,0,0 +0,36.632586546811126,8.810295057781655,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,146.5303461872445,-79.292655520034899,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,-29.96197077630681,-7.4273365256825441,2,0,1.0063869999999997,0.15000000000000002,0,0,0,0 +0,-119.84788310522724,66.846028731142894,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0.69999999999999984,-28.02076086210656,-6.5230478214981957,-70,0,0.075781299999999968,0.037911299999999981,0.00095199999999999983,0,0,0 +0.69999999999999996,-112.08304344842624,58.707430393483762,-70,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,-36.14628172153602,-9.2849199404695852,-50,0,0.075781299999999968,0.037911299999999995,0.00095199999999999983,0,0,0 +0.69999999999999996,-144.58512688614408,83.564279464226274,-50,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,3.3553280663774103,-4.0977833792740519,-41,0,0.32723521375000003,0.11272379999999999,0.00074362750000000002,0,0,0 +0.69999999999999996,13.421312265509641,36.880050413466464,-41,0,0.32723521375000003,0.11272379999999999,0.00074362750000000002,0,0,0 +0.69999999999999996,-31.972033235176774,5.4521511695150906,-30,0,0.63456777500000006,0.20416129999999999,0.00048894999999999993,0,0,0 +0.69999999999999996,-127.8881329407071,-49.069360525635815,-30,0,0.63456777499999995,0.20416129999999996,0.00048894999999999993,0,0,0 +0.69999999999999996,34.379596770195292,-8.7218122019177518,-20,0,0.7755830178571429,0.18416129999999997,-0.0003889500000000001,0,0,0 +0.69999999999999996,137.51838708078117,78.496309817259771,-20,0,0.7755830178571429,0.18416129999999997,-0.00038894999999999999,0,0,0 +0.69999999999999996,11.16126785635651,2.5043531721859065,-12.5,0,0.88134445000000006,0.16916129999999999,-0.0010473749999999999,0,0,0 +0.69999999999999996,44.645071425426039,-22.53917854967316,-12.5,0,0.88134445000000017,0.16916129999999999,-0.0010473749999999999,0,0,0 +0.69999999999999996,-29.348708093264236,0.95625921196315034,-7.2999999999999998,0,0.95467249266666687,0.15876129999999999,-0.0013422149999999999,0,0,0 +0.69999999999999996,-117.39483237305694,-8.606332907668353,-7.2999999999999998,0,0.95467249266666687,0.15876129999999999,-0.0013422149999999999,0,0,0 +0.69999999999999996,-22.203587385333094,-2.0378883977280582,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999991,0,0,0 +0.69999999999999996,-88.814349541332376,18.340995579552523,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999991,0,0,0 +0.69999999999999996,18.190400780927327,7.6932029114202614,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,72.761603123709307,-69.238826202782349,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,-24.12915133518095,1.4288192371581143,2,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,-96.5166053407238,-12.859373134423029,2,0,1.0576131749999997,0.14416129999999999,0,0,0,0 +2.9998999999998115,-22.696983243303571,4.7645721603939695,-70,0,0.3247661740999796,0.16247158409998977,0.004079863999999744,0,0,0 +2.9998999999999998,-90.787932973214282,-42.881149443545723,-70,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,29.60912871286267,-4.5951718023777177,-50,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,118.43651485145068,41.356546221399462,-50,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,25.618852234935133,7.6544913688136056,-41,0,0.50961995738374999,0.17259939659999998,0.0031868687675,0,0,0 +2.9998999999999998,102.47540893974053,-68.890422319322454,-41,0,0.50961995738374999,0.17259939659999998,0.0031868687675,0,0,0 +2.9998999999999998,10.53684893278772,-6.7450871122768952,-30,0,0.73555235917499995,0.18497783409999999,0.00209543015,0,0,0 +2.9998999999999998,42.14739573115088,60.705784010492053,-30,0,0.73555235917499995,0.18497783409999999,0.00209543015,0,0,0 +2.9998999999999998,-20.117303652755972,-8.1552875404150704,-20,0,0.89900838344642864,0.16497783410000005,-0.0016668730071428565,0,0,0 +2.9998999999999998,-80.469214611023887,73.397587863735637,-20,0,0.89900838344642864,0.1649778341,-0.0016668730071428561,0,0,0 +2.9998999999999998,28.877993020518687,3.6868449410257362,-12.5,0,1.02160040165,0.14997783410000001,-0.0044886003749999995,0,0,0 +2.9998999999999998,115.51197208207475,-33.18160446923163,-12.5,0,1.02160040165,0.14997783410000004,-0.0044886003749999995,0,0,0 +2.9998999999999998,34.889472036363031,-8.6499183972374354,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582550000006,0,0,0 +2.9998999999999998,139.55788814545213,77.849265575136911,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582550000006,0,0,0 +2.9998999999999998,-17.050722524734745,6.4104332387690839,-1,0,1.2095748795499999,0.12697783409999999,-0.0012622079249999998,0,0,0 +2.9998999999999998,-68.20289009893898,-57.693899148921759,-1,0,1.2095748795499999,0.12697783410000002,-0.0012622079249999998,0,0,0 +2.9998999999999998,-16.690651040342416,-9.1022902008163555,0,0,1.2259204319750001,0.1249778341,0,0,0,0 +2.9998999999999998,-66.762604161369666,81.9206118073472,0,0,1.2259204319750001,0.12497783410000002,0,0,0,0 +2.9998999999999998,9.3410154959595459,-0.67081577166983664,2,0,1.2259204319749999,0.12497783409999999,0,0,0,0 +2.9998999999999998,37.364061983838184,6.0373419450285297,2,0,1.2259204319749999,0.1249778341,0,0,0,0 +3,-10.836166288895548,-2.8115086833376761,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,-43.344665155582192,25.303578150039087,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,16.775443700382759,-6.7131723758024897,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,67.101774801531036,60.418551382222404,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,15.427820937577209,9.2448327960807788,-41,0,0.50962788749999999,0.17260199999999998,0.0031869750000000003,0,0,0 +3,61.711283750308837,-83.203495164727002,-41,0,0.50962788749999999,0.17260199999999998,0.0031869750000000003,0,0,0 +3,7.630055290347471,-3.3308172468554282,-30,0,0.73555674999999998,0.184977,0.0020955000000000001,0,0,0 +3,30.520221161389884,29.977355221698854,-30,0,0.73555674999999998,0.18497699999999997,0.0020955000000000001,0,0,0 +3,-27.412426819126992,9.6358073816110839,-20,0,0.89901374999999994,0.16497699999999998,-0.0016669285714285709,0,0,0 +3,-109.64970727650797,-86.722266434499758,-20,0,0.89901374999999994,0.16497699999999998,-0.0016669285714285709,0,0,0 +3,17.203682945812851,6.8040296956902608,-12.5,0,1.0216065000000001,0.14997700000000003,-0.0044887499999999997,0,0,0 +3,68.814731783251403,-61.236267261212348,-12.5,0,1.0216065000000001,0.14997700000000003,-0.0044887499999999997,0,0,0 +3,-38.990395083912347,-8.6007969180635229,-7.2999999999999998,0,1.1066043133333334,0.13957700000000001,-0.0057523500000000007,0,0,0 +3,-155.96158033564939,77.407172262571706,-7.2999999999999998,0,1.1066043133333334,0.13957700000000001,-0.0057523500000000007,0,0,0 +3,-29.231849903309861,7.1667743025490402,-1,0,1.2095820999999998,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-116.92739961323944,-64.500968722941366,-1,0,1.2095820999999998,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-35.203358965445574,-9.0692755562979404,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-140.8134358617823,81.623480006681461,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-36.116039280277235,-3.8822382563456852,2,0,1.2259277499999999,0.124977,0,0,0,0 +3,-144.46415712110894,34.940144307111169,2,0,1.2259277499999999,0.124977,0,0,0,0 +4.4000000000000217,1.1124388464913793,5.2052587647150101,-70,0,0.3835706222222231,0.16880857777777786,0.0060574222222222534,0,0,0 +4.4000000000000217,4.449755385965517,-46.847328882435093,-70,0,0.38357062222222305,0.16880857777777783,0.0060574222222222534,0,0,0 +4.4000000000000217,34.909765359536976,4.6492065207760032,-50,0,0.38357062222222316,0.16880857777777786,0.0060574222222222534,0,0,0 +4.4000000000000217,139.63906143814791,-41.84285868698403,-50,0,0.3835706222222231,0.16880857777777786,0.0060574222222222526,0,0,0 +4.4000000000000217,33.382476189054231,6.2852042478643355,-41,0,0.55788593222222294,0.16580857777777769,0.0052616622222222548,0,0,0 +4.4000000000000217,133.52990475621692,-56.56683823077902,-41,0,0.55788593222222294,0.16580857777777769,0.0052616622222222548,0,0,0 +4.4000000000000217,21.118088989511691,7.1464517926659141,-30,0,0.77093797777777828,0.16214191111111076,0.0042890666666667004,0,0,0 +4.4000000000000217,84.472355958046762,-64.318066133993227,-30,0,0.77093797777777828,0.16214191111111076,0.0042890666666667004,0,0,0 +4.4000000000000217,-16.791523486757871,1.797590082510812,-20,0,0.94225753333333406,0.1421419111111108,0.0016156825396825905,0,0,0 +4.4000000000000217,-67.166093947031484,-16.178310742597308,-20,0,0.94225753333333406,0.1421419111111108,0.0016156825396825905,0,0,0 +4.4000000000000217,7.9041211742781954,-0.054646302818639469,-12.5,0,1.0707472000000009,0.12714191111111078,-0.00038935555555549188,0,0,0 +4.4000000000000217,31.616484697112782,0.49181672536775523,-12.5,0,1.0707472000000009,0.12714191111111078,-0.00038935555555549188,0,0,0 +4.4000000000000217,38.844175038483527,7.1843931317166643,-7.2999999999999998,0,1.1598334613333343,0.11674191111111076,-0.005483260148148145,0,0,0 +4.4000000000000217,155.37670015393411,-64.659538185449975,-7.2999999999999998,0,1.1598334613333343,0.11674191111111076,-0.005483260148148145,0,0,0 +4.4000000000000217,-8.7213686226181331,2.9390179049262528,-1,0,1.2677648400000008,0.10414191111111076,-0.0015472666666666711,0,0,0 +4.4000000000000217,-34.885474490472532,-26.451161144336275,-1,0,1.2677648400000008,0.10414191111111076,-0.0015472666666666707,0,0,0 +4.4000000000000217,-31.500770648871857,-4.1916864180962037,0,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +4.4000000000000217,-126.00308259548743,37.725177762865833,0,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +4.4000000000000217,-31.018717744515953,4.2873602486832603,2,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +4.4000000000000217,-124.07487097806381,-38.586242238149339,2,0,1.2848968000000007,0.10214191111111076,0,0,0,0 +6.9900000000009292,25.984579991006967,6.1489211330709139,-70,0,0.44493905333332784,0.15447589416664645,0.0081504083333331784,0,0,0 +6.9900000000009292,103.93831996402787,-55.340290197638225,-70,0,0.44493905333332784,0.15447589416664642,0.0081504083333331784,0,0,0 +6.9900000000009292,25.581854432298712,9.7110801990826481,-50,0,0.44493905333332784,0.15447589416664645,0.0081504083333331784,0,0,0 +6.9900000000009292,102.32741772919485,-87.399721791743829,-50,0,0.44493905333332784,0.15447589416664645,0.0081504083333331784,0,0,0 +6.9900000000009292,36.400293065186446,-6.4788192721909388,-41,0,0.60511694520832582,0.13647589416664643,0.0076923574583333898,0,0,0 +6.9900000000009292,145.60117226074578,58.30937344971845,-41,0,0.60511694520832593,0.13647589416664646,0.0076923574583333907,0,0,0 +6.9900000000009292,-16.131052630012999,-9.933801481428981,-30,0,0.80088992416665683,0.11447589416664644,0.0071325175000003151,0,0,0 +6.9900000000009292,-64.524210520051994,89.404213332860834,-30,0,0.80088992416665683,0.11447589416664644,0.0071325175000003151,0,0,0 +6.9900000000009292,11.949152372833652,-0.64963881772035137,-20,0,0.97886558321427375,0.094475894166646451,0.0060124627380958428,0,0,0 +6.9900000000009292,47.796609491334607,5.8467493594831623,-20,0,0.97886558321427375,0.094475894166646451,0.0060124627380958428,0,0,0 +6.9900000000009292,1.7948777433545473,1.0536637081014071,-12.5,0,1.1123473274999864,0.079475894166646438,0.0051724216666674885,0,0,0 +6.9900000000009292,7.1795109734181892,-9.4829733729126637,-12.5,0,1.1123473274999864,0.079475894166646438,0.0051724216666674885,0,0,0 +6.9900000000009292,-5.9676589396120221,-1.1771128513667843,-7.2999999999999998,0,1.2048946048333187,0.069075894166646432,-0.0041257341555545717,0,0,0 +6.9900000000009292,-23.870635758448088,10.594015662301059,-7.2999999999999998,0,1.2048946048333187,0.069075894166646432,-0.0041257341555545717,0,0,0 +6.9900000000009292,24.096936358151595,3.4748222061226919,-1,0,1.3170195234999837,0.056475894166646431,-0.0016476759999997884,0,0,0 +6.9900000000009292,96.38774543260638,-31.273399855104227,-1,0,1.3170195234999837,0.056475894166646431,-0.0016476759999997884,0,0,0 +6.9900000000009292,34.277818838471035,0.919347914896818,0,0,1.3348171599999836,0.054475894166646444,0,0,0,0 +6.9900000000009292,137.11127535388414,-8.274131234071362,0,0,1.3348171599999836,0.054475894166646437,0,0,0,0 +6.9900000000009292,29.82452168463881,-6.7856616184547498,2,0,1.3348171599999836,0.054475894166646444,0,0,0,0 +6.9900000000009292,119.29808673855524,61.070954566092752,2,0,1.3348171599999836,0.054475894166646437,0,0,0,0 +10.099999999999296,-38.713778106373411,-2.6909196691918824,-70,0,0.41853185000000936,0.085899412500015843,0.0067420250000006857,0,0,0 +10.1,-154.85511242549364,24.218277022726941,-70,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,21.585287827692134,-1.5231418564411054,-50,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,86.341151310768538,13.708276707969949,-50,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,33.277869171065134,-8.813343938797555,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,133.11147668426054,79.320095449177998,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,33.313263307978758,2.9080081138450176,-30,0,0.75335696249999995,0.045899412500000007,0.0072760624999999995,0,0,0 +10.1,133.25305323191503,-26.172073024605158,-30,0,0.75335696250000006,0.045899412500000014,0.0072760624999999995,0,0,0 +10.1,-4.6156042235926691,5.4690483641294811,-20,0,0.92076984821428565,0.0258994125,0.006310641071428571,0,0,0 +10.1,-18.462416894370676,-49.221435277165327,-20,0,0.92076984821428576,0.02589941250000001,0.006310641071428571,0,0,0 +10.1,14.431288479807982,-6.0866448253907741,-12.5,0,1.0463295125000001,0.010899412499999997,0.0055865749999999999,0,0,0 +10.1,57.725153919231929,54.779803428516971,-12.5,0,1.0463295125000003,0.010899412499999999,0.0055865749999999999,0,0,0 +10.1,-22.287438378876743,-5.9931563516567943,-7.2999999999999998,0,1.1333839605,0.00049941249999999743,-0.00092980500000000013,0,0,0 +10.1,-89.149753515506973,53.938407164911148,-7.2999999999999998,0,1.1333839605000002,0.00049941249999999743,-0.00092980500000000013,0,0,0 +10.1,24.798799380345031,-3.9029596822975527,-1,0,1.2388542025,-0.012100587499999999,-0.00076240999999999961,0,0,0 +10.1,99.195197521380123,35.126637140677971,-1,0,1.2388542025,-0.012100587499999999,-0.00076240999999999972,0,0,0 +10.1,-22.749879023039252,8.3958130959682222,0,0,1.2555955499999998,-0.014100587499999996,0,0,0,0 +10.1,-90.999516092157009,-75.562317863714,0,0,1.25559555,-0.014100587499999997,0,0,0,0 +10.1,22.027009649720995,1.515237560299898,2,0,1.25559555,-0.014100587499999997,0,0,0,0 +10.1,88.108038598883979,-13.637138042699082,2,0,1.2555955500000002,-0.014100587499999997,0,0,0,0 +14.999999999997604,13.876708886608398,0.74198059533564731,-70,0,0.35357500000003173,-0.024507999999946024,0.001978000000002329,0,0,0 +15,55.506835546433592,-6.6778253580208258,-70,0,0.35357499999999997,-0.024507999999999999,0.0019780000000000002,0,0,0 +15,-2.7469521472092566,-3.5314995308744734,-50,0,0.35357499999999997,-0.024507999999999999,0.0019780000000000002,0,0,0 +15,-10.987808588837026,31.783495777870261,-50,0,0.35357499999999997,-0.024508000000000002,0.0019780000000000006,0,0,0 +15,29.646585258486994,9.962368830173471,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,118.58634103394797,-89.661319471561242,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,37.053032151947576,9.8181285065495807,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,148.21212860779031,-88.36315655894623,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,21.029863466981439,-5.0995662461400215,-20,0,0.7778652857142857,-0.084508,0.0018034285714285715,0,0,0 +15,84.119453867925756,45.896096215260194,-20,0,0.7778652857142857,-0.084508,0.0018034285714285715,0,0,0 +15,32.845196822829848,-2.3039314011475254,-12.5,0,0.88393799999999989,-0.099507999999999999,-0.00049799999999999996,0,0,0 +15,131.38078729131939,20.735382610327729,-12.5,0,0.883938,-0.099507999999999999,-0.00049799999999999996,0,0,0 +15,36.136092054079853,7.0038673785676444,-7.2999999999999998,0,0.95748125333333323,-0.10990799999999999,0.0038103733333333333,0,0,0 +15,144.54436821631941,-63.034806407108803,-7.2999999999999998,0,0.95748125333333334,-0.10990800000000001,0.0038103733333333333,0,0,0 +15,-11.799015997376479,9.1435538652081547,-1,0,1.0465819999999999,-0.12250799999999999,0.0011431999999999996,0,0,0 +15,-47.196063989505916,-82.2919847868734,-1,0,1.0465819999999999,-0.12250799999999999,0.0011431999999999998,0,0,0 +15,-13.440509756587147,3.6347630909713775,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,-53.762039026348589,-32.712867818742396,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,0.9221939903324099,-3.9009838610955754,2,0,1.0607249999999999,-0.12450800000000001,0,0,0,0 +15,3.6887759613296396,35.108854749860178,2,0,1.0607249999999999,-0.12450799999999998,0,0,0,0 +22.200000000007591,36.867108357945853,4.3234528028892942,-70,0,0.43220380000008285,0.062470400000091728,0.0028900000000009621,0,0,0 +22.200000000007591,147.46843343178341,-38.911075226003646,-70,0,0.43220380000008285,0.062470400000091728,0.0028900000000009617,0,0,0 +22.200000000007591,-32.328943017938776,-1.8016757645856387,-50,0,0.43220380000008285,0.062470400000091728,0.0028900000000009612,0,0,0 +22.200000000007591,-129.31577207175511,16.215081881270748,-50,0,0.43220380000008285,0.062470400000091728,0.0028900000000009617,0,0,0 +22.200000000007591,-35.80139720077473,-5.1599786500436888,-41,0,0.58779716800011284,0.044470400000091725,0.00089160399999748102,0,0,0 +22.200000000007591,-143.20558880309892,46.439807850393201,-41,0,0.58779716800011284,0.044470400000091725,0.00089160399999748123,0,0,0 +22.200000000007591,-26.223680897920421,8.239591500764341,-30,0,0.77796684000014937,0.022470400000091713,-0.0015508800000067729,0,0,0 +22.200000000007591,-104.89472359168168,-74.156323506879062,-30,0,0.77796684000014937,0.022470400000091713,-0.0015508800000067729,0,0,0 +22.200000000007591,23.990432529791548,4.2782867938128177,-20,0,0.95084837142875389,0.0024704000000917194,-0.00054000000000247112,0,0,0 +22.200000000007591,95.961730119166191,-38.50458114431536,-20,0,0.95084837142875389,0.0024704000000917194,-0.00054000000000247112,0,0,0 +22.200000000007591,2.887023810869664,6.4828489826972664,-12.5,0,1.0805095200002073,-0.012529599999908278,0.00021816000000075529,0,0,0 +22.200000000007591,11.548095243478656,-58.345640844275394,-12.5,0,1.0805095200002073,-0.012529599999908278,0.00021816000000075529,0,0,0 +22.200000000007591,32.434164811981134,-7.8507772219933631,-7.2999999999999998,0,1.1704078965335578,-0.022929599999908276,-0.00099395306667173248,0,0,0 +22.200000000007591,129.73665924792454,70.656994997940274,-7.2999999999999998,0,1.1704078965335578,-0.02292959999990828,-0.0009939530666717327,0,0,0 +22.200000000007591,27.646650826375748,6.6777754328004413,-1,0,1.2793232480002454,-0.035529599999908283,-0.00030601600000152812,0,0,0 +22.200000000007591,110.58660330550299,-60.099978895203975,-1,0,1.2793232480002454,-0.035529599999908276,-0.00030601600000152812,0,0,0 +22.200000000007591,0.74396917360442671,5.562222983029244,0,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +22.200000000007591,2.9758766944177069,-50.060006847263196,0,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +22.200000000007591,25.152845672099858,7.842833299939155,2,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +22.200000000007591,100.61138268839943,-70.585499699452399,2,0,1.2966114000002487,-0.037529599999908278,0,0,0,0 +27.000000000006168,34.177434854625872,5.9766241601186021,-70,0,0.48462300000006731,0.1204560000000745,0.0034980000000007809,0,0,0 +27.000000000006168,136.70973941850349,-53.789617441067421,-70,0,0.48462300000006731,0.12045600000007448,0.0034980000000007809,0,0,0 +27.000000000006168,22.493094807101244,-0.30775054810584912,-50,0,0.48462300000006731,0.12045600000007449,0.0034980000000007809,0,0,0 +27.000000000006168,89.972379228404975,2.7697549329526421,-50,0,0.48462300000006731,0.12045600000007448,0.0034980000000007809,0,0,0 +27.000000000006168,25.885819390472761,-5.8243899747383665,-41,0,0.65908728000009165,0.10245600000007449,-0.00070086000000204522,0,0,0 +27.000000000006168,103.54327756189105,52.419509772645299,-41,0,0.65908728000009154,0.10245600000007449,-0.00070086000000204522,0,0,0 +27.000000000006168,-28.483027801526923,-9.3070219450368796,-30,0,0.87232140000012137,0.080456000000074496,-0.0058328000000054999,0,0,0 +27.000000000006168,-113.93211120610769,83.763197505331917,-30,0,0.87232140000012126,0.080456000000074482,-0.0058328000000054999,0,0,0 +27.000000000006168,9.0213466103913547,-3.454486553556011,-20,0,1.0661704285715765,0.060456000000074492,-0.0021022857142877212,0,0,0 +27.000000000006168,36.085386441565419,31.090378982004097,-20,0,1.0661704285715765,0.060456000000074492,-0.0021022857142877212,0,0,0 +27.000000000006168,-7.8579344021051085,4.3088050425696949,-12.5,0,1.2115572000001682,0.045456000000074492,0.00069560000000061354,0,0,0 +27.000000000006168,-31.431737608420434,-38.779245383127254,-12.5,0,1.2115572000001682,0.045456000000074492,0.00069560000000061354,0,0,0 +27.000000000006168,3.846277922265557,2.544877826817034,-7.2999999999999998,0,1.3123589920001824,0.035056000000074493,-0.0041968373333374481,0,0,0 +27.000000000006168,15.385111689062228,-22.903900441353308,-7.2999999999999998,0,1.3123589920001824,0.035056000000074493,-0.0041968373333374481,0,0,0 +27.000000000006168,18.177235829689387,4.6831025268385353,-1,0,1.4344840800001994,0.022456000000074486,-0.0012721600000012408,0,0,0 +27.000000000006168,72.708943318757548,-42.147922741546822,-1,0,1.4344840800001994,0.022456000000074486,-0.0012721600000012408,0,0,0 +27.000000000006168,-0.75801079980575992,-8.7983991709748484,0,0,1.4538690000002021,0.020456000000074484,0,0,0,0 +27.000000000006168,-3.0320431992230397,79.185592538773633,0,0,1.4538690000002021,0.020456000000074491,0,0,0,0 +27.000000000006168,21.20569224848559,-8.5978798774983201,2,0,1.4538690000002021,0.020456000000074488,0,0,0,0 +27.000000000006168,84.822768993942361,77.380918897484875,2,0,1.4538690000002021,0.020456000000074488,0,0,0,0 +29.900000000003637,1.4068909434364869,-8.3769989685523569,-70,0,0.51629293333337301,0.15548896666671058,0.003865333333333794,0,0,0 +29.900000000003637,5.6275637737459476,75.392990716971212,-70,0,0.51629293333337301,0.15548896666671058,0.003865333333333794,0,0,0 +29.900000000003637,35.734934922741331,1.1619742971977622,-50,0,0.51629293333337301,0.15548896666671058,0.003865333333333794,0,0,0 +29.900000000003637,142.93973969096533,-10.45776867477986,-50,0,0.51629293333337301,0.15548896666671058,0.003865333333333794,0,0,0 +29.900000000003637,37.799493650061336,0.41397227450426044,-41,0,0.70215838933338737,0.13748896666671057,-0.0016629736666678723,0,0,0 +29.900000000003637,151.19797460024535,-3.725750470538344,-41,0,0.70215838933338737,0.13748896666671057,-0.0016629736666678723,0,0,0 +29.900000000003637,20.183925874373905,1.0212616773877166,-30,0,0.92932728000007137,0.11548896666671057,-0.0084197933333365754,0,0,0 +29.900000000003637,80.735703497495621,-9.191355096489449,-30,0,0.92932728000007148,0.11548896666671057,-0.0084197933333365754,0,0,0 +29.900000000003637,-17.815889634232171,-1.0721355449493082,-20,0,1.1358441714286587,0.095488966666710584,-0.0030461666666678497,0,0,0 +29.900000000003637,-71.263558536928684,9.6492199045437737,-20,0,1.1358441714286589,0.095488966666710584,-0.0030461666666678497,0,0,0 +29.900000000003637,10.672238679317502,-7.2897431841229476,-12.5,0,1.2907318400000991,0.080488966666710571,0.00098405333333369499,0,0,0 +29.900000000003637,42.688954717270008,65.607688657106536,-12.5,0,1.2907318400000991,0.080488966666710585,0.00098405333333369499,0,0,0 +29.900000000003637,-26.973218729797495,0.3614691414785991,-7.2999999999999998,0,1.3981211121778852,0.070088966666710592,-0.0061319132444468691,0,0,0 +29.900000000003637,-107.89287491918998,-3.2532222733073919,-7.2999999999999998,0,1.3981211121778852,0.070088966666710592,-0.0061319132444468691,0,0,0 +29.900000000003637,37.135747505861445,-5.5397219777701583,-1,0,1.5282270826667843,0.057488966666710578,-0.0018558720000007309,0,0,0 +29.900000000003637,148.54299002344578,49.857497799931423,-1,0,1.5282270826667841,0.057488966666710578,-0.0018558720000007309,0,0,0 +29.900000000003637,14.740809994223198,9.1125628640246106,0,0,1.548878800000119,0.055488966666710576,0,0,0,0 +29.900000000003637,58.963239976892794,-82.013065776221495,0,0,1.5488788000001192,0.055488966666710576,0,0,0,0 +29.900000000003637,-11.677147320143256,-9.2474157959482923,2,0,1.5488788000001192,0.055488966666710576,0,0,0,0 +29.900000000003637,-46.708589280573023,83.226742163534624,2,0,1.548878800000119,0.055488966666710576,0,0,0,0 +30.000000000000121,-8.650754310000881,9.1693461371038794,-70,0,0,0,0,0,0,0 +30.000000000000121,-34.603017240003524,-82.524115233934907,-70,0,0,0,0,0,0,0 +30.000000000000121,-21.528344832550019,-2.4498442073934967,-50,0,0,0,0,0,0,0 +30.000000000000121,-86.113379330200075,22.048597866541471,-50,0,0,0,0,0,0,0 +30.000000000000121,-37.913659422049847,1.7869178293190444,-41,0,0.27172440000000003,0.094499999999999987,0,0,0,0 +30.000000000000121,-151.65463768819939,-16.0822604638714,-41,0,0.27172440000000009,0.094500000000000015,0,0,0,0 +30.000000000000121,8.4481059835368626,-0.71042863432680114,-30,0,0.60383199999999992,0.20999999999999996,0,0,0,0 +30.000000000000121,33.79242393414745,6.3938577089412103,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +30.000000000000121,-10.984575041640863,-1.482566812128896,-20,0,0.73801714285714271,0.19,0,0,0,0 +30.000000000000121,-43.938300166563451,13.343101309160064,-20,0,0.73801714285714293,0.19,0,0,0,0 +30.000000000000121,17.471716959475991,-3.3085417618235073,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +30.000000000000121,69.886867837903964,29.776875856411564,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +30.000000000000121,-9.9692979111432862,6.4769913695198262,-7.2999999999999998,0,0.90843237333333327,0.16460000000000002,0,0,0,0 +30.000000000000121,-39.877191644573145,-58.292922325678433,-7.2999999999999998,0,0.90843237333333327,0.16460000000000002,0,0,0,0 +30.000000000000121,19.286561874569031,-9.7170013962221802,-1,0,0.99296859999999998,0.152,0,0,0,0 +30.000000000000121,77.146247498276125,87.453012565999614,-1,0,0.99296859999999998,0.152,0,0,0,0 +30.000000000000121,26.75939860221601,-2.596169523828566,0,0,1.0063869999999999,0.14999999999999997,0,0,0,0 +30.000000000000121,107.03759440886404,23.365525714457092,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30.000000000000121,-27.572206265855908,-8.0281491627056347,2,0,1.0063870000000001,0.14999999999999997,0,0,0,0 +30.000000000000121,-110.28882506342363,72.253342464350709,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,12.32596528400471,-4.3338365504395409,-70,0,0,0,0,0,0,0 +31.500000000001826,49.303861136018838,39.004528953955869,-70,0,0,0,0,0,0,0 +31.500000000001826,13.765699540806267,-1.3972193507397392,-50,0,0,0,0,0,0,0 +31.500000000001826,55.062798163225068,12.574974156657653,-50,0,0,0,0,0,0,0 +31.500000000001826,30.071913752994931,-0.27677302343631283,-41,0,0.27172440000000003,0.094499999999999987,0,0,0,0 +31.500000000001826,120.28765501197972,2.4909572109268154,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +31.500000000001826,19.431548625850759,-9.7959945925604348,-30,0,0.60383200000000004,0.21000000000000002,0,0,0,0 +31.500000000001826,77.726194503403036,88.163951333043912,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +31.500000000001826,-28.793376785410032,-8.4567812390446857,-20,0,0.73801714285714271,0.19,0,0,0,0 +31.500000000001826,-115.17350714164013,76.111031151402173,-20,0,0.73801714285714282,0.19,0,0,0,0 +31.500000000001826,-36.309749669594368,4.5935349429275547,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +31.500000000001826,-145.23899867837747,-41.341814486347992,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +31.500000000001826,-2.239900235497096,0.13376092702809217,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +31.500000000001826,-8.9596009419883842,-1.2038483432528295,-7.2999999999999998,0,0.90843237333333327,0.16459999999999997,0,0,0,0 +31.500000000001826,-23.449608268622228,2.8363753799615417,-1,0,0.99296859999999998,0.152,0,0,0,0 +31.500000000001826,-93.798433074488912,-25.527378419653875,-1,0,0.99296859999999998,0.15200000000000002,0,0,0,0 +31.500000000001826,37.409503897000633,4.0180531530013752,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,149.63801558800253,-36.162478377012377,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,-29.032706522727636,-0.2497391911787421,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.500000000001826,-116.13082609091055,2.2476527206086789,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +32.999999999998288,-39.854124729019311,3.8768432788161906,-70,0,0,0,0,0,0,0 +33,-159.41649891607724,-34.891589509345714,-70,0,0,0,0,0,0,0 +33,17.684325638275766,3.5714735876826005,-50,0,0,0,0,0,0,0 +33,70.737302553103063,-32.143262289143408,-50,0,0,0,0,0,0,0 +33,-0.4594188146910767,6.5280235239098801,-41,0,0.27172440000000009,0.094500000000000015,0,0,0,0 +33,-1.8376752587643068,-58.75221171518892,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +33,38.256746798218416,-3.2436924925503297,-30,0,0.60383199999999992,0.20999999999999996,0,0,0,0 +33,153.02698719287366,29.193232432952968,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +33,-27.521341499367054,-2.7390553415641001,-20,0,0.73801714285714271,0.19,0,0,0,0 +33,-110.08536599746822,24.651498074076901,-20,0,0.73801714285714271,0.19,0,0,0,0 +33,-12.987076895057115,-7.1632817430584605,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +33,-51.948307580228459,64.469535687526147,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +33,-12.696516486637286,-6.2580687836890414,-7.2999999999999998,0,0.90843237333333327,0.1646,0,0,0,0 +33,-50.786065946549144,56.322619053201372,-7.2999999999999998,0,0.90843237333333349,0.1646,0,0,0,0 +33,-15.027932615069012,-1.6160955882136356,-1,0,0.9929686000000002,0.15200000000000002,0,0,0,0 +33,-60.11173046027605,14.544860293922721,-1,0,0.99296859999999998,0.152,0,0,0,0 +33,-30.393098056862947,-6.3003307178771024,0,0,1.0063870000000001,0.15000000000000002,0,0,0,0 +33,-121.57239222745179,56.702976460893922,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,17.451886515299904,-7.4559148239279738,2,0,1.0063869999999997,0.14999999999999997,0,0,0,0 +33,69.807546061199616,67.103233415351767,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +35.199999999994901,-12.175965967280263,6.7831133701243189,-70,0,0.23816979999944821,0.11914979999972392,0.0029919999999930683,0,0,0 +35.200000000000003,-48.703863869121051,-61.04802033111887,-70,0,0.23816980000000032,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,4.6180814704796731,0.81549098970607581,-50,0,0.23816980000000029,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,18.472325881918692,-7.3394189073546823,-50,0,0.23816980000000026,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,35.559261112186789,4.1372114999958356,-41,0,0.44618695750000026,0.15177480000000004,0.0023371150000000033,0,0,0 +35.200000000000003,142.23704444874716,-37.23490349996252,-41,0,0.4461869575000002,0.15177480000000004,0.0023371150000000033,0,0,0 +35.200000000000003,-5.4011216736405032,9.6066153542405033,-30,0,0.70043015000000008,0.19164979999999995,0.0015367000000000022,0,0,0 +35.200000000000003,-21.604486694562013,-86.45953818816453,-30,0,0.70043015000000008,0.19164979999999995,0.0015367000000000022,0,0,0 +35.200000000000003,-12.109738563386159,0.037484791004560591,-20,0,0.85608132142857163,0.17164979999999996,-0.0012224142857142869,0,0,0 +35.200000000000003,-48.438954253544637,-0.33736311904104532,-20,0,0.85608132142857163,0.17164980000000002,-0.0012224142857142871,0,0,0 +35.200000000000003,11.75197738317857,-9.5241292360080703,-12.5,0,0.97281970000000029,0.15664980000000001,-0.0032917500000000039,0,0,0 +35.200000000000003,47.00790953271428,85.717163124072627,-12.5,0,0.97281970000000029,0.15664980000000001,-0.0032917500000000039,0,0,0 +35.200000000000003,21.038370881567459,3.5302548364859625,-7.2999999999999998,0,1.053758462666667,0.14624979999999999,-0.0042183900000000059,0,0,0 +35.200000000000003,84.153483526269838,-31.772293528373662,-7.2999999999999998,0,1.053758462666667,0.14624979999999999,-0.0042183900000000059,0,0,0 +35.200000000000003,-15.973711330369085,3.4445876816223553,-1,0,1.1518185000000001,0.13364979999999999,-0.00092565000000000106,0,0,0 +35.200000000000003,-63.894845321476339,-31.001289134601198,-1,0,1.1518185000000001,0.13364979999999999,-0.00092565000000000106,0,0,0 +35.200000000000003,-20.737096172036509,-6.9182720241524791,0,0,1.1673835500000003,0.13164979999999998,0,0,0,0 +35.200000000000003,-82.948384688146035,62.264448217372312,0,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,24.682597011745329,2.2417909878109477,2,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,98.730388046981318,-20.176118890298529,2,0,1.16738355,0.13164979999999998,0,0,0,0 +39.999999999989114,-28.536695796128988,-4.9250282768244125,-70,0,0.44488022222228624,0.15425802777801495,0.0081487222222240592,0,0,0 +40,-114.14678318451595,44.325254491419713,-70,0,0.44488022222222223,0.15425802777777775,0.0081487222222222239,0,0,0 +40,-37.794874756703308,-3.1006887978684139,-50,0,0.44488022222222223,0.15425802777777775,0.0081487222222222239,0,0,0 +40,-151.17949902681323,27.906199180815726,-50,0,0.44488022222222223,0.15425802777777775,0.0081487222222222239,0,0,0 +40,-34.489431309685216,0.39550850033954532,-41,0,0.6050369347222222,0.13625802777777773,0.0076929597222222239,0,0,0 +40,-137.95772523874086,-3.5595765030559079,-41,0,0.6050369347222222,0.13625802777777773,0.0076929597222222239,0,0,0 +40,-22.625244513000098,-1.5039685698797065,-30,0,0.8007840277777778,0.11425802777777774,0.0071359166666666671,0,0,0 +40,-90.500978052000391,13.535717128917359,-30,0,0.8007840277777778,0.11425802777777774,0.0071359166666666671,0,0,0 +40,-8.384812969166795,-6.8755142722931524,-20,0,0.9787361547619049,0.094258027777777739,0.0060189801587301603,0,0,0 +40,-33.53925187666718,61.879628450638371,-20,0,0.9787361547619049,0.094258027777777739,0.0060189801587301603,0,0,0 +40,-24.046467454115312,9.1937867724362334,-12.5,0,1.1122002500000001,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-96.185869816461249,-82.744080951926094,-12.5,0,1.1122002500000001,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-7.1583616365327529,-9.175947291231326,-7.2999999999999998,0,1.2047352899999999,0.068858027777777747,-0.0041151281481481465,0,0,0 +40,-28.633446546131012,82.583525621081932,-7.2999999999999998,0,1.2047352899999999,0.068858027777777747,-0.0041151281481481465,0,0,0 +40,-37.563419615947083,-7.9501130849871888,-1,0,1.3168453833333331,0.05625802777777774,-0.0016453999999999993,0,0,0 +40,-150.25367846378833,71.551017764884705,-1,0,1.3168453833333331,0.056258027777777747,-0.0016453999999999993,0,0,0 +40,16.627586727950444,-1.7018366852211031,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,66.510346911801776,15.316530166989928,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,-20.299794883215469,2.2463666881873419,2,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,-81.199179532861876,-20.217300193686079,2,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +70.299999999980059,-27.259439885464111,1.3303422268762404,-70,0,0.37937107777694035,0.16835632222213204,0.0059161777777496137,0,0,0 +70.300000000000011,-109.03775954185645,-11.973080041886163,-70,0,0.37937107777777823,0.16835632222222227,0.0059161777777777943,0,0,0 +70.300000000000011,-18.329419181105777,8.4999330687997166,-50,0,0.37937107777777823,0.16835632222222227,0.0059161777777777943,0,0,0 +70.300000000000011,-73.317676724423109,-76.499397619197453,-50,0,0.37937107777777823,0.16835632222222227,0.0059161777777777943,0,0,0 +70.300000000000011,-28.279731776551642,0.40439045633691961,-41,0,0.55443892902777825,0.16629382222222219,0.0051134702777777949,0,0,0 +70.300000000000011,-113.11892710620657,-3.6395141070322765,-41,0,0.55443892902777825,0.16629382222222217,0.0051134702777777949,0,0,0 +70.300000000000011,7.2620474241576645,1.7805222100826015,-30,0,0.76841074722222258,0.16377298888888869,0.0041323833333333504,0,0,0 +70.300000000000011,29.048189696630658,-16.024699890743413,-30,0,0.76841074722222258,0.16377298888888869,0.0041323833333333504,0,0,0 +70.300000000000011,5.5694295374896896,7.4337734139059322,-20,0,0.93916869166666705,0.1437729888888887,0.0013812103174603439,0,0,0 +70.300000000000011,22.277718149958758,-66.903960725153382,-20,0,0.93916869166666705,0.1437729888888887,0.0013812103174603439,0,0,0 +70.300000000000011,-32.08471351381484,5.2144014253670647,-12.5,0,1.0672371500000004,0.12877298888888872,-0.00068216944444441123,0,0,0 +70.300000000000011,-128.33885405525936,-46.929612828303583,-12.5,0,1.0672371500000004,0.12877298888888872,-0.00068216944444441123,0,0,0 +70.300000000000011,30.99699708402197,-7.6298523843479193,-7.2999999999999998,0,1.1560313793333339,0.11837298888888871,-0.00550248085185185,0,0,0 +70.300000000000011,123.98798833608788,68.668671459131275,-7.2999999999999998,0,1.1560313793333339,0.11837298888888871,-0.00550248085185185,0,0,0 +70.300000000000011,16.420688115163323,0.3052507316806885,-1,0,1.2636089300000006,0.10577298888888871,-0.0015269083333333353,0,0,0 +70.300000000000011,65.68275246065329,-2.7472565851261965,-1,0,1.2636089300000006,0.10577298888888871,-0.0015269083333333353,0,0,0 +70.300000000000011,-12.057577684522364,-8.488938632238991,0,0,1.2806847250000004,0.10377298888888872,0,0,0,0 +70.300000000000011,-48.230310738089457,76.400447690150912,0,0,1.2806847250000004,0.10377298888888871,0,0,0,0 +70.300000000000011,-7.3514790764289799,0.57507548381627416,2,0,1.2806847250000004,0.10377298888888871,0,0,0,0 +70.300000000000011,-29.40591630571592,-5.1756793543464674,2,0,1.2806847250000004,0.1037729888888887,0,0,0,0 diff --git a/tests/data/currents_mdc/c5uniform/ref_python.csv b/tests/data/currents_mdc/c5uniform/ref_python.csv new file mode 100644 index 00000000..947bd68b --- /dev/null +++ b/tests/data/currents_mdc/c5uniform/ref_python.csv @@ -0,0 +1,341 @@ +t,x,y,z,zeta,ux,uy,uz,ax,ay,az +0,-7.0227440711249898,5.1111914475697731,-70,0,0,0,0,0,0,0 +0,-28.090976284499959,-46.000723028127958,-70,0,0,0,0,0,0,0 +0,31.485198909702078,-2.7143405605404558,-50,0,0,0,0,0,0,0 +0,125.94079563880831,24.429065044864103,-50,0,0,0,0,0,0,0 +0,-20.809732103447978,-0.11709455529188517,-41,0,0.27172440000000003,0.094500000000000015,0,0,0,0 +0,-83.238928413791911,1.0538509976269665,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +0,39.372803737268669,8.1470737833757489,-30,0,0.60383200000000004,0.20999999999999996,0,0,0,0 +0,157.49121494907467,-73.323664050381737,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +0,22.655718499009495,9.0072588429436564,-20,0,0.73801714285714282,0.19,0,0,0,0 +0,90.622873996037981,-81.065329586492908,-20,0,0.73801714285714293,0.19,0,0,0,0 +0,-18.753718663728201,-6.3312860955636596,-12.5,0,0.83865599999999985,0.17499999999999999,0,0,0,0 +0,-75.014874654912802,56.981574860072939,-12.5,0,0.83865599999999996,0.17500000000000002,0,0,0,0 +0,-12.854524951559121,-9.2261219752510932,-7.2999999999999998,0,0.90843237333333338,0.1646,0,0,0,0 +0,-51.418099806236484,83.035097777259836,-7.2999999999999998,0,0.90843237333333338,0.16460000000000002,0,0,0,0 +0,-14.582842600996724,9.9481395883889334,-1,0,0.99296859999999965,0.15199999999999997,0,0,0,0 +0,-58.331370403986895,-89.533256295500394,-1,0,0.99296860000000009,0.15200000000000002,0,0,0,0 +0,36.632586546811126,8.810295057781655,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,146.5303461872445,-79.292655520034899,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,-29.96197077630681,-7.4273365256825441,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0,-119.84788310522724,66.846028731142894,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +0.69999999999999996,-28.02076086210656,-6.5230478214981957,-70,0,0.075781299999999968,0.037911299999999988,0.00095199999999999994,0,0,0 +0.69999999999999996,-112.08304344842624,58.707430393483762,-70,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,-36.14628172153602,-9.2849199404695852,-50,0,0.075781299999999968,0.037911299999999995,0.00095199999999999983,0,0,0 +0.69999999999999996,-144.58512688614408,83.564279464226274,-50,0,0.075781299999999982,0.037911299999999995,0.00095199999999999994,0,0,0 +0.69999999999999996,3.3553280663774103,-4.0977833792740519,-41,0,0.32723521375000003,0.1127238,0.00074362750000000002,0,0,0 +0.69999999999999996,13.421312265509641,36.880050413466464,-41,0,0.32723521375000003,0.11272379999999999,0.00074362750000000002,0,0,0 +0.69999999999999996,-31.972033235176774,5.4521511695150906,-30,0,0.63456777500000006,0.20416129999999999,0.00048894999999999993,0,0,0 +0.69999999999999996,-127.8881329407071,-49.069360525635815,-30,0,0.63456777499999995,0.20416129999999996,0.00048894999999999993,0,0,0 +0.69999999999999996,34.379596770195292,-8.7218122019177518,-20,0,0.7755830178571429,0.1841613,-0.00038894999999999999,0,0,0 +0.69999999999999996,137.51838708078117,78.496309817259771,-20,0,0.77558301785714279,0.18416129999999997,-0.00038894999999999999,0,0,0 +0.69999999999999996,11.16126785635651,2.5043531721859065,-12.5,0,0.88134444999999983,0.16916129999999999,-0.0010473749999999999,0,0,0 +0.69999999999999996,44.645071425426039,-22.53917854967316,-12.5,0,0.88134444999999995,0.16916130000000001,-0.0010473750000000001,0,0,0 +0.69999999999999996,-29.348708093264236,0.95625921196315034,-7.2999999999999998,0,0.95467249266666654,0.15876129999999997,-0.0013422149999999999,0,0,0 +0.69999999999999996,-117.39483237305694,-8.606332907668353,-7.2999999999999998,0,0.95467249266666654,0.15876129999999999,-0.0013422150000000001,0,0,0 +0.69999999999999996,-22.203587385333094,-2.0378883977280582,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999991,0,0,0 +0.69999999999999996,-88.814349541332376,18.340995579552523,-1,0,1.04351175,0.14616129999999999,-0.00029452499999999996,0,0,0 +0.69999999999999996,18.190400780927327,7.6932029114202614,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,72.761603123709307,-69.238826202782349,0,0,1.057613175,0.14416129999999999,0,0,0,0 +0.69999999999999996,-24.12915133518095,1.4288192371581143,2,0,1.057613175,0.14416129999999996,0,0,0,0 +0.69999999999999996,-96.5166053407238,-12.859373134423029,2,0,1.0576131750000002,0.14416129999999999,0,0,0,0 +2.9998999999999998,-22.696983243303571,4.7645721603939695,-70,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,-90.787932973214282,-42.881149443545723,-70,0,0.32476617409999997,0.16247158409999993,0.0040798640000000008,0,0,0 +2.9998999999999998,29.60912871286267,-4.5951718023777177,-50,0,0.32476617409999997,0.16247158409999995,0.0040798640000000008,0,0,0 +2.9998999999999998,118.43651485145068,41.356546221399462,-50,0,0.32476617409999997,0.16247158409999995,0.0040798639999999999,0,0,0 +2.9998999999999998,25.618852234935133,7.6544913688136056,-41,0,0.50961995738374999,0.17259939659999998,0.0031868687675000004,0,0,0 +2.9998999999999998,102.47540893974053,-68.890422319322454,-41,0,0.50961995738374999,0.17259939660000001,0.0031868687675,0,0,0 +2.9998999999999998,10.53684893278772,-6.7450871122768952,-30,0,0.73555235917499995,0.18497783410000002,0.00209543015,0,0,0 +2.9998999999999998,42.14739573115088,60.705784010492053,-30,0,0.73555235917499995,0.18497783410000002,0.00209543015,0,0,0 +2.9998999999999998,-20.117303652755972,-8.1552875404150704,-20,0,0.89900838344642842,0.16497783410000003,-0.0016668730071428568,0,0,0 +2.9998999999999998,-80.469214611023887,73.397587863735637,-20,0,0.89900838344642831,0.1649778341,-0.0016668730071428565,0,0,0 +2.9998999999999998,28.877993020518687,3.6868449410257362,-12.5,0,1.0216004016499998,0.14997783409999998,-0.0044886003749999986,0,0,0 +2.9998999999999998,115.51197208207475,-33.18160446923163,-12.5,0,1.0216004016499998,0.14997783409999998,-0.0044886003749999995,0,0,0 +2.9998999999999998,34.889472036363031,-8.6499183972374354,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582549999997,0,0,0 +2.9998999999999998,139.55788814545213,77.849265575136911,-7.2999999999999998,0,1.1065977076019999,0.13957783410000002,-0.0057521582550000006,0,0,0 +2.9998999999999998,-17.050722524734745,6.4104332387690839,-1,0,1.2095748795500001,0.12697783409999999,-0.0012622079249999998,0,0,0 +2.9998999999999998,-68.20289009893898,-57.693899148921759,-1,0,1.2095748795500001,0.12697783410000002,-0.0012622079249999998,0,0,0 +2.9998999999999998,-16.690651040342416,-9.1022902008163555,0,0,1.2259204319750001,0.1249778341,0,0,0,0 +2.9998999999999998,-66.762604161369666,81.9206118073472,0,0,1.2259204319750001,0.12497783410000002,0,0,0,0 +2.9998999999999998,9.3410154959595459,-0.67081577166983664,2,0,1.2259204319749999,0.1249778341,0,0,0,0 +2.9998999999999998,37.364061983838184,6.0373419450285297,2,0,1.2259204319749999,0.12497783410000002,0,0,0,0 +3,-10.836166288895548,-2.8115086833376761,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,-43.344665155582192,25.303578150039087,-70,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,16.775443700382759,-6.7131723758024897,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,67.101774801531036,60.418551382222404,-50,0,0.32477699999999998,0.16247699999999998,0.0040800000000000003,0,0,0 +3,15.427820937577209,9.2448327960807788,-41,0,0.50962788749999999,0.17260200000000001,0.0031869750000000003,0,0,0 +3,61.711283750308837,-83.203495164727002,-41,0,0.50962788749999999,0.17260200000000001,0.0031869750000000007,0,0,0 +3,7.630055290347471,-3.3308172468554282,-30,0,0.73555675000000009,0.184977,0.0020955000000000006,0,0,0 +3,30.520221161389884,29.977355221698854,-30,0,0.73555674999999998,0.184977,0.0020955000000000001,0,0,0 +3,-27.412426819126992,9.6358073816110839,-20,0,0.89901374999999983,0.16497700000000001,-0.0016669285714285709,0,0,0 +3,-109.64970727650797,-86.722266434499758,-20,0,0.89901374999999994,0.16497699999999998,-0.0016669285714285709,0,0,0 +3,17.203682945812851,6.8040296956902608,-12.5,0,1.0216064999999999,0.149977,-0.0044887499999999997,0,0,0 +3,68.814731783251403,-61.236267261212348,-12.5,0,1.0216064999999999,0.149977,-0.0044887499999999997,0,0,0 +3,-38.990395083912347,-8.6007969180635229,-7.2999999999999998,0,1.1066043133333334,0.13957699999999998,-0.0057523500000000007,0,0,0 +3,-155.96158033564939,77.407172262571706,-7.2999999999999998,0,1.1066043133333334,0.13957700000000001,-0.0057523500000000007,0,0,0 +3,-29.231849903309861,7.1667743025490402,-1,0,1.2095821,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-116.92739961323944,-64.500968722941366,-1,0,1.2095820999999998,0.12697700000000001,-0.0012622499999999999,0,0,0 +3,-35.203358965445574,-9.0692755562979404,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-140.8134358617823,81.623480006681461,0,0,1.2259277499999999,0.124977,0,0,0,0 +3,-36.116039280277235,-3.8822382563456852,2,0,1.2259277499999999,0.12497700000000002,0,0,0,0 +3,-144.46415712110894,34.940144307111169,2,0,1.2259277499999999,0.124977,0,0,0,0 +4.4000000000000004,1.1124388464913793,5.2052587647150101,-70,0,0.38357062222222227,0.16880857777777775,0.0060574222222222231,0,0,0 +4.4000000000000004,4.449755385965517,-46.847328882435093,-70,0,0.38357062222222227,0.16880857777777772,0.0060574222222222231,0,0,0 +4.4000000000000004,34.909765359536976,4.6492065207760032,-50,0,0.38357062222222227,0.16880857777777775,0.0060574222222222231,0,0,0 +4.4000000000000004,139.63906143814791,-41.84285868698403,-50,0,0.38357062222222227,0.16880857777777775,0.0060574222222222231,0,0,0 +4.4000000000000004,33.382476189054231,6.2852042478643355,-41,0,0.55788593222222227,0.16580857777777777,0.0052616622222222235,0,0,0 +4.4000000000000004,133.52990475621692,-56.56683823077902,-41,0,0.55788593222222216,0.16580857777777777,0.0052616622222222235,0,0,0 +4.4000000000000004,21.118088989511691,7.1464517926659141,-30,0,0.77093797777777773,0.16214191111111109,0.0042890666666666674,0,0,0 +4.4000000000000004,84.472355958046762,-64.318066133993227,-30,0,0.77093797777777773,0.16214191111111109,0.0042890666666666674,0,0,0 +4.4000000000000004,-16.791523486757871,1.797590082510812,-20,0,0.94225753333333329,0.14214191111111113,0.0016156825396825409,0,0,0 +4.4000000000000004,-67.166093947031484,-16.178310742597308,-20,0,0.94225753333333329,0.1421419111111111,0.0016156825396825406,0,0,0 +4.4000000000000004,7.9041211742781954,-0.054646302818639469,-12.5,0,1.0707471999999998,0.12714191111111112,-0.00038935555555555428,0,0,0 +4.4000000000000004,31.616484697112782,0.49181672536775523,-12.5,0,1.0707472,0.12714191111111112,-0.00038935555555555433,0,0,0 +4.4000000000000004,38.844175038483527,7.1843931317166643,-7.2999999999999998,0,1.1598334613333334,0.11674191111111111,-0.0054832601481481485,0,0,0 +4.4000000000000004,155.37670015393411,-64.659538185449975,-7.2999999999999998,0,1.1598334613333334,0.11674191111111112,-0.0054832601481481485,0,0,0 +4.4000000000000004,-8.7213686226181331,2.9390179049262528,-1,0,1.2677648399999997,0.10414191111111111,-0.0015472666666666668,0,0,0 +4.4000000000000004,-34.885474490472532,-26.451161144336275,-1,0,1.2677648399999997,0.10414191111111112,-0.0015472666666666666,0,0,0 +4.4000000000000004,-31.500770648871857,-4.1916864180962037,0,0,1.2848967999999996,0.10214191111111112,0,0,0,0 +4.4000000000000004,-126.00308259548743,37.725177762865833,0,0,1.2848967999999998,0.10214191111111112,0,0,0,0 +4.4000000000000004,-31.018717744515953,4.2873602486832603,2,0,1.2848967999999998,0.10214191111111111,0,0,0,0 +4.4000000000000004,-124.07487097806381,-38.586242238149339,2,0,1.2848967999999998,0.10214191111111112,0,0,0,0 +6.9900000000000002,25.984579991006967,6.1489211330709139,-70,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,103.93831996402787,-55.340290197638225,-70,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,25.581854432298712,9.7110801990826481,-50,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,102.32741772919485,-87.399721791743829,-50,0,0.44493905333333333,0.15447589416666666,0.0081504083333333345,0,0,0 +6.9900000000000002,36.400293065186446,-6.4788192721909388,-41,0,0.60511694520833337,0.13647589416666667,0.0076923574583333352,0,0,0 +6.9900000000000002,145.60117226074578,58.30937344971845,-41,0,0.60511694520833337,0.13647589416666667,0.0076923574583333352,0,0,0 +6.9900000000000002,-16.131052630012999,-9.933801481428981,-30,0,0.80088992416666671,0.11447589416666668,0.0071325175000000003,0,0,0 +6.9900000000000002,-64.524210520051994,89.404213332860834,-30,0,0.80088992416666671,0.11447589416666666,0.0071325175000000003,0,0,0 +6.9900000000000002,11.949152372833652,-0.64963881772035137,-20,0,0.97886558321428563,0.094475894166666657,0.0060124627380952391,0,0,0 +6.9900000000000002,47.796609491334607,5.8467493594831623,-20,0,0.97886558321428574,0.094475894166666657,0.0060124627380952391,0,0,0 +6.9900000000000002,1.7948777433545473,1.0536637081014071,-12.5,0,1.1123473274999998,0.079475894166666658,0.005172421666666668,0,0,0 +6.9900000000000002,7.1795109734181892,-9.4829733729126637,-12.5,0,1.1123473275,0.079475894166666658,0.0051724216666666671,0,0,0 +6.9900000000000002,-5.9676589396120221,-1.1771128513667843,-7.2999999999999998,0,1.2048946048333333,0.069075894166666665,-0.0041257341555555552,0,0,0 +6.9900000000000002,-23.870635758448088,10.594015662301059,-7.2999999999999998,0,1.2048946048333331,0.069075894166666665,-0.0041257341555555552,0,0,0 +6.9900000000000002,24.096936358151595,3.4748222061226919,-1,0,1.3170195235,0.056475894166666665,-0.0016476759999999998,0,0,0 +6.9900000000000002,96.38774543260638,-31.273399855104227,-1,0,1.3170195235,0.056475894166666665,-0.0016476759999999994,0,0,0 +6.9900000000000002,34.277818838471035,0.919347914896818,0,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +6.9900000000000002,137.11127535388414,-8.274131234071362,0,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +6.9900000000000002,29.82452168463881,-6.7856616184547498,2,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +6.9900000000000002,119.29808673855524,61.070954566092752,2,0,1.3348171600000001,0.054475894166666664,0,0,0,0 +10.1,-38.713778106373411,-2.6909196691918824,-70,0,0.41853184999999998,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,-154.85511242549364,24.218277022726941,-70,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,21.585287827692134,-1.5231418564411054,-50,0,0.41853184999999993,0.085899412500000008,0.0067420250000000004,0,0,0 +10.1,86.341151310768538,13.708276707969949,-50,0,0.41853184999999993,0.085899412499999994,0.0067420250000000004,0,0,0 +10.1,33.277869171065134,-8.813343938797555,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,133.11147668426054,79.320095449177998,-41,0,0.56920315062499993,0.067899412500000006,0.0069823418750000008,0,0,0 +10.1,33.313263307978758,2.9080081138450176,-30,0,0.75335696250000006,0.045899412500000007,0.0072760624999999995,0,0,0 +10.1,133.25305323191503,-26.172073024605158,-30,0,0.75335696250000006,0.045899412500000014,0.0072760624999999995,0,0,0 +10.1,-4.6156042235926691,5.4690483641294811,-20,0,0.92076984821428554,0.0258994125,0.006310641071428571,0,0,0 +10.1,-18.462416894370676,-49.221435277165327,-20,0,0.92076984821428565,0.025899412499999996,0.0063106410714285702,0,0,0 +10.1,14.431288479807982,-6.0866448253907741,-12.5,0,1.0463295125000001,0.010899412499999999,0.0055865749999999999,0,0,0 +10.1,57.725153919231929,54.779803428516971,-12.5,0,1.0463295125000001,0.010899412499999999,0.0055865749999999999,0,0,0 +10.1,-22.287438378876743,-5.9931563516567943,-7.2999999999999998,0,1.1333839605,0.00049941250000000003,-0.00092980499999999991,0,0,0 +10.1,-89.149753515506973,53.938407164911148,-7.2999999999999998,0,1.1333839605,0.00049941249999999981,-0.00092980500000000013,0,0,0 +10.1,24.798799380345031,-3.9029596822975527,-1,0,1.2388542025000002,-0.012100587500000003,-0.00076240999999999982,0,0,0 +10.1,99.195197521380123,35.126637140677971,-1,0,1.2388542024999998,-0.012100587500000001,-0.00076240999999999972,0,0,0 +10.1,-22.749879023039252,8.3958130959682222,0,0,1.25559555,-0.014100587500000001,0,0,0,0 +10.1,-90.999516092157009,-75.562317863714,0,0,1.25559555,-0.014100587500000003,0,0,0,0 +10.1,22.027009649720995,1.515237560299898,2,0,1.25559555,-0.014100587500000003,0,0,0,0 +10.1,88.108038598883979,-13.637138042699082,2,0,1.25559555,-0.014100587500000004,0,0,0,0 +15,13.876708886608398,0.74198059533564731,-70,0,0.35357499999999997,-0.024507999999999995,0.0019780000000000002,0,0,0 +15,55.506835546433592,-6.6778253580208258,-70,0,0.35357499999999997,-0.024508000000000002,0.0019780000000000002,0,0,0 +15,-2.7469521472092566,-3.5314995308744734,-50,0,0.35357499999999997,-0.024507999999999995,0.0019780000000000002,0,0,0 +15,-10.987808588837026,31.783495777870261,-50,0,0.35357500000000003,-0.024508000000000002,0.0019780000000000006,0,0,0 +15,29.646585258486994,9.962368830173471,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,118.58634103394797,-89.661319471561242,-41,0,0.48086200000000001,-0.042507999999999997,0.0032802999999999999,0,0,0 +15,37.053032151947576,9.8181285065495807,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,148.21212860779031,-88.36315655894623,-30,0,0.63643499999999997,-0.064507999999999996,0.0048719999999999996,0,0,0 +15,21.029863466981439,-5.0995662461400215,-20,0,0.77786528571428559,-0.084507999999999986,0.0018034285714285713,0,0,0 +15,84.119453867925756,45.896096215260194,-20,0,0.7778652857142857,-0.084508,0.0018034285714285713,0,0,0 +15,32.845196822829848,-2.3039314011475254,-12.5,0,0.883938,-0.099507999999999985,-0.00049799999999999996,0,0,0 +15,131.38078729131939,20.735382610327729,-12.5,0,0.883938,-0.099507999999999999,-0.00049799999999999996,0,0,0 +15,36.136092054079853,7.0038673785676444,-7.2999999999999998,0,0.95748125333333345,-0.10990800000000001,0.0038103733333333333,0,0,0 +15,144.54436821631941,-63.034806407108803,-7.2999999999999998,0,0.95748125333333334,-0.10990800000000001,0.0038103733333333333,0,0,0 +15,-11.799015997376479,9.1435538652081547,-1,0,1.0465819999999999,-0.12250800000000001,0.0011431999999999996,0,0,0 +15,-47.196063989505916,-82.2919847868734,-1,0,1.0465820000000001,-0.12250799999999999,0.0011431999999999998,0,0,0 +15,-13.440509756587147,3.6347630909713775,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,-53.762039026348589,-32.712867818742396,0,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,0.9221939903324099,-3.9009838610955754,2,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +15,3.6887759613296396,35.108854749860178,2,0,1.0607249999999999,-0.12450799999999999,0,0,0,0 +22.199999999999999,36.867108357945853,4.3234528028892942,-70,0,0.43220379999999992,0.062470399999999981,0.0028900000000000002,0,0,0 +22.199999999999999,147.46843343178341,-38.911075226003646,-70,0,0.43220379999999997,0.062470399999999988,0.0028900000000000002,0,0,0 +22.199999999999999,-32.328943017938776,-1.8016757645856387,-50,0,0.43220379999999992,0.062470399999999981,0.0028900000000000002,0,0,0 +22.199999999999999,-129.31577207175511,16.215081881270748,-50,0,0.43220379999999997,0.062470399999999981,0.0028900000000000002,0,0,0 +22.199999999999999,-35.80139720077473,-5.1599786500436888,-41,0,0.58779716800000004,0.044470399999999979,0.00089160400000000114,0,0,0 +22.199999999999999,-143.20558880309892,46.439807850393201,-41,0,0.58779716800000004,0.044470399999999986,0.00089160400000000092,0,0,0 +22.199999999999999,-26.223680897920421,8.239591500764341,-30,0,0.77796683999999994,0.022470399999999984,-0.001550879999999998,0,0,0 +22.199999999999999,-104.89472359168168,-74.156323506879062,-30,0,0.77796683999999994,0.022470399999999988,-0.001550879999999998,0,0,0 +22.199999999999999,23.990432529791548,4.2782867938128177,-20,0,0.95084837142857137,0.0024703999999999863,-0.00053999999999999936,0,0,0 +22.199999999999999,95.961730119166191,-38.50458114431536,-20,0,0.95084837142857137,0.0024703999999999868,-0.00053999999999999925,0,0,0 +22.199999999999999,2.887023810869664,6.4828489826972664,-12.5,0,1.0805095199999999,-0.012529600000000016,0.00021815999999999985,0,0,0 +22.199999999999999,11.548095243478656,-58.345640844275394,-12.5,0,1.0805095199999999,-0.012529600000000016,0.00021815999999999985,0,0,0 +22.199999999999999,32.434164811981134,-7.8507772219933631,-7.2999999999999998,0,1.1704078965333331,-0.022929600000000015,-0.00099395306666666535,0,0,0 +22.199999999999999,129.73665924792454,70.656994997940274,-7.2999999999999998,0,1.1704078965333333,-0.022929600000000015,-0.00099395306666666535,0,0,0 +22.199999999999999,27.646650826375748,6.6777754328004413,-1,0,1.2793232479999999,-0.035529600000000008,-0.0003060159999999995,0,0,0 +22.199999999999999,110.58660330550299,-60.099978895203975,-1,0,1.2793232479999999,-0.035529600000000015,-0.0003060159999999995,0,0,0 +22.199999999999999,0.74396917360442671,5.562222983029244,0,0,1.2966113999999997,-0.03752960000000001,0,0,0,0 +22.199999999999999,2.9758766944177069,-50.060006847263196,0,0,1.2966113999999997,-0.037529600000000017,0,0,0,0 +22.199999999999999,25.152845672099858,7.842833299939155,2,0,1.2966113999999997,-0.03752960000000001,0,0,0,0 +22.199999999999999,100.61138268839943,-70.585499699452399,2,0,1.2966113999999997,-0.03752960000000001,0,0,0,0 +27,34.177434854625872,5.9766241601186021,-70,0,0.48462299999999991,0.12045600000000001,0.0034980000000000002,0,0,0 +27,136.70973941850349,-53.789617441067421,-70,0,0.48462299999999997,0.12045600000000001,0.0034980000000000002,0,0,0 +27,22.493094807101244,-0.30775054810584912,-50,0,0.48462299999999997,0.12045600000000001,0.0034980000000000002,0,0,0 +27,89.972379228404975,2.7697549329526421,-50,0,0.48462299999999997,0.12045600000000001,0.0034980000000000002,0,0,0 +27,25.885819390472761,-5.8243899747383665,-41,0,0.65908728000000005,0.10245600000000002,-0.00070085999999999933,0,0,0 +27,103.54327756189105,52.419509772645299,-41,0,0.65908728000000005,0.10245600000000001,-0.00070085999999999933,0,0,0 +27,-28.483027801526923,-9.3070219450368796,-30,0,0.87232140000000002,0.080456000000000014,-0.0058328,0,0,0 +27,-113.93211120610769,83.763197505331917,-30,0,0.87232140000000002,0.080456000000000014,-0.0058327999999999991,0,0,0 +27,9.0213466103913547,-3.454486553556011,-20,0,1.0661704285714286,0.06045600000000001,-0.0021022857142857141,0,0,0 +27,36.085386441565419,31.090378982004097,-20,0,1.0661704285714286,0.060456000000000017,-0.0021022857142857141,0,0,0 +27,-7.8579344021051085,4.3088050425696949,-12.5,0,1.2115571999999999,0.04545600000000001,0.00069559999999999999,0,0,0 +27,-31.431737608420434,-38.779245383127254,-12.5,0,1.2115571999999999,0.04545600000000001,0.00069559999999999999,0,0,0 +27,3.846277922265557,2.544877826817034,-7.2999999999999998,0,1.3123589919999998,0.035056000000000011,-0.0041968373333333324,0,0,0 +27,15.385111689062228,-22.903900441353308,-7.2999999999999998,0,1.3123589920000001,0.035056000000000004,-0.0041968373333333324,0,0,0 +27,18.177235829689387,4.6831025268385353,-1,0,1.4344840799999998,0.022456000000000018,-0.0012721599999999996,0,0,0 +27,72.708943318757548,-42.147922741546822,-1,0,1.4344840800000001,0.022456000000000018,-0.0012721599999999996,0,0,0 +27,-0.75801079980575992,-8.7983991709748484,0,0,1.4538689999999996,0.020456000000000012,0,0,0,0 +27,-3.0320431992230397,79.185592538773633,0,0,1.4538689999999999,0.020456000000000016,0,0,0,0 +27,21.20569224848559,-8.5978798774983201,2,0,1.4538689999999999,0.020456000000000016,0,0,0,0 +27,84.822768993942361,77.380918897484875,2,0,1.4538689999999999,0.020456000000000016,0,0,0,0 +29.899999999999999,1.4068909434364869,-8.3769989685523569,-70,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,5.6275637737459476,75.392990716971212,-70,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,35.734934922741331,1.1619742971977622,-50,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,142.93973969096533,-10.45776867477986,-50,0,0.51629293333333337,0.15548896666666667,0.0038653333333333335,0,0,0 +29.899999999999999,37.799493650061336,0.41397227450426044,-41,0,0.70215838933333341,0.13748896666666668,-0.0016629736666666664,0,0,0 +29.899999999999999,151.19797460024535,-3.725750470538344,-41,0,0.70215838933333352,0.13748896666666668,-0.0016629736666666666,0,0,0 +29.899999999999999,20.183925874373905,1.0212616773877166,-30,0,0.92932728000000009,0.11548896666666666,-0.0084197933333333332,0,0,0 +29.899999999999999,80.735703497495621,-9.191355096489449,-30,0,0.9293272800000002,0.11548896666666666,-0.0084197933333333332,0,0,0 +29.899999999999999,-17.815889634232171,-1.0721355449493082,-20,0,1.1358441714285714,0.095488966666666675,-0.0030461666666666666,0,0,0 +29.899999999999999,-71.263558536928684,9.6492199045437737,-20,0,1.1358441714285712,0.095488966666666675,-0.0030461666666666666,0,0,0 +29.899999999999999,10.672238679317502,-7.2897431841229476,-12.5,0,1.2907318399999999,0.080488966666666675,0.00098405333333333352,0,0,0 +29.899999999999999,42.688954717270008,65.607688657106536,-12.5,0,1.2907318399999999,0.080488966666666675,0.00098405333333333352,0,0,0 +29.899999999999999,-26.973218729797495,0.3614691414785991,-7.2999999999999998,0,1.3981211121777777,0.070088966666666669,-0.006131913244444444,0,0,0 +29.899999999999999,-107.89287491918998,-3.2532222733073919,-7.2999999999999998,0,1.3981211121777775,0.070088966666666669,-0.0061319132444444431,0,0,0 +29.899999999999999,37.135747505861445,-5.5397219777701583,-1,0,1.5282270826666662,0.057488966666666662,-0.0018558719999999993,0,0,0 +29.899999999999999,148.54299002344578,49.857497799931423,-1,0,1.5282270826666664,0.057488966666666662,-0.0018558719999999993,0,0,0 +29.899999999999999,14.740809994223198,9.1125628640246106,0,0,1.5488787999999998,0.055488966666666667,0,0,0,0 +29.899999999999999,58.963239976892794,-82.013065776221495,0,0,1.5488787999999998,0.055488966666666667,0,0,0,0 +29.899999999999999,-11.677147320143256,-9.2474157959482923,2,0,1.5488787999999998,0.055488966666666674,0,0,0,0 +29.899999999999999,-46.708589280573023,83.226742163534624,2,0,1.5488787999999998,0.055488966666666667,0,0,0,0 +30,-8.650754310000881,9.1693461371038794,-70,0,0,0,0,0,0,0 +30,-34.603017240003524,-82.524115233934907,-70,0,0,0,0,0,0,0 +30,-21.528344832550019,-2.4498442073934967,-50,0,0,0,0,0,0,0 +30,-86.113379330200075,22.048597866541471,-50,0,0,0,0,0,0,0 +30,-37.913659422049847,1.7869178293190444,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +30,-151.65463768819939,-16.0822604638714,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +30,8.4481059835368626,-0.71042863432680114,-30,0,0.60383199999999992,0.20999999999999996,0,0,0,0 +30,33.79242393414745,6.3938577089412103,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +30,-10.984575041640863,-1.482566812128896,-20,0,0.73801714285714282,0.18999999999999997,0,0,0,0 +30,-43.938300166563451,13.343101309160064,-20,0,0.73801714285714271,0.18999999999999997,0,0,0,0 +30,17.471716959475991,-3.3085417618235073,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +30,69.886867837903964,29.776875856411564,-12.5,0,0.83865600000000007,0.17499999999999999,0,0,0,0 +30,-9.9692979111432862,6.4769913695198262,-7.2999999999999998,0,0.90843237333333338,0.1646,0,0,0,0 +30,-39.877191644573145,-58.292922325678433,-7.2999999999999998,0,0.90843237333333338,0.1646,0,0,0,0 +30,19.286561874569031,-9.7170013962221802,-1,0,0.99296859999999998,0.152,0,0,0,0 +30,77.146247498276125,87.453012565999614,-1,0,0.99296859999999987,0.152,0,0,0,0 +30,26.75939860221601,-2.596169523828566,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30,107.03759440886404,23.365525714457092,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30,-27.572206265855908,-8.0281491627056347,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +30,-110.28882506342363,72.253342464350709,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.5,12.32596528400471,-4.3338365504395409,-70,0,0,0,0,0,0,0 +31.5,49.303861136018838,39.004528953955869,-70,0,0,0,0,0,0,0 +31.5,13.765699540806267,-1.3972193507397392,-50,0,0,0,0,0,0,0 +31.5,55.062798163225068,12.574974156657653,-50,0,0,0,0,0,0,0 +31.5,30.071913752994931,-0.27677302343631283,-41,0,0.27172440000000003,0.094500000000000001,0,0,0,0 +31.5,120.28765501197972,2.4909572109268154,-41,0,0.27172439999999998,0.094500000000000001,0,0,0,0 +31.5,19.431548625850759,-9.7959945925604348,-30,0,0.60383199999999992,0.20999999999999996,0,0,0,0 +31.5,77.726194503403036,88.163951333043912,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +31.5,-28.793376785410032,-8.4567812390446857,-20,0,0.73801714285714282,0.19,0,0,0,0 +31.5,-115.17350714164013,76.111031151402173,-20,0,0.73801714285714282,0.19,0,0,0,0 +31.5,-36.309749669594368,4.5935349429275547,-12.5,0,0.83865600000000007,0.17499999999999999,0,0,0,0 +31.5,-145.23899867837747,-41.341814486347992,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +31.5,-2.239900235497096,0.13376092702809217,-7.2999999999999998,0,0.90843237333333338,0.16459999999999997,0,0,0,0 +31.5,-8.9596009419883842,-1.2038483432528295,-7.2999999999999998,0,0.90843237333333315,0.1646,0,0,0,0 +31.5,-23.449608268622228,2.8363753799615417,-1,0,0.99296859999999998,0.15200000000000002,0,0,0,0 +31.5,-93.798433074488912,-25.527378419653875,-1,0,0.99296859999999998,0.152,0,0,0,0 +31.5,37.409503897000633,4.0180531530013752,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.5,149.63801558800253,-36.162478377012377,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +31.5,-29.032706522727636,-0.2497391911787421,2,0,1.0063869999999999,0.15000000000000002,0,0,0,0 +31.5,-116.13082609091055,2.2476527206086789,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,-39.854124729019311,3.8768432788161906,-70,0,0,0,0,0,0,0 +33,-159.41649891607724,-34.891589509345714,-70,0,0,0,0,0,0,0 +33,17.684325638275766,3.5714735876826005,-50,0,0,0,0,0,0,0 +33,70.737302553103063,-32.143262289143408,-50,0,0,0,0,0,0,0 +33,-0.4594188146910767,6.5280235239098801,-41,0,0.27172440000000003,0.094500000000000015,0,0,0,0 +33,-1.8376752587643068,-58.75221171518892,-41,0,0.27172440000000003,0.094499999999999987,0,0,0,0 +33,38.256746798218416,-3.2436924925503297,-30,0,0.60383199999999992,0.20999999999999996,0,0,0,0 +33,153.02698719287366,29.193232432952968,-30,0,0.60383200000000004,0.20999999999999999,0,0,0,0 +33,-27.521341499367054,-2.7390553415641001,-20,0,0.73801714285714271,0.18999999999999997,0,0,0,0 +33,-110.08536599746822,24.651498074076901,-20,0,0.73801714285714282,0.19,0,0,0,0 +33,-12.987076895057115,-7.1632817430584605,-12.5,0,0.83865599999999985,0.17499999999999999,0,0,0,0 +33,-51.948307580228459,64.469535687526147,-12.5,0,0.83865599999999996,0.17499999999999999,0,0,0,0 +33,-12.696516486637286,-6.2580687836890414,-7.2999999999999998,0,0.90843237333333338,0.1646,0,0,0,0 +33,-50.786065946549144,56.322619053201372,-7.2999999999999998,0,0.90843237333333349,0.16459999999999997,0,0,0,0 +33,-15.027932615069012,-1.6160955882136356,-1,0,0.99296859999999998,0.15200000000000002,0,0,0,0 +33,-60.11173046027605,14.544860293922721,-1,0,0.99296859999999976,0.152,0,0,0,0 +33,-30.393098056862947,-6.3003307178771024,0,0,1.0063870000000001,0.15000000000000002,0,0,0,0 +33,-121.57239222745179,56.702976460893922,0,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,17.451886515299904,-7.4559148239279738,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +33,69.807546061199616,67.103233415351767,2,0,1.0063869999999999,0.14999999999999999,0,0,0,0 +35.200000000000003,-12.175965967280263,6.7831133701243189,-70,0,0.23816980000000026,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,-48.703863869121051,-61.04802033111887,-70,0,0.23816980000000032,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,4.6180814704796731,0.81549098970607581,-50,0,0.23816980000000029,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,18.472325881918692,-7.3394189073546823,-50,0,0.23816980000000032,0.11914980000000014,0.0029920000000000042,0,0,0 +35.200000000000003,35.559261112186789,4.1372114999958356,-41,0,0.44618695750000026,0.15177480000000007,0.0023371150000000033,0,0,0 +35.200000000000003,142.23704444874716,-37.23490349996252,-41,0,0.44618695750000015,0.15177480000000004,0.0023371150000000033,0,0,0 +35.200000000000003,-5.4011216736405032,9.6066153542405033,-30,0,0.70043015000000008,0.19164979999999998,0.0015367000000000022,0,0,0 +35.200000000000003,-21.604486694562013,-86.45953818816453,-30,0,0.70043015000000008,0.19164979999999998,0.0015367000000000022,0,0,0 +35.200000000000003,-12.109738563386159,0.037484791004560591,-20,0,0.85608132142857141,0.17164979999999996,-0.0012224142857142867,0,0,0 +35.200000000000003,-48.438954253544637,-0.33736311904104532,-20,0,0.85608132142857163,0.17164979999999996,-0.0012224142857142871,0,0,0 +35.200000000000003,11.75197738317857,-9.5241292360080703,-12.5,0,0.97281970000000006,0.15664979999999995,-0.0032917500000000039,0,0,0 +35.200000000000003,47.00790953271428,85.717163124072627,-12.5,0,0.97281970000000006,0.15664979999999995,-0.0032917500000000039,0,0,0 +35.200000000000003,21.038370881567459,3.5302548364859625,-7.2999999999999998,0,1.053758462666667,0.14624979999999999,-0.004218390000000005,0,0,0 +35.200000000000003,84.153483526269838,-31.772293528373662,-7.2999999999999998,0,1.0537584626666667,0.14624979999999999,-0.0042183900000000059,0,0,0 +35.200000000000003,-15.973711330369085,3.4445876816223553,-1,0,1.1518185000000001,0.13364979999999999,-0.00092565000000000117,0,0,0 +35.200000000000003,-63.894845321476339,-31.001289134601198,-1,0,1.1518185000000001,0.13364979999999996,-0.00092565000000000106,0,0,0 +35.200000000000003,-20.737096172036509,-6.9182720241524791,0,0,1.1673835500000003,0.13164980000000001,0,0,0,0 +35.200000000000003,-82.948384688146035,62.264448217372312,0,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,24.682597011745329,2.2417909878109477,2,0,1.16738355,0.13164979999999998,0,0,0,0 +35.200000000000003,98.730388046981318,-20.176118890298529,2,0,1.16738355,0.13164979999999998,0,0,0,0 +40,-28.536695796128988,-4.9250282768244125,-70,0,0.44488022222222223,0.1542580277777777,0.0081487222222222239,0,0,0 +40,-114.14678318451595,44.325254491419713,-70,0,0.44488022222222223,0.15425802777777772,0.0081487222222222239,0,0,0 +40,-37.794874756703308,-3.1006887978684139,-50,0,0.44488022222222223,0.15425802777777772,0.0081487222222222239,0,0,0 +40,-151.17949902681323,27.906199180815726,-50,0,0.44488022222222223,0.15425802777777772,0.0081487222222222239,0,0,0 +40,-34.489431309685216,0.39550850033954532,-41,0,0.6050369347222222,0.13625802777777771,0.0076929597222222239,0,0,0 +40,-137.95772523874086,-3.5595765030559079,-41,0,0.60503693472222231,0.13625802777777773,0.0076929597222222239,0,0,0 +40,-22.625244513000098,-1.5039685698797065,-30,0,0.8007840277777778,0.11425802777777773,0.0071359166666666671,0,0,0 +40,-90.500978052000391,13.535717128917359,-30,0,0.8007840277777778,0.11425802777777774,0.0071359166666666671,0,0,0 +40,-8.384812969166795,-6.8755142722931524,-20,0,0.9787361547619049,0.094258027777777753,0.0060189801587301603,0,0,0 +40,-33.53925187666718,61.879628450638371,-20,0,0.9787361547619049,0.094258027777777753,0.0060189801587301594,0,0,0 +40,-24.046467454115312,9.1937867724362334,-12.5,0,1.1122002499999999,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-96.185869816461249,-82.744080951926094,-12.5,0,1.1122002500000001,0.07925802777777774,0.0051812777777777794,0,0,0 +40,-7.1583616365327529,-9.175947291231326,-7.2999999999999998,0,1.2047352899999999,0.068858027777777733,-0.0041151281481481465,0,0,0 +40,-28.633446546131012,82.583525621081932,-7.2999999999999998,0,1.2047352899999999,0.068858027777777733,-0.0041151281481481474,0,0,0 +40,-37.563419615947083,-7.9501130849871888,-1,0,1.3168453833333331,0.05625802777777774,-0.0016453999999999989,0,0,0 +40,-150.25367846378833,71.551017764884705,-1,0,1.3168453833333331,0.05625802777777774,-0.0016453999999999993,0,0,0 +40,16.627586727950444,-1.7018366852211031,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,66.510346911801776,15.316530166989928,0,0,1.3346406666666666,0.054258027777777745,0,0,0,0 +40,-20.299794883215469,2.2463666881873419,2,0,1.3346406666666666,0.054258027777777752,0,0,0,0 +40,-81.199179532861876,-20.217300193686079,2,0,1.3346406666666666,0.054258027777777752,0,0,0,0 +70.299999999999997,-27.259439885464111,1.3303422268762404,-70,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-109.03775954185645,-11.973080041886163,-70,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-18.329419181105777,8.4999330687997166,-50,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-73.317676724423109,-76.499397619197453,-50,0,0.37937107777777779,0.16835632222222222,0.0059161777777777796,0,0,0 +70.299999999999997,-28.279731776551642,0.40439045633691961,-41,0,0.5544389290277778,0.16629382222222222,0.0051134702777777801,0,0,0 +70.299999999999997,-113.11892710620657,-3.6395141070322765,-41,0,0.5544389290277778,0.16629382222222222,0.0051134702777777792,0,0,0 +70.299999999999997,7.2620474241576645,1.7805222100826015,-30,0,0.76841074722222225,0.16377298888888889,0.0041323833333333348,0,0,0 +70.299999999999997,29.048189696630658,-16.024699890743413,-30,0,0.76841074722222213,0.16377298888888886,0.0041323833333333348,0,0,0 +70.299999999999997,5.5694295374896896,7.4337734139059322,-20,0,0.93916869166666661,0.1437729888888889,0.0013812103174603199,0,0,0 +70.299999999999997,22.277718149958758,-66.903960725153382,-20,0,0.93916869166666661,0.14377298888888887,0.0013812103174603197,0,0,0 +70.299999999999997,-32.08471351381484,5.2144014253670647,-12.5,0,1.06723715,0.12877298888888888,-0.00068216944444444169,0,0,0 +70.299999999999997,-128.33885405525936,-46.929612828303583,-12.5,0,1.06723715,0.12877298888888888,-0.0006821694444444418,0,0,0 +70.299999999999997,30.99699708402197,-7.6298523843479193,-7.2999999999999998,0,1.1560313793333337,0.11837298888888888,-0.0055024808518518526,0,0,0 +70.299999999999997,123.98798833608788,68.668671459131275,-7.2999999999999998,0,1.1560313793333334,0.11837298888888888,-0.0055024808518518518,0,0,0 +70.299999999999997,16.420688115163323,0.3052507316806885,-1,0,1.26360893,0.10577298888888889,-0.0015269083333333332,0,0,0 +70.299999999999997,65.68275246065329,-2.7472565851261965,-1,0,1.2636089300000002,0.10577298888888889,-0.0015269083333333332,0,0,0 +70.299999999999997,-12.057577684522364,-8.488938632238991,0,0,1.280684725,0.10377298888888889,0,0,0,0 +70.299999999999997,-48.230310738089457,76.400447690150912,0,0,1.280684725,0.10377298888888889,0,0,0,0 +70.299999999999997,-7.3514790764289799,0.57507548381627416,2,0,1.280684725,0.10377298888888889,0,0,0,0 +70.299999999999997,-29.40591630571592,-5.1756793543464674,2,0,1.280684725,0.10377298888888888,0,0,0,0 diff --git a/tests/data/currents_mdc/tension_c0/ref_moordyn_c_tension.csv b/tests/data/currents_mdc/tension_c0/ref_moordyn_c_tension.csv new file mode 100644 index 00000000..85921086 --- /dev/null +++ b/tests/data/currents_mdc/tension_c0/ref_moordyn_c_tension.csv @@ -0,0 +1,222 @@ +t,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20 +0,3347.400371,3253.367737,3073.059491,2904.689961,2750.454325,2612.856668,2494.649244,2398.695686,2327.743491,2284.117533,2269.389762,2284.117594,2327.743605,2398.695849,2494.64943,2612.856879,2750.454526,2904.690164,3073.059662,3253.3679,3347.400507 +0.1,3347.400643,3253.368024,3073.059783,2904.690262,2750.45461,2612.856935,2494.64947,2398.695874,2327.743638,2284.117653,2269.389871,2284.117714,2327.743753,2398.696034,2494.64966,2612.857141,2750.454817,2904.690459,3073.059961,3253.368179,3347.400786 +0.2,3347.40138,3253.368784,3073.060579,2904.691069,2750.455387,2612.857641,2494.650068,2398.696348,2327.743995,2284.117928,2269.390116,2284.117988,2327.74411,2398.696507,2494.650258,2612.857846,2750.455594,2904.691265,3073.060757,3253.36894,3347.401523 +0.3,3347.402573,3253.370016,3073.061871,2904.692376,2750.456647,2612.858782,2494.65103,2398.697103,2327.744556,2284.118351,2269.39049,2284.118412,2327.744671,2398.697262,2494.65122,2612.858987,2750.456854,2904.692572,3073.062048,3253.370171,3347.402716 +0.4,3347.404219,3253.371717,3073.063656,2904.694184,2750.458388,2612.860356,2494.652356,2398.698138,2327.74532,2284.118924,2269.390993,2284.118984,2327.745435,2398.698297,2494.652545,2612.86056,2750.458594,2904.694379,3073.063832,3253.371871,3347.404362 +0.5,3347.406324,3253.373891,3073.065937,2904.696495,2750.460614,2612.862369,2494.654049,2398.69946,2327.746295,2284.119652,2269.391632,2284.119712,2327.746409,2398.699618,2494.654237,2612.862572,2750.460818,2904.696689,3073.066113,3253.374044,3347.406465 +0.6,3347.408893,3253.376545,3073.068722,2904.699316,2750.463332,2612.864828,2494.656119,2398.701078,2327.747489,2284.120545,2269.392417,2284.120605,2327.747603,2398.701235,2494.656306,2612.86503,2750.463534,2904.699509,3073.068897,3253.376697,3347.409034 +0.7,3347.411932,3253.379683,3073.072014,2904.70265,2750.466544,2612.867736,2494.658571,2398.702997,2327.748911,2284.121613,2269.393357,2284.121673,2327.749024,2398.703153,2494.658756,2612.867936,2750.466745,2904.702841,3073.072187,3253.379833,3347.412071 +0.8,3347.415435,3253.3833,3073.075808,2904.706492,2750.470247,2612.871091,2494.661402,2398.705218,2327.75056,2284.122856,2269.394453,2284.122915,2327.750672,2398.705373,2494.661586,2612.87129,2750.470446,2904.706681,3073.075979,3253.383449,3347.415573 +0.9,3347.419391,3253.387384,3073.080089,2904.710829,2750.474428,2612.874881,2494.664603,2398.707732,2327.75243,2284.124268,2269.395699,2284.124327,2327.752541,2398.707886,2494.664785,2612.875077,2750.474625,2904.711015,3073.080258,3253.387531,3347.419527 +1,3347.423777,3253.391911,3073.084836,2904.715637,2750.479064,2612.879084,2494.668154,2398.710522,2327.754505,2284.125834,2269.397081,2284.125893,2327.754615,2398.710674,2494.668335,2612.879279,2750.479258,2904.715821,3073.085003,3253.392057,3347.423911 +1.1,3347.428566,3253.396855,3073.09002,2904.720888,2750.484128,2612.883676,2494.672033,2398.713567,2327.756765,2284.127537,2269.398582,2284.127595,2327.756875,2398.713717,2494.672211,2612.883868,2750.48432,2904.72107,3073.090185,3253.396999,3347.428699 +1.2,3347.433733,3253.402189,3073.095615,2904.726556,2750.489594,2612.888632,2494.676216,2398.716846,2327.759194,2284.129359,2269.400185,2284.129416,2327.759302,2398.716994,2494.676392,2612.888821,2750.489784,2904.726735,3073.095776,3253.40233,3347.433863 +1.3,3347.439255,3253.407891,3073.101596,2904.732618,2750.495441,2612.893931,2494.680687,2398.720344,2327.761776,2284.131289,2269.401877,2284.131345,2327.761883,2398.720491,2494.68086,2612.894118,2750.495627,2904.732794,3073.101755,3253.40803,3347.439383 +1.4,3347.445116,3253.413944,3073.107947,2904.739055,2750.501651,2612.89956,2494.685432,2398.724052,2327.764506,2284.13332,2269.403655,2284.133376,2327.764612,2398.724197,2494.685603,2612.899743,2750.501834,2904.739228,3073.108104,3253.41408,3347.445242 +1.5,3347.451308,3253.420338,3073.114658,2904.745858,2750.508213,2612.905509,2494.690446,2398.727967,2327.767383,2284.135454,2269.405519,2284.135509,2327.767486,2398.72811,2494.690614,2612.905689,2750.508393,2904.746027,3073.114811,3253.420472,3347.451431 +1.6,3347.457821,3253.427065,3073.121717,2904.753015,2750.51512,2612.911771,2494.695725,2398.732087,2327.770406,2284.137693,2269.407473,2284.137746,2327.770508,2398.732227,2494.69589,2612.911947,2750.515296,2904.753181,3073.121866,3253.427195,3347.457942 +1.7,3347.464646,3253.434112,3073.129112,2904.760514,2750.522359,2612.918337,2494.701262,2398.736409,2327.773575,2284.140037,2269.409517,2284.14009,2327.773676,2398.736546,2494.701424,2612.918509,2750.522531,2904.760676,3073.129258,3253.434239,3347.464763 +1.8,3347.471764,3253.441463,3073.136826,2904.768337,2750.529913,2612.925191,2494.707044,2398.740923,2327.776885,2284.142482,2269.411648,2284.142534,2327.776983,2398.741057,2494.707203,2612.92536,2750.530081,2904.768495,3073.136968,3253.441587,3347.471879 +1.9,3347.479152,3253.449091,3073.144831,2904.776457,2750.537756,2612.932311,2494.713053,2398.745613,2327.780321,2284.145017,2269.413855,2284.145069,2327.780418,2398.745745,2494.713207,2612.932475,2750.53792,2904.776611,3073.14497,3253.449212,3347.479264 +2,3347.486779,3253.456966,3073.153096,2904.784842,2750.545857,2612.939667,2494.719261,2398.750457,2327.783865,2284.147626,2269.416123,2284.147676,2327.78396,2398.750586,2494.719412,2612.939827,2750.546016,2904.784991,3073.153231,3253.457084,3347.486888 +2.1,3347.494612,3253.465054,3073.161584,2904.793455,2750.554182,2612.947227,2494.725641,2398.755431,2327.787496,2284.150289,2269.418433,2284.150338,2327.787588,2398.755557,2494.725788,2612.947383,2750.554336,2904.7936,3073.161715,3253.465167,3347.494717 +2.2,3347.502616,3253.47332,3073.170261,2904.802263,2750.562696,2612.954961,2494.732166,2398.76051,2327.791193,2284.152988,2269.420767,2284.153035,2327.791283,2398.760633,2494.732309,2612.955113,2750.562845,2904.802403,3073.170388,3253.473429,3347.502718 +2.3,3347.510765,3253.481735,3073.179097,2904.811233,2750.57137,2612.962842,2494.738811,2398.765676,2327.79494,2284.155709,2269.423114,2284.155756,2327.795028,2398.765796,2494.73895,2612.962988,2750.571515,2904.811369,3073.179219,3253.481841,3347.510863 +2.4,3347.519035,3253.490276,3073.188067,2904.820343,2750.580181,2612.970847,2494.74556,2398.770916,2327.798728,2284.158446,2269.425467,2284.158491,2327.798813,2398.771031,2494.745694,2612.970989,2750.580321,2904.820473,3073.188184,3253.490378,3347.519129 +2.5,3347.527408,3253.498924,3073.197151,2904.829571,2750.58911,2612.978962,2494.752399,2398.776219,2327.802551,2284.161196,2269.427823,2284.16124,2327.802634,2398.776331,2494.752529,2612.979099,2750.589245,2904.829696,3073.197264,3253.499022,3347.527498 +2.6,3347.535869,3253.507664,3073.206332,2904.838899,2750.59814,2612.987171,2494.759318,2398.78158,2327.806407,2284.163957,2269.430184,2284.164,2327.806487,2398.781689,2494.759444,2612.987303,2750.598269,2904.839019,3073.20644,3253.507758,3347.535956 +2.7,3347.544402,3253.516476,3073.21559,2904.848308,2750.607251,2612.995458,2494.766305,2398.78699,2327.810291,2284.16673,2269.432549,2284.166771,2327.810368,2398.787095,2494.766425,2612.995584,2750.607375,2904.848423,3073.215693,3253.516566,3347.544484 +2.8,3347.552982,3253.525339,3073.224901,2904.857773,2750.616421,2613.003802,2494.773341,2398.792437,2327.814193,2284.169506,2269.434912,2284.169546,2327.814268,2398.792537,2494.773456,2613.003923,2750.616539,2904.857883,3073.224998,3253.525423,3347.553061 +2.9,3347.561585,3253.534223,3073.234235,2904.867265,2750.625621,2613.012177,2494.780405,2398.797901,2327.818101,2284.172275,2269.437263,2284.172314,2327.818173,2398.797998,2494.780515,2613.012292,2750.625733,2904.867369,3073.234328,3253.534303,3347.561659 +3,3347.570177,3253.543096,3073.24356,2904.87675,2750.634817,2613.020553,2494.787469,2398.803362,2327.821996,2284.175023,2269.439588,2284.17506,2327.822064,2398.803454,2494.787575,2613.020662,2750.634923,2904.876848,3073.243647,3253.543172,3347.570247 +3.1,3347.578725,3253.551925,3073.252838,2904.886191,2750.643975,2613.028897,2494.794507,2398.808795,2327.825857,2284.177731,2269.441872,2284.177766,2327.825923,2398.808883,2494.794607,2613.029001,2750.644075,2904.886283,3073.252921,3253.551996,3347.578791 +3.2,3347.587198,3253.560677,3073.262038,2904.895555,2750.653063,2613.03718,2494.80149,2398.814178,2327.829669,2284.180386,2269.4441,2284.18042,2327.829731,2398.814261,2494.801585,2613.037277,2750.653157,2904.895642,3073.262115,3253.560744,3347.587259 +3.3,3347.595569,3253.569324,3073.27113,2904.904813,2750.662052,2613.045374,2494.808397,2398.819493,2327.833415,2284.182977,2269.446264,2284.183009,2327.833475,2398.819571,2494.808486,2613.045465,2750.662139,2904.904894,3073.271202,3253.569386,3347.595626 +3.4,3347.603817,3253.577844,3073.280091,2904.913941,2750.670918,2613.053459,2494.815211,2398.824727,2327.837089,2284.185497,2269.448358,2284.185527,2327.837145,2398.824801,2494.815294,2613.053544,2750.670999,2904.914015,3073.280157,3253.577901,3347.60387 +3.5,3347.611924,3253.58622,3073.288902,2904.922919,2750.679643,2613.061419,2494.821918,2398.829872,2327.840685,2284.187947,2269.450383,2284.187975,2327.840738,2398.829941,2494.821995,2613.061498,2750.679719,2904.922988,3073.288963,3253.586273,3347.611973 +3.6,3347.619877,3253.594436,3073.297546,2904.931731,2750.688212,2613.06924,2494.828507,2398.834921,2327.844202,2284.190326,2269.452341,2284.190352,2327.844251,2398.834985,2494.828579,2613.069313,2750.688281,2904.931794,3073.297601,3253.594484,3347.619921 +3.7,3347.62766,3253.602477,3073.306007,2904.940359,2750.696606,2613.076906,2494.834968,2398.839866,2327.847635,2284.192633,2269.454231,2284.192658,2327.84768,2398.839925,2494.835034,2613.076972,2750.696668,2904.940415,3073.306056,3253.602519,3347.627699 +3.8,3347.635254,3253.610322,3073.314263,2904.948781,2750.704805,2613.084398,2494.841283,2398.844696,2327.850978,2284.194866,2269.456052,2284.194889,2327.85102,2398.844751,2494.841344,2613.084458,2750.704861,2904.948831,3073.314307,3253.61036,3347.635289 +3.9,3347.642636,3253.617949,3073.32229,2904.956974,2750.712785,2613.091695,2494.847436,2398.849397,2327.854219,2284.197017,2269.457796,2284.197038,2327.854258,2398.849446,2494.84749,2613.091749,2750.712834,2904.957018,3073.322328,3253.617982,3347.642667 +4,3347.649783,3253.625332,3073.330062,2904.964909,2750.720519,2613.098772,2494.853402,2398.85395,2327.857346,2284.199075,2269.459456,2284.199094,2327.857381,2398.853994,2494.85345,2613.098818,2750.720562,2904.964946,3073.330095,3253.62536,3347.649809 +4.1,3347.656668,3253.632444,3073.337551,2904.972559,2750.72798,2613.105602,2494.859161,2398.858336,2327.860344,2284.201029,2269.46102,2284.201046,2327.860375,2398.858376,2494.859203,2613.105642,2750.728016,2904.97259,3073.337578,3253.632468,3347.656689 +4.2,3347.663267,3253.639263,3073.344732,2904.979898,2750.735143,2613.112163,2494.864692,2398.862541,2327.863201,2284.202869,2269.46248,2284.202884,2327.863228,2398.862575,2494.864727,2613.112197,2750.735173,2904.979924,3073.344754,3253.639282,3347.663284 +4.3,3347.669563,3253.645768,3073.351586,2904.986907,2750.741988,2613.118436,2494.869978,2398.86655,2327.865907,2284.204589,2269.463832,2284.204602,2327.86593,2398.866578,2494.870007,2613.118463,2750.742011,2904.986926,3073.351603,3253.645782,3347.669576 +4.4,3347.675541,3253.651947,3073.358098,2904.993569,2750.7485,2613.124406,2494.875008,2398.870356,2327.868458,2284.206189,2269.465075,2284.2062,2327.868477,2398.870379,2494.875031,2613.124426,2750.748516,2904.993582,3073.358108,3253.651955,3347.67555 +4.5,3347.681193,3253.657787,3073.364255,2904.999873,2750.754666,2613.130064,2494.879774,2398.873954,2327.870855,2284.207671,2269.466213,2284.20768,2327.87087,2398.873972,2494.87979,2613.130077,2750.754676,2904.99988,3073.36426,3253.657791,3347.681197 +4.6,3347.686511,3253.663283,3073.370051,2905.00581,2750.760478,2613.135401,2494.88427,2398.877343,2327.873097,2284.209038,2269.467251,2284.209045,2327.873108,2398.877355,2494.884281,2613.135408,2750.760482,2905.005811,3073.37005,3253.663282,3347.68651 +4.7,3347.691487,3253.668426,3073.375475,2905.01137,2750.765927,2613.14041,2494.888491,2398.880518,2327.875185,2284.210293,2269.468192,2284.210298,2327.875192,2398.880525,2494.888495,2613.14041,2750.765924,2905.011365,3073.375469,3253.66842,3347.691482 +4.8,3347.696111,3253.673205,3073.380517,2905.016543,2750.771001,2613.145078,2494.892426,2398.883474,2327.877116,2284.211437,2269.469038,2284.211439,2327.877119,2398.883475,2494.892424,2613.145072,2750.770992,2905.016531,3073.380506,3253.673195,3347.696102 +4.9,3347.700372,3253.677608,3073.385164,2905.021313,2750.775686,2613.149395,2494.896066,2398.886202,2327.878885,2284.212466,2269.469787,2284.212466,2327.878884,2398.886198,2494.896058,2613.149382,2750.77567,2905.021296,3073.385147,3253.677593,3347.700358 +5,3347.704255,3253.681621,3073.3894,2905.025666,2750.779967,2613.153343,2494.899397,2398.888692,2327.880484,2284.213375,2269.470434,2284.213372,2327.880479,2398.888682,2494.899382,2613.153324,2750.779945,2905.025642,3073.389378,3253.681601,3347.704237 +5.1,3347.707745,3253.685229,3073.393211,2905.029585,2750.783828,2613.15691,2494.902405,2398.890932,2327.881906,2284.214158,2269.470974,2284.214154,2327.881896,2398.890917,2494.902384,2613.156883,2750.783799,2905.029556,3073.393184,3253.685205,3347.707723 +5.2,3347.710832,3253.68842,3073.396584,2905.03306,2750.787256,2613.160081,2494.905079,2398.892914,2327.883143,2284.214811,2269.471405,2284.214805,2327.88313,2398.892893,2494.905052,2613.160048,2750.787221,2905.033025,3073.396552,3253.688391,3347.710806 +5.3,3347.713508,3253.691186,3073.399511,2905.03608,2750.790243,2613.162849,2494.907413,2398.894633,2327.884193,2284.215334,2269.471726,2284.215326,2327.884176,2398.894607,2494.907379,2613.16281,2750.790202,2905.036039,3073.399474,3253.691154,3347.713478 +5.4,3347.71577,3253.693526,3073.401989,2905.038642,2750.792785,2613.16521,2494.909402,2398.896087,2327.885057,2284.215729,2269.47194,2284.215718,2327.885035,2398.896055,2494.909362,2613.165165,2750.792737,2905.038596,3073.401946,3253.693488,3347.715736 +5.5,3347.717619,3253.695438,3073.404017,2905.040746,2750.79488,2613.167164,2494.911048,2398.897277,2327.885739,2284.216002,2269.472055,2284.215989,2327.885713,2398.89724,2494.911002,2613.167112,2750.794827,2905.040694,3073.40397,3253.695397,3347.71758 +5.6,3347.719057,3253.696926,3073.405599,2905.042394,2750.796531,2613.168711,2494.912352,2398.898208,2327.886242,2284.216158,2269.472076,2284.216143,2327.886212,2398.898165,2494.912299,2613.168652,2750.796471,2905.042336,3073.405546,3253.69688,3347.719014 +5.7,3347.720086,3253.697991,3073.406735,2905.043586,2750.797738,2613.169852,2494.913315,2398.898881,2327.886572,2284.216204,2269.472009,2284.216186,2327.886538,2398.898833,2494.913257,2613.169788,2750.797672,2905.043523,3073.406678,3253.697941,3347.72004 +5.8,3347.720707,3253.698635,3073.407427,2905.044324,2750.798502,2613.170589,2494.913938,2398.899298,2327.886731,2284.216141,2269.471859,2284.216121,2327.886692,2398.899244,2494.913874,2613.170518,2750.79843,2905.044256,3073.407365,3253.698581,3347.720658 +5.9,3347.72092,3253.698856,3073.407672,2905.044605,2750.798819,2613.170917,2494.914218,2398.899455,2327.886716,2284.215972,2269.471626,2284.215949,2327.886674,2398.899397,2494.914148,2613.17084,2750.798742,2905.044532,3073.407605,3253.698798,3347.720866 +6,3347.72072,3253.69865,3073.407468,2905.044427,2750.798688,2613.170833,2494.914152,2398.899352,2327.886527,2284.215693,2269.471308,2284.215669,2327.886481,2398.899287,2494.914076,2613.170751,2750.798605,2905.044349,3073.407397,3253.698588,3347.720662 +6.1,3347.720105,3253.698017,3073.406814,2905.043787,2750.798105,2613.170335,2494.913736,2398.898983,2327.886161,2284.215304,2269.470905,2284.215277,2327.886111,2398.898914,2494.913654,2613.170247,2750.798017,2905.043704,3073.406738,3253.697951,3347.720044 +6.2,3347.719077,3253.696955,3073.405708,2905.042686,2750.79707,2613.169422,2494.912969,2398.898348,2327.885616,2284.214803,2269.470415,2284.214774,2327.885562,2398.898274,2494.912881,2613.169328,2750.796976,2905.042597,3073.405628,3253.696886,3347.719012 +6.3,3347.717637,3253.69547,3073.404155,2905.041126,2750.795587,2613.168096,2494.911854,2398.89745,2327.884895,2284.214193,2269.469841,2284.214162,2327.884837,2398.89737,2494.91176,2613.167996,2750.795487,2905.041033,3073.404071,3253.695396,3347.717569 +6.4,3347.715794,3253.693567,3073.402163,2905.039117,2750.793662,2613.166364,2494.910395,2398.896292,2327.884003,2284.213479,2269.469189,2284.213446,2327.883941,2398.896208,2494.910296,2613.166258,2750.793557,2905.039019,3073.402075,3253.69349,3347.715723 +6.5,3347.713559,3253.691259,3073.399743,2905.036669,2750.791307,2613.164236,2494.908603,2398.894884,2327.882947,2284.212668,2269.468465,2284.212633,2327.882881,2398.894794,2494.908498,2613.164125,2750.791197,2905.036566,3073.399651,3253.691179,3347.713484 +6.6,3347.710942,3253.688557,3073.396908,2905.033793,2750.788533,2613.161722,2494.906486,2398.893233,2327.881735,2284.211767,2269.467676,2284.21173,2327.881666,2398.893139,2494.906377,2613.161606,2750.788418,2905.033686,3073.396811,3253.688473,3347.710865 +6.7,3347.707956,3253.685473,3073.393668,2905.030503,2750.785351,2613.158834,2494.904055,2398.891349,2327.880374,2284.210783,2269.466829,2284.210744,2327.880301,2398.89125,2494.90394,2613.158713,2750.785231,2905.030391,3073.393567,3253.685385,3347.707875 +6.8,3347.704609,3253.682016,3073.390034,2905.026808,2750.781772,2613.15558,2494.901316,2398.889236,2327.878868,2284.209719,2269.465926,2284.209679,2327.878792,2398.889133,2494.901196,2613.155454,2750.781648,2905.026692,3073.38993,3253.681925,3347.704526 +6.9,3347.70091,3253.678193,3073.386015,2905.022717,2750.777803,2613.151967,2494.898276,2398.886899,2327.87722,2284.208577,2269.46497,2284.208535,2327.877141,2398.886791,2494.898151,2613.151836,2750.777674,2905.022596,3073.385907,3253.678099,3347.700823 +7,3347.696864,3253.674013,3073.381618,2905.018237,2750.773453,2613.148002,2494.894939,2398.884341,2327.875432,2284.207357,2269.463958,2284.207312,2327.875349,2398.884229,2494.894809,2613.147866,2750.773319,2905.018113,3073.381506,3253.673916,3347.696774 +7.1,3347.692479,3253.669482,3073.37685,2905.013377,2750.768728,2613.143691,2494.89131,2398.881565,2327.873503,2284.206057,2269.462891,2284.206011,2327.873417,2398.881448,2494.891175,2613.14355,2750.76859,2905.013249,3073.376735,3253.669382,3347.692386 +7.2,3347.687763,3253.664611,3073.371723,2905.008147,2750.763639,2613.139044,2494.887396,2398.878575,2327.871437,2284.204679,2269.461767,2284.204631,2327.871347,2398.878455,2494.887257,2613.138899,2750.763496,2905.008015,3073.371604,3253.664508,3347.687668 +7.3,3347.68273,3253.65941,3073.366249,2905.002561,2750.758199,2613.134072,2494.883207,2398.875379,2327.869238,2284.203225,2269.46059,2284.203175,2327.869145,2398.875255,2494.883064,2613.133922,2750.758052,2905.002425,3073.366127,3253.659304,3347.682632 +7.4,3347.677393,3253.653897,3073.360445,2904.996636,2750.752424,2613.128791,2494.878757,2398.871988,2327.866914,2284.201701,2269.459363,2284.20165,2327.866818,2398.871859,2494.87861,2613.128637,2750.752274,2904.996496,3073.36032,3253.653788,3347.677293 +7.5,3347.671771,3253.648088,3073.354329,2904.990389,2750.746334,2613.123218,2494.874061,2398.868412,2327.864473,2284.200113,2269.458093,2284.200061,2327.864375,2398.86828,2494.873909,2613.12306,2750.74618,2904.990246,3073.354201,3253.647977,3347.671668 +7.6,3347.665881,3253.642003,3073.34792,2904.983842,2750.739947,2613.117371,2494.869133,2398.864666,2327.861926,2284.198469,2269.456785,2284.198415,2327.861824,2398.86453,2494.868978,2613.117209,2750.739789,2904.983696,3073.34779,3253.641889,3347.665776 +7.7,3347.659741,3253.635659,3073.341239,2904.977013,2750.733282,2613.111267,2494.86399,2398.86076,2327.859279,2284.196774,2269.455444,2284.196718,2327.859176,2398.860621,2494.863831,2613.111101,2750.733121,2904.976864,3073.341105,3253.635543,3347.659634 +7.8,3347.653367,3253.629072,3073.3343,2904.96992,2750.726358,2613.104923,2494.858644,2398.856705,2327.856541,2284.195031,2269.454073,2284.194974,2327.856435,2398.856563,2494.858482,2613.104754,2750.726193,2904.969768,3073.334164,3253.628954,3347.653258 +7.9,3347.646773,3253.622258,3073.327122,2904.96258,2750.719189,2613.098353,2494.853109,2398.85251,2327.853715,2284.193242,2269.452671,2284.193184,2327.853607,2398.852365,2494.852943,2613.098181,2750.719021,2904.962424,3073.326983,3253.622138,3347.646661 +8,3347.639971,3253.61523,3073.319717,2904.955006,2750.71179,2613.091571,2494.847394,2398.848181,2327.850805,2284.191407,2269.451239,2284.191348,2327.850695,2398.848033,2494.847225,2613.091396,2750.71162,2904.954848,3073.319576,3253.615108,3347.639858 +8.1,3347.632976,3253.608003,3073.312101,2904.947217,2750.704178,2613.084592,2494.841511,2398.843726,2327.847815,2284.189527,2269.449774,2284.189467,2327.847702,2398.843575,2494.841339,2613.084413,2750.704005,2904.947056,3073.311958,3253.607878,3347.632861 +8.2,3347.625803,3253.600591,3073.304291,2904.939227,2750.69637,2613.07743,2494.835474,2398.839154,2327.844748,2284.187603,2269.448278,2284.187542,2327.844633,2398.839001,2494.835299,2613.077248,2750.696194,2904.939064,3073.304146,3253.600464,3347.625686 +8.3,3347.618469,3253.593013,3073.296307,2904.931058,2750.688384,2613.070104,2494.829297,2398.834477,2327.841612,2284.185638,2269.446751,2284.185575,2327.841495,2398.834322,2494.82912,2613.06992,2750.688206,2904.930893,3073.296159,3253.592885,3347.618351 +8.4,3347.610994,3253.585289,3073.288169,2904.922732,2750.680244,2613.062634,2494.822998,2398.829707,2327.838415,2284.183636,2269.445197,2284.183573,2327.838297,2398.82955,2494.822819,2613.062448,2750.680063,2904.922564,3073.288019,3253.58516,3347.610874 +8.5,3347.603399,3253.577442,3073.2799,2904.914272,2750.671971,2613.055043,2494.816596,2398.82486,2327.835167,2284.181605,2269.443622,2284.181541,2327.835048,2398.8247,2494.816414,2613.054854,2750.671788,2904.914102,3073.279749,3253.577311,3347.603278 +8.6,3347.595706,3253.569493,3073.271525,2904.905701,2750.663591,2613.047352,2494.81011,2398.819949,2327.831879,2284.179551,2269.44203,2284.179486,2327.831758,2398.819788,2494.809926,2613.047161,2750.663406,2904.90553,3073.271372,3253.569361,3347.595583 +8.7,3347.587935,3253.561465,3073.263064,2904.897044,2750.655125,2613.039583,2494.803558,2398.814989,2327.828558,2284.177478,2269.440425,2284.177413,2327.828437,2398.814827,2494.803372,2613.03939,2750.654938,2904.896871,3073.26291,3253.561331,3347.587811 +8.8,3347.580107,3253.553376,3073.254541,2904.888322,2750.646596,2613.031755,2494.796957,2398.809993,2327.825214,2284.175391,2269.438809,2284.175325,2327.825092,2398.809829,2494.79677,2613.031561,2750.646408,2904.888148,3073.254385,3253.55324,3347.579982 +8.9,3347.572237,3253.545245,3073.245973,2904.879555,2750.638024,2613.023888,2494.790323,2398.804971,2327.821852,2284.173291,2269.437182,2284.173225,2327.821728,2398.804806,2494.790134,2613.023692,2750.637833,2904.879379,3073.245816,3253.545108,3347.572111 +9,3347.564344,3253.537089,3073.237379,2904.870762,2750.629426,2613.015998,2494.783669,2398.799933,2327.818476,2284.17118,2269.435544,2284.171113,2327.818352,2398.799767,2494.783479,2613.015801,2750.629235,2904.870585,3073.237221,3253.536952,3347.564217 +9.1,3347.556443,3253.528926,3073.228778,2904.861962,2750.620823,2613.008104,2494.777011,2398.794889,2327.815092,2284.169058,2269.433896,2284.168991,2327.814968,2398.794722,2494.77682,2613.007906,2750.62063,2904.861784,3073.228619,3253.528788,3347.556315 +9.2,3347.548553,3253.520774,3073.22019,2904.853177,2750.612234,2613.000223,2494.770363,2398.789849,2327.811707,2284.166928,2269.432237,2284.166861,2327.811582,2398.789682,2494.770171,2613.000024,2750.612041,2904.852998,3073.22003,3253.520636,3347.548425 +9.3,3347.540694,3253.512654,3073.211636,2904.844427,2750.603682,2612.992376,2494.763743,2398.784828,2327.808327,2284.164795,2269.43057,2284.164728,2327.808201,2398.784661,2494.763551,2612.992177,2750.603488,2904.844247,3073.211476,3253.512515,3347.540565 +9.4,3347.532885,3253.504588,3073.203139,2904.835737,2750.59519,2612.984586,2494.757169,2398.779839,2327.804962,2284.162662,2269.428899,2284.162595,2327.804836,2398.779671,2494.756977,2612.984386,2750.594995,2904.835557,3073.202978,3253.504448,3347.532756 +9.5,3347.525151,3253.496597,3073.194723,2904.827131,2750.586782,2612.976873,2494.750662,2398.774896,2327.801622,2284.160538,2269.427229,2284.160471,2327.801497,2398.774728,2494.75047,2612.976673,2750.586587,2904.82695,3073.194561,3253.496457,3347.525021 +9.6,3347.517511,3253.488705,3073.186411,2904.818633,2750.578481,2612.969262,2494.744239,2398.770015,2327.798318,2284.158428,2269.425566,2284.158361,2327.798193,2398.769848,2494.744047,2612.969062,2750.578286,2904.818452,3073.186249,3253.488565,3347.517381 +9.7,3347.509988,3253.480933,3073.178226,2904.810267,2750.570311,2612.961773,2494.73792,2398.76521,2327.795058,2284.156337,2269.423912,2284.156271,2327.794934,2398.765043,2494.737729,2612.961573,2750.570117,2904.810086,3073.178065,3253.480792,3347.509858 +9.8,3347.5026,3253.473301,3073.17019,2904.802054,2750.562294,2612.954425,2494.731721,2398.760492,2327.791851,2284.154271,2269.422272,2284.154205,2327.791727,2398.760326,2494.73153,2612.954225,2750.562099,2904.801873,3073.170028,3253.47316,3347.50247 +9.9,3347.495365,3253.465827,3073.16232,2904.794013,2750.554448,2612.947237,2494.725657,2398.755874,2327.788703,2284.152232,2269.420648,2284.152166,2327.78858,2398.755709,2494.725466,2612.947038,2750.554253,2904.793833,3073.162159,3253.465686,3347.495235 +10,3347.4883,3253.458528,3073.154636,2904.786164,2750.546791,2612.940225,2494.719741,2398.751365,2327.78562,2284.150223,2269.419039,2284.150158,2327.785498,2398.7512,2494.719552,2612.940027,2750.546598,2904.785984,3073.154475,3253.458387,3347.48817 +10.1,3347.48142,3253.45142,3073.147155,2904.778525,2750.539343,2612.933406,2494.713988,2398.746974,2327.782607,2284.148246,2269.417449,2284.148182,2327.782486,2398.746811,2494.7138,2612.933209,2750.53915,2904.778346,3073.146994,3253.451281,3347.48129 +10.2,3347.474742,3253.444523,3073.139896,2904.771116,2750.532122,2612.926798,2494.708412,2398.742712,2327.779672,2284.146306,2269.415878,2284.146242,2327.779552,2398.742551,2494.708225,2612.926602,2750.53193,2904.770937,3073.139736,3253.444384,3347.474613 +10.3,3347.468285,3253.437853,3073.132878,2904.763955,2750.525146,2612.920417,2494.703028,2398.738591,2327.776821,2284.144405,2269.414332,2284.144342,2327.776702,2398.738431,2494.702843,2612.920223,2750.524956,2904.763777,3073.132719,3253.437715,3347.468157 +10.4,3347.462066,3253.43143,3073.126121,2904.757063,2750.518437,2612.914284,2494.697851,2398.734623,2327.774064,2284.142552,2269.412814,2284.14249,2327.773947,2398.734465,2494.697668,2612.914091,2750.518248,2904.756887,3073.125963,3253.431293,3347.461939 +10.5,3347.456106,3253.425274,3073.119646,2904.750462,2750.512015,2612.908415,2494.692899,2398.730822,2327.77141,2284.140752,2269.411332,2284.140691,2327.771294,2398.730665,2494.692718,2612.908224,2750.511827,2904.750287,3073.119489,3253.425137,3347.45598 +10.6,3347.450422,3253.419403,3073.113473,2904.744171,2750.505898,2612.90283,2494.688186,2398.727198,2327.768868,2284.139013,2269.40989,2284.138953,2327.768754,2398.727044,2494.688007,2612.902641,2750.505712,2904.743997,3073.113317,3253.419268,3347.450296 +10.7,3347.445031,3253.413835,3073.107619,2904.738209,2750.500106,2612.897545,2494.683727,2398.723764,2327.766446,2284.13734,2269.408494,2284.137281,2327.766334,2398.723612,2494.68355,2612.897359,2750.499922,2904.738037,3073.107465,3253.413701,3347.444906 +10.8,3347.439948,3253.408586,3073.102101,2904.732592,2750.494654,2612.892575,2494.679534,2398.720529,2327.764152,2284.135739,2269.407148,2284.13568,2327.764042,2398.720379,2494.67936,2612.892391,2750.494472,2904.732422,3073.101948,3253.408453,3347.439825 +10.9,3347.435186,3253.403668,3073.096934,2904.727336,2750.489557,2612.887932,2494.675618,2398.717501,2327.761991,2284.134213,2269.405856,2284.134155,2327.761883,2398.717354,2494.675446,2612.887751,2750.489378,2904.727168,3073.096783,3253.403537,3347.435065 +11,3347.430758,3253.399096,3073.09213,2904.722453,2750.484827,2612.883629,2494.671988,2398.714687,2327.759967,2284.132765,2269.404619,2284.132708,2327.759862,2398.714543,2494.67182,2612.88345,2750.484651,2904.722287,3073.091981,3253.398966,3347.430638 +11.1,3347.426675,3253.394879,3073.087703,2904.717956,2750.480477,2612.879675,2494.668653,2398.712094,2327.758086,2284.131398,2269.40344,2284.131343,2327.757983,2398.711953,2494.668488,2612.8795,2750.480303,2904.717793,3073.087556,3253.394751,3347.426557 +11.2,3347.422948,3253.391031,3073.083664,2904.713859,2750.476519,2612.876083,2494.665623,2398.709729,2327.756352,2284.130117,2269.402324,2284.130063,2327.756251,2398.709591,2494.665461,2612.875911,2750.476348,2904.713698,3073.083519,3253.390905,3347.422832 +11.3,3347.419589,3253.387563,3073.080026,2904.710173,2750.472964,2612.872862,2494.662906,2398.707599,2327.754772,2284.128926,2269.401274,2284.128874,2327.754673,2398.707465,2494.662748,2612.872693,2750.472797,2904.710015,3073.079884,3253.387439,3347.419475 +11.4,3347.41661,3253.384487,3073.076802,2904.706911,2750.469826,2612.870024,2494.660512,2398.705713,2327.753351,2284.127831,2269.400296,2284.12778,2327.753255,2398.705581,2494.660357,2612.869859,2750.469662,2904.706756,3073.076662,3253.384365,3347.416497 +11.5,3347.414022,3253.381815,3073.074004,2904.704085,2750.467115,2612.867579,2494.65845,2398.704077,2327.752097,2284.126838,2269.399396,2284.126789,2327.752004,2398.703949,2494.658299,2612.867418,2750.466954,2904.703934,3073.073867,3253.381696,3347.413912 +11.6,3347.411835,3253.379559,3073.071643,2904.701708,2750.464842,2612.865537,2494.656728,2398.702699,2327.751016,2284.125953,2269.398579,2284.125905,2327.750926,2398.702575,2494.656581,2612.86538,2750.464685,2904.701559,3073.071509,3253.379442,3347.411728 +11.7,3347.41006,3253.377726,3073.069729,2904.699786,2750.463016,2612.863905,2494.655352,2398.701585,2327.750113,2284.125181,2269.397851,2284.125135,2327.750026,2398.701464,2494.65521,2612.863752,2750.462863,2904.699642,3073.069598,3253.377612,3347.409954 +11.8,3347.408701,3253.376324,3073.068268,2904.698329,2750.461644,2612.86269,2494.654329,2398.700738,2327.749391,2284.124525,2269.397215,2284.124481,2327.749307,2398.700622,2494.654191,2612.862541,2750.461495,2904.698188,3073.06814,3253.376213,3347.408598 +11.9,3347.407764,3253.375358,3073.067265,2904.69734,2750.460729,2612.861894,2494.65366,2398.700161,2327.748854,2284.123989,2269.396674,2284.123946,2327.748773,2398.700049,2494.653526,2612.86175,2750.460584,2904.697203,3073.067141,3253.37525,3347.407664 +12,3347.407252,3253.37483,3073.066725,2904.696824,2750.460275,2612.86152,2494.653347,2398.699856,2327.748503,2284.123574,2269.396231,2284.123533,2327.748425,2398.699748,2494.653218,2612.861381,2750.460134,2904.696691,3073.066605,3253.374725,3347.407154 +12.1,3347.407167,3253.374744,3073.06665,2904.696782,2750.460283,2612.861569,2494.65339,2398.699823,2327.748338,2284.123281,2269.395886,2284.123242,2327.748263,2398.69972,2494.653266,2612.861435,2750.460147,2904.696653,3073.066533,3253.374642,3347.407072 +12.2,3347.40751,3253.375101,3073.06704,2904.697215,2750.460754,2612.862042,2494.65379,2398.700063,2327.748361,2284.123114,2269.395642,2284.123076,2327.74829,2398.699963,2494.653671,2612.861912,2750.460623,2904.69709,3073.066927,3253.375002,3347.407419 +12.3,3347.408283,3253.375901,3073.067897,2904.698124,2750.461689,2612.862937,2494.654547,2398.700575,2327.748573,2284.123073,2269.395502,2284.123038,2327.748505,2398.70048,2494.654433,2612.862813,2750.461563,2904.698004,3073.067788,3253.375806,3347.408195 +12.4,3347.409487,3253.377146,3073.069222,2904.699511,2750.463087,2612.864256,2494.65566,2398.701361,2327.748977,2284.123162,2269.39547,2284.123129,2327.748912,2398.70127,2494.655551,2612.864137,2750.462966,2904.699395,3073.069117,3253.377055,3347.409402 +12.5,3347.411121,3253.378836,3073.071015,2904.701374,2750.464948,2612.865997,2494.65713,2398.702421,2327.749573,2284.123384,2269.395548,2284.123353,2327.749512,2398.702335,2494.657026,2612.865883,2750.464832,2904.701263,3073.070914,3253.378748,3347.41104 +12.6,3347.413186,3253.380971,3073.073275,2904.703712,2750.46727,2612.868159,2494.658954,2398.703754,2327.750364,2284.123743,2269.395741,2284.123713,2327.750306,2398.703673,2494.658856,2612.868051,2750.46716,2904.703607,3073.073179,3253.380887,3347.413109 +12.7,3347.415679,3253.383547,3073.075999,2904.706522,2750.470051,2612.870737,2494.66113,2398.70536,2327.751349,2284.124239,2269.396051,2284.124211,2327.751295,2398.705284,2494.661038,2612.870635,2750.469946,2904.706422,3073.075907,3253.383467,3347.415605 +12.8,3347.418595,3253.38656,3073.079182,2904.709799,2750.473284,2612.873728,2494.663654,2398.707236,2327.752529,2284.124874,2269.39648,2284.124848,2327.752478,2398.707165,2494.663567,2612.873631,2750.473185,2904.709704,3073.079095,3253.386484,3347.418525 +12.9,3347.421928,3253.390004,3073.082817,2904.713535,2750.476961,2612.877122,2494.666519,2398.709377,2327.7539,2284.125648,2269.397028,2284.125624,2327.753853,2398.70931,2494.666437,2612.877032,2750.476868,2904.713446,3073.082735,3253.389932,3347.421862 +13,3347.425669,3253.393869,3073.086894,2904.717721,2750.481072,2612.880912,2494.669717,2398.711776,2327.755459,2284.126558,2269.397694,2284.126536,2327.755416,2398.711714,2494.669641,2612.880827,2750.480985,2904.717637,3073.086818,3253.393802,3347.425607 +13.1,3347.429808,3253.398145,3073.091404,2904.722345,2750.485607,2612.885086,2494.673238,2398.714427,2327.757202,2284.127603,2269.398477,2284.127583,2327.757162,2398.714371,2494.673168,2612.885007,2750.485526,2904.722266,3073.091332,3253.398083,3347.42975 +13.2,3347.434335,3253.402822,3073.096333,2904.727395,2750.490554,2612.889632,2494.677074,2398.717323,2327.759124,2284.128781,2269.399375,2284.128763,2327.759088,2398.717272,2494.67701,2612.88956,2750.490479,2904.727322,3073.096267,3253.402764,3347.434282 +13.3,3347.439239,3253.407889,3073.101672,2904.732859,2750.4959,2612.89454,2494.681214,2398.720457,2327.761221,2284.130089,2269.400388,2284.130073,2327.761189,2398.720411,2494.681156,2612.894475,2750.495831,2904.732793,3073.101611,3253.407835,3347.43919 +13.4,3347.444509,3253.413333,3073.107406,2904.738724,2750.501632,2612.899798,2494.685649,2398.723821,2327.763489,2284.131527,2269.401516,2284.131512,2327.763461,2398.72378,2494.685597,2612.899739,2750.50157,2904.738664,3073.107351,3253.413284,3347.444464 +13.5,3347.450132,3253.419142,3073.113523,2904.744977,2750.507737,2612.905393,2494.690367,2398.727409,2327.765924,2284.133092,2269.402756,2284.133079,2327.7659,2398.727373,2494.690321,2612.905341,2750.507681,2904.744923,3073.113473,3253.419098,3347.450092 +13.6,3347.456096,3253.425302,3073.120009,2904.751602,2750.5142,2612.911312,2494.695359,2398.731211,2327.768521,2284.134782,2269.404109,2284.134772,2327.768501,2398.73118,2494.695319,2612.911266,2750.514151,2904.751554,3073.119964,3253.425263,3347.45606 +13.7,3347.462385,3253.431799,3073.126846,2904.758583,2750.521005,2612.917539,2494.700611,2398.73522,2327.771275,2284.136595,2269.405572,2284.136587,2327.771258,2398.735194,2494.700577,2612.9175,2750.520963,2904.758541,3073.126808,3253.431765,3347.462354 +13.8,3347.468983,3253.438614,3073.134019,2904.765902,2750.528133,2612.924058,2494.706109,2398.739424,2327.774178,2284.138526,2269.407142,2284.138519,2327.774165,2398.739403,2494.706082,2612.924026,2750.528098,2904.765866,3073.133986,3253.438586,3347.468957 +13.9,3347.475873,3253.445731,3073.141505,2904.773537,2750.535566,2612.930852,2494.711839,2398.743811,2327.777223,2284.140569,2269.408815,2284.140565,2327.777214,2398.743796,2494.711818,2612.930826,2750.535538,2904.773509,3073.141478,3253.445707,3347.475851 +14,3347.483034,3253.453127,3073.149285,2904.781469,2750.543282,2612.937899,2494.717782,2398.748369,2327.7804,2284.142719,2269.410586,2284.142717,2327.780394,2398.748359,2494.717768,2612.93788,2750.54326,2904.781446,3073.149264,3253.453108,3347.483017 +14.1,3347.490445,3253.460782,3073.157335,2904.789673,2750.551258,2612.945181,2494.723923,2398.753084,2327.783699,2284.144969,2269.412447,2284.144968,2327.783697,2398.753079,2494.723914,2612.945168,2750.551243,2904.789657,3073.15732,3253.460769,3347.490433 +14.2,3347.498086,3253.468674,3073.165633,2904.798126,2750.559471,2612.952675,2494.730243,2398.757942,2327.78711,2284.147311,2269.414395,2284.147312,2327.787112,2398.757943,2494.73024,2612.95267,2750.559464,2904.798117,3073.165624,3253.468666,3347.498078 +14.3,3347.505935,3253.47678,3073.174156,2904.806805,2750.5679,2612.960361,2494.736724,2398.76293,2327.790625,2284.149739,2269.416423,2284.149742,2327.79063,2398.762936,2494.736728,2612.960363,2750.567899,2904.806802,3073.174153,3253.476777,3347.505932 +14.4,3347.51397,3253.485079,3073.18288,2904.815685,2750.57652,2612.968219,2494.743349,2398.768034,2327.794233,2284.152246,2269.418525,2284.152251,2327.794242,2398.768045,2494.743359,2612.968227,2750.576526,2904.81569,3073.182883,3253.485082,3347.513972 +14.5,3347.522169,3253.493548,3073.191782,2904.824744,2750.585308,2612.976227,2494.750101,2398.77324,2327.797925,2284.154826,2269.420696,2284.154833,2327.797938,2398.773256,2494.750117,2612.976242,2750.585321,2904.824755,3073.191791,3253.493556,3347.522177 +14.6,3347.530511,3253.502164,3073.200836,2904.833955,2750.594241,2612.984362,2494.75696,2398.778536,2327.801691,2284.157471,2269.42293,2284.15748,2327.801707,2398.778557,2494.756983,2612.984384,2750.594261,2904.833973,3073.200851,3253.502177,3347.530524 +14.7,3347.538972,3253.510902,3073.210018,2904.843293,2750.603293,2612.992604,2494.763909,2398.783905,2327.80552,2284.160175,2269.425221,2284.160186,2327.80554,2398.783931,2494.763938,2612.992633,2750.60332,2904.843318,3073.210039,3253.510921,3347.538989 +14.8,3347.547527,3253.519738,3073.219301,2904.852731,2750.612439,2613.000927,2494.770927,2398.789332,2327.809402,2284.162928,2269.427561,2284.162941,2327.809426,2398.789364,2494.770962,2613.000963,2750.612473,2904.852762,3073.219328,3253.519762,3347.547549 +14.9,3347.55615,3253.528644,3073.228657,2904.862242,2750.62165,2613.009308,2494.777993,2398.794802,2327.813323,2284.165721,2269.429941,2284.165735,2327.81335,2398.794839,2494.778034,2613.009351,2750.621691,2904.862279,3073.228691,3253.528673,3347.556177 +15,3347.564816,3253.537594,3073.238058,2904.871795,2750.630901,2613.017722,2494.785087,2398.800298,2327.817271,2284.168544,2269.432352,2284.16856,2327.817302,2398.800339,2494.785134,2613.017771,2750.630949,2904.87184,3073.238098,3253.537628,3347.564848 +15.1,3347.573497,3253.54656,3073.247476,2904.881364,2750.640163,2613.026143,2494.792186,2398.805801,2327.821233,2284.171387,2269.434786,2284.171405,2327.821268,2398.805847,2494.79224,2613.026199,2750.640218,2904.881415,3073.247521,3253.546599,3347.573534 +15.2,3347.582168,3253.555515,3073.256881,2904.890917,2750.649408,2613.034546,2494.79927,2398.811296,2327.825196,2284.174239,2269.437234,2284.174259,2327.825234,2398.811347,2494.79933,2613.034608,2750.649469,2904.890975,3073.256933,3253.55556,3347.58221 +15.3,3347.590803,3253.564433,3073.266246,2904.900429,2750.658609,2613.042907,2494.806319,2398.816766,2327.829148,2284.177092,2269.439685,2284.177113,2327.829189,2398.816822,2494.806384,2613.042976,2750.658677,2904.900493,3073.266304,3253.564483,3347.590849 +15.4,3347.599376,3253.573286,3073.275544,2904.90987,2750.667739,2613.051202,2494.813311,2398.822195,2327.833077,2284.179935,2269.442133,2284.179959,2327.833121,2398.822256,2494.813382,2613.051277,2750.667814,2904.90994,3073.275608,3253.573342,3347.599427 +15.5,3347.607862,3253.582051,3073.284747,2904.919213,2750.676773,2613.059407,2494.820227,2398.827568,2327.836971,2284.18276,2269.444569,2284.182785,2327.837018,2398.827634,2494.820304,2613.059489,2750.676855,2904.91929,3073.284816,3253.582111,3347.607918 +15.6,3347.616236,3253.5907,3073.293829,2904.928432,2750.685685,2613.067499,2494.827048,2398.83287,2327.840818,2284.185558,2269.446985,2284.185585,2327.840869,2398.83294,2494.827131,2613.067587,2750.685773,2904.928515,3073.293904,3253.590765,3347.616297 +15.7,3347.624475,3253.599208,3073.302762,2904.937499,2750.694448,2613.075455,2494.833754,2398.838085,2327.844607,2284.188319,2269.449372,2284.188348,2327.844661,2398.83816,2494.833843,2613.075549,2750.694542,2904.937588,3073.302842,3253.599278,3347.62454 +15.8,3347.632552,3253.60755,3073.311519,2904.946387,2750.703036,2613.083251,2494.840326,2398.843197,2327.848326,2284.191034,2269.451722,2284.191065,2327.848383,2398.843276,2494.840419,2613.083352,2750.703137,2904.946482,3073.311606,3253.607625,3347.632621 +15.9,3347.640442,3253.615699,3073.320075,2904.955068,2750.711424,2613.090864,2494.846743,2398.848191,2327.851962,2284.193693,2269.454025,2284.193725,2327.852022,2398.848274,2494.846842,2613.09097,2750.711531,2904.955169,3073.320166,3253.615778,3347.640516 +16,3347.648121,3253.623629,3073.3284,2904.963516,2750.719585,2613.09827,2494.852985,2398.85305,2327.855502,2284.196285,2269.456272,2284.196318,2327.855566,2398.853138,2494.85309,2613.098382,2750.719697,2904.963623,3073.328497,3253.623714,3347.648199 +16.1,3347.655565,3253.631317,3073.336471,2904.971704,2750.727494,2613.105447,2494.859035,2398.85776,2327.858936,2284.1988,2269.458454,2284.198835,2327.859002,2398.857852,2494.859144,2613.105565,2750.727613,2904.971817,3073.336573,3253.631406,3347.655647 +16.2,3347.66275,3253.638738,3073.344261,2904.979607,2750.735128,2613.112373,2494.864872,2398.862305,2327.86225,2284.20123,2269.460562,2284.201267,2327.862319,2398.862401,2494.864986,2613.112496,2750.735252,2904.979726,3073.344368,3253.638831,3347.662836 +16.3,3347.669654,3253.645869,3073.351747,2904.987202,2750.742463,2613.119027,2494.87048,2398.866671,2327.865435,2284.203565,2269.462589,2284.203603,2327.865507,2398.866772,2494.8706,2613.119156,2750.742593,2904.987326,3073.351859,3253.645966,3347.669745 +16.4,3347.676258,3253.652689,3073.358907,2904.994466,2750.749478,2613.125391,2494.875844,2398.870847,2327.86848,2284.205798,2269.464526,2284.205837,2327.868555,2398.870951,2494.875968,2613.125526,2750.749613,2904.994595,3073.359023,3253.65279,3347.676352 +16.5,3347.68254,3253.659177,3073.365719,2905.001377,2750.756152,2613.131447,2494.880946,2398.87482,2327.871377,2284.207921,2269.466368,2284.207962,2327.871455,2398.874928,2494.881075,2613.131586,2750.756293,2905.001511,3073.36584,3253.659283,3347.682638 +16.6,3347.688484,3253.665316,3073.372163,2905.007916,2750.762467,2613.137176,2494.885775,2398.878578,2327.874117,2284.209928,2269.468108,2284.20997,2327.874197,2398.87869,2494.885908,2613.13732,2750.762613,2905.008054,3073.372289,3253.665426,3347.688585 +16.7,3347.69407,3253.671086,3073.378221,2905.014062,2750.768404,2613.142562,2494.890314,2398.882111,2327.87669,2284.211811,2269.46974,2284.211854,2327.876773,2398.882227,2494.890452,2613.142712,2750.768555,2905.014205,3073.378351,3253.671199,3347.694175 +16.8,3347.699283,3253.676469,3073.383873,2905.019798,2750.773945,2613.14759,2494.894551,2398.885408,2327.87909,2284.213564,2269.471258,2284.213609,2327.879175,2398.885527,2494.894693,2613.147744,2750.774101,2905.019946,3073.384007,3253.676586,3347.699391 +16.9,3347.704105,3253.68145,3073.389103,2905.025105,2750.779073,2613.152245,2494.898474,2398.888459,2327.881307,2284.21518,2269.472655,2284.215226,2327.881395,2398.888581,2494.89862,2613.152403,2750.779233,2905.025257,3073.389241,3253.68157,3347.704216 +17,3347.708522,3253.686012,3073.393893,2905.029968,2750.783773,2613.156511,2494.902069,2398.891253,2327.883334,2284.216653,2269.473927,2284.216701,2327.883425,2398.891378,2494.902219,2613.156674,2750.783937,2905.030124,3073.394035,3253.686135,3347.708636 +17.1,3347.712519,3253.690141,3073.398229,2905.03437,2750.78803,2613.160376,2494.905326,2398.893782,2327.885165,2284.217978,2269.475067,2284.218027,2327.885258,2398.893911,2494.90548,2613.160543,2750.788198,2905.034531,3073.398375,3253.690267,3347.712637 +17.2,3347.716085,3253.693824,3073.402098,2905.0383,2750.79183,2613.163829,2494.908235,2398.896039,2327.886793,2284.21915,2269.476072,2284.219199,2327.886888,2398.89617,2494.908392,2613.163999,2750.792003,2905.038464,3073.402247,3253.693953,3347.716205 +17.3,3347.719209,3253.69705,3073.405488,2905.041744,2750.795164,2613.166858,2494.910788,2398.898016,2327.888213,2284.220164,2269.476938,2284.220215,2327.88831,2398.89815,2494.910949,2613.167033,2750.79534,2905.041912,3073.40564,3253.697183,3347.719331 +17.4,3347.721882,3253.699811,3073.40839,2905.044695,2750.798022,2613.169458,2494.912978,2398.899708,2327.889421,2284.221018,2269.477662,2284.22107,2327.88952,2398.899845,2494.913142,2613.169635,2750.798201,2905.044865,3073.408544,3253.699946,3347.722007 +17.5,3347.724097,3253.7021,3073.410795,2905.047143,2750.800396,2613.171619,2494.914799,2398.901111,2327.890414,2284.22171,2269.478243,2284.221762,2327.890515,2398.901251,2494.914966,2613.1718,2750.800579,2905.047316,3073.410953,3253.702237,3347.724224 +17.6,3347.725848,3253.703909,3073.412698,2905.049082,2750.80228,2613.173337,2494.916246,2398.902222,2327.89119,2284.222238,2269.478679,2284.222291,2327.891293,2398.902364,2494.916416,2613.173522,2750.802466,2905.049258,3073.412858,3253.704048,3347.725977 +17.7,3347.727131,3253.705234,3073.414094,2905.050507,2750.803669,2613.174608,2494.917317,2398.903037,2327.891748,2284.2226,2269.47897,2284.222655,2327.891852,2398.903182,2494.91749,2613.174795,2750.803858,2905.050686,3073.414257,3253.705376,3347.727262 +17.8,3347.727943,3253.706073,3073.414979,2905.051415,2750.804561,2613.175428,2494.918008,2398.903555,2327.892084,2284.222798,2269.479115,2284.222853,2327.892191,2398.903702,2494.918183,2613.175618,2750.804751,2905.051597,3073.415144,3253.706216,3347.728075 +17.9,3347.728281,3253.706422,3073.415351,2905.051803,2750.804951,2613.175795,2494.918317,2398.903774,2327.8922,2284.222829,2269.479113,2284.222885,2327.892308,2398.903923,2494.918494,2613.175987,2750.805144,2905.051987,3073.415517,3253.706567,3347.728415 +18,3347.728144,3253.706282,3073.415208,2905.051671,2750.804839,2613.175707,2494.918243,2398.903694,2327.892094,2284.222693,2269.478965,2284.22275,2327.892203,2398.903845,2494.918423,2613.175901,2750.805034,2905.051856,3073.415376,3253.706428,3347.728279 +18.1,3347.727533,3253.705652,3073.414552,2905.051018,2750.804226,2613.175165,2494.917787,2398.903314,2327.891766,2284.222392,2269.478672,2284.22245,2327.891877,2398.903467,2494.917968,2613.175362,2750.804423,2905.051205,3073.414722,3253.705799,3347.72767 +18.2,3347.726451,3253.704535,3073.413385,2905.049847,2750.803114,2613.174172,2494.916949,2398.902636,2327.891219,2284.221927,2269.478234,2284.221986,2327.891331,2398.902791,2494.917133,2613.17437,2750.803312,2905.050036,3073.413556,3253.704683,3347.726589 +18.3,3347.724902,3253.702935,3073.411712,2905.048163,2750.801507,2613.17273,2494.915734,2398.901664,2327.890456,2284.221301,2269.477656,2284.221361,2327.890569,2398.90182,2494.915919,2613.172929,2750.801707,2905.048353,3073.411884,3253.703085,3347.72504 +18.4,3347.722892,3253.70086,3073.40954,2905.045973,2750.799411,2613.170845,2494.914146,2398.9004,2327.889478,2284.220518,2269.476941,2284.220578,2327.889592,2398.900558,2494.914333,2613.171046,2750.799612,2905.046164,3073.409712,3253.701011,3347.723031 +18.5,3347.720429,3253.698317,3073.406876,2905.043285,2750.796835,2613.168524,2494.912191,2398.898851,2327.888292,2284.21958,2269.476092,2284.219641,2327.888407,2398.899009,2494.912379,2613.168726,2750.797037,2905.043476,3073.407049,3253.698468,3347.720568 +18.6,3347.717522,3253.695315,3073.40373,2905.040108,2750.793786,2613.165776,2494.909875,2398.897021,2327.886902,2284.218494,2269.475113,2284.218555,2327.887018,2398.89718,2494.910064,2613.165978,2750.793989,2905.0403,3073.403904,3253.695466,3347.717662 +18.7,3347.714181,3253.691865,3073.400114,2905.036453,2750.790276,2613.162608,2494.907207,2398.894917,2327.885313,2284.217263,2269.47401,2284.217324,2327.88543,2398.895078,2494.907396,2613.162811,2750.790479,2905.036645,3073.400288,3253.692016,3347.71432 +18.8,3347.710416,3253.687977,3073.396038,2905.032331,2750.786315,2613.159031,2494.904194,2398.892546,2327.883531,2284.215893,2269.472788,2284.215954,2327.883648,2398.892707,2494.904384,2613.159235,2750.786518,2905.032523,3073.396212,3253.688128,3347.710556 +18.9,3347.70624,3253.683664,3073.391516,2905.027756,2750.781915,2613.155055,2494.900844,2398.889915,2327.881562,2284.214388,2269.47145,2284.21445,2327.881679,2398.890076,2494.901035,2613.155259,2750.782118,2905.027948,3073.391689,3253.683815,3347.706379 +19,3347.701665,3253.67894,3073.386561,2905.022741,2750.777089,2613.150693,2494.897169,2398.887031,2327.879411,2284.212754,2269.470003,2284.212817,2327.879529,2398.887193,2494.89736,2613.150897,2750.777292,2905.022933,3073.386734,3253.679091,3347.701804 +19.1,3347.696706,3253.673819,3073.381189,2905.017302,2750.771852,2613.145956,2494.893179,2398.883903,2327.877087,2284.210997,2269.468451,2284.21106,2327.877205,2398.884065,2494.893369,2613.14616,2750.772055,2905.017493,3073.381361,3253.673969,3347.696845 +19.2,3347.691379,3253.668317,3073.375417,2905.011456,2750.766221,2613.14086,2494.888885,2398.880542,2327.874596,2284.209125,2269.466801,2284.209187,2327.874715,2398.880704,2494.889075,2613.141063,2750.766423,2905.011646,3073.375588,3253.668466,3347.691516 +19.3,3347.6857,3253.662452,3073.369263,2905.005222,2750.760212,2613.13542,2494.884302,2398.876957,2327.871948,2284.207143,2269.46506,2284.207205,2327.872067,2398.877119,2494.884491,2613.135622,2750.760413,2905.005411,3073.369434,3253.6626,3347.685837 +19.4,3347.679688,3253.656243,3073.362748,2904.998619,2750.753845,2613.129653,2494.879442,2398.873161,2327.869153,2284.20506,2269.463235,2284.205123,2327.869271,2398.873322,2494.879632,2613.129854,2750.754045,2904.998807,3073.362917,3253.65639,3347.679824 +19.5,3347.673362,3253.64971,3073.355892,2904.991668,2750.74714,2613.123576,2494.874323,2398.869166,2327.866219,2284.202884,2269.461335,2284.202947,2327.866337,2398.869327,2494.874511,2613.123776,2750.747338,2904.991854,3073.356059,3253.649856,3347.673497 +19.6,3347.666743,3253.642874,3073.348716,2904.984392,2750.740117,2613.11721,2494.868958,2398.864983,2327.863156,2284.200624,2269.459366,2284.200687,2327.863274,2398.865144,2494.869145,2613.117408,2750.740314,2904.984576,3073.348882,3253.643018,3347.666876 +19.7,3347.65985,3253.635755,3073.341243,2904.976811,2750.732798,2613.110572,2494.863365,2398.860627,2327.859976,2284.198288,2269.457337,2284.198351,2327.860093,2398.860787,2494.863551,2613.110769,2750.732993,2904.976994,3073.341407,3253.635898,3347.659982 +19.8,3347.652706,3253.628376,3073.333496,2904.96895,2750.725204,2613.103682,2494.857559,2398.856111,2327.856688,2284.195885,2269.455256,2284.195947,2327.856805,2398.856269,2494.857744,2613.103877,2750.725397,2904.96913,3073.333658,3253.628517,3347.652836 +19.9,3347.645331,3253.620759,3073.325497,2904.960831,2750.717358,2613.09656,2494.851558,2398.851446,2327.853302,2284.193421,2269.453128,2284.193483,2327.853418,2398.851604,2494.851741,2613.096752,2750.717548,2904.961009,3073.325657,3253.620898,3347.645459 +20,3347.637746,3253.612925,3073.317271,2904.952479,2750.709282,2613.089226,2494.845378,2398.846648,2327.849829,2284.190906,2269.450962,2284.190967,2327.849944,2398.846804,2494.845559,2613.089416,2750.70947,2904.952654,3073.317428,3253.613062,3347.637873 +20.1,3347.629975,3253.604899,3073.308841,2904.943917,2750.701,2613.081702,2494.839037,2398.841729,2327.846278,2284.188347,2269.448765,2284.188407,2327.846392,2398.841883,2494.839216,2613.08189,2750.701185,2904.944089,3073.308996,3253.605033,3347.630099 +20.2,3347.62204,3253.596703,3073.300232,2904.935171,2750.692537,2613.074009,2494.832554,2398.836705,2327.842662,2284.185753,2269.446546,2284.185813,2327.842775,2398.836857,2494.83273,2613.074194,2750.692719,2904.935341,3073.300384,3253.596836,3347.622162 +20.3,3347.613966,3253.588363,3073.291471,2904.926267,2750.683916,2613.066169,2494.825946,2398.83159,2327.838991,2284.183133,2269.444311,2284.183193,2327.839103,2398.83174,2494.82612,2613.066352,2750.684095,2904.926434,3073.29162,3253.588493,3347.614086 +20.4,3347.605775,3253.579904,3073.282583,2904.917232,2750.675163,2613.058207,2494.819235,2398.826399,2327.835277,2284.180496,2269.442068,2284.180555,2327.835387,2398.826547,2494.819406,2613.058386,2750.675339,2904.917395,3073.282729,3253.580031,3347.605893 +20.5,3347.597494,3253.57135,3073.273594,2904.908091,2750.666305,2613.050145,2494.812439,2398.821148,2327.831532,2284.177851,2269.439827,2284.177909,2327.83164,2398.821295,2494.812608,2613.050321,2750.666477,2904.908251,3073.273737,3253.571475,3347.597609 +20.6,3347.589146,3253.562727,3073.264532,2904.898872,2750.657367,2613.042006,2494.805579,2398.815853,2327.827766,2284.175206,2269.437594,2284.175264,2327.827873,2398.815997,2494.805744,2613.042178,2750.657535,2904.899029,3073.264672,3253.562849,3347.589258 +20.7,3347.580754,3253.55406,3073.255421,2904.889602,2750.648374,2613.033813,2494.798673,2398.810529,2327.823992,2284.17257,2269.435377,2284.172627,2327.824097,2398.81067,2494.798835,2613.033982,2750.648538,2904.889755,3073.255558,3253.554179,3347.580864 +20.8,3347.572344,3253.545373,3073.246289,2904.880305,2750.639351,2613.02559,2494.791741,2398.80519,2327.82022,2284.169951,2269.433182,2284.170006,2327.820323,2398.805329,2494.791899,2613.025755,2750.639512,2904.880454,3073.246422,3253.545488,3347.572451 +20.9,3347.563938,3253.53669,3073.237159,2904.871009,2750.630324,2613.017359,2494.784802,2398.799852,2327.81646,2284.167355,2269.431015,2284.16741,2327.816561,2398.799988,2494.784957,2613.01752,2750.630481,2904.871154,3073.237289,3253.536802,3347.564042 +21,3347.555559,3253.528035,3073.228059,2904.861739,2750.621318,2613.009143,2494.777875,2398.794529,2327.812723,2284.164791,2269.428884,2284.164844,2327.812822,2398.794661,2494.778026,2613.0093,2750.62147,2904.86188,3073.228184,3253.528145,3347.55566 +21.1,3347.547231,3253.519433,3073.219012,2904.852521,2750.612357,2613.000964,2494.770979,2398.789235,2327.809019,2284.162265,2269.426793,2284.162317,2327.809116,2398.789364,2494.771126,2613.001117,2750.612505,2904.852657,3073.219134,3253.519539,3347.547329 +21.2,3347.538977,3253.510907,3073.210043,2904.843379,2750.603466,2612.992845,2494.764133,2398.783985,2327.805359,2284.159784,2269.424748,2284.159835,2327.805453,2398.784111,2494.764276,2612.992993,2750.60361,2904.843511,3073.210161,3253.511009,3347.539072 +21.3,3347.530819,3253.50248,3073.201178,2904.834339,2750.59467,2612.984808,2494.757356,2398.778794,2327.801751,2284.157355,2269.422756,2284.157405,2327.801843,2398.778916,2494.757495,2612.984952,2750.594809,2904.834467,3073.201292,3253.502579,3347.530911 +21.4,3347.52278,3253.494176,3073.192441,2904.825426,2750.585992,2612.976876,2494.750667,2398.773676,2327.798207,2284.154985,2269.420821,2284.155033,2327.798296,2398.773795,2494.750801,2612.977015,2750.586126,2904.825549,3073.19255,3253.494271,3347.522868 +21.5,3347.514882,3253.486017,3073.183855,2904.816664,2750.577457,2612.96907,2494.744084,2398.768645,2327.794736,2284.152681,2269.418948,2284.152727,2327.794823,2398.76876,2494.744214,2612.969204,2750.577586,2904.816783,3073.18396,3253.486108,3347.514966 +21.6,3347.507146,3253.478025,3073.175444,2904.808078,2750.569088,2612.961412,2494.737625,2398.763715,2327.791348,2284.150447,2269.417144,2284.150492,2327.791431,2398.763826,2494.737751,2612.961541,2750.569212,2904.808192,3073.175545,3253.478113,3347.507227 +21.7,3347.499592,3253.470222,3073.16723,2904.799689,2750.560908,2612.953923,2494.731309,2398.758899,2327.78805,2284.14829,2269.415411,2284.148333,2327.788131,2398.759006,2494.731429,2612.954046,2750.561027,2904.799798,3073.167326,3253.470306,3347.49967 +21.8,3347.49224,3253.462628,3073.159234,2904.79152,2750.552937,2612.946621,2494.72515,2398.75421,2327.784852,2284.146214,2269.413753,2284.146256,2327.784929,2398.754312,2494.725266,2612.94674,2750.55305,2904.791624,3073.159326,3253.462708,3347.492315 +21.9,3347.48511,3253.455262,3073.151477,2904.783591,2750.545196,2612.939527,2494.719166,2398.749659,2327.781761,2284.144223,2269.412173,2284.144264,2327.781835,2398.749757,2494.719276,2612.93964,2750.545304,2904.78369,3073.151564,3253.455338,3347.48518 +22,3347.478218,3253.448141,3073.143978,2904.775924,2750.537705,2612.932658,2494.713371,2398.745258,2327.778783,2284.142323,2269.410674,2284.142361,2327.778854,2398.745351,2494.713477,2612.932765,2750.537808,2904.776018,3073.144061,3253.448214,3347.478284 diff --git a/tests/data/currents_mdc/tension_c0/tension.dat b/tests/data/currents_mdc/tension_c0/tension.dat new file mode 100644 index 00000000..21f86d32 --- /dev/null +++ b/tests/data/currents_mdc/tension_c0/tension.dat @@ -0,0 +1,25 @@ +--------------------- MoorDyn Input File ------------------------------------ +Current tension parity deck (MoorDyn-C Currents 0): still water +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +22.0 TMax simulation length (s) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +300.0 TmaxIC max time for ic gen (s) +1.0e-12 threshIC convergence threshold for ic gen (-) +0 WaveKin MoorDyn-C water kinematics mode (-) +0 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/tension_c2/current_profile_dynamic.txt b/tests/data/currents_mdc/tension_c2/current_profile_dynamic.txt new file mode 100644 index 00000000..6801c669 --- /dev/null +++ b/tests/data/currents_mdc/tension_c2/current_profile_dynamic.txt @@ -0,0 +1,10 @@ +--------------------- MoorDyn dynamic currents File ---------------------------------- +still water at t = 0, then a sheared cross-flow + + +-50.0 -30.0 -10.0 0.0 +time ux... uy... uz... +0.0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 +5.0 0.300000 0.380000 0.460000 0.500000 0.105184 0.105184 0.105184 0.105184 0.000000 0.000000 0.000000 0.000000 +12.0 0.600000 0.760000 0.920000 1.000000 0.168866 0.168866 0.168866 0.168866 0.000000 0.000000 0.000000 0.000000 +25.0 0.360000 0.456000 0.552000 0.600000 -0.143839 -0.143839 -0.143839 -0.143839 0.000000 0.000000 0.000000 0.000000 diff --git a/tests/data/currents_mdc/tension_c2/ref_moordyn_c_tension.csv b/tests/data/currents_mdc/tension_c2/ref_moordyn_c_tension.csv new file mode 100644 index 00000000..a78ccb8d --- /dev/null +++ b/tests/data/currents_mdc/tension_c2/ref_moordyn_c_tension.csv @@ -0,0 +1,222 @@ +t,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20 +0,3347.400371,3253.367737,3073.059491,2904.689961,2750.454325,2612.856668,2494.649244,2398.695686,2327.743491,2284.117533,2269.389762,2284.117594,2327.743605,2398.695849,2494.64943,2612.856879,2750.454526,2904.690164,3073.059662,3253.3679,3347.400507 +0.1,3347.399715,3253.367387,3073.059649,2904.690483,2750.455052,2612.857481,2494.650022,2398.696352,2327.743984,2284.11783,2269.389861,2284.117518,2327.743393,2398.695548,2494.649108,2612.856602,2750.454388,2904.690254,3073.060112,3253.368834,3347.401731 +0.2,3347.397819,3253.366422,3073.06032,2904.692321,2750.457594,2612.860296,2494.65273,2398.698652,2327.745668,2284.118787,2269.390075,2284.117055,2327.742386,2398.694184,2494.647616,2612.855248,2750.453477,2904.690125,3073.061141,3253.371431,3347.405214 +0.3,3347.394812,3253.364958,3073.061591,2904.695541,2750.461987,2612.865132,2494.657371,2398.702591,2327.748551,2284.120428,2269.390445,2284.116262,2327.740653,2398.691824,2494.645017,2612.85286,2750.451811,2904.689756,3073.062706,3253.375619,3347.410869 +0.4,3347.389871,3253.362161,3073.062664,2904.699404,2750.467562,2612.871411,2494.663471,2398.707809,2327.752401,2284.122654,2269.391009,2284.115317,2327.738508,2398.688913,2494.641874,2612.850108,2750.450157,2904.689994,3073.065717,3253.382347,3347.419639 +0.5,3347.38227,3253.357293,3073.062838,2904.703271,2750.47376,2612.878664,2494.670661,2398.714044,2327.757065,2284.125424,2269.391839,2284.114403,2327.736244,2398.685851,2494.638692,2612.847596,2750.449209,2904.691615,3073.071022,3253.39251,3347.432407 +0.6,3347.371749,3253.350059,3073.061835,2904.706901,2750.48038,2612.886733,2494.678829,2398.721235,2327.762537,2284.128787,2269.39304,2284.113682,2327.73408,2398.682913,2494.635804,2612.845712,2750.449412,2904.695119,3073.079171,3253.406694,3347.449739 +0.7,3347.35775,3253.339872,3073.059092,2904.709786,2750.486987,2612.89527,2494.687725,2398.729239,2327.768784,2284.132828,2269.394817,2284.11348,2327.732463,2398.680667,2494.633891,2612.845248,2750.45166,2904.701494,3073.091238,3253.426026,3347.472744 +0.8,3347.339465,3253.325884,3073.053794,2904.711195,2750.492957,2612.90378,2494.697004,2398.737875,2327.775807,2284.137734,2269.397551,2284.114373,2327.732163,2398.680072,2494.634096,2612.847519,2750.457429,2904.712363,3073.108972,3253.452331,3347.503235 +0.9,3347.316588,3253.307744,3073.0456,2904.710847,2750.498096,2612.912176,2494.706702,2398.747319,2327.783929,2284.143988,2269.401888,2284.117177,2327.734168,2398.682285,2494.637742,2612.854009,2750.468354,2904.7295,3073.134268,3253.487577,3347.543166 +1,3347.289386,3253.285658,3073.034705,2904.708978,2750.502704,2612.92084,2494.717299,2398.758162,2327.793866,2284.15244,2269.408821,2284.123031,2327.739767,2398.688748,2494.646422,2612.86646,2750.486321,2904.754928,3073.169272,3253.533977,3347.594735 +1.1,3347.258287,3253.259992,3073.021454,2904.705982,2750.507255,2612.93035,2494.729499,2398.771254,2327.806631,2284.164279,2269.419726,2284.133508,2327.750731,2398.701433,2494.662307,2612.887233,2750.513875,2904.791363,3073.21685,3253.594475,3347.660877 +1.2,3347.223995,3253.231379,3073.006452,2904.702509,2750.512483,2612.941554,2494.744292,2398.787749,2327.823562,2284.181043,2269.436355,2284.15058,2327.769264,2398.722774,2494.688059,2612.919214,2750.554111,2904.842095,3073.280456,3253.672607,3347.745129 +1.3,3347.187786,3253.201019,3072.990841,2904.699722,2750.519612,2612.955764,2494.7631,2398.809204,2327.846369,2284.204614,2269.460775,2284.176514,2327.797835,2398.75545,2494.726566,2612.965495,2750.61032,2904.910602,3073.363725,3253.772076,3347.851194 +1.4,3347.1513,3253.170468,3072.976101,2904.699106,2750.530171,2612.97458,2494.787623,2398.83744,2327.877014,2284.237113,2269.495282,2284.213793,2327.839126,2398.802343,2494.780914,2613.029364,2750.685987,2905.000553,3073.470478,3253.896763,3347.982952 +1.5,3347.116206,3253.141311,3072.963733,2904.702162,2750.545713,2612.999641,2494.819608,2398.874341,2327.917546,2284.28077,2269.542305,2284.265057,2327.895997,2398.866542,2494.854419,2613.114361,2750.784865,2905.1159,3073.604826,3254.050832,3348.144578 +1.6,3347.084269,3253.115227,3072.955318,2904.710461,2750.567855,2613.03264,2494.860862,2398.921849,2327.970064,2284.337868,2269.604327,2284.333004,2327.97137,2398.951197,2494.950459,2613.224089,2750.910774,2905.260663,3073.770944,3254.238501,3348.340302 +1.7,3347.057476,3253.094113,3072.952637,2904.725755,2750.59837,2613.075411,2494.913302,2398.981997,2328.036738,2284.410732,2269.683848,2284.420322,2328.068132,2399.059402,2495.072338,2613.362056,2751.067423,2905.438735,3073.97286,3254.463823,3348.574189 +1.8,3347.037912,3253.079967,3072.957562,2904.74987,2750.639101,2613.129845,2494.978899,2399.056857,2328.119769,2284.501713,2269.783385,2284.52971,2328.189178,2399.194249,2495.223348,2613.531757,2751.258499,2905.653981,3074.21456,3254.730801,3348.850256 +1.9,3347.027698,3253.074824,3072.971998,2904.784656,2750.69191,2613.197855,2495.059646,2399.148533,2328.221394,2284.613204,2269.905507,2284.663927,2328.337463,2399.3589,2495.406861,2613.736767,2751.487775,2905.910351,3074.500113,3255.043507,3349.172593 +2,3347.029149,3253.080917,3072.998037,2904.832138,2750.758822,2613.281506,2495.157677,2399.259255,2328.343965,2284.747702,2270.052872,2284.82581,2328.516015,2399.55658,2495.626299,2613.980705,2751.759062,2906.211823,3074.833593,3255.406015,3349.545295 +2.1,3347.044867,3253.100763,3073.038048,2904.894598,2750.842101,2613.383083,2495.27533,2399.391437,2328.489999,2284.907844,2270.228261,2285.018297,2328.727943,2399.790576,2495.885131,2614.267223,2752.076184,2906.562372,3075.219058,3255.822373,3349.97243 +2.2,3347.077648,3253.13708,3073.094599,2904.974503,2750.944185,2613.505038,2495.415097,2399.547642,2328.66215,2285.096405,2270.434584,2285.24445,2328.976471,2400.064282,2496.186928,2614.600065,2752.443055,2906.966055,3075.660632,3256.29669,3350.458133 +2.3,3347.130423,3253.192722,3073.17039,2905.074445,2751.06763,2613.649937,2495.579584,2399.730541,2328.863181,2285.316256,2270.674846,2285.507423,2329.264916,2400.381187,2496.53535,2614.983067,2752.863677,2907.427008,3076.162506,3256.833148,3351.00661 +2.4,3347.206271,3253.270694,3073.268275,2905.197156,2751.215119,2613.820457,2495.771496,2399.942891,2329.095925,2285.570333,2270.9521,2285.810405,2329.596615,2400.744784,2496.934053,2615.420045,2753.34202,2907.949322,3076.728813,3257.435869,3351.622013 +2.5,3347.308368,3253.3741,3073.391203,2905.345453,2751.389406,2614.019339,2495.993586,2400.187485,2329.363238,2285.861574,2271.269389,2286.156558,2329.974862,2401.15851,2497.386622,2615.914734,2753.881959,2908.536976,3077.363556,3258.108848,3352.308368 +2.6,3347.439867,3253.506022,3073.542109,2905.522132,2751.593217,2614.249287,2496.24857,2400.46707,2329.667925,2286.192863,2271.629694,2286.548977,2330.40288,2401.625722,2497.896555,2616.470773,2754.487267,2909.193834,3078.070613,3258.855963,3353.069588 +2.7,3347.603865,3253.66949,3073.723883,2905.72994,2751.829218,2614.512944,2496.539093,2400.784325,2330.012714,2286.567001,2272.035908,2286.990663,2330.883789,2402.14967,2498.467236,2617.091681,2755.161585,2909.923621,3078.853713,3259.68095,3353.909445 +2.8,3347.80344,3253.867516,3073.939399,2905.971603,2752.10005,2614.812913,2496.867758,2401.14187,2330.400269,2286.986713,2272.490836,2287.484516,2331.420596,2402.733477,2499.10191,2617.780828,2755.908396,2910.72988,3079.716396,3260.587361,3354.831534 +2.9,3348.041655,3254.103098,3074.191528,2906.249841,2752.408332,2615.151774,2497.237132,2401.542284,2330.833201,2287.454663,2272.997209,2288.033351,2332.016214,2403.380162,2499.803708,2618.541457,2756.731042,2911.616005,3080.662043,3261.578601,3355.839303 +3,3348.321549,3254.37921,3074.483123,2906.567358,2752.756666,2615.532079,2497.649754,2401.988114,2331.314084,2287.973471,2273.557715,2288.639936,2332.6735,2404.092681,2500.575693,2619.376738,2757.632783,2912.585294,3081.693937,3262.657983,3356.936112 +3.1,3348.646156,3254.698823,3074.817049,2906.926868,2753.147653,2615.956378,2498.108154,2402.481894,2331.845476,2288.545737,2274.175008,2289.306996,2333.395265,2404.873942,2501.420871,2620.289776,2758.616806,2913.640961,3082.815277,3263.828745,3358.125253 +3.2,3349.018527,3255.064924,3075.196192,2907.331109,2753.583915,2616.427228,2498.614865,2403.026153,2332.42992,2289.174036,2274.851715,2290.037223,2334.184276,2405.726792,2502.342183,2621.283604,2759.686212,2914.786123,3084.029165,3265.094033,3359.409929 +3.3,3349.441693,3255.480483,3075.623431,2907.782814,2754.068059,2616.947172,2499.172396,2403.623391,2333.069926,2289.860905,2275.590415,2290.83325,2335.043234,2406.654013,2503.342492,2622.361168,2760.844008,2916.023791,3085.338599,3266.4569,3360.79325 +3.4,3349.918617,3255.948399,3076.101583,2908.284662,2754.602636,2617.518686,2499.783192,2404.276041,2333.767932,2290.608804,2276.393606,2291.69763,2335.974755,2407.658292,2504.424567,2623.525312,2762.093088,2917.356856,3086.746462,3267.920288,3362.278222 +3.5,3350.452162,3256.471475,3076.633382,2908.839248,2755.190113,2618.144157,2500.449602,2404.986437,2334.526275,2291.42009,2277.263677,2292.632797,2336.981331,2408.74219,2505.591039,2624.778739,2763.436196,2918.78805,3088.255486,3269.486992,3363.867707 +3.6,3351.04508,3257.052404,3077.221453,2909.449073,2755.832853,2618.825866,2501.173862,2405.756796,2335.34717,2292.296989,2278.202883,2293.641046,2338.065309,2409.908113,2506.844382,2626.123984,2764.875897,2920.319919,3089.868223,3271.159634,3365.564397 +3.7,3351.699998,3257.693751,3077.868306,2910.116525,2756.533111,2619.565975,2501.958087,2406.589211,2336.232704,2293.241599,2279.213344,2294.724532,2339.22889,2411.158318,2508.186914,2627.563418,2766.414582,2921.954835,3091.587055,3272.940668,3367.370819 +3.8,3352.419424,3258.397968,3078.576339,2910.843888,2757.293035,2620.366537,2502.804283,2407.485662,2337.184849,2294.255897,2280.297058,2295.885287,2340.474148,2412.49493,2509.620818,2629.099273,2768.054496,2923.695017,3093.414223,3274.832413,3369.289369 +3.9,3353.205787,3259.167428,3079.347878,2911.633385,2758.11471,2621.229535,2503.714376,2408.448049,2338.205494,2295.341775,2281.455933,2297.125247,2341.80306,2413.919975,2511.14817,2630.733668,2769.797763,2925.542565,3095.351857,3276.837081,3371.322338 +4,3354.061477,3260.004464,3080.185211,2912.487205,2759.000191,2622.156918,2504.690255,2409.478228,2339.296479,2296.501075,2282.691823,2298.44629,2343.217538,2415.43541,2512.770977,2632.468646,2771.646426,2927.499495,3097.402013,3278.956813,3373.471949 +4.1,3354.988865,3260.911394,3081.090614,2913.407535,2759.95153,2623.150623,2505.733789,2410.578033,2340.459623,2297.73561,2284.006554,2299.850263,2344.719463,2417.043157,2514.491208,2634.306208,2773.602476,2929.567782,3099.566713,3281.193723,3375.740403 +4.2,3355.99032,3261.890533,3082.066359,2914.396566,2760.970784,2624.212591,2506.846849,2411.749297,2341.696736,2299.047187,2285.401937,2301.339,2346.310701,2418.745125,2516.310814,2636.248333,2775.667885,2931.749382,3101.847968,3283.549918,3378.129897 +4.3,3357.06821,3262.9442,3083.114724,2915.4565,2762.060025,2625.344769,2508.031306,2412.993846,2343.009624,2300.437602,2286.879776,2302.914323,2347.993103,2420.543204,2518.231728,2638.296979,2777.844595,2934.046231,3104.24778,3286.027504,3380.642631 +4.4,3358.224898,3264.074706,3084.23798,2916.589539,2763.221328,2626.549105,2509.289021,2414.313497,2344.400077,2301.908637,2288.441855,2304.578031,2349.7685,2422.439264,2520.25586,2640.454073,2780.13452,2936.460246,3106.768135,3288.628577,3383.280798 +4.5,3359.462718,3265.284339,3085.438373,2917.797866,2764.456754,2627.827529,2510.621838,2415.71004,2345.869859,2303.462041,2290.089928,2306.331896,2351.638689,2424.43514,2522.385084,2642.72151,2782.539538,2938.993313,3109.411001,3291.35522,3386.046584 +4.6,3360.783976,3266.575355,3086.718122,2919.08364,2765.768344,2629.181949,2512.031568,2417.185236,2347.420698,2305.099531,2291.825712,2308.177651,2353.605433,2426.532635,2524.62124,2645.101142,2785.061487,2941.647293,3112.17832,3294.209503,3388.942165 +4.7,3362.190946,3267.949984,3088.079415,2920.448997,2767.158122,2630.614256,2513.520003,2418.740815,2349.054294,2306.822793,2293.650893,2310.116996,2355.670461,2428.733515,2526.966132,2647.594784,2787.702169,2944.424019,3115.072019,3297.193484,3391.969711 +4.8,3363.685885,3269.41044,3089.52443,2921.896063,2768.628109,2632.126333,2515.088919,2420.378494,2350.772329,2308.633492,2295.567139,2312.151613,2357.835484,2431.03953,2529.421544,2650.204231,2790.463371,2947.325318,3118.094021,3300.309229,3395.131403 +4.9,3365.271052,3270.958937,3091.055347,2923.426969,2770.180337,2633.720077,2516.740106,2422.099994,2352.57649,2310.533298,2297.576117,2314.283186,2360.102216,2433.452435,2531.989266,2652.93128,2793.346884,2950.353036,3121.246273,3303.558835,3398.429461 +5,3366.948721,3272.597708,3092.674365,2925.043869,2771.816867,2635.397417,2518.475375,2423.907058,2354.468479,2312.523898,2299.679514,2316.513419,2362.472392,2435.974004,2534.671106,2655.777749,2796.354528,2953.509054,3124.530765,3306.944454,3401.866164 +5.1,3368.76503,3274.363076,3094.402061,2926.757734,2773.542625,2637.159419,2520.293327,2425.796571,2356.443545,2314.598253,2301.866589,2318.825658,2364.920432,2438.565906,2537.411371,2658.665256,2799.379368,2956.651659,3127.764588,3310.235903,3405.186195 +5.2,3370.659297,3276.203345,3096.197638,2928.527602,2775.308037,2638.940817,2522.106912,2427.654539,2358.356691,2316.577698,2303.92405,2320.972955,2367.168768,2440.92506,2539.888481,2661.262365,2802.090058,2959.460487,3130.649667,3313.168566,3408.144301 +5.3,3372.217414,3277.707905,3097.659165,2929.965873,2776.745479,2640.399513,2523.604901,2429.205485,2359.972249,2318.269282,2305.703146,2322.850691,2369.155283,2443.028803,2542.115042,2663.611991,2804.554492,2962.022989,3133.287559,3315.852846,3410.85403 +5.4,3373.298188,3278.737497,3098.652091,2930.945796,2777.738683,2641.431875,2524.697969,2430.375572,2361.232596,2319.631946,2307.179483,2324.451053,2370.888502,2444.901558,2544.130628,2665.767718,2806.838699,2964.415603,3135.762587,3318.37818,3413.406658 +5.5,3374.228388,3279.615849,3099.491141,2931.767851,2778.569026,2642.295828,2525.616931,2431.365642,2362.306533,2320.801177,2308.454736,2325.842169,2372.404001,2446.548036,2545.911451,2667.680275,2808.871603,2966.549703,3137.973257,3320.635408,3415.690462 +5.6,3375.254351,3280.588215,3100.418412,2932.669348,2779.467621,2643.215116,2526.577336,2432.382618,2363.392259,2321.966638,2309.710466,2327.198101,2373.869055,2448.129489,2547.613504,2669.501172,2810.80107,2968.570381,3140.062757,3322.766864,3417.847638 +5.7,3376.407153,3281.687672,3101.472687,2933.698518,2780.495676,2644.267078,2527.675459,2433.544134,2364.630772,2323.294232,2311.138526,2328.737185,2375.528429,2449.916405,2549.531575,2671.547361,2812.963431,2970.829925,3142.395359,3325.144574,3420.253094 +5.8,3377.813008,3283.040328,3102.779855,2934.981017,2781.778704,2645.577205,2529.036963,2434.976356,2366.149153,2324.912407,2312.869212,2330.592012,2377.517394,2452.046987,2551.806886,2673.963006,2815.505603,2973.477658,3145.122322,3327.921315,3423.060277 +5.9,3379.62882,3284.801318,3104.490051,2936.658824,2783.447719,2647.263022,2530.763753,2436.763912,2368.013555,2326.868076,2314.929835,2332.770345,2379.824611,2454.491639,2554.392825,2676.686149,2818.352412,2976.4277,3148.14992,3330.998772,3426.169354 +6,3381.761059,3286.877429,3106.51083,2938.640499,2785.412596,2649.235943,2532.768929,2438.821693,2370.140702,2329.079739,2317.240539,2335.193788,2382.372934,2457.174238,2557.21406,2679.642056,2821.429605,2979.606166,3151.404598,3334.303811,3429.50736 +6.1,3383.961342,3289.021879,3108.599748,2940.690261,2787.446456,2651.279893,2534.848735,2440.959404,2372.354497,2331.38581,2319.654169,2337.729206,2385.04256,2459.98737,2560.174393,2682.744403,2824.659256,2982.941882,3154.820208,3337.773555,3433.012553 +6.2,3386.092065,3291.097053,3110.61907,2942.66979,2789.410073,2653.254395,2536.861041,2443.032876,2374.508333,2333.636812,2322.017938,2340.220096,2387.672944,2462.766251,2563.104767,2685.820041,2827.864553,2986.254972,3158.214647,3341.224673,3436.501152 +6.3,3388.115686,3293.0647,3112.528625,2944.535407,2791.254912,2655.104815,2538.743987,2444.972064,2376.523208,2335.744161,2324.23321,2342.557484,2390.144708,2465.381279,2565.865804,2688.720615,2830.889308,2989.382829,3161.420633,3344.48714,3439.80218 +6.4,3389.994247,3294.887225,3114.292162,2946.252657,2792.948854,2656.80187,2540.471507,2446.754451,2378.380433,2337.693184,2326.289406,2344.734871,2392.455327,2467.833683,2568.462188,2691.453909,2833.74401,2992.338173,3164.452683,3347.576738,3442.931916 +6.5,3391.762837,3296.600145,3115.946942,2947.861298,2794.534978,2658.392748,2542.095584,2448.437447,2380.143425,2339.553798,2328.263315,2346.836145,2394.695842,2470.221512,2570.998607,2694.130719,2836.544852,2995.241683,3167.434987,3350.619991,3446.0178 +6.6,3393.583578,3298.36492,3117.653232,2949.519396,2796.168322,2660.028824,2543.763432,2450.163822,2381.950465,2341.459933,2330.284796,2348.987468,2396.989139,2472.664795,2573.592648,2696.866631,2839.40586,2998.206255,3170.479831,3353.728958,3449.171936 +6.7,3395.620563,3300.344969,3119.573213,2951.386858,2798.005636,2661.863007,2545.623584,2452.077403,2383.940595,2343.545968,2332.483827,2351.314786,2399.457549,2475.282676,2576.3607,2699.77575,2842.439335,3001.342867,3173.69743,3357.013515,3452.504197 +6.8,3397.932345,3302.599024,3121.766607,2953.524738,2800.109636,2663.960062,2547.743199,2454.248091,2386.186826,2345.888387,2334.940682,2353.902393,2402.189513,2478.167725,2579.399308,2702.958339,2845.748867,3004.757929,3177.196483,3360.583853,3456.125384 +6.9,3400.503983,3305.112398,3124.219713,2955.920659,2802.46954,2666.31111,2550.115547,2456.671497,2388.6873,2348.488017,2337.65896,2356.756685,2405.194165,2481.331672,2582.722597,2706.430709,2849.352685,3008.471299,3180.998205,3364.462067,3460.057932 +7,3403.283244,3307.832744,3126.879915,2958.52132,2805.030867,2668.8601,2552.682614,2459.287271,2391.379023,2351.278962,2340.569637,2359.805318,2408.395708,2484.695211,2586.247834,2710.10695,2853.162091,3012.39204,3185.010117,3368.554726,3464.208058 +7.1,3406.163808,3310.653878,3129.641292,2961.221008,2807.687913,2671.501174,2555.338183,2461.988575,2394.154261,2354.152313,2343.562327,2362.936124,2411.679913,2488.141839,2589.856155,2713.865936,2857.053918,3016.395336,3189.10627,3372.735157,3468.448794 +7.2,3409.016886,3313.447504,3132.376767,2963.894482,2810.317649,2674.113871,2557.964595,2464.660642,2396.901143,2356.998997,2346.530553,2366.044931,2414.944563,2491.570918,2593.448172,2717.609276,2860.930563,3020.384253,3193.190306,3376.90734,3472.684189 +7.3,3411.773335,3316.144708,3135.017956,2966.474178,2812.853393,2676.632469,2560.497128,2467.239713,2399.556803,2359.756965,2349.412959,2369.070912,2418.12916,2494.922081,2596.96351,2721.276531,2864.731507,3024.29828,3197.201809,3381.01091,3476.853878 +7.4,3414.450983,3318.763169,3137.582118,2968.976728,2815.310763,2679.071255,2562.94848,2469.736667,2402.130158,2362.433106,2352.214402,2372.016905,2421.234553,2498.194239,2600.399275,2724.863222,2868.450947,3028.130666,3201.133429,3385.038168,3480.95006 +7.5,3417.118486,3321.371436,3140.137618,2971.470318,2817.757582,2681.49756,2565.385435,2472.217714,2404.6869,2365.092745,2355.000024,2374.948051,2424.326028,2501.452933,2603.821367,2728.435697,2872.155742,3031.948851,3205.053152,3389.057476,3485.041289 +7.6,3419.866213,3324.059871,3142.774942,2974.045792,2820.285096,2684.003099,2567.900311,2474.775928,2407.321072,2367.83118,2357.86669,2377.963058,2427.504328,2504.801043,2607.334847,2732.101167,2875.955102,3035.863874,3209.073473,3393.182282,3489.241428 +7.7,3422.787845,3326.922023,3145.587377,2976.796159,2822.985879,2686.679871,2570.584492,2477.502086,2410.122936,2370.738359,2360.904292,2381.152014,2430.859945,2508.329627,2611.031482,2735.9522,2879.942448,3039.970033,3213.289424,3397.508122,3493.646274 +7.8,3425.941444,3330.015829,3148.632488,2979.77848,2825.916257,2689.583219,2573.492185,2480.44915,2413.144175,2373.864749,2364.162207,2384.563347,2434.44048,2512.085579,2614.957617,2740.034761,2884.163527,3044.313062,3217.746783,3402.080838,3498.301749 +7.9,3429.317639,3333.332043,3151.901185,2982.983972,2829.067794,2692.705019,2576.615571,2483.609575,2416.377482,2377.203279,2367.633611,2388.190461,2438.239517,2516.062613,2619.107097,2744.342845,2888.612536,3048.887444,3222.440249,3406.895295,3503.202804 +8,3432.852786,3336.807295,3155.330546,2986.35043,2832.379207,2695.984969,2579.895379,2486.925101,2419.765529,2380.697466,2371.262756,2391.978193,2442.202287,2520.20619,2623.425522,2748.822143,2893.235279,3053.639154,3227.315908,3411.897669,3508.295642 +8.1,3436.466505,3340.361433,3158.84066,2989.798301,2835.771389,2699.344348,2583.253201,2490.317504,2423.230092,2384.268888,2374.970825,2395.847113,2446.248524,2524.435041,2627.830571,2753.389329,2897.947578,3058.483388,3232.288451,3417.002365,3513.494557 +8.2,3440.090208,3343.926051,3162.363278,2993.259535,2839.176558,2702.715557,2586.621523,2493.719214,2426.703351,2387.849291,2378.688945,2399.72753,2450.307522,2528.677317,2632.249239,2757.970308,2902.674435,3063.344468,3237.281657,3422.132876,3518.722936 +8.3,3443.688112,3347.465548,3165.863054,2996.699138,2842.560237,2706.064646,2589.966911,2497.097275,2430.152749,2391.406432,2382.385117,2403.587588,2454.347447,2532.90112,2636.649547,2762.533041,2907.383836,3068.190469,3242.263632,3427.257394,3523.949027 +8.4,3447.27384,3350.993626,3169.35382,3000.131073,2845.936646,2709.406086,2593.304082,2500.466655,2433.593492,2394.955774,2386.075101,2407.443376,2458.384716,2537.123215,2641.048653,2767.095118,2912.093868,3073.039963,3247.25329,3432.395139,3529.192217 +8.5,3450.905793,3354.568625,3172.893792,3003.613257,2849.363402,2712.7971,2596.689791,2503.883618,2437.081363,2398.552686,2389.81398,2411.349822,2462.474217,2541.398575,2645.501755,2771.712073,2916.860522,3077.949397,3252.307408,3437.603206,3534.509808 +8.6,3454.658326,3358.264825,3176.557132,3007.219521,2852.913999,2716.310763,2600.196627,2507.420273,2440.688026,2402.268492,2393.672901,2415.378066,2466.687239,2545.798802,2650.080922,2776.456556,2921.757125,3082.992726,3257.500405,3442.956426,3539.976879 +8.7,3458.590469,3362.141251,3180.402925,3011.008863,2856.647402,2720.006004,2603.883466,2511.135477,2444.472371,2406.162204,2397.711139,2419.587787,2471.083982,2550.384744,2654.847762,2781.39101,2926.847004,3088.234047,3262.896948,3448.51994,3545.658837 +8.8,3462.727715,3366.223454,3184.456876,3015.006984,2860.589374,2723.908663,2607.776191,2515.055149,2448.46035,2410.259821,2401.95478,2424.005205,2475.690846,2555.183053,2659.829264,2786.542835,2932.158046,3093.701662,3268.525637,3454.322651,3551.584769 +8.9,3467.056074,3370.497567,3188.705323,3019.200272,2864.726402,2728.005332,2611.861431,2519.165899,2452.638466,2414.547646,2406.389857,2428.616017,2480.493142,2560.178672,2665.010058,2791.896445,2937.674571,3099.379795,3274.370611,3460.34876,3557.738945 +9,3471.528762,3374.917009,3193.102027,3023.542729,2869.01281,2732.250721,2616.094233,2523.423035,2456.962173,2418.981122,2410.971644,2433.375176,2485.445379,2565.32562,2670.343688,2797.404988,2943.349436,3105.221023,3280.384233,3466.550606,3564.073717 +9.1,3476.087391,3379.423634,3197.589263,3027.976988,2873.391704,2736.588506,2620.418824,2527.771273,2461.376552,2423.505521,2415.64542,2438.22778,2490.492331,2570.568277,2675.774134,2803.012101,2949.126029,3111.168471,3286.509429,3472.871109,3570.532019 +9.2,3480.688288,3383.973973,3202.123899,3032.460173,2877.82051,2740.976512,2624.793391,2532.1691,2465.84028,2428.079553,2420.369761,2443.132118,2495.59189,2575.864112,2681.25846,2808.674533,2954.960863,3117.178397,3292.702288,3479.266379,3577.069992 +9.3,3485.319271,3388.55597,3206.694109,3036.980546,2882.287577,2745.403229,2629.206536,2536.605174,2470.341999,2432.691743,2425.132973,2448.0762,2500.731739,2581.200515,2686.783833,2814.379332,2960.840933,3123.237705,3298.949686,3485.723414,3583.674719 +9.4,3490.001643,3393.191001,3211.321441,3041.559686,2886.814462,2749.890262,2633.679901,2541.101157,2474.903379,2437.363738,2429.956662,2453.081595,2505.933465,2586.599193,2692.372175,2820.148737,2966.788823,3129.369214,3305.274682,3492.265568,3590.369731 +9.5,3494.780449,3397.924145,3216.05111,3046.242787,2891.446265,2754.482669,2638.258513,2545.702055,2479.569436,2442.140589,2434.885943,2458.193551,2511.242568,2592.106039,2698.069892,2826.02978,2972.852161,3135.621017,3311.725789,3498.94177,3597.20419 +9.6,3499.706684,3402.80642,3220.934237,3051.080909,2896.233866,2759.231189,2642.992979,2550.458344,2484.390548,2447.072603,2439.971099,2463.462406,2516.709573,2597.771929,2703.928352,2832.074424,2979.083488,3142.046094,3318.356407,3505.805834,3604.232147 +9.7,3504.817205,3407.874741,3226.007881,3056.111103,2901.214186,2764.172645,2647.920034,2555.406668,2489.403276,2452.196259,2445.248526,2468.924514,2522.370904,2603.633499,2709.984528,2838.320094,2985.520641,3148.682596,3325.205016,3512.896589,3611.492634 +9.8,3510.121524,3413.138746,3231.281917,3061.343376,2906.397266,2769.317163,2653.049915,2560.557354,2494.618017,2457.521971,2450.728588,2474.590162,2528.236827,2609.701086,2716.248928,2844.777552,2992.174602,3155.541657,3332.282955,3520.225645,3618.997414 +9.9,3515.601449,3418.580414,3236.738612,3066.760245,2911.765788,2774.647638,2658.365766,2565.893758,2500.018278,2463.033288,2456.394737,2480.442611,2534.290401,2615.957598,2722.704382,2851.429632,2999.028167,3162.60601,3339.573011,3527.775955,3626.729533 +10,3521.225837,3424.166445,3242.34263,3072.326708,2917.285027,2780.129665,2663.833536,2571.382126,2505.570506,2468.696699,2462.213309,2486.447894,2540.497305,2622.368376,2729.315951,2858.241179,3006.045932,3169.840028,3347.039489,3535.511911,3634.653438 +10.1,3525.904213,3428.830359,3247.10869,3077.186019,2922.237181,2785.177813,2668.984178,2576.64819,2510.970153,2474.250098,2467.93585,2492.341291,2546.545596,2628.542064,2735.57927,2864.559779,3012.391168,3176.18609,3353.368162,3541.828734,3641.009457 +10.2,3527.903592,3430.819775,3249.199012,3079.363014,2924.493425,2787.510851,2671.393674,2579.138566,2513.549651,2476.92807,2470.717101,2495.218655,2549.497563,2631.538042,2738.587019,2867.552498,3015.349849,3179.095259,3356.220421,3544.639499,3643.84362 +10.3,3525.496966,3428.414798,3246.904852,3077.17057,2922.397586,2785.512358,2669.493327,2577.338912,2511.853913,2475.337432,2469.225721,2493.807536,2548.133975,2630.182422,2737.201585,2866.10893,3013.830812,3177.489695,3354.528005,3542.883883,3642.097487 +10.4,3519.127058,3422.058193,3240.669197,3071.056184,2916.404696,2779.647728,2663.761734,2571.743833,2506.39637,2470.01331,2464.02145,2488.695235,2543.072457,2625.125308,2732.1066,2860.945667,3008.581124,3172.142744,3349.084852,3537.370232,3636.584841 +10.5,3511.251619,3414.199799,3232.927305,3063.434645,2908.902093,2772.270379,2656.513264,2564.625167,2499.404722,2463.139551,2457.246199,2481.984927,2536.381437,2618.404651,2725.31381,2854.052339,3001.572264,3165.011866,3341.838812,3530.042089,3629.249552 +10.6,3504.71297,3407.674,3226.5015,3057.111571,2902.674098,2766.140251,2650.482798,2558.694654,2493.572032,2457.397127,2451.576824,2476.357728,2530.754015,2612.73166,2719.556465,2848.185659,2995.58347,3158.896018,3335.604363,3523.724953,3622.923501 +10.7,3501.450425,3404.419522,3223.336831,3054.043442,2899.692856,2763.249081,2647.685791,2555.995912,2490.974859,2454.900547,2449.170628,2474.017917,2528.444324,2610.411328,2717.189223,2845.746432,2993.056086,3156.269886,3332.881178,3520.934796,3620.130576 +10.8,3502.264031,3405.234323,3224.228565,3055.021386,2900.744287,2764.376964,2648.896754,2557.298967,2492.380655,2456.417277,2450.798106,2475.742129,2530.237978,2612.240453,2719.021385,2847.556684,2994.824083,3157.977816,3334.521747,3522.529625,3621.731616 +10.9,3506.515184,3409.479501,3228.534322,3059.396304,2905.169719,2768.852653,2653.428792,2561.898049,2497.061394,2461.193658,2455.676818,2480.716563,2535.28814,2617.338653,2724.139837,2852.672675,2999.916563,3163.026534,3339.516221,3527.489282,3626.702223 +11,3512.217981,3415.173442,3234.277214,3065.197368,2911.006185,2774.722173,2659.337146,2567.856605,2503.086388,2467.301391,2461.876675,2487.005079,2541.648889,2623.747493,2730.572138,2859.107675,3006.333461,3169.404729,3345.844879,3533.788496,3633.013564 +11.1,3517.002454,3419.9527,3239.103935,3070.085928,2915.934355,2779.688948,2664.349814,2572.92704,2508.230198,2472.533144,2467.203162,2492.420256,2547.134513,2629.278524,2736.123916,2864.659508,3011.864328,3174.894479,3351.284014,3539.199507,3638.434656 +11.2,3519.312887,3422.264002,3241.463288,3072.512724,2918.407234,2782.208008,2666.922945,2575.564863,2510.944951,2475.334135,2470.090682,2495.381911,2550.147135,2632.314128,2739.157013,2867.669925,3014.832637,3177.803999,3354.130497,3542.011856,3641.251262 +11.3,3518.858599,3421.816066,3241.062981,3072.182881,2918.126095,2781.975274,2666.745564,2575.450625,2510.901056,2475.362942,2470.184418,2495.520573,2550.30179,2632.453555,2739.25517,2867.707983,3014.794338,3177.678403,3353.921449,3541.757601,3640.993626 +11.4,3516.490961,3419.458697,3238.752135,3069.945216,2915.94197,2779.844385,2664.674636,2573.445812,2508.966115,2473.495207,2468.37016,2493.73418,2548.510155,2630.62314,2737.35942,2865.72854,3012.716572,3175.494995,3351.641879,3539.42659,3638.654506 +11.5,3513.846287,3416.825048,3236.161689,3067.428369,2913.483408,2777.444101,2662.340099,2571.18348,2506.779153,2471.37954,2466.310126,2491.702465,2546.472665,2628.546052,2735.216219,2863.500348,3010.388144,3173.059284,3349.109949,3536.845006,3636.06481 +11.6,3512.687496,3415.673624,3235.046411,3066.380908,2912.490641,2776.504688,2661.461604,2570.373334,2506.041887,2470.712741,2465.70004,2491.124105,2545.894581,2627.936919,2734.551168,2862.760367,3009.55676,3172.128233,3348.089824,3535.781635,3634.996774 +11.7,3514.091794,3417.078925,3236.478525,3067.870937,2914.026196,2778.082035,2663.08794,2572.057441,2507.790852,2472.527706,2467.571544,2493.032024,2547.812408,2629.837624,2736.412578,2864.563641,3011.283932,3173.769005,3349.653133,3537.31085,3636.526822 +11.8,3518.023593,3421.005895,3240.424929,3071.867612,2918.062111,2782.151723,2667.198778,2576.220059,2512.015278,2476.818904,2471.924559,2497.431724,2552.237249,2634.264761,2740.82221,2868.936613,3015.600266,3178.015745,3353.836776,3541.470978,3640.693811 +11.9,3523.507971,3426.481901,3245.91572,3077.404203,2923.635536,2787.755365,2672.840229,2581.911234,2517.767905,2482.639963,2477.811502,2503.372306,2558.213061,2640.255816,2746.810308,2874.902199,3021.522009,3183.879218,3359.64747,3547.265769,3646.499496 +12,3529.119904,3432.084637,3251.53055,3083.062294,2929.330046,2793.478408,2678.598809,2587.716954,2523.631736,2488.567744,2483.799628,2509.408102,2564.278507,2646.331979,2752.879862,2880.945709,3027.518591,3189.815757,3365.531772,3553.135196,3652.380088 +12.1,3533.543181,3436.500639,3255.958622,3087.534551,2933.842333,2798.021895,2683.179516,2592.344971,2528.315226,2493.308636,2488.590147,2514.232069,2569.115673,2651.162587,2757.686483,2885.70917,3032.219705,3194.444828,3370.101446,3557.685807,3656.939013 +12.2,3536.087993,3439.041795,3258.514311,3090.139191,2936.495289,2800.714056,2685.916085,2595.134197,2531.161627,2496.208956,2491.530916,2517.192023,2572.070849,2654.091192,2760.570105,2888.52856,3034.957605,3197.095567,3372.683223,3560.242604,3659.50005 +12.3,3536.952553,3439.905804,3259.395251,3091.074266,2937.48725,2801.753454,2687.007234,2596.28355,2532.370244,2497.468692,2492.823006,2518.490492,2573.348296,2655.323881,2761.738534,2889.613307,3035.943227,3197.980255,3373.490371,3561.019467,3660.27753 +12.4,3537.056078,3440.009643,3259.516309,3091.252262,2937.727447,2802.045498,2687.354359,2596.69081,2532.836313,2497.982164,2493.361788,2519.025901,2573.851194,2655.769756,2762.107339,2889.885512,3036.104803,3198.032401,3373.460379,3560.956527,3660.213432 +12.5,3537.570591,3440.522821,3260.044957,3091.838496,2938.378442,2802.749733,2688.114223,2597.510884,2533.714594,2498.906333,2494.309142,2519.967708,2574.758802,2656.619341,2762.878891,2890.559233,3036.667135,3198.485936,3373.834036,3561.299044,3660.555749 +12.6,3539.429035,3442.376424,3261.910796,3093.761056,2940.366451,2804.790453,2690.209547,2599.665803,2535.927925,2501.166838,2496.595766,2522.253875,2577.018166,2658.829942,2765.021199,2892.613018,3038.618483,3200.337391,3375.614078,3563.053725,3662.313489 +12.7,3542.985836,3445.924146,3265.466536,3097.370293,2944.039045,2808.513364,2693.984129,2603.497627,2539.817084,2505.103882,2500.562146,2526.226044,2580.972849,2662.747561,2768.883003,2896.398532,3042.313418,3203.943975,3379.159662,3566.580885,3665.847657 +12.8,3547.916034,3450.841673,3270.387816,3102.339742,2949.067463,2813.589207,2699.108023,2608.675345,2545.049502,2510.382734,2505.870755,2531.543296,2586.278059,2668.023199,2774.11103,2901.558585,3047.391446,3208.942631,3384.10571,3571.513956,3670.790756 +12.9,3553.390757,3456.302092,3275.849357,3107.846285,2954.631153,2819.200202,2704.766027,2614.385599,2550.812446,2516.189692,2511.705107,2537.384573,2592.106632,2673.822445,2779.863108,2907.243496,3052.99622,3214.471554,3389.586138,3576.983848,3676.27177 +13,3558.471026,3461.36856,3280.916172,3112.95747,2959.800713,2824.420239,2710.035142,2619.707723,2556.186272,2521.604397,2517.142141,2542.822131,2597.524406,2679.203416,2785.18902,2912.494939,3058.162164,3219.559171,3394.624636,3582.010973,3681.309012 +13.1,3562.506019,3465.39165,3284.939992,3117.026685,2963.931497,2828.606657,2714.274409,2624.00176,2560.530976,2525.985492,2521.537683,2547.207514,2601.877358,2683.505528,2789.421192,2916.638592,3062.20894,3223.520125,3398.531835,3585.903252,3685.208815 +13.2,3565.363112,3468.238977,3287.788649,3119.9223,2966.892558,2831.62911,2717.35395,2627.138042,2563.716832,2529.202925,2524.761059,2550.409109,2605.032588,2686.59425,2792.423329,2919.536528,3064.997225,3226.213906,3401.166101,3588.518311,3687.828456 +13.3,3567.427281,3470.294705,3289.845819,3122.027708,2969.067103,2833.870594,2719.656678,2629.499702,2566.127751,2531.64219,2527.200224,2552.818133,2607.38516,2688.868765,2794.598838,2921.596317,3066.938416,3228.055035,3402.9441,3590.274273,3689.587017 +13.4,3569.402106,3472.260885,3291.812321,3124.042385,2971.153161,2836.027569,2721.87769,2631.781057,2568.458306,2533.999552,2529.554735,2555.138953,2609.645452,2691.046199,2796.671964,2923.549263,3068.770296,3229.78665,3404.612834,3591.920757,3691.235795 +13.5,3571.995177,3474.843532,3294.392693,3126.669001,2973.851291,2838.798264,2724.713022,2634.676484,2571.40222,2536.969489,2532.521415,2558.072276,2612.519306,2693.838353,2799.360948,2926.120094,3071.223612,3232.144481,3406.911655,3594.199577,3693.518204 +13.6,3575.623928,3478.459173,3298.002545,3130.321884,2977.574402,2842.59402,2728.572527,2638.594682,2575.367649,2540.960496,2536.510082,2562.030186,2616.421826,2697.663873,2803.088344,2929.73539,3074.728741,3235.562024,3410.276282,3597.547956,3696.872416 +13.7,3580.271511,3483.091044,3302.625125,3134.984109,2982.305459,2847.397662,2733.438872,2643.518155,2580.336953,2545.95485,2541.502988,2566.994944,2621.33527,2702.505001,2807.836532,2934.377843,3079.268783,3240.022643,3414.690132,3601.949344,3701.281861 +13.8,3585.537879,3488.339996,3307.861996,3140.25789,2987.647502,2852.813034,2738.916512,2649.051586,2585.914472,2551.555852,2547.101603,2572.565395,2626.855152,2707.953464,2813.193407,2939.631794,3084.424966,3245.104842,3419.729505,3606.978572,3706.320427 +13.9,3590.837808,3493.622083,3313.130311,3145.561562,2993.020193,2858.261104,2744.427516,2654.617555,2591.52241,2557.184245,2552.723997,2578.155718,2632.390694,2713.412818,2818.556723,2944.889485,3089.584599,3250.191643,3424.774031,3612.013022,3711.364104 +14,3595.654744,3498.421896,3317.915799,3150.382195,2997.910505,2863.228809,2749.460311,2659.70551,2596.650492,2562.329087,2557.857472,2583.250352,2637.422455,2718.359074,2823.39776,2949.617641,3094.210261,3254.741931,3429.279664,3616.506733,3715.865738 +14.1,3599.743521,3502.494782,3321.974394,3154.476462,3002.07546,2867.47354,2753.773087,2664.074186,2601.057647,2566.749084,2562.260042,2587.606095,2641.705507,2722.545254,2827.467461,2953.565231,3098.04908,3258.501044,3432.990293,3620.202698,3719.56778 +14.2,3603.202852,3505.939227,3325.404568,3157.942892,3005.613729,2871.094133,2757.46484,2667.822801,2604.843452,2570.544374,2566.032599,2591.324722,2645.342535,2726.075002,2830.870524,2956.837983,3101.2076,3261.575944,3436.013143,3623.208416,3722.577955 +14.3,3606.401866,3509.123531,3328.574006,3161.148467,3008.891555,2874.456102,2760.900456,2671.315962,2608.372805,2574.080898,2569.542954,2594.776648,2648.707116,2729.325504,2833.988014,2959.820768,3104.074033,3264.357397,3438.740929,3625.917992,3725.291261 +14.4,3609.803408,3512.50952,3331.943687,3164.553141,3012.367756,2878.017135,2764.536628,2675.009801,2612.10198,2577.815985,2573.250488,2598.424224,2652.2653,2732.767095,2837.294888,2962.993081,3107.131871,3267.332026,3441.662702,3628.822176,3728.199535 +14.5,3613.766943,3516.455859,3335.871521,3168.513821,3016.398091,2882.131828,2768.726876,2679.257093,2616.383571,2582.102766,2577.509664,2602.623982,2656.376289,2736.762179,2841.157089,2966.724382,3110.753656,3270.874785,3445.15533,3632.29916,3731.681796 +14.6,3618.411322,3521.081144,3340.475804,3173.148312,3021.099778,2886.916812,2773.587237,2684.173391,2621.332847,2587.056491,2582.435997,2607.491944,2661.156821,2741.428503,2845.693607,2971.134934,3115.0607,3275.107717,3449.341502,3636.472073,3735.861435 +14.7,3623.589758,3526.238919,3345.61031,3178.310536,3026.326866,2892.226286,2778.971948,2689.612828,2626.803665,2592.530498,2587.882039,2612.879584,2666.457072,2746.614943,2850.752125,2976.071307,3119.898424,3279.875151,3454.06481,3641.183987,3740.581173 +14.8,3628.975624,3531.603283,3350.949755,3183.675859,3031.755412,2897.737023,2784.558325,2695.252941,2632.473333,2598.201283,2593.522819,2618.459795,2671.94727,2751.988852,2855.997123,2981.195179,3124.925797,3284.833662,3458.980086,3646.088532,3745.493865 +14.9,3634.212404,3536.818504,3356.139124,3188.890096,3037.032129,2903.096681,2789.99478,2700.742551,2637.990585,2603.716847,2599.004875,2623.876913,2677.268959,2757.188729,2861.063989,2986.138864,3129.772127,3289.60992,3463.71207,3650.809115,3750.222081 +15,3639.060496,3541.645504,3360.939874,3193.715387,3041.919904,2908.068954,2795.045702,2705.846504,2643.120407,2608.841884,2604.092112,2628.893531,2682.183029,2761.973611,2865.709856,2990.65753,3134.190543,3293.955245,3468.010771,3655.094846,3754.51438 +15.1,3642.247719,3544.82715,3364.144635,3197.036679,3045.429986,2911.816113,2799.027587,2710.017897,2647.428209,2613.224884,2608.483239,2633.223285,2686.381486,2765.976821,2869.471912,2994.154405,3137.41222,3296.890664,3470.648065,3657.425967,3756.692557 +15.2,3641.812007,3544.39765,3363.747038,3196.760699,3045.346116,2911.973557,2799.425635,2710.609433,2648.155038,2614.019731,2609.272936,2633.93309,2686.93835,2766.317406,2869.554275,2993.959698,3136.934215,3296.119901,3469.572952,3656.03583,3755.140168 +15.3,3636.963042,3539.565149,3358.946277,3192.074712,3040.840917,2907.694849,2795.372906,2706.73537,2644.396124,2610.301975,2605.515254,2630.05205,2682.852911,2761.95932,2864.880538,2988.953622,3131.593783,3290.442178,3463.555672,3649.678063,3748.604503 +15.4,3628.816952,3531.442985,3350.851854,3184.084791,3033.016479,2900.077517,2787.962126,2699.48435,2637.238015,2603.159035,2598.302245,2622.681123,2675.239445,2754.034089,2856.602166,2980.308557,3122.583351,3281.067665,3453.820497,3639.58694,3738.324616 +15.5,3619.733322,3522.388805,3341.826018,3175.164084,3024.26177,2891.530359,2779.62504,2691.313776,2629.166701,2595.108399,2590.185611,2614.408423,2666.723813,2745.205326,2847.418892,2970.757122,3112.663978,3270.780806,3443.169714,3628.577274,3727.122619 +15.6,3612.548302,3515.231115,3334.686952,3168.117538,3017.36612,2884.82603,2773.118336,2684.967278,2622.917956,2588.884721,2583.906395,2607.988799,2660.081156,2738.273174,2840.158262,2963.154269,3104.715978,3262.483771,3434.522615,3619.58041,3717.937106 +15.7,3609.213205,3511.916546,3331.375606,3164.87877,3014.254325,2881.879287,2770.345792,2682.337269,2620.373375,2586.360033,2581.328807,2605.280632,2657.166016,2735.089974,2836.671474,2959.350586,3100.58964,3258.02695,3429.730077,3614.448396,3712.622536 +15.8,3609.975415,3512.691903,3332.137879,3165.692307,3015.169688,2882.932718,2771.549986,2683.66722,2621.778655,2587.783819,2582.707793,2606.546037,2658.249318,2735.936721,2837.250229,2959.64837,3100.597147,3257.731231,3429.119824,3613.513484,3711.513115 +15.9,3613.491037,3516.21735,3335.640112,3169.232651,3018.796935,2886.682678,2775.439201,2687.676415,2625.862211,2591.890966,2586.78159,2610.523499,2662.067169,2739.54515,2840.620536,2962.767224,3103.45186,3260.30463,3431.395678,3615.476492,3713.307392 +16,3617.646983,3520.383589,3339.775613,3173.394645,3023.031717,2891.024507,2779.906601,2692.253067,2630.503847,2596.548927,2591.401248,2615.044085,2666.428102,2743.699901,2844.543037,2966.444925,3106.871157,3263.447696,3434.245402,3618.016571,3715.679375 +16.1,3620.376464,3523.127987,3342.486314,3176.124891,3025.825391,2893.913705,2782.91018,2695.354801,2633.656968,2599.702328,2594.497798,2618.020794,2669.22361,2746.268696,2846.860734,2968.500237,3108.651698,3264.938462,3435.432691,3618.887807,3716.377811 +16.2,3620.431914,3523.205994,3342.532955,3176.190843,3025.953515,2894.134761,2783.242356,2695.781298,2634.128302,2600.163025,2594.885972,2618.269026,2669.267853,2746.062837,2846.380805,2967.735429,3107.590809,3263.569827,3433.74683,3616.876893,3714.18753 +16.3,3617.861841,3520.666196,3339.9664,3173.6465,3023.474048,2891.750166,2780.969012,2693.602089,2631.992752,2598.011382,2592.651564,2615.879916,2666.657135,2743.183329,2843.20818,2964.258465,3103.798805,3259.453848,3429.301106,3612.098001,3709.223393 +16.4,3613.877653,3516.716807,3335.992156,3169.693663,3019.584375,2887.952459,2777.277971,2690.000964,2628.431336,2594.427441,2588.975719,2612.037854,2662.580944,2738.825932,2838.545307,2959.27828,3098.490631,3253.810594,3423.319678,3605.778386,3702.715192 +16.5,3610.17462,3513.049181,3332.298299,3166.016368,3015.964147,2884.417021,2773.84119,2686.648018,2625.114538,2591.084955,2585.538601,2608.432507,2658.741019,2734.706046,2834.121746,2954.538152,3093.422144,3248.406612,3417.577506,3599.698952,3696.447816 +16.6,3608.18658,3511.094183,3330.313581,3164.041007,3014.037583,2882.566552,2772.081094,2684.967188,2623.470104,2589.418212,2583.783959,2606.519887,2656.607911,2732.310111,2831.440141,2951.556329,3090.125896,3244.786599,3413.628818,3595.420457,3691.985889 +16.7,3608.574574,3511.511268,3330.695882,3164.423135,3014.457561,2883.051273,2772.645603,2685.604704,2624.143397,2590.072803,2584.358867,2606.949902,2656.835564,2732.296917,2831.1645,2951.002107,3089.276316,3243.62954,3412.156357,3593.628253,3690.016351 +16.8,3611.030312,3513.992456,3333.137137,3166.853774,3016.913559,2885.558652,2775.21971,2688.242459,2626.8124,2592.721964,2586.931095,2609.384393,2659.079673,2734.315958,2832.938276,2952.513415,3090.50672,3244.565101,3412.787214,3593.947676,3690.163556 +16.9,3614.460958,3517.44723,3336.549673,3170.248287,3020.324032,2889.010172,2778.727451,2691.805993,2630.402479,2596.288829,2590.419405,2612.73586,2662.244958,2737.263092,2835.647934,2954.967571,3092.686249,3246.455579,3414.378478,3595.232101,3691.278458 +17,3617.513135,3520.525248,3339.587283,3173.265423,3023.353095,2892.07543,2781.843462,2694.973831,2633.594148,2599.453481,2593.50088,2615.676013,2664.995755,2739.793733,2837.939083,2957.000387,3094.441765,3247.920206,3415.543466,3596.090581,3691.967292 +17.1,3619.159831,3522.201618,3341.228,3174.886727,3024.985857,2893.742935,2783.559069,2696.739049,2635.380625,2601.207308,2595.163035,2617.186649,2666.306543,2740.873798,2838.768368,2957.559343,3094.712391,3247.89098,3415.208668,3595.44573,3691.150335 +17.2,3619.062595,3522.138478,3341.135093,3174.777015,3024.888612,2893.68034,2783.543024,2696.77111,2635.431481,2601.219249,2595.073464,2616.933391,2665.840355,2740.163108,2837.791974,2956.296995,3093.147374,3246.014306,3413.018318,3592.940269,3688.469512 +17.3,3617.618169,3520.731746,3339.704136,3173.332009,3023.457362,2892.284198,2782.19284,2695.468357,2634.146566,2599.892094,2593.638677,2615.327198,2664.013011,2738.082389,2835.435322,2953.64322,3090.180599,3242.727434,3409.412307,3589.015874,3684.367615 +17.4,3615.734298,3518.887198,3337.838859,3171.453485,3021.591848,2890.452458,2780.405294,2693.725837,2632.420629,2598.123621,2591.761347,2613.277387,2661.741752,2735.557502,2832.633094,2950.541357,3086.763374,3238.988489,3405.354144,3584.639759,3679.814117 +17.5,3614.418117,3517.609653,3336.541059,3170.139823,3020.286623,2889.175855,2779.16777,2692.52852,2631.237621,2596.898513,2590.428803,2611.775786,2660.024347,2733.59308,2830.397266,2948.01085,3083.922172,3235.830109,3401.881403,3580.852945,3675.852257 +17.6,3614.351071,3517.578975,3336.488323,3170.06599,3020.21367,2889.123388,2779.146635,2692.540847,2631.261052,2596.880559,2590.306492,2611.490856,2659.533325,2732.866418,2829.410327,2946.739604,3082.350078,3233.949998,3399.695493,3578.359363,3673.187511 +17.7,3615.646852,3518.908614,3337.793591,3171.344448,3021.484859,2890.406355,2780.452748,2693.873445,2632.60153,2598.180559,2591.505715,2612.53471,2660.38179,2733.491702,2829.787673,2946.844436,3082.16538,3233.467865,3398.91725,3577.280511,3671.941706 +17.8,3617.873109,3521.167095,3340.026268,3173.545684,3023.671649,2892.597025,2782.658912,2696.099211,2634.831407,2600.369539,2593.595416,2614.473532,2662.13253,2735.027864,2831.084293,2947.876706,3082.916259,3233.929337,3399.090257,3577.158413,3671.655888 +17.9,3620.277349,3523.603472,3342.437244,3175.92284,3026.029401,2894.952705,2785.023859,2698.477472,2637.209464,2602.704349,2595.829108,2616.556186,2664.028571,2736.711242,2832.529557,2949.059126,3083.819413,3234.546075,3399.422125,3577.197741,3671.532974 +18,3622.110884,3525.470653,3344.28162,3177.733866,3027.819083,2896.737234,2786.813867,2700.276198,2639.004318,2604.452956,2597.47275,2618.045281,2665.327924,2737.794295,2833.369982,2949.632425,3084.110246,3234.548957,3399.139999,3576.622927,3670.795762 +18.1,3622.925958,3526.321869,3345.114168,3178.535732,3028.600106,2897.512431,2787.592955,2701.061203,2639.783022,2605.182949,2598.093698,2618.507116,2665.594964,2737.838784,2833.164403,2949.152541,3083.341974,3233.488845,3397.792687,3574.981284,3668.99067 +18.2,3622.725807,3526.160322,3344.938197,3178.332173,3028.376744,2897.283082,2787.366403,2700.838271,2639.551951,2604.901394,2597.699788,2617.950262,2664.838801,2736.854158,2831.922588,2947.629582,3081.524994,3231.376378,3395.390838,3572.283489,3666.128455 +18.3,3621.913542,3525.388208,3344.154704,3177.522978,3027.547576,2896.446563,2786.530577,2700.003169,2638.70694,2604.005013,2596.689465,2616.775561,2663.463102,2735.247193,2830.054656,2945.47705,3079.07595,3228.63091,3392.355794,3568.952355,3662.632881 +18.4,3621.087388,3524.602439,3343.358786,3176.701242,3026.703672,2895.591998,2785.673022,2699.142527,2637.834332,2603.081057,2595.652463,2615.576247,2662.065341,2733.620133,2828.168013,2943.307544,3076.612284,3225.874061,3389.312353,3565.614995,3659.13248 +18.5,3620.786862,3524.341351,3343.087043,3176.401565,3026.37757,2895.249885,2785.322474,2698.783861,2637.459426,2602.653698,2595.114813,2614.881182,2661.177955,2732.509579,2826.803864,2941.666966,3074.684333,3223.660014,3386.817623,3562.830662,3656.187779 +18.6,3621.287142,3524.879426,3343.612732,3176.895677,3026.839326,2895.68849,2785.74547,2699.192213,2637.845953,2602.985913,2595.339542,2614.953871,2661.065256,2732.180987,2826.229193,2940.82402,3073.562543,3222.260754,3385.14473,3560.873393,3654.073386 +18.7,3622.511736,3526.140283,3344.859494,3178.107235,3028.012631,2896.831418,2786.865407,2700.290644,2638.916548,2603.99988,2596.248298,2615.715242,2661.647277,2732.553474,2826.362377,2940.696498,3073.164278,3221.593261,3384.210238,3559.659535,3652.70549 +18.8,3624.099083,3527.763117,3346.467605,3179.677897,3029.540699,2898.323344,2788.328171,2701.725862,2640.318264,2605.342487,2597.487194,2616.809913,2662.566496,2733.267024,2826.840861,2940.919391,3073.122309,3221.288299,3383.643186,3558.81697,3651.711225 +18.9,3625.578011,3529.277719,3347.968288,3181.140691,3030.958569,2899.701171,2789.672171,2703.037234,2641.590764,2606.552982,2598.594229,2617.773683,2663.355685,2733.850892,2827.190268,2941.014752,3072.955404,3220.861672,3382.956906,3557.85736,3650.601232 +19,3626.562289,3530.298634,3348.977308,3182.112961,3031.885368,2900.585698,2790.519562,2703.847804,2642.357447,2607.254571,2599.191732,2618.227173,2663.633044,2733.920445,2827.023018,2940.592074,3072.270335,3219.917633,3381.753554,3556.381476,3648.975447 +19.1,3626.890272,3530.66455,3349.333979,3182.434927,3032.162448,2900.8194,2790.713813,2704.001856,2642.463247,2607.292725,2599.125464,2618.016018,2663.243697,2733.320118,2826.182822,2939.494293,3070.909268,3218.297485,3379.873687,3554.229441,3646.673715 +19.2,3626.666433,3530.479701,3349.142297,3182.21041,3031.893599,2900.506088,2790.358793,2703.603424,2642.012594,2606.772633,2598.501635,2617.247504,2662.29606,2732.159593,2824.780733,2937.833781,3068.985748,3216.115604,3377.432329,3551.516842,3643.811939 +19.3,3626.194523,3530.047151,3348.704291,3181.740214,3031.378406,2899.94416,2789.751832,2702.949057,2641.301755,2605.990969,2597.617939,2616.220776,2661.091125,2730.742119,2823.122515,2935.918814,3066.810375,3213.684453,3374.743484,3548.558884,3640.70604 +19.4,3625.836183,3529.727722,3348.379477,3181.382249,3030.97311,2899.488218,2789.246035,2702.390716,2640.682126,2605.299298,2596.826821,2615.289744,2659.984782,2729.426077,2821.569353,2934.113419,3064.749819,3211.372876,3372.177826,3545.727634,3637.728907 +19.5,3625.862461,3529.791865,3348.437355,3181.404854,3030.944886,2899.404339,2789.106512,2702.192828,2640.417904,2604.960369,2596.390113,2614.71754,2659.241868,2728.478424,2820.390569,2932.689299,3063.077969,3209.456544,3370.012553,3543.301425,3635.159518 +19.6,3626.360584,3530.326551,3348.964382,3181.893809,3031.378781,2899.776788,2789.41669,2702.438009,2640.591035,2605.054815,2596.387301,2614.583463,2658.941653,2727.978675,2819.666116,2931.726928,3061.875788,3208.016757,3368.329359,3541.362277,3633.080078 +19.7,3627.215034,3531.216457,3349.84549,3182.734359,3032.160401,2900.491494,2790.062658,2703.012322,2641.087388,2605.468139,2596.703272,2614.771492,2658.967032,2727.808643,2819.276748,2931.106045,3061.022013,3206.931293,3367.005368,3539.786867,3631.366999 +19.8,3628.172031,3532.208323,3350.82828,3183.675246,3033.0398,2901.299855,2790.796978,2703.669228,2641.661006,2605.954587,2597.092002,2615.034825,2659.070038,2727.719029,2818.971713,2930.574406,3060.26289,3205.944962,3365.784321,3538.318159,3629.762746 +19.9,3628.95595,3533.027087,3351.638651,3184.443647,3033.745618,2901.931994,2791.351052,2704.141096,2642.044847,2606.247255,2597.286184,2615.10519,2658.981019,2727.438573,2818.477988,2929.857171,3059.321728,3204.779363,3364.386531,3536.675535,3627.986139 +20,3629.37942,3533.485735,3352.090191,3184.853965,3034.093184,2902.204178,2791.54192,2704.245498,2642.056752,2606.163943,2597.103198,2614.799171,2658.515488,2726.7816,2817.6086,2928.766015,3058.008791,3203.243465,3362.620021,3534.666342,3625.844136 +20.1,3629.40412,3533.546004,3352.144786,3184.868352,3034.044999,2902.079327,2791.332876,2703.946061,2641.660655,2605.668837,2596.507405,2614.081206,2657.637938,2725.712686,2816.328151,2927.265495,3056.288427,3201.301395,3360.448833,3532.254555,3623.300676 +20.2,3629.14065,3533.318253,3351.912437,3184.596429,3033.710326,2901.666451,2790.832755,2703.351576,2640.965506,2604.871258,2595.608697,2613.061976,2656.460065,2724.344738,2814.750793,2925.470932,3054.276892,3199.070229,3357.990791,3529.558527,3620.474418 +20.3,3628.792372,3533.005388,3351.595267,3184.239365,3033.289307,2901.164728,2790.239881,2702.659725,2640.168658,2603.968572,2594.604809,2611.93998,2655.181548,2722.878925,2813.079299,2923.586673,3052.179888,3196.756911,3355.453934,3526.787087,3617.574667 +20.4,3628.566671,3532.814331,3351.39939,3184.002275,3032.985967,2900.77717,2789.756388,2702.071994,2639.471281,2603.161973,2593.695452,2610.913864,2654.00227,2721.516672,2811.516746,2921.817404,3050.203497,3194.568827,3353.046777,3524.149558,3614.811224 +20.5,3628.595251,3532.876461,3351.455555,3184.015107,3032.929339,2900.631904,2789.509534,2701.714871,2638.999242,2602.576855,2593.004599,2610.106474,2653.045413,2720.381749,2810.187606,2920.288307,3048.473508,3192.632415,3350.896354,3521.773415,3612.31184 +20.6,3628.88785,3533.201456,3351.773287,3184.287213,3033.128563,2900.737884,2789.508092,2701.596947,2638.760949,2602.221392,2592.540151,2609.525511,2652.318628,2719.48182,2809.099558,2919.007027,3046.997451,3190.95522,3349.010262,3519.6663,3610.084182 +20.7,3629.340517,3533.685579,3352.249223,3184.715784,3033.481473,2900.99366,2789.651334,2701.618134,2638.656807,2601.996237,2592.202763,2609.071511,2651.722292,2718.717008,2808.152352,2917.872819,3045.674008,3189.435506,3347.286423,3517.725877,3608.025743 +20.8,3629.791284,3534.167176,3352.722252,3185.140466,3033.828554,2901.240596,2789.781441,2701.621258,2638.530021,2601.744594,2591.835262,2608.586707,2651.097914,2717.927923,2807.185549,2916.724077,3044.340391,3187.909543,3345.560331,3515.787097,3605.971146 +20.9,3630.088104,3534.494482,3353.041087,3185.410632,3034.01991,2901.329539,2789.749944,2701.458362,2638.232869,2601.318599,2591.289294,2607.92206,2650.295654,2716.963751,2806.047211,2915.407617,3042.842184,3186.221929,3343.67577,3513.693187,3603.763295 +21,3630.143854,3534.580543,3353.119093,3185.440136,3033.969961,2901.175535,2789.472541,2701.045725,2637.682056,2600.635132,2590.481706,2606.994337,2649.232184,2715.740943,2804.653432,2913.839023,3041.094436,3184.287324,3341.547054,3511.358238,3601.316137 +21.1,3629.964433,3534.431247,3352.962155,3185.234929,3033.684764,2900.784816,2788.955734,2700.390162,2636.88469,2599.701518,2589.420027,2605.811388,2647.915812,2714.268257,2803.013337,2912.027642,3039.106677,3182.115502,3339.184116,3508.792333,3598.639823 +21.2,3629.639288,3534.135843,3352.659178,3184.883513,3033.252405,2900.245102,2788.287026,2699.579098,2635.928229,2598.605329,2588.192104,2604.459583,2646.431698,2712.631785,2801.21392,2910.061249,3036.967422,3179.795704,3336.676765,3506.08572,3595.82484 +21.3,3629.300295,3533.825892,3352.341096,3184.51601,3032.802071,2899.684612,2787.593756,2698.739095,2634.938542,2597.471808,2586.92274,2603.062418,2644.902357,2710.954417,2799.37852,2908.063596,3034.800916,3177.452721,3334.150238,3503.364032,3592.99707 +21.4,3629.062301,3533.615964,3352.121917,3184.245704,3032.446223,2899.214973,2786.98684,2697.980494,2634.0255,2596.410477,2585.721328,2601.729493,2643.437917,2709.346979,2797.618684,2906.146911,3032.720116,3175.200233,3331.718804,3500.742002,3590.271515 +21.5,3628.979767,3533.560424,3352.055853,3184.126656,3032.238819,2898.890109,2786.520317,2697.357564,2633.243646,2595.476159,2584.643071,2600.516578,2642.094889,2707.866766,2795.992435,2904.369828,3030.784297,3173.098107,3329.442785,3498.280307,3587.709022 +21.6,3629.038112,3533.644696,3352.128299,3184.14425,3032.165236,2898.695389,2786.179605,2696.855771,2632.578392,2594.654081,2583.67297,2599.408517,2640.85803,2706.498435,2794.484257,2902.7166,3028.977592,3171.130404,3327.306179,3495.96293,3585.293557 +21.7,3629.165285,3533.796831,3352.267456,3184.226884,3032.154097,2898.55963,2785.893708,2696.404212,2631.958712,2593.872845,2582.73909,2598.332776,2639.654165,2705.168082,2793.0194,2901.111583,3027.223622,3169.220115,3325.231472,3493.712037,3582.947109 +21.8,3629.261511,3533.917255,3352.374115,3184.275879,3032.10736,2898.385466,2785.565965,2695.906861,2631.289,2593.036998,2581.745944,2597.193729,2638.387433,2703.779466,2791.501068,2899.457339,3025.424413,3167.26877,3323.119785,3491.428469,3580.570337 +21.9,3629.241877,3533.921241,3352.363935,3184.207457,3031.941964,2898.090634,2785.11499,2695.283196,2630.48944,2592.06724,2580.614638,2595.912841,2636.978219,2702.251747,2789.848371,2897.672799,3023.498761,3165.194984,3320.889566,3489.030551,3578.081454 +22,3629.072234,3533.77471,3352.202976,3183.987898,3031.624474,2897.641997,2784.507959,2694.500656,2629.527556,2590.930993,2579.312364,2594.457016,2635.390976,2700.54685,2788.022697,2895.718822,3021.407132,3162.958862,3318.500662,3486.477971,3575.440066 diff --git a/tests/data/currents_mdc/tension_c2/tension.dat b/tests/data/currents_mdc/tension_c2/tension.dat new file mode 100644 index 00000000..8b4c0d64 --- /dev/null +++ b/tests/data/currents_mdc/tension_c2/tension.dat @@ -0,0 +1,25 @@ +--------------------- MoorDyn Input File ------------------------------------ +Current tension parity deck (MoorDyn-C Currents 2): a time-varying cross-flow profile +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +22.0 TMax simulation length (s) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +300.0 TmaxIC max time for ic gen (s) +1.0e-12 threshIC convergence threshold for ic gen (-) +0 WaveKin MoorDyn-C water kinematics mode (-) +2 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/tension_c5/current_profile_4d.txt b/tests/data/currents_mdc/tension_c5/current_profile_4d.txt new file mode 100644 index 00000000..14e70669 --- /dev/null +++ b/tests/data/currents_mdc/tension_c5/current_profile_4d.txt @@ -0,0 +1,78 @@ +2 3 3 4 +-20.0 20.0 +-40.0 0.0 40.0 +-50.0 -25.0 0.0 +0.0 6.0 15.0 25.0 +x y z t ux uy uz +-20.0 -40.0 -50.0 0.0 0.000000 0.000000 0.0 +-20.0 -40.0 -25.0 0.0 0.000000 0.000000 0.0 +-20.0 -40.0 0.0 0.0 0.000000 0.000000 0.0 +-20.0 0.0 -50.0 0.0 0.000000 0.000000 0.0 +-20.0 0.0 -25.0 0.0 0.000000 0.000000 0.0 +-20.0 0.0 0.0 0.0 0.000000 0.000000 0.0 +-20.0 40.0 -50.0 0.0 0.000000 0.000000 0.0 +-20.0 40.0 -25.0 0.0 0.000000 0.000000 0.0 +-20.0 40.0 0.0 0.0 0.000000 0.000000 0.0 +20.0 -40.0 -50.0 0.0 0.000000 0.000000 0.0 +20.0 -40.0 -25.0 0.0 0.000000 0.000000 0.0 +20.0 -40.0 0.0 0.0 0.000000 0.000000 0.0 +20.0 0.0 -50.0 0.0 0.000000 0.000000 0.0 +20.0 0.0 -25.0 0.0 0.000000 0.000000 0.0 +20.0 0.0 0.0 0.0 0.000000 0.000000 0.0 +20.0 40.0 -50.0 0.0 0.000000 0.000000 0.0 +20.0 40.0 -25.0 0.0 0.000000 0.000000 0.0 +20.0 40.0 0.0 0.0 0.000000 0.000000 0.0 +-20.0 -40.0 -50.0 6.0 0.235200 0.000000 0.0 +-20.0 -40.0 -25.0 6.0 0.285600 0.035000 0.0 +-20.0 -40.0 0.0 6.0 0.336000 0.070000 0.0 +-20.0 0.0 -50.0 6.0 0.352800 0.000000 0.0 +-20.0 0.0 -25.0 6.0 0.428400 0.035000 0.0 +-20.0 0.0 0.0 6.0 0.504000 0.070000 0.0 +-20.0 40.0 -50.0 6.0 0.470400 0.000000 0.0 +-20.0 40.0 -25.0 6.0 0.571200 0.035000 0.0 +-20.0 40.0 0.0 6.0 0.672000 0.070000 0.0 +20.0 -40.0 -50.0 6.0 0.254800 0.000000 0.0 +20.0 -40.0 -25.0 6.0 0.309400 0.035000 0.0 +20.0 -40.0 0.0 6.0 0.364000 0.070000 0.0 +20.0 0.0 -50.0 6.0 0.382200 0.000000 0.0 +20.0 0.0 -25.0 6.0 0.464100 0.035000 0.0 +20.0 0.0 0.0 6.0 0.546000 0.070000 0.0 +20.0 40.0 -50.0 6.0 0.509600 0.000000 0.0 +20.0 40.0 -25.0 6.0 0.618800 0.035000 0.0 +20.0 40.0 0.0 6.0 0.728000 0.070000 0.0 +-20.0 -40.0 -50.0 15.0 0.369600 0.000000 0.0 +-20.0 -40.0 -25.0 15.0 0.448800 0.055000 0.0 +-20.0 -40.0 0.0 15.0 0.528000 0.110000 0.0 +-20.0 0.0 -50.0 15.0 0.554400 0.000000 0.0 +-20.0 0.0 -25.0 15.0 0.673200 0.055000 0.0 +-20.0 0.0 0.0 15.0 0.792000 0.110000 0.0 +-20.0 40.0 -50.0 15.0 0.739200 0.000000 0.0 +-20.0 40.0 -25.0 15.0 0.897600 0.055000 0.0 +-20.0 40.0 0.0 15.0 1.056000 0.110000 0.0 +20.0 -40.0 -50.0 15.0 0.400400 0.000000 0.0 +20.0 -40.0 -25.0 15.0 0.486200 0.055000 0.0 +20.0 -40.0 0.0 15.0 0.572000 0.110000 0.0 +20.0 0.0 -50.0 15.0 0.600600 0.000000 0.0 +20.0 0.0 -25.0 15.0 0.729300 0.055000 0.0 +20.0 0.0 0.0 15.0 0.858000 0.110000 0.0 +20.0 40.0 -50.0 15.0 0.800800 0.000000 0.0 +20.0 40.0 -25.0 15.0 0.972400 0.055000 0.0 +20.0 40.0 0.0 15.0 1.144000 0.110000 0.0 +-20.0 -40.0 -50.0 25.0 0.168000 0.000000 0.0 +-20.0 -40.0 -25.0 25.0 0.204000 0.025000 0.0 +-20.0 -40.0 0.0 25.0 0.240000 0.050000 0.0 +-20.0 0.0 -50.0 25.0 0.252000 0.000000 0.0 +-20.0 0.0 -25.0 25.0 0.306000 0.025000 0.0 +-20.0 0.0 0.0 25.0 0.360000 0.050000 0.0 +-20.0 40.0 -50.0 25.0 0.336000 0.000000 0.0 +-20.0 40.0 -25.0 25.0 0.408000 0.025000 0.0 +-20.0 40.0 0.0 25.0 0.480000 0.050000 0.0 +20.0 -40.0 -50.0 25.0 0.182000 0.000000 0.0 +20.0 -40.0 -25.0 25.0 0.221000 0.025000 0.0 +20.0 -40.0 0.0 25.0 0.260000 0.050000 0.0 +20.0 0.0 -50.0 25.0 0.273000 0.000000 0.0 +20.0 0.0 -25.0 25.0 0.331500 0.025000 0.0 +20.0 0.0 0.0 25.0 0.390000 0.050000 0.0 +20.0 40.0 -50.0 25.0 0.364000 0.000000 0.0 +20.0 40.0 -25.0 25.0 0.442000 0.025000 0.0 +20.0 40.0 0.0 25.0 0.520000 0.050000 0.0 diff --git a/tests/data/currents_mdc/tension_c5/ref_moordyn_c_tension.csv b/tests/data/currents_mdc/tension_c5/ref_moordyn_c_tension.csv new file mode 100644 index 00000000..2d4d68e9 --- /dev/null +++ b/tests/data/currents_mdc/tension_c5/ref_moordyn_c_tension.csv @@ -0,0 +1,222 @@ +t,T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20 +0,3347.400371,3253.367737,3073.059491,2904.689961,2750.454325,2612.856668,2494.649244,2398.695686,2327.743491,2284.117533,2269.389762,2284.117594,2327.743605,2398.695849,2494.64943,2612.856879,2750.454526,2904.690164,3073.059662,3253.3679,3347.400507 +0.1,3347.401104,3253.368518,3073.060324,2904.690813,2750.455137,2612.85741,2494.649871,2398.696185,2327.74385,2284.117762,2269.389881,2284.11763,2327.743588,2398.6958,2494.649372,2612.856815,2750.454474,2904.690118,3073.059646,3253.367917,3347.400557 +0.2,3347.406887,3253.374384,3073.066253,2904.696589,2750.46055,2612.862269,2494.654019,2398.699517,2327.746317,2284.119375,2269.390698,2284.117744,2327.743104,2398.694823,2494.647995,2612.85512,2750.452534,2904.688012,3073.057465,3253.365772,3347.398458 +0.3,3347.421066,3253.388658,3073.080526,2904.710434,2750.473555,2612.87406,2494.66429,2398.708052,2327.75301,2284.124225,2269.393797,2284.119245,2327.743194,2398.693694,2494.645833,2612.852096,2750.448819,2904.683789,3073.052949,3253.361214,3347.393939 +0.4,3347.442691,3253.410416,3073.102317,2904.731683,2750.493703,2612.892605,2494.680819,2398.72228,2327.764802,2284.133595,2269.400882,2284.12427,2327.746424,2398.695402,2494.646269,2612.851491,2750.447393,2904.681778,3073.050624,3253.358893,3347.39169 +0.5,3347.471928,3253.439828,3073.131839,2904.760622,2750.521381,2612.918408,2494.704248,2398.742997,2327.782651,2284.148611,2269.413253,2284.13429,2327.754438,2398.70175,2494.651263,2612.855403,2750.450478,2904.684303,3073.052894,3253.361265,3347.394179 +0.6,3347.511208,3253.479283,3073.171394,2904.79942,2750.558579,2612.953244,2494.736102,2398.771446,2327.807505,2284.16991,2269.431231,2284.149313,2327.766933,2398.712145,2494.659949,2612.862728,2750.456765,2904.68989,3073.058168,3253.366667,3347.399713 +0.7,3347.560126,3253.528349,3073.220533,2904.847613,2750.604817,2612.996613,2494.775859,2398.807081,2327.838785,2284.196876,2269.454158,2284.168635,2327.783159,2398.72579,2494.671486,2612.872582,2750.465337,2904.697597,3073.065489,3253.374135,3347.407315 +0.8,3347.615493,3253.583843,3073.276131,2904.902192,2750.657245,2613.045869,2494.821107,2398.847752,2327.874619,2284.227926,2269.48074,2284.191246,2327.802384,2398.742213,2494.685645,2612.884956,2750.476376,2904.707769,3073.075326,3253.384213,3347.417547 +0.9,3347.675909,3253.644334,3073.33674,2904.961706,2750.71443,2613.0996,2494.870467,2398.892112,2327.913695,2284.26178,2269.509727,2284.215925,2327.823405,2398.760232,2494.701261,2612.898703,2750.488751,2904.719291,3073.08658,3253.395815,3347.429318 +1,3347.742221,3253.710615,3073.403064,2905.026758,2750.77685,2613.158148,2494.924128,2398.940186,2327.955864,2284.298107,2269.540603,2284.241965,2327.845335,2398.778784,2494.717109,2612.912452,2750.500973,2904.730582,3073.097611,3253.407261,3347.440925 +1.1,3347.81513,3253.78334,3073.475711,2905.097925,2750.84507,2613.222079,2494.982664,2398.992571,2328.001749,2284.337562,2269.574056,2284.270095,2327.868943,2398.79868,2494.734045,2612.927107,2750.513991,2904.742636,3073.109451,3253.419608,3347.453427 +1.2,3347.89593,3253.863761,3073.555901,2905.176434,2750.920352,2613.292718,2495.047497,2399.050798,2328.053012,2284.381952,2269.612052,2284.302445,2327.896527,2398.822388,2494.7547,2612.945454,2750.530734,2904.758509,3073.125261,3253.436078,3347.470059 +1.3,3347.988239,3253.955428,3073.647094,2905.265649,2751.005978,2613.373267,2495.121751,2399.117927,2328.112655,2284.43423,2269.657502,2284.341895,2327.930947,2398.852759,2494.78193,2612.970362,2750.554094,2904.781118,3073.147987,3253.45963,3347.493783 +1.4,3348.096524,3254.062732,3073.753561,2905.369718,2751.10596,2613.467605,2495.209172,2399.19757,2328.184161,2284.497757,2269.713656,2284.391598,2327.975275,2398.892796,2494.818682,2613.00474,2750.586956,2904.813346,3073.180514,3253.493149,3347.527479 +1.5,3348.223957,3254.188778,3073.87833,2905.491601,2751.223211,2613.578614,2495.312627,2399.292596,2328.270418,2284.575452,2269.783479,2284.454573,2328.032591,2398.945652,2494.868191,2613.051904,2750.632719,2904.858668,3073.226385,3253.54021,3347.574732 +1.6,3348.372796,3254.335762,3074.02353,2905.633367,2751.359769,2613.708323,2495.434157,2399.405077,2328.373539,2284.669487,2269.869208,2284.533137,2328.105301,2399.013826,2494.933048,2613.114543,2750.694167,2904.919956,3073.288541,3253.603787,3347.638528 +1.7,3348.545259,3254.505834,3074.191213,2905.796971,2751.517491,2613.8585,2495.575449,2399.536624,2328.495071,2284.781348,2269.972279,2284.628678,2328.194756,2399.098639,2495.014557,2613.193952,2750.772597,2904.99852,3073.368307,3253.685204,3347.720188 +1.8,3348.743014,3254.700595,3074.382892,2905.98382,2751.697693,2614.030374,2495.737654,2399.688318,2328.636029,2284.911988,2270.093589,2284.742045,2328.30176,2399.200863,2495.113464,2613.290864,2750.86874,2905.095099,3073.466431,3253.785197,3347.820447 +1.9,3348.967073,3254.921002,3074.599462,2906.194749,2751.901164,2614.224714,2495.921535,2399.86093,2328.797203,2285.062228,2270.233996,2284.874139,2328.427263,2399.321498,2495.230828,2613.406396,2750.983774,2905.21093,3073.584192,3253.905059,3347.940603 +2,3349.219035,3255.168601,3074.842406,2906.431171,2752.129266,2614.442843,2496.128394,2400.055757,2328.979895,2285.233386,2270.394839,2285.026329,2328.572671,2399.461994,2495.368144,2613.542097,2751.119304,2905.347672,3073.723288,3254.046495,3348.082369 +2.1,3349.5018,3255.446237,3075.114493,2906.695752,2752.384566,2614.687239,2496.360629,2400.275121,2329.186364,2285.427663,2270.578274,2285.200733,2328.740074,2399.624423,2495.52748,2613.700039,2751.277419,2905.507434,3073.885843,3254.211622,3348.247862 +2.2,3349.81902,3255.757511,3075.419249,2906.991925,2752.670406,2614.961162,2496.621425,2400.522148,2329.419684,2285.648093,2270.787305,2285.400339,2328.932456,2399.811776,2495.711845,2613.883261,2751.461193,2905.693333,3074.074994,3254.403579,3348.440226 +2.3,3350.174619,3256.106304,3075.760501,2907.32344,2752.990468,2615.268241,2496.914376,2400.800405,2329.683415,2285.898241,2271.025518,2285.628764,2329.153478,2400.027771,2495.925022,2614.095618,2751.674557,2905.909365,3074.294785,3254.626421,3348.663526 +2.4,3350.572779,3256.496755,3076.14233,2907.694298,2753.348675,2615.61233,2497.243278,2401.11365,2329.981281,2286.181817,2271.296618,2285.889725,2329.40688,2400.276183,2496.170831,2614.340983,2751.921444,2906.159519,3074.549235,3254.884175,3348.921799 +2.5,3351.017507,3256.932835,3076.568647,2908.108322,2753.748759,2615.997077,2497.611703,2401.465382,2330.316726,2286.502215,2271.603964,2286.186555,2329.695985,2400.560335,2496.452609,2614.622718,2752.205248,2906.447219,3074.84178,3255.180278,3349.218485 +2.6,3351.511951,3257.417656,3077.042522,2908.568514,2754.193652,2616.425352,2498.022468,2401.85838,2330.692496,2286.86216,2271.950268,2286.521965,2330.023509,2400.882961,2496.773118,2614.943622,2752.528809,2906.775341,3075.175311,3255.517617,3349.556478 +2.7,3352.058357,3257.953439,3077.566147,2909.077018,2754.685448,2616.899212,2498.477605,2402.29466,2331.110603,2287.263666,2272.337557,2286.898001,2330.391527,2401.246171,2497.134507,2615.30589,2752.894372,2907.14617,3075.552126,3255.898497,3349.938086 +2.8,3352.658584,3258.542019,3078.141331,2909.635595,2755.225856,2617.420323,2498.978747,2402.775826,2331.572632,2287.708309,2272.767399,2287.316229,2330.80161,2401.651546,2497.538379,2615.711153,2753.303597,2907.561387,3075.973911,3256.324598,3350.364993 +2.9,3353.314453,3259.185193,3078.769855,2910.245979,2755.816559,2617.990317,2499.527482,2403.303436,2332.08011,2288.19759,2273.241277,2287.77812,2331.25522,2402.10055,2497.986204,2616.160895,2753.757989,2908.022509,3076.442172,3256.797421,3350.838703 +3,3354.027948,3259.884923,3079.453673,2910.910091,2756.459433,2618.611038,2500.125629,2403.879286,2332.634823,2288.733289,2273.760971,2288.28546,2331.754156,2402.594998,2498.479822,2616.656989,2754.259452,2908.531458,3076.958833,3257.318889,3351.361141 +3.1,3354.801514,3260.643636,3080.195215,2911.630332,2757.156844,2619.284822,2500.7755,2404.505676,2333.239065,2289.317702,2274.328785,2288.840567,2332.300757,2403.137261,2499.021641,2617.201883,2754.810475,2909.09075,3077.526412,3257.891524,3351.934838 +3.2,3355.638208,3261.464367,3080.997524,2912.409713,2757.911762,2620.014596,2501.47999,2405.185474,2333.895683,2289.953663,2274.947548,2289.446272,2332.897866,2403.730199,2499.61455,2617.798503,2755.414018,2909.703359,3078.147886,3258.518306,3352.562776 +3.3,3356.541391,3262.350457,3081.863958,2913.251566,2758.727473,2620.803608,2502.242311,2405.92186,2334.607835,2290.644315,2275.620395,2290.105713,2333.54863,2404.376978,2500.261742,2618.450074,2756.073335,2910.372556,3078.826523,3259.202509,3353.248237 +3.4,3357.514269,3263.305097,3082.797738,2914.159091,2759.607151,2621.655,2503.065581,2406.717939,2335.378616,2291.392752,2276.350425,2290.822,2334.256179,2405.080759,2500.966414,2619.159835,2756.791703,2911.101633,3079.565621,3259.947434,3353.99453 +3.5,3358.559614,3264.331045,3083.801663,2915.135081,2760.553566,2622.571522,2503.952536,2407.576435,2336.210746,2292.201694,2277.140367,2291.597877,2335.02328,2405.844335,2501.731393,2619.930652,2757.572018,2911.893497,3080.368087,3260.755994,3354.804574 +3.6,3359.679618,3265.430482,3084.877969,2916.181769,2761.568933,2623.55537,2504.905355,2408.499518,2337.10639,2293.073304,2277.992386,2292.435514,2335.852112,2406.669902,2502.558899,2620.764766,2758.416539,2912.750405,3081.236171,3261.630438,3355.680624 +3.7,3360.875844,3266.604963,3086.028276,2917.300781,2762.654872,2624.608152,2505.925641,2409.488786,2338.067145,2294.009182,2278.908084,2293.33652,2336.744293,2407.559091,2503.450579,2621.663847,2759.326941,2913.674024,3082.171533,3262.572421,3356.624336 +3.8,3362.149392,3267.855588,3087.253758,2918.49331,2763.812576,2625.731061,2507.014591,2410.545445,2339.094226,2295.010553,2279.888699,2294.302144,2337.701088,2408.513183,2504.407735,2622.629212,2760.304553,2914.665671,3083.17548,3263.583246,3357.637017 +3.9,3363.501274,3269.183369,3088.555512,2919.760476,2765.043171,2626.925224,2508.173335,2411.670632,2340.18878,2296.078575,2280.935401,2295.333569,2338.723689,2409.533387,2505.431593,2623.662105,2761.350619,2915.726576,3084.249232,3264.664126,3358.719884 +4,3364.932738,3270.589557,3089.934879,2921.103647,2766.34803,2628.19201,2509.403243,2412.86572,2341.352185,2297.214633,2282.049579,2296.43219,2339.813503,2410.621119,2506.523584,2624.763968,2762.466578,2916.858163,3085.394203,3265.816469,3359.874348 +4.1,3366.445411,3272.075787,3091.393583,2922.52458,2767.728911,2629.533177,2510.706071,2414.132467,2342.586204,2298.420495,2283.23301,2297.599794,2340.972327,2411.778194,2507.68554,2625.936648,2763.654277,2918.062263,3086.612219,3267.042095,3361.102231 +4.2,3368.041285,3273.644059,3092.933725,2924.025409,2769.187959,2630.950862,2512.083957,2415.473015,2343.892984,2299.698315,2284.487859,2298.838559,2342.202356,2413.006826,2508.919699,2627.1824,2764.915972,2919.341122,3087.905524,3268.343243,3362.40578 +4.3,3369.722586,3275.296614,3094.557642,2925.608516,2770.727557,2632.447447,2513.539275,2416.889736,2345.2749,2301.050475,2285.816515,2300.150885,2343.506006,2414.309452,2510.228518,2628.503696,2766.254135,2920.697201,3089.276577,3269.722371,3363.787455 +4.4,3371.491519,3277.035674,3096.267661,2927.276273,2772.350085,2634.025303,2515.074393,2418.384996,2346.734316,2302.479342,2287.22135,2301.539152,2344.885669,2415.688478,2511.614422,2629.902974,2767.671196,2922.132919,3090.727795,3271.181889,3365.249674 +4.5,3373.35,3278.863177,3098.065832,2929.030783,2774.057657,2635.686545,2516.691421,2419.960904,2348.273347,2303.987034,2288.704489,2303.005496,2346.343491,2417.146067,2513.079591,2631.382418,2769.169329,2923.650437,3092.261334,3272.723949,3366.794592 +4.6,3375.299532,3280.780652,3099.953798,2930.873754,2775.852,2637.432901,2518.392088,2421.619194,2349.893731,2305.575297,2290.267688,2304.551679,2347.881247,2418.684007,2514.625823,2632.943829,2770.750321,2925.251525,3093.878959,3274.35031,3368.423973 +4.7,3377.34124,3282.789258,3101.932841,2932.806537,2777.734487,2639.265751,2520.177775,2423.361251,2351.59686,2307.24553,2291.912349,2306.179112,2349.500355,2420.303724,2516.254551,2634.588636,2772.415578,2926.937572,3095.58205,3276.062343,3370.139192 +4.8,3379.476034,3284.88994,3104.004035,2934.83028,2779.706295,2641.186279,2522.049669,2425.188267,2353.38393,2308.998936,2293.639682,2307.889008,2351.202033,2422.006441,2517.967,2636.318051,2774.166288,2928.709746,3097.371764,3277.861196,3371.941402 +4.9,3381.704817,3287.083643,3106.16846,2936.946144,2781.768617,2643.195687,2524.008976,2427.101452,2355.256161,2310.836737,2295.450915,2309.682601,2352.98752,2423.793405,2519.76442,2638.133313,2776.003663,2930.569241,3099.249284,3279.748045,3373.831782 +5,3384.028702,3289.371524,3108.427417,2939.155512,2783.922872,2645.295405,2526.057126,2429.10224,2357.214989,2312.760379,2297.347499,2311.561346,2354.85828,2425.666085,2521.648281,2640.035878,2777.929136,2932.517475,3101.216018,3281.724292,3375.811743 +5.1,3386.449126,3291.755069,3110.782541,2941.460107,2786.170821,2647.487202,2528.195887,2431.192398,2359.262183,2314.771632,2299.331208,2313.527026,2356.816099,2427.626277,2523.620381,2642.027532,2779.944468,2934.556197,3103.273708,3283.791676,3377.883029 +5.2,3388.96782,3294.236063,3113.235774,2943.861958,2788.514533,2649.773158,2530.427338,2433.374001,2361.399819,2316.872573,2301.404121,2315.581722,2358.86307,2429.67608,2525.682821,2644.110362,2782.051729,2936.687467,3105.424407,3285.952249,3380.047702 +5.3,3391.586656,3296.816435,3115.789217,2946.363254,2790.956248,2652.155526,2532.753726,2435.649293,2363.630139,2319.065449,2303.568489,2317.727693,2361.001458,2431.81777,2527.837879,2646.286635,2784.253163,2938.913523,3107.670348,3288.208246,3382.308006 +5.4,3394.307454,3299.498069,3118.444933,2948.96616,2793.498183,2654.636537,2535.177286,2438.020506,2365.955376,2321.352489,2305.826548,2319.967179,2363.233512,2434.053605,2530.087814,2648.558592,2786.550996,2941.236584,3110.013746,3290.561881,3384.666169 +5.5,3397.131813,3302.282634,3121.204787,2951.672637,2796.142364,2657.21824,2537.700068,2440.489689,2368.377578,2323.735749,2308.180353,2322.302241,2365.561302,2436.385659,2532.434696,2650.928284,2788.947259,2943.658673,3112.456617,3293.015175,3387.12422 +5.6,3400.06108,3305.171505,3124.070319,2954.484349,2798.89053,2659.902409,2540.323856,2443.058628,2370.898536,2326.217019,2310.6317,2324.734682,2367.986634,2438.815743,2534.880327,2653.397491,2791.443708,2946.181537,3115.000699,3295.569867,3389.683915 +5.7,3403.097656,3308.16639,3127.042678,2957.402549,2801.744016,2662.690426,2543.050063,2445.728759,2373.519705,2328.79778,2313.18209,2327.266019,2370.511045,2441.345403,2537.426249,2655.967733,2794.041849,2948.806672,3117.647483,3298.227452,3392.346759 +5.8,3406.243279,3311.268741,3130.123176,2960.428665,2804.70432,2665.583807,2545.880191,2448.501558,2376.242539,2331.479459,2315.832929,2329.897641,2373.135906,2443.975996,2540.073794,2658.640308,2796.742951,2951.535335,3120.398216,3300.989179,3395.114017 +5.9,3409.4992,3314.479709,3133.313021,2963.564037,2807.772879,2668.584049,2548.815767,2451.378569,2379.068592,2334.26362,2318.585788,2332.631121,2375.862788,2446.709081,2542.824493,2661.416703,2799.548467,2954.368951,3123.254306,3303.856457,3397.987109 +6,3412.866756,3317.800523,3136.613495,2966.810086,2810.951218,2671.69274,2551.858415,2454.361437,2381.99953,2337.151953,2321.44238,2335.4682,2378.693464,2449.546452,2545.680146,2664.298716,2802.4602,2957.309333,3126.217574,3306.831121,3400.967891 +6.1,3415.831083,3320.72816,3139.56103,2969.764473,2813.903143,2674.636865,2554.79158,2457.28183,2384.906806,2340.047752,2324.330636,2338.354992,2381.586417,2452.453673,2548.608519,2667.251876,2805.437569,2960.306625,3129.226701,3309.839726,3403.976885 +6.2,3417.566982,3322.438149,3141.318523,2971.566916,2815.750982,2676.53391,2556.742538,2459.29092,2386.977516,2342.18325,2326.534209,2340.630155,2383.936625,2454.881491,2551.114092,2669.831077,2808.08134,2963.001619,3131.955222,3312.579462,3406.720388 +6.3,3418.207866,3323.057009,3141.990404,2972.287562,2816.518524,2677.350032,2557.609613,2460.210397,2387.949602,2343.207445,2327.610061,2341.757771,2385.116758,2456.114995,2552.400499,2671.166823,2809.459182,2964.411122,3133.382403,3314.006481,3408.146249 +6.4,3418.000288,3322.827612,3141.807908,2972.140862,2816.39833,2677.251548,2557.529379,2460.144497,2387.893218,2343.155426,2327.55789,2341.702409,2385.057104,2456.05164,2552.334488,2671.098026,2809.385818,2964.330046,3133.288418,3313.891954,3408.022491 +6.5,3416.915414,3321.726523,3140.762752,2971.145142,2815.445504,2676.339495,2556.656785,2459.308795,2387.089953,2342.378804,2326.801909,2340.961953,2384.328657,2455.333196,2551.624405,2670.39353,2808.682717,2963.622949,3132.569987,3313.152859,3407.273432 +6.6,3415.56397,3320.36389,3139.464196,2969.910323,2814.272091,2675.229408,2555.612447,2458.330875,2386.176536,2341.525839,2326.004345,2340.214865,2383.627939,2454.6754,2551.005499,2669.807454,2808.121253,2963.07593,3132.02462,3312.594285,3406.707216 +6.7,3415.005112,3319.792111,3138.946559,2969.443287,2813.8492,2674.848903,2555.274237,2458.034265,2385.91927,2341.304393,2325.81491,2340.054298,2383.494246,2454.567337,2550.921152,2669.742822,2808.070218,2963.030377,3131.973774,3312.525814,3406.629663 +6.8,3415.662197,3320.433146,3139.628951,2970.159543,2814.587954,2675.604107,2556.043008,2458.814663,2386.709219,2342.10176,2326.618233,2340.863443,2384.310526,2455.392749,2551.756695,2670.587068,2808.91936,2963.878274,3132.811371,3313.342913,3407.437042 +6.9,3417.247133,3322.002606,3141.237705,2971.803277,2816.256886,2677.293547,2557.752014,2460.543806,2388.459355,2343.873914,2328.414097,2342.685762,2386.162884,2457.278429,2553.676735,2672.53883,2810.896677,2965.871485,3134.806993,3315.326279,3409.413989 +7,3419.42101,3324.16153,3143.433439,2974.03446,2818.515132,2679.575118,2560.057361,2462.875317,2390.819996,2346.266924,2330.843334,2345.155916,2388.679031,2459.844629,2556.293914,2675.203397,2813.600749,2968.602876,3137.549139,3318.061699,3412.145193 +7.1,3421.814245,3326.538374,3145.838562,2976.465397,2820.961179,2682.029852,2562.519182,2465.345215,2393.300092,2348.760048,2333.353294,2347.687692,2391.238299,2462.436286,2558.919941,2677.86162,2816.285099,2971.303264,3140.251532,3320.752185,3414.829665 +7.2,3423.817772,3328.5257,3147.849785,2978.499062,2823.006388,2684.079065,2564.569776,2467.397219,2395.354633,2350.818857,2335.418995,2349.764136,2393.330213,2464.547886,2561.052907,2680.014059,2818.451841,2973.475617,3142.41755,3322.90125,3416.970722 +7.3,3424.972576,3329.666888,3149.017436,2979.696559,2824.226436,2685.316146,2565.822723,2468.666855,2396.642133,2352.125198,2336.745347,2351.112405,2394.702927,2465.946957,2562.4778,2681.460996,2819.914135,2974.943345,3143.878113,3324.344424,3418.405397 +7.4,3425.381758,3330.06375,3149.440925,2980.152858,2824.710399,2685.823004,2566.351581,2469.218398,2397.216928,2352.723111,2337.365987,2351.755858,2395.369835,2466.637445,2563.189834,2682.189833,2820.652666,2975.681715,3144.60458,3325.050739,3419.101973 +7.5,3425.486171,3330.154838,3149.554344,2980.294086,2824.873918,2686.002962,2566.54562,2469.425894,2397.437277,2352.955069,2337.608109,2352.007291,2395.630477,2466.906931,2563.466046,2682.468571,2820.927964,2975.94543,3144.847607,3325.268537,3419.3082 +7.6,3425.709162,3330.363266,3149.782394,2980.547161,2825.147122,2686.29038,2566.844473,2469.735413,2397.756991,2353.284055,2337.945304,2352.352207,2395.983262,2467.267271,2563.831739,2682.835338,2821.289749,2976.29403,3145.174366,3325.569952,3419.59824 +7.7,3426.429251,3331.067423,3150.505086,2981.294378,2825.915555,2687.075028,2567.643145,2470.548292,2398.584952,2354.127784,2338.805415,2353.229733,2396.879477,2468.182372,2564.763391,2683.778587,2822.237275,2977.235924,3146.100381,3326.475106,3420.494081 +7.8,3427.935085,3332.554562,3152.00708,2982.815815,2827.453127,2688.623318,2569.199465,2472.113043,2400.159984,2355.715392,2340.408206,2354.850818,2398.521966,2469.847789,2566.450165,2685.48203,2823.949773,2978.946893,3147.799088,3328.156072,3422.167444 +7.9,3430.199529,3334.797096,3154.259892,2985.081117,2829.726864,2690.899,2571.473254,2474.384941,2402.432284,2357.991555,2342.692488,2357.148178,2400.837252,2472.183915,2568.806589,2687.854787,2826.331604,2981.327411,3150.168133,3330.508691,3424.513496 +8,3432.853768,3337.427544,3156.899281,2987.730883,2832.383749,2693.556774,2574.127832,2477.036413,2405.083442,2360.646701,2345.356893,2359.827785,2403.53765,2474.908389,2571.554659,2690.622318,2829.110882,2984.107564,3152.93898,3333.265117,3427.264451 +8.1,3435.449786,3339.999016,3159.480585,2990.323747,2834.986521,2696.164274,2576.736238,2479.645886,2407.696864,2363.268463,2347.992276,2362.482565,2406.217001,2477.614935,2574.287186,2693.375991,2831.877283,2986.875394,3155.698313,3336.010983,3430.005326 +8.2,3437.664186,3342.188225,3161.679989,2992.534912,2837.208581,2698.392578,2578.966815,2481.878156,2409.932848,2365.511604,2350.24681,2364.753117,2408.50753,2479.926911,2576.618576,2695.721602,2834.228785,2989.222313,3158.032555,3338.329437,3432.317903 +8.3,3439.335279,3343.833677,3163.336152,2994.203378,2838.889208,2700.081273,2580.659373,2483.573019,2411.630834,2367.214786,2351.957912,2366.475152,2410.242812,2481.675446,2578.37735,2697.485067,2835.988882,2990.969787,3159.761639,3340.03936,3434.020581 +8.4,3440.507934,3344.980519,3164.495191,2995.377141,2840.078862,2701.283954,2581.87125,2484.792061,2412.857086,2368.449325,2353.202264,2367.730922,2411.510754,2482.954027,2579.662349,2698.770164,2837.265721,2992.229664,3161.000247,3341.257184,3435.230425 +8.5,3441.462338,3345.90836,3165.435826,2996.333909,2841.05388,2702.275457,2582.875813,2485.807357,2413.882753,2369.485991,2354.25093,2368.792515,2412.585135,2484.038678,2580.752208,2699.85828,2838.343388,2993.288516,3162.036978,3342.272844,3436.237968 +8.6,3442.584797,3347.002417,3166.541129,2997.453762,2842.190316,2703.4271,2584.039222,2486.979779,2415.063618,2370.675992,2355.451319,2370.004453,2413.808538,2485.270921,2581.988122,2701.090826,2839.563888,2994.489181,3163.215498,3343.430621,3437.387883 +8.7,3444.166074,3348.552919,3168.100515,2999.025199,2843.775471,2705.024769,2585.646028,2488.592896,2416.682667,2372.3023,2357.08708,2371.6518,2415.468117,2486.940549,2583.662882,2702.763706,2841.226159,2996.133368,3164.839725,3345.035872,3438.986168 +8.8,3446.306394,3350.660134,3170.21449,3001.14941,2845.911447,2707.171655,2587.800869,2490.753264,2418.848704,2374.476293,2359.272486,2373.851999,2417.684694,2489.171876,2585.904274,2705.00801,2843.464318,2998.35783,3167.048417,3347.228592,3441.173295 +8.9,3448.921186,3353.23963,3172.798526,3003.741873,2848.513671,2709.783091,2590.418953,2493.375851,2421.476245,2377.111778,2361.920339,2376.516565,2420.368254,2491.873197,2588.618841,2707.728576,2846.181692,3001.064676,3169.742711,3349.909219,3443.849394 +9,3451.77363,3356.054937,3175.616198,3006.566323,2851.346009,2712.622991,2593.264105,2496.224107,2424.327889,2379.969878,2364.789599,2379.401598,2423.27143,2494.793258,2591.551247,2710.66604,2849.115242,3003.987765,3172.654004,3352.807471,3446.743445 +9.1,3454.556183,3358.79923,3178.361611,3009.318425,2854.106168,2715.391435,2596.038986,2499.003218,2427.111003,2382.759568,2367.590091,2382.21695,2426.103314,2497.639738,2594.407294,2713.524101,2851.966608,3006.82691,3175.480549,3355.620468,3449.551999 +9.2,3457.029645,3361.233889,3180.796952,3011.761757,2856.559589,2717.856042,2598.513612,2501.485627,2429.600245,2385.257297,2370.099496,2384.740897,2428.642164,2500.190364,2596.963797,2716.078445,2854.510341,3009.355624,3177.994925,3358.120079,3452.046545 +9.3,3459.125966,3363.290905,3182.854047,3013.828016,2858.637833,2719.948149,2600.618922,2503.601792,2431.72556,2387.392288,2372.246072,2386.900502,2430.813663,2502.369331,2599.143425,2718.250286,2856.666401,3011.492839,3180.115201,3360.223786,3454.144324 +9.4,3460.950821,3365.075634,3184.637674,3015.621219,2860.443996,2721.769744,2602.455684,2505.451293,2433.585483,2389.262168,2374.126732,2388.792187,2432.713983,2504.272796,2601.042509,2720.136287,2858.531921,3013.336175,3181.939345,3362.029804,3455.943694 +9.5,3462.722199,3366.805649,3186.364976,3017.357988,2862.194148,2723.536299,2604.238877,2507.248879,2435.394897,2391.082411,2375.958051,2390.634165,2434.563483,2506.123664,2602.88674,2721.965,2860.338234,3015.119407,3183.70299,3363.774994,3457.68208 +9.6,3464.688858,3368.729199,3188.283636,3019.285218,2864.13427,2725.492765,2606.212483,2509.237796,2437.396699,2393.096053,2377.983784,2392.671516,2436.609149,2508.17131,2604.928185,2723.991316,2862.343013,3017.102658,3185.668135,3365.722618,3459.623332 +9.7,3467.035838,3371.030857,3190.57757,3021.585803,2866.445999,2727.819296,2608.555093,2511.595168,2439.766741,2395.477965,2380.378184,2395.07829,2439.025255,2510.590618,2607.342628,2726.392137,2864.724385,3019.465175,3188.014875,3368.053368,3461.948456 +9.8,3469.808011,3373.755358,3193.291338,3024.303971,2869.173193,2730.559305,2611.309666,2514.363545,2442.547226,2398.270046,2383.182892,2397.895925,2441.853125,2513.422893,2610.171446,2729.209021,2867.524185,3022.249021,3190.785397,3370.809521,3464.699795 +9.9,3472.900855,3376.798415,3196.321049,3027.336354,2872.213231,2733.611046,2614.375417,2517.443148,2445.63931,2401.374191,2386.300258,2401.026915,2444.995115,2516.570137,2613.316142,2732.342946,2870.642904,3025.354185,3193.879197,3373.890228,3467.776329 +10,3476.119409,3379.965443,3199.472613,3030.489519,2875.373578,2736.783006,2617.561887,2520.644481,2448.854242,2404.602031,2389.541778,2404.282065,2448.260854,2519.840421,2616.583002,2735.59839,2873.883321,3028.581874,3197.096157,3377.09448,3470.976632 +10.1,3479.261775,3383.054888,3202.544843,3033.56276,2878.454175,2739.875842,2620.670418,2523.769365,2451.994059,2407.755474,2392.708683,2407.46136,2451.448574,2523.029855,2619.765811,2738.766831,2877.03477,3031.71947,3200.222055,3380.206989,3474.084939 +10.2,3482.193625,3385.932653,3205.403945,3036.422722,2881.322281,2742.757506,2623.56967,2526.687129,2454.928616,2410.704641,2395.670996,2410.434331,2454.426977,2526.006049,2622.730949,2741.713435,2879.961268,3034.629889,3203.118882,3383.089135,3476.962345 +10.3,3484.896922,3388.580713,3208.031992,3039.051666,2883.96044,2745.410893,2626.242924,2529.381498,2457.642128,2413.434223,2398.413813,2413.186401,2457.181756,2528.754927,2625.464561,2744.424603,2882.649452,3037.29987,3205.773417,3385.72774,3479.595683 +10.4,3487.472778,3391.099917,3210.529549,3041.549797,2886.468425,2747.935276,2628.788936,2531.950794,2460.23265,2416.042198,2401.035239,2415.81602,2459.811931,2531.37628,2628.067378,2747.002134,2885.202155,3039.833081,3208.28998,3388.22759,3482.089963 +10.5,3490.092201,3393.660849,3213.066712,3044.086541,2889.014814,2750.498257,2631.374282,2534.560675,2462.865156,2418.693173,2403.699876,2418.488179,2462.483278,2534.03701,2630.7077,2749.615896,2887.790773,3042.402196,3210.842276,3390.763116,3484.61997 +10.6,3492.921179,3396.429115,3215.808686,3046.826577,2891.76362,2753.263102,2634.161464,2537.373005,2465.701132,2421.548582,2406.569467,2421.365315,2465.359308,2536.902024,2633.552081,2752.434236,2890.585354,3045.178684,3213.602911,3393.507717,3487.359469 +10.7,3496.05737,3399.502152,3218.852674,3049.86682,2894.811401,2756.325974,2637.246249,2540.483248,2468.835909,2424.703822,2409.739677,2424.543579,2468.536878,2540.069073,2636.699341,2755.557143,2893.68697,3048.264489,3216.674537,3396.564533,3490.411829 +10.8,3499.498916,3402.878063,3222.196698,3053.205211,2898.155994,2759.684594,2640.62621,2543.888832,2472.266795,2428.156072,2413.207518,2428.019776,2472.012567,2543.534529,2640.145711,2758.98079,2897.0917,3051.655536,3220.052985,3399.929339,3493.772797 +10.9,3503.15159,3406.462779,3225.746795,3056.747983,2901.703886,2763.245748,2644.208404,2547.497027,2475.901175,2431.812652,2416.879989,2431.700318,2475.691969,2547.203004,2643.794792,2762.607793,2900.701166,3055.252502,3223.638201,3403.501597,3497.341609 +11,3506.871974,3410.113157,3229.360069,3060.352676,2905.313188,2766.868217,2647.852278,2551.167872,2479.599539,2435.534244,2420.617608,2435.44518,2479.434165,2550.932437,2647.503275,2766.293574,2904.369489,3058.908287,3227.282137,3407.132613,3500.969259 +11.1,3510.5292,3413.698572,3232.906103,3063.889274,2908.854414,2770.423138,2651.429583,2554.77366,2483.234592,2439.193733,2424.293124,2439.126628,2483.110629,2554.593283,2651.140508,2769.906346,2907.963696,3062.488811,3230.849856,3410.686868,3504.519951 +11.2,3514.05659,3417.152436,3236.318349,3067.291389,2912.261404,2773.844617,2654.87466,2558.248918,2486.740979,2442.725772,2427.841029,2442.67882,2486.655023,2558.118607,2654.638958,2773.377972,2911.414977,3065.924629,3234.271441,3414.094131,3507.923298 +11.3,3517.472344,3420.492867,3239.614793,3070.576949,2915.552025,2777.150461,2658.20523,2561.611271,2490.136277,2446.14794,2431.278948,2446.119465,2490.085178,2561.526428,2658.016921,2776.727029,2914.742083,3069.234621,3237.565911,3417.37351,3511.198456 +11.4,3520.865784,3423.808962,3242.884289,3073.834581,2918.81464,2780.428742,2661.509055,2564.948212,2493.507807,2449.54758,2434.694497,2449.53668,2493.489917,2564.906464,2661.365177,2780.045374,2918.037795,3072.512371,3240.827518,3420.619713,3514.44034 +11.5,3524.357721,3427.221236,3246.247033,3077.184128,2922.168662,2783.798397,2664.904562,2568.377707,2496.973208,2453.04225,2438.205479,2453.048813,2496.988416,2568.37898,2664.805282,2783.455869,2921.426133,3075.882926,3244.182161,3423.959214,3517.775695 +11.6,3528.050527,3430.831801,3249.804845,3080.727066,2925.715154,2787.360024,2668.491853,2571.999384,2500.631761,2456.731094,2441.911143,2456.755479,2500.680894,2572.045026,2668.4393,2787.061597,2925.011069,3079.451067,3247.735296,3427.497921,3521.310646 +11.7,3531.98874,3434.685063,3253.60196,3084.50745,2929.49797,2791.157269,2672.314339,2575.856412,2504.526449,2460.657007,2445.854416,2460.699757,2504.610693,2575.948334,2672.311458,2790.907246,2928.837652,3083.262189,3251.53261,3431.281716,3525.091172 +11.8,3536.146406,3438.755089,3257.612419,3088.499333,2933.491223,2795.164333,2676.346301,2579.923094,2508.631557,2464.79423,2450.009456,2464.855672,2508.751658,2580.062572,2676.39526,2794.966079,2932.878834,3087.289,3255.546633,3435.283002,3529.089614 +11.9,3540.443755,3442.962236,3261.756639,3092.623267,2937.615677,2799.302255,2680.509031,2584.120884,2512.868589,2469.064181,2454.297435,2469.143978,2513.023964,2584.307242,2680.60948,2799.156038,2937.051688,3091.44785,3259.693141,3439.417162,3533.221176 +12,3544.783246,3447.209125,3265.937333,3096.782145,2941.774508,2803.474558,2684.70639,2588.353872,2517.141712,2473.370945,2458.622163,2473.467998,2517.330252,2588.584181,2684.855062,2803.377045,2941.2551,3095.636752,3263.869451,3443.581042,3537.382482 +12.1,3547.776904,3450.154984,3268.919463,3099.869801,2944.998981,2806.846991,2688.228087,2592.021134,2520.943452,2477.284229,2462.614294,2477.504122,2521.378976,2592.621692,2688.869067,2807.364668,2945.213826,3099.561433,3267.755242,3447.422823,3541.204637 +12.2,3547.405401,3449.758008,3268.599484,3099.715438,2945.0636,2807.163993,2688.818751,2592.898065,2522.107208,2478.718179,2464.286518,2479.37549,2523.409898,2594.777468,2691.124392,2809.700959,2947.610357,3101.993664,3270.197845,3449.849237,3543.619099 +12.3,3544.271272,3446.603047,3265.509991,3096.769396,2942.30601,2804.621214,2686.504923,2590.81811,2520.253423,2477.065273,2462.79402,2477.996678,2522.099815,2593.499621,2689.855661,2808.428076,2946.320941,3100.675153,3268.839617,3448.441496,3542.185267 +12.4,3539.351419,3441.658978,3260.599369,3091.950099,2937.605248,2800.050195,2682.064449,2586.501304,2516.042343,2472.925771,2458.678214,2473.852444,2517.879867,2589.169396,2685.398528,2803.841049,2941.605853,3095.83814,3263.892197,3443.398926,3537.098511 +12.5,3533.076508,3435.3702,3254.354723,3085.816463,2931.618471,2794.229968,2676.418857,2581.029056,2510.729329,2467.739661,2453.570766,2468.76927,2512.770167,2583.994592,2680.137404,2798.484727,2936.149512,3090.281379,3258.239703,3437.659343,3531.316527 +12.6,3527.382536,3429.669377,3248.707654,3080.300237,2926.27793,2789.093753,2671.503618,2576.341468,2506.262732,2463.468413,2449.452094,2464.752558,2508.806479,2580.045311,2676.178718,2794.501678,2932.128326,3086.210711,3254.111113,3433.467229,3527.090485 +12.7,3524.725431,3426.996699,3246.062858,3077.74973,2923.855332,2786.818308,2669.385092,2574.382521,2504.455956,2461.790476,2447.864938,2463.211833,2507.27044,2578.483132,2674.574057,2792.845784,2930.412985,3084.430034,3252.261553,3431.548314,3525.136771 +12.8,3525.493558,3427.740383,3246.810223,3078.557876,2924.748346,2787.807744,2670.475664,2575.574798,2505.743788,2463.15484,2449.274263,2464.629493,2508.662949,2579.827921,2675.861936,2794.07313,2931.575406,3085.524588,3253.286443,3432.504663,3526.060101 +12.9,3528.325145,3430.549514,3249.625186,3081.442002,2927.731308,2790.906831,2673.701725,2578.934823,2509.238596,2466.77272,2452.990649,2468.413755,2512.486126,2583.670108,2679.713665,2797.926862,2935.420077,3089.348248,3257.075916,3436.248662,3529.780312 +13,3531.923755,3434.12799,3253.207056,3085.09262,2931.482545,2794.778367,2677.707111,2583.083759,2513.534858,2471.207838,2457.543261,2473.056012,2517.191333,2588.420025,2684.499019,2802.738409,2940.244083,3094.16926,3261.876221,3441.012468,3534.523798 +13.1,3535.10384,3437.287272,3256.353705,3088.284212,2934.744482,2798.124527,2681.145978,2586.620336,2517.168853,2474.927609,2461.325122,2476.870673,2521.011981,2592.229942,2688.291554,2806.507953,2943.982533,3097.86854,3265.527302,3444.610064,3538.094528 +13.2,3536.496255,3438.663577,3257.712344,3089.680638,2936.203497,2799.659253,2682.763739,2588.323936,2518.95495,2476.781042,2463.218325,2478.770434,2522.88829,2594.06414,2690.075928,2808.236956,2945.65031,3099.471063,3267.061091,3446.077306,3539.529124 +13.3,3535.567896,3437.728439,3256.767576,3088.786807,2935.391791,2798.948086,2682.164277,2587.840641,2518.584076,2476.505481,2463.007235,2478.586298,2522.696549,2593.841768,2689.810694,2807.919134,2945.271284,3099.02505,3266.543821,3445.491582,3538.908811 +13.4,3533.233777,3435.392149,3254.421721,3086.491835,2933.180275,2796.839088,2680.168964,2585.962355,2516.817029,2474.830205,2461.39034,2476.987597,2521.079139,2592.180765,2688.092049,2806.131965,2943.407466,3097.080402,3264.516884,3443.389389,3536.768825 +13.5,3530.92243,3433.077862,3252.090273,3084.198946,2930.955526,2794.698279,2678.120289,2584.006309,2514.945376,2473.022007,2459.611642,2475.198253,2519.242981,2590.274065,2686.101735,2804.048621,2941.225777,3094.799769,3262.140475,3440.929958,3534.268812 +13.6,3529.682612,3431.834289,3250.828025,3082.972879,2929.795978,2793.621336,2677.134656,2583.11322,2514.137791,2472.281158,2458.906452,2474.491558,2518.501388,2589.475713,2685.233732,2803.100728,2940.19159,3093.676849,3260.930022,3439.642698,3532.943815 +13.7,3530.166352,3432.313142,3251.289589,3083.472722,2930.366852,2794.28126,2677.894511,2583.976761,2515.101027,2473.329413,2460.013485,2475.624986,2519.631935,2590.584005,2686.306863,2804.126677,2941.160983,3094.582689,3261.768169,3440.41773,3533.687004 +13.8,3532.532713,3434.671057,3253.625492,3085.83856,2932.793991,2796.786353,2680.487757,2586.662105,2517.875694,2476.181516,2462.920937,2478.560131,2522.570146,2593.509427,2689.208223,2806.992529,2943.981888,3097.350509,3264.477353,3443.070766,3536.311695 +13.9,3536.117578,3438.244721,3257.171908,3089.404859,2936.409393,2800.465567,2684.239551,2590.489615,2521.77603,2480.143965,2466.925838,2482.582943,2526.589535,2597.512091,2693.184191,2810.931396,2947.875278,3101.190951,3268.260287,3446.799238,3540.013024 +14,3539.721257,3441.83852,3260.739974,3092.992645,2940.04717,2804.16904,2688.018188,2594.346893,2525.708974,2484.14202,2470.969981,2486.649449,2530.6578,2601.568722,2697.218113,2814.931276,2951.832159,3105.096778,3272.110584,3450.596761,3543.783956 +14.1,3542.363754,3444.474648,3263.354134,3095.629191,2942.737937,2806.931183,2690.861863,2597.275351,2528.717957,2487.219382,2474.095292,2489.797717,2533.807154,2604.703961,2700.325959,2817.999118,2954.850755,3108.058503,3275.012634,3453.443451,3546.602529 +14.2,3543.642981,3445.750688,3264.609568,3096.905508,2944.066626,2808.32912,2692.338154,2598.831313,2530.346371,2488.904877,2475.814601,2491.523463,2535.515438,2606.37744,2701.949511,2819.559977,2956.341157,3109.473741,3276.354607,3454.721345,3547.848329 +14.3,3543.669426,3445.777026,3264.617385,3096.934162,2944.147558,2808.479254,2692.565808,2599.136164,2530.718567,2489.326135,2476.259135,2491.961816,2535.921831,2606.73234,2702.235831,2819.764576,2956.457319,3109.499214,3276.29537,3454.590614,3547.682053 +14.4,3543.013967,3445.124162,3263.950052,3096.291477,2943.562236,2807.969573,2692.140597,2598.794886,2530.450318,2489.11136,2476.071171,2491.770622,2535.700815,2606.460238,2701.893493,2819.337669,2955.93857,3108.886631,3275.596159,3453.818591,3546.873541 +14.5,3542.558338,3444.671659,3263.484992,3095.852263,2943.181995,2807.667308,2691.925379,2598.666225,2530.397114,2489.114122,2476.10409,2491.804998,2535.711021,2606.424741,2701.792179,2819.15556,2955.667762,3108.524862,3275.150757,3453.30238,3546.321557 +14.6,3543.063002,3445.177735,3263.977244,3096.367129,2943.751565,2808.310201,2692.650205,2599.472372,2531.27372,2490.042663,2477.060901,2492.764271,2536.64964,2607.322306,2702.628868,2819.916653,2956.345222,3109.11639,3275.663592,3453.747826,3546.73284 +14.7,3544.793149,3446.907281,3265.691837,3098.101638,2945.5373,2810.165811,2694.584339,2601.484895,2533.354698,2492.175234,2479.224233,2494.936096,2538.80983,2609.451885,2704.708457,2821.931633,2958.286945,3110.981837,3277.458831,3455.481312,3548.434708 +14.8,3547.508608,3449.621007,3268.390684,3100.819508,2948.305244,2813.003094,2697.500153,2604.479873,2536.419939,2495.295383,2482.380946,2498.110212,2541.983678,2612.607404,2707.826353,2824.997038,2961.290306,3113.919216,3280.334804,3458.301178,3551.225372 +14.9,3550.652925,3452.763359,3271.518069,3103.964333,2951.497757,2816.262734,2700.836123,2607.892827,2539.901043,2498.829575,2485.951034,2501.698863,2545.574545,2616.182594,2711.366467,2828.487237,2964.72093,3117.286728,3283.643834,3461.555766,3554.451441 +15,3553.553466,3455.662937,3274.403012,3106.865333,2954.443984,2819.27351,2703.92024,2611.050228,2543.121942,2502.097873,2489.249158,2505.009763,2548.881803,2619.467493,2714.609105,2831.672909,2967.840568,3120.338439,3286.633837,3464.488811,3557.354795 +15.1,3555.670555,3457.781507,3276.50912,3108.988781,2956.613491,2821.508781,2706.229951,2613.433563,2545.567797,2504.588399,2491.765398,2507.533798,2551.39596,2621.951255,2717.041402,2834.038726,2970.131319,3122.554038,3288.782332,3466.576213,3559.41048 +15.2,3556.840488,3458.955865,3277.674068,3110.173793,2957.847159,2822.81139,2707.61022,2614.88995,2547.087836,2506.152344,2493.352623,2509.125145,2552.972079,2623.489507,2718.519342,2835.440808,2971.449322,3123.789599,3289.945139,3467.673538,3560.473905 +15.3,3557.31903,3459.441029,3278.15201,3110.673486,2958.3967,2823.431245,2708.308924,2615.665166,2547.925908,2507.031978,2494.251954,2510.024221,2553.850301,2624.322595,2719.283911,2836.121022,2972.037488,3124.289044,3290.366926,3468.026009,3560.790642 +15.4,3557.608022,3459.737709,3278.442753,3110.986755,2958.759941,2823.864937,2708.821501,2616.253831,2548.576468,2507.722514,2494.960377,2510.730782,2554.534067,2624.958461,2719.848108,2836.597562,2972.419036,3124.58001,3290.578733,3468.166992,3560.895176 +15.5,3558.229178,3460.366651,3279.06661,3111.633732,2959.456998,2824.632716,2709.668721,2617.177848,2549.56344,2508.751006,2496.009241,2511.781556,2555.56643,2625.947286,2720.76969,2837.435719,2973.166352,3125.241003,3291.163761,3468.68284,3561.375279 +15.6,3559.539361,3461.683927,3280.378895,3112.968811,2960.841194,2826.086701,2711.20159,2618.787397,2551.236677,2510.467668,2497.749852,2513.529627,2557.302911,2627.647673,2722.410783,2839.00129,2974.648835,3126.644564,3292.496955,3469.950159,3562.60835 +15.7,3561.601188,3463.751867,3282.441253,3115.052531,2962.971619,2828.284199,2713.475463,2621.135792,2553.647443,2512.921784,2500.229566,2516.02044,2559.787135,2630.101682,2724.812152,2841.333996,2976.90545,3128.829019,3294.616094,3472.006432,3564.631798 +15.8,3564.16612,3466.32246,3285.00602,3117.637501,2965.60116,2830.978306,2716.243592,2623.976305,2556.548765,2515.86578,2503.199685,2519.003543,2562.766366,2633.054009,2727.71579,2844.173148,2979.673043,3131.528962,3297.253876,3474.583105,3567.176487 +15.9,3566.80587,3468.968419,3287.646898,3120.298584,2968.30605,2833.746691,2719.085076,2626.889273,2559.521789,2518.880982,2506.240869,2522.057922,2565.81703,2636.077933,2730.691445,2847.084857,2982.514262,3134.303827,3299.967054,3477.235119,3569.796487 +16,3569.111052,3471.281205,3289.956059,3122.628717,2970.680037,2836.183807,2721.59489,2629.469864,2562.161348,2521.56122,2508.945075,2524.772665,2568.524506,2638.754595,2733.31572,2849.641185,2984.996912,3136.717553,3302.316416,3479.521171,3572.04953 +16.1,3570.845529,3473.025134,3291.698218,3124.393056,2972.488745,2838.055613,2723.539154,2631.484141,2564.233124,2523.671407,2511.07593,2526.909479,2570.64808,2640.840588,2735.342361,2851.593072,2986.869317,3138.516026,3304.045869,3481.183882,3573.677649 +16.2,3572.015435,3474.206367,3292.879798,3125.598512,2973.739741,2839.370361,2724.926848,2632.941899,2565.747813,2525.223254,2512.646191,2528.482075,2572.202387,2642.351524,2736.787932,2852.958018,2988.149798,3139.718107,3305.174647,3482.242765,3574.700469 +16.3,3572.849952,3475.053628,3293.729347,3126.473611,2974.661658,2840.356826,2725.986993,2634.072674,2566.935839,2526.448575,2513.889556,2529.726427,2573.426096,2643.529156,2737.897453,2853.98434,2989.089737,3140.577694,3305.958634,3482.955076,3575.375858 +16.4,3573.694564,3475.911617,3294.590861,3127.361573,2975.596883,2841.356471,2727.060157,2635.216409,2568.136975,2527.687611,2515.147425,2530.98573,2574.664865,2644.722201,2739.023055,2855.027747,2990.048236,3141.456763,3306.762133,3483.686744,3576.070506 +16.5,3574.85776,3477.088114,3295.771421,3128.568643,2976.850745,2842.673623,2728.44969,2636.675726,2569.65353,2529.242921,2516.723224,2532.564848,2576.225603,2646.240157,2740.47716,2856.403758,2991.343745,3142.676252,3307.908121,3484.762161,3577.109474 +16.6,3576.489224,3478.732485,3297.42008,3130.243486,2978.571521,2844.456161,2730.303104,2638.597948,2571.632887,2531.262264,2518.765394,2534.613156,2578.258933,2648.235182,2742.413637,2858.268056,2993.13362,3144.394881,3309.556459,3486.341974,3578.653764 +16.7,3578.539526,3480.795394,3299.487505,3132.336688,2980.709701,2846.65444,2732.570543,2640.932999,2574.024717,2533.694995,2521.222859,2537.07899,2580.712535,2650.654297,2744.778864,2860.566467,2995.363109,3146.557316,3311.651404,3488.370172,3580.647237 +16.8,3580.799228,3483.067815,3301.764918,3134.639622,2983.056776,2849.059984,2735.043382,2643.471913,2576.619442,2536.330546,2523.883599,2539.748379,2583.370124,2653.278657,2747.351335,2863.074904,2997.805627,3148.934717,3313.962395,3490.615027,3582.857635 +16.9,3582.992933,3485.27493,3303.978002,3136.878491,2985.339503,2851.400082,2737.449272,2645.942476,2579.144642,2538.895811,2526.473236,2542.345054,2585.953044,2655.826846,2749.846685,2865.506068,3000.170989,3151.234305,3316.194643,3492.78038,3584.988163 +17,3584.893886,3487.190491,3305.901053,3138.828245,2987.333603,2853.451264,2739.565435,2648.122445,2581.378362,2541.168738,2528.769145,2544.645327,2588.236138,2658.071908,2752.03598,2867.629006,3002.226184,3153.221198,3318.111819,3494.628894,3586.801007 +17.1,3586.411496,3488.724101,3307.443937,3140.399117,2988.949747,2855.124685,2741.303435,2649.923719,2583.232747,2543.061562,2530.683448,2546.561018,2590.13078,2659.924637,2753.829368,2869.353196,3003.87991,3154.803379,3319.621388,3496.06766,3588.20308 +17.2,3587.613809,3489.943651,3308.674455,3141.658861,2990.25569,2856.488137,2742.731079,2651.414158,2584.775829,2544.642584,2532.284837,2548.161368,2591.706927,2661.45579,2755.298493,2870.751167,3005.205403,3156.054713,3320.797767,3497.171455,3589.269328 +17.3,3588.683543,3491.031462,3309.774616,3142.789207,2991.432903,2857.722918,2744.029537,2652.77496,2586.189107,2546.093915,2533.75639,2549.630849,2593.150829,2662.853648,2756.633844,2872.015604,3006.397302,3157.171585,3321.838785,3498.139069,3590.198983 +17.4,3589.835443,3492.201816,3310.958289,3144.003592,2992.694401,2859.041694,2745.411207,2654.218428,2587.685108,2547.628666,2535.312228,2551.185099,2594.680094,2664.338084,2758.057771,2873.371328,3007.682664,3158.383072,3322.97517,3499.20233,3591.224385 +17.5,3591.229552,3493.614391,3312.384756,3145.460825,2994.198472,2860.602278,2747.033456,2655.901587,2589.420737,2549.403862,2537.109802,2552.982398,2596.454183,2666.069971,2759.732748,2874.982411,3009.226998,3159.856033,3324.374898,3500.529968,3592.514618 +17.6,3592.912329,3495.315521,3314.100149,3147.206752,2995.990612,2862.449832,2748.941104,2657.868908,2591.440169,2551.463413,2539.192825,2555.066436,2598.516901,2668.093301,2761.703049,2876.893386,3011.075034,3161.635467,3326.083215,3502.167387,3594.11517 +17.7,3594.808013,3497.229592,3316.02894,3149.165886,2997.995345,2864.508919,2751.058703,2660.044822,2593.667612,2553.731121,2541.484516,2557.359777,2600.790062,2670.329025,2763.888743,2879.02337,3013.144934,3163.638793,3328.01696,3504.03103,3595.942307 +17.8,3596.760523,3499.200851,3318.015658,3151.183045,3000.057767,2866.624932,2753.231883,2662.275012,2595.948578,2556.052003,2543.829061,2559.705539,2603.115472,2672.617404,2766.128437,2881.209207,3015.271832,3165.69973,3330.008726,3505.952722,3597.827499 +17.9,3598.602915,3501.062699,3319.894031,3153.09232,3002.01233,2868.632707,2755.295797,2664.394752,2598.118209,2558.260724,2546.060292,2561.936472,2605.324522,2674.788219,2768.250167,2883.277062,3017.280087,3167.64114,3331.880171,3507.753306,3599.591214 +18,3600.223392,3502.703574,3321.55275,3154.782719,3003.748376,2870.421962,2757.140519,2666.294327,2600.066824,2560.247391,2548.067874,2563.941664,2607.305547,2676.728875,2770.140297,2885.11211,3019.053733,3169.34613,3333.513643,3509.314622,3601.115059 +18.1,3599.874608,3502.460535,3321.489311,3154.906287,3004.068995,2870.941475,2757.851963,2667.185642,2601.120141,2561.438104,2549.363017,2565.301417,2608.691907,2678.109991,2771.491258,2886.413443,3020.283921,3170.483869,3334.542693,3510.221455,3601.956008 +18.2,3594.986868,3497.707077,3316.971804,3150.655692,3000.119143,2867.317761,2754.568735,2664.248769,2598.525205,2559.168547,2547.388395,2563.579056,2607.176006,2676.756808,2770.26081,2885.267403,3019.178679,3169.374454,3333.387425,3508.980226,3600.659422 +18.3,3586.477756,3489.336576,3308.824538,3142.746207,2992.465571,2859.931255,2747.450013,2657.390647,2591.910982,2552.770461,2541.16666,2557.484051,2601.157869,2670.771506,2764.272661,2879.246096,3013.092654,3163.195618,3327.09449,3502.556664,3594.162432 +18.4,3575.691676,3478.68369,3298.358565,3132.454494,2982.340681,2849.96187,2737.617112,2647.670134,2582.272333,2543.174808,2531.56606,2547.824302,2591.388317,2660.851888,2754.17634,2868.956267,3002.596285,3152.488706,3316.183989,3491.458236,3582.968689 +18.5,3563.262093,3466.399703,3286.281382,3120.582125,2970.675273,2838.501382,2726.350669,2636.580286,2571.333747,2532.351714,2520.811458,2537.083168,2580.607138,2649.985838,2743.192906,2857.830739,2991.306713,3141.021978,3304.537152,3479.637232,3571.056713 +18.6,3551.732045,3455.0229,3275.127767,3109.661619,2960.000728,2828.081364,2716.184575,2626.660431,2561.644249,2522.865606,2511.489504,2527.876377,2571.465136,2640.863667,2734.054436,2848.643252,2982.036909,3131.642703,3295.028408,3469.986393,3561.327217 +18.7,3544.183307,3447.614735,3267.911229,3102.632094,2953.157342,2821.421454,2709.699414,2620.337643,2555.467178,2516.810295,2505.522951,2521.958037,2565.553813,2634.923687,2728.058551,2842.566316,2975.85281,3125.331226,3288.575613,3463.385898,3554.64835 +18.8,3540.964844,3444.524559,3264.983929,3099.851084,2950.511123,2818.899332,2707.287839,2618.022751,2553.234527,2514.641428,2503.392933,2519.836075,2563.408603,2632.728802,2725.794651,2840.21398,2973.39046,3122.74194,3285.847126,3460.51316,3551.701037 +18.9,3540.256434,3443.945976,3264.573681,3099.599803,2950.414687,2818.954885,2707.490271,2618.36687,2553.714933,2515.248833,2504.111206,2520.642164,2564.276603,2633.634725,2726.717972,2841.129914,2974.269042,3123.55478,3286.567444,3461.120006,3552.246189 +19,3540.402988,3444.224013,3265.019702,3100.205427,2951.17726,2819.873472,2708.562331,2619.58996,2555.086727,2516.763712,2505.757152,2522.400137,2566.123768,2635.548954,2728.6789,2843.110981,2976.237713,3125.478901,3288.415232,3462.865589,3553.935131 +19.1,3539.916639,3443.867027,3264.814169,3100.131517,2951.222165,2820.02709,2708.814285,2619.930813,2555.508208,2517.255845,2506.305325,2522.98443,2566.721935,2636.141092,2729.248285,2843.636292,2976.694349,3125.844526,3288.66952,3462.996492,3554.002008 +19.2,3537.102916,3441.187509,3262.285226,3097.729409,2948.931022,2817.833624,2706.704943,2617.892274,2553.527688,2515.318791,2504.392829,2521.072872,2564.786086,2634.159153,2727.202656,2841.506352,2974.458891,3123.486403,3286.175391,3460.363746,3551.299195 +19.3,3531.350894,3435.580229,3256.844027,3092.435757,2943.774443,2812.804944,2701.793499,2613.085597,2548.811797,2510.676662,2499.802175,2516.505976,2560.213123,2629.55355,2722.541755,2836.765066,2969.613187,3118.517078,3281.068153,3455.116813,3545.98099 +19.4,3523.843577,3428.222126,3249.655688,3085.397407,2936.875213,2806.034588,2695.139978,2606.534218,2542.345587,2504.2757,2493.441592,2510.155686,2553.841186,2623.131592,2716.045392,2830.168553,2962.893757,3111.657755,3274.058297,3447.96009,3538.750141 +19.5,3516.349884,3420.875527,3242.471095,3078.348611,2929.94661,2799.211329,2688.406168,2599.871742,2535.734656,2497.694796,2486.865438,2503.554722,2547.184642,2616.392601,2709.200944,2823.195219,2955.772618,3104.376288,3266.611536,3440.358743,3531.072448 +19.6,3510.144567,3414.815239,3236.571113,3072.581614,2924.297746,2793.666531,2682.950929,2594.489697,2530.408179,2492.405423,2481.591575,2498.270542,2541.862579,2611.007757,2703.730366,2817.614684,2950.06199,3098.520657,3260.603321,3434.205973,3524.848119 +19.7,3506.028037,3410.841137,3232.757618,3068.902363,2920.74088,2790.22108,2679.606071,2591.233189,2527.226928,2489.286429,2478.519272,2495.224801,2538.820478,2607.947017,2700.627832,2814.444197,2946.799959,3095.146626,3257.103182,3430.580292,3521.159258 +19.8,3504.208935,3409.158651,3231.227524,3067.493975,2919.440556,2789.016763,2678.48699,2590.188237,2526.245215,2488.358821,2477.635398,2494.370125,2537.977408,2607.097308,2699.750338,2813.513883,2945.79348,3094.04238,3255.885557,3429.247649,3519.768798 +19.9,3503.890066,3408.971432,3231.184346,3067.558639,2919.596438,2789.24957,2678.784665,2590.539297,2526.639205,2488.788483,2478.093525,2494.845926,2538.457183,2607.565944,2700.188529,2813.898414,2946.102647,3094.255627,3255.988672,3429.240017,3519.70602 +20,3503.622762,3408.835675,3231.193868,3067.675867,2919.805208,2789.536202,2679.137719,2590.947774,2527.092854,2489.280653,2478.6181,2495.393251,2539.014615,2608.118618,2700.716342,2814.377708,2946.511373,3094.572742,3256.200196,3429.345274,3519.75814 +20.1,3502.22047,3407.567343,3230.075775,3066.669861,2918.895796,2788.710213,2678.383655,2590.25391,2526.447395,2488.675377,2478.045563,2494.842494,2538.471841,2607.567433,2700.134801,2813.741468,2945.798503,3093.763025,3255.281867,3428.319923,3518.679161 +20.2,3499.175114,3404.657915,3227.318968,3064.024831,2916.345311,2786.239308,2675.978452,2587.899689,2524.128683,2486.38036,2475.763679,2492.56006,2536.173002,2605.233983,2697.743536,2811.268797,2943.224791,3091.07196,3252.467625,3425.390413,3515.692551 +20.3,3494.575442,3400.196096,3223.012922,3059.831949,2912.24725,2782.219963,2672.022097,2583.989125,2520.24527,2482.509085,2471.891115,2488.669954,2532.24744,2601.252785,2693.682046,2807.103809,2938.93839,3086.651153,3247.911759,3420.712655,3510.954834 +20.4,3489.066151,3394.826216,3217.80357,3054.74099,2907.257242,2777.315751,2667.188146,2579.207822,2515.496965,2477.777635,2467.162089,2483.92606,2527.46971,2596.419416,2688.766646,2802.082417,2933.792795,3081.369022,3242.494183,3415.173908,3505.356229 +20.5,3483.692598,3389.591007,3212.729634,3049.78589,2902.403806,2772.549591,2662.494143,2574.568687,2510.893365,2473.194056,2462.585105,2479.339442,2522.855345,2591.755442,2684.026134,2797.241187,2928.832214,3076.276818,3237.271926,3409.835115,3499.959598 +20.6,3479.391155,3385.424019,3208.719457,3045.888088,2898.600047,2768.825359,2658.834333,2570.956486,2507.310547,2469.626979,2459.022914,2475.768749,2519.260639,2588.11642,2680.316776,2793.438094,2924.91692,3072.237397,3233.110214,3405.563239,3495.632991 +20.7,3476.535405,3382.698284,3206.145589,3043.420119,2896.218932,2766.517115,2656.584634,2568.749845,2505.130834,2467.463397,2456.868089,2473.612978,2517.09165,2585.915875,2678.059775,2791.101783,2922.48239,3069.692193,3230.455079,3402.807221,3492.826593 +20.8,3474.907514,3381.196776,3204.792551,3042.168916,2895.050399,2765.41836,2655.542542,2567.7505,2504.160307,2466.51364,2455.934928,2472.690048,2516.169464,2584.977629,2677.081373,2790.060511,2921.358525,3068.472438,3229.138603,3401.399478,3491.37286 +20.9,3473.897762,3380.310604,3204.051844,3041.525923,2894.485037,2764.917947,2655.094172,2567.340617,2503.775868,2466.14788,2455.585358,2472.35228,2515.835667,2584.631869,2676.7003,2789.621957,2920.842949,3067.867238,3228.443178,3400.617862,3490.547732 +21,3472.716045,3379.250987,3203.136075,3040.705104,2893.737657,2764.230816,2654.453658,2566.732288,2503.186104,2465.569474,2455.015639,2471.787079,2515.267292,2584.044243,2676.070484,2788.928535,2920.067457,3066.999275,3227.484212,3399.572834,3489.459528 +21.1,3470.677944,3377.33523,3201.365644,3039.03116,2892.137948,2762.691995,2652.961422,2565.270993,2501.74088,2464.131638,2453.581003,2470.350274,2513.819354,2582.567821,2674.542289,2787.327398,2918.375907,3065.209334,3225.599757,3397.600401,3487.443212 +21.2,3467.509362,3374.289959,3198.468638,3036.234416,2889.4189,2760.037372,2650.356375,2562.698604,2499.18486,2461.581476,2451.030465,2467.792198,2511.242875,2579.953829,2671.866819,2784.569239,2915.51848,3062.24704,3222.538766,3394.448939,3484.246847 +21.3,3463.431572,3370.335703,3194.664249,3032.532416,2885.79608,2756.48025,2646.849447,2559.223704,2495.724478,2458.123584,2447.567109,2464.314779,2507.738958,2576.402944,2668.244713,2780.8549,2911.696463,3058.314186,3218.503373,3390.320865,3480.073078 +21.4,3458.989444,3366.016088,3190.494204,3028.464773,2881.806935,2752.556001,2642.974342,2555.378967,2491.892285,2454.291461,2443.726495,2460.456715,2503.850376,2572.462825,2664.229035,2776.742966,2907.473784,3053.9794,3214.065833,3385.790915,3475.497817 +21.5,3454.805385,3361.95237,3186.578277,3024.649906,2878.068856,2748.881484,2639.348178,2551.78281,2488.309252,2450.71004,2440.138935,2456.855012,2500.221925,2568.786914,2660.482287,2772.904887,2903.530298,3049.92978,3209.91881,3381.555497,3471.219136 +21.6,3451.362912,3358.627,3183.397175,3021.566486,2875.058396,2745.931182,2636.443726,2548.906882,2485.446704,2447.851295,2437.278071,2453.985964,2497.333441,2565.859369,2657.493424,2769.834565,2900.364717,3046.66823,3206.568441,3378.122996,3467.746473 +21.7,3448.831443,3356.208813,3181.118428,3019.380259,2872.939114,2743.866109,2634.419312,2546.906819,2483.457684,2445.865877,2435.29242,2451.996232,2495.330053,2563.824203,2655.405698,2767.674809,2898.119706,3044.337341,3204.157224,3375.63596,3465.222482 +21.8,3447.006312,3354.493517,3179.538207,3017.887962,2871.508282,2742.483878,2633.072709,2545.580326,2482.139491,2444.55027,2433.977188,2450.679246,2494.003019,2562.470308,2654.005537,2766.20965,2896.577139,3042.717008,3202.463375,3373.871526,3463.423817 +21.9,3445.425907,3353.020529,3178.19763,3016.632943,2870.311711,2741.332667,2631.954244,2544.479484,2481.0453,2443.457912,2432.885104,2449.585997,2492.900703,2561.342799,2652.834389,2764.976779,2895.271136,3041.338042,3201.014921,3372.355859,3461.875748 +22,3443.5884,3351.289005,3176.597373,3015.117773,2868.853927,2739.918674,2630.571352,2543.11237,2479.682991,2442.095478,2431.520522,2448.21736,2491.519536,2559.933025,2651.378133,2763.456634,2893.677052,3039.6712,3199.27888,3370.553504,3460.041683 diff --git a/tests/data/currents_mdc/tension_c5/tension.dat b/tests/data/currents_mdc/tension_c5/tension.dat new file mode 100644 index 00000000..4e07f732 --- /dev/null +++ b/tests/data/currents_mdc/tension_c5/tension.dat @@ -0,0 +1,25 @@ +--------------------- MoorDyn Input File ------------------------------------ +Current tension parity deck (MoorDyn-C Currents 5): a cross-flow sheared along the line, in depth and time +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +22.0 TMax simulation length (s) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +300.0 TmaxIC max time for ic gen (s) +1.0e-12 threshIC convergence threshold for ic gen (-) +0 WaveKin MoorDyn-C water kinematics mode (-) +5 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/test_mdc_currents.f90 b/tests/test_mdc_currents.f90 new file mode 100644 index 00000000..f18e724f --- /dev/null +++ b/tests/test_mdc_currents.f90 @@ -0,0 +1,273 @@ +! File: tests/test_mdc_currents.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +!> MoorDyn-C time-varying and gridded currents (Currents 2, current_profile_dynamic.txt, and +!> Currents 5, current_profile_4d.txt) on the shared inputs of tests/data/currents_mdc: the deck +!> current CableDyn samples (CD_Deck_Fluid_Probe) at given points and times against +!> - MoorDyn-C v2.7.1 itself (ref_moordyn_c.csv, validation/scripts/wavekin_mdc_probe.cpp) and an +!> independent Python evaluation of the files (ref_python.csv, +!> validation/scripts/currents_mdc_reference.py), both to 1e-14 m/s: a time-varying depth +!> profile with uneven times (c2, sampled past the table's last time, where MoorDyn-C's grid +!> repeats), single-precision depths and x velocities only (c2stof), a grid uniform in x and y +!> (c5uniform) and a grid sheared in x, y and z and varying in time (c5); the current has no +!> acceleration, as in MoorDyn-C; +!> - a second source of the same field: Currents 2 with the steady profile of current_profile.txt +!> at every time (c2const) equals Currents 1 (c1) to round-off, and the grid uniform in x and y +!> (c5uniform) equals the Currents 2 profile (c2) to round-off, inside and beyond its x-y span; +!> - a line-6 data row of current_profile_4d.txt (the layout of MoorDyn-C's documentation) is a +!> grid point, not a header; +!> - malformed tables, Currents 3 and 4 (no current source in MoorDyn-C v2.7.1) and a second +!> current source fail closed by name. +PROGRAM test_mdc_currents + USE CableDyn_Precision, ONLY: wp + USE CableDyn_DeckDriver, ONLY: CD_Deck_Fluid_Probe, CD_DECKDRV_OK + IMPLICIT NONE + INTEGER :: n_fail = 0 + CHARACTER(*), PARAMETER :: CASES(6) = [CHARACTER(9) :: 'c1', 'c2const', 'c2', 'c2stof', 'c5uniform', 'c5'] + INTEGER :: k + + DO k = 1, SIZE(CASES) + CALL check_reference(TRIM(CASES(k)), 'ref_moordyn_c.csv', 'MoorDyn-C v2.7.1') + CALL check_reference(TRIM(CASES(k)), 'ref_python.csv', 'the Python evaluation') + END DO + CALL check_same_field('c2const', 'c1', 1, 'Currents 2 (a constant table) vs Currents 1') + CALL check_same_field('c5uniform', 'c2', 2, 'Currents 5 (uniform in x and y) vs Currents 2') + CALL check_line6_row() + CALL check_rejections() + IF (n_fail > 0) THEN + WRITE (*, '(A,I0,A)') 'FAIL: ', n_fail, ' MoorDyn-C current gate(s) failed' + ERROR STOP 1 + END IF + WRITE (*, '(A)') 'PASS: MoorDyn-C Currents 2 and 5 match MoorDyn-C and the independent evaluation' + +CONTAINS + + INCLUDE 'nan_max_abs.inc' + + SUBROUTINE require(cond, msg) + LOGICAL, INTENT(IN) :: cond + CHARACTER(*), INTENT(IN) :: msg + IF (.NOT. cond) THEN + n_fail = n_fail + 1 + WRITE (*, '(A,A)') 'FAILED: ', msg + END IF + END SUBROUTINE require + + SUBROUTINE read_reference(path, ref, ok) + !! The rows "t,x,y,z,zeta,ux,uy,uz,ax,ay,az" of a probe CSV into ref(11, n). + CHARACTER(*), INTENT(IN) :: path + REAL(wp), ALLOCATABLE, INTENT(OUT) :: ref(:, :) + LOGICAL, INTENT(OUT) :: ok + INTEGER :: u, ios, n, i + CHARACTER(1024) :: buf + ok = .FALSE. + OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios) + IF (ios /= 0) RETURN + n = 0 + DO + READ (u, '(A)', IOSTAT=ios) buf + IF (ios /= 0) EXIT + IF (LEN_TRIM(buf) > 0) n = n + 1 + END DO + REWIND (u) + READ (u, '(A)') buf + ALLOCATE (ref(11, n - 1)) + DO i = 1, n - 1 + READ (u, *, IOSTAT=ios) ref(:, i) + IF (ios /= 0) THEN + CLOSE (u) + RETURN + END IF + END DO + CLOSE (u) + ok = n > 1 + END SUBROUTINE read_reference + + SUBROUTINE probe(deck, ref, vel, acc, ok) + !! The deck current at the reference rows' points and times. + CHARACTER(*), INTENT(IN) :: deck + REAL(wp), INTENT(IN) :: ref(:, :) + REAL(wp), ALLOCATABLE, INTENT(OUT) :: vel(:, :), acc(:, :) + LOGICAL, INTENT(OUT) :: ok + REAL(wp), ALLOCATABLE :: eta(:) + INTEGER :: es + CHARACTER(512) :: em + ALLOCATE (eta(SIZE(ref, 2)), vel(3, SIZE(ref, 2)), acc(3, SIZE(ref, 2))) + CALL CD_Deck_Fluid_Probe(deck, ref(2:4, :), ref(1, :), eta, vel, acc, es, em) + ok = es == CD_DECKDRV_OK + CALL require(ok, deck//': deck current evaluated: '//TRIM(em)) + END SUBROUTINE probe + + SUBROUTINE check_reference(case, csv, label) + CHARACTER(*), INTENT(IN) :: case, csv, label + REAL(wp), ALLOCATABLE :: ref(:, :), vel(:, :), acc(:, :) + REAL(wp) :: e_vel, e_acc + LOGICAL :: ok + CALL read_reference('../currents_mdc/'//case//'/'//csv, ref, ok) + CALL require(ok, case//': reference '//csv//' readable') + IF (.NOT. ok) RETURN + CALL probe('../currents_mdc/'//case//'/currents.dat', ref, vel, acc, ok) + IF (.NOT. ok) RETURN + e_vel = nan_max_abs(vel - ref(6:8, :)) + e_acc = nan_max_abs(acc - ref(9:11, :)) + WRITE (*, '(A,A,A,A,A,A,I0,A,ES10.3,A,ES10.3,A,ES10.3,A)') case, ' vs ', label, ' (', csv, ', ', SIZE(ref, 2), & + ' samples): velocity ', e_vel, ' m/s of ', nan_max_abs(ref(6:8, :)), ' m/s, acceleration ', e_acc, ' m/s^2' + CALL require(e_vel <= 1.0e-14_wp, case//': the current matches '//label) + CALL require(e_acc <= 0.0_wp, case//': the current has no acceleration, as in '//label) + END SUBROUTINE check_reference + + SUBROUTINE check_same_field(case, other, repeat, label) + !! The current of case at the points of its reference equals that of other at the same depths + !! and times: each row of other's reference stands for repeat consecutive rows of case's (the + !! uniform grid's points are other's and points far outside its x-y span). + CHARACTER(*), INTENT(IN) :: case, other, label + INTEGER, INTENT(IN) :: repeat + REAL(wp), ALLOCATABLE :: ref(:, :), ref_o(:, :), vel(:, :), acc(:, :), vel_o(:, :), acc_o(:, :) + REAL(wp) :: err + INTEGER :: i, j + LOGICAL :: ok, ok_o + CALL read_reference('../currents_mdc/'//case//'/ref_python.csv', ref, ok) + CALL read_reference('../currents_mdc/'//other//'/ref_python.csv', ref_o, ok_o) + CALL require(ok .AND. ok_o, label//': points readable') + IF (.NOT. (ok .AND. ok_o)) RETURN + CALL require(SIZE(ref, 2) == repeat*SIZE(ref_o, 2), label//': point sets correspond') + IF (SIZE(ref, 2) /= repeat*SIZE(ref_o, 2)) RETURN + CALL probe('../currents_mdc/'//case//'/currents.dat', ref, vel, acc, ok) + CALL probe('../currents_mdc/'//other//'/currents.dat', ref_o, vel_o, acc_o, ok_o) + IF (.NOT. (ok .AND. ok_o)) RETURN + err = 0.0_wp + DO i = 1, SIZE(ref_o, 2) + DO j = 1, repeat + CALL require(ref(1, repeat*(i - 1) + j) == ref_o(1, i) .AND. ref(4, repeat*(i - 1) + j) == ref_o(4, i), & + label//': the same time and depth') + err = MAX(err, nan_max_abs(vel(:, repeat*(i - 1) + j) - vel_o(:, i))) + END DO + END DO + WRITE (*, '(A,A,I0,A,ES10.3,A)') label, ' (', SIZE(ref, 2), ' samples): velocity ', err, ' m/s' + CALL require(err <= 4.0_wp*EPSILON(1.0_wp), label//': the same current to round-off') + END SUBROUTINE check_same_field + + SUBROUTINE write_deck(path, currents, extra_option) + !! A one-line probe deck with the given Currents row (and an optional extra OPTIONS row). + CHARACTER(*), INTENT(IN) :: path, currents + CHARACTER(*), INTENT(IN), OPTIONAL :: extra_option + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '--------------------- MoorDyn Input File ------------------------------------' + WRITE (u, '(A)') 'MoorDyn-C current table checks' + WRITE (u, '(A)') '----------------------- LINE TYPES ------------------------------------------' + WRITE (u, '(A)') 'TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx' + WRITE (u, '(A)') '(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'chain 0.1 50.0 1.0e7 0.0 0 1.2 1.0 0.2 0.0' + WRITE (u, '(A)') '---------------------- POINT PROPERTIES --------------------------------' + WRITE (u, '(A)') 'ID Type X Y Z Mass Volume CdA Ca' + WRITE (u, '(A)') '(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)' + WRITE (u, '(A)') '1 Fixed -30.0 0.0 -20.0 0 0 0 0' + WRITE (u, '(A)') '2 Vessel 30.0 0.0 -20.0 0 0 0 0' + WRITE (u, '(A)') '---------------------- LINES ----------------------------------------' + WRITE (u, '(A)') 'ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs' + WRITE (u, '(A)') '(#) (name) (#) (#) (m) (-) (-)' + WRITE (u, '(A)') '1 chain 2 1 70.0 20 -' + WRITE (u, '(A)') '---------------------- OPTIONS -----------------------------------------' + WRITE (u, '(A)') '0.002 dtM' + WRITE (u, '(A)') '10.0 TMax' + WRITE (u, '(A)') '50 WtrDpth' + WRITE (u, '(A)') currents//' Currents' + IF (PRESENT(extra_option)) WRITE (u, '(A)') extra_option + WRITE (u, '(A)') '------------------------- need this line --------------------------------------' + CLOSE (u) + END SUBROUTINE write_deck + + SUBROUTINE write_text(path, lines) + CHARACTER(*), INTENT(IN) :: path, lines(:) + INTEGER :: u, i + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + DO i = 1, SIZE(lines) + WRITE (u, '(A)') TRIM(lines(i)) + END DO + CLOSE (u) + END SUBROUTINE write_text + + SUBROUTINE check_line6_row() + !! current_profile_4d.txt with its first grid point on line 6, as MoorDyn-C's documentation + !! lays the file out: that row is read (MoorDyn-C v2.7.1 starts at line 7 and leaves the point + !! at zero), so the current at the corner (x, y, z, t) = (-1, -2, -3, 0) is the row's. + REAL(wp) :: pos(3, 2), t(2), eta(2), vel(3, 2), acc(3, 2) + INTEGER :: es + CHARACTER(512) :: em + CALL write_deck('mdc_line6.dat', '5') + CALL write_text('current_profile_4d.txt', [CHARACTER(40) :: '2 2 2 2', '-1 1', '-2 2', '-3 0', '0 15', & + '-1 -2 -3 0 0.7 -0.2 0.05', '-1 -2 0 0 0.0 0.0 0.0', '-1 2 -3 0 0.0 0.0 0.0', & + '-1 2 0 0 0.0 0.0 0.0', '1 -2 -3 0 0.0 0.0 0.0', '1 -2 0 0 0.0 0.0 0.0', & + '1 2 -3 0 0.0 0.0 0.0', '1 2 0 0 0.0 0.0 0.0', '-1 -2 -3 15 -0.5 -0.5 0.0', & + '-1 -2 -0 15 -1.0 -1.0 0.0', '-1 2 -3 15 -0.5 0.5 0.0', '-1 2 -0 15 -1.0 1.0 0.0', & + '1 -2 -3 15 0.5 -0.5 0.0', '1 -2 -0 15 1.0 -1.0 0.0', '1 2 -3 15 0.5 0.5 0.0', & + '1 2 -0 15 1.0 1.0 0.0']) + pos(:, 1) = [-5.0_wp, -7.0_wp, -9.0_wp] + pos(:, 2) = [3.0_wp, 4.0_wp, 1.0_wp] + t = [0.0_wp, 7.5_wp] + CALL CD_Deck_Fluid_Probe('mdc_line6.dat', pos, t, eta, vel, acc, es, em) + CALL require(es == CD_DECKDRV_OK, 'line-6 row: evaluated: '//TRIM(em)) + IF (es /= CD_DECKDRV_OK) RETURN + WRITE (*, '(A,3ES12.4,A,3ES12.4)') 'line-6 row: corner current ', vel(:, 1), '; (1, 2, 0) at 7.5 s ', vel(:, 2) + CALL require(nan_max_abs(vel(:, 1) - [0.7_wp, -0.2_wp, 0.05_wp]) <= 0.0_wp, & + 'line-6 row: the first grid point is the row on line 6') + ! "-0" is the coordinate 0 (matched by value): half of the 15 s value at the (1, 2, 0) corner + CALL require(nan_max_abs(vel(:, 2) - [0.5_wp, 0.5_wp, 0.0_wp]) <= 1.0e-15_wp, & + 'line-6 row: a "-0" coordinate is the grid coordinate 0') + END SUBROUTINE check_line6_row + + SUBROUTINE expect_failure(currents, file, lines, needle, extra_option) + !! The deck with the given Currents row and the table lines written to file fails, naming needle. + CHARACTER(*), INTENT(IN) :: currents, file, lines(:), needle + CHARACTER(*), INTENT(IN), OPTIONAL :: extra_option + REAL(wp) :: pos(3, 1), t(1), eta(1), vel(3, 1), acc(3, 1) + INTEGER :: es + CHARACTER(512) :: em + pos = 0.0_wp + pos(3, 1) = -5.0_wp + t = 0.0_wp + IF (PRESENT(extra_option)) THEN + CALL write_deck('mdc_fail.dat', currents, extra_option) + ELSE + CALL write_deck('mdc_fail.dat', currents) + END IF + IF (LEN_TRIM(file) > 0) CALL write_text(file, lines) + CALL CD_Deck_Fluid_Probe('mdc_fail.dat', pos, t, eta, vel, acc, es, em) + CALL require(es /= CD_DECKDRV_OK .AND. INDEX(em, needle) > 0, 'Currents '//currents// & + ' fails closed naming "'//needle//'": '//TRIM(em)) + END SUBROUTINE expect_failure + + SUBROUTINE check_rejections() + CHARACTER(*), PARAMETER :: DYN = 'current_profile_dynamic.txt', G4 = 'current_profile_4d.txt' + CHARACTER(40), PARAMETER :: HEAD(4) = [CHARACTER(40) :: 'MoorDyn dynamic currents', 'header', '', ''] + CALL expect_failure('3', '', [CHARACTER(1) :: ' '], 'no current source in MoorDyn-C v2.7.1') + CALL expect_failure('4', '', [CHARACTER(1) :: ' '], 'no current source in MoorDyn-C v2.7.1') + ! Currents 2: a row with a partial velocity set, times out of order, one time row, depths + ! out of order, a non-number + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '-10 0', 'h', '0 0.1 0.2', '5 0.1 0.2 0.3'], & + 'found 4') + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '-10 0', 'h', '5 0.1 0.2', '0 0.1 0.2'], & + 'times must be strictly increasing') + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '-10 0', 'h', '0 0.1 0.2'], 'at least two time rows') + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '0 -10', 'h', '0 0.1 0.2', '5 0.1 0.2'], & + 'depths must be strictly increasing') + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '-10 0', 'h', '0 0.1 0.2', '5 0.1 1/2'], & + 'is not a plain finite number') + CALL expect_failure('2', DYN, [CHARACTER(40) :: HEAD, '-10 0', 'h', '0 0.1 0.2', '5 0.1 0.2'], & + 'double-counting', 'uniform 0.2 0 0 current') + ! Currents 5: a missing, a repeated and an off-grid point, one time, a short coordinate line + CALL expect_failure('5', G4, [CHARACTER(40) :: '1 1 1 2', '0', '0', '0', '0 5', '0 0 0 0 0.1 0 0'], & + 'has no row for the grid point') + CALL expect_failure('5', G4, [CHARACTER(40) :: '1 1 1 2', '0', '0', '0', '0 5', '0 0 0 0 0.1 0 0', & + '0 0 0 0 0.1 0 0'], 'repeats a grid point') + CALL expect_failure('5', G4, [CHARACTER(40) :: '1 1 1 2', '0', '0', '0', '0 5', '0 0 0 0 0.1 0 0', & + '0 0 0 6 0.1 0 0'], 'off the grid') + CALL expect_failure('5', G4, [CHARACTER(40) :: '1 1 1 1', '0', '0', '0', '0', '0 0 0 0 0.1 0 0'], & + 'at least two times') + CALL expect_failure('5', G4, [CHARACTER(40) :: '2 1 1 2', '0', '0', '0', '0 5', '0 0 0 0 0.1 0 0'], & + 'must list the 2 x coordinates') + CALL expect_failure('5', G4, [CHARACTER(40) :: '1 1 2 2', '0', '0', '0 -1', '0 5', '0 0 0 0 0.1 0 0'], & + 'coordinates must be strictly increasing') + END SUBROUTINE check_rejections +END PROGRAM test_mdc_currents diff --git a/tests/test_mdc_currents_runs.py b/tests/test_mdc_currents_runs.py new file mode 100644 index 00000000..196b9123 --- /dev/null +++ b/tests/test_mdc_currents_runs.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +"""Standalone runs in the MoorDyn-C time-varying and gridded currents (Currents 2 and 5). + +The inputs are those of tests/data/currents_mdc (validation/scripts/currents_mdc_reference.py). +Gates, each run through the cabledyn driver with the line node tension channels Ten1N1..Ten1N21: + +* against MoorDyn-C v2.7.1 itself (ref_moordyn_c_tension.csv; a 70 m rope across the flow, held + at both ends, from rest in still water): the still-water tensions within 0.3 % of MoorDyn-C's, + and the tension change the current makes over 22 s (each code's run minus its own still-water + run) within 15 % of MoorDyn-C's largest change, for a depth profile that varies in time + (tension_c2) and for a grid sheared along the line, in depth and in time (tension_c5) (measured: + 0.8 % and 0.9 %; the still-water tensions 0.12 %); +* a second source of the same field, on the EI = 0 and the finite-EI routes: Currents 2 with the + steady profile at every time equals Currents 1 (c2const, c1), and the Currents 5 grid uniform in + x and y equals the Currents 2 profile (c5uniform, c2), every channel to the 8 significant digits + the .out file prints (measured: identical, and one unit of the last digit); +* the static start in a grid sheared along the line and in depth (the tension_c5 grid frozen in + time) is an equilibrium of the march on the EI = 0, the finite-EI and the point-connected EI = 0 + routes: over the first 2 s the tensions move by less than 1e-4 of the change the current makes + to the still-water start (a finite-EI static that samples the grid in its translated solve frame + instead of at the global node positions moves them by 0.8 of it). + +usage: test_mdc_currents_runs.py --exe --data --output +""" + +from __future__ import annotations + +import argparse +import os +import shutil +import subprocess +import sys +from pathlib import Path + +import numpy as np + +FAILURES: list[str] = [] +END_LINE = "------------------------- need this line --------------------------------------" +OUTPUTS = "---------------------- OUTPUTS -----------------------------------------\n" + "\n".join( + f"Ten1N{j}" for j in range(1, 22) +) + + +def check(ok: bool, message: str) -> None: + print(("PASS: " if ok else "FAIL: ") + message) + if not ok: + FAILURES.append(message) + + +def deck_text(path: Path, finite_ei: bool = False, tmax: float | None = None) -> str: + """The MoorDyn-C deck with the tension channels (and optionally EI > 0, another TMax).""" + lines = [] + for line in path.read_text().splitlines(): + parts = line.split() + if line.startswith("------------------------- need this line"): + lines.append(OUTPUTS) + if finite_ei and len(parts) == 10 and parts[0] in {"chain", "rope"}: + parts[5] = "2.0e3" + line = " ".join(parts) + if tmax is not None and len(parts) >= 2 and parts[1] == "TMax": + line = f"{tmax} TMax" + lines.append(line) + return "\n".join(lines) + "\n" + + +def run(exe: str, folder: Path, name: str, text: str, tables: list[Path]) -> np.ndarray | None: + """Run text in folder (with the current tables copied in); the .out rows, time first.""" + folder.mkdir(parents=True, exist_ok=True) + for table in tables: + shutil.copy2(table, folder / table.name) + (folder / f"{name}.dat").write_text(text, encoding="utf-8", newline="\n") + proc = subprocess.run([exe, f"{name}.dat", name], cwd=folder, capture_output=True, text=True, + env=dict(os.environ, OMP_NUM_THREADS="1")) + check(proc.returncode == 0, f"{folder.name}/{name} runs (exit {proc.returncode})") + if proc.returncode != 0: + print(proc.stdout[-2000:], proc.stderr[-2000:]) + return None + lines = (folder / f"{name}.out").read_text().splitlines() + head = next(i for i, line in enumerate(lines) if line.split() and line.split()[0].startswith("Time")) + return np.array([[float(v) for v in line.split()] for line in lines[head + 1:] + if line.strip() and not line.lstrip().startswith("(")]) + + +def tables(case: Path) -> list[Path]: + return sorted(case.glob("current_profile*.txt")) + + +def against_moordyn_c(exe: str, data: Path, out: Path) -> None: + """Node tensions of the tension cases against MoorDyn-C's.""" + series = {} + for case in ("tension_c0", "tension_c2", "tension_c5"): + src = data / case + cd = run(exe, out / case, "tension", deck_text(src / "tension.dat"), tables(src)) + if cd is None: + return + mdc = np.loadtxt(src / "ref_moordyn_c_tension.csv", delimiter=",", skiprows=1) + # CableDyn's rows every dtM at MoorDyn-C's output times; CableDyn node J (from End A) is + # MoorDyn-C node J - 1 + rows = np.searchsorted(cd[:, 0], mdc[:, 0] - 1.0e-9) + check(bool(np.all(np.abs(cd[rows, 0] - mdc[:, 0]) < 1.0e-6)), f"{case}: the output times correspond") + series[case] = (cd[rows, 1:22], mdc[:, 1:22]) + # interior nodes 2-20, where both codes report the mean of the two adjacent segment tensions + # (at an end MoorDyn-C reports the end segment's, CableDyn the line-end force) + cd0, mdc0 = series["tension_c0"] + still = np.abs(cd0[:, 1:20] - mdc0[:, 1:20]).max() / np.abs(mdc0[:, 1:20]).max() + check(still <= 3.0e-3, f"still water: node tensions within {still:.2e} of MoorDyn-C's (0.3 %)") + for case in ("tension_c2", "tension_c5"): + cd, mdc = series[case] + d_cd, d_mdc = cd - cd0, mdc - mdc0 + scale = np.abs(d_mdc[:, 1:20]).max() + err = np.abs(d_cd[:, 1:20] - d_mdc[:, 1:20]).max() + rms = np.sqrt(np.mean((d_cd[:, 1:20] - d_mdc[:, 1:20]) ** 2)) + check(err <= 0.03 * scale, + f"{case}: the tension change of the current, MoorDyn-C's largest {scale:.0f} N, matches to " + f"{err:.1f} N ({err / scale:.1%}, rms {rms / scale:.1%}) at nodes 2-20 over 22 s (3 %)") + + +def same_field(exe: str, data: Path, out: Path) -> None: + """Two sources of the same current give the same run, on both routes.""" + for case, other, label in (("c2const", "c1", "Currents 2 (a constant table) vs Currents 1"), + ("c5uniform", "c2", "Currents 5 (uniform in x and y) vs Currents 2")): + for finite in (False, True): + route = "finite-EI" if finite else "EI = 0" + a = run(exe, out / f"{case}_{int(finite)}", "run", + deck_text(data / case / "currents.dat", finite, tmax=8.0), tables(data / case)) + b = run(exe, out / f"{other}_{int(finite)}", "run", + deck_text(data / other / "currents.dat", finite, tmax=8.0), tables(data / other)) + if a is None or b is None: + continue + # the runs agree to the 8 significant digits the .out file prints (the fields differ + # by round-off, which the Newton iterations of the march may carry to the last digit) + ok = a.shape == b.shape + if ok: + unit = 10.0 ** (np.floor(np.log10(np.maximum(np.abs(b[:, 1:]), 1.0e-300))) - 7.0) + digits = np.abs(a[:, 1:] - b[:, 1:]) / unit + ok = bool(np.all(digits <= 1.01)) + print(f" {label}, {route}: largest difference {np.abs(a - b).max():.1e} N, " + f"{digits.max():.2f} units of the last printed digit") + check(ok, f"{label}, {route}: every channel the same to the last printed digit") + + +def static_start(exe: str, data: Path, out: Path) -> None: + """The static start in a sheared grid, frozen in time, is an equilibrium of the march.""" + src = (data / "tension_c5" / "current_profile_4d.txt").read_text().splitlines() + head, rows = src[:6], src[6:] + dims = head[0].split() + frozen = [" ".join(dims[:3] + ["2"])] + head[1:4] + ["0.0 100.0"] + [head[5]] + t_keep = "15.0" + for t_new in ("0.0", "100.0"): + for row in rows: + parts = row.split() + if parts[3] == t_keep: + parts[3] = t_new + frozen.append(" ".join(parts)) + for kind in ("EI = 0", "finite-EI", "EI = 0 with a free point"): + tag = kind.replace(" ", "_").replace("=", "") + folder = out / f"static_{tag}" + folder.mkdir(parents=True, exist_ok=True) + (folder / "current_profile_4d.txt").write_text("\n".join(frozen) + "\n", encoding="utf-8", newline="\n") + if kind == "EI = 0 with a free point": + text_cur = two_line_deck(5) + text_still = two_line_deck(0) + else: + finite = kind == "finite-EI" + text_cur = deck_text(data / "tension_c5" / "tension.dat", finite, tmax=2.0) + text_still = deck_text(data / "tension_c0" / "tension.dat", finite, tmax=2.0) + cur = run(exe, folder, "run", text_cur, []) + still = run(exe, out / f"still_{tag}", "run", text_still, []) + if cur is None or still is None: + continue + step = np.abs(cur[0, 1:] - still[0, 1:]).max() + drift = np.abs(cur[:, 1:] - cur[0, 1:]).max() + check(step > 0.05 * np.abs(still[0, 1:]).max() and drift <= 1.0e-4 * step, + f"{kind}: the static start in the sheared grid moves the tensions by {step:.0f} N from still " + f"water; the march then moves them by {drift:.2e} N ({drift / step:.1e}, 1e-4) over 2 s") + + +def two_line_deck(currents: int) -> str: + """The tension rope as two EI = 0 lines meeting at a free point (the point-connected route).""" + return f"""--------------------- MoorDyn Input File ------------------------------------ +two lines meeting at a free point (Currents {currents}) +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Free 4.0 0.0 -32.0 200 0.05 0.5 1.0 +3 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 35.0 10 - +2 rope 3 2 35.0 10 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM +2.0 TMax +1025.0 WtrDnsty +50 WtrDpth +0 WaveKin +{currents} Currents +{OUTPUTS.split(chr(10))[0]} +""" + "\n".join(f"Ten{line}N{j}" for line in (1, 2) for j in range(1, 12)) + f"\n{END_LINE}\n" + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--exe", required=True) + parser.add_argument("--data", required=True) + parser.add_argument("--output", required=True) + args = parser.parse_args() + data, out = Path(args.data), Path(args.output) + if out.exists(): + shutil.rmtree(out) + out.mkdir(parents=True) + against_moordyn_c(args.exe, data, out) + same_field(args.exe, data, out) + static_start(args.exe, data, out) + print(f"{len(FAILURES)} failure(s)") + return 1 if FAILURES else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/test_wavekin_modes.f90 b/tests/test_wavekin_modes.f90 index d85f2004..896e9b30 100644 --- a/tests/test_wavekin_modes.f90 +++ b/tests/test_wavekin_modes.f90 @@ -257,8 +257,8 @@ SUBROUTINE check_rejections() CALL expect_failure('2', '0', 'FFT_GRID') CALL expect_failure('4', '0', 'no kinematics source in MoorDyn-C') CALL expect_failure('6', '0', 'no kinematics source in MoorDyn-C') - CALL expect_failure('0', '2', 'current_profile_dynamic.txt') - CALL expect_failure('0', '5', 'current_profile_4d.txt') + CALL expect_failure('0', '3', 'no current source in MoorDyn-C') + CALL expect_failure('0', '4', 'no current source in MoorDyn-C') ! short-crested components (rows with different directions) OPEN (NEWUNIT=u, FILE='wave_frequencies.txt', STATUS='REPLACE', ACTION='WRITE') WRITE (u, '(A)') '0.0 0.0 0.0 0.0' diff --git a/validation/scripts/currents_mdc_reference.py b/validation/scripts/currents_mdc_reference.py new file mode 100644 index 00000000..26c6004e --- /dev/null +++ b/validation/scripts/currents_mdc_reference.py @@ -0,0 +1,231 @@ +# SPDX-License-Identifier: Apache-2.0 +"""Regenerate the MoorDyn-C current references of tests/data/currents_mdc. + +Every case folder holds a MoorDyn-C deck (currents.dat), its fixed-name current file and probe +points (points.txt, rows ``t x y z``). For each case this script writes + +* ``ref_python.csv``: the current evaluated here, independently of CableDyn, from the file as + MoorDyn-C v2.7.1 reads and interpolates it (constructDynamicCurrentGrid and + construct4DCurrentGrid of source/Waves/WaveGrid.cpp, CurrentGrid::getCurrentKin of + source/Waves.cpp): the table resampled at the smallest time interval dt from t = 0 to its last + time, linear in time between samples with the upper sample index taken modulo the sample count + (so the grid repeats past its last sample), and trilinear in x, y and z, held beyond the end + coordinates. ``Currents 2`` depths are read in single precision, as MoorDyn-C's ``stof``. + ``Currents 5`` rows are read from line 6 (a text line 6 is a header) and matched to the grid by + value. Currents 1 is a steady depth profile, linear in z and held beyond its end rows. +* ``ref_moordyn_c.csv`` (with ``--moordyn-c``): the same points from MoorDyn-C itself, through + validation/scripts/wavekin_mdc_probe.cpp compiled against a MoorDyn-C build (CD_MDC_SRC, + CD_MDC_BUILD and CD_GXX as for the bodies scripts). + +The tension case folders (tension_c0, tension_c2, tension_c5) hold a MoorDyn-C deck +(tension.dat) and its current file; with ``--moordyn-c`` each gets ``ref_moordyn_c_tension.csv``, +the line node tensions MoorDyn-C reports every 0.1 s over 22 s +(validation/scripts/currents_mdc_tension.cpp), which tests/test_mdc_currents_runs.py compares +with CableDyn's. + +Rows are ``t,x,y,z,zeta,ux,uy,uz,ax,ay,az`` (zeta and the accelerations zero: MoorDyn-C gives a +current no acceleration). The currents_mdc CTest compares CableDyn against both. +""" + +from __future__ import annotations + +import argparse +import math +import os +import shutil +import subprocess +import tempfile +from pathlib import Path + +import numpy as np + +REPO = Path(__file__).resolve().parents[2] +DATA = REPO / "tests" / "data" / "currents_mdc" +FILES = {1: "current_profile.txt", 2: "current_profile_dynamic.txt", 5: "current_profile_4d.txt"} + + +def tokens(line: str) -> list[str]: + """Whitespace tokens up to the first one holding '#' (MoorDyn-C's str::split).""" + out = [] + for tok in line.split(): + if "#" in tok: + break + out.append(tok) + return out + + +def currents_mode(deck: Path) -> int: + for line in deck.read_text().splitlines(): + parts = line.split() + if len(parts) >= 2 and parts[1].lower() == "currents": + return int(float(parts[0])) + raise ValueError(f"{deck}: no Currents option") + + +class Grid: + """A current tabulated on x, y, z and the times t, values v[3, nx, ny, nz, nt].""" + + def __init__(self, x, y, z, t_in, v_in): + self.x, self.y, self.z = (np.asarray(c, dtype=float) for c in (x, y, z)) + t_in = np.asarray(t_in, dtype=float) + self.dt = float(np.min(np.diff(t_in))) + self.nt = math.floor(t_in[-1] / self.dt) + 1 + ts = np.arange(self.nt) * self.dt + # linear in time, held at the end rows + flat = v_in.reshape(-1, len(t_in)) + self.v = np.array([np.interp(ts, t_in, row) for row in flat]).reshape(v_in.shape[:-1] + (self.nt,)) + + @staticmethod + def weights(c: np.ndarray, x: float) -> tuple[int, int, float]: + """Bracketing indices and the weight of the upper one, held beyond the ends.""" + if len(c) == 1 or x <= c[0]: + return 0, 0, 0.0 + if x >= c[-1]: + return len(c) - 1, len(c) - 1, 0.0 + i = int(np.searchsorted(c, x)) + return i - 1, i, (x - c[i - 1]) / (c[i] - c[i - 1]) + + def velocity(self, x: float, y: float, z: float, t: float) -> np.ndarray: + if self.nt > 1: + q = t / self.dt + n = math.floor(q) + ft = q - n + hi = (n + 1) % self.nt + lo = hi - 1 if hi > 0 else 0 + else: + lo = hi = 0 + ft = 0.0 + out = np.zeros(3) + for ia, ib, wx in [self.weights(self.x, x)]: + for ja, jb, wy in [self.weights(self.y, y)]: + for ka, kb, wz in [self.weights(self.z, z)]: + for i, wi in ((ia, 1.0 - wx), (ib, wx)): + for j, wj in ((ja, 1.0 - wy), (jb, wy)): + for k, wk in ((ka, 1.0 - wz), (kb, wz)): + w = wi * wj * wk + if w == 0.0: + continue + vt = self.v[:, i, j, k, lo] * (1.0 - ft) + self.v[:, i, j, k, hi] * ft + out += w * vt + return out + + +def read_steady(path: Path) -> Grid: + rows = [list(map(float, tokens(line))) for line in path.read_text().splitlines()[3:] if tokens(line)] + z = [r[0] for r in rows] + v = np.zeros((3, 1, 1, len(z), 2)) + for k, r in enumerate(rows): + for c in range(3): + v[c, 0, 0, k, :] = r[c + 1] if len(r) > c + 1 else 0.0 + return Grid([0.0], [0.0], z, [0.0, 1.0], v) + + +def read_dynamic(path: Path) -> Grid: + lines = path.read_text().splitlines() + z = [float(np.float32(tok)) for tok in tokens(lines[4])] + nz = len(z) + t, cols = [], [] + for line in lines[6:]: + tok = tokens(line) + if not tok: + continue + t.append(float(tok[0])) + vals = [float(s) for s in tok[1:]] + cols.append(vals + [0.0] * (3 * nz - len(vals))) + v = np.zeros((3, 1, 1, nz, len(t))) + for n, vals in enumerate(cols): + for c in range(3): + v[c, 0, 0, :, n] = vals[c * nz:(c + 1) * nz] + return Grid([0.0], [0.0], z, t, v) + + +def read_4d(path: Path) -> Grid: + lines = path.read_text().splitlines() + dims = [int(s) for s in tokens(lines[0])] + axes = [[float(s) for s in tokens(lines[k + 1])] for k in range(4)] + v = np.zeros((3, *dims)) + seen = np.zeros(dims, dtype=bool) + for k, line in enumerate(lines[5:]): + tok = tokens(line) + if not tok: + continue + try: + row = [float(s) for s in tok] + except ValueError: + if k == 0: + continue # a text header on line 6 + raise + idx = tuple(axes[a].index(row[a]) for a in range(4)) + assert not seen[idx], f"{path}: grid point repeated" + seen[idx] = True + v[(slice(None),) + idx] = row[4:7] + assert seen.all(), f"{path}: grid point missing" + return Grid(axes[0], axes[1], axes[2], axes[3], v) + + +def write_csv(path: Path, rows) -> None: + with open(path, "w", newline="\n") as fh: + fh.write("t,x,y,z,zeta,ux,uy,uz,ax,ay,az\n") + for t, x, y, z, u in rows: + fh.write(",".join(f"{v:.17g}" for v in (t, x, y, z, 0.0, *u, 0.0, 0.0, 0.0)) + "\n") + + +def python_reference(case: Path) -> None: + mode = currents_mode(case / "currents.dat") + grid = {1: read_steady, 2: read_dynamic, 5: read_4d}[mode](case / FILES[mode]) + points = np.loadtxt(case / "points.txt", ndmin=2) + write_csv(case / "ref_python.csv", [(t, x, y, z, grid.velocity(x, y, z, t)) for t, x, y, z in points]) + print(f"wrote {case / 'ref_python.csv'}") + + +def moordyn_c_reference(cases: list[Path], tension_cases: list[Path]) -> None: + """Run MoorDyn-C on the probe cases (wavekin_mdc_probe.cpp) and on the tension cases + (currents_mdc_tension.cpp: line node tensions every 0.1 s over TMax = 22 s).""" + src = Path(os.environ.get("CD_MDC_SRC", "MoorDyn")) + build = Path(os.environ.get("CD_MDC_BUILD", "MoorDyn-build")) + gxx = os.environ.get("CD_GXX", "g++") + dll = build / "source" / "libmoordyn.dll" + if not dll.exists(): + raise FileNotFoundError(f"MoorDyn-C library not found: {dll} (set CD_MDC_BUILD)") + with tempfile.TemporaryDirectory() as tmp: + work = Path(tmp) + env = dict(os.environ) + env["PATH"] = str(Path(gxx).parent) + os.pathsep + str(work) + os.pathsep + env.get("PATH", "") + exes = {} + for name in ("wavekin_mdc_probe", "currents_mdc_tension"): + exes[name] = work / f"{name}.exe" + subprocess.run([gxx, "-O2", "-std=c++17", f"-I{src / 'source'}", f"-I{build / 'source'}", + str(REPO / "validation" / "scripts" / f"{name}.cpp"), str(dll), "-o", str(exes[name])], + check=True, env=env) + shutil.copy2(dll, work / "libmoordyn.dll") + for case in cases + tension_cases: + run = work / case.name + run.mkdir() + for f in case.iterdir(): + if not f.name.startswith("ref_"): + shutil.copy2(f, run / f.name) + if case in cases: + args, out = [str(exes["wavekin_mdc_probe"]), "currents.dat", "points.txt", "out.csv"], "ref_moordyn_c.csv" + else: + args, out = [str(exes["currents_mdc_tension"]), "tension.dat", "0.1", "22.0", "out.csv"], \ + "ref_moordyn_c_tension.csv" + subprocess.run(args, cwd=run, check=True, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + # the repository keeps LF line endings (the probes write CRLF on Windows) + (case / out).write_bytes((run / "out.csv").read_bytes().replace(b"\r\n", b"\n")) + print(f"wrote {case / out}") + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--moordyn-c", action="store_true", help="also run MoorDyn-C on every case") + args = parser.parse_args() + cases = sorted(p for p in DATA.iterdir() if (p / "currents.dat").exists()) + tension_cases = sorted(p for p in DATA.iterdir() if (p / "tension.dat").exists()) + for case in cases: + python_reference(case) + if args.moordyn_c: + moordyn_c_reference(cases, tension_cases) + + +if __name__ == "__main__": + main() diff --git a/validation/scripts/currents_mdc_tension.cpp b/validation/scripts/currents_mdc_tension.cpp new file mode 100644 index 00000000..5788d9a0 --- /dev/null +++ b/validation/scripts/currents_mdc_tension.cpp @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: Apache-2.0 +// Line node tensions of a MoorDyn-C deck whose coupled points are held at their deck positions. +// +// currents_mdc_tension +// +// The system is initialised (the deck's TmaxIC sets the stationary initial condition) and stepped +// to t_end in steps of dt_out (MoorDyn-C sub-steps each at the deck's dtM). Output rows: +// "t,T0,...,TN" with Tk the tension magnitude MoorDyn_GetLineNodeTen reports at node k of line 1 +// (the mean of the adjacent segment tensions at an interior node). +#include "MoorDyn2.h" + +#include +#include +#include +#include +#include + +int +main(int argc, char** argv) +{ + if (argc != 5) { + std::cerr << "usage: currents_mdc_tension " << std::endl; + return 2; + } + const double dt_out = std::atof(argv[2]), t_end = std::atof(argv[3]); + MoorDyn system = MoorDyn_Create(argv[1]); + if (!system) + return 3; + unsigned int n_dof = 0, n_points = 0; + if (MoorDyn_NCoupledDOF(system, &n_dof) != MOORDYN_SUCCESS || + MoorDyn_GetNumberPoints(system, &n_points) != MOORDYN_SUCCESS) + return 3; + std::vector x, dx(n_dof, 0.0); + for (unsigned int i = 1; i <= n_points; i++) { + MoorDynPoint point = MoorDyn_GetPoint(system, i); + int type = 0; + double pos[3]; + if (!point || MoorDyn_GetPointType(point, &type) != MOORDYN_SUCCESS || + MoorDyn_GetPointPos(point, pos) != MOORDYN_SUCCESS) + return 3; + if (type == -1) + x.insert(x.end(), pos, pos + 3); + } + if (x.size() != n_dof) { + std::cerr << "the deck may couple points only" << std::endl; + return 3; + } + std::vector f(n_dof + 3, 0.0); + if (MoorDyn_Init(system, x.data(), dx.data()) != MOORDYN_SUCCESS) + return 4; + MoorDynLine line = MoorDyn_GetLine(system, 1); + unsigned int n = 0; + if (!line || MoorDyn_GetLineN(line, &n) != MOORDYN_SUCCESS) + return 5; + FILE* out = std::fopen(argv[4], "w"); + if (!out) + return 6; + std::fprintf(out, "t"); + for (unsigned int k = 0; k <= n; k++) + std::fprintf(out, ",T%u", k); + std::fprintf(out, "\n"); + const long nstep = std::lround(t_end / dt_out); + double t = 0.0; + for (long s = 0; s <= nstep; s++) { + if (s > 0) { + double dt = dt_out; + if (MoorDyn_Step(system, x.data(), dx.data(), f.data(), &t, &dt) != MOORDYN_SUCCESS) + return 7; + } + std::fprintf(out, "%.10g", t); + for (unsigned int k = 0; k <= n; k++) { + double ten[3]; + MoorDyn_GetLineNodeTen(line, k, ten); + std::fprintf(out, ",%.10g", std::sqrt(ten[0] * ten[0] + ten[1] * ten[1] + ten[2] * ten[2])); + } + std::fprintf(out, "\n"); + } + std::fclose(out); + MoorDyn_Close(system); + return 0; +} From cb1d4361ba3a5bf5c03c04ca3012863b8306163b Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 18:44:07 +0900 Subject: [PATCH 07/10] fix(currents): a current below the chord in the EI = 0 static start; C API clock The EI = 0 model build decided whether its static start carries a current from the node velocities sampled on the straight chord, so a current that is zero along the chord but not where the line sags (a depth profile, a Currents 2/5 grid) was left out: the start was solved in still water and the march drifted (192 N in 4 s on a 70 m rope with its ends at z = -20 m in 0.8 m/s below z = -32 m; the same with Currents 1). The decision now looks at the field itself: the node velocities, the profile, or the grid's t = 0 sample. With the current in, the static Newton needs the current's gradient along the line (the load moves with the nodes through the re-sampled fluid velocity): the EI = 0 static tangent adds -(d load/d v) du/dx at each node (CD_Current_Profile_Gradient, CD_Current_Grid_Gradient), without which that start did not converge. A later current row also discards the levels of an earlier profile row. The point-system shells of the C API and OpenFAST (CD_Init_Deck_System) have no simulation clock and held a Currents 2/5 table at its t = 0 value without a word. A table that varies in time is now refused, as deck waves are; one constant in time is the steady field the shells apply, as Currents 1. A grid holds at most 2e6 resampled samples (48 MB): every static current object keeps its own copy. The cross-plane test of the finite-EI static frame reads the grid's t = 0 sample, the field the static start sees (the march holds only the end translations). The aggregate-route and coupled refusals and the dtM message name Currents 2/5. The docs qualify the static start: MoorDyn-C's default stationary initial condition takes the t = 0 current, its legacy dynamic relaxation samples it in time. Gates: test_mdc_currents_runs, the off-chord decks (Currents 1 and 2 on the EI = 0 route, Currents 2 finite-EI): the march holds the start to 0 N (EI = 0) and 1e-4 N (finite-EI) over 4 s, and the EI = 0 start is within 0.14 % of the finite-EI one; test_c_api and test_native_model: a Currents 2 table that varies in time is refused naming the missing clock, a constant one initialises; step_allocations_current_grid: 20000 grid velocity and gradient evaluations make no heap allocation. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 11 +- CMakeLists.txt | 3 + doc/capi.rst | 8 +- doc/driver_format.md | 8 +- python/cabledyn/deck_file.py | 6 +- python/tests/test_native_model.py | 20 ++++ src/CableDyn_DeckDriver.f90 | 64 +++++++--- src/CableDyn_Hydro.f90 | 109 +++++++++++++++++- src/CableDyn_Model.f90 | 13 ++- src/CableDyn_Static.f90 | 22 +++- tests/data/currents_mdc/offchord/c1.dat | 25 ++++ tests/data/currents_mdc/offchord/c2.dat | 25 ++++ .../currents_mdc/offchord/current_profile.txt | 7 ++ .../offchord/current_profile_dynamic.txt | 8 ++ tests/test_c_api.f90 | 82 +++++++++++++ tests/test_mdc_currents_runs.py | 34 +++++- tests/test_step_allocations.f90 | 61 +++++++++- 17 files changed, 476 insertions(+), 30 deletions(-) create mode 100644 tests/data/currents_mdc/offchord/c1.dat create mode 100644 tests/data/currents_mdc/offchord/c2.dat create mode 100644 tests/data/currents_mdc/offchord/current_profile.txt create mode 100644 tests/data/currents_mdc/offchord/current_profile_dynamic.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index b8cd9c74..c8c739e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -150,7 +150,8 @@ All notable changes to CableDyn are recorded in this file. The format follows times the current is identical to MoorDyn-C v2.7.1's; a constant table equals `Currents 1` and a grid uniform in x and y equals `Currents 2`; on a 70 m rope the tension change of a time-varying and of a sheared current matches MoorDyn-C's within 0.9 %, and the static start in a sheared grid - holds the tensions to 1.4e-7 of the change the current makes. + holds the tensions to 1.4e-7 of the change the current makes. The C API, without a clock, + refuses a table that varies in time. ### Changed @@ -220,6 +221,14 @@ All notable changes to CableDyn are recorded in this file. The format follows and where a light rope's steep residual (BA_s|BA_d = 1e4|1e3) changes sign between two adjacent reals it returns that root to machine precision. Over 440,000 fuzzed states every solve that converged before is bit-identical, and the 26 that failed now converge. +- The static start of an `EI = 0` line now carries a deck current that is zero along the + straight chord between its ends but not where the line sags (a depth profile or a current + grid): it was solved in still water and the march drifted toward the current's equilibrium. + On a 70 m rope with its ends at z = -20 m in 0.8 m/s below z = -32 m the start now holds to + machine precision (it drifted 192 N in 4 s) and agrees with the finite-EI route within 0.14 %. + The static tangent takes the current's gradient along the line, so the Newton iteration also + converges in a current sheared across the line. A later `current` row now discards the levels + of an earlier profile row. - A deck with a WaterKin elevation history (`WaveKinMod 1`) at `TMax = 0`, a check of the static start, reduces the record over its own length instead of failing for want of a positive `TMax`. diff --git a/CMakeLists.txt b/CMakeLists.txt index ec833d74..8cee131c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1430,6 +1430,9 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_ID STREQUAL "GN # And with the nodal twist (polar inertia, torsional damping, the 7-DOF-per-node band). add_test(NAME step_allocations_nodal_twist COMMAND test_step_allocations nodal) set_tests_properties(step_allocations_nodal_twist PROPERTIES LABELS "fortran;dynamic;memory") + # And the MoorDyn-C current grid (Currents 2 and 5) every standalone step samples at the nodes. + add_test(NAME step_allocations_current_grid COMMAND test_step_allocations current_grid) + set_tests_properties(step_allocations_current_grid PROPERTIES LABELS "fortran;dynamic;memory") endif() add_executable(test_snap_load tests/test_snap_load.f90) diff --git a/doc/capi.rst b/doc/capi.rst index 6b4aa23a..75e5faae 100644 --- a/doc/capi.rst +++ b/doc/capi.rst @@ -943,6 +943,9 @@ The deck is validated under the standalone-deck rules: * - a ``waves`` option (regular or JONSWAP deck waves) - the standalone driver; supply time-varying fluid kinematics through ``CableDyn_UpdatePointFluidFields`` + * - a MoorDyn-C ``Currents 2``/``5`` table that varies in time + - the standalone driver; supply time-varying fluid kinematics through + ``CableDyn_UpdatePointFluidFields`` * - FAST.Farm ``Turbine`` points - the OpenFAST module in FAST.Farm * - ``frictionMu`` in a deck that has ``Free`` or ``Connect`` points @@ -952,8 +955,9 @@ The deck is validated under the standalone-deck rules: .. important:: The C ABI has no simulation clock and no per-node fluid input. A deck's current is applied - as a steady field. A deck with a ``waves`` option is rejected with ``CD_C_BAD_INPUT``, - because its waves could not be evaluated. Time-varying fluid kinematics reach the ``Free`` + as a steady field. A deck with a ``waves`` option, or a MoorDyn-C ``Currents 2``/``5`` table + that varies in time, is rejected with ``CD_C_BAD_INPUT``, because it could not be evaluated + in time; such a table constant in time is applied as the steady field. Time-varying fluid kinematics reach the ``Free`` and ``Connect`` points through ``CableDyn_UpdatePointFluidFields``. Parse and validation failures, including a file that cannot be opened, return diff --git a/doc/driver_format.md b/doc/driver_format.md index 3eeffc9a..bd55c354 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1256,7 +1256,13 @@ every node's position and time as MoorDyn-C interpolates them. Standalone decks node elevation is not stretched; - the current has no fluid acceleration (MoorDyn-C sets it to zero), so its time variation adds no Froude-Krylov or added-mass load; -- the static start takes the current at `t = 0`, as MoorDyn-C's initial condition does; +- the static start takes the current at `t = 0`, as MoorDyn-C's default stationary initial + condition does (its legacy dynamic relaxation, `ICgenDynamic 1`, samples the current over the + relaxation time instead); +- a grid holds at most 2e6 resampled points in space and time (every static solve holds a copy, + 48 MB at the limit); +- the C API and the OpenFAST point-system shells have no simulation clock: they apply a current + constant in time as a steady field, as `Currents 1`, and refuse one that varies in time; - `current_profile_4d.txt` is read as MoorDyn-C documents it, which MoorDyn-C v2.7.1 does not quite do: it reads its rows from line 7, so a row on line 6 leaves that grid point at zero, and it matches a row to the grid by the text of its coordinates, so a row writing `-0` for `0` or diff --git a/python/cabledyn/deck_file.py b/python/cabledyn/deck_file.py index 776c5c62..474539f4 100644 --- a/python/cabledyn/deck_file.py +++ b/python/cabledyn/deck_file.py @@ -2507,7 +2507,7 @@ def effective(key: str, default: float) -> float: f"{self._label}: OPTION TMax must be an integer multiple of dtM" ) # MoorDyn-C WaveKin 3/7 and Currents 1/2/5 (native read_moordyn_c_kinematics): component - # waves and a steady current profile read from fixed-name files in the deck folder. + # waves and a current profile or grid read from fixed-name files in the deck folder. # The coupled aggregate takes its water kinematics from the host and rejects both. waterkin_row = option_by_key.get("waterkin") currents_row = option_by_key.get("currents") @@ -2515,8 +2515,8 @@ def effective(key: str, default: float) -> float: mdc_currents = _moordyn_c_currents(None if currents_row is None else currents_row.values[0]) if self.caller_driven and (mdc_wave_kin or mdc_currents): raise DeckFormatError( - f"{self._label}: the MoorDyn-C WaveKin 3/7 and Currents 1 files are not supported " - "on the coupled route (coupled runs take water kinematics from the host)" + f"{self._label}: the MoorDyn-C WaveKin 3/7 and Currents 1/2/5 files are not " + "supported on the coupled route (coupled runs take water kinematics from the host)" ) # Native apply_option: motionFile, vesselMotion and vesselRAO are alternative # sources of one prescribed motion; activating a second one is an error, and a diff --git a/python/tests/test_native_model.py b/python/tests/test_native_model.py index 9039d5a5..9e8b1e61 100644 --- a/python/tests/test_native_model.py +++ b/python/tests/test_native_model.py @@ -86,6 +86,26 @@ def tracking_close(self: model_module.CableDyn) -> None: assert caught.value.status != 0 and caught.value.detail +def test_a_deck_current_that_varies_in_time_is_refused_without_a_clock(tmp_path): + # The C ABI has no simulation clock: a MoorDyn-C Currents 2 table that varies in time is + # refused like deck waves; the same deck with a table constant in time applies it steadily. + case = REPO / "tests" / "data" / "currents_mdc" / "tension_c2" + deck = tmp_path / "tension.dat" + deck.write_bytes((case / "tension.dat").read_bytes()) + table = tmp_path / "current_profile_dynamic.txt" + table.write_bytes((case / "current_profile_dynamic.txt").read_bytes()) + with cabledyn.CableDyn() as m: + with pytest.raises(CableDynError): + m.init_deck(deck) + assert "no simulation clock" in m.last_error() + assert "Currents 2" in m.last_error() + table.write_text( + "h\nh\n\n\n-50.0 0.0\nt ux\n0.0 0.4 0.6\n10.0 0.4 0.6\n", encoding="utf-8", newline="\n" + ) + with cabledyn.CableDyn(deck) as m: + assert m.n_lines == 1 + + def test_last_error_reports_the_library_diagnostic(): with cabledyn.CableDyn() as m: with pytest.raises(CableDynError) as caught: diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index b3810f86..8dc6a6fa 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -1312,6 +1312,17 @@ SUBROUTINE CD_Init_Deck_System(deck_path, system, dtM, gravity, rho_water, ErrSt 'fluid kinematics with CableDyn_UpdatePointFluidFields') RETURN END IF + ! Without a clock a current is held at its t = 0 value, the steady field the embedded system + ! applies (as Currents 1): a Currents 2/5 table that varies in time is refused like waves, + ! one constant in time (a steady depth profile or grid) is applied. + IF (opts%has_current_grid) THEN + IF (current_grid_varies_in_time(opts%current_grid)) THEN + CALL fail(ErrStat, ErrMsg, 'CD_Init_Deck_System does not apply a deck current that varies in time '// & + '(Currents '//TRIM(int_to_str(opts%mdc_currents))//'): the embedded system has no simulation '// & + 'clock; supply time-varying fluid kinematics with CableDyn_UpdatePointFluidFields') + RETURN + END IF + END IF dtM = MERGE(opts%dtM, CD_ZERO, opts%has_dtm) gravity = opts%g rho_water = opts%rhoW @@ -1996,18 +2007,18 @@ RECURSIVE SUBROUTINE build_one_hermite_cable(ln, sections, types, points, opts, ! static equilibrium is then solved in 3D as well. IF (opts%has_current) THEN IF (opts%has_current_grid) THEN - ! a current grid (Currents 2 and 5): every sample of it, in space and time + ! a current grid (Currents 2 and 5): the static start takes its t = 0 sample, every point + ! of it; the march is free out of the plane whatever the later samples hold (its held + ! DOFs are the end translations only) BLOCK - INTEGER :: ix, iy, iz, it - DO it = 1, opts%current_grid%nt - DO iz = 1, SIZE(opts%current_grid%z) - DO iy = 1, SIZE(opts%current_grid%y) - DO ix = 1, SIZE(opts%current_grid%x) - IF (ABS(-frame_cs(2)*opts%current_grid%velocity(1, ix, iy, iz, it) + & - frame_cs(1)*opts%current_grid%velocity(2, ix, iy, iz, it)) > & - 64.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, NORM2(opts%current_grid%velocity(:, ix, iy, iz, it)))) & - require_3d_static = .TRUE. - END DO + INTEGER :: ix, iy, iz + DO iz = 1, SIZE(opts%current_grid%z) + DO iy = 1, SIZE(opts%current_grid%y) + DO ix = 1, SIZE(opts%current_grid%x) + IF (ABS(-frame_cs(2)*opts%current_grid%velocity(1, ix, iy, iz, 1) + & + frame_cs(1)*opts%current_grid%velocity(2, ix, iy, iz, 1)) > & + 64.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, NORM2(opts%current_grid%velocity(:, ix, iy, iz, 1)))) & + require_3d_static = .TRUE. END DO END DO END DO @@ -7320,7 +7331,7 @@ SUBROUTINE CD_Init_Deck_Aggregate(deck_path, dt, agg, ErrStat, ErrMsg, env_gravi RETURN END IF IF (opts%mdc_wave_kin > 0 .OR. opts%mdc_currents > 0) THEN - CALL fail(ErrStat, ErrMsg, 'the MoorDyn-C WaveKin 3/7 and Currents 1 files are not supported on the '// & + CALL fail(ErrStat, ErrMsg, 'the MoorDyn-C WaveKin 3/7 and Currents 1/2/5 files are not supported on the '// & 'aggregate route (coupled runs take water kinematics from the host; standalone mixed '// & 'EI=0/finite-EI decks reject deck water kinematics)') RETURN @@ -13292,6 +13303,9 @@ SUBROUTINE read_moordyn_c_kinematics(dir, opts, ErrStat, ErrMsg) !! 7). A row's coordinates are matched by value. !! Both are resampled in time as MoorDyn-C does and evaluated at every node position and !! time (CD_Current_Grid_Resample, CD_Current_Grid_Velocity), with no fluid acceleration. + !! The static start takes the t = 0 current, as MoorDyn-C's default stationary initial + !! condition does (its legacy dynamic relaxation, ICgenDynamic 1, samples the current over + !! the relaxation time instead). CHARACTER(*), INTENT(IN) :: dir TYPE(DeckOptions), INTENT(INOUT) :: opts INTEGER, INTENT(OUT) :: ErrStat @@ -13681,7 +13695,7 @@ END SUBROUTINE read_dynamic_profile SUBROUTINE read_4d_grid() !! Currents 5: current_profile_4d.txt into opts%current_grid. - INTEGER(int64), PARAMETER :: MAX_POINTS = 10000000_int64 + INTEGER(int64), PARAMETER :: MAX_POINTS = 2000000_int64 CHARACTER(:), ALLOCATABLE :: buf INTEGER, ALLOCATABLE :: lo(:), hi(:) REAL(wp), ALLOCATABLE :: xc(:), yc(:), zc(:), tc(:), v5(:, :, :, :, :) @@ -13722,7 +13736,7 @@ SUBROUTINE read_4d_grid() npts = PRODUCT(INT(dims, int64)) IF (npts > MAX_POINTS) THEN CLOSE (unit) - CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' declares more than 1e7 grid points') + CALL fail(ErrStat, ErrMsg, 'Currents 5: '//TRIM(fname)//' declares more than 2e6 grid points') RETURN END IF DEALLOCATE (xc, yc, zc, tc, v5, seen) @@ -15947,6 +15961,9 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) opts%current_velocity = [x1, x2, x3] opts%has_current = .TRUE. opts%has_current_profile = .FALSE. + ! last row wins: an earlier profile row leaves no levels behind + IF (ALLOCATED(opts%current_profile_z)) DEALLOCATE (opts%current_profile_z) + IF (ALLOCATED(opts%current_profile_velocity)) DEALLOCATE (opts%current_profile_velocity) RETURN ELSE IF (to_lower(TRIM(kw)) == 'waves' .OR. to_lower(TRIM(kw)) == 'wave') THEN IF (to_lower(TRIM(mode)) /= 'airy' .AND. to_lower(TRIM(mode)) /= 'stream' .AND. & @@ -16312,6 +16329,8 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) opts%has_current = .FALSE. opts%current_velocity = CD_ZERO opts%has_current_profile = .FALSE. + IF (ALLOCATED(opts%current_profile_z)) DEALLOCATE (opts%current_profile_z) + IF (ALLOCATED(opts%current_profile_velocity)) DEALLOCATE (opts%current_profile_velocity) ELSE CALL fail(ErrStat, ErrMsg, 'OPTION current supports "none current" or "uniform vx vy vz current"') END IF @@ -17151,6 +17170,10 @@ SUBROUTINE finalize_checks(types, bodies, rod_types, rods, points, lines, sectio IF (opts%has_current) THEN ! A caller-driven (coupled) deck takes its clock from the host, as for frictionMu. IF (.NOT. caller_driven .AND. .NOT. opts%has_dtm) THEN + IF (opts%mdc_currents > 0) THEN + CALL fail(ErrStat, ErrMsg, 'standalone Currents '//TRIM(int_to_str(opts%mdc_currents))// & + ' requires dtM and TMax'); RETURN + END IF CALL fail(ErrStat, ErrMsg, 'standalone OPTION current requires dtM and TMax'); RETURN END IF IF (.NOT. ALL(IEEE_IS_FINITE(opts%current_velocity))) THEN @@ -30616,6 +30639,19 @@ FUNCTION deck_current_velocity(opts, pos, time, ErrStat, ErrMsg) RESULT(velocity END IF END FUNCTION deck_current_velocity + PURE LOGICAL FUNCTION current_grid_varies_in_time(grid) RESULT(varies) + !! Whether a current grid holds a sample that differs from its t = 0 sample. + TYPE(CD_CurrentGridType), INTENT(IN) :: grid + INTEGER :: n + varies = .FALSE. + DO n = 2, grid%nt + IF (ANY(ABS(grid%velocity(:, :, :, :, n) - grid%velocity(:, :, :, :, 1)) > CD_ZERO)) THEN + varies = .TRUE. + RETURN + END IF + END DO + END FUNCTION current_grid_varies_in_time + PURE FUNCTION line_node_pos(anchor, fairlead, l0, node_id) RESULT(x) !! Straight-line position estimate for initial environment fields before !! the persistent line model exposes its static equilibrium state. diff --git a/src/CableDyn_Hydro.f90 b/src/CableDyn_Hydro.f90 index cbaae55c..a8bd802b 100644 --- a/src/CableDyn_Hydro.f90 +++ b/src/CableDyn_Hydro.f90 @@ -27,6 +27,7 @@ MODULE CableDyn_Hydro PUBLIC :: CD_Solve_Dispersion_Wavenumber PUBLIC :: CD_Current_Profile_Velocity PUBLIC :: CD_CurrentGridType, CD_Current_Grid_Resample, CD_Current_Grid_Velocity + PUBLIC :: CD_Current_Grid_Gradient, CD_Current_Profile_Gradient PUBLIC :: CD_SeaState_Steady_Current PUBLIC :: CD_Airy_Wave_Kinematics PUBLIC :: CD_Airy_Wave_Kinematics_Precomputed @@ -62,8 +63,9 @@ MODULE CableDyn_Hydro REAL(wp), PARAMETER :: DEG2RAD = PI/180.0_wp REAL(wp), PARAMETER :: MIN_TANGENT_NORM = 1.0e-12_wp INTEGER, PARAMETER :: CD_JONSWAP_COMPONENTS = 200 - ! largest resampled current grid (nx ny nz nt samples of three velocity components) - INTEGER(INT64), PARAMETER :: MAX_CURRENT_GRID_SAMPLES = 10000000_INT64 + ! largest resampled current grid (nx ny nz nt samples of three velocity components, 48 MB): + ! every static current object (each line's static solve) holds its own copy of the grid + INTEGER(INT64), PARAMETER :: MAX_CURRENT_GRID_SAMPLES = 2000000_INT64 ! A current tabulated on a rectilinear grid in space and time, as MoorDyn-C (v2.7.1) holds its ! time-varying currents (moordyn::waves::CurrentGrid of source/Waves.hpp): coordinates x, y, z @@ -1737,7 +1739,7 @@ SUBROUTINE CD_Current_Grid_Resample(x, y, z, t_in, v_in, grid, ErrStat, ErrMsg) END IF nt64 = FLOOR(t_in(m)/dt, KIND=INT64) + 1_INT64 IF (nt64*INT(SIZE(x), INT64)*INT(SIZE(y), INT64)*INT(SIZE(z), INT64) > MAX_CURRENT_GRID_SAMPLES) THEN - CALL fail(ErrStat, ErrMsg, 'current grid: more than 1e7 resampled space-time samples; coarsen the grid or '// & + CALL fail(ErrStat, ErrMsg, 'current grid: more than 2e6 resampled space-time samples; coarsen the grid or '// & 'its smallest time interval'); RETURN END IF IF (.NOT. CD_All_Finite(RESHAPE(v_in, [SIZE(v_in)]))) THEN @@ -1835,6 +1837,107 @@ SUBROUTINE CD_Current_Grid_Velocity(grid, pos, time, velocity, ErrStat, ErrMsg) velocity = c0*(CD_ONE - fz) + c1*fz END SUBROUTINE CD_Current_Grid_Velocity + SUBROUTINE CD_Current_Profile_Gradient(z, z_profile, velocity_profile, gradient) + !! The gradient d(velocity)/d(position) (3 x 3, column j the derivative along x_j) of the + !! depth profile of CD_Current_Profile_Velocity at elevation z: (u_(k+1) - u_k)/(z_(k+1) - z_k) + !! in the z column inside a segment, zero where the profile is held beyond its end levels. + !! For a Newton tangent: the caller has validated the profile. + REAL(wp), INTENT(IN) :: z, z_profile(:), velocity_profile(:, :) + REAL(wp), INTENT(OUT) :: gradient(3, 3) + INTEGER :: n, k, seg + REAL(wp) :: denom, alpha + gradient = CD_ZERO + n = SIZE(z_profile) + IF (n < 2) RETURN + seg = 1 + DO k = 2, n - 1 + IF (z >= z_profile(k)) seg = k + END DO + denom = z_profile(seg + 1) - z_profile(seg) + alpha = (z - z_profile(seg))/denom + IF (alpha > CD_ZERO .AND. alpha < CD_ONE) & + gradient(:, 3) = (velocity_profile(:, seg + 1) - velocity_profile(:, seg))/denom + END SUBROUTINE CD_Current_Profile_Gradient + + SUBROUTINE CD_Current_Grid_Gradient(grid, pos, time, gradient, ErrStat, ErrMsg) + !! The gradient d(velocity)/d(position) (3 x 3, column j the derivative along x_j) of the + !! current of CD_Current_Grid_Velocity at pos and time: the derivative of its trilinear + !! blend, zero along an axis where the grid is held beyond its end coordinates (or has a + !! single coordinate). For a Newton tangent. + TYPE(CD_CurrentGridType), INTENT(IN) :: grid + REAL(wp), INTENT(IN) :: pos(3), time + REAL(wp), INTENT(OUT) :: gradient(3, 3) + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp) :: f(3), g(3), ft, q, c(3, 0:1, 0:1, 0:1), w(0:1, 3), dw(0:1, 3) + INTEGER :: iu(3), il(3), it, it0, i, j, k, a + INTEGER(INT64) :: n + + gradient = CD_ZERO + ErrStat = CD_HYDRO_OK + ErrMsg = '' + IF (.NOT. (CD_All_Finite(pos) .AND. CD_Is_Finite(time))) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: position and time must be finite'); RETURN + END IF + IF (.NOT. ALLOCATED(grid%velocity)) THEN + CALL fail(ErrStat, ErrMsg, 'current grid is not set'); RETURN + END IF + CALL axis(grid%x, pos(1), 1) + CALL axis(grid%y, pos(2), 2) + CALL axis(grid%z, pos(3), 3) + it = 1 + ft = CD_ZERO + IF (grid%nt > 1) THEN + IF (.NOT. MAX(time, CD_ZERO)/1.0e18_wp < grid%dt) THEN + CALL fail(ErrStat, ErrMsg, 'current grid: time beyond 1e18 grid time steps'); RETURN + END IF + q = MAX(time, CD_ZERO)/grid%dt + n = FLOOR(q, KIND=INT64) + ft = q - REAL(n, wp) + it = INT(MOD(n + 1_INT64, INT(grid%nt, INT64))) + 1 + END IF + it0 = MAX(it - 1, 1) + DO k = 0, 1 + DO j = 0, 1 + DO i = 0, 1 + c(:, i, j, k) = grid%velocity(:, MERGE(iu(1), il(1), i == 1), MERGE(iu(2), il(2), j == 1), & + MERGE(iu(3), il(3), k == 1), it0)*(CD_ONE - ft) + & + grid%velocity(:, MERGE(iu(1), il(1), i == 1), MERGE(iu(2), il(2), j == 1), & + MERGE(iu(3), il(3), k == 1), it)*ft + END DO + END DO + END DO + DO a = 1, 3 + w(0, a) = CD_ONE - f(a) + w(1, a) = f(a) + dw(0, a) = -g(a) + dw(1, a) = g(a) + END DO + DO k = 0, 1 + DO j = 0, 1 + DO i = 0, 1 + gradient(:, 1) = gradient(:, 1) + dw(i, 1)*w(j, 2)*w(k, 3)*c(:, i, j, k) + gradient(:, 2) = gradient(:, 2) + w(i, 1)*dw(j, 2)*w(k, 3)*c(:, i, j, k) + gradient(:, 3) = gradient(:, 3) + w(i, 1)*w(j, 2)*dw(k, 3)*c(:, i, j, k) + END DO + END DO + END DO + + CONTAINS + + SUBROUTINE axis(xp, x, a_) + !! Bracket, factor and d(factor)/dx along axis a_ (zero where the grid is held). + REAL(wp), INTENT(IN) :: xp(:), x + INTEGER, INTENT(IN) :: a_ + CALL grid_factor(xp, x, iu(a_), f(a_)) + il(a_) = MAX(iu(a_) - 1, 1) + g(a_) = CD_ZERO + IF (SIZE(xp) > 1) THEN + IF (x > xp(1) .AND. x < xp(SIZE(xp))) g(a_) = CD_ONE/(xp(iu(a_)) - xp(il(a_))) + END IF + END SUBROUTINE axis + END SUBROUTINE CD_Current_Grid_Gradient + PURE SUBROUTINE grid_factor(xp, x, iu, f) !! MoorDyn-C's interp_factor (source/Util/Interp.hpp) on 1-based coordinates xp: the upper !! bracketing index iu and the factor f of the blend a (1 - f) + b f between xp(iu - 1) and diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index ce916d57..02038957 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -1544,6 +1544,7 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra ! A current grid in space and time (MoorDyn-C Currents 2 and 5): the static initial condition ! then samples it at each node's own position at t = 0, in place of the depth profile. TYPE(CD_CurrentGridType), INTENT(IN), OPTIONAL :: current_grid + LOGICAL :: field_on ! Static seabed friction (with seabed_mu > 0 on a seabed): the policy ! (CD_STATIC_FRICTION_AS_LAID or CD_STATIC_FRICTION_NONE, the default), the lay azimuth ! [rad, from global +x toward +y; default: the horizontal direction of the chord from @@ -1722,10 +1723,20 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra ! strut. A steady current enters as Morison drag on the line at rest, with the node ! velocities and element hydrodynamics the dynamic model is built with, so the first ! dynamic step starts from equilibrium. + ! The static start carries the current wherever the field is non-zero: in the node + ! velocities, in the depth profile or in the current grid at t = 0 (the node velocities are + ! sampled on the straight chord, where a current below the chord would be missed). use_current = .FALSE. IF (PRESENT(fluid_velocity) .AND. PRESENT(drag_rho)) THEN IF (SIZE(fluid_velocity, 1) == 3 .AND. SIZE(fluid_velocity, 2) == n_elem + 1) THEN - IF (ANY(ABS(fluid_velocity) > CD_ZERO)) THEN + field_on = ANY(ABS(fluid_velocity) > CD_ZERO) + IF (PRESENT(current_profile_z) .AND. PRESENT(current_profile_velocity)) & + field_on = field_on .OR. ANY(ABS(current_profile_velocity) > CD_ZERO) + IF (PRESENT(current_grid)) THEN + IF (ALLOCATED(current_grid%velocity)) & + field_on = field_on .OR. ANY(ABS(current_grid%velocity(:, :, :, :, 1)) > CD_ZERO) + END IF + IF (field_on) THEN IF (PRESENT(drag_diameter_elem) .AND. PRESENT(drag_cdn_elem) .AND. PRESENT(drag_cdt_elem)) THEN use_current = .TRUE. cur%elem_diameter = drag_diameter_elem diff --git a/src/CableDyn_Static.f90 b/src/CableDyn_Static.f90 index 439d67cf..a64d2849 100644 --- a/src/CableDyn_Static.f90 +++ b/src/CableDyn_Static.f90 @@ -33,7 +33,8 @@ MODULE CableDyn_Static USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Bathymetry_Is_Initialized, & CD_Bathymetry_Floor_Gradient, CD_BATHY_OK USE CableDyn_Hydro, ONLY: CD_Cable_Morison_Drag_Force, CD_Morison_Drag_Element_Load, CD_Current_Profile_Velocity, & - CD_CurrentGridType, CD_Current_Grid_Velocity, CD_HYDRO_OK + CD_CurrentGridType, CD_Current_Grid_Velocity, CD_Current_Grid_Gradient, & + CD_Current_Profile_Gradient, CD_HYDRO_OK USE CableDyn_Linalg, ONLY: CD_Solve_Banded USE CableDyn_Mesh, ONLY: CD_Partition_Free_Dofs USE CableDyn_Catenary, ONLY: CD_Catenary_Seed, CD_CAT_OK @@ -1042,7 +1043,7 @@ SUBROUTINE eval_drag_tangent(qe, es_out, em_out) INTEGER, INTENT(OUT) :: es_out CHARACTER(*), INTENT(OUT) :: em_out INTEGER :: e, a, b, i, j, fi, fj, gmap(6) - REAL(wp) :: f2(6), jq2(6, 6), jv2(6, 6), de, cn, ct + REAL(wp) :: f2(6), jq2(6, 6), jv2(6, 6), de, cn, ct, grad_a(3, 3), grad_b(3, 3) drag_kq_band = CD_ZERO es_out = CD_HYDRO_OK @@ -1063,6 +1064,23 @@ SUBROUTINE eval_drag_tangent(qe, es_out, em_out) fluidvel(:, a), fluidvel(:, b), waterln(a), waterln(b), & current%rho, de, cn, ct, f2, jq2, jv2, es_out, em_out) IF (es_out /= CD_HYDRO_OK) RETURN + IF (profile_active) THEN + ! A current re-sampled at the node positions moves with them: the load depends on + ! position through the fluid velocity too, d(load)/du_a = -d(load)/dv_a, so + ! -d(load)/dq_a gains -(jac_v block a) G_a with G = du/dx the field's gradient at the node + ! (without it the Newton iteration can fail in a current sheared across the line). + IF (ALLOCATED(current%grid)) THEN + CALL CD_Current_Grid_Gradient(current%grid, qe(3*a - 2:3*a), CD_ZERO, grad_a, es_out, em_out) + IF (es_out == CD_HYDRO_OK) & + CALL CD_Current_Grid_Gradient(current%grid, qe(3*b - 2:3*b), CD_ZERO, grad_b, es_out, em_out) + IF (es_out /= CD_HYDRO_OK) RETURN + ELSE + CALL CD_Current_Profile_Gradient(qe(3*a), current%profile_z, current%profile_velocity, grad_a) + CALL CD_Current_Profile_Gradient(qe(3*b), current%profile_z, current%profile_velocity, grad_b) + END IF + jq2(:, 1:3) = jq2(:, 1:3) - MATMUL(jv2(:, 1:3), grad_a) + jq2(:, 4:6) = jq2(:, 4:6) - MATMUL(jv2(:, 4:6), grad_b) + END IF DO i = 1, 3 gmap(i) = 3*a - 3 + i gmap(3 + i) = 3*b - 3 + i diff --git a/tests/data/currents_mdc/offchord/c1.dat b/tests/data/currents_mdc/offchord/c1.dat new file mode 100644 index 00000000..288326a2 --- /dev/null +++ b/tests/data/currents_mdc/offchord/c1.dat @@ -0,0 +1,25 @@ +--------------------- MoorDyn Input File ------------------------------------ +A current below the straight chord (0.8 m/s under z = -32 m, ends at z = -20 m) +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +4.0 TMax simulation length (s) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +300.0 TmaxIC max time for ic gen (s) +1.0e-12 threshIC convergence threshold for ic gen (-) +0 WaveKin MoorDyn-C water kinematics mode (-) +1 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/offchord/c2.dat b/tests/data/currents_mdc/offchord/c2.dat new file mode 100644 index 00000000..ef65bc2b --- /dev/null +++ b/tests/data/currents_mdc/offchord/c2.dat @@ -0,0 +1,25 @@ +--------------------- MoorDyn Input File ------------------------------------ +A current below the straight chord (0.8 m/s under z = -32 m, ends at z = -20 m) +----------------------- LINE TYPES ------------------------------------------ +TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx +(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-) +rope 0.3 80.0 1.0e7 -1.0 0 1.2 1.0 0.2 0.0 +---------------------- POINT PROPERTIES -------------------------------- +ID Type X Y Z Mass Volume CdA Ca +(#) (-) (m) (m) (m) (kg) (m^3) (m^2) (-) +1 Fixed 0.0 -30.0 -20.0 0 0 0 0 +2 Vessel 0.0 30.0 -20.0 0 0 0 0 +---------------------- LINES ---------------------------------------- +ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs +(#) (name) (#) (#) (m) (-) (-) +1 rope 2 1 70.0 20 - +---------------------- OPTIONS ----------------------------------------- +0.002 dtM time step to use in mooring integration (s) +4.0 TMax simulation length (s) +1025.0 WtrDnsty water density (kg/m^3) +50 WtrDpth water depth (m) +300.0 TmaxIC max time for ic gen (s) +1.0e-12 threshIC convergence threshold for ic gen (-) +0 WaveKin MoorDyn-C water kinematics mode (-) +2 Currents MoorDyn-C current mode (-) +------------------------- need this line -------------------------------------- diff --git a/tests/data/currents_mdc/offchord/current_profile.txt b/tests/data/currents_mdc/offchord/current_profile.txt new file mode 100644 index 00000000..c5b43d56 --- /dev/null +++ b/tests/data/currents_mdc/offchord/current_profile.txt @@ -0,0 +1,7 @@ +h +h +h +-50.0 0.8 0 0 +-32.0 0.8 0 0 +-28.0 0 0 0 +0.0 0 0 0 diff --git a/tests/data/currents_mdc/offchord/current_profile_dynamic.txt b/tests/data/currents_mdc/offchord/current_profile_dynamic.txt new file mode 100644 index 00000000..8f708acf --- /dev/null +++ b/tests/data/currents_mdc/offchord/current_profile_dynamic.txt @@ -0,0 +1,8 @@ +h +h +h +h +-50.0 -32.0 -28.0 0.0 +t ux +0.0 0.8 0.8 0.0 0.0 +10.0 0.8 0.8 0.0 0.0 diff --git a/tests/test_c_api.f90 b/tests/test_c_api.f90 index 8e2e742f..2b9c3691 100644 --- a/tests/test_c_api.f90 +++ b/tests/test_c_api.f90 @@ -26,6 +26,7 @@ PROGRAM test_c_api CALL case_lifecycle() CALL case_deck_init() CALL case_deck_dynamic_point_fluid() + CALL case_deck_current_in_time() CALL case_deck_bodies_rods() CALL case_init_update_output_step() CALL case_multiline_shared_map() @@ -203,6 +204,87 @@ SUBROUTINE case_deck_dynamic_point_fluid() CALL require(es == 0_C_INT .AND. .NOT. C_ASSOCIATED(hydro_handle), 'c-api-deck-fluid:close-hydro') END SUBROUTINE case_deck_dynamic_point_fluid + SUBROUTINE case_deck_current_in_time() + !! The C ABI has no simulation clock: a deck current that varies in time (MoorDyn-C + !! Currents 2) is refused, as deck waves are, rather than held at its t = 0 value; the same + !! table constant in time is the steady field the ABI applies, as Currents 1. + CHARACTER(*), PARAMETER :: DECK_PATH = 'capi_currents2_deck.dat' + CHARACTER(KIND=C_CHAR), TARGET :: c_path(LEN(DECK_PATH)) + CHARACTER(KIND=C_CHAR), TARGET :: msg(300) + TYPE(C_PTR) :: handle + INTEGER(C_INT) :: es + INTEGER :: i + + DO i = 1, LEN(DECK_PATH) + c_path(i) = DECK_PATH(i:i) + END DO + CALL write_capi_currents_deck(DECK_PATH, '0.2 0.2 0.0 0.0') + CALL CableDyn_Create(handle, es) + CALL require(es == 0_C_INT .AND. C_ASSOCIATED(handle), 'c-api-currents2:create') + CALL CableDyn_InitDeck(handle, C_LOC(c_path), INT(LEN(DECK_PATH), C_INT), es) + CALL require(es == 3_C_INT, 'c-api-currents2:varying-in-time-rejected') + CALL CableDyn_GetLastError(handle, C_LOC(msg), INT(SIZE(msg), C_INT)) + CALL require(INDEX(c_text(msg), 'no simulation clock') > 0 .AND. INDEX(c_text(msg), 'Currents 2') > 0, & + 'c-api-currents2:varying-in-time-message') + CALL write_capi_currents_deck(DECK_PATH, '0.1 0.1 0.0 0.0') + CALL CableDyn_InitDeck(handle, C_LOC(c_path), INT(LEN(DECK_PATH), C_INT), es) + CALL require(es == 0_C_INT, 'c-api-currents2:constant-in-time-applied') + CALL CableDyn_Close(handle, es) + CALL require(es == 0_C_INT .AND. .NOT. C_ASSOCIATED(handle), 'c-api-currents2:close') + END SUBROUTINE case_deck_current_in_time + + SUBROUTINE write_capi_currents_deck(path, row_later) + !! The smoke deck with Currents 2 and its current_profile_dynamic.txt: x velocities + !! 0.1 m/s at the two depths at t = 0 and the given row at t = 5 s. + CHARACTER(*), INTENT(IN) :: path, row_later + INTEGER :: u, ios + + OPEN (NEWUNIT=u, FILE='current_profile_dynamic.txt', STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) + CALL require(ios == 0, 'c-api-currents2:create-table') + IF (ios /= 0) RETURN + WRITE (u, '(A)') 'MoorDyn dynamic currents' + WRITE (u, '(A)') 'header' + WRITE (u, '(A)') '' + WRITE (u, '(A)') '' + WRITE (u, '(A)') '-5.0 0.0' + WRITE (u, '(A)') 't ux uy' + WRITE (u, '(A)') '0.0 0.1 0.1 0.0 0.0' + WRITE (u, '(A)') '5.0 '//row_later + CLOSE (u) + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE', IOSTAT=ios) + CALL require(ios == 0, 'c-api-currents2:create-file') + IF (ios /= 0) RETURN + WRITE (u, '(A)') 'C API deck with a MoorDyn-C current table' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'line 0.10 80.0 1.0e5 0.0 0.0 1.0 0.0 1.0 0.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z' + WRITE (u, '(A)') '(-) (-) (m) (m) (m)' + WRITE (u, '(A)') '1 Fixed 0.0 0.0 -1.0' + WRITE (u, '(A)') '2 Coupled 0.8 0.0 -1.0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 2 1 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 line 1.0 4' + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '5.0 WtrDpth' + WRITE (u, '(A)') '0.01 dtM' + WRITE (u, '(A)') '1.0 TMax' + WRITE (u, '(A)') '2 Currents' + WRITE (u, '(A)') '--- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1 AnchTen1' + WRITE (u, '(A)') '--- end ---' + CLOSE (u) + END SUBROUTINE write_capi_currents_deck + SUBROUTINE case_init_update_output_step() TYPE(C_PTR) :: handle INTEGER(C_INT), TARGET :: elem_conn(2), fixed_dofs(6) diff --git a/tests/test_mdc_currents_runs.py b/tests/test_mdc_currents_runs.py index 196b9123..12a09236 100644 --- a/tests/test_mdc_currents_runs.py +++ b/tests/test_mdc_currents_runs.py @@ -20,7 +20,11 @@ time) is an equilibrium of the march on the EI = 0, the finite-EI and the point-connected EI = 0 routes: over the first 2 s the tensions move by less than 1e-4 of the change the current makes to the still-water start (a finite-EI static that samples the grid in its translated solve frame - instead of at the global node positions moves them by 0.8 of it). + instead of at the global node positions moves them by 0.8 of it); +* a current that is zero along the straight chord but not where the line sags (offchord: Currents 1 + and 2 on the EI = 0 route, Currents 2 on the finite-EI route) is in the static start: the march + then moves the tensions by less than 1e-4 of the change the current makes, and the EI = 0 start + is within 0.5 % of the finite-EI one (an EI = 0 start in still water drifted 192 N in 4 s). usage: test_mdc_currents_runs.py --exe --data --output """ @@ -177,6 +181,33 @@ def static_start(exe: str, data: Path, out: Path) -> None: f"water; the march then moves them by {drift:.2e} N ({drift / step:.1e}, 1e-4) over 2 s") +def current_below_the_chord(exe: str, data: Path, out: Path) -> None: + """The static start in a current that is zero along the straight chord but not where the line + sags (offchord: 0.8 m/s below z = -32 m, the ends at z = -20 m) carries the current: the march + then holds the start, and the EI = 0 start agrees with the finite-EI one.""" + src = data / "offchord" + tables = [src / "current_profile.txt", src / "current_profile_dynamic.txt"] + runs = {} + for name, finite in (("c1", False), ("c2", False), ("c2", True)): + tag = f"{name}_{'fei' if finite else 'ei0'}" + text = deck_text(src / f"{name}.dat", finite) + runs[tag] = run(exe, out / f"offchord_{tag}", "run", text, tables) + still = run(exe, out / "offchord_still", "run", deck_text(data / "tension_c0" / "tension.dat", tmax=4.0), []) + if still is None or any(r is None for r in runs.values()): + return + for tag, r in runs.items(): + step = np.abs(r[0, 1:] - still[0, 1:]).max() + drift = np.abs(r[:, 1:] - r[0, 1:]).max() + check(step > 0.05 * np.abs(still[0, 1:]).max() and drift <= 1.0e-4 * step, + f"current below the chord, {tag}: the static start carries it ({step:.0f} N from still water); " + f"the march then moves the tensions by {drift:.2e} N over 4 s (1e-4 of that)") + ei0, fei = runs["c2_ei0"][0, 1:], runs["c2_fei"][0, 1:] + gap = np.abs(ei0 - fei).max() / np.abs(fei).max() + check(gap <= 5.0e-3 and np.array_equal(runs["c1_ei0"][0, 1:], ei0), + f"current below the chord: the EI = 0 start within {gap:.1e} of the finite-EI one (0.5 %), and " + "Currents 1 and 2 give the same start") + + def two_line_deck(currents: int) -> str: """The tension rope as two EI = 0 lines meeting at a free point (the point-connected route).""" return f"""--------------------- MoorDyn Input File ------------------------------------ @@ -220,6 +251,7 @@ def main() -> int: against_moordyn_c(args.exe, data, out) same_field(args.exe, data, out) static_start(args.exe, data, out) + current_below_the_chord(args.exe, data, out) print(f"{len(FAILURES)} failure(s)") return 1 if FAILURES else 0 diff --git a/tests/test_step_allocations.f90 b/tests/test_step_allocations.f90 index e5bc065c..df0ccab8 100644 --- a/tests/test_step_allocations.f90 +++ b/tests/test_step_allocations.f90 @@ -25,8 +25,13 @@ PROGRAM test_step_allocations !! the same cable carries the nodal twist (polar inertia and torsional damping), with its !! 7-DOF-per-node band and the node-torque and element-twist queries. !! + !! With "current_grid" the gate runs the evaluation of a MoorDyn-C current grid (Currents 2 and + !! 5) that every standalone step makes at every node: CD_Current_Grid_Velocity, and the gradient + !! of the EI = 0 static tangent (CD_Current_Grid_Gradient), at points inside and outside a + !! sheared grid and at times before, inside and past its last sample. + !! !! Usage: test_step_allocations [ranges] - !! test_step_allocations torsion | nodal + !! test_step_allocations torsion | nodal | current_grid USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_INT, C_LONG_LONG USE CableDyn_Precision, ONLY: wp USE CableDyn_EndConnection, ONLY: CD_ENDCONN_RIGID @@ -37,6 +42,8 @@ PROGRAM test_step_allocations USE CableDyn_HermiteCableDynamic, ONLY: CD_HermiteCable_Dyn_End_Force, CD_HermiteCable_Dyn_Energy, & CD_HermiteCable_Dyn_Torsion_State, CD_HermiteCable_Dyn_Node_Torque, & CD_HermiteCable_Dyn_Element_Twist + USE CableDyn_Hydro, ONLY: CD_CurrentGridType, CD_Current_Grid_Resample, CD_Current_Grid_Velocity, & + CD_Current_Grid_Gradient USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, & CD_AGG_NFluidNodes, CD_AGG_NumChannels, CD_AGG_GetMovingPointMesh, & CD_AGG_Snapshot, CD_AGG_SetFluidFields, CD_AGG_Step_Moving, & @@ -67,7 +74,12 @@ END SUBROUTINE cd_test_allocation_counting IF (COMMAND_ARGUMENT_COUNT() == 1) THEN CALL GET_COMMAND_ARGUMENT(1, arg) - IF (TRIM(arg) /= 'torsion' .AND. TRIM(arg) /= 'nodal') ERROR STOP 'a single argument must be "torsion" or "nodal"' + IF (TRIM(arg) == 'current_grid') THEN + CALL current_grid_gate() + STOP + END IF + IF (TRIM(arg) /= 'torsion' .AND. TRIM(arg) /= 'nodal') & + ERROR STOP 'a single argument must be "torsion", "nodal" or "current_grid"' CALL torsion_gate(TRIM(arg) == 'nodal') STOP END IF @@ -278,6 +290,51 @@ SUBROUTINE torsion_gate(nodal) PRINT '(A)', 'PASS: no heap allocation in the per-step advance or outputs of a cable with torsion after warm-up' END SUBROUTINE torsion_gate + SUBROUTINE current_grid_gate() + TYPE(CD_CurrentGridType) :: grid + REAL(wp) :: xc(4), yc(2), zc(4), tc(4), v_in(3, 4, 2, 4, 4), u(3), g(3, 3), p(3), t, total + INTEGER(C_LONG_LONG) :: n0, n1 + INTEGER :: ix, iy, iz, it, k + xc = [-60.0_wp, -20.0_wp, 10.0_wp, 50.0_wp] + yc = [-30.0_wp, 30.0_wp] + zc = [-50.0_wp, -25.0_wp, -10.0_wp, 0.0_wp] + tc = [0.0_wp, 5.0_wp, 12.0_wp, 20.0_wp] + DO it = 1, 4 + DO iz = 1, 4 + DO iy = 1, 2 + DO ix = 1, 4 + v_in(:, ix, iy, iz, it) = [0.4_wp + 0.006_wp*xc(ix) + 0.01_wp*tc(it), 0.003_wp*yc(iy), 0.001_wp*zc(iz)] + END DO + END DO + END DO + END DO + CALL CD_Current_Grid_Resample(xc, yc, zc, tc, v_in, grid, es, em) + CALL check('current grid resample') + total = 0.0_wp + ! warm-up (any lazy runtime set-up outside the counted window) + CALL CD_Current_Grid_Velocity(grid, [1.0_wp, 2.0_wp, -3.0_wp], 1.0_wp, u, es, em) + CALL check('current grid warm-up') + CALL cd_test_allocation_counting(1_C_INT) + n0 = cd_test_allocation_count() + DO k = 1, 20000 + t = -1.0_wp + 0.0037_wp*REAL(k, wp) + p = [-80.0_wp + 0.0071_wp*REAL(k, wp), -45.0_wp + 0.0047_wp*REAL(k, wp), -60.0_wp + 0.0033_wp*REAL(k, wp)] + CALL CD_Current_Grid_Velocity(grid, p, t, u, es, em) + CALL check('current grid velocity') + CALL CD_Current_Grid_Gradient(grid, p, t, g, es, em) + CALL check('current grid gradient') + total = total + SUM(u) + SUM(g) + END DO + n1 = cd_test_allocation_count() + CALL cd_test_allocation_counting(0_C_INT) + PRINT '(A,I0,A,ES12.4,A)', 'current grid: 20000 evaluations, ', n1 - n0, ' heap allocations (checksum ', total, ')' + IF (n1 /= n0) THEN + PRINT '(A)', 'FAIL: the current grid evaluation allocated' + ERROR STOP 1 + END IF + PRINT '(A)', 'PASS: no heap allocation in the current grid evaluation' + END SUBROUTINE current_grid_gate + SUBROUTINE check(stage) CHARACTER(*), INTENT(IN) :: stage From 556e2429e60cadd6b263c4a1e7f6cb7ff01c3579 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 19:48:45 +0900 Subject: [PATCH 08/10] test(integration): CoupledPinned bodies, line control and attachments with currents New gate parity_integration where the MoorDyn-parity features meet: - A CoupledPinned body in a Currents 2 or Currents 5 deck: the coupled aggregate (with and without the host fluid field) refuses it for the current files ("the MoorDyn-C WaveKin 3/7 and Currents 1/2/5 files are not supported on the aggregate route (coupled runs take water kinematics from the host; ...)"), the same deck without them initialises, and the standalone driver refuses it for the body ("CoupledPinned/VesselPinned BODY requires a coupled host"). - CONTROL on a viscoelastic and on a Syrope segment of a taut rope in a cross-flow the host prescribes (fields at every node, its steady current for the static start): a still 10 s run at a zero command keeps the start (node drift 1.4e-14 m and 6.0e-12 m); after a 0.3 m pay-out (viscoelastic) or a 0.2 m haul-in (Syrope) and a 40 s hold the line rests at the static start of the deck with that segment changed, to 1.1e-12 m and 3.8e-12 of the tension (viscoelastic) and 5.0e-7 m and 7.1e-7 (Syrope), the cross-flow deflecting the rope by 0.39 m and 0.08 m. - The lazy wave with 25 buoyancy modules and one turn of pretwist, turned by 30 deg and moved off the origin, in a Currents 5 grid sheared in x, y and z: a still 10 s run keeps the twisted discrete start (the attachment drag fixed point samples the grid at the modules' global positions) to 8.6e-8 of the fairlead tension and 0 in torque and twist, while the grid moves the start by 4.5e-3 and 2.0e-2. Sampling the grid at x = y = 0 or at the unturned solve-frame position instead leaves spreads of 1.6e-4 to 1.5e-3. A grid in depth only gives the start of the same Currents 1 profile to the output precision. The ATTACHMENTS docs and the drag comments name the node position (a current grid) instead of its depth; a CHANGELOG entry is reflowed. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 4 +- CMakeLists.txt | 12 + doc/driver_format.md | 5 +- src/CableDyn_DeckDriver.f90 | 8 +- tests/test_parity_integration.f90 | 603 ++++++++++++++++++++++++++++++ 5 files changed, 624 insertions(+), 8 deletions(-) create mode 100644 tests/test_parity_integration.f90 diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c739e9..5ed4e78c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,8 +33,8 @@ All notable changes to CableDyn are recorded in this file. The format follows pendulum keeps the elliptic-integral period to 1.6e-4 at `dt = T/100`, a body with a `CoupledPinned` rod's mass and inertia follows the rod to 2e-12, and against MoorDyn-F (`inertialF 1`) a pendulum swinging through 120 deg agrees to 0.09 deg (0.15 deg when its node - surges). Outside - a coupled host, without inertias, and in linearisation the body fails closed by name. + surges). Outside a coupled host, without inertias, and in linearisation the body fails closed + by name. - Active line control (`CONTROL`, OpenFAST `CableDeltaL`/`CableDeltaLdot`) of a Syrope polyester segment, which stopped at initialisation before. As in MoorDyn-F and MoorDyn-C the segment's slow stretch carries over the length change (its slow strain is read at the new diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cee131c..48b7f2f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2141,6 +2141,18 @@ add_test(NAME torsion_attachments WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_tests_properties(torsion_attachments PROPERTIES LABELS "fortran;driver;integration;static;dynamic") +# Where the MoorDyn-parity features meet: a CoupledPinned body in a Currents 2/5 deck (refused on +# the coupled aggregate for the current files, standalone for the body), CONTROL on viscoelastic +# and Syrope segments in the host's cross-flow against the static start of the changed deck, and +# ATTACHMENTS on a turned torsion line in a sheared Currents 5 grid (a still run keeps the start) +add_executable(test_parity_integration tests/test_parity_integration.f90) +target_link_libraries(test_parity_integration PRIVATE cabledyn_core) +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/parity_integration) +add_test(NAME parity_integration + COMMAND test_parity_integration ${CMAKE_CURRENT_SOURCE_DIR}/tests/data/lazy_wave_torsion_attachments.dat + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/parity_integration) +set_tests_properties(parity_integration PROPERTIES LABELS "fortran;driver;integration;dynamic;openfast") + add_executable(test_section_curvature tests/test_section_curvature.f90) target_link_libraries(test_section_curvature PRIVATE cabledyn_core) add_test(NAME section_curvature COMMAND test_section_curvature) diff --git a/doc/driver_format.md b/doc/driver_format.md index bd55c354..a9890723 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -951,13 +951,14 @@ Behaviour: - Loads: the net weight `(Mass − rhoW Volume) g` downward; with the dry mass, the added mass `Ca rhoW Volume` (a constant nodal mass); the fluid-inertia force `rhoW Volume (1 + Ca) du/dt` and the drag against the current and wave velocity at the node. - A deck `current` (uniform or profile) loads the attachments in the static initial condition + A deck current (a `current` row, uniform or profile, or a MoorDyn-C `Currents` field at + `t = 0`, sampled at the attachment node) loads the attachments in the static initial condition with the same drag law at rest, so a run in a current starts in equilibrium. An attachment above the free surface carries its weight only. Attachments have no seabed contact of their own; the node's contact acts on the line. - The static equilibrium is solved first with each attachment's net weight spread over the two elements at its node, then carried to the discrete loads by continuation. The current drag - depends on the node's depth and line direction, so the final solve is repeated until the + depends on the node's position and line direction, so the final solve is repeated until the node positions change by less than 1e-9 m. On a line restrained in torsion the torsion stage (the imposed twist) follows on the discrete equilibrium, with the attachments' net weights and drag as nodal loads (the drag again to a fixed point), so a run starts in the twisted diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 8dc6a6fa..b922d085 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -3515,7 +3515,7 @@ SUBROUTINE torsion_after_attachments(est, emt) !! The torsion stage of a line with ATTACHMENTS, on its discrete equilibrium (after the !! attachment polish): the attachments' net weights -(m - rho V) g e_z at their nodes and, !! in a deck current, their drag at the twisted state as nodal loads. The drag depends on - !! the node's depth and line tangent, so the stage is repeated, each time a fresh torsion + !! the node's position and line tangent, so the stage is repeated, each time a fresh torsion !! solve from the last state, with the drag of the last solution until the solution stops !! moving (fixed point, as in attachment_static_polish). INTEGER, INTENT(OUT) :: est @@ -5129,9 +5129,9 @@ SUBROUTINE attachment_static_polish(l0, ea, ei, w_bare, w_smear, diam, node, att !! Newton solves the element weights move from w_smear to w_bare while the lumped nodal !! forces -(m - rho V) g e_z and, in a deck current, the attachment current drag grow from !! zero to full, with the contact, dry-buoyancy, end-connection and line current terms of - !! the builder's static problem. The drag depends on the node's depth (profile current) - !! and line tangent, so the full-load solve is repeated with the drag of the last solution - !! until the solution stops moving (fixed point). + !! the builder's static problem. The drag depends on the node's position (profile current, + !! current grid) and line tangent, so the full-load solve is repeated with the drag of the + !! last solution until the solution stops moving (fixed point). !! !! The load fraction advances in steps of 1/NSTEP. A step whose damped Newton solve does !! not converge is repeated from the last converged state with pseudo-transient diff --git a/tests/test_parity_integration.f90 b/tests/test_parity_integration.f90 new file mode 100644 index 00000000..9e58d579 --- /dev/null +++ b/tests/test_parity_integration.f90 @@ -0,0 +1,603 @@ +! File: tests/test_parity_integration.f90 +! SPDX-License-Identifier: Apache-2.0 +! Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +PROGRAM test_parity_integration + !! Gates where the MoorDyn-parity features meet: CoupledPinned bodies, active line control of + !! viscoelastic and Syrope segments, the MoorDyn-C Currents 2 and 5 fields, and ATTACHMENTS on a + !! line restrained in torsion. + !! 1. A CoupledPinned body in a Currents 2 or Currents 5 deck: the coupled aggregate (the + !! OpenFAST CompMooring = 5 route, with and without the host fluid field) refuses the deck + !! for its current files, by the aggregate's water-kinematics rule (the host supplies the + !! water kinematics there), while the same deck without them initialises; the standalone + !! driver refuses it for the body (no host moves its node). + !! 2. CONTROL on a viscoelastic (ElasticMod 2) and on a Syrope segment of a taut rope in a + !! cross-flow the host prescribes (external_fluid fields at every node, and its steady + !! current for the static start): with a zero command a still run keeps the static start; + !! after a pay-out (viscoelastic, the static law is history free) or a haul-in (Syrope, + !! onto the original working curve, which the static start also takes) and a hold, the + !! line rests where the static start of the deck with that segment longer or shorter + !! lies in the same current (a second route: the static solver against the controlled + !! march). The rope's cross-flow deflection is printed: the current is not negligible. + !! 3. The lazy wave of test_torsion_attachments (25 buoyancy modules with drag, one turn of + !! pretwist, the nodal twist), turned by 30 deg about z and moved off the origin, in a + !! Currents 5 grid sheared in x, y and z: the twisted discrete static start (the attachment + !! drag fixed point after the polish samples the grid at the modules' global positions) is + !! an equilibrium of the march, which samples the grid at the nodes: a still 10 s run keeps + !! the fairlead tension, both end torques and the twist. A grid that varies in depth only + !! gives the start of the same field as a Currents 1 profile (a second source of the field). + USE CableDyn_Precision, ONLY: wp + USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK + USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_GetMovingPointMesh, & + CD_AGG_Step_Moving, CD_AGG_Apply_LineControl, CD_AGG_NFluidNodes, & + CD_AGG_SetFluidFields, CD_AGG_End, CD_AGG_OK + USE CableDyn_System, ONLY: CD_System_Line_NElem, CD_Get_System_Line_Tension, CD_SYSTEM_OK + USE, INTRINSIC :: IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE + IMPLICIT NONE + + REAL(wp), PARAMETER :: PI = 3.14159265358979323846_wp, DT = 0.05_wp + INTEGER :: n_fail = 0 + CHARACTER(512) :: lazy_wave + + IF (COMMAND_ARGUMENT_COUNT() /= 1) THEN + WRITE (*, '(A)') 'usage: test_parity_integration ' + ERROR STOP 2 + END IF + CALL GET_COMMAND_ARGUMENT(1, lazy_wave) + CALL case_pinned_body_currents(2) + CALL case_pinned_body_currents(5) + CALL case_control_host_current('viscoelastic', 100.4_wp, 0.6_wp, 0.3_wp) + CALL case_control_host_current('syrope', 102.0_wp, 1.0_wp, -0.2_wp) + CALL case_attachments_grid() + IF (n_fail > 0) THEN + WRITE (*, '(A,I0,A)') 'FAIL: ', n_fail, ' integration check(s) failed' + ERROR STOP 1 + END IF + WRITE (*, '(A)') 'PASS: CoupledPinned bodies, line control and attachments with currents' + +CONTAINS + + SUBROUTINE require(cond, msg) + LOGICAL, INTENT(IN) :: cond + CHARACTER(*), INTENT(IN) :: msg + IF (.NOT. cond) THEN + n_fail = n_fail + 1 + WRITE (*, '(A,A)') 'FAILED: ', msg + END IF + END SUBROUTINE require + + FUNCTION num(x) RESULT(s) + !! A real as a deck token without blanks. + REAL(wp), INTENT(IN) :: x + CHARACTER(:), ALLOCATABLE :: s + CHARACTER(32) :: buf + WRITE (buf, '(ES23.15)') x + s = TRIM(ADJUSTL(buf)) + END FUNCTION num + + ! --------------------------------------------------------------------------------------------- ! + ! 1. a CoupledPinned body in a Currents 2/5 deck ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE write_pinned_body_deck(path, currents, standalone) + !! A CoupledPinned body (1000 kg, CG 2 m below its reference point at (0, 0, -5), inertias + !! 500 kg m^2, no drag or added mass) carrying a line from a Body1 point at its node to a Coupled point, with the + !! MoorDyn-C Currents mode currents (0: none) and, standalone, the dtM/TMax clock. + CHARACTER(*), INTENT(IN) :: path + INTEGER, INTENT(IN) :: currents + LOGICAL, INTENT(IN) :: standalone + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'CoupledPinned body in a MoorDyn-C current field' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'line 0.10 80.0 1.0e6 0.0 0.0 1.0 0.0 1.0 0.0' + WRITE (u, '(A)') '--- BODIES ---' + WRITE (u, '(A)') 'ID Attachment X0 Y0 Z0 r0 p0 y0 Mass CG* I* Volume CdA* Ca*' + WRITE (u, '(A)') '(#) (word) (m) (m) (m) (deg) (deg) (deg) (kg) (m) (kg-m^2) (m^3) (m^2) (-)' + WRITE (u, '(A)') '1 CoupledPinned 0.0 0.0 -5.0 0.0 0.0 0.0 1000.0 0.0|0.0|-2.0 500.0|500.0|500.0 0.5 0.0 0.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Body1 0.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '2 Coupled 4.0 0.0 -13.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 line 9.5 6' + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '50.0 WtrDpth' + WRITE (u, '(A)') 'deck bodyIC' + IF (currents > 0) WRITE (u, '(I0,A)') currents, ' Currents' + IF (standalone) THEN + WRITE (u, '(A)') '0.01 dtM' + WRITE (u, '(A)') '0.1 TMax' + END IF + WRITE (u, '(A)') '--- end ---' + CLOSE (u) + END SUBROUTINE write_pinned_body_deck + + SUBROUTINE write_current_files() + !! A Currents 2 depth profile in time and a Currents 5 grid (2 x 2 x 2 x 2), both varying in + !! time, beside the decks. + INTEGER :: u, ix, iy, iz, it + REAL(wp), PARAMETER :: XS(2) = [-20.0_wp, 20.0_wp], YS(2) = [-20.0_wp, 20.0_wp], ZS(2) = [-50.0_wp, 0.0_wp], & + TS(2) = [0.0_wp, 10.0_wp] + OPEN (NEWUNIT=u, FILE='current_profile_dynamic.txt', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Currents 2 profile in time' + WRITE (u, '(A)') 'depths on line 5, then t ux(z)' + WRITE (u, '(A)') '-' + WRITE (u, '(A)') '-' + WRITE (u, '(A)') '-50.0 0.0' + WRITE (u, '(A)') 't ux' + WRITE (u, '(A)') '0.0 0.2 0.4' + WRITE (u, '(A)') '10.0 0.3 0.6' + CLOSE (u) + OPEN (NEWUNIT=u, FILE='current_profile_4d.txt', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '2 2 2 2' + WRITE (u, '(A)') '-20.0 20.0' + WRITE (u, '(A)') '-20.0 20.0' + WRITE (u, '(A)') '-50.0 0.0' + WRITE (u, '(A)') '0.0 10.0' + WRITE (u, '(A)') 'x y z t ux uy uz' + DO ix = 1, 2 + DO iy = 1, 2 + DO iz = 1, 2 + DO it = 1, 2 + WRITE (u, '(7(A,1X))') num(XS(ix)), num(YS(iy)), num(ZS(iz)), num(TS(it)), & + num(0.2_wp + 0.01_wp*XS(ix) + 0.1_wp*REAL(it - 1, wp)), num(0.005_wp*YS(iy)), num(0.0_wp) + END DO + END DO + END DO + END DO + CLOSE (u) + END SUBROUTINE write_current_files + + SUBROUTINE case_pinned_body_currents(currents) + INTEGER, INTENT(IN) :: currents + TYPE(CD_AGG_ModuleType) :: agg + INTEGER :: es + LOGICAL :: conv + CHARACTER(2048) :: em + CHARACTER(16) :: tag + WRITE (tag, '(A,I0)') 'Currents ', currents + CALL write_current_files() + ! the deck without the current files is a valid coupled deck + CALL write_pinned_body_deck('pint_pin_none.dat', 0, .FALSE.) + CALL CD_AGG_Init_From_Deck(agg, 'pint_pin_none.dat', 0.01_wp, es, em) + CALL require(es == CD_AGG_OK, '1 '//TRIM(tag)//': the CoupledPinned body deck without currents initialises: '// & + TRIM(em)) + CALL CD_AGG_End(agg, es, em) + CALL write_pinned_body_deck('pint_pin.dat', currents, .FALSE.) + CALL CD_AGG_Init_From_Deck(agg, 'pint_pin.dat', 0.01_wp, es, em) + WRITE (*, '(A)') '1 '//TRIM(tag)//', coupled aggregate: '//TRIM(em) + CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'Currents 1/2/5 files are not supported on the aggregate route') > 0 & + .AND. INDEX(em, 'coupled runs take water kinematics from the host') > 0, & + '1 '//TRIM(tag)//': the coupled aggregate refuses the current files of a CoupledPinned body deck') + CALL CD_AGG_End(agg, es, em) + ! as the OpenFAST shell builds it, with the host's fluid field + CALL CD_AGG_Init_From_Deck(agg, 'pint_pin.dat', 0.01_wp, es, em, external_fluid=.TRUE.) + CALL require(es /= CD_AGG_OK .AND. INDEX(em, 'Currents 1/2/5 files are not supported on the aggregate route') > 0, & + '1 '//TRIM(tag)//': the coupled aggregate with the host field refuses them too: '//TRIM(em)) + CALL CD_AGG_End(agg, es, em) + CALL write_pinned_body_deck('pint_pin_sa.dat', currents, .TRUE.) + CALL CD_Run_Deck_Driver('pint_pin_sa.dat', 'pint_pin_sa', conv, es, em) + WRITE (*, '(A)') '1 '//TRIM(tag)//', standalone driver: '//TRIM(em) + CALL require(es /= CD_DECKDRV_OK .AND. INDEX(em, 'CoupledPinned/VesselPinned BODY requires a coupled host') > 0, & + '1 '//TRIM(tag)//': the standalone driver refuses the CoupledPinned body') + END SUBROUTINE case_pinned_body_currents + + ! --------------------------------------------------------------------------------------------- ! + ! 2. CONTROL on a viscoelastic or Syrope segment in the host's current ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE write_rope_deck(path, kind, span, l_first, control) + !! A taut rope between a Coupled fairlead at (0, 0, -100) and a Fixed anchor span away at the + !! same depth, written fairlead first (the controlled end at NodeA): a first segment of + !! l_first and nine of 10 m. kind viscoelastic: Es|Ed = 1e8|3e8 N, Bs|Bd = 1e6|1e5 N s; kind + !! syrope: the polyester of test_syrope_control (OWC table, LINEAR working curve, k1 = 0.5). + !! Both are nearly neutrally buoyant (0.05 kg/m above the displaced water's), Cdn = 1.2. + CHARACTER(*), INTENT(IN) :: path, kind + REAL(wp), INTENT(IN) :: span, l_first + LOGICAL, INTENT(IN) :: control + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Controlled rope in a host cross-flow ('//kind//')' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + IF (kind == 'syrope') THEN + WRITE (u, '(A)') 'rope 0.1438 16.70 "SYROPE:pint_settings.dat|1.53e8|23.12" 1.0e6|1.0e5 0.0 1.2 0.2 1.0 0.0' + ELSE + WRITE (u, '(A)') 'rope 0.1438 16.70 1.0e8|3.0e8 1.0e6|1.0e5 0.0 1.2 0.2 1.0 0.0' + END IF + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + WRITE (u, '(A)') '1 Coupled 0.0 0.0 -100.0 0 0 0 0' + WRITE (u, '(A)') '2 Fixed '//num(span)//' 0.0 -100.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '1 1 2 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 rope '//num(l_first)//' 1' + WRITE (u, '(A)') '1 rope 90.0 9' + IF (control) THEN + WRITE (u, '(A)') '--- CONTROL ---' + WRITE (u, '(A)') 'ChannelID Lines' + WRITE (u, '(A)') '(-) (-)' + WRITE (u, '(A)') '1 1' + END IF + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '200.0 WtrDpth' + WRITE (u, '(A)') '--- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen1' + WRITE (u, '(A)') '--- end ---' + CLOSE (u) + END SUBROUTINE write_rope_deck + + SUBROUTINE write_syrope_files() + !! The OWC table of test_syrope_control (the shipped data/syrope/syrope_owc.dat) and its + !! settings file. + INTEGER :: u, k + REAL(wp), PARAMETER :: OWC_EPS(30) = [ & + 0.00000e+00_wp, 2.06897e-03_wp, 4.13793e-03_wp, 6.20690e-03_wp, 8.27586e-03_wp, & + 1.03448e-02_wp, 1.24138e-02_wp, 1.44828e-02_wp, 1.65517e-02_wp, 1.86207e-02_wp, & + 2.06897e-02_wp, 2.27586e-02_wp, 2.48276e-02_wp, 2.68966e-02_wp, 2.89655e-02_wp, & + 3.10345e-02_wp, 3.31034e-02_wp, 3.51724e-02_wp, 3.72414e-02_wp, 3.93103e-02_wp, & + 4.13793e-02_wp, 4.34483e-02_wp, 4.55172e-02_wp, 4.75862e-02_wp, 4.96552e-02_wp, & + 5.17241e-02_wp, 5.37931e-02_wp, 5.58621e-02_wp, 5.79310e-02_wp, 6.00000e-02_wp] + REAL(wp), PARAMETER :: OWC_TEN(30) = [ & + 0.00000e+00_wp, 1.71768e+05_wp, 3.30952e+05_wp, 4.78788e+05_wp, 6.16510e+05_wp, & + 7.45355e+05_wp, 8.66556e+05_wp, 9.81351e+05_wp, 1.09097e+06_wp, 1.19666e+06_wp, & + 1.29964e+06_wp, 1.40116e+06_wp, 1.50245e+06_wp, 1.60474e+06_wp, 1.70927e+06_wp, & + 1.81728e+06_wp, 1.93000e+06_wp, 2.04866e+06_wp, 2.17450e+06_wp, 2.30876e+06_wp, & + 2.45267e+06_wp, 2.60747e+06_wp, 2.77439e+06_wp, 2.95467e+06_wp, 3.14954e+06_wp, & + 3.36024e+06_wp, 3.58800e+06_wp, 3.83406e+06_wp, 4.09965e+06_wp, 4.38601e+06_wp] + OPEN (NEWUNIT=u, FILE='pint_owc.dat', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Strain Tension' + WRITE (u, '(A)') '(-) (N)' + DO k = 1, SIZE(OWC_EPS) + WRITE (u, '(ES14.6,1X,ES14.6)') OWC_EPS(k), OWC_TEN(k) + END DO + CLOSE (u) + OPEN (NEWUNIT=u, FILE='pint_settings.dat', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'pint_owc.dat OWC - Original working-curve table file' + WRITE (u, '(A)') 'LINEAR WCType - Working-curve formulation' + WRITE (u, '(A)') '0.5 k1 - First working-curve shape parameter' + WRITE (u, '(A)') '0.0 k2 - Second working-curve shape parameter' + CLOSE (u) + END SUBROUTINE write_syrope_files + + SUBROUTINE init_in_cross_flow(agg, deck, what, u_cross, ok) + !! Initialise deck on the coupled aggregate with the host's fluid field and its steady + !! cross-flow u_cross (along +y) for the static start, and hold the cross-flow at every fluid + !! node. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + CHARACTER(*), INTENT(IN) :: deck, what + REAL(wp), INTENT(IN) :: u_cross + LOGICAL, INTENT(OUT) :: ok + REAL(wp) :: sc(4, 2) + INTEGER :: es + CHARACTER(1024) :: em + sc(:, 1) = [-250.0_wp, 0.0_wp, u_cross, 0.0_wp] + sc(:, 2) = [0.0_wp, 0.0_wp, u_cross, 0.0_wp] + CALL CD_AGG_Init_From_Deck(agg, deck, DT, es, em, external_fluid=.TRUE., static_current=sc) + ok = es == CD_AGG_OK + CALL require(ok, '2 '//what//': '//deck//' initialises in the host cross-flow: '//TRIM(em)) + IF (ok) CALL hold_cross_flow(agg, u_cross, ok) + END SUBROUTINE init_in_cross_flow + + SUBROUTINE hold_cross_flow(agg, u_cross, ok) + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + REAL(wp), INTENT(IN) :: u_cross + LOGICAL, INTENT(OUT) :: ok + REAL(wp), ALLOCATABLE :: uf(:, :), af(:, :), wz(:) + INTEGER :: nf, es + CHARACTER(1024) :: em + nf = CD_AGG_NFluidNodes(agg, es, em) + ALLOCATE (uf(3, nf), af(3, nf), wz(nf)) + uf = 0.0_wp + uf(2, :) = u_cross + af = 0.0_wp + wz = 0.0_wp + CALL CD_AGG_SetFluidFields(agg, uf, af, wz, es, em) + ok = es == CD_AGG_OK + CALL require(ok, '2: the host fluid field is accepted: '//TRIM(em)) + END SUBROUTINE hold_cross_flow + + SUBROUTINE case_control_host_current(kind, span, u_cross, dl) + !! The controlled rope of kind (anchor span away) in the host's cross-flow u_cross: a 10 s + !! still run at a zero command, then the first segment's length changed by dl on a half-cosine + !! over 10 s and held 40 s, against the static start of the deck whose first segment is + !! 10 + dl long. + CHARACTER(*), INTENT(IN) :: kind + REAL(wp), INTENT(IN) :: span, u_cross, dl + TYPE(CD_AGG_ModuleType) :: agg, ref + INTEGER, PARAMETER :: NSTILL = 200, NRAMP = 200, NHOLD = 800 + REAL(wp) :: r0(3, 1), vel(3, 1), acc(3, 1), ld(3, 1), t, cmd, cmd_dot, drift, dten, dq, dt_rel, defl + REAL(wp), ALLOCATABLE :: q0(:), ten0(:), ten(:), ten_ref(:) + INTEGER :: es, ni, il, ne, s + LOGICAL :: ok, cv, st + CHARACTER(1024) :: em + CHARACTER(64) :: deck, deck_ref + + IF (kind == 'syrope') CALL write_syrope_files() + deck = 'pint_ctrl_'//kind//'.dat' + deck_ref = 'pint_ref_'//kind//'.dat' + CALL write_rope_deck(TRIM(deck), kind, span, 10.0_wp, .TRUE.) + CALL write_rope_deck(TRIM(deck_ref), kind, span, 10.0_wp + dl, .FALSE.) + CALL init_in_cross_flow(agg, TRIM(deck), kind, u_cross, ok) + IF (.NOT. ok) RETURN + CALL init_in_cross_flow(ref, TRIM(deck_ref), kind, u_cross, ok) + IF (.NOT. ok) RETURN + CALL CD_AGG_GetMovingPointMesh(agg, r0, vel, acc, ld, es, em) + vel = 0.0_wp + acc = 0.0_wp + il = agg%ctrl_line(1) + ne = CD_System_Line_NElem(agg%sys%fast%system, il, es, em) + ALLOCATE (ten0(ne), ten(ne), ten_ref(ne)) + q0 = agg%sys%fast%system%lines(il)%q + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten0, es, em) + drift = 0.0_wp + dten = 0.0_wp + DO s = 1, NSTILL + NRAMP + NHOLD + t = REAL(s, wp)*DT - REAL(NSTILL, wp)*DT + cmd = 0.0_wp + cmd_dot = 0.0_wp + IF (t >= REAL(NRAMP, wp)*DT) THEN + cmd = dl + ELSE IF (t > 0.0_wp) THEN + cmd = dl*0.5_wp*(1.0_wp - COS(PI*t/(REAL(NRAMP, wp)*DT))) + cmd_dot = dl*0.5_wp*(PI/(REAL(NRAMP, wp)*DT))*SIN(PI*t/(REAL(NRAMP, wp)*DT)) + END IF + CALL hold_cross_flow(agg, u_cross, ok) + IF (.NOT. ok) RETURN + CALL CD_AGG_Apply_LineControl(agg, [cmd], [cmd_dot], es, em) + IF (es == CD_AGG_OK) CALL CD_AGG_Step_Moving(agg, DT, r0, vel, acc, cv, st, ni, es, em) + IF (es /= CD_AGG_OK .OR. .NOT. cv) THEN + CALL require(.FALSE., '2 '//kind//': step '//TRIM(num(t))//': '//TRIM(em)) + RETURN + END IF + IF (s <= NSTILL) THEN + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + drift = MAX(drift, MAXVAL(ABS(agg%sys%fast%system%lines(il)%q - q0))) + dten = MAX(dten, MAXVAL(ABS(ten - ten0))/MAXVAL(ten0)) + END IF + END DO + CALL CD_Get_System_Line_Tension(agg%sys%fast%system, il, ten, es, em) + CALL CD_Get_System_Line_Tension(ref%sys%fast%system, 1, ten_ref, es, em) + ! the controlled segment is the deck's first (the fairlead's), as the changed deck's + CALL require(MAXVAL(ABS(agg%sys%fast%system%lines(il)%l0 - ref%sys%fast%system%lines(1)%l0)) <= 1.0e-12_wp, & + '2 '//kind//': the controlled line takes the segment lengths of the changed deck') + ASSOCIATE (q => agg%sys%fast%system%lines(il)%q, qr => ref%sys%fast%system%lines(1)%q) + dq = MAXVAL(ABS(q - qr)) + defl = MAXVAL(ABS(qr(2::3))) + END ASSOCIATE + dt_rel = MAXVAL(ABS(ten - ten_ref))/MAXVAL(ten_ref) + WRITE (*, '(A,A,A,ES10.3,A,ES10.3)') '2 ', kind, ': still 10 s at a zero command: node drift ', drift, & + ' m, tension change / T ', dten + WRITE (*, '(A,A,A,F6.3,A,ES12.5,A,ES12.5,A,F7.4,A)') '2 ', kind, ': after DeltaL = ', dl, & + ' m and a 40 s hold: T ', MAXVAL(ten), ' N, the static start of the changed deck ', MAXVAL(ten_ref), & + ' N (cross-flow deflection ', defl, ' m)' + WRITE (*, '(A,A,A,ES10.3,A,ES10.3)') '2 ', kind, ': max |x - x_static| ', dq, ' m, max |T - T_static| / T ', dt_rel + CALL require(drift <= 1.0e-9_wp .AND. dten <= 1.0e-9_wp, & + '2 '//kind//': a still run at a zero command keeps the static start in the host current') + CALL require(defl > 0.05_wp, '2 '//kind//': the cross-flow deflects the rope') + CALL require(dq <= 1.0e-5_wp .AND. dt_rel <= 1.0e-5_wp, & + '2 '//kind//': the controlled line rests at the static start of the changed deck') + CALL CD_AGG_End(agg, es, em) + CALL CD_AGG_End(ref, es, em) + END SUBROUTINE case_control_host_current + + ! --------------------------------------------------------------------------------------------- ! + ! 3. ATTACHMENTS on a line restrained in torsion in a Currents 5 grid ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE write_turned_lazy_wave(path, currents) + !! The lazy wave of lazy_wave_torsion_attachments.dat turned by PSI about z and moved by + !! (X_OFF, Y_OFF), its END CONNECTIONS directions turned with it, in the MoorDyn-C Currents + !! mode currents. + CHARACTER(*), INTENT(IN) :: path + INTEGER, INTENT(IN) :: currents + REAL(wp), PARAMETER :: PSI = 30.0_wp*PI/180.0_wp, X_OFF = 100.0_wp, Y_OFF = -50.0_wp + REAL(wp) :: c, s + INTEGER :: u + c = COS(PSI) + s = SIN(PSI) + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Turned lazy wave with buoyancy modules, restrained in torsion, in a MoorDyn-C current' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI GAs GJ Irt Irn Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (N) (Nm2) (kgm) (kgm) (-) (-) (-) (-)' + WRITE (u, '(A)') 'bare 0.16 36.70 4.69e8 0.0 1.99e4 1.0e8 1.5e4 1.0 1.0 1.2 0.1 1.0 0.0' + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z' + WRITE (u, '(A)') '(-) (-) (m) (m) (m)' + WRITE (u, '(A)') '7 Coupled '//num(X_OFF + 30.0_wp*c)//' '//num(Y_OFF + 30.0_wp*s)//' -20.0' + WRITE (u, '(A)') '8 Fixed '//num(X_OFF + 500.0_wp*c)//' '//num(Y_OFF + 500.0_wp*s)//' -200.0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + WRITE (u, '(A)') '4 7 8 -' + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '4 bare 80.0 20' + WRITE (u, '(A)') '4 bare 100.0 25' + WRITE (u, '(A)') '4 bare 420.0 42' + WRITE (u, '(A)') '--- ATTACHMENTS ---' + WRITE (u, '(A)') 'LineID ArcLength Mass Volume CdA Ca CdAx' + WRITE (u, '(A)') '(-) (m) (kg) (m^3) (m^2) (-) (m^2)' + WRITE (u, '(A)') '4 80.0:4.0:176.0 91.32 0.18378 1.392 1.0 0.0' + WRITE (u, '(A)') '--- END CONNECTIONS ---' + WRITE (u, '(A)') 'LineID End Stiffness EzX EzY EzZ TorsStiffness NxX NxY NxZ Pretwist' + WRITE (u, '(A)') '(-) (-) (N-m/rad) (-) (-) (-) (N-m/rad) (-) (-) (-) (deg)' + WRITE (u, '(A)') '4 A Rigid '//num(0.1058_wp*c)//' '//num(0.1058_wp*s)//' -0.9944 Rigid '//num(-s)//' '// & + num(c)//' 0 0' + WRITE (u, '(A)') '4 B Rigid '//num(c)//' '//num(s)//' 0 Rigid '//num(-s)//' '//num(c)//' 0 360' + WRITE (u, '(A)') '--- OPTIONS ---' + WRITE (u, '(A)') '9.80665 g' + WRITE (u, '(A)') '1025.0 rhoW' + WRITE (u, '(A)') '3.0e6 kBot' + WRITE (u, '(A)') '3.0e5 cBot' + WRITE (u, '(A)') '0.35 frictionMu' + WRITE (u, '(A)') '200.0 WtrDpth' + WRITE (u, '(A)') '0.025 dtM' + WRITE (u, '(A)') '10.0 TMax' + WRITE (u, '(I0,A)') currents, ' Currents' + WRITE (u, '(A)') '--- OUTPUTS ---' + WRITE (u, '(A)') 'FairTen4' + WRITE (u, '(A)') 'Torq4N1' + WRITE (u, '(A)') 'Torq4N88' + WRITE (u, '(A)') 'Twist4' + WRITE (u, '(A)') '--- END ---' + CLOSE (u) + END SUBROUTINE write_turned_lazy_wave + + PURE FUNCTION grid_speed(x, y, z, sheared) RESULT(sp) + !! The speed of the grid field, across the turned line (direction (-sin 30, cos 30, 0)): + !! (0.15 + 3e-4 x - 2e-4 y)(1 + z/400) when sheared, else 0.15 (1 + z/400). Trilinear, so the + !! grid reproduces it between its points. + REAL(wp), INTENT(IN) :: x, y, z + LOGICAL, INTENT(IN) :: sheared + REAL(wp) :: sp + IF (sheared) THEN + sp = (0.15_wp + 3.0e-4_wp*x - 2.0e-4_wp*y)*(1.0_wp + z/400.0_wp) + ELSE + sp = 0.15_wp*(1.0_wp + z/400.0_wp) + END IF + END FUNCTION grid_speed + + SUBROUTINE write_grid(sheared) + !! current_profile_4d.txt: x in {-100, 300, 700}, y in {-200, 100, 400}, z in {-250, -100, 0}, + !! t in {0, 100} (steady), the velocity grid_speed along (-sin 30, cos 30, 0). + LOGICAL, INTENT(IN) :: sheared + REAL(wp), PARAMETER :: XS(3) = [-100.0_wp, 300.0_wp, 700.0_wp], YS(3) = [-200.0_wp, 100.0_wp, 400.0_wp], & + ZS(3) = [-250.0_wp, -100.0_wp, 0.0_wp], TS(2) = [0.0_wp, 100.0_wp] + REAL(wp) :: sp, nx, ny + INTEGER :: u, ix, iy, iz, it + nx = -SIN(30.0_wp*PI/180.0_wp) + ny = COS(30.0_wp*PI/180.0_wp) + OPEN (NEWUNIT=u, FILE='current_profile_4d.txt', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') '3 3 3 2' + WRITE (u, '(3(A,1X))') num(XS(1)), num(XS(2)), num(XS(3)) + WRITE (u, '(3(A,1X))') num(YS(1)), num(YS(2)), num(YS(3)) + WRITE (u, '(3(A,1X))') num(ZS(1)), num(ZS(2)), num(ZS(3)) + WRITE (u, '(2(A,1X))') num(TS(1)), num(TS(2)) + WRITE (u, '(A)') 'x y z t ux uy uz' + DO ix = 1, 3 + DO iy = 1, 3 + DO iz = 1, 3 + DO it = 1, 2 + sp = grid_speed(XS(ix), YS(iy), ZS(iz), sheared) + WRITE (u, '(7(A,1X))') num(XS(ix)), num(YS(iy)), num(ZS(iz)), num(TS(it)), num(sp*nx), num(sp*ny), & + num(0.0_wp) + END DO + END DO + END DO + END DO + CLOSE (u) + END SUBROUTINE write_grid + + SUBROUTINE write_profile() + !! current_profile.txt (Currents 1): the depth-only grid field at the grid's levels. + REAL(wp), PARAMETER :: ZS(3) = [-250.0_wp, -100.0_wp, 0.0_wp] + REAL(wp) :: sp, nx, ny + INTEGER :: u, iz + nx = -SIN(30.0_wp*PI/180.0_wp) + ny = COS(30.0_wp*PI/180.0_wp) + OPEN (NEWUNIT=u, FILE='current_profile.txt', STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Currents 1 profile' + WRITE (u, '(A)') 'the depth-only grid field' + WRITE (u, '(A)') 'z (m), ux (m/s), uy (m/s), uz (m/s)' + DO iz = 1, 3 + sp = grid_speed(0.0_wp, 0.0_wp, ZS(iz), .FALSE.) + WRITE (u, '(4(A,1X))') num(ZS(iz)), num(sp*nx), num(sp*ny), num(0.0_wp) + END DO + CLOSE (u) + END SUBROUTINE write_profile + + SUBROUTINE run_still(root, currents, label, first, spread, ok) + !! Write and run the turned lazy wave as root.dat in Currents mode currents; first holds the + !! first output row (FairTen, Torq A, Torq B, Twist) and spread the relative spread of each + !! column over the 10 s run. + CHARACTER(*), INTENT(IN) :: root, label + INTEGER, INTENT(IN) :: currents + REAL(wp), INTENT(OUT) :: first(4), spread(4) + LOGICAL, INTENT(OUT) :: ok + INTEGER, PARAMETER :: MAXROW = 1000 + REAL(wp) :: vals(5, MAXROW) + INTEGER :: u, ios, nrow, j, es + LOGICAL :: conv + CHARACTER(2048) :: em, buf + first = 0.0_wp + spread = HUGE(1.0_wp) + CALL write_turned_lazy_wave(root//'.dat', currents) + CALL CD_Run_Deck_Driver(root//'.dat', root, conv, es, em) + ok = es == CD_DECKDRV_OK .AND. conv + CALL require(ok, '3 '//label//': the turned lazy wave with modules and torsion solves and runs: '//TRIM(em)) + IF (.NOT. ok) RETURN + nrow = 0 + OPEN (NEWUNIT=u, FILE=root//'.out', STATUS='OLD', ACTION='READ', IOSTAT=ios) + IF (ios == 0) THEN + READ (u, '(A)', IOSTAT=ios) buf + READ (u, '(A)', IOSTAT=ios) buf + DO WHILE (nrow < MAXROW) + READ (u, *, IOSTAT=ios) vals(:, nrow + 1) + IF (ios /= 0) EXIT + nrow = nrow + 1 + END DO + CLOSE (u) + END IF + ok = nrow == 401 + IF (ok) ok = ALL(IEEE_IS_FINITE(vals(:, 1:nrow))) + CALL require(ok, '3 '//label//': 401 finite output rows') + IF (.NOT. ok) RETURN + first = vals(2:5, 1) + DO j = 1, 4 + spread(j) = (MAXVAL(vals(j + 1, 1:nrow)) - MINVAL(vals(j + 1, 1:nrow)))/ABS(vals(j + 1, 1)) + END DO + WRITE (*, '(A,A,A,4ES14.6,A,4ES10.2)') '3 ', label, ': FairTen, Torq A, Torq B, Twist ', first, & + '; relative spread over 10 s ', spread + END SUBROUTINE run_still + + SUBROUTINE case_attachments_grid() + REAL(wp) :: f_grid(4), s_grid(4), f_z(4), s_z(4), f_c1(4), s_c1(4), f_still(4), s_still(4) + LOGICAL :: ok + ! the current-free start, for the size of the current's effect + CALL run_still('pint_lw_still', 0, 'still water', f_still, s_still, ok) + IF (.NOT. ok) RETURN + CALL write_grid(.TRUE.) + CALL run_still('pint_lw_grid', 5, 'Currents 5 grid sheared in x, y and z', f_grid, s_grid, ok) + IF (.NOT. ok) RETURN + CALL require(ABS(f_grid(4)) > 300.0_wp, '3: the static start in the grid is twisted (one turn of pretwist)') + CALL require(MAXVAL(s_grid) <= 1.0e-6_wp, '3: a still run keeps the twisted discrete start in the sheared grid') + WRITE (*, '(A,4ES10.2)') '3 the grid changes the start (relative to still water): ', & + ABS(f_grid - f_still)/ABS(f_still) + CALL require(ABS(f_grid(1) - f_still(1)) > 1.0e-3_wp*ABS(f_still(1)), '3: the grid current loads the line') + CALL write_grid(.FALSE.) + CALL run_still('pint_lw_gridz', 5, 'Currents 5 grid in depth only', f_z, s_z, ok) + IF (.NOT. ok) RETURN + CALL write_profile() + CALL run_still('pint_lw_c1', 1, 'Currents 1 profile of the same field', f_c1, s_c1, ok) + IF (.NOT. ok) RETURN + WRITE (*, '(A,4ES10.2)') '3 depth-only grid against the Currents 1 profile, relative: ', ABS(f_z - f_c1)/ABS(f_c1) + CALL require(MAXVAL(s_z) <= 1.0e-6_wp .AND. MAXVAL(s_c1) <= 1.0e-6_wp, & + '3: still runs keep the starts in the depth-only grid and in the profile') + CALL require(MAXVAL(ABS(f_z - f_c1)/ABS(f_c1)) <= 1.0e-9_wp, & + '3: a depth-only grid gives the start of the same Currents 1 profile') + END SUBROUTINE case_attachments_grid + +END PROGRAM test_parity_integration From e1cc96d282a5c443b4fb2ebff6b388f0babe741a Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 20:15:14 +0900 Subject: [PATCH 09/10] fix(currents): one PUBLIC declaration of CD_CurrentGridType The type was both in the PUBLIC statement and declared TYPE, PUBLIC, which ifx rejects (error #6251) and gfortran accepts; the Windows wheel build stopped there. Signed-off-by: Jae Hoon Seo --- src/CableDyn_Hydro.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CableDyn_Hydro.f90 b/src/CableDyn_Hydro.f90 index a8bd802b..7cc03891 100644 --- a/src/CableDyn_Hydro.f90 +++ b/src/CableDyn_Hydro.f90 @@ -75,7 +75,7 @@ MODULE CableDyn_Hydro ! CD_Current_Grid_Velocity, which mirror constructDynamicCurrentGrid / construct4DCurrentGrid ! (source/Waves/WaveGrid.cpp) and CurrentGrid::getCurrentKin (source/Waves.cpp). The fluid ! acceleration of such a current is zero, as MoorDyn-C sets it. - TYPE, PUBLIC :: CD_CurrentGridType + TYPE :: CD_CurrentGridType REAL(wp), ALLOCATABLE :: x(:), y(:), z(:) REAL(wp) :: dt = 1.0_wp INTEGER :: nt = 1 From ac71146ad0f358d800ee04cad5c7cda3b697cabc Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Fri, 30 Oct 2026 21:45:19 +0900 Subject: [PATCH 10/10] fix(bodies): start accelerations in the host's fluid field The aggregate solves the start accelerations of its Free Rigid6 bodies, Free, Pinned and CoupledPinned rods and CoupledPinned bodies at Init, in the zero fields of an external_fluid build, and marks them valid; a host that then set its fluid fields (CD_AGG_SetFluidFields) and stepped started them from the still-water accelerations, without the drag, Froude-Krylov and wetting of its field. Before the first committed step (and before a state mirror is restored) CD_AGG_SetFluidFields now starts the first step in the new fields: a committed transfer of the EI = 0 system's present moving-point kinematics (the line interior accelerations in the fields, which the end-node loads on the objects carry through their consistent inertia), then the objects' start accelerations, as a step-start transfer (CD_AGG_UpdateStates_Moving) gives them. The OpenFAST shell sets its t = 0 field at Init, so the mirror it restores after the first output call carries the accelerations of that field; a checkpoint rebuild restores the mirror before its held field and keeps the checkpoint's. The aggregate snapshot carries whether the objects are committed, so a correction rewind of the first step starts again from the new field. The C API's point fluid fields are refused on decks with bodies or rods, so its aggregate handles are not affected. Decks without integrated bodies or rods are unchanged. Gate 12 of openfast_pinned_body, a submerged Free Rigid6 body and a Free rod on taut, nearly massless lines in a host current with a fluid acceleration: after SetFluidFields the body's start acceleration changes from the still-water one by the drag over the effective mass, 0.5 rhoW CdA |U| U / (m + rhoW V Ca), to 3.3e-6 (the lines' end-node mass); SetFluidFields then Step, the shell's order (field at Init, output call and mirror restore, field before each step) and a rewind of the first step match a run whose start is solved in the field at a step-start transfer bit for bit over 5 steps, and differ from the still-water start by 0.42 and 0.20. On the previous code the body's start acceleration did not change and the three orders were 2.1e-3 (body) and 1.0e-3 (rod) off. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 5 +- CMakeLists.txt | 3 +- doc/theory.rst | 7 +- src/CableDyn_OpenFAST_Aggregate.f90 | 59 ++++++- tests/test_openfast_pinned_body.f90 | 230 +++++++++++++++++++++++++++- 5 files changed, 293 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed4e78c..e1061aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -205,8 +205,9 @@ All notable changes to CableDyn are recorded in this file. The format follows - In OpenFAST, Free Rigid6 bodies and Free, Pinned and CoupledPinned rods started their first step from zero acceleration: the module restores its state mirror after the output call at `t = 0`, which marked the objects' accelerations as committed before the start accelerations - were solved. They are now solved when the module initialises (and at a committed step-start - transfer before the first step), and the line ends on a CoupledPinned object move with them. + were solved. They are now solved when the module initialises (and, before the first step, at a + committed step-start transfer and in new host fluid fields, so a SeaState current or wave starts + them in that field), and the line ends on a CoupledPinned object move with them. An object in its static equilibrium changes at round-off (1e-12 m and 1e-6 deg over 10 s); one started out of balance (`bodyIC deck`) changes by the first step's velocity error, 0.02 m/s and 0.05 deg for a hanging Pinned rod and up to 0.6 m/s for bodies and rods released far out of diff --git a/CMakeLists.txt b/CMakeLists.txt index 48b7f2f2..7960bd80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1137,7 +1137,8 @@ set_tests_properties(openfast_pinned_rod PROPERTIES LABELS "fortran;dynamic;open # a held node, a constant node acceleration against closed forms, a CoupledPinned rod of the same # inertia as a second route, a symmetric mooring that does not turn the body, the output probe, # snapshot/restore and restart, PtfmInit with the static start, sub-cycling, the OpenFAST shell's -# state-mirror restore before the first step, and the refusals. +# state-mirror restore before the first step, the refusals, and the start of Free bodies and rods +# in a host fluid field. add_executable(test_openfast_pinned_body tests/test_openfast_pinned_body.f90) target_link_libraries(test_openfast_pinned_body PRIVATE cabledyn_core) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/openfast_pinned_body) diff --git a/doc/theory.rst b/doc/theory.rst index 93e94481..f1098f58 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -2575,8 +2575,11 @@ added mass and line ends at their own points; MoorDyn-F applies the full buoyanc MoorDyn's); and the attached ``EI = 0`` lines carry their consistent end-node inertia (:math:`m l/3` of the end element, less with the interior following in a step) against MoorDyn-F's lumped :math:`m l/2`. The aggregate solves the start accelerations of its bodies and -rods at initialisation and at a committed transfer of the step-start kinematics, so the state -mirror the OpenFAST shell restores after its first output call already carries them. The sub-step estimate +rods at initialisation and, before the first step, at a committed transfer of the step-start +kinematics and at new host fluid fields (with the line interior accelerations in those fields), so +the first step starts from the accelerations in the host's field and the state mirror the OpenFAST +shell restores after its first output call (its ``t = 0`` field is set at initialisation) already +carries them. The sub-step estimate takes the diagonal of :math:`\mathbf{I}_p` against the line springs through their arms from the node, the waterplane restoring, and the swing stiffness of the weight and buoyancy turning with the body, :math:`|\mathbf{K}_{kk}|` of :math:`\mathbf{K} = -\sum_i[\mathbf{f}_i]_\times[\mathbf{p}_i]_\times` diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index b6f0ff47..53446968 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -246,9 +246,11 @@ MODULE CableDyn_OpenFAST_Aggregate REAL(wp), ALLOCATABLE :: hf_q(:), hf_v(:), hf_a(:) REAL(wp), ALLOCATABLE :: hb_pos(:, :), hb_vel(:, :), hb_acc(:, :), hb_load(:, :) ! The bodies and rods carry the accelerations of a committed step or of a restored state mirror; - ! until then a transfer of the step-start host kinematics re-solves their start accelerations - ! (start_object_accelerations), so the mirror carries them from t = 0. + ! until then a transfer of the step-start host kinematics or new host fluid fields re-solve + ! their start accelerations (start_object_accelerations), so the mirror carries them from + ! t = 0, in the host's field. snap_objects_committed joins the aggregate snapshot. LOGICAL :: objects_committed = .FALSE. + LOGICAL :: snap_objects_committed = .FALSE. LOGICAL :: initialized = .FALSE. END TYPE CD_AGG_ModuleType @@ -1304,6 +1306,9 @@ SUBROUTINE CD_AGG_Snapshot(self, ErrStat, ErrMsg) ! only sys%fast%system); capture them so a correction rewind un-advances the body too. IF (self%has_rigid6) CALL CD_Rigid6_Snapshot(self%rigid6) IF (self%has_rod) CALL CD_Rod_Snapshot(self%rod) + ! a rewind to a state before the first step takes the start accelerations open again (new + ! fluid fields re-solve them) + self%snap_objects_committed = self%objects_committed ErrStat = CD_AGG_OK ErrMsg = '' END SUBROUTINE CD_AGG_Snapshot @@ -1338,6 +1343,7 @@ SUBROUTINE CD_AGG_Restore(self, ErrStat, ErrMsg) IF (ALLOCATED(self%snap_failures)) self%failures = self%snap_failures IF (self%has_rigid6) CALL CD_Rigid6_Restore(self%rigid6) IF (self%has_rod) CALL CD_Rod_Restore(self%rod) + self%objects_committed = self%snap_objects_committed ErrStat = CD_AGG_OK ErrMsg = '' END SUBROUTINE CD_AGG_Restore @@ -1557,6 +1563,9 @@ SUBROUTINE CD_AGG_SetFluidFields(self, fluid_velocity, fluid_acceleration, water !! drag configuration, so the model layer alone cannot catch them). !! dynamic_pressure (optional, Pa, shaped (nfluid)): the wave dynamic pressure at the nodes; !! the rod blocks use it for the end-cap pressure (other blocks ignore it). + !! Before the first committed step (and before a state mirror is restored) the integrated + !! bodies and rods re-solve their start accelerations in the new fields: the accelerations + !! solved at Init saw the zero fields of the build, and the first step starts from them. TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self REAL(wp), INTENT(IN) :: fluid_velocity(:, :), fluid_acceleration(:, :), waterline_z(:) INTEGER, INTENT(OUT) :: ErrStat @@ -1681,10 +1690,51 @@ SUBROUTINE CD_AGG_SetFluidFields(self, fluid_velocity, fluid_acceleration, water RETURN END IF END IF + ! the start of the first step: the bodies' and rods' accelerations in the host's field (the + ! OpenFAST shell sets its t = 0 field at Init, before the output call and its mirror restore) + IF (.NOT. self%objects_committed .AND. (self%has_rigid6 .OR. self%has_rod)) THEN + CALL start_in_fluid_fields(self, ErrStat, ErrMsg) + IF (ErrStat /= CD_AGG_OK) RETURN + END IF ErrStat = CD_AGG_OK ErrMsg = '' END SUBROUTINE CD_AGG_SetFluidFields + SUBROUTINE start_in_fluid_fields(self, ErrStat, ErrMsg) + !! The start of the first step in new host fluid fields (CD_AGG_SetFluidFields before the first + !! committed step): a committed transfer of the EI=0 system's present moving-point kinematics, + !! which solves the line interior accelerations in the fields (the end-node loads on the + !! objects carry their consistent inertia), then the bodies' and rods' start accelerations -- + !! the start a step-start transfer (CD_AGG_UpdateStates_Moving) gives in the same fields. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: self + INTEGER, INTENT(OUT) :: ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp), ALLOCATABLE :: pos(:, :), vel(:, :), acc(:, :), load(:, :) + INTEGER :: n, es, stat + CHARACTER(1024) :: em + ErrStat = CD_AGG_OK + ErrMsg = '' + IF (.NOT. self%has_sys) RETURN + n = CD_FMF_NMovingPoints(self%sys, es, em) + IF (es /= CD_FMF_OK) THEN + CALL map_fmf_status(es, em, ErrStat, ErrMsg) + RETURN + END IF + ALLOCATE (pos(3, n), vel(3, n), acc(3, n), load(3, n), STAT=stat) + IF (stat /= 0) THEN + ErrStat = CD_AGG_ALLOCFAIL + ErrMsg = 'CableDyn_OpenFAST_Aggregate: start-state workspace allocation failed' + RETURN + END IF + CALL CD_FMF_GetMovingPointMesh(self%sys, pos, vel, acc, load, es, em) + IF (es == CD_FMF_OK) CALL CD_FMF_UpdateStates_Moving(self%sys, pos, vel, acc, es, em) + IF (es /= CD_FMF_OK) THEN + CALL map_fmf_status(es, em, ErrStat, ErrMsg) + RETURN + END IF + CALL start_object_accelerations(self, ErrStat, ErrMsg) + END SUBROUTINE start_in_fluid_fields + SUBROUTINE CD_AGG_CalcOutput(self, ErrStat, ErrMsg) !! Compute the EI=0 system loads at the current committed state (stored in the system's !! output/point mesh). Each cable's fairlead reaction is read on demand in @@ -2444,8 +2494,9 @@ END SUBROUTINE overlay_host_objects SUBROUTINE start_object_accelerations(self, ErrStat, ErrMsg) !! Solve the start accelerations of the integrated bodies and rods at the current state - !! (CD_Rigid6_StartAccelerations, CD_Rod_StartAccelerations): at Init and at a committed - !! transfer of the step-start kinematics before the first step. The OpenFAST shell restores + !! (CD_Rigid6_StartAccelerations, CD_Rod_StartAccelerations), in the held fluid fields: at + !! Init and, before the first step, at a committed transfer of the step-start kinematics and + !! at new host fluid fields (CD_AGG_SetFluidFields). The OpenFAST shell restores !! the state mirror after every CalcOutput, which marks the object accelerations committed; !! solved here, the mirror carries the start accelerations, and the first step starts from them !! instead of from zero. diff --git a/tests/test_openfast_pinned_body.f90 b/tests/test_openfast_pinned_body.f90 index d172a749..d47deb78 100644 --- a/tests/test_openfast_pinned_body.f90 +++ b/tests/test_openfast_pinned_body.f90 @@ -35,7 +35,16 @@ PROGRAM test_openfast_pinned_body !! CoupledPinned rods march bit for bit as without the restore; !! 11) a CoupledPinned body outside a coupled host, without inertia, or under the linearisation !! probe (coupled_positions) is refused by name, and so is MoorDyn-F's inertialF 0 (CableDyn - !! always returns the inertia; inertialF 1 is accepted). + !! always returns the inertia; inertialF 1 is accepted); + !! 12) in a host fluid field (a current and a fluid acceleration at every node) a Free Rigid6 body + !! and a Free rod start from their accelerations in that field: after CD_AGG_SetFluidFields + !! the body's start acceleration differs from the still-water one by the drag over the + !! effective mass, 0.5 rhoW CdA |U| U / (m + rhoW V Ca) (1e-5: the lines' end-node mass is + !! left out), and the first steps of + !! SetFluidFields then Step, of the shell's order (the t = 0 field at Init, the output call + !! and its mirror restore, the field again before the step) and of a correction rewind to + !! before the first step are those of a run whose start accelerations are solved in the + !! field at a step-start transfer, bit for bit, and differ from the still-water start. USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK USE CableDyn_OpenFAST_Aggregate, ONLY: CD_AGG_ModuleType, CD_AGG_Init_From_Deck, CD_AGG_NMovingPoints, & @@ -44,7 +53,7 @@ PROGRAM test_openfast_pinned_body CD_AGG_End, CD_AGG_OK, CD_AGG_HasRigid6, CD_AGG_HasRod, & CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, & CD_AGG_Set_Rigid6_States, CD_AGG_Rod_MirrorSize, CD_AGG_Get_Rod_States, & - CD_AGG_Set_Rod_States + CD_AGG_Set_Rod_States, CD_AGG_NFluidNodes, CD_AGG_SetFluidFields USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_Get_System_Line_State, & CD_Update_System_Line_Interior_State, CD_SYSTEM_OK, CD_System_NSystemCoupledDOF, & CD_Get_System_CoupledMotion, CD_Update_System_CoupledMotion, CD_Calc_System_CoupledLoads @@ -55,6 +64,11 @@ PROGRAM test_openfast_pinned_body REAL(wp), PARAMETER :: MB = 1000.0_wp, HCG = 2.0_wp, IYY = 500.0_wp, ZPIN = 20.0_wp ! the arm of the second route: a 4 m rod, 0.3 m diameter, 75 kg/m, pinned at z = 5 m, 20 deg REAL(wp), PARAMETER :: LA = 4.0_wp, DA = 0.3_wp, MA = 300.0_wp, ZA = 5.0_wp, THA = 20.0_wp + ! the Free body of gate 12: mass, volume, CdA and Ca + REAL(wp), PARAMETER :: FB_M = 5000.0_wp, FB_V = 4.0_wp, FB_CDA = 6.0_wp, FB_CA = 0.8_wp + ! gate 12's host field (a current and a fluid acceleration), coupling step and step count + REAL(wp), PARAMETER :: FS_U(3) = [0.8_wp, 0.3_wp, 0.0_wp], FS_A(3) = [0.2_wp, 0.0_wp, 0.1_wp], FS_DT = 0.01_wp + INTEGER, PARAMETER :: FS_NSTEP = 5 INTEGER :: nfail nfail = 0 @@ -69,6 +83,8 @@ PROGRAM test_openfast_pinned_body CALL case_mixed_hosts() CALL case_shell_start() CALL case_refusals() + CALL case_fluid_start('pinbody_fluid_body.dat', .FALSE.) + CALL case_fluid_start('pinbody_fluid_rod.dat', .TRUE.) IF (nfail > 0) THEN WRITE (*, '(A,I0,A)') 'FAIL: ', nfail, ' assertion(s) failed' ERROR STOP 1 @@ -1439,4 +1455,214 @@ SUBROUTINE write_zero_inertia(path) CLOSE (u) END SUBROUTINE write_zero_inertia + ! --------------------------------------------------------------------------------------------- ! + ! 12: start accelerations in the host's fluid field ! + ! --------------------------------------------------------------------------------------------- ! + + SUBROUTINE write_fluid_deck(path, rod) + !! A submerged Free object on two taut, nearly massless lines (0.01 kg/m, EA 1e5 N) without + !! hydrodynamic coefficients (their end forces neither see the field nor add inertia) to + !! anchors at x = +-40 m on the 50 m seabed: rod a horizontal + !! Free rod (6 m, 0.5 m diameter, 200 kg/m, Cd 1.2, Ca 1) at z = -20 m, else a Free Rigid6 + !! body (5000 kg, 4 m^3, CdA 6 m^2, Ca 0.8, CG at the reference point) there with its line + !! points 3 m out along x. Released at its deck pose (out of balance). + CHARACTER(*), INTENT(IN) :: path + LOGICAL, INTENT(IN) :: rod + INTEGER :: u + OPEN (NEWUNIT=u, FILE=path, STATUS='REPLACE', ACTION='WRITE') + WRITE (u, '(A)') 'Free object in a host fluid field' + WRITE (u, '(A)') '--- LINE TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass EA BA EI Cdn Cdt Can Cat' + WRITE (u, '(A)') '(-) (m) (kg/m) (N) (-) (Nm2) (-) (-) (-) (-)' + WRITE (u, '(A)') 'dry 0.002 0.01 1.0e5 0.0 0.0 0.0 0.0 0.0 0.0' + IF (rod) THEN + WRITE (u, '(A)') '--- ROD TYPES ---' + WRITE (u, '(A)') 'Name Diam Mass Cd Ca CdEnd CaEnd' + WRITE (u, '(A)') '(-) (m) (kg/m) (-) (-) (-) (-)' + WRITE (u, '(A)') 'arm 0.5 200.0 1.2 1.0 0 0' + WRITE (u, '(A)') '--- RODS ---' + WRITE (u, '(A)') 'ID RodType Type XA YA ZA XB YB ZB NumSegs Outputs' + WRITE (u, '(A)') '(-) (-) (-) (m) (m) (m) (m) (m) (m) (-) (-)' + WRITE (u, '(A)') '1 arm Free -3.0 0.0 -20.0 3.0 0.0 -20.0 6 -' + ELSE + WRITE (u, '(A)') '--- BODIES ---' + WRITE (u, '(A)') 'ID Type X Y Z Rot1 Rot2 Rot3 Mass Vol C33 C44 C55 CdA Ca Ixx Iyy Izz' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (deg) (deg) (deg) (kg) (m3) (N/m) (Nm/rad) (Nm/rad) (m2) (-) '// & + '(kgm2) (kgm2) (kgm2)' + WRITE (u, '(A,ES24.16,1X,ES24.16,A,ES24.16,1X,ES24.16,A)') '1 Rigid6 0.0 0.0 -20.0 0.0 0.0 0.0 ', FB_M, & + FB_V, ' 0.0 0.0 0.0 ', FB_CDA, FB_CA, ' 1.0e4 1.0e4 1.0e4' + END IF + WRITE (u, '(A)') '--- POINTS ---' + WRITE (u, '(A)') 'ID Type X Y Z Mass Vol CdA Ca' + WRITE (u, '(A)') '(-) (-) (m) (m) (m) (kg) (m3) (m2) (-)' + IF (.NOT. rod) THEN + WRITE (u, '(A)') '1 Body1 3.0 0.0 0.0 0 0 0 0' + WRITE (u, '(A)') '2 Body1 -3.0 0.0 0.0 0 0 0 0' + END IF + WRITE (u, '(A)') '3 Fixed 40.0 0.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '4 Fixed -40.0 0.0 -50.0 0 0 0 0' + WRITE (u, '(A)') '--- LINES ---' + WRITE (u, '(A)') 'ID NodeA NodeB Outputs' + WRITE (u, '(A)') '(-) (-) (-) (-)' + IF (rod) THEN + WRITE (u, '(A)') '1 R1B 3 -' + WRITE (u, '(A)') '2 R1A 4 -' + ELSE + WRITE (u, '(A)') '1 1 3 -' + WRITE (u, '(A)') '2 2 4 -' + END IF + WRITE (u, '(A)') '--- SECTIONS ---' + WRITE (u, '(A)') 'LineID LineType Length NumSegs' + WRITE (u, '(A)') '(-) (-) (m) (-)' + WRITE (u, '(A)') '1 dry 47.0 10' + WRITE (u, '(A)') '2 dry 47.0 10' + CALL write_options(u, 50.0_wp, 'deck') + CLOSE (u) + END SUBROUTINE write_fluid_deck + + SUBROUTINE set_field(agg, u_c, a_c) + !! The uniform host field u_c, a_c at every fluid node, the free surface at z = 0. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + REAL(wp), INTENT(IN) :: u_c(3), a_c(3) + REAL(wp), ALLOCATABLE :: uf(:, :), af(:, :), wz(:) + INTEGER :: nf, es, i + CHARACTER(512) :: em + nf = CD_AGG_NFluidNodes(agg, es, em) + ALLOCATE (uf(3, nf), af(3, nf), wz(nf)) + DO i = 1, nf + uf(:, i) = u_c + af(:, i) = a_c + END DO + wz = 0.0_wp + CALL CD_AGG_SetFluidFields(agg, uf, af, wz, es, em) + CALL require(es == CD_AGG_OK, 'fluid-start:the host field is accepted: '//TRIM(em)) + END SUBROUTINE set_field + + SUBROUTINE get_mirror(agg, rod, s) + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + LOGICAL, INTENT(IN) :: rod + REAL(wp), INTENT(OUT) :: s(:) + INTEGER :: es + CHARACTER(512) :: em + IF (rod) THEN + CALL CD_AGG_Get_Rod_States(agg, s, es, em) + ELSE + CALL CD_AGG_Get_Rigid6_States(agg, s, es, em) + END IF + END SUBROUTINE get_mirror + + SUBROUTINE case_fluid_start(path, rod) + !! Gate 12 for one deck (rod: the Free rod, else the Free Rigid6 body). Every run in the field + !! holds FS_U, FS_A and takes FS_NSTEP steps; the mirror after them is compared. + CHARACTER(*), INTENT(IN) :: path + LOGICAL, INTENT(IN) :: rod + TYPE(CD_AGG_ModuleType) :: still, direct, oracle, shell, rewound, drag_only + REAL(wp), ALLOCATABLE :: p(:, :), v(:, :), a(:, :), f(:, :) + REAL(wp) :: s_still(24), s_dir(24), s_or(24), s_sh(24), s_rw(24) + REAL(wp) :: s0(24), s1(24), da(3), da_o(3), ms(24), err_drag + INTEGER :: es, n, it + LOGICAL :: cv, st + CHARACTER(512) :: em + + CALL write_fluid_deck(path, rod) + CALL CD_AGG_Init_From_Deck(still, path, FS_DT, es, em, external_fluid=.TRUE.) + CALL require(es == CD_AGG_OK, 'fluid-start:init '//path//': '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + CALL CD_AGG_Init_From_Deck(direct, path, FS_DT, es, em, external_fluid=.TRUE.) + CALL CD_AGG_Init_From_Deck(oracle, path, FS_DT, es, em, external_fluid=.TRUE.) + CALL CD_AGG_Init_From_Deck(shell, path, FS_DT, es, em, external_fluid=.TRUE.) + CALL CD_AGG_Init_From_Deck(rewound, path, FS_DT, es, em, external_fluid=.TRUE.) + n = CD_AGG_NMovingPoints(still, es, em) + CALL require(n == 0, 'fluid-start:no host node '//path) + ALLOCATE (p(3, n), v(3, n), a(3, n), f(3, n)) + p = 0.0_wp + v = 0.0_wp + a = 0.0_wp + ! the body: the start acceleration in a current over the still-water one, against the drag + IF (.NOT. rod) THEN + CALL CD_AGG_Init_From_Deck(drag_only, path, FS_DT, es, em, external_fluid=.TRUE.) + CALL get_mirror(drag_only, rod, s0) + CALL set_field(drag_only, FS_U, [0.0_wp, 0.0_wp, 0.0_wp]) + CALL get_mirror(drag_only, rod, s1) + da = s1(7:9) - s0(7:9) + da_o = 0.5_wp*RHO*FB_CDA*NORM2(FS_U)*FS_U/(FB_M + RHO*FB_V*FB_CA) + err_drag = NORM2(da - da_o)/NORM2(da_o) + WRITE (*, '(A,3ES14.6,A,ES10.3)') 'start acceleration in a current, Free body: change ', da, & + ' m/s^2, against the drag over the effective mass ', err_drag + CALL require(err_drag <= 1.0e-5_wp, 'fluid-start:the body starts from its acceleration in the current') + CALL require(MAXVAL(ABS(s1(13:15) - s0(13:15))) <= 1.0e-12_wp*MAX(1.0_wp, MAXVAL(ABS(s0(13:15)))), & + 'fluid-start:the drag at the reference point turns nothing') + CALL CD_AGG_End(drag_only, es, em) + END IF + ! still water + CALL march_in_field(still, .FALSE., path, p, v, a) + CALL get_mirror(still, rod, s_still) + ! the host's field, then the steps + CALL set_field(direct, FS_U, FS_A) + CALL march_in_field(direct, .FALSE., path, p, v, a) + CALL get_mirror(direct, rod, s_dir) + ! the oracle: the field, then a committed step-start transfer solves the start accelerations + CALL set_field(oracle, FS_U, FS_A) + CALL CD_AGG_UpdateStates_Moving(oracle, p, v, a, es, em) + CALL require(es == CD_AGG_OK, 'fluid-start:step-start transfer: '//TRIM(em)) + CALL march_in_field(oracle, .FALSE., path, p, v, a) + CALL get_mirror(oracle, rod, s_or) + ! the OpenFAST shell: the t = 0 field at Init, the output call and its mirror restore, the + ! field of the step's end before the step + CALL set_field(shell, FS_U, FS_A) + CALL CD_AGG_CalcOutput(shell, es, em) + CALL CD_AGG_GetMovingPointMesh(shell, p, v, a, f, es, em) + CALL get_mirror(shell, rod, ms) + IF (rod) THEN + CALL CD_AGG_Set_Rod_States(shell, ms, es, em) + ELSE + CALL CD_AGG_Set_Rigid6_States(shell, ms, es, em) + END IF + CALL require(es == CD_AGG_OK, 'fluid-start:mirror restore: '//TRIM(em)) + CALL march_in_field(shell, .TRUE., path, p, v, a) + CALL get_mirror(shell, rod, s_sh) + ! a correction rewind of the first step to the snapshot before it, then the field and the steps + ! again + CALL CD_AGG_Snapshot(rewound, es, em) + CALL set_field(rewound, FS_U, FS_A) + CALL CD_AGG_Step_Moving(rewound, FS_DT, p, v, a, cv, st, it, es, em, t_committed=FS_DT) + CALL require(es == CD_AGG_OK .AND. cv, 'fluid-start:first step before the rewind: '//TRIM(em)) + CALL CD_AGG_Restore(rewound, es, em) + CALL require(es == CD_AGG_OK, 'fluid-start:rewind: '//TRIM(em)) + CALL set_field(rewound, FS_U, FS_A) + CALL march_in_field(rewound, .FALSE., path, p, v, a) + CALL get_mirror(rewound, rod, s_rw) + WRITE (*, '(A,A,A,ES10.3,A,3ES10.3)') 'start in the host field, ', path, ': field vs still water ', & + nan_max_abs(s_dir - s_still), '; vs the transfer-solved start: direct, shell order, rewind ', & + nan_max_abs(s_dir - s_or), nan_max_abs(s_sh - s_or), nan_max_abs(s_rw - s_or) + CALL require(nan_max_abs(s_dir - s_still) > 1.0e-6_wp, 'fluid-start:the field changes the first steps '//path) + CALL require(nan_max_abs(s_dir - s_or) <= 0.0_wp, & + 'fluid-start:SetFluidFields then Step starts from the accelerations in the field '//path) + CALL require(nan_max_abs(s_sh - s_or) <= 0.0_wp, 'fluid-start:the shell order starts from them '//path) + CALL require(nan_max_abs(s_rw - s_or) <= 0.0_wp, 'fluid-start:a rewind before the first step too '//path) + CALL CD_AGG_End(still, es, em) + CALL CD_AGG_End(direct, es, em) + CALL CD_AGG_End(oracle, es, em) + CALL CD_AGG_End(shell, es, em) + CALL CD_AGG_End(rewound, es, em) + END SUBROUTINE case_fluid_start + + SUBROUTINE march_in_field(agg, refresh, path, p, v, a) + !! FS_NSTEP steps of gate 12 with the host node set (p, v, a) held; refresh sets the field + !! again before each step, as the shell samples it at every step's end. + TYPE(CD_AGG_ModuleType), INTENT(INOUT) :: agg + LOGICAL, INTENT(IN) :: refresh + CHARACTER(*), INTENT(IN) :: path + REAL(wp), INTENT(IN) :: p(:, :), v(:, :), a(:, :) + INTEGER :: step, it, es + LOGICAL :: cv, st + CHARACTER(512) :: em + DO step = 1, FS_NSTEP + IF (refresh) CALL set_field(agg, FS_U, FS_A) + CALL CD_AGG_Step_Moving(agg, FS_DT, p, v, a, cv, st, it, es, em, t_committed=REAL(step, wp)*FS_DT) + CALL require(es == CD_AGG_OK .AND. cv, 'fluid-start:step '//path//': '//TRIM(em)) + IF (es /= CD_AGG_OK) RETURN + END DO + END SUBROUTINE march_in_field + END PROGRAM test_openfast_pinned_body