From d1000bc4d3450541bf6568c302637e47e87c5ee6 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sat, 17 Oct 2026 12:18:17 +0900 Subject: [PATCH 1/5] feat(dynamics): sub-step EI = 0 steps that turn or snap taut At dtM 0.1 s a taut segment of the Lozon 80 m all-chain mooring turns by up to 6 deg per step in 5 m / 7 s heave, and both generalised-alpha blends gave snap-load peaks 10 to 20 % low. The release cap was not the cause: it acts in 0.3 % of the element steps, never near a peak, and the cycle maxima with and without it agree to within 1 %. The peaks followed the algorithmic damping, so a coarse step under-resolves them whatever the blend. CD_Step_Model now measures each converged step against its committed start. When a segment that ends the step taut turned by more than ei0_substep_angle (default 1 deg), or a segment slack at the start ends above a quarter of the largest step-start tension, the interval is solved again from the same committed state in max(4, ceil(turn/angle)) equal sub-steps, at most ei0_substep_max (default 16). The end motion follows the quintic of the recovering step and the last sub-step lands on the given end state. The sub-stepped interval is measured once more and re-solved when its turn needs more sub-steps; a sub-step that fails returns the plain step. The decision depends only on the committed state and the step inputs, so a restart repeats it. Every route that steps EI = 0 lines goes through it (standalone lines and line systems, OpenFAST, FAST.Farm, the C API) except the monolithic junction coupling, which needs the nominal step's end reaction and tangent. The recovering step keeps taking its rungs as given. New OPTIONS ei0_substeps auto|off (default auto; off with False alpha_force_blend unless the deck sets it, so paper mode is unchanged), ei0_substep_angle and ei0_substep_max, mirrored in the Python deck reader. off gives the previous results bit for bit. The run audit measures turns and axial-wave crossings per solver step, reports the sub-stepped steps, and its turn note states the peak underestimate. Over seven runs with amplitudes 3e-4 apart, against 0.5 / 0.25 ms runs, the 80 m heave fairlead and anchor maxima move from 15 / 17 % low to 4 / 8 % low, and the 200 m semitaut anchor maxima in 10 m / 14 s and 5 m / 7 s surge from +16 / +26 % to -1.4 / -2.6 %. 19 of 21 EI = 0 dynamic examples are unchanged; the line-break decks' pre-failure snap moves by 5-11 %. Bergdahl RMSE 1.58 -> 1.59 N (record files and provenance updated); the other validation records move within their recorded ranges or not at all. The 20-run mooring envelope takes 1.65 times as long. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 45 +++ VALIDATION.md | 36 +- doc/capi.rst | 6 +- doc/driver_format.md | 3 + doc/options.rst | 37 +- doc/theory.rst | 57 ++- doc/troubleshooting.rst | 28 +- examples/cabledyn_options_reference.dat | 4 + python/cabledyn/deck_file.py | 28 ++ python/tests/test_deck_file.py | 13 + src/CableDyn_DeckDriver.f90 | 78 +++- src/CableDyn_Dynamic.f90 | 12 + src/CableDyn_Model.f90 | 335 +++++++++++++++++- tests/test_ei0_slack_dynamics.f90 | 53 ++- tests/test_model.f90 | 131 ++++++- validation/experiments/bergdahl/README.md | 13 +- .../bergdahl/aggregate_metrics.json | 16 +- .../bergdahl/comparison_summary.csv | 40 +-- .../experiments/bergdahl/provenance.json | 16 +- .../bergdahl/refinement_summary.csv | 4 +- .../bergdahl/refinement_summary.json | 40 +-- 21 files changed, 878 insertions(+), 117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba564c6f..24d79c07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -168,6 +168,51 @@ All notable changes to CableDyn are recorded in this file. The format follows ### Changed +- Tension-only (`EI = 0`) lines resolve fast segment rotation and slack-to-taut snaps by + sub-stepping, on by default (new OPTIONS `ei0_substeps auto|off`, `ei0_substep_angle` + (default 1°) and `ei0_substep_max` (default 16)). A converged step in which a segment that + ends it taut turned by more than `ei0_substep_angle`, or a segment slack at its start ends it + above a quarter of the largest step-start tension, is solved again from the same committed + state in `max(4, ceil(turn/angle))` equal sub-steps, at most `ei0_substep_max`, with the end + motion on the quintic of the recovering step and the last sub-step on the given end state; + output and coupling times are unchanged. At `dtM` 0.1 s a taut segment of the Lozon 80 m + all-chain mooring turns by up to 6° per step in 5 m / 7 s heave, and the snap-load peaks of + both generalised-α blends came out 10 to 20 % low. The release cap was not the cause: it acts + in 0.3 % of the element steps, never within 0.5 s of a peak, and the cycle maxima with and + without it agree to within 1 %; the peaks followed the algorithmic damping (28 and 31 % low at + `rhoInf` 0, 10 and 40 % high at 0.6). Over seven runs whose amplitude differs by up to 3e-4, + against 0.5 and 0.25 ms runs, the fairlead and anchor maxima move from 15 and 17 % low to 4 and + 8 % low (the configuration blend of 0.1.1 gave 10 and 18 % low), and the anchor maxima of + the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge from 16 and 26 % high to 1.4 + and 2.6 % low. A single run at that step varies by 15 to 20 points, so a single comparison + can make either blend look accurate. The decision depends only on the committed state and the + step inputs, so restarts repeat it; a sub-step that does not converge returns the plain + step. It applies on every route that steps `EI = 0` lines (standalone lines and line systems, + OpenFAST, FAST.Farm and the C API, whose raw lines always take it) except the monolithic body + and point coupling, which needs the end reaction and tangent of the nominal step. `False + alpha_force_blend` (paper mode) turns it off unless the deck sets it, so the paper + reproduction is unchanged. The standalone driver reports the sub-stepped steps per line, and + its segment-turn note now measures the turn per solver step and states that peaks come out 10 + to 20 % low near 6° per step. Over the shipped examples 19 of the 21 `EI = 0` dynamic decks + are unchanged bit for bit; in the two `als_volturnus` line-break decks the pre-failure anchor + snap at 250 s, a single-step peak at `dtM` 0.05 s, moves from 2.145 to 1.918 MN (1.963 MN + converged) and from 2.262 to 2.158 MN (2.334 MN converged), with the other tension + statistics within 0.02 %. The 20-run Lozon mooring envelope at `dtM` 0.1 s takes 1.65 times + as long (at most 2.6 times; the steps that do not trigger cost nothing extra), and the + examples whose steps never trigger run as before. Of the reproducers of the force-blend + entry below, the semi-taut chain–polyester leg in 15 m surge now peaks at 4.65 MN at the + anchor at `dtM` 0.05 s (5.74 MN before, 4.6 MN at 0.0025 s), the Syrope line at 1.82 MN + (1.64 MN before, 1.78 MN at 1 and 2.5 ms), the lightly damped viscoelastic light cable at + 0.092 MN (0.085 MN before, 0.082 to 0.095 MN at 0.5 to 2.5 ms) and the shipped viscoelastic + polyester at 1.80 MN as before; the light cable stays at 0.092 / 0.106 MN at `dtM` 0.1 s and + its largest segment tension at `dtM` 0.01 s moves from 0.107 to 0.095 MN. Validation: the + Bergdahl matrix gives RMSE 1.59 N (1.58 N), MAPE 3.13 %, Pearson 0.993 and Lin concordance + 0.989, with mesh and time-step halving moving the cycle maxima by at most 0.53 % and 0.13 % + (0.52 % and 0.19 %); the WD0050/A2 cell of the L2-2 parity moves within its recorded range + (largest OrcaFlex summary difference 0.091 to 0.093, MoorDyn-C metric 0.078 to 0.076); the + other L2-2 cells, the one-hour VolturnUS-S record, the L3-2 regular-wave comparison and the + snap-load verification are unchanged bit for bit (the latter two step the generalised-α + kernel directly). `off ei0_substeps` gives the previous results bit for bit. - Finite-EI node tension, curvature and bend moment are recovered from nodal equilibrium. The `TenN`, `CurvN` and `BendMomN` channels, the `Tension`, `Curvature` and `BendMoment` columns of the static profile and the range graph, and the `.t.out` segment diff --git a/VALIDATION.md b/VALIDATION.md index 7d7ce2b9..0aa7c4e0 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -76,7 +76,7 @@ article's methods, are compared in | **L3-6e** | Out-of-plane / 3D whirl response | OrcaFlex 11.6d | 3D curv 0.52%, interior Y env ≤1.0 mm, sag ≤22 mm, tension 0.14/0.17/0.12% | curv <3%, env <5 cm, tension <2–3% | Pass | | **L3-7** | 1-hour VolturnUS-S mooring dynamic | OrcaFlex 11.6d | `FairTen` mean 0.27%, std 0.26%, min/max 0.50/0.43%, Fourier 0.27/1.14% | ≤5% | Pass | | **L3-H** | Holcombe static lazy-wave experiment | measured marker geometry | position RMSE 1.07–1.89% of suspended length; peak marker-curvature error 0.34–5.54% | end-restraint bracket | Pass | -| **L3-B** | Bergdahl chain experiment, 30 orbit conditions | measured upper-end force | RMSE 1.58 N; MAPE 3.13%; Pearson 0.993; Lin concordance 0.989 | full published matrix | Pass | +| **L3-B** | Bergdahl chain experiment, 30 orbit conditions | measured upper-end force | RMSE 1.59 N; MAPE 3.13%; Pearson 0.993; Lin concordance 0.989 | full published matrix | Pass | | **L-fig** | Along-arc curvature overlay (CableDyn / OrcaFlex / MoorDyn-F ±4×) | 3-code committed record | CableDyn peak 0.11% from OrcaFlex | <0.5% | Pass | | **L4-1** | Coupled platform + mooring | synthetic reference | bit-for-bit | — | Pass | | **L4-1b** | VolturnUS-S coupled platform + power cable | OpenFAST v5.0.0 (CompMooring 5 vs 3) | platform DOFs <0.6% (3-seed DLC-1.1); fairlead and anchor <0.001% static | <3% platform | Pass | @@ -259,7 +259,8 @@ initialisation. mean, 0.26% in std, 0.50 / 0.43% in minimum / maximum, and 0.27% (90 s) / 1.14% (12 s) in Fourier amplitude**. The end-element tension carries the 1.28% static offset of L2-V in its mean and extremes. The force-blended `EI = 0` step moved the - minimum by +7 kN (0.15% before) and the other statistics by at most 0.01%. + minimum by +7 kN (0.15% before) and the other statistics by at most 0.01%; no step of this + drive needs the rotation- and snap-resolved sub-steps, so they leave it unchanged bit for bit. - **L-fig curvature overlay**: `l3_lazywave_dynamic` writes each site's along-arc curvature profile. [`validation/scripts/curvature_profile_overlay.py`](https://github.com/SMI-Lab-Inha/CableDyn/blob/main/validation/scripts/curvature_profile_overlay.py) @@ -288,15 +289,17 @@ scripts, results, and source provenance are in - **L3-B Bergdahl dynamic chain test** ([Bergdahl et al., 2016](https://cabledyn.readthedocs.io/en/latest/references.html#ref-bergdahl2016)): over the full 30-condition period-radius matrix, cycle-maximum upper-end force - has RMSE 1.58 N, mean absolute percentage error 3.13%, Pearson correlation + has RMSE 1.59 N, mean absolute percentage error 3.13%, Pearson correlation 0.993, and Lin concordance 0.989. Two phase-averaged measured histories have waveform RMSEs of 5.95% and 2.54% of their force ranges; these two were computed with the - executable of the 2026-10-09 record (the configuration-blended `EI = 0` step), because the + executable of the 2026-10-09 record (the configuration-blended `EI = 0` step, without + sub-steps), because the article supplement's `expData.dat` they need was not available for the rerun (see the experiment's README and `provenance.json`). Halving the mesh length - and the time step changes the mean cycle maximum by at most 0.52% and 0.19%. The + and the time step changes the mean cycle maximum by at most 0.53% and 0.13%. The 0.3125 ms step resolves the segment axial modes that the snap loads excite; at - 1.25 ms the maxima are 2–15% higher and vary from cycle to cycle. + 0.625 ms the T = 1.25 s maxima are 2.3% higher (6.5% with every step taken as given), and + at 1.25 ms they are 2–15% higher and vary from cycle to cycle. ## L4 coupled OpenFAST @@ -380,6 +383,16 @@ scripts, results, and source provenance are in 30 ms in a sweep); the peak is within **1.5%** of the 0.5 ms sub-CFL reference (1.1% at 10 ms, 0.05% at 5 ms). Before the force-blended `EI = 0` step these were 2.76 / 0.62 / 0.16%; the 2.76% at 20 ms is the value published as 2.7% (truncated). + The test steps the generalised-α kernel itself, without the rotation- and snap-resolved + sub-steps of the line models (next item). +- **Snap-load peaks at a coarse step** (Lozon moorings, `dtM = 0.1 s`): over seven runs whose + motion amplitude differs by up to 3e-4 (the snap peaks of a single run vary by 15–20 + points at this step), against 0.5 and 0.25 ms runs, the fairlead and anchor maxima of the + 80 m all-chain mooring in 5 m / 7 s heave are 15% and 17% low when every step is taken as + given (`off ei0_substeps`) and 4% and 8% low with the default `auto`; the anchor maxima of + the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge are 16% and 26% high and + 1.4% and 2.6% low. In 5 m / 7 s surge the 80 m maxima are within 2.5% either way. On the + 0.1 s output grid the converged run itself reads the 80 m heave maxima 5% low. - **Implicit and explicit steps**: on the matched near-taut snap, MoorDyn-C's explicit RK2 needs `dtM ≲ 1 ms`, as expected of an explicit scheme at this line stiffness; CableDyn's implicit step remains stable at **20 ms**. @@ -673,10 +686,13 @@ feedback re-converge each step (three-seed DLC-1.1, L4-1b, <0.6%). **Prescribed-motion moorings.** The Lozon all-chain catenary and semitaut chain–polyester moorings are driven through the same surge-and-heave envelope at -`dtM = 0.1 s`. The all-chain mooring needs no step subdivision and takes 0.7–1.1 ms -of wall time per 0.1 s step with at most 16 Newton iterations; the stiffer composite -subdivides about 1.4% of steps at the severe and extreme excursions and takes less -than 3.3 ms per step. +`dtM = 0.1 s` (72 s each). All 20 runs complete. With the default `ei0_substeps auto`, +the steps in which a taut segment turns by more than 1° or a segment snaps taut are +solved in 4 to 8 sub-steps: none to 3% of the steps in the 3 m / 10 s and 8 m / 20 s +motions, 31–74% in the 5 m / 7 s and 10 m / 14 s ones. The march takes 0.25–1.0 ms of +wall time per 0.1 s step for the all-chain mooring and 0.35–1.3 ms for the composite, +1.65 times the plain steps over the 20 runs (at most 2.6 times), and the recovering step +subdivides at most 12 of the 720 intervals of a run. **Coupled OpenFAST sea states.** In the full IEA-15 MW VolturnUS-S model with SeaState JONSWAP waves, the all-chain mooring completes `Hs = 10 m`, `Tp = 14 s` diff --git a/doc/capi.rst b/doc/capi.rst index 19c90a50..c0cafceb 100644 --- a/doc/capi.rst +++ b/doc/capi.rst @@ -1048,8 +1048,10 @@ The Newton settings are fixed at their defaults: relative residual tolerance :math:`10^{-8}`, at most 30 iterations per step, and at most 12 line-search backtracks. So is the generalised-α scheme: these lines always take the force-blended step (``alpha_force_blend`` ``True``, with the release cap on a tension-only line, -:doc:`theory`). They cannot select the configuration blend of 0.1.1 and earlier -(``False alpha_force_blend``), which only a deck sets, through ``CableDyn_InitDeck``. +:doc:`theory`), with the rotation- and snap-resolved sub-steps of ``ei0_substeps auto`` at +their default settings (:doc:`options`). They cannot select the configuration blend of 0.1.1 +and earlier (``False alpha_force_blend``) or ``off ei0_substeps``, which only a deck sets, +through ``CableDyn_InitDeck``. ``CableDyn_InitLines`` ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/driver_format.md b/doc/driver_format.md index e934d6cb..74f01f80 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1026,6 +1026,9 @@ syntax form. The most frequently edited keywords are: | `tensile_safety` | `False`, `warn`, or `True`; audits the element-mean axial force (three-point Gauss mean of the signed axial resultant, averaged over an element and its two neighbours). `True` rejects. `warn` commits the state, counts accepted-step events, and reports the worst force, threshold, element and time (the printed `xi` is always 0.5, the element centre) | `False` | | `tensile_strain_tolerance` | non-negative strain band for the dynamic tensile audit | `2e-6` | | `recovery_max_substeps` | integer from 4 to 65536; maximum step subdivision for dynamic-step recovery on tension-only and bending lines. Internal prescribed states lie on one C2 quintic trajectory and land on the nominal coupling endpoint. The standalone summary reports recovered intervals and the largest subdivision used | `1024` | +| `ei0_substeps` | `auto` or `off`. `auto` solves a converged `EI = 0` step again in `max(4, ceil(turn/ei0_substep_angle))` equal sub-steps (at most `ei0_substep_max`) when a segment that ends it taut turned by more than `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of the largest step-start tension; the end motion follows the C2 quintic of the recovering step, and output and coupling times are unchanged. `off` takes every step as given. Steps of the monolithic body and point coupling are not sub-stepped | `auto` (`off` with `False alpha_force_blend`) | +| `ei0_substep_angle` | real in (0, 90], deg; largest taut-segment turn per step before `auto` sub-steps it | `1.0` | +| `ei0_substep_max` | integer from 2 to 1024; most sub-steps `auto` takes for one step | `16` | | `axial_quadrature_order` | Gauss order 1–6 for the finite-EI axial energy; a value different from the bending order gives selective integration | `4` | | `bending_quadrature_order` | Gauss order 1–6 for the finite-EI curvature energy | `4` | | `dynamic_solver rel abs max_iter backtracks [rhoInf]` | dynamic Newton controls; keyword-first syntax, unlike scalar rows. `EI = 0` solves use all four; standalone finite-EI decks use `rel` and `max_iter` (coupled cables: see the OPTIONS reference). Choose them for the mesh and load case; the 952-element Gulf of Maine example uses `1e-4 1e-14 100 12` | `1e-8 1e-14 30 12` | diff --git a/doc/options.rst b/doc/options.rst index d573b6e4..f11f2fbf 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -353,6 +353,40 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver`` recovered intervals and the largest subdivision count used - both - ``1024 recovery_max_substeps`` + * - ``ei0_substeps`` / ``ei0substeps`` + - word + - ``auto``; ``off`` with ``False alpha_force_blend`` + - ``auto`` or ``off``. ``auto``: a converged step of an ``EI = 0`` line in which a segment + that ends the step taut turned by more than ``ei0_substep_angle``, or a segment slack at + the start of the step ended it above a quarter of the largest step-start tension, is + solved again from the same committed state in ``max(4, ceil(turn/ei0_substep_angle))`` + equal sub-steps (at most ``ei0_substep_max``). The end motion inside the step follows + the C2 quintic of the recovering step and the last sub-step lands on the given end state; + the output and coupling times are unchanged. At ``dtM = 0.1`` s a taut segment of the + Lozon 80 m all-chain mooring turns by up to 6 deg per step in 5 m / 7 s heave, and both + generalised-α blends then give snap-load peaks 10 to 20 % low; with ``auto`` they are 4 % + and 8 % low on average, within 4 % of the converged run sampled at the same 0.1 s output + times, at 2 to 2.5 times the wall time of the plain steps on the severe cases (1.65 times + over the 20-case Lozon mooring envelope). ``off`` takes every step as given, as before + this option. Steps of the monolithic body + and point coupling (``monolithic bodyScheme``) are never sub-stepped. The standalone + driver reports the sub-stepped steps per line. See :doc:`theory` + - both (``EI = 0`` lines) + - ``off ei0_substeps`` + * - ``ei0_substep_angle`` / ``ei0substepangle`` + - real, deg + - ``1.0`` + - finite, in ``(0, 90]``. Largest chord turn of a taut segment in one step before + ``ei0_substeps auto`` sub-steps it + - both (``EI = 0`` lines) + - ``1.0 ei0_substep_angle`` + * - ``ei0_substep_max`` / ``ei0substepmax`` + - integer, – + - ``16`` + - integer from 2 to 1024. Most sub-steps ``ei0_substeps auto`` takes for one step; a step + whose turn needs more is solved in this many, and the run notes it + - both (``EI = 0`` lines) + - ``16 ei0_substep_max`` Finite-EI cable controls ------------------------ @@ -398,7 +432,8 @@ Finite-EI cable controls (``True``) or 0.1 deg (``False``) in one step. A dynamic run with a torsional line (``END CONNECTIONS`` ``TorsStiffness`` at both ends) needs ``True``. The lines the raw C API builds without a deck (``CableDyn_InitLine``, ``CableDyn_InitLines``) always use - ``True``: their only integrator setting is ``rho_inf`` (:doc:`capi`) + ``True``: their only integrator setting is ``rho_inf`` (:doc:`capi`). ``False`` also + turns ``ei0_substeps`` off unless the deck sets it - standalone and coupled (finite-EI and ``EI = 0`` lines) - ``False alpha_force_blend`` * - ``cable_statics`` / ``cablestatics`` diff --git a/doc/theory.rst b/doc/theory.rst index 2a61acce..fac90e9f 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1524,7 +1524,9 @@ segments (the snap is not resolved at that step, so the peak depends on round-of compilers and platforms give other values) and at 0.145 MN without it, against 0.082 to 0.095 MN at :math:`\Delta t` from 0.5 to 2.5 ms. A taut Syrope line in 4 m surge that goes slack peaks at 1.64 MN at 0.1 s, against 1.78 MN at 1 and 2.5 ms, with or -without the cap. +without the cap. These figures take every step as given (``off ei0_substeps``); with the +rotation- and snap-resolved sub-steps of the default (below) the two lines peak at 0.092 MN and +1.82 MN. An elastic segment with axial damping (``BA``) also keeps :math:`\alpha_f T_{d,n}` along :math:`\mathbf{t}_n`, :math:`T_{d,n}` the tension of its dashpot at :math:`t_n`. A segment that @@ -1654,6 +1656,42 @@ the interval-start and target position, velocity, and acceleration. If the halve complete the interval, the interval-start state is restored and the full step is re-run, so no partly subdivided state is ever committed. +**Rotation- and snap-resolved sub-steps** (``ei0_substeps auto``, the default). A converged +``EI = 0`` step is measured against its committed start: the largest chord turn +:math:`\theta` of a segment that ends the step taut, and whether a segment slack at the start +ends above a quarter of the largest step-start tension :math:`T_\text{max}` (tensions from the +static ``EA``). When :math:`\theta` exceeds ``ei0_substep_angle`` +:math:`\theta_s` (default 1°), or such a snap occurred, the interval is solved again from the +same committed state, constitutive and friction states included, in +:math:`n = \max(4, \lceil\theta/\theta_s\rceil)` equal sub-steps, at most ``ei0_substep_max`` +(default 16), with the prescribed motion on the quintic trajectory of the recovery above and +the last sub-step on the target state. The trial step under-turns a line whose rotation it does +not resolve, so the sub-stepped interval is measured again; when its turn needs more sub-steps +it is solved once more with them. If a sub-step does not converge, the plain step is solved +again and kept. The decision uses only the committed state and the step inputs, so a restart +repeats it, and the host time grid, output and coupling times are unchanged. Every route that +steps ``EI = 0`` lines uses it (standalone lines and line systems, OpenFAST, FAST.Farm and the +C API), except the monolithic body and point coupling, whose junction Newton needs the end +reaction and condensed end tangent of the nominal step; ``off`` takes every step as given, and +``False alpha_force_blend`` turns it off unless the deck sets it. + +At ``dtM`` 0.1 s a taut segment of the Lozon 80 m all-chain mooring turns by up to 6° per step +under 5 m / 7 s heave. Over seven runs whose heave amplitude differs by up to +:math:`3\times10^{-4}` (the snap peaks at that step vary by 15 to 20 points from one run to the +next), the fairlead and anchor maxima are then 15 % and 17 % below a 0.25 ms run with the force +blend and 10 % and 18 % below it with the configuration blend; the release cap acts in 0.3 % of +the element steps, never within 0.5 s of a peak, and removing it changes the cycle maxima by less +than 1 %. The peaks follow the algorithmic damping instead: 28 % and 31 % low at +:math:`\rho_\infty = 0`, 10 % and 40 % high at 0.6. With ``auto`` they are 4 % and 8 % low +(1 % high and 4 % low against the reference sampled on the same 0.1 s output grid), and the +anchor maxima of the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge, 16 % and 26 % +high taken as given, are within 3 %. +Two or three sub-steps of a step that turned by 1 to 3° left those anchor peaks 8 % high on +average (up to 22 %); four bring them within 3 %, hence the minimum. Resolving the sub-steps +of a step recovered after a stall as well left them 9 % high, so the recovery takes its sub-steps +as given. Over the 20 motions of the Lozon mooring envelope at ``dtM`` 0.1 s the march takes +1.65 times as long as with plain steps, 2 to 2.5 times on the severe motions. + **Step size.** Being implicit, the scheme is not bound by the explicit axial-wave limit. In the snap-load verification a slack line snapping to about 10 MN integrates stably at :math:`\Delta t = 20\,\mathrm{ms}`, well above the explicit limit of 3.2 ms, with the peak @@ -1662,13 +1700,18 @@ response of interest and, for explicitly integrated points and bodies (below), t stability limit. The standalone driver audits every ``EI = 0`` line on the initial state and at each output step, and reports at the end of the run: -- the largest turn of the chord of a taut segment in one step. Above 1 deg it prints a note: - against a 3.125 ms reference on chain catenaries under 5 m heave, 10 m surge and 15 m sway - and on a light laid cable under 10 m sway, the mean and standard deviation of the fairlead - tension err by 0.9 % at 1.2 deg per step (sway, standard deviation), and by 0.6 % at - 1.4 deg and 1.3 % at 2.9 deg (heave, mean), in proportion with the turn; +- the steps ``ei0_substeps auto`` solved in sub-steps, with the largest count, those that needed + more than ``ei0_substep_max``, and those that kept the plain step; +- the largest turn of the chord of a taut segment in one solver step (the sub-steps of a + sub-stepped or recovered step count as steps). Above 1 deg it prints a note (with ``auto`` + above 1.1 times the larger of 1 deg and ``ei0_substep_angle``): against a 3.125 ms reference + on chain catenaries under 5 m heave, 10 m surge and 15 m sway and on a light laid cable under + 10 m sway, the mean and standard deviation of the fairlead tension err by 0.9 % at 1.2 deg per + step (sway, standard deviation), and by 0.6 % at 1.4 deg and 1.3 % at 2.9 deg (heave, mean), + in proportion with the turn, and at about 6 deg per step snap-load peaks come out 10 to 20 % + low (above); - segments that go from slack to taut above the initial tension in one step while the axial - wave crosses a segment more than once per step (:math:`\Delta t\,c/l_0 > 1`, + wave crosses a segment more than once per solver step (:math:`\Delta t\,c/l_0 > 1`, :math:`c = \sqrt{EA/m}` with the dynamic stiffness of the segment, :math:`EA_D` of a viscoelastic segment and :math:`\alpha + \beta T` of a Syrope one): the snap peaks are then not resolved in time, and the note asks for a confirmation at a smaller ``dtM``; diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index 30b6a095..807ccadd 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -571,15 +571,27 @@ Warnings and notes that do not stop a run * - ``Note: line ...: a nodal tangent turned up to ... deg in one step`` - the time-step audit of a finite-EI line: above 0.25° per step (0.1° with ``False alpha_force_blend``) the mean tension can err by about 1 %. Reduce ``dtM``. - * - ``Note: line ...: a taut segment turned up to ... deg in one step`` - - the time-step audit of an ``EI = 0`` line: above 1° per step the mean and standard - deviation of the tension can err by about 1 % (1.3 % at 2.9° on a heaving chain). Reduce - ``dtM`` if that matters for the result. + * - ``Note: line ...: a taut segment turned up to ... deg in one solver step`` + - the time-step audit of an ``EI = 0`` line, per solver step (the sub-steps of a + sub-stepped step count as steps): above 1° per step the mean and standard deviation of + the tension can err by about 1 % (1.3 % at 2.9° on a heaving chain), and near 6° per step + snap-load peaks come out 10 to 20 % low with either generalised-α blend. With + ``off ei0_substeps`` set ``auto`` (the default) or reduce ``dtM``; with ``auto`` the note + means steps it did not resolve (more than ``ei0_substep_max`` needed, a step recovered + after a stall, whose recovery sub-steps are taken as given, or the monolithic body and + point coupling, which is not sub-stepped): reduce ``dtM``. + * - ``Note: line ...: ei0_substeps auto solved ... of ... solver step(s) in sub-steps`` + - information: the steps in which a taut segment turned by more than ``ei0_substep_angle`` + or a segment snapped from slack to taut were solved in sub-steps (see + ``ei0_substeps``). A companion note counts the steps that needed more than + ``ei0_substep_max`` sub-steps, and another the steps that kept the whole step because a + sub-step did not converge. * - ``Note: line ...: ... segment step(s) went from slack to taut above the initial tension`` - - snap loads on an ``EI = 0`` line at a ``dtM`` that does not resolve the axial wave over a - segment: the peak is set by a single step (a 15 m surge of a semi-taut chain–polyester - line peaks at 5.7 MN at ``dtM`` 0.05 s against 4.6 MN at 0.0025 s). The run is valid; - confirm design peaks with a smaller ``dtM``. + - snap loads on an ``EI = 0`` line at a solver step that does not resolve the axial wave + over a segment: the peak is set by a single step. A 15 m surge of a semi-taut + chain–polyester line peaks at 4.65 MN at ``dtM`` 0.05 s with the default sub-steps + (5.7 MN with ``off ei0_substeps``) against 4.6 MN at 0.0025 s. The run is valid; confirm + design peaks with a smaller ``dtM``. * - ``Warning: line ...: segment ... carried ... N at t = ... s for a single step, ... times the largest tension on the line one step before and after`` - a non-physical tension spike: the tension of one segment (elastic, viscoelastic or diff --git a/examples/cabledyn_options_reference.dat b/examples/cabledyn_options_reference.dat index 2d264baf..dabeaebe 100644 --- a/examples/cabledyn_options_reference.dat +++ b/examples/cabledyn_options_reference.dat @@ -45,6 +45,9 @@ True alpha_force_blend - Generalised-alpha force blend, finite-EI and EI=0 False tensile_safety - Element-mean axial-force audit {False; warn; True=reject} [default: False] 2.0e-6 tensile_strain_tolerance - Dynamic audit strain band [default: 2.0e-6] 1024 recovery_max_substeps - Internal dynamic-step recovery ceiling {4..65536} [default: 1024] +auto ei0_substeps - EI=0 sub-steps for segment rotation and slack-taut snaps {auto; off} [default: auto; off with False alpha_force_blend] +1.0 ei0_substep_angle - Largest taut-segment turn per EI=0 step before sub-stepping (deg) {0 str | None: if value.lower() in {"equilibrium", "element"} else "must be equilibrium or element" ) + if key == "ei0_substeps": + return None if value.lower() in {"auto", "off"} else "must be auto or off" + if key == "ei0_substep_angle": + try: + numeric = _native_float(value) + except ValueError: + return "must lie in (0, 90] deg" + return ( + None if math.isfinite(numeric) and 0.0 < numeric <= 90.0 else "must lie in (0, 90] deg" + ) + if key == "ei0_substep_max": + try: + numeric = _native_float(value) + except ValueError: + return "must be an integer in [2, 1024]" + if not math.isfinite(numeric): + return "must be an integer in [2, 1024]" + nearest = round(numeric) + integer_tolerance = 16.0 * math.ulp(1.0) * max(1.0, abs(numeric)) + if abs(numeric - nearest) > integer_tolerance or not 2 <= nearest <= 1024: + return "must be an integer in [2, 1024]" + return None if key in {"axial_quadrature_order", "bending_quadrature_order"}: try: numeric = _native_float(value) diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index 2760d72a..e04faf75 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -666,6 +666,13 @@ def test_unknown_scalar_option_keyword_fails_closed(tmp_path): ("maybe", "alpha_force_blend", "native boolean"), ("relaxed", "cable_statics", "continuation or sequenced"), ("nodal", "OutputRecovery", "equilibrium or element"), + ("on", "ei0_substeps", "auto or off"), + ("0", "ei0_substep_angle", r"\(0, 90\] deg"), + ("91", "ei0SubstepAngle", r"\(0, 90\] deg"), + ("NaN", "ei0_substep_angle", r"\(0, 90\] deg"), + ("1", "ei0_substep_max", r"integer in \[2, 1024\]"), + ("2.5", "ei0_substep_max", r"integer in \[2, 1024\]"), + ("1025", "ei0SubstepMax", r"integer in \[2, 1024\]"), ], ) def test_invalid_scalar_option_values_fail_closed(tmp_path, value, keyword, message): @@ -741,6 +748,12 @@ def test_zero_e_exponent_waterkin_mode_is_accepted(tmp_path): "sequenced cableStatics", "equilibrium OutputRecovery", "element output_recovery", + "auto ei0_substeps", + "off ei0Substeps", + "0.5 ei0_substep_angle", + "90 ei0SubstepAngle", + "2 ei0_substep_max", + "1024 ei0SubstepMax", ], ) def test_native_scalar_option_vocabulary_is_accepted(tmp_path, row): diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index 8596e50f..e432dc36 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -51,7 +51,7 @@ MODULE CableDyn_DeckDriver USE CableDyn_Syrope, ONLY: CD_SYROPE_WC_LINEAR, CD_SYROPE_WC_QUADRATIC, CD_SYROPE_WC_EXP, & CD_SyropeType, CD_Syrope_Init, CD_Syrope_End, & CD_Syrope_Static_Tension, CD_Syrope_Slow_For_Tension, CD_SYROPE_OK - USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_DYN_OK + USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_DYN_OK, CD_EI0_SUBSTEPS_OFF, CD_EI0_SUBSTEPS_AUTO USE CableDyn_Model, ONLY: CD_ModelType, CD_Init_Line_Model, CD_End_Model, CD_Model_NCoupledDOF, CD_Model_NDOF, & CD_Get_Model_CoupledDofs, CD_Get_Model_State, CD_Get_Model_Tension, & CD_Get_Model_EndForces, & @@ -606,6 +606,12 @@ MODULE CableDyn_DeckDriver ! Generalised-alpha blend of the finite-EI dynamics (alpha_force_blend): force blend ! (default) or the configuration blend f_int(q_alpha_f). LOGICAL :: alpha_force_blend = CD_HC_FORCE_BLEND_DEFAULT + ! Rotation- and snap-resolved sub-stepping of the EI=0 lines (ei0_substeps): -1 not set + ! (auto with the force blend, off with False alpha_force_blend), else CD_EI0_SUBSTEPS_OFF + ! or CD_EI0_SUBSTEPS_AUTO; the turn per step it allows (deg) and its sub-step cap. + INTEGER :: ei0_substeps = -1 + REAL(wp) :: ei0_substep_angle = 1.0_wp + INTEGER :: ei0_substep_max = 16 ! Finite-EI static route order (cable_statics): 'continuation' (default) solves the ! catenary-seeded EI continuation first and the mesh-sequenced route as its fallback; ! 'sequenced' runs the mesh-sequenced route first. @@ -7632,6 +7638,13 @@ SUBROUTINE init_one_model(ln, sections, types, points, opts, model, ErrStat, Err dynamic_cfg%armijo_max_backtracks = opts%dynamic_backtracks dynamic_cfg%modified_newton = opts%dynamic_modified_newton dynamic_cfg%force_blend = opts%alpha_force_blend + ! ei0_substeps not set: auto with the force blend; the configuration blend (paper mode) + ! takes every step as given, as the article did + dynamic_cfg%ei0_substeps = opts%ei0_substeps + IF (opts%ei0_substeps < 0) dynamic_cfg%ei0_substeps = MERGE(CD_EI0_SUBSTEPS_AUTO, CD_EI0_SUBSTEPS_OFF, & + opts%alpha_force_blend) + dynamic_cfg%ei0_substep_angle = opts%ei0_substep_angle + dynamic_cfg%ei0_substep_max = opts%ei0_substep_max CALL CD_Build_Line_Mesh(secs, lts, .TRUE., conn, l0, ea, mpl, diam, es, em) IF (es /= CD_LINE_OK) THEN CALL fail(ErrStat, ErrMsg, 'line mesh for model init: '//TRIM(em)); RETURN @@ -13041,6 +13054,34 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) CALL rd_bool(val, opts%adaptive_mesh, ErrStat, ErrMsg) CASE ('alpha_force_blend', 'alphaforceblend') CALL rd_bool(val, opts%alpha_force_blend, ErrStat, ErrMsg) + CASE ('ei0_substeps', 'ei0substeps') + SELECT CASE (TRIM(to_lower(val))) + CASE ('auto') + opts%ei0_substeps = CD_EI0_SUBSTEPS_AUTO + CASE ('off') + opts%ei0_substeps = CD_EI0_SUBSTEPS_OFF + CASE DEFAULT + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substeps "'//TRIM(val)//'" must be auto or off') + END SELECT + CASE ('ei0_substep_angle', 'ei0substepangle') + CALL rd(val, x1, ErrStat, ErrMsg) + IF (ErrStat == 0) THEN + IF (.NOT. (IEEE_IS_FINITE(x1) .AND. x1 > CD_ZERO .AND. x1 <= 90.0_wp)) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_angle must lie in (0, 90] deg'); RETURN + END IF + opts%ei0_substep_angle = x1 + END IF + CASE ('ei0_substep_max', 'ei0substepmax') + CALL rd(val, x1, ErrStat, ErrMsg) + IF (ErrStat == 0) THEN + IF (.NOT. IEEE_IS_FINITE(x1) .OR. x1 < 2.0_wp .OR. x1 > 1024.0_wp) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be in [2,1024]'); RETURN + END IF + IF (ABS(x1 - REAL(NINT(x1), wp)) > 16.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, ABS(x1))) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be an integer'); RETURN + END IF + opts%ei0_substep_max = NINT(x1) + END IF CASE ('cable_statics', 'cablestatics') SELECT CASE (TRIM(to_lower(val))) CASE ('continuation') @@ -27468,16 +27509,43 @@ SUBROUTINE report_model_audit(model, line_id, dt) REAL(wp), INTENT(IN) :: dt REAL(wp), PARAMETER :: EI0_TURN_NOTE = 1.0_wp INTEGER :: ios - IF (model%audit_max_turn > EI0_TURN_NOTE) THEN + LOGICAL :: auto + CHARACTER(200) :: remedy + REAL(wp) :: turn_note + auto = model%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO + IF (auto .AND. model%sub_events > 0) THEN + WRITE (output_unit, '(A,I0,A,I0,A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', line_id, & + ': ei0_substeps auto solved ', model%sub_events, ' of ', model%sub_calls, & + ' solver step(s) in sub-steps to resolve segment rotation and slack-to-taut snaps (at most ', & + model%sub_max_used, ' per step).' + IF (model%sub_capped > 0) WRITE (output_unit, '(A,I0,A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', line_id, & + ': ', model%sub_capped, ' step(s) needed more than ei0_substep_max = ', model%cfg%ei0_substep_max, & + ' sub-steps; raise it or reduce dtM.' + END IF + IF (auto .AND. model%sub_fallbacks > 0) WRITE (output_unit, '(A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', & + line_id, ': ', model%sub_fallbacks, ' step(s) kept the whole step because a resolving sub-step did not converge.' + ! with ei0_substeps auto a step is solved in sub-steps whose average turn is at most + ! ei0_substep_angle; a single sub-step can turn slightly more + turn_note = EI0_TURN_NOTE + IF (auto) turn_note = 1.1_wp*MAX(EI0_TURN_NOTE, model%cfg%ei0_substep_angle) + IF (model%audit_max_turn > turn_note) THEN + ! per solver step: the sub-steps of a resolved or recovered step count as steps + IF (auto) THEN + remedy = 'steps ei0_substeps auto did not resolve (beyond ei0_substep_max, recovered after a '// & + 'stall, or in a monolithic body or point coupling step): reduce dtM.' + ELSE + remedy = 'set ei0_substeps auto (the default) or reduce dtM.' + END IF WRITE (output_unit, '(A,I0,A,F7.3,A)', IOSTAT=ios) ' Note: line ', line_id, ': a taut segment turned up to ', & - model%audit_max_turn, ' deg in one step; a smaller dtM would resolve the line''s rotation (tension '// & - 'mean and standard-deviation errors of about 1 % and more above 1 deg per step).' + model%audit_max_turn, ' deg in one solver step. Above about 1 deg per step the tension mean and '// & + 'standard deviation err by about 1 % and more, and at about 6 deg per step snap-load peaks come out '// & + '10 to 20 % low with either generalised-alpha blend: '//TRIM(remedy) END IF IF (model%audit_snaps > 0 .AND. model%audit_snap_courant > CD_ONE) THEN WRITE (output_unit, '(A,I0,A,I0,A,ES9.2,A,F0.1,A)', IOSTAT=ios) ' Note: line ', line_id, ': ', & model%audit_snaps, ' segment step(s) went from slack to taut above the initial tension; at dtM =', & dt, ' s the axial wave crosses a segment up to ', model%audit_snap_courant, & - ' times per step, so the snap-load peaks are not resolved in time: confirm peak tensions with a '// & + ' times per solver step, so the snap-load peaks are not resolved in time: confirm peak tensions with a '// & 'smaller dtM.' END IF IF (model%audit_spikes > 1) THEN diff --git a/src/CableDyn_Dynamic.f90 b/src/CableDyn_Dynamic.f90 index e7646397..3d8fde49 100644 --- a/src/CableDyn_Dynamic.f90 +++ b/src/CableDyn_Dynamic.f90 @@ -82,6 +82,15 @@ MODULE CableDyn_Dynamic !! + alpha_f r(q_n, v_n); .FALSE. evaluates them at the !! blended configuration (q_alpha, v_alpha). The finite-EI !! paths have their own setting. + ! Rotation- and snap-resolved sub-stepping of an EI=0 line model (CD_Step_Model of + ! CableDyn_Model; the kernel step here does not read these). With CD_EI0_SUBSTEPS_AUTO a + ! converged step whose taut segments turned by more than ei0_substep_angle degrees, or in + ! which a segment went from slack to taut with a large tension, is solved again from the + ! same committed state in max(4, ceil(turn/ei0_substep_angle)) equal sub-steps, at most + ! ei0_substep_max; CD_EI0_SUBSTEPS_OFF takes every step as given. + INTEGER :: ei0_substeps = 1 !! CD_EI0_SUBSTEPS_AUTO (1) or CD_EI0_SUBSTEPS_OFF (0) + REAL(wp) :: ei0_substep_angle = 1.0_wp !! largest turn of a taut segment per step, deg, (0, 90] + INTEGER :: ei0_substep_max = 16 !! sub-step cap per step, [2, 1024] END TYPE GenAlphaConfig TYPE :: CD_CableGenAlphaWorkspace @@ -224,6 +233,9 @@ MODULE CableDyn_Dynamic INTEGER, PARAMETER, PUBLIC :: CD_DYN_BADINPUT = 1 INTEGER, PARAMETER, PUBLIC :: CD_DYN_SINGULAR = 2 INTEGER, PARAMETER, PUBLIC :: CD_DYN_ALLOCFAIL = 3 + ! GenAlphaConfig%ei0_substeps + INTEGER, PARAMETER, PUBLIC :: CD_EI0_SUBSTEPS_OFF = 0 + INTEGER, PARAMETER, PUBLIC :: CD_EI0_SUBSTEPS_AUTO = 1 ABSTRACT INTERFACE SUBROUTINE CD_Cable_Dynamic_Load_Proc(q, v, force, jac_q, jac_v, ErrStat, ErrMsg) diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index 9e3971ad..a0dc4a87 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -55,7 +55,8 @@ MODULE CableDyn_Model CD_Cable_Added_Mass, CD_Cable_Added_Mass_Matrix, CD_Cable_Added_Mass_Force, & CD_Added_Mass_Element, CD_Added_Mass_Element_Matrix, CD_Added_Mass_Element_Force USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_CableGenAlphaWorkspace, CD_Clear_GenAlpha_Workspace, & - CD_Cable_Initial_Acceleration, CD_Cable_Gen_Alpha_Step, CD_DYN_OK, CD_DYN_ALLOCFAIL + CD_Cable_Initial_Acceleration, CD_Cable_Gen_Alpha_Step, CD_DYN_OK, CD_DYN_ALLOCFAIL, & + CD_EI0_SUBSTEPS_AUTO USE CableDyn_Mesh, ONLY: CD_Partition_Free_Dofs, CD_Validate_Connectivity USE CableDyn_Linalg, ONLY: CD_Solve_Dense_As_Banded, CD_Solve_Dense_As_Banded_Multiple, CD_Factor_Banded, & CD_Solve_Factored_Banded_Multiple @@ -112,6 +113,13 @@ MODULE CableDyn_Model INTEGER, PARAMETER, PUBLIC :: CD_MODEL_NOT_INITIALIZED = 3 INTEGER, PARAMETER, PUBLIC :: CD_MODEL_ALLOCFAIL = 4 INTEGER, PARAMETER :: MODEL_DEFAULT_MAX_SUBSTEPS = 1024 + ! Rotation- and snap-resolved sub-stepping (CD_Step_Model, cfg%ei0_substeps): every segment + ! that ends the step taut counts for the turn; one slack at the step start that ends above + ! SUB_SNAP_FRACTION of the largest step-start tension is a snap. A step solved in sub-steps takes at least SUB_SNAP_STEPS of them: on the Lozon + ! semitaut line two or three sub-steps of a step that turned 1 to 3 deg left the anchor snap + ! peaks 8 % high on average (up to 22 %), four brought them within 3 % of the converged run. + REAL(wp), PARAMETER :: SUB_SNAP_FRACTION = 0.25_wp + INTEGER, PARAMETER :: SUB_SNAP_STEPS = 4 TYPE :: CD_ModelType !! Persistent positions-only EI=0 model state and immutable mesh/properties. @@ -309,6 +317,18 @@ MODULE CableDyn_Model REAL(wp) :: audit_snap_courant = CD_ZERO INTEGER :: audit_snaps = 0, audit_spikes = 0, audit_spike_elem = 0 REAL(wp) :: audit_spike_time = CD_ZERO, audit_spike_tension = CD_ZERO, audit_spike_ratio = CD_ZERO + ! audit_hmax: the largest single solver step committed since the last audit (the nominal + ! step, or a sub-step of the resolved or the recovering step); the audit measures turns and + ! axial wave crossings per solver step with it. Diagnostics only. + REAL(wp) :: audit_hmax = CD_ZERO + ! Rotation- and snap-resolved sub-stepping (CD_Step_Model), diagnostics only: sub_calls + ! counts the steps it examined, sub_events those it solved in sub-steps (sub_max_used the + ! largest count), sub_capped those whose turn needed more than cfg%ei0_substep_max, and + ! sub_fallbacks those that returned to the plain step after a sub-step failed. The sub_* + ! arrays are scratch: the step-start snapshot and the sub-step boundary motion. + INTEGER :: sub_calls = 0, sub_events = 0, sub_max_used = 1, sub_capped = 0, sub_fallbacks = 0 + REAL(wp), ALLOCATABLE :: sub_q0(:), sub_v0(:), sub_a0(:), sub_pq(:), sub_pv(:), sub_pa(:) + REAL(wp), ALLOCATABLE :: sub_ve_dl_1(:), sub_syrope_slow(:), sub_syrope_tmax(:), sub_fr_anchor(:, :) END TYPE CD_ModelType CONTAINS @@ -1844,11 +1864,276 @@ END SUBROUTINE CD_Init_Line_Model SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q, prescribed_v, prescribed_a) - !! Advance the persistent model by one generalized-alpha step. Optional - !! prescribed_q/v/a arrays are full model-sized vectors; only entries in - !! model%fixed_dofs are consumed by CableDyn_Dynamic. On successful or stalled - !! dynamics returns, the model owns the returned state. On solver failure, the - !! underlying step contract preserves the previous state. + !! Advance the persistent model over dt. Optional prescribed_q/v/a arrays are full + !! model-sized vectors at the end of the step; only entries in model%fixed_dofs are + !! consumed by CableDyn_Dynamic. On successful or stalled dynamics returns, the model owns + !! the returned state. On solver failure, the underlying step contract preserves the + !! previous state. + !! + !! Rotation- and snap-resolved sub-stepping (cfg%ei0_substeps = CD_EI0_SUBSTEPS_AUTO, the + !! default): the step is solved as given; when it converges and a segment that ends it taut + !! turned by more than cfg%ei0_substep_angle degrees, or a segment slack at its start ends + !! it above SUB_SNAP_FRACTION of the largest step-start tension, the interval is solved + !! again from the same committed state in n = max(SUB_SNAP_STEPS, ceil(turn/angle)) equal + !! sub-steps, at most cfg%ei0_substep_max. The trial step under-turns a line whose rotation + !! it does not resolve, so the sub-stepped interval is measured again and, when its turn + !! needs more sub-steps, solved once more with them. The prescribed end motion inside the + !! interval follows the C2 quintic of CD_Step_Model_Recovering and the last sub-step lands + !! on the given end state exactly. The decision depends only on the committed state and the + !! step's inputs, so a run restarted from a checkpoint repeats it. If a sub-step fails, the + !! plain step is solved again and returned. A step of the + !! monolithic junction coupling (the end query armed, CD_Set_Model_EndQuery) is never + !! sub-stepped: its caller needs the end reaction and tangent of the nominal step. + TYPE(CD_ModelType), INTENT(INOUT) :: model + REAL(wp), INTENT(IN) :: dt + LOGICAL, INTENT(OUT) :: converged, stalled + INTEGER, INTENT(OUT) :: n_iter, ErrStat + CHARACTER(*), INTENT(OUT) :: ErrMsg + REAL(wp), INTENT(IN), OPTIONAL :: prescribed_q(:), prescribed_v(:), prescribed_a(:) + INTEGER :: nsub, nsub2 + LOGICAL :: has_pres, resolve, capped, capped2, ok + + has_pres = PRESENT(prescribed_q) .AND. PRESENT(prescribed_v) .AND. PRESENT(prescribed_a) + resolve = model%initialized .AND. model%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO .AND. & + .NOT. model%dynamic_workspace%end_request + ! partial prescribed motion: the plain step reports the input error + IF (resolve) resolve = has_pres .OR. .NOT. (PRESENT(prescribed_q) .OR. PRESENT(prescribed_v) .OR. & + PRESENT(prescribed_a)) + IF (resolve) THEN + IF (.NOT. (CD_Is_Finite(model%cfg%ei0_substep_angle) .AND. model%cfg%ei0_substep_angle > CD_ZERO .AND. & + model%cfg%ei0_substep_angle <= 90.0_wp .AND. model%cfg%ei0_substep_max >= 2 .AND. & + model%cfg%ei0_substep_max <= 1024)) THEN + converged = .FALSE. + stalled = .FALSE. + n_iter = 0 + CALL fail(ErrStat, ErrMsg, 'ei0_substep_angle must lie in (0, 90] deg and '// & + 'ei0_substep_max in [2, 1024]') + RETURN + END IF + resolve = sub_snapshot(model, has_pres) + END IF + IF (.NOT. resolve) THEN + ! absent optional arguments stay absent + CALL step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & + prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) + IF (ErrStat == CD_MODEL_OK) model%audit_hmax = MAX(model%audit_hmax, dt) + RETURN + END IF + + CALL step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & + prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) + IF (ErrStat /= CD_MODEL_OK) RETURN + IF (model%sub_calls < HUGE(model%sub_calls)) model%sub_calls = model%sub_calls + 1 + nsub = 1 + capped = .FALSE. + IF (converged) CALL sub_count(model, nsub, capped) + IF (nsub <= 1) THEN + model%audit_hmax = MAX(model%audit_hmax, dt) + RETURN + END IF + + ! Solve the interval again from the committed state in nsub sub-steps. The trial step + ! under-turns a line whose rotation it does not resolve, so the sub-stepped interval is + ! measured again: when its turn needs more sub-steps, it is solved once more with them (and + ! the first count is kept should that fail). + CALL run_substeps(nsub, ok) + IF (ok) THEN + CALL sub_count(model, nsub2, capped2) + IF (nsub2 > nsub) THEN + CALL run_substeps(nsub2, ok) + IF (ok) THEN + nsub = nsub2 + capped = capped2 + ELSE + CALL run_substeps(nsub, ok) + END IF + END IF + END IF + IF (ok) THEN + converged = .TRUE. + stalled = .FALSE. + ErrStat = CD_MODEL_OK + ErrMsg = '' + IF (model%sub_events < HUGE(model%sub_events)) model%sub_events = model%sub_events + 1 + IF (capped .AND. model%sub_capped < HUGE(model%sub_capped)) model%sub_capped = model%sub_capped + 1 + model%sub_max_used = MAX(model%sub_max_used, nsub) + model%audit_hmax = MAX(model%audit_hmax, dt/REAL(nsub, wp)) + RETURN + END IF + ! a sub-step failed: return the plain step, solved again from the committed state + CALL sub_restore(model) + CALL step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & + prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) + IF (model%sub_fallbacks < HUGE(model%sub_fallbacks)) model%sub_fallbacks = model%sub_fallbacks + 1 + IF (ErrStat == CD_MODEL_OK) model%audit_hmax = MAX(model%audit_hmax, dt) + + CONTAINS + + SUBROUTINE run_substeps(n, ok_run) + !! The interval from the committed state (sub_q0) in n equal sub-steps, the prescribed + !! end motion on the C2 quintic of the interval, the last sub-step on the given end state. + INTEGER, INTENT(IN) :: n + LOGICAL, INTENT(OUT) :: ok_run + INTEGER :: k, it_k, es_k + LOGICAL :: conv_k, stall_k + REAL(wp) :: h + CHARACTER(300) :: em_k + CALL sub_restore(model) + h = dt/REAL(n, wp) + ok_run = .TRUE. + DO k = 1, n + IF (has_pres) THEN + IF (k == n) THEN + model%sub_pq = prescribed_q + model%sub_pv = prescribed_v + model%sub_pa = prescribed_a + ELSE + CALL quintic_model_boundary_state(model%sub_q0, model%sub_v0, model%sub_a0, prescribed_q, & + prescribed_v, prescribed_a, dt, REAL(k, wp)/REAL(n, wp), & + model%sub_pq, model%sub_pv, model%sub_pa) + END IF + CALL step_model_plain(model, h, conv_k, stall_k, it_k, es_k, em_k, prescribed_q=model%sub_pq, & + prescribed_v=model%sub_pv, prescribed_a=model%sub_pa) + ELSE + CALL step_model_plain(model, h, conv_k, stall_k, it_k, es_k, em_k) + END IF + IF (es_k /= CD_MODEL_OK .OR. .NOT. conv_k) THEN + ok_run = .FALSE. + RETURN + END IF + n_iter = MAX(n_iter, it_k) + END DO + END SUBROUTINE run_substeps + END SUBROUTINE CD_Step_Model + + LOGICAL FUNCTION sub_snapshot(model, has_pres) RESULT(ok) + !! Snapshot the committed state into the sub-stepping scratch (allocated on first use): + !! the kinematics and the viscoelastic, Syrope and friction states a step commits. .FALSE. + !! when the scratch cannot be allocated (the step is then taken as given). + TYPE(CD_ModelType), INTENT(INOUT) :: model + LOGICAL, INTENT(IN) :: has_pres + INTEGER :: istat + ok = .FALSE. + istat = 0 + IF (.NOT. sized1(model%sub_q0, model%n_dof)) THEN + IF (ALLOCATED(model%sub_q0)) DEALLOCATE (model%sub_q0, model%sub_v0, model%sub_a0) + ALLOCATE (model%sub_q0(model%n_dof), model%sub_v0(model%n_dof), model%sub_a0(model%n_dof), STAT=istat) + IF (istat /= 0) RETURN + END IF + IF (has_pres .AND. .NOT. sized1(model%sub_pq, model%n_dof)) THEN + IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq, model%sub_pv, model%sub_pa) + ALLOCATE (model%sub_pq(model%n_dof), model%sub_pv(model%n_dof), model%sub_pa(model%n_dof), STAT=istat) + IF (istat /= 0) RETURN + END IF + IF (model%has_viscoelastic .AND. .NOT. sized1(model%sub_ve_dl_1, SIZE(model%ve_dl_1))) THEN + IF (ALLOCATED(model%sub_ve_dl_1)) DEALLOCATE (model%sub_ve_dl_1) + ALLOCATE (model%sub_ve_dl_1(SIZE(model%ve_dl_1)), STAT=istat) + IF (istat /= 0) RETURN + END IF + IF (model%has_syrope .AND. .NOT. sized1(model%sub_syrope_slow, SIZE(model%syrope_slow))) THEN + IF (ALLOCATED(model%sub_syrope_slow)) DEALLOCATE (model%sub_syrope_slow, model%sub_syrope_tmax) + ALLOCATE (model%sub_syrope_slow(SIZE(model%syrope_slow)), model%sub_syrope_tmax(SIZE(model%syrope_tmax)), & + STAT=istat) + IF (istat /= 0) RETURN + END IF + IF (model%has_seabed_friction) THEN + IF (ALLOCATED(model%sub_fr_anchor)) THEN + IF (ANY(SHAPE(model%sub_fr_anchor) /= SHAPE(model%fr_anchor))) DEALLOCATE (model%sub_fr_anchor) + END IF + IF (.NOT. ALLOCATED(model%sub_fr_anchor)) THEN + ALLOCATE (model%sub_fr_anchor(SIZE(model%fr_anchor, 1), SIZE(model%fr_anchor, 2)), STAT=istat) + IF (istat /= 0) RETURN + END IF + END IF + model%sub_q0 = model%q + model%sub_v0 = model%v + model%sub_a0 = model%a + IF (model%has_viscoelastic) model%sub_ve_dl_1 = model%ve_dl_1 + IF (model%has_syrope) THEN + model%sub_syrope_slow = model%syrope_slow + model%sub_syrope_tmax = model%syrope_tmax + END IF + IF (model%has_seabed_friction) model%sub_fr_anchor = model%fr_anchor + ok = .TRUE. + CONTAINS + LOGICAL FUNCTION sized1(x, n) RESULT(yes) + REAL(wp), ALLOCATABLE, INTENT(IN) :: x(:) + INTEGER, INTENT(IN) :: n + yes = ALLOCATED(x) + IF (yes) yes = SIZE(x) == n + END FUNCTION sized1 + END FUNCTION sub_snapshot + + SUBROUTINE sub_restore(model) + !! Return the model to the state sub_snapshot saved. + TYPE(CD_ModelType), INTENT(INOUT) :: model + model%q = model%sub_q0 + model%v = model%sub_v0 + model%a = model%sub_a0 + IF (model%has_viscoelastic) model%ve_dl_1 = model%sub_ve_dl_1 + IF (model%has_syrope) THEN + model%syrope_slow = model%sub_syrope_slow + model%syrope_tmax = model%sub_syrope_tmax + END IF + IF (model%has_seabed_friction) model%fr_anchor = model%sub_fr_anchor + END SUBROUTINE sub_restore + + SUBROUTINE sub_count(model, nsub, capped) + !! The sub-step count of a converged step (model%q) from the committed state (sub_q0): 1, or + !! max(SUB_SNAP_STEPS, ceil(turn/angle)) when turn > angle, at most cfg%ei0_substep_max + !! (capped when the turn needs more), turn the largest chord turn of a segment that ends + !! taut; at least SUB_SNAP_STEPS when a segment slack at the start ends above + !! SUB_SNAP_FRACTION of the largest step-start tension (the static EA times the strain). + TYPE(CD_ModelType), INTENT(IN) :: model + INTEGER, INTENT(OUT) :: nsub + LOGICAL, INTENT(OUT) :: capped + REAL(wp), PARAMETER :: DEG = 57.295779513082320876798154814105_wp + INTEGER :: e, na, nb, nmax + REAL(wp) :: d0(3), d1(3), l_s, l_e, t0max, te, c, turn, ratio + LOGICAL :: snap + nsub = 1 + capped = .FALSE. + t0max = CD_ZERO + DO e = 1, model%n_elem + na = model%elem_conn(1, e) + nb = model%elem_conn(2, e) + d0 = model%sub_q0(3*nb - 2:3*nb) - model%sub_q0(3*na - 2:3*na) + t0max = MAX(t0max, model%ea(e)*(NORM2(d0)/model%l0(e) - CD_ONE)) + END DO + turn = CD_ZERO + snap = .FALSE. + DO e = 1, model%n_elem + na = model%elem_conn(1, e) + nb = model%elem_conn(2, e) + d1 = model%q(3*nb - 2:3*nb) - model%q(3*na - 2:3*na) + l_e = NORM2(d1) + IF (.NOT. l_e > model%l0(e)) CYCLE + te = model%ea(e)*(l_e/model%l0(e) - CD_ONE) + d0 = model%sub_q0(3*nb - 2:3*nb) - model%sub_q0(3*na - 2:3*na) + l_s = NORM2(d0) + IF (l_s <= model%l0(e) .AND. te > SUB_SNAP_FRACTION*t0max) snap = .TRUE. + IF (l_s > CD_ZERO) THEN + c = DOT_PRODUCT(d0, d1)/(l_s*l_e) + turn = MAX(turn, ACOS(MAX(-CD_ONE, MIN(CD_ONE, c)))*DEG) + END IF + END DO + nmax = model%cfg%ei0_substep_max + IF (turn > model%cfg%ei0_substep_angle) THEN + ratio = turn/model%cfg%ei0_substep_angle + IF (ratio > REAL(nmax, wp)) THEN + nsub = nmax + capped = .TRUE. + ELSE + nsub = MIN(nmax, MAX(SUB_SNAP_STEPS, CEILING(ratio))) + END IF + END IF + IF (snap) nsub = MAX(nsub, MIN(SUB_SNAP_STEPS, nmax)) + END SUBROUTINE sub_count + + SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & + prescribed_q, prescribed_v, prescribed_a) + !! One generalized-alpha step of the model over dt, as given (CD_Step_Model without its + !! resolved sub-stepping). TYPE(CD_ModelType), INTENT(INOUT) :: model REAL(wp), INTENT(IN) :: dt LOGICAL, INTENT(OUT) :: converged, stalled @@ -2192,7 +2477,7 @@ SUBROUTINE model_added_mass_band(q, accel, free, kl, ku, M_add_a, M_add_band, dM ErrStat, ErrMsg, need_tangent=need_tangent) ErrStat = as_dyn_callback_status(ErrStat) END SUBROUTINE model_added_mass_band - END SUBROUTINE CD_Step_Model + END SUBROUTINE step_model_plain SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q, prescribed_v, prescribed_a, max_substeps, substeps_used) @@ -2217,7 +2502,7 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt INTEGER :: recovery_cap, nsub, k, es, iter_sub, max_iter_seen LOGICAL :: has_pres, conv_sub, stall_sub, rung_ok - REAL(wp) :: subdt, fraction + REAL(wp) :: subdt, fraction, hmax0 REAL(wp), ALLOCATABLE :: pq(:), pv(:), pa(:) CHARACTER(300) :: em, first_em @@ -2262,6 +2547,7 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt END IF CALL save_recovery_state(model) + hmax0 = model%audit_hmax IF (has_pres) THEN CALL CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) @@ -2294,6 +2580,10 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt nsub = 4 DO CALL restore_recovery_state(model) + ! the audit measures the solver steps of the rung that completes + model%audit_hmax = hmax0 + ! the rungs take their sub-steps as given: resolving them as well (sub-steps of sub-steps) + ! left the anchor snap peaks of the Lozon semitaut line 9 % high on average subdt = dt/REAL(nsub, wp) rung_ok = .TRUE. es = CD_MODEL_OK @@ -2308,10 +2598,10 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt pv = prescribed_v pa = prescribed_a END IF - CALL CD_Step_Model(model, subdt, conv_sub, stall_sub, iter_sub, es, em, & - prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + CALL step_model_plain(model, subdt, conv_sub, stall_sub, iter_sub, es, em, & + prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) ELSE - CALL CD_Step_Model(model, subdt, conv_sub, stall_sub, iter_sub, es, em) + CALL step_model_plain(model, subdt, conv_sub, stall_sub, iter_sub, es, em) END IF max_iter_seen = MAX(max_iter_seen, iter_sub) IF (es /= CD_MODEL_OK .OR. .NOT. conv_sub) THEN @@ -2323,6 +2613,7 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt converged = .TRUE. stalled = .FALSE. n_iter = max_iter_seen + model%audit_hmax = MAX(hmax0, subdt) IF (PRESENT(substeps_used)) substeps_used = nsub ErrStat = CD_MODEL_OK ErrMsg = '' @@ -4815,13 +5106,18 @@ SUBROUTINE CD_Audit_Model_Step(model, time, dt, new_spike) REAL(wp), PARAMETER :: TURN_TAUT_FRACTION = 1.0e-3_wp INTEGER, PARAMETER :: SPIKE_MIN_ELEMS = 3 INTEGER :: e, na, nb, istat, es - REAL(wp) :: d(3), ell, strain, u(3), c, line_max, tn + REAL(wp) :: d(3), ell, strain, u(3), c, line_max, tn, h REAL(wp), ALLOCATABLE :: law(:) LOGICAL :: fresh, laws CHARACTER(160) :: em new_spike = .FALSE. IF (.NOT. model%initialized .OR. model%n_elem < 1) RETURN + ! the largest solver step since the last audit (sub-steps of the resolved or recovering + ! step): turns and axial wave crossings are measured per solver step + h = dt + IF (model%audit_hmax > CD_ZERO) h = MIN(dt, model%audit_hmax) + model%audit_hmax = CD_ZERO fresh = .NOT. (ALLOCATED(model%audit_t) .AND. ALLOCATED(model%audit_u) .AND. ALLOCATED(model%audit_now)) IF (.NOT. fresh) fresh = SIZE(model%audit_t, 1) /= model%n_elem IF (fresh) THEN @@ -4881,13 +5177,13 @@ SUBROUTINE CD_Audit_Model_Step(model, time, dt, new_spike) model%audit_t(e, 1) > TURN_TAUT_FRACTION*model%audit_floor .AND. model%audit_t(e, 1) > CD_ZERO) & model%audit_max_turn = MAX(model%audit_max_turn, & ACOS(MAX(-CD_ONE, MIN(CD_ONE, DOT_PRODUCT(u, model%audit_u(:, e)))))* & - (180.0_wp/ACOS(-CD_ONE))) + (180.0_wp/ACOS(-CD_ONE))*(h/dt)) ! slack at the previous state, taut above the initial tension scale now IF (model%audit_t(e, 1) >= CD_ZERO .AND. .NOT. model%audit_t(e, 1) > CD_ZERO .AND. & model%audit_now(e) > model%audit_floor) THEN model%audit_snaps = model%audit_snaps + 1 c = SQRT(wave_stiffness(e)/model%rho_a(e)) - model%audit_snap_courant = MAX(model%audit_snap_courant, dt*c/model%l0(e)) + model%audit_snap_courant = MAX(model%audit_snap_courant, h*c/model%l0(e)) END IF END IF model%audit_u(:, e) = u @@ -4968,6 +5264,7 @@ SUBROUTINE clear_model_audit(model) model%audit_spike_time = CD_ZERO model%audit_spike_tension = CD_ZERO model%audit_spike_ratio = CD_ZERO + model%audit_hmax = CD_ZERO END SUBROUTINE clear_model_audit SUBROUTINE CD_End_Model(model, ErrStat, ErrMsg) @@ -5005,6 +5302,16 @@ SUBROUTINE CD_End_Model(model, ErrStat, ErrMsg) IF (ALLOCATED(model%v_rollback)) DEALLOCATE (model%v_rollback) IF (ALLOCATED(model%a_rollback)) DEALLOCATE (model%a_rollback) IF (ALLOCATED(model%recovery_q0)) DEALLOCATE (model%recovery_q0) + IF (ALLOCATED(model%sub_q0)) DEALLOCATE (model%sub_q0) + IF (ALLOCATED(model%sub_v0)) DEALLOCATE (model%sub_v0) + IF (ALLOCATED(model%sub_a0)) DEALLOCATE (model%sub_a0) + IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq) + IF (ALLOCATED(model%sub_pv)) DEALLOCATE (model%sub_pv) + IF (ALLOCATED(model%sub_pa)) DEALLOCATE (model%sub_pa) + IF (ALLOCATED(model%sub_ve_dl_1)) DEALLOCATE (model%sub_ve_dl_1) + IF (ALLOCATED(model%sub_syrope_slow)) DEALLOCATE (model%sub_syrope_slow) + IF (ALLOCATED(model%sub_syrope_tmax)) DEALLOCATE (model%sub_syrope_tmax) + IF (ALLOCATED(model%sub_fr_anchor)) DEALLOCATE (model%sub_fr_anchor) IF (ALLOCATED(model%recovery_v0)) DEALLOCATE (model%recovery_v0) IF (ALLOCATED(model%recovery_a0)) DEALLOCATE (model%recovery_a0) IF (ALLOCATED(model%f_ext_rollback)) DEALLOCATE (model%f_ext_rollback) diff --git a/tests/test_ei0_slack_dynamics.f90 b/tests/test_ei0_slack_dynamics.f90 index 167883b1..b8a8c4a6 100644 --- a/tests/test_ei0_slack_dynamics.f90 +++ b/tests/test_ei0_slack_dynamics.f90 @@ -14,8 +14,10 @@ PROGRAM test_ei0_slack_dynamics !! 1.80 MN at the fairlead (2.69 MN configuration-blended), as at dtM 0.0025 s. !! 4. The run audit of the driver (stdout of the executable given as the first argument): !! the configuration blend (False alpha_force_blend) of case 1 warns of a non-physical - !! tension spike, the force blend does not; rhoInf above 0.95 prints its note; a 10 m - !! sway at dtM 0.2 s prints the segment-turn advisory; the unresolved slack-to-taut + !! tension spike and is not sub-stepped, the force blend does not warn; rhoInf above + !! 0.95 prints its note; a 10 m sway at dtM 0.2 s prints the segment-turn advisory with + !! off ei0_substeps, and with the default auto is sub-stepped instead (reported; the turn + !! per solver step drops from about 6 deg to below 2 deg); the unresolved slack-to-taut !! snaps of case 1 print the snap note. !! 5. The Newton tangent of the force-blended step against a central finite difference of its !! residual (the step's probe_q hook), on a three-segment tension-only chain with one fixed @@ -288,6 +290,28 @@ LOGICAL FUNCTION file_contains(path, needle) RESULT(found) CLOSE (u) END FUNCTION file_contains + REAL(wp) FUNCTION noted_turn(path) RESULT(turn) + !! The turn (deg) of the run audit's segment-turn note in a driver log, 0 without the note. + CHARACTER(*), INTENT(IN) :: path + CHARACTER(*), PARAMETER :: KEY = 'a taut segment turned up to' + INTEGER :: u, ios, i + CHARACTER(4096) :: line + turn = 0.0_wp + OPEN (NEWUNIT=u, FILE=path, STATUS='OLD', ACTION='READ', IOSTAT=ios) + IF (ios /= 0) RETURN + DO + READ (u, '(A)', IOSTAT=ios) line + IF (ios /= 0) EXIT + i = INDEX(line, KEY) + IF (i > 0) THEN + READ (line(i + LEN(KEY):), *, IOSTAT=ios) turn + IF (ios /= 0) turn = -1.0_wp + EXIT + END IF + END DO + CLOSE (u) + END FUNCTION noted_turn + SUBROUTINE echo_tail(path, n) !! Print the last n lines of a log (the reason a driver run stopped). CHARACTER(*), INTENT(IN) :: path @@ -606,6 +630,7 @@ END SUBROUTINE case_viscoelastic_surge SUBROUTINE case_run_audit() LOGICAL :: ok + REAL(wp) :: turn_off, turn_auto CHARACTER(64) :: opts(4) ! the configuration blend of case 1: its spikes are reported once, as a warning. Its ! non-physical spikes make the run chaotic: whether it completes or a later spike stops it @@ -648,20 +673,40 @@ SUBROUTINE case_run_audit() CALL require(ok, 'audit:rhoinf-run') CALL require(file_contains('ei0slack_audit_rho.log', 'Note: rhoInf = 0.990 leaves almost no numerical'), & 'audit:rhoinf-note') - ! a 10 m sway at dtM 0.2 s turns the segments by several degrees per step + ! a 10 m sway at dtM 0.2 s turns the segments by several degrees per step: taken as given + ! (off ei0_substeps) the run notes the turn CALL write_motion('ei0slack_sway.txt', 1, [5.0_wp, 0.0_wp, -14.0_wp], 2, 10.0_wp, 10.0_wp, 10.0_wp, & 0.2_wp, 20.0_wp) opts(1) = '0.2 dtM' opts(2) = '20.0 TMax' opts(3) = 'ei0slack_sway.txt motionFile' - opts(4) = '' + opts(4) = 'off ei0_substeps' CALL write_deck('ei0slack_audit_sway.dat', CABLE, [205.0_wp, 0.0_wp, -80.0_wp], [5.0_wp, 0.0_wp, -14.0_wp], & 230.0_wp, 115, 80.0_wp, '-', opts) CALL run_driver_logged('ei0slack_audit_sway.dat', 'ei0slack_audit_sway', 'ei0slack_audit_sway.log', ok) CALL require(ok, 'audit:sway-run') CALL require(file_contains('ei0slack_audit_sway.log', 'Note: line 1: a taut segment turned up to'), & 'audit:segment-turn-note') + CALL require(file_contains('ei0slack_audit_sway.log', 'set ei0_substeps auto'), 'audit:segment-turn-remedy') CALL require(.NOT. file_contains('ei0slack_audit_sway.log', 'Warning: line'), 'audit:sway-no-warning') + ! the default (auto) sub-steps those steps: the run reports the sub-stepping, and the turn + ! per solver step drops to about 1 deg (the steps recovered after a stall take their four + ! sub-steps as given, so a note may remain for them) + opts(4) = '' + CALL write_deck('ei0slack_audit_sway_auto.dat', CABLE, [205.0_wp, 0.0_wp, -80.0_wp], & + [5.0_wp, 0.0_wp, -14.0_wp], 230.0_wp, 115, 80.0_wp, '-', opts) + CALL run_driver_logged('ei0slack_audit_sway_auto.dat', 'ei0slack_audit_sway_auto', & + 'ei0slack_audit_sway_auto.log', ok) + CALL require(ok, 'audit:sway-auto-run') + CALL require(file_contains('ei0slack_audit_sway_auto.log', 'ei0_substeps auto solved'), 'audit:substep-note') + turn_off = noted_turn('ei0slack_audit_sway.log') + turn_auto = noted_turn('ei0slack_audit_sway_auto.log') + WRITE (*, '(A,F7.3,A,F7.3,A)') ' sway at dtM 0.2 s: largest turn per solver step ', turn_off, ' deg (off), ', & + turn_auto, ' deg (auto)' + CALL require(turn_off > 4.0_wp .AND. turn_auto >= 0.0_wp .AND. turn_auto < 2.0_wp, 'audit:sway-auto-resolved-turn') + ! the configuration blend (paper mode) takes every step as given + CALL require(.NOT. file_contains('ei0slack_audit_cfg.log', 'ei0_substeps auto solved'), & + 'audit:configuration-blend-not-sub-stepped') END SUBROUTINE case_run_audit ! ------------------------------------------------------------------------------------------ diff --git a/tests/test_model.f90 b/tests/test_model.f90 index da2b20ca..e7b8eb0e 100644 --- a/tests/test_model.f90 +++ b/tests/test_model.f90 @@ -10,7 +10,7 @@ PROGRAM test_model !! End releases the model cleanly. USE CableDyn_Precision, ONLY: wp USE CableDyn_Bathymetry, ONLY: CD_BathymetryType, CD_Init_Bathymetry, CD_End_Bathymetry, CD_BATHY_OK - USE CableDyn_Dynamic, ONLY: GenAlphaConfig + USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_EI0_SUBSTEPS_OFF USE CableDyn_SeabedContact, ONLY: CD_SEABED_CONTACT_BLEND USE CableDyn_Line, ONLY: CD_LineType, CD_LineSection, CD_Build_Line_Mesh, CD_Nodal_Seabed_Stiffness, CD_LINE_OK USE CableDyn_Static, ONLY: CableSolverConfig @@ -27,7 +27,7 @@ PROGRAM test_model CD_Recompute_Model_Acceleration, & CD_Copy_Model, & CD_MODEL_OK, CD_MODEL_BADINPUT, CD_MODEL_SOLVEFAIL, CD_MODEL_NOT_INITIALIZED, & - CD_Update_Model_SegmentLength + CD_Update_Model_SegmentLength, CD_Set_Model_EndQuery USE CableDyn_Loads, ONLY: CD_Assemble_Distributed_Load USE CableDyn_Assemble, ONLY: CD_Assemble_Cable_Mass USE CableDyn_Hydro, ONLY: CD_Cable_Added_Mass_Matrix @@ -47,6 +47,7 @@ PROGRAM test_model CALL case_prescribed_step_updates_state() CALL case_recovery_common_path() CALL case_recovery_subdivision_path() + CALL case_resolved_substeps() CALL case_coupled_load_sign() CALL case_coupled_motion_update() CALL case_external_load_update() @@ -521,6 +522,132 @@ SUBROUTINE case_recovery_common_path() CALL CD_End_Model(plain, es, em) END SUBROUTINE case_recovery_common_path + SUBROUTINE case_resolved_substeps() + !! Rotation-resolved sub-stepping of CD_Step_Model (cfg%ei0_substeps auto, the default): a + !! pretensioned 8-segment line whose End B moves on a 0.6 m circle at 2 s (from rest, after a 1 s ramp) turns its + !! segments by several degrees per 0.1 s step. The resolved march solves those steps in + !! sub-steps, lands on the prescribed end state exactly, is closer to a plain march at dt/8 + !! than the plain march at dt, and repeats bit for bit from a copy of its state (a restart). + !! With off, or with an angle no step reaches, every step is the plain step bit for bit; a + !! junction step (end query armed) is never sub-stepped (it matches the plain march to the + !! Newton tolerance: its warm start differs); an invalid angle fails closed. + INTEGER, PARAMETER :: NE = 8, NN = NE + 1, NDOF = 3*NN, NSTEP = 30, NFINE = 8 + REAL(wp), PARAMETER :: DT = 0.1_wp + TYPE(CD_ModelType) :: auto_m, off_m, wide_m, twin_m, junc_m, fine_m, bad_m + TYPE(GenAlphaConfig) :: cfg + INTEGER :: conn(2, NE), fixed(6), es, n_iter, k, j + REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), v0(NDOF), f_ext(NDOF) + REAL(wp) :: pq(NDOF), pv(NDOF), pa(NDOF), err_auto, err_off + LOGICAL :: conv, stalled, all_conv, lands, twin_ok + CHARACTER(240) :: em + + CALL straight_cable(NE, conn, l0, ea, rho_a, q0, fixed) + v0 = 0.0_wp + f_ext = 0.0_wp + CALL CD_Init_Model(auto_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, cfg, es, em) + CALL require(es == CD_MODEL_OK, 'resolved:init: '//TRIM(em)) + IF (es /= CD_MODEL_OK) RETURN + CALL CD_Copy_Model(auto_m, off_m, es, em) + off_m%cfg%ei0_substeps = CD_EI0_SUBSTEPS_OFF + CALL CD_Copy_Model(auto_m, wide_m, es, em) + wide_m%cfg%ei0_substep_angle = 90.0_wp + CALL CD_Copy_Model(auto_m, junc_m, es, em) + CALL CD_Copy_Model(off_m, fine_m, es, em) + CALL CD_Copy_Model(auto_m, bad_m, es, em) + bad_m%cfg%ei0_substep_angle = 0.0_wp + + all_conv = .TRUE. + lands = .TRUE. + twin_ok = .FALSE. + DO k = 1, NSTEP + CALL circle_end_motion(q0, pq, pv, pa, REAL(k, wp)*DT) + CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + lands = lands .AND. ALL(auto_m%q(fixed) == pq(fixed)) .AND. ALL(auto_m%v(fixed) == pv(fixed)) .AND. & + ALL(auto_m%a(fixed) == pa(fixed)) + CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(wide_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Set_Model_EndQuery(junc_m, .TRUE.) + CALL CD_Step_Model(junc_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + CALL CD_Set_Model_EndQuery(junc_m, .FALSE.) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + DO j = 1, NFINE + CALL circle_end_motion(q0, pq, pv, pa, (REAL(k - 1, wp) + REAL(j, wp)/REAL(NFINE, wp))*DT) + CALL CD_Step_Model(fine_m, DT/REAL(NFINE, wp), conv, stalled, n_iter, es, em, prescribed_q=pq, & + prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + END DO + IF (k == NSTEP/2) THEN + ! a restart: a copy of the committed state continues the march + CALL CD_Copy_Model(auto_m, twin_m, es, em) + CALL require(es == CD_MODEL_OK, 'resolved:copy: '//TRIM(em)) + ELSE IF (k > NSTEP/2) THEN + CALL circle_end_motion(q0, pq, pv, pa, REAL(k, wp)*DT) + CALL CD_Step_Model(twin_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, & + prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + END IF + END DO + twin_ok = ALL(twin_m%q == auto_m%q) .AND. ALL(twin_m%v == auto_m%v) .AND. ALL(twin_m%a == auto_m%a) + err_auto = MAXVAL(ABS(auto_m%q - fine_m%q)) + err_off = MAXVAL(ABS(off_m%q - fine_m%q)) + WRITE (*, '(A,I0,A,I0,A,I0,A,ES10.3,A,ES10.3,A)') ' resolved sub-steps: ', auto_m%sub_events, ' of ', & + auto_m%sub_calls, ' steps (at most ', auto_m%sub_max_used, '); position error against dt/8 ', err_auto, & + ' m (plain ', err_off, ' m)' + CALL require(all_conv, 'resolved:converged') + CALL require(auto_m%sub_events > 0 .AND. auto_m%sub_max_used >= 4, 'resolved:sub-stepped') + CALL require(lands, 'resolved:lands-on-prescribed-end') + CALL require(err_auto < 0.75_wp*err_off, 'resolved:closer-to-fine-march') + CALL require(twin_ok, 'resolved:restart-bit-identical') + CALL require(off_m%sub_calls == 0 .AND. off_m%sub_events == 0, 'resolved:off-not-examined') + CALL require(wide_m%sub_events == 0 .AND. ALL(wide_m%q == off_m%q) .AND. ALL(wide_m%v == off_m%v) .AND. & + ALL(wide_m%a == off_m%a), 'resolved:untriggered-is-plain') + CALL require(junc_m%sub_calls == 0 .AND. MAXVAL(ABS(junc_m%q - off_m%q)) < 1.0e-6_wp, & + 'resolved:junction-not-sub-stepped') + CALL circle_end_motion(q0, pq, pv, pa, DT) + CALL CD_Step_Model(bad_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + CALL require(es == CD_MODEL_BADINPUT .AND. INDEX(em, 'ei0_substep_angle') > 0, 'resolved:invalid-angle') + CALL CD_End_Model(auto_m, es, em) + CALL CD_End_Model(off_m, es, em) + CALL CD_End_Model(wide_m, es, em) + CALL CD_End_Model(twin_m, es, em) + CALL CD_End_Model(junc_m, es, em) + CALL CD_End_Model(fine_m, es, em) + CALL CD_End_Model(bad_m, es, em) + END SUBROUTINE case_resolved_substeps + + SUBROUTINE circle_end_motion(q0, pq, pv, pa, t) + !! End A held, End B (the last node) on the circle x_B + R r(t) (0, sin wt, 1 - cos wt), + !! R = 0.3 m, period 2 s, r the C2 quintic ramp over the first second, so the motion starts + !! from rest (case_resolved_substeps). + REAL(wp), INTENT(IN) :: q0(:), t + REAL(wp), INTENT(OUT) :: pq(:), pv(:), pa(:) + REAL(wp), PARAMETER :: RADIUS = 0.6_wp, PERIOD = 2.0_wp, RAMP = 1.0_wp + REAL(wp) :: w, u, r, rd, rdd, g(2), gd(2), gdd(2) + INTEGER :: n + n = SIZE(q0) + w = 2.0_wp*ACOS(-1.0_wp)/PERIOD + u = MIN(t/RAMP, 1.0_wp) + r = 10.0_wp*u**3 - 15.0_wp*u**4 + 6.0_wp*u**5 + rd = 0.0_wp + rdd = 0.0_wp + IF (t < RAMP) THEN + rd = (30.0_wp*u**2 - 60.0_wp*u**3 + 30.0_wp*u**4)/RAMP + rdd = (60.0_wp*u - 180.0_wp*u**2 + 120.0_wp*u**3)/RAMP**2 + END IF + g = RADIUS*[SIN(w*t), 1.0_wp - COS(w*t)] + gd = RADIUS*w*[COS(w*t), SIN(w*t)] + gdd = RADIUS*w*w*[-SIN(w*t), COS(w*t)] + pq = q0 + pv = 0.0_wp + pa = 0.0_wp + pq(n - 1:n) = q0(n - 1:n) + r*g + pv(n - 1:n) = rd*g + r*gd + pa(n - 1:n) = rdd*g + 2.0_wp*rd*gd + r*gdd + END SUBROUTINE circle_end_motion + SUBROUTINE case_recovery_subdivision_path() !! Find a bounded, deterministic prescribed-motion increment for which the !! deliberately small nonlinear-iteration allowance rejects the full diff --git a/validation/experiments/bergdahl/README.md b/validation/experiments/bergdahl/README.md index 1d7a615b..0f372ba9 100644 --- a/validation/experiments/bergdahl/README.md +++ b/validation/experiments/bergdahl/README.md @@ -70,11 +70,11 @@ committed summary file (`sha256sum`, or `Get-FileHash` in PowerShell). `comparison_summary.csv`, `aggregate_metrics.json` and `provenance.json` hold the compact results and the checksum of the executable used. The calculated force is `FairTen1`, the force -at the upper line end. Across the 30 conditions, the cycle maxima have an RMSE of 1.58 N, a -mean absolute percentage error of 3.13%, a mean bias of +0.46 N, a Pearson correlation of 0.993 +at the upper line end. Across the 30 conditions, the cycle maxima have an RMSE of 1.59 N, a +mean absolute percentage error of 3.13%, a mean bias of +0.45 N, a Pearson correlation of 0.993 and a Lin concordance coefficient of 0.989. For the two waveform conditions, halving the nominal -element length and the time step changes the mean cycle maximum by no more than 0.52% and -0.19%, respectively, and the phase-averaged force histories have RMSEs of 5.95% and 2.54% of +element length and the time step changes the mean cycle maximum by no more than 0.53% and +0.13%, respectively, and the phase-averaged force histories have RMSEs of 5.95% and 2.54% of the measured force range (computed with the executable of the 2026-10-09 record; see `provenance.json`). The waveform CSVs carry the measured phase averages computed from the supplement's `expData.dat`. @@ -86,9 +86,10 @@ modes up to about 2c/l ≈ 3500 rad/s. The force maxima are snap loads, which co step only once the step resolves these modes, roughly dtM ≲ l/(2c) ≈ 0.29 ms (see "Snap loads on slack lines" in the [modelling guide](https://cabledyn.readthedocs.io/en/latest/modeling.html)). At a coarser step the maxima do not settle: at the T = 1.25 s, 0.20 m condition they are -72.2 N at 0.625 ms, against 68.0 N at 0.3125 ms and 67.8 N at 0.15625 ms. Coarse steps also +69.5 N at 0.625 ms (72.2 N with every step taken as given, `off ei0_substeps`), against +68.0 N at 0.3125 ms and 67.9 N at 0.15625 ms. Coarse steps also leave the maxima sensitive to the Newton tolerance and to small changes in the solver's iteration path. With a 1.25 ms step and a relative tolerance of 1e-5, the five cycle maxima of a condition have standard deviations of up to 1.6 N, their means are 2–15% above the converged values, and the 30-condition RMSE is 3.7 N. At the 0.3125 ms step the standard deviation is at -most 0.19 N. +most 0.17 N. diff --git a/validation/experiments/bergdahl/aggregate_metrics.json b/validation/experiments/bergdahl/aggregate_metrics.json index 7e090b78..afbc23da 100644 --- a/validation/experiments/bergdahl/aggregate_metrics.json +++ b/validation/experiments/bergdahl/aggregate_metrics.json @@ -1,12 +1,12 @@ { "completed_cases": 30, - "mean_bias_N": 0.4616683466666679, - "mean_bias_percent_of_measured": 1.5855886766627234, - "mae_N": 1.327560893333332, - "mape_percent": 3.1267980284256174, - "rmse_N": 1.5827470765235303, + "mean_bias_N": 0.4463738400000018, + "mean_bias_percent_of_measured": 1.5566744346055916, + "mae_N": 1.3322167866666672, + "mape_percent": 3.1345007652497823, + "rmse_N": 1.5877613664615542, "maximum_absolute_error_percent": 7.717337853107351, - "pearson_correlation": 0.9932561631491675, - "correlation_r_squared": 0.9865578056338057, - "lin_concordance_correlation": 0.9891388894227845 + "pearson_correlation": 0.9931905701837782, + "correlation_r_squared": 0.9864275087019785, + "lin_concordance_correlation": 0.9890602173780585 } diff --git a/validation/experiments/bergdahl/comparison_summary.csv b/validation/experiments/bergdahl/comparison_summary.csv index cb97a7df..fec0f964 100644 --- a/validation/experiments/bergdahl/comparison_summary.csv +++ b/validation/experiments/bergdahl/comparison_summary.csv @@ -1,31 +1,31 @@ case,period_s,radius_m,measured_maximum_N,dt_s,number_of_elements,element_length_m,total_cycles,ramp_cycles,rho_inf,published_ground_modulus_Pa_per_m,published_ground_damping_ratio,published_contact_diameter_m,equivalent_volume_diameter_m,kbot_Pa_per_m,cbot_Pa_s_per_m,contact_coefficients_overridden,ba_N_s,friction_mu,solver_relative_tolerance,analysis_start_s,deck_sha256,motion_sha256,samples_analysed,predicted_mean_N,predicted_minimum_N,predicted_absolute_maximum_N,predicted_mean_cycle_maximum_N,predicted_cycle_maximum_std_N,predicted_range_N,maximum_error_N,maximum_error_percent -bergdahl_T1p25_R0p075_h0p200_dt0p0003,1.25,0.075,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,9a15c83cd584db2d41b7425c2464d45b951e064312e22d2bd5f2bdc5d62c78be,200c532b956836233ff1706360190a636fa05d658c6e4dc8b0eeda6ac38665d7,20001,22.75729029778711,0.84961577,41.55663,41.518083000000004,0.0364163607119109,40.70701423,-0.9819169999999957,-2.3103929411764605 -bergdahl_T1p25_R0p100_h0p200_dt0p0003,1.25,0.1,46.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,35f623bef1aa930eca217ccf056b72d26a2a3003af68a8efbce83fadb8921146,deb435829efdb15fd5c8f0b8db9dd0c83cfa10aab269a24dcd1fae02d0156547,20001,23.423043792491978,0.080218397,47.463795,47.3005878,0.10685080749437453,47.383576602999995,0.5005878000000052,1.0696320512820625 -bergdahl_T1p25_R0p125_h0p200_dt0p0003,1.25,0.125,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,3db8b8c41f6fd9b122135c92bb6311db9c79ed022cea0e9341c82e382ea2d8c4,350bd646ce87b6afcfec808548ada2624a25186efabbcd00dc72864f1b20fbf0,20001,24.476081125954803,0.080218397,53.264162,53.1698942,0.0748986296049524,53.183943602999996,-0.9301057999999998,-1.7192343807763397 -bergdahl_T1p25_R0p150_h0p200_dt0p0003,1.25,0.15,60.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,6db3b6e1e3a34c320567820a2b227905aea57c8940efdebb14afb0b1a4bb6b8b,a8a5c083de018445740094b398496386e405db1c896d75c8e01c6acd0c985d3c,20001,25.732057802401027,0.080218397,58.343019,58.232365200000004,0.0759659228615041,58.262800602999995,-2.1676347999999948,-3.588799337748336 -bergdahl_T1p25_R0p200_h0p200_dt0p0003,1.25,0.2,70.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,79b6ad075892ffbad6f63343cb55454aa2380387002b23c95dd63ec99ad89757,a3f02e630a2f80e08b9367d4362b4bb09c37f3fb5935ecdc3f548d38fb0f22da,20001,28.52452245713629,0.047432814,68.254513,67.9673104,0.20436951680913815,68.207080186,-2.332689599999995,-3.3181928876244595 +bergdahl_T1p25_R0p075_h0p200_dt0p0003,1.25,0.075,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,9a15c83cd584db2d41b7425c2464d45b951e064312e22d2bd5f2bdc5d62c78be,200c532b956836233ff1706360190a636fa05d658c6e4dc8b0eeda6ac38665d7,20001,22.761262326175693,0.6118298,41.58885,41.51824520000001,0.087761545968037,40.9770202,-0.9817547999999903,-2.3100112941176243 +bergdahl_T1p25_R0p100_h0p200_dt0p0003,1.25,0.1,46.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,35f623bef1aa930eca217ccf056b72d26a2a3003af68a8efbce83fadb8921146,deb435829efdb15fd5c8f0b8db9dd0c83cfa10aab269a24dcd1fae02d0156547,20001,23.41468092322619,0.080218397,47.33166,47.2240214,0.08104350965561587,47.251441602999996,0.4240214000000009,0.9060286324786344 +bergdahl_T1p25_R0p125_h0p200_dt0p0003,1.25,0.125,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,3db8b8c41f6fd9b122135c92bb6311db9c79ed022cea0e9341c82e382ea2d8c4,350bd646ce87b6afcfec808548ada2624a25186efabbcd00dc72864f1b20fbf0,20001,24.473830476762014,0.080218397,53.097523,52.9544852,0.09836654800134037,53.017304603,-1.1455148000000008,-2.1174025878003713 +bergdahl_T1p25_R0p150_h0p200_dt0p0003,1.25,0.15,60.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,6db3b6e1e3a34c320567820a2b227905aea57c8940efdebb14afb0b1a4bb6b8b,a8a5c083de018445740094b398496386e405db1c896d75c8e01c6acd0c985d3c,20001,25.735719992589374,0.080218397,58.297697,58.1087224,0.11443742252340404,58.217478602999996,-2.291277600000001,-3.793505960264902 +bergdahl_T1p25_R0p200_h0p200_dt0p0003,1.25,0.2,70.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,79b6ad075892ffbad6f63343cb55454aa2380387002b23c95dd63ec99ad89757,a3f02e630a2f80e08b9367d4362b4bb09c37f3fb5935ecdc3f548d38fb0f22da,20001,28.523775550869306,0.046140683,68.182784,67.9888416,0.1332818584496762,68.136643317,-2.3111583999999965,-3.287565291607392 bergdahl_T1p50_R0p075_h0p200_dt0p0003,1.5,0.075,41.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,c84e640a68f2f9a806a08b3afb2b220a49025cf6cf3f75a4439df1e5007eb536,c93b19181604134c73d29a1e343dadd769c4cf5510d2214a929e96ad98bab6d7,24001,22.592768295391856,2.1826476,39.942296,39.862761,0.06165540456034704,37.759648399999996,-1.137239000000001,-2.7737536585365876 -bergdahl_T1p50_R0p100_h0p200_dt0p0003,1.5,0.1,45.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,89df9b353f05c33ad5b47160fb17b0ef2fb9aaaddc5f9c1bb6faa1aa651345b0,08aff391d95ba06a6e36de8101f986e34725034f826dcb56c079f6de0e8c63db,24001,23.099262985012874,0.080218397,46.163762,45.9797466,0.12750091794885285,46.083543602999995,0.6797466000000014,1.5005443708609303 -bergdahl_T1p50_R0p125_h0p200_dt0p0003,1.5,0.125,51.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,b08f6f7411a4c6bf6c51479886cdd5e5ec05048995f7df56b314f38602a6ac68,8da6cf5077f315d1445f9fa86597eb0c45f4a47ea564b2a14f53dbfcb12d70c0,24001,24.037791008454146,0.080218397,51.738263,51.5905316,0.10014122989208964,51.658044603,0.09053159999999849,0.17578951456310388 -bergdahl_T1p50_R0p150_h0p200_dt0p0003,1.5,0.15,59.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4adab994765aca18aa52757ef82e30d15cd9ad09a908cf44bae00cd890218bcb,d399fa50a0dcd35fa3a55d5e8cfddae96652df14bc08b3707dae3766fb725531,24001,25.22877844669226,0.080218397,56.421491,56.337508400000004,0.07367940691129274,56.341272603,-2.6624915999999956,-4.512697627118636 -bergdahl_T1p50_R0p200_h0p200_dt0p0003,1.5,0.2,68.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4087f2ecb4c0dc5d8d29440397162646e11ea24585c1bff5229079b1c9e4bda0,80096d02b10970eabc9320273215f978a016c2ea4add6012ca7ecd21c68c2851,24001,27.95913363490667,0.049391599,67.036091,66.92867720000001,0.09692043402812402,66.986699401,-1.0713227999999901,-1.5754747058823384 +bergdahl_T1p50_R0p100_h0p200_dt0p0003,1.5,0.1,45.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,89df9b353f05c33ad5b47160fb17b0ef2fb9aaaddc5f9c1bb6faa1aa651345b0,08aff391d95ba06a6e36de8101f986e34725034f826dcb56c079f6de0e8c63db,24001,23.093700958486732,0.080218397,46.141903,45.9667182,0.16534378531925498,46.061684602999996,0.6667182000000054,1.4717841059602768 +bergdahl_T1p50_R0p125_h0p200_dt0p0003,1.5,0.125,51.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,b08f6f7411a4c6bf6c51479886cdd5e5ec05048995f7df56b314f38602a6ac68,8da6cf5077f315d1445f9fa86597eb0c45f4a47ea564b2a14f53dbfcb12d70c0,24001,24.045022168526646,0.080218397,51.734981,51.58838060000001,0.16784017486525726,51.654762602999995,0.0883806000000078,0.17161281553399574 +bergdahl_T1p50_R0p150_h0p200_dt0p0003,1.5,0.15,59.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4adab994765aca18aa52757ef82e30d15cd9ad09a908cf44bae00cd890218bcb,d399fa50a0dcd35fa3a55d5e8cfddae96652df14bc08b3707dae3766fb725531,24001,25.233665231943505,0.080218397,56.563023,56.470973,0.10221066959960627,56.482804603,-2.5290269999999992,-4.286486440677965 +bergdahl_T1p50_R0p200_h0p200_dt0p0003,1.5,0.2,68.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4087f2ecb4c0dc5d8d29440397162646e11ea24585c1bff5229079b1c9e4bda0,80096d02b10970eabc9320273215f978a016c2ea4add6012ca7ecd21c68c2851,24001,27.95158491895067,0.049653031,66.994316,66.9071382,0.08601608688320998,66.94466296899999,-1.0928617999999943,-1.6071497058823445 bergdahl_T2p00_R0p075_h0p200_dt0p0003,2.0,0.075,36.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,788d6c963eaccba31443ed29b33d8dd37dcde8e5945ac02f4c63728f4bcede11,06b2ee6b12d716e9c4757c91d6e330d7985b118f411d8673f0e3be1317cd10b7,32001,22.50825846114497,7.1153458,36.047917,36.035346999999994,0.011414748069932139,28.932571199999998,0.035346999999994466,0.09818611111109574 -bergdahl_T2p00_R0p100_h0p200_dt0p0003,2.0,0.1,39.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,66b4e4070897810cc0c2db78a9da33350dbf480ff297311b5ade518c36518e72,7cfeecfbc7673140d72af2c7a475ead3ce77736e54552c663e5df1b72cf6afdd,32001,22.725582901798692,0.20156104,41.949945,41.8937148,0.043681995812919115,41.74838396,2.393714799999998,6.060037468354425 -bergdahl_T2p00_R0p125_h0p200_dt0p0003,2.0,0.125,47.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,11d53518b7f6d58facee9b5d62e582bbdc94a289098bbf6d3ac61defaf82c7e8,b2a8c64acddab4c852169269cca4e60bb258479eda2a6495d094c99f39cf76d3,32001,23.438071037375487,0.080218397,47.713108,47.5727352,0.1101758711342915,47.632889602999995,0.07273519999999678,0.1531267368420985 -bergdahl_T2p00_R0p150_h0p200_dt0p0003,2.0,0.15,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,d423c8a5aeb69a63655c03060d6f2b45742420795e5d8004b716da8908cd126d,71ae7988f4e286c2a5c4f8b21cbdf9cf0c5138bb68f74c9e2e7083d2bd8a9c39,32001,24.44123775418168,0.080218397,53.034022,52.9313364,0.08391372617039487,52.953803603,-1.1686636000000021,-2.160191497227361 -bergdahl_T2p00_R0p200_h0p200_dt0p0003,2.0,0.2,62.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,a640e7f76fa6bb1ae074d28e43f3958084d3e75bf7d9d368fd414b9849f14e25,5211abe84187c30899ee1759f47f60ddd307427b5aaa577a132c9269b8d0b0f1,32001,26.998362808274205,0.069770449,63.216109,63.1520804,0.03968285901746634,63.146338551,0.8520804000000055,1.3677052969502497 +bergdahl_T2p00_R0p100_h0p200_dt0p0003,2.0,0.1,39.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,66b4e4070897810cc0c2db78a9da33350dbf480ff297311b5ade518c36518e72,7cfeecfbc7673140d72af2c7a475ead3ce77736e54552c663e5df1b72cf6afdd,32001,22.72410170257179,0.49445707,41.953784,41.9163164,0.04256154826601123,41.459326929999996,2.4163163999999995,6.117256708860758 +bergdahl_T2p00_R0p125_h0p200_dt0p0003,2.0,0.125,47.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,11d53518b7f6d58facee9b5d62e582bbdc94a289098bbf6d3ac61defaf82c7e8,b2a8c64acddab4c852169269cca4e60bb258479eda2a6495d094c99f39cf76d3,32001,23.43402956827424,0.080218397,47.666255,47.5752832,0.06737417150288458,47.586036603,0.07528320000000122,0.15849094736842362 +bergdahl_T2p00_R0p150_h0p200_dt0p0003,2.0,0.15,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,d423c8a5aeb69a63655c03060d6f2b45742420795e5d8004b716da8908cd126d,71ae7988f4e286c2a5c4f8b21cbdf9cf0c5138bb68f74c9e2e7083d2bd8a9c39,32001,24.44396749566129,0.080218397,52.90618,52.83243280000001,0.06172464578432187,52.825961602999996,-1.267567199999995,-2.3430077634010997 +bergdahl_T2p00_R0p200_h0p200_dt0p0003,2.0,0.2,62.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,a640e7f76fa6bb1ae074d28e43f3958084d3e75bf7d9d368fd414b9849f14e25,5211abe84187c30899ee1759f47f60ddd307427b5aaa577a132c9269b8d0b0f1,32001,26.994398577719945,0.067488668,63.10472,63.0812954,0.017040065692363174,63.037231332,0.7812954000000047,1.254085714285722 bergdahl_T2p50_R0p075_h0p200_dt0p0003,2.5,0.075,31.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,87645fbd5487107bb7b4710a95d6eebc3da8d0309ba5de053694f17590581d35,b3a5ceda599c59b5516c7f95d48a53c5a9082ba4573eb87d0f4ebdb816c9918d,40001,22.573128677483066,10.591124,33.062585,33.0596916,0.003054553044227603,22.471460999999998,1.9596915999999993,6.301259163987136 bergdahl_T2p50_R0p100_h0p200_dt0p0003,2.5,0.1,35.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,9898a74d88ffedf8e9585d680862587b7382f129aa1cbf90dcec137bcd6f3f7d,69865be17566563fed41360b3b26602dd059e960ddf492a02bb8474239fe8617,40001,22.64237321955451,4.7312149,38.136158,38.1319376,0.002738401960999871,33.404943100000004,2.731937600000002,7.7173378531073515 -bergdahl_T2p50_R0p125_h0p200_dt0p0003,2.5,0.125,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6c1845719020a1b825f0878b9722de394658a468d2576549e8ac44e3854c1943,4606eb29aac566ef9436af19d60063e21915d8e535ee1a29cb8164bf36832ac1,40001,23.06203512397165,0.080218397,43.671052,43.619687400000004,0.03978410596331384,43.590833603,1.1196874000000037,2.634558588235303 -bergdahl_T2p50_R0p150_h0p200_dt0p0003,2.5,0.15,49.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6ebf7ca718808043f57a87bb177c1d5a25f86e13ebcf6a1129e7ef8d9f73fe77,f96b5df08fdfbafbf1a73f3a476ab4bd83f366340e729a555fff4abfbdcb128f,40001,23.951691448754932,0.080218397,48.966114,48.918578600000004,0.03350533006552719,48.885895602999994,-0.08142139999999642,-0.1661661224489723 -bergdahl_T2p50_R0p200_h0p200_dt0p0003,2.5,0.2,57.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,2d0261069c6689ebe857731f237f70a2883a5980112b9f277246377d0230c9cf,da167b278b0560de961de703952a1e36a22f7e4ff637e7a8453f90eeada7281d,40001,26.27020682526119,0.074341225,59.599114,59.5508086,0.03514053619112935,59.524772775,2.2508086000000063,3.928112739965107 +bergdahl_T2p50_R0p125_h0p200_dt0p0003,2.5,0.125,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6c1845719020a1b825f0878b9722de394658a468d2576549e8ac44e3854c1943,4606eb29aac566ef9436af19d60063e21915d8e535ee1a29cb8164bf36832ac1,40001,23.06433277538484,0.080218397,43.631724,43.5970626,0.021472816228896,43.551505602999995,1.097062600000001,2.5813237647058846 +bergdahl_T2p50_R0p150_h0p200_dt0p0003,2.5,0.15,49.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6ebf7ca718808043f57a87bb177c1d5a25f86e13ebcf6a1129e7ef8d9f73fe77,f96b5df08fdfbafbf1a73f3a476ab4bd83f366340e729a555fff4abfbdcb128f,40001,23.951675601070225,0.080218397,48.954134,48.9199924,0.03121052419136763,48.873915603,-0.08000760000000184,-0.16328081632653438 +bergdahl_T2p50_R0p200_h0p200_dt0p0003,2.5,0.2,57.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,2d0261069c6689ebe857731f237f70a2883a5980112b9f277246377d0230c9cf,da167b278b0560de961de703952a1e36a22f7e4ff637e7a8453f90eeada7281d,40001,26.269534998201692,0.075057922,59.592596,59.5669956,0.014613585675665251,59.517538078,2.2669956000000013,3.956362303664924 bergdahl_T3p00_R0p075_h0p200_dt0p0003,3.0,0.075,29.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,302324da0849af35df6392af12635f08555aba2a6e69de515e79fb9705bbab04,d9ad6838f7015b0e7d32a70eb86534166089bd80a096e0a2989cf5cef41dbd05,48001,22.653205223224518,13.239237,31.054133,31.053350599999998,0.0007923962392643522,17.814896,1.5533505999999981,5.265595254237282 bergdahl_T3p00_R0p100_h0p200_dt0p0003,3.0,0.1,33.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,eb00be510264d4ead391c24cc9a240da7dec29658c898bbc9b481e894d73bd07,8a90048a3f3bab35a054f704a11342f580f746ec87972031da7d49d02217f6cc,48001,22.68028505046978,7.8264702,35.57996,35.577183000000005,0.0018532568629307379,27.7534898,2.4771830000000037,7.483936555891249 bergdahl_T3p00_R0p125_h0p200_dt0p0003,3.0,0.125,39.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,ced08cb707dbc660e07d97949e7422b7326d083dc99d18a5ae84378a21fc84ef,bde9b1a9923f0d4e4c3158d7df37ba31838710c39d672bb8241ec6cab8e55722,48001,22.90058616806525,1.1527348,40.40689,40.401079200000005,0.005300698180428831,39.2541552,1.101079200000008,2.80172824427483 -bergdahl_T3p00_R0p150_h0p200_dt0p0003,3.0,0.15,45.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,47aa51d93408ca527f8a8ac85613ab9b0f7a4f9a2459ec9bca396e62de32dfb2,402811dda2da329a55b8e7816c5134f5aecb0a59bdbefc6b13eeb232cb4fb15b,48001,23.530885720303036,0.080218397,45.358404,45.3450974,0.010693752699590463,45.278185603,-0.45490259999999694,-0.9932371179039235 -bergdahl_T3p00_R0p200_h0p200_dt0p0003,3.0,0.2,54.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,96e1dda1aa324b9669d601026fb6ad0831cadaf6dcc32492235ee05cd7d7d3b5,f03dc52610fa2de64c497f78321355d34ea6fad14109005aafde665c707b0e35,48001,25.689062797173765,0.080218397,55.736209,55.698312599999994,0.03162717803250884,55.655990603,1.6983125999999942,3.1450233333333224 +bergdahl_T3p00_R0p150_h0p200_dt0p0003,3.0,0.15,45.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,47aa51d93408ca527f8a8ac85613ab9b0f7a4f9a2459ec9bca396e62de32dfb2,402811dda2da329a55b8e7816c5134f5aecb0a59bdbefc6b13eeb232cb4fb15b,48001,23.530868768436324,0.080218397,45.373699,45.348763999999996,0.022267908725337952,45.293480603,-0.4512360000000015,-0.9852314410480383 +bergdahl_T3p00_R0p200_h0p200_dt0p0003,3.0,0.2,54.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,96e1dda1aa324b9669d601026fb6ad0831cadaf6dcc32492235ee05cd7d7d3b5,f03dc52610fa2de64c497f78321355d34ea6fad14109005aafde665c707b0e35,48001,25.690994785671446,0.078386477,55.741428,55.7089604,0.023063043409316825,55.663041523,1.7089604000000023,3.1647414814814856 bergdahl_T3p50_R0p075_h0p200_dt0p0003,3.5,0.075,27.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,235d4acffaff2133c0833b4dde65d4f746a980e483bf1a184fbda1789d26d32b,832f1074f37014ce95341e0baea190a6c995ca381de72b85ef1d8e4ffbecc7ed,56001,22.741663554740096,15.199221,29.866848,29.8664992,0.0004117046271295802,14.667627000000001,2.066499199999999,7.433450359712226 bergdahl_T3p50_R0p100_h0p200_dt0p0003,3.5,0.1,31.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,dfd71b038e2016e837ca8d2976ff4dabbdbc579d663b3e4d6cc02c867bde1e35,d70c6750c97b8271d7f0604166e62a41a1e57b583932f16598c4ebe75de573aa,56001,22.765204520883554,10.515801,33.721231,33.7197632,0.001419329313444277,23.205430000000003,2.2197632000000027,7.0468673015873105 bergdahl_T3p50_R0p125_h0p200_dt0p0003,3.5,0.125,37.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,0c91662ea48cc2fa12539fc97fc123c1b3dff743ead2bace86bdf2ac3ac53997,2fe336ce9ff36b4af7c8d698c3e68f372b762b8127ecdda730fb5e07c46f68ea,56001,22.890783096641133,5.7432455,38.029771,38.027166,0.002623257802807864,32.286525499999996,0.5271660000000011,1.405776000000003 -bergdahl_T3p50_R0p150_h0p200_dt0p0003,3.5,0.15,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,f2a0f779cd4f722e64114a1d24d297d7b71ce71b3234ebf98d0ee02349768a0e,fd49ce4e3dce2c1d034faeedf52a60633dfb26a3a6cfbc935c66a29ea7297d3c,56001,23.270828354333318,0.38777922,42.77665,42.75414859999999,0.026079876654231008,42.38887078,0.2541485999999935,0.5979967058823377 -bergdahl_T3p50_R0p200_h0p200_dt0p0003,3.5,0.2,50.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,7bdf322dbff579b866971969ad11b066c3aa1da0fb8bd19bf7f64c3e05b85e00,de9d5e2bf50d61ca47a1fb69f0cfabab511139a97cff5ccdf79fc257b156f438,56001,25.18984178717771,0.080218397,52.364122,52.35406759999999,0.00952333220569378,52.283903603,2.254067599999992,4.499136926147688 +bergdahl_T3p50_R0p150_h0p200_dt0p0003,3.5,0.15,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,f2a0f779cd4f722e64114a1d24d297d7b71ce71b3234ebf98d0ee02349768a0e,fd49ce4e3dce2c1d034faeedf52a60633dfb26a3a6cfbc935c66a29ea7297d3c,56001,23.270113562783166,0.30571667,42.757722,42.7187964,0.047317708649088665,42.45200533,0.21879640000000222,0.5148150588235346 +bergdahl_T3p50_R0p200_h0p200_dt0p0003,3.5,0.2,50.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,7bdf322dbff579b866971969ad11b066c3aa1da0fb8bd19bf7f64c3e05b85e00,de9d5e2bf50d61ca47a1fb69f0cfabab511139a97cff5ccdf79fc257b156f438,56001,25.190993396198962,0.080218397,52.378952,52.3630118,0.013188911031619902,52.298733602999995,2.263011800000001,4.516989620758485 diff --git a/validation/experiments/bergdahl/provenance.json b/validation/experiments/bergdahl/provenance.json index 6569d610..cfe95d40 100644 --- a/validation/experiments/bergdahl/provenance.json +++ b/validation/experiments/bergdahl/provenance.json @@ -1,8 +1,8 @@ { "CableDyn_release": "v0.1.1+dev (unreleased)", - "validation_date": "2026-10-16", + "validation_date": "2026-10-17", "executable_name": "cabledyn.exe", - "executable_sha256": "78a3fed9390fd77392a1dcaec244f79f9174d9e2e94e4b3032fb53c7b8bd4395", + "executable_sha256": "51f17f4bee5253961d6b36bd8404d948e815470abff64491deeb99a7e77708b7", "compiler": "GNU Fortran 16.2.0", "build_type": "Release", "platform": "Windows 11 x86-64", @@ -12,14 +12,14 @@ "completed_cases": 30, "nonlinear_misses": 0, "refinement_cases": 8, - "maximum_spatial_refinement_difference_percent": 0.5236270564721716, - "maximum_temporal_refinement_difference_percent": 0.18888172026785752, - "force_maxima_sha256": "978889378964c6d6749bc27c11d99d6584956e3c8eac146ae79bf5f7a05e2e95", - "aggregate_metrics_sha256": "35d800fa34137a3a1500cbd0081a490bc1b61cf636cfef5a923b5c18947ba1a7", + "maximum_spatial_refinement_difference_percent": 0.5265703061372087, + "maximum_temporal_refinement_difference_percent": 0.12568365771083198, + "force_maxima_sha256": "83df076fba89f1e759e084b78956283f6f08c7300b93b30576447f11c34fed3c", + "aggregate_metrics_sha256": "ffbd4c82f8191dc67f18b53717afd4d521f8f172612e8d11bffc1d50d233d03c", "case_manifest_sha256": "8da5e7b4a8a92755363807902aba48e0ff42abab04ac44912041853db9e56604", "waveform_T1p25_sha256": "65c8c846636c378b800bb3c7a95ccd2bde766d789af3cdffce26a2e688e1a134", "waveform_T3p50_sha256": "b3ca65ebfc1d61b5510e54876fc11d1604fc18ffcca3eab523dc7d67f50da4d8", "waveform_metrics_sha256": "2803a57cb7726f966a00e00bf6eb070231b9c702ae67a81685da50991d0adb11", - "waveform_note": "Waveform metrics were computed with the executable of the 2026-10-09 validation (sha256 71090e2e28c9e1d99c5180d05a395ebcc891a77cc5294d315a57c691904745ac); the force-blended EI = 0 step of this development build was not rerun on them because the article supplement's expData.dat, which reduce_bergdahl_waveforms.py reads, was not available. The measured phase averages are those of expData.dat, as carried in the waveform CSVs.", - "refinement_summary_sha256": "b3ef33659ba852ce8b6667032a9f2c44bf0336d988c29c2a80fddc2ab4053859" + "waveform_note": "Waveform metrics were computed with the executable of the 2026-10-09 validation (sha256 71090e2e28c9e1d99c5180d05a395ebcc891a77cc5294d315a57c691904745ac); the development builds since then (the force-blended EI = 0 step and its rotation- and snap-resolved sub-steps) were not rerun on them because the article supplement's expData.dat, which reduce_bergdahl_waveforms.py reads, was not available. The measured phase averages are those of expData.dat, as carried in the waveform CSVs.", + "refinement_summary_sha256": "8b5c2665ca10154ac0abf9c737971f7c02bf74029ac9898ab065bc785071670c" } diff --git a/validation/experiments/bergdahl/refinement_summary.csv b/validation/experiments/bergdahl/refinement_summary.csv index ddbd61e6..b590407f 100644 --- a/validation/experiments/bergdahl/refinement_summary.csv +++ b/validation/experiments/bergdahl/refinement_summary.csv @@ -1,3 +1,3 @@ period_s,radius_m,force_h0p400_dt0p0003125_N,force_h0p200_dt0p0003125_N,force_h0p100_dt0p0003125_N,force_h0p200_dt0p00015625_N,force_h0p200_dt0p000625_N,spatial_difference_h0p400_dt0p0003125_percent,spatial_difference_h0p200_dt0p0003125_percent,temporal_difference_h0p200_dt0p0003125_percent,temporal_difference_h0p200_dt0p000625_percent -1.25,0.2,68.15018140000001,67.9673104,68.32507899999999,67.8391746,72.2422804,-0.25597862828666473,-0.5236270564721716,0.18888172026785752,6.490506150704244 -3.5,0.2,52.3714018,52.35406759999999,52.345151599999994,52.3533266,53.9582166,0.0501482930083001,0.01703309614638552,0.0014153828383290867,3.0654976564564618 +1.25,0.2,67.93431739999998,67.9888416,68.3487458,67.903498,69.497535,-0.6063438255512507,-0.5265703061372087,0.12568365771083198,2.3475035115274916 +3.5,0.2,52.36749339999999,52.3630118,52.342603399999994,52.3527778,53.2401192,0.0475520864137837,0.03899003617387512,0.01954815089105754,1.6949270645959955 diff --git a/validation/experiments/bergdahl/refinement_summary.json b/validation/experiments/bergdahl/refinement_summary.json index f5f934c3..4dcdae59 100644 --- a/validation/experiments/bergdahl/refinement_summary.json +++ b/validation/experiments/bergdahl/refinement_summary.json @@ -4,34 +4,34 @@ "temporal_reference_time_step_s": 0.00015625, "primary_nominal_element_length_m": 0.2, "primary_time_step_s": 0.0003125, - "maximum_primary_spatial_difference_percent": 0.5236270564721716, - "maximum_primary_temporal_difference_percent": 0.18888172026785752, + "maximum_primary_spatial_difference_percent": 0.5265703061372087, + "maximum_primary_temporal_difference_percent": 0.12568365771083198, "rows": [ { "period_s": 1.25, "radius_m": 0.2, - "force_h0p400_dt0p0003125_N": 68.15018140000001, - "force_h0p200_dt0p0003125_N": 67.9673104, - "force_h0p100_dt0p0003125_N": 68.32507899999999, - "force_h0p200_dt0p00015625_N": 67.8391746, - "force_h0p200_dt0p000625_N": 72.2422804, - "spatial_difference_h0p400_dt0p0003125_percent": -0.25597862828666473, - "spatial_difference_h0p200_dt0p0003125_percent": -0.5236270564721716, - "temporal_difference_h0p200_dt0p0003125_percent": 0.18888172026785752, - "temporal_difference_h0p200_dt0p000625_percent": 6.490506150704244 + "force_h0p400_dt0p0003125_N": 67.93431739999998, + "force_h0p200_dt0p0003125_N": 67.9888416, + "force_h0p100_dt0p0003125_N": 68.3487458, + "force_h0p200_dt0p00015625_N": 67.903498, + "force_h0p200_dt0p000625_N": 69.497535, + "spatial_difference_h0p400_dt0p0003125_percent": -0.6063438255512507, + "spatial_difference_h0p200_dt0p0003125_percent": -0.5265703061372087, + "temporal_difference_h0p200_dt0p0003125_percent": 0.12568365771083198, + "temporal_difference_h0p200_dt0p000625_percent": 2.3475035115274916 }, { "period_s": 3.5, "radius_m": 0.2, - "force_h0p400_dt0p0003125_N": 52.3714018, - "force_h0p200_dt0p0003125_N": 52.35406759999999, - "force_h0p100_dt0p0003125_N": 52.345151599999994, - "force_h0p200_dt0p00015625_N": 52.3533266, - "force_h0p200_dt0p000625_N": 53.9582166, - "spatial_difference_h0p400_dt0p0003125_percent": 0.0501482930083001, - "spatial_difference_h0p200_dt0p0003125_percent": 0.01703309614638552, - "temporal_difference_h0p200_dt0p0003125_percent": 0.0014153828383290867, - "temporal_difference_h0p200_dt0p000625_percent": 3.0654976564564618 + "force_h0p400_dt0p0003125_N": 52.36749339999999, + "force_h0p200_dt0p0003125_N": 52.3630118, + "force_h0p100_dt0p0003125_N": 52.342603399999994, + "force_h0p200_dt0p00015625_N": 52.3527778, + "force_h0p200_dt0p000625_N": 53.2401192, + "spatial_difference_h0p400_dt0p0003125_percent": 0.0475520864137837, + "spatial_difference_h0p200_dt0p0003125_percent": 0.03899003617387512, + "temporal_difference_h0p200_dt0p0003125_percent": 0.01954815089105754, + "temporal_difference_h0p200_dt0p000625_percent": 1.6949270645959955 } ] } From 6a997e561ed30f34a25b3103af7cf85a94c2c7c6 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sat, 17 Oct 2026 13:41:20 +0900 Subject: [PATCH 2/5] fix(dynamics): tighten the EI = 0 sub-stepping paths and their reports The halves of a line-system step that CD_Step_System halved after a failure now take their steps as given (CD_Step_Model as_given), as the rungs of the recovering step do, and the system rollback restores the run audit's largest solver step with the line state. A step whose sub-step fails now keeps the plain step's own converged result instead of solving it a third time. The turn trigger counts a segment that ends the step above 1e-3 of the largest step-start tension, the audit's floor. Counting only segments taut at both ends, as the review suggested, left the Lozon semitaut anchor peaks 5 % high on average and up to 25 % high in single runs, so the trigger keeps segments that were slack at the step start. The strains use the step's own unstretched lengths, and a comment marks where a length that changes within the step would need its step-start value. The counts are visible on every route: OpenFAST and FAST.Farm print them at the end of the run, CD_AGG_Get_Substep_Counts and CD_Get_System_Substep_Counts return them, and the standalone driver notes once per run that the monolithic body/point step is not sub-stepped. Tests cover the snap-only trigger, the re-measure path, the failing sub-step fallback (equal to off bit for bit), the ei0_substep_max cap, and the complete restore of the viscoelastic, Syrope and seabed friction states, through test-only hooks. The slack-dynamics bounds are widened around the measured peaks. Figures with the final build: the 80 m heave maxima are 3.8 / 7.7 % low, the 200 m semitaut anchor maxima 1.4 / 2.6 % low and the 80 m surge maxima 1.8 % low / 1.4 % high, over seven runs. The Bergdahl records, the L2-2 parity and the shipped examples match the previous commit. The 20-run mooring envelope takes 1.63 times as long (1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s motions, 4 to 7 sub-steps). The docs, CHANGELOG, VALIDATION and ARCHITECTURE now give these figures. Signed-off-by: Jae Hoon Seo --- ARCHITECTURE.md | 9 +- CHANGELOG.md | 43 ++- VALIDATION.md | 9 +- doc/modeling.rst | 8 + doc/options.rst | 15 +- doc/theory.rst | 21 +- doc/troubleshooting.rst | 15 +- src/CableDyn_DeckDriver.f90 | 8 + src/CableDyn_Model.f90 | 249 +++++++++++------- src/CableDyn_OpenFAST_Aggregate.f90 | 16 +- src/CableDyn_System.f90 | 28 +- src/openfast/CableDyn_OF.f90 | 14 +- tests/test_ei0_slack_dynamics.f90 | 15 +- tests/test_model.f90 | 140 +++++++++- tests/test_syrope.f90 | 116 +++++++- .../experiments/bergdahl/provenance.json | 2 +- 16 files changed, 571 insertions(+), 137 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index e7e2c77a..173881ab 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -193,7 +193,14 @@ The effective tangent is `(1 − α_m)/(β Δt²) M + (1 − α_f) K_q + 1e-14, 30 iterations, 12 backtracks. A non-converged step, or on the Hermite path an under-resolved one, is repeated by internal subdivision (4, 16, … up to `recovery_max_substeps`) along a C² quintic boundary trajectory that ends on the -host time. +host time. On `EI = 0` lines `CD_Step_Model` also re-solves a converged step in +`max(4, ceil(turn/ei0_substep_angle))` sub-steps on the same trajectory when a +taut segment turned by more than `ei0_substep_angle` or a slack segment snapped +taut (`ei0_substeps auto`, the default; at most `ei0_substep_max`). It restores +the committed kinematics and constitutive and friction states first and keeps +the plain step when a sub-step fails. The sub-steps of a recovered step, the +halves of a line-system step halved by `CD_Step_System`, and the monolithic +body/point step are taken as given. ### Bodies, rods, and points diff --git a/CHANGELOG.md b/CHANGELOG.md index 24d79c07..27c53753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -171,8 +171,9 @@ All notable changes to CableDyn are recorded in this file. The format follows - Tension-only (`EI = 0`) lines resolve fast segment rotation and slack-to-taut snaps by sub-stepping, on by default (new OPTIONS `ei0_substeps auto|off`, `ei0_substep_angle` (default 1°) and `ei0_substep_max` (default 16)). A converged step in which a segment that - ends it taut turned by more than `ei0_substep_angle`, or a segment slack at its start ends it - above a quarter of the largest step-start tension, is solved again from the same committed + ends it taut (above 0.1 % of the largest step-start tension) turned by more than + `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of that + tension, is solved again from the same committed state in `max(4, ceil(turn/angle))` equal sub-steps, at most `ei0_substep_max`, with the end motion on the quintic of the recovering step and the last sub-step on the given end state; output and coupling times are unchanged. At `dtM` 0.1 s a taut segment of the Lozon 80 m @@ -186,26 +187,37 @@ All notable changes to CableDyn are recorded in this file. The format follows the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge from 16 and 26 % high to 1.4 and 2.6 % low. A single run at that step varies by 15 to 20 points, so a single comparison can make either blend look accurate. The decision depends only on the committed state and the - step inputs, so restarts repeat it; a sub-step that does not converge returns the plain - step. It applies on every route that steps `EI = 0` lines (standalone lines and line systems, - OpenFAST, FAST.Farm and the C API, whose raw lines always take it) except the monolithic body - and point coupling, which needs the end reaction and tangent of the nominal step. `False - alpha_force_blend` (paper mode) turns it off unless the deck sets it, so the paper - reproduction is unchanged. The standalone driver reports the sub-stepped steps per line, and - its segment-turn note now measures the turn per solver step and states that peaks come out 10 - to 20 % low near 6° per step. Over the shipped examples 19 of the 21 `EI = 0` dynamic decks + step inputs, so restarts repeat it; when a sub-step does not converge the plain step's own + result is kept, and a step recovered after a stall or a half of a line-system step halved + after a failure takes its sub-steps as given. It applies on every route that steps `EI = 0` + lines (standalone lines and line systems, OpenFAST, FAST.Farm and the C API, whose raw lines + always take it) except the monolithic body and point coupling, which needs the end reaction + and tangent of the nominal step; the standalone driver notes that exclusion once per run. + `False alpha_force_blend` (paper mode) turns it off unless the deck sets it, so the paper + reproduction is unchanged. The standalone driver reports the sub-stepped steps per line, + OpenFAST and FAST.Farm print the counts (steps sub-stepped, largest count, steps that needed + more than `ei0_substep_max`, steps that kept the plain step) at the end of the run, and + `CD_AGG_Get_Substep_Counts` returns them to an aggregate host. The segment-turn note now + measures the turn per solver step and states that peaks come out 10 to 20 % low near 6° per + step. Over the shipped examples 19 of the 21 `EI = 0` dynamic decks are unchanged bit for bit; in the two `als_volturnus` line-break decks the pre-failure anchor snap at 250 s, a single-step peak at `dtM` 0.05 s, moves from 2.145 to 1.918 MN (1.963 MN converged) and from 2.262 to 2.158 MN (2.334 MN converged), with the other tension - statistics within 0.02 %. The 20-run Lozon mooring envelope at `dtM` 0.1 s takes 1.65 times - as long (at most 2.6 times; the steps that do not trigger cost nothing extra), and the + statistics within 0.02 %. The 20-run Lozon mooring envelope at `dtM` 0.1 s takes 1.63 times + as long (1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s motions; the steps that do not + trigger cost only the measurement), and the examples whose steps never trigger run as before. Of the reproducers of the force-blend entry below, the semi-taut chain–polyester leg in 15 m surge now peaks at 4.65 MN at the anchor at `dtM` 0.05 s (5.74 MN before, 4.6 MN at 0.0025 s), the Syrope line at 1.82 MN (1.64 MN before, 1.78 MN at 1 and 2.5 ms), the lightly damped viscoelastic light cable at 0.092 MN (0.085 MN before, 0.082 to 0.095 MN at 0.5 to 2.5 ms) and the shipped viscoelastic polyester at 1.80 MN as before; the light cable stays at 0.092 / 0.106 MN at `dtM` 0.1 s and - its largest segment tension at `dtM` 0.01 s moves from 0.107 to 0.095 MN. Validation: the + its largest segment tension at `dtM` 0.01 s moves from 0.107 to 0.095 MN. Its fairlead and + anchor peaks at `dtM` 2.5 ms move from 0.099 / 0.091 to 0.102 / 0.119 MN, and on the stiff + seabed at `dtM` 0.05 s from 0.52 / 0.67 to 0.62 / 0.86 MN; the snap peaks of this light, + stiff cable keep rising as the step is refined (0.14 to 0.23 / 0.14 to 0.19 MN over seven + runs at 0.125 ms and 0.26 to 0.31 / 0.29 to 0.34 MN over four at 0.05 ms, with plain steps), + so none of these is a converged peak. Validation: the Bergdahl matrix gives RMSE 1.59 N (1.58 N), MAPE 3.13 %, Pearson 0.993 and Lin concordance 0.989, with mesh and time-step halving moving the cycle maxima by at most 0.53 % and 0.13 % (0.52 % and 0.19 %); the WD0050/A2 cell of the L2-2 parity moves within its recorded range @@ -455,7 +467,10 @@ All notable changes to CableDyn are recorded in this file. The format follows `EI = 0` dynamic decks (one more force evaluation per step and about 4 % more Newton iterations). `False alpha_force_blend`, which until now applied to finite-EI lines only, selects the former scheme for `EI = 0` lines as well. Lines that the C API builds without a - deck (`CableDyn_InitLine`, `CableDyn_InitLines`) always take the force blend. + deck (`CableDyn_InitLine`, `CableDyn_InitLines`) always take the force blend. The figures + of this entry take every step as given, as `off ei0_substeps` now does; the rotation- and + snap-resolved sub-steps of the default (under Changed) move the snap peaks among them, for + example the chain–polyester anchor to 4.65 MN and the viscoelastic light cable to 0.092 MN. - `modified_newton` on `EI = 0` lines (with or without the force blend, so also under `False alpha_force_blend`) rebuilds the tangent when an iterate reduces the residual by less than a factor four, as the manual states; it had kept the first tangent for the whole step, diff --git a/VALIDATION.md b/VALIDATION.md index 0aa7c4e0..44f084d1 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -688,10 +688,11 @@ feedback re-converge each step (three-seed DLC-1.1, L4-1b, <0.6%). chain–polyester moorings are driven through the same surge-and-heave envelope at `dtM = 0.1 s` (72 s each). All 20 runs complete. With the default `ei0_substeps auto`, the steps in which a taut segment turns by more than 1° or a segment snaps taut are -solved in 4 to 8 sub-steps: none to 3% of the steps in the 3 m / 10 s and 8 m / 20 s -motions, 31–74% in the 5 m / 7 s and 10 m / 14 s ones. The march takes 0.25–1.0 ms of -wall time per 0.1 s step for the all-chain mooring and 0.35–1.3 ms for the composite, -1.65 times the plain steps over the 20 runs (at most 2.6 times), and the recovering step +solved in 4 to 7 sub-steps: none to 3% of the steps in the 3 m / 10 s and 8 m / 20 s +motions, 31–74% in the 5 m / 7 s and 10 m / 14 s ones. The march takes 0.24–0.94 ms of +wall time per 0.1 s step for the all-chain mooring and 0.32–1.2 ms for the composite, +1.63 times the plain steps over the 20 runs (1.6 to 2.5 times on the 5 m / 7 s and +10 m / 14 s motions), and the recovering step subdivides at most 12 of the 720 intervals of a run. **Coupled OpenFAST sea states.** In the full IEA-15 MW VolturnUS-S model with diff --git a/doc/modeling.rst b/doc/modeling.rst index 2ce56278..e923c9de 100644 --- a/doc/modeling.rst +++ b/doc/modeling.rst @@ -140,6 +140,14 @@ only because its stability limit forces a step of that size; the implicit solver (Orcina) shows a similar plateau (about 0.5 %). When snap-tension histories matter, use the coarsest mesh that resolves the line shape and refine ``dtM`` toward :math:`l/(2c)`, rather than refining both. +At a much coarser ``dtM`` the step no longer resolves the rotation of the line during a snap, +and the peaks follow the algorithmic damping (10 to 20 % low at 6° of segment turn per step). +By default (``ei0_substeps auto``) such steps of an ``EI = 0`` line are solved in sub-steps, +which brings the Lozon mooring snap peaks at ``dtM = 0.1 s`` within 8 % on average; single +peaks at that step still vary by 15 to 20 points with tiny changes of the motion, so compare +ensembles or refine ``dtM`` before drawing conclusions from one peak. The driver reports the +sub-stepped steps per line and notes a turn per step it did not resolve (see +:doc:`options`, ``ei0_substeps``). 6. Establish the static initial condition ----------------------------------------- diff --git a/doc/options.rst b/doc/options.rst index f11f2fbf..77365207 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -357,7 +357,8 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver`` - word - ``auto``; ``off`` with ``False alpha_force_blend`` - ``auto`` or ``off``. ``auto``: a converged step of an ``EI = 0`` line in which a segment - that ends the step taut turned by more than ``ei0_substep_angle``, or a segment slack at + that ends the step taut (above 0.1 % of the largest step-start tension) turned by more + than ``ei0_substep_angle``, or a segment slack at the start of the step ended it above a quarter of the largest step-start tension, is solved again from the same committed state in ``max(4, ceil(turn/ei0_substep_angle))`` equal sub-steps (at most ``ei0_substep_max``). The end motion inside the step follows @@ -366,11 +367,13 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver`` Lozon 80 m all-chain mooring turns by up to 6 deg per step in 5 m / 7 s heave, and both generalised-α blends then give snap-load peaks 10 to 20 % low; with ``auto`` they are 4 % and 8 % low on average, within 4 % of the converged run sampled at the same 0.1 s output - times, at 2 to 2.5 times the wall time of the plain steps on the severe cases (1.65 times - over the 20-case Lozon mooring envelope). ``off`` takes every step as given, as before - this option. Steps of the monolithic body - and point coupling (``monolithic bodyScheme``) are never sub-stepped. The standalone - driver reports the sub-stepped steps per line. See :doc:`theory` + times, at 1.6 to 2.5 times the wall time of the plain steps on the 5 m / 7 s and + 10 m / 14 s motions (1.63 times over the 20-case Lozon mooring envelope). If a sub-step + does not converge, the plain step's own result is kept. ``off`` takes every step as + given, as before this option. Steps of the monolithic body and point coupling + (``monolithic bodyScheme``) are never sub-stepped, and the standalone driver notes it + once per run. The standalone driver reports the sub-stepped steps per line, and OpenFAST + and FAST.Farm runs report them at the end of the run. See :doc:`theory` - both (``EI = 0`` lines) - ``off ei0_substeps`` * - ``ei0_substep_angle`` / ``ei0substepangle`` diff --git a/doc/theory.rst b/doc/theory.rst index fac90e9f..2b226e5d 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1658,19 +1658,23 @@ partly subdivided state is ever committed. **Rotation- and snap-resolved sub-steps** (``ei0_substeps auto``, the default). A converged ``EI = 0`` step is measured against its committed start: the largest chord turn -:math:`\theta` of a segment that ends the step taut, and whether a segment slack at the start -ends above a quarter of the largest step-start tension :math:`T_\text{max}` (tensions from the -static ``EA``). When :math:`\theta` exceeds ``ei0_substep_angle`` +:math:`\theta` of a segment that ends the step above :math:`10^{-3}\,T_\text{max}`, the +largest step-start tension (tensions from the static ``EA`` and the step's unstretched +lengths), and whether a segment slack at the start ends above :math:`T_\text{max}/4`. A +segment slack at the step start counts for the turn: counting only segments taut at both ends +of the step left the Lozon semitaut anchor peaks (below) up to 5 % high on average and up to +25 % high in single runs. When :math:`\theta` exceeds ``ei0_substep_angle`` :math:`\theta_s` (default 1°), or such a snap occurred, the interval is solved again from the same committed state, constitutive and friction states included, in :math:`n = \max(4, \lceil\theta/\theta_s\rceil)` equal sub-steps, at most ``ei0_substep_max`` (default 16), with the prescribed motion on the quintic trajectory of the recovery above and the last sub-step on the target state. The trial step under-turns a line whose rotation it does not resolve, so the sub-stepped interval is measured again; when its turn needs more sub-steps -it is solved once more with them. If a sub-step does not converge, the plain step is solved -again and kept. The decision uses only the committed state and the step inputs, so a restart -repeats it, and the host time grid, output and coupling times are unchanged. Every route that -steps ``EI = 0`` lines uses it (standalone lines and line systems, OpenFAST, FAST.Farm and the +it is solved once more with them. If a sub-step does not converge, the plain step's own +result is kept. A step recovered after a stall (above) and the halves of a line-system step +halved after a failure take their sub-steps as given. The decision uses only the committed +state and the step inputs, so a restart repeats it, and the host time grid, output and +coupling times are unchanged. Every route that steps ``EI = 0`` lines uses it (standalone lines and line systems, OpenFAST, FAST.Farm and the C API), except the monolithic body and point coupling, whose junction Newton needs the end reaction and condensed end tangent of the nominal step; ``off`` takes every step as given, and ``False alpha_force_blend`` turns it off unless the deck sets it. @@ -1690,7 +1694,8 @@ Two or three sub-steps of a step that turned by 1 to 3° left those anchor peaks average (up to 22 %); four bring them within 3 %, hence the minimum. Resolving the sub-steps of a step recovered after a stall as well left them 9 % high, so the recovery takes its sub-steps as given. Over the 20 motions of the Lozon mooring envelope at ``dtM`` 0.1 s the march takes -1.65 times as long as with plain steps, 2 to 2.5 times on the severe motions. +1.63 times as long as with plain steps, 1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s +motions. **Step size.** Being implicit, the scheme is not bound by the explicit axial-wave limit. In the snap-load verification a slack line snapping to about 10 MN integrates stably at diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index 807ccadd..77bdf33f 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -578,14 +578,21 @@ Warnings and notes that do not stop a run snap-load peaks come out 10 to 20 % low with either generalised-α blend. With ``off ei0_substeps`` set ``auto`` (the default) or reduce ``dtM``; with ``auto`` the note means steps it did not resolve (more than ``ei0_substep_max`` needed, a step recovered - after a stall, whose recovery sub-steps are taken as given, or the monolithic body and - point coupling, which is not sub-stepped): reduce ``dtM``. + after a stall or a half of a line-system step halved after a failure, whose sub-steps + are taken as given, a step that kept its plain result because a sub-step failed, or the + monolithic body and point coupling, which is not sub-stepped): reduce ``dtM``. * - ``Note: line ...: ei0_substeps auto solved ... of ... solver step(s) in sub-steps`` - information: the steps in which a taut segment turned by more than ``ei0_substep_angle`` or a segment snapped from slack to taut were solved in sub-steps (see ``ei0_substeps``). A companion note counts the steps that needed more than - ``ei0_substep_max`` sub-steps, and another the steps that kept the whole step because a - sub-step did not converge. + ``ei0_substep_max`` sub-steps, and another the steps that kept the plain step's result + because a sub-step did not converge. OpenFAST and FAST.Farm print the same counts, summed + over the lines, as ``CableDyn: ei0_substeps auto solved ...`` at the end of the run. + * - ``Note: ei0_substeps auto does not sub-step the EI = 0 lines of the monolithic body/point step`` + - information, once per run of a deck with ``monolithic bodyScheme`` coupling: the lines + stepped inside the body and point junction are taken at ``dtM`` as given, so their + rotation and snaps are resolved only as far as ``dtM`` resolves them. Reduce ``dtM`` when + the segment-turn note above appears for them. * - ``Note: line ...: ... segment step(s) went from slack to taut above the initial tension`` - snap loads on an ``EI = 0`` line at a solver step that does not resolve the axial wave over a segment: the peak is set by a single step. A 15 m surge of a semi-taut diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index e432dc36..a3df3c59 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -18045,6 +18045,14 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod IF (mb%implicit .AND. mb%n_steps_imp > 0) THEN WRITE (*, '(A,F6.2,A,I0,A,I0)') ' Monolithic body/point step: mean outer iterations ', & REAL(mb%n_outer, wp)/REAL(mb%n_steps_imp, wp), ', max ', mb%max_outer, ', step halvings ', mb%n_subdiv + ! the junction Newton needs the nominal step's end reaction and tangent, so ei0_substeps + ! auto leaves these line steps whole (noted once per run) + IF (mb%has_sys) THEN + IF (ANY(mb%system%lines(:)%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO)) & + WRITE (*, '(A)') ' Note: ei0_substeps auto does not sub-step the EI = 0 lines of the monolithic '// & + 'body/point step (it needs the end reaction and tangent of the whole step); reduce dtM to resolve '// & + 'their rotation and snaps.' + END IF END IF CALL CD_Classify_Dynamic_Completion('multibody dynamic run', nstep, miss_count, max_consecutive_miss, & first_miss_time, last_miss_time, converged, ErrStat, ErrMsg) diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index a0dc4a87..ea5d2bd2 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -69,6 +69,7 @@ MODULE CableDyn_Model PUBLIC :: CD_Init_Line_Model PUBLIC :: CD_Step_Model PUBLIC :: CD_Step_Model_Recovering + PUBLIC :: CD_Get_Model_Substep_Counts PUBLIC :: CD_End_Model PUBLIC :: CD_Model_NCoupledDOF PUBLIC :: CD_Model_NDOF @@ -113,12 +114,16 @@ MODULE CableDyn_Model INTEGER, PARAMETER, PUBLIC :: CD_MODEL_NOT_INITIALIZED = 3 INTEGER, PARAMETER, PUBLIC :: CD_MODEL_ALLOCFAIL = 4 INTEGER, PARAMETER :: MODEL_DEFAULT_MAX_SUBSTEPS = 1024 - ! Rotation- and snap-resolved sub-stepping (CD_Step_Model, cfg%ei0_substeps): every segment - ! that ends the step taut counts for the turn; one slack at the step start that ends above - ! SUB_SNAP_FRACTION of the largest step-start tension is a snap. A step solved in sub-steps takes at least SUB_SNAP_STEPS of them: on the Lozon - ! semitaut line two or three sub-steps of a step that turned 1 to 3 deg left the anchor snap - ! peaks 8 % high on average (up to 22 %), four brought them within 3 % of the converged run. - REAL(wp), PARAMETER :: SUB_SNAP_FRACTION = 0.25_wp + ! Rotation- and snap-resolved sub-stepping (CD_Step_Model, cfg%ei0_substeps): a segment that + ! ends the step taut above SUB_TAUT_FRACTION of the largest step-start tension counts for the + ! turn (the run audit's floor, relative to the step-start tension because only the standalone + ! driver knows the initial one), also when it was slack at the start: counting only segments + ! taut at both ends left the Lozon semitaut anchor snap peaks up to 25 % high. One slack at + ! the step start that ends above SUB_SNAP_FRACTION of that tension is a snap. A step solved + ! in sub-steps takes at least SUB_SNAP_STEPS of them: on the Lozon semitaut line two or three + ! sub-steps of a step that turned 1 to 3 deg left the anchor snap peaks 8 % high on average + ! (up to 22 %), four brought them within 3 % of the converged run. + REAL(wp), PARAMETER :: SUB_TAUT_FRACTION = 1.0e-3_wp, SUB_SNAP_FRACTION = 0.25_wp INTEGER, PARAMETER :: SUB_SNAP_STEPS = 4 TYPE :: CD_ModelType @@ -327,8 +332,21 @@ MODULE CableDyn_Model ! sub_fallbacks those that returned to the plain step after a sub-step failed. The sub_* ! arrays are scratch: the step-start snapshot and the sub-step boundary motion. INTEGER :: sub_calls = 0, sub_events = 0, sub_max_used = 1, sub_capped = 0, sub_fallbacks = 0 - REAL(wp), ALLOCATABLE :: sub_q0(:), sub_v0(:), sub_a0(:), sub_pq(:), sub_pv(:), sub_pa(:) - REAL(wp), ALLOCATABLE :: sub_ve_dl_1(:), sub_syrope_slow(:), sub_syrope_tmax(:), sub_fr_anchor(:, :) + ! sub_remeasured: steps whose sub-stepped interval needed more sub-steps and was solved again + INTEGER :: sub_remeasured = 0 + ! audit_hmax at the last save of the system-rollback state (CableDyn_System) + REAL(wp) :: audit_hmax_rollback = CD_ZERO + ! slot 1: the committed state at the step start; slot 2: the state the plain step reached + REAL(wp), ALLOCATABLE :: sub_q(:, :), sub_v(:, :), sub_a(:, :), sub_pq(:), sub_pv(:), sub_pa(:) + REAL(wp), ALLOCATABLE :: sub_ve_dl_1(:, :), sub_syrope_slow(:, :), sub_syrope_tmax(:, :) + REAL(wp), ALLOCATABLE :: sub_fr_anchor(:, :, :) + ! TEST-ONLY hooks of the sub-stepping, never set by a production caller: sub_test_fail > 0 + ! makes sub-step number sub_test_fail of every sub-stepped pass report a failure, and + ! sub_test_repeat solves the first sub-stepped pass twice (the second from the restored + ! committed state), which must not change the result; sub_test_more makes the re-measure of + ! every sub-stepped interval ask for one more sub-step. + INTEGER :: sub_test_fail = 0 + LOGICAL :: sub_test_repeat = .FALSE., sub_test_more = .FALSE. END TYPE CD_ModelType CONTAINS @@ -1863,7 +1881,7 @@ SUBROUTINE CD_Init_Line_Model(model, anchor, fairlead, line_types, sections, gra END SUBROUTINE CD_Init_Line_Model SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & - prescribed_q, prescribed_v, prescribed_a) + prescribed_q, prescribed_v, prescribed_a, as_given) !! Advance the persistent model over dt. Optional prescribed_q/v/a arrays are full !! model-sized vectors at the end of the step; only entries in model%fixed_dofs are !! consumed by CableDyn_Dynamic. On successful or stalled dynamics returns, the model owns @@ -1872,30 +1890,34 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, !! !! Rotation- and snap-resolved sub-stepping (cfg%ei0_substeps = CD_EI0_SUBSTEPS_AUTO, the !! default): the step is solved as given; when it converges and a segment that ends it taut - !! turned by more than cfg%ei0_substep_angle degrees, or a segment slack at its start ends - !! it above SUB_SNAP_FRACTION of the largest step-start tension, the interval is solved - !! again from the same committed state in n = max(SUB_SNAP_STEPS, ceil(turn/angle)) equal - !! sub-steps, at most cfg%ei0_substep_max. The trial step under-turns a line whose rotation - !! it does not resolve, so the sub-stepped interval is measured again and, when its turn - !! needs more sub-steps, solved once more with them. The prescribed end motion inside the - !! interval follows the C2 quintic of CD_Step_Model_Recovering and the last sub-step lands - !! on the given end state exactly. The decision depends only on the committed state and the - !! step's inputs, so a run restarted from a checkpoint repeats it. If a sub-step fails, the - !! plain step is solved again and returned. A step of the - !! monolithic junction coupling (the end query armed, CD_Set_Model_EndQuery) is never - !! sub-stepped: its caller needs the end reaction and tangent of the nominal step. + !! turned by more than cfg%ei0_substep_angle degrees, or a segment slack at its start ends it + !! above SUB_SNAP_FRACTION of the largest step-start tension, the interval is + !! solved again from the same committed state in n = max(SUB_SNAP_STEPS, ceil(turn/angle)) + !! equal sub-steps, at most cfg%ei0_substep_max. The trial step under-turns a line whose + !! rotation it does not resolve, so the sub-stepped interval is measured again and, when its + !! turn needs more sub-steps, solved once more with them. The prescribed end motion inside + !! the interval follows the C2 quintic of CD_Step_Model_Recovering and the last sub-step + !! lands on the given end state exactly. The decision depends only on the committed state + !! and the step's inputs, so a run restarted from a checkpoint repeats it. If a sub-step + !! fails, the plain step's own result is returned. A step of the monolithic junction + !! coupling (the end query armed, CD_Set_Model_EndQuery) is never sub-stepped: its caller + !! needs the end reaction and tangent of the nominal step. as_given = .TRUE. takes the step + !! as given as well: the stall recoveries of CD_Step_Model_Recovering and CD_Step_System, + !! whose sub-steps are themselves part of a recovery, pass it. TYPE(CD_ModelType), INTENT(INOUT) :: model REAL(wp), INTENT(IN) :: dt LOGICAL, INTENT(OUT) :: converged, stalled INTEGER, INTENT(OUT) :: n_iter, ErrStat CHARACTER(*), INTENT(OUT) :: ErrMsg REAL(wp), INTENT(IN), OPTIONAL :: prescribed_q(:), prescribed_v(:), prescribed_a(:) - INTEGER :: nsub, nsub2 + LOGICAL, INTENT(IN), OPTIONAL :: as_given + INTEGER :: nsub, nsub2, iter_trial LOGICAL :: has_pres, resolve, capped, capped2, ok has_pres = PRESENT(prescribed_q) .AND. PRESENT(prescribed_v) .AND. PRESENT(prescribed_a) resolve = model%initialized .AND. model%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO .AND. & .NOT. model%dynamic_workspace%end_request + IF (resolve .AND. PRESENT(as_given)) resolve = .NOT. as_given ! partial prescribed motion: the plain step reports the input error IF (resolve) resolve = has_pres .OR. .NOT. (PRESENT(prescribed_q) .OR. PRESENT(prescribed_v) .OR. & PRESENT(prescribed_a)) @@ -1910,7 +1932,8 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, 'ei0_substep_max in [2, 1024]') RETURN END IF - resolve = sub_snapshot(model, has_pres) + resolve = sub_alloc(model, has_pres) + IF (resolve) CALL sub_store(model, 1) END IF IF (.NOT. resolve) THEN ! absent optional arguments stay absent @@ -1931,15 +1954,21 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, model%audit_hmax = MAX(model%audit_hmax, dt) RETURN END IF + ! keep the plain step's result: it is returned should a sub-step fail + CALL sub_store(model, 2) + iter_trial = n_iter ! Solve the interval again from the committed state in nsub sub-steps. The trial step ! under-turns a line whose rotation it does not resolve, so the sub-stepped interval is ! measured again: when its turn needs more sub-steps, it is solved once more with them (and ! the first count is kept should that fail). CALL run_substeps(nsub, ok) + IF (ok .AND. model%sub_test_repeat) CALL run_substeps(nsub, ok) IF (ok) THEN CALL sub_count(model, nsub2, capped2) + IF (model%sub_test_more) nsub2 = MAX(nsub2, MIN(model%cfg%ei0_substep_max, nsub + 1)) IF (nsub2 > nsub) THEN + IF (model%sub_remeasured < HUGE(model%sub_remeasured)) model%sub_remeasured = model%sub_remeasured + 1 CALL run_substeps(nsub2, ok) IF (ok) THEN nsub = nsub2 @@ -1960,17 +1989,20 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, model%audit_hmax = MAX(model%audit_hmax, dt/REAL(nsub, wp)) RETURN END IF - ! a sub-step failed: return the plain step, solved again from the committed state - CALL sub_restore(model) - CALL step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & - prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) + ! a sub-step failed: return the plain step's own (converged) result + CALL sub_load(model, 2) + converged = .TRUE. + stalled = .FALSE. + n_iter = iter_trial + ErrStat = CD_MODEL_OK + ErrMsg = '' IF (model%sub_fallbacks < HUGE(model%sub_fallbacks)) model%sub_fallbacks = model%sub_fallbacks + 1 - IF (ErrStat == CD_MODEL_OK) model%audit_hmax = MAX(model%audit_hmax, dt) + model%audit_hmax = MAX(model%audit_hmax, dt) CONTAINS SUBROUTINE run_substeps(n, ok_run) - !! The interval from the committed state (sub_q0) in n equal sub-steps, the prescribed + !! The interval from the committed state (slot 1) in n equal sub-steps, the prescribed !! end motion on the C2 quintic of the interval, the last sub-step on the given end state. INTEGER, INTENT(IN) :: n LOGICAL, INTENT(OUT) :: ok_run @@ -1978,7 +2010,7 @@ SUBROUTINE run_substeps(n, ok_run) LOGICAL :: conv_k, stall_k REAL(wp) :: h CHARACTER(300) :: em_k - CALL sub_restore(model) + CALL sub_load(model, 1) h = dt/REAL(n, wp) ok_run = .TRUE. DO k = 1, n @@ -1988,15 +2020,16 @@ SUBROUTINE run_substeps(n, ok_run) model%sub_pv = prescribed_v model%sub_pa = prescribed_a ELSE - CALL quintic_model_boundary_state(model%sub_q0, model%sub_v0, model%sub_a0, prescribed_q, & - prescribed_v, prescribed_a, dt, REAL(k, wp)/REAL(n, wp), & - model%sub_pq, model%sub_pv, model%sub_pa) + CALL quintic_model_boundary_state(model%sub_q(:, 1), model%sub_v(:, 1), model%sub_a(:, 1), & + prescribed_q, prescribed_v, prescribed_a, dt, & + REAL(k, wp)/REAL(n, wp), model%sub_pq, model%sub_pv, model%sub_pa) END IF CALL step_model_plain(model, h, conv_k, stall_k, it_k, es_k, em_k, prescribed_q=model%sub_pq, & prescribed_v=model%sub_pv, prescribed_a=model%sub_pa) ELSE CALL step_model_plain(model, h, conv_k, stall_k, it_k, es_k, em_k) END IF + IF (k == model%sub_test_fail) conv_k = .FALSE. IF (es_k /= CD_MODEL_OK .OR. .NOT. conv_k) THEN ok_run = .FALSE. RETURN @@ -2006,84 +2039,99 @@ SUBROUTINE run_substeps(n, ok_run) END SUBROUTINE run_substeps END SUBROUTINE CD_Step_Model - LOGICAL FUNCTION sub_snapshot(model, has_pres) RESULT(ok) - !! Snapshot the committed state into the sub-stepping scratch (allocated on first use): - !! the kinematics and the viscoelastic, Syrope and friction states a step commits. .FALSE. - !! when the scratch cannot be allocated (the step is then taken as given). + LOGICAL FUNCTION sub_alloc(model, has_pres) RESULT(ok) + !! Allocate the sub-stepping scratch on first use: two slots of the state a step commits + !! (the kinematics and the viscoelastic, Syrope and friction states) and the sub-step + !! boundary motion. .FALSE. when it cannot be allocated (the step is then taken as given). TYPE(CD_ModelType), INTENT(INOUT) :: model LOGICAL, INTENT(IN) :: has_pres INTEGER :: istat ok = .FALSE. istat = 0 - IF (.NOT. sized1(model%sub_q0, model%n_dof)) THEN - IF (ALLOCATED(model%sub_q0)) DEALLOCATE (model%sub_q0, model%sub_v0, model%sub_a0) - ALLOCATE (model%sub_q0(model%n_dof), model%sub_v0(model%n_dof), model%sub_a0(model%n_dof), STAT=istat) + IF (.NOT. sized2(model%sub_q, model%n_dof)) THEN + IF (ALLOCATED(model%sub_q)) DEALLOCATE (model%sub_q, model%sub_v, model%sub_a) + ALLOCATE (model%sub_q(model%n_dof, 2), model%sub_v(model%n_dof, 2), model%sub_a(model%n_dof, 2), STAT=istat) IF (istat /= 0) RETURN END IF - IF (has_pres .AND. .NOT. sized1(model%sub_pq, model%n_dof)) THEN - IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq, model%sub_pv, model%sub_pa) - ALLOCATE (model%sub_pq(model%n_dof), model%sub_pv(model%n_dof), model%sub_pa(model%n_dof), STAT=istat) - IF (istat /= 0) RETURN + IF (has_pres) THEN + IF (ALLOCATED(model%sub_pq)) THEN + IF (SIZE(model%sub_pq) /= model%n_dof) DEALLOCATE (model%sub_pq, model%sub_pv, model%sub_pa) + END IF + IF (.NOT. ALLOCATED(model%sub_pq)) THEN + ALLOCATE (model%sub_pq(model%n_dof), model%sub_pv(model%n_dof), model%sub_pa(model%n_dof), STAT=istat) + IF (istat /= 0) RETURN + END IF END IF - IF (model%has_viscoelastic .AND. .NOT. sized1(model%sub_ve_dl_1, SIZE(model%ve_dl_1))) THEN + IF (model%has_viscoelastic .AND. .NOT. sized2(model%sub_ve_dl_1, SIZE(model%ve_dl_1))) THEN IF (ALLOCATED(model%sub_ve_dl_1)) DEALLOCATE (model%sub_ve_dl_1) - ALLOCATE (model%sub_ve_dl_1(SIZE(model%ve_dl_1)), STAT=istat) + ALLOCATE (model%sub_ve_dl_1(SIZE(model%ve_dl_1), 2), STAT=istat) IF (istat /= 0) RETURN END IF - IF (model%has_syrope .AND. .NOT. sized1(model%sub_syrope_slow, SIZE(model%syrope_slow))) THEN + IF (model%has_syrope .AND. .NOT. sized2(model%sub_syrope_slow, SIZE(model%syrope_slow))) THEN IF (ALLOCATED(model%sub_syrope_slow)) DEALLOCATE (model%sub_syrope_slow, model%sub_syrope_tmax) - ALLOCATE (model%sub_syrope_slow(SIZE(model%syrope_slow)), model%sub_syrope_tmax(SIZE(model%syrope_tmax)), & - STAT=istat) + ALLOCATE (model%sub_syrope_slow(SIZE(model%syrope_slow), 2), & + model%sub_syrope_tmax(SIZE(model%syrope_tmax), 2), STAT=istat) IF (istat /= 0) RETURN END IF IF (model%has_seabed_friction) THEN IF (ALLOCATED(model%sub_fr_anchor)) THEN - IF (ANY(SHAPE(model%sub_fr_anchor) /= SHAPE(model%fr_anchor))) DEALLOCATE (model%sub_fr_anchor) + IF (SIZE(model%sub_fr_anchor, 1) /= SIZE(model%fr_anchor, 1) .OR. & + SIZE(model%sub_fr_anchor, 2) /= SIZE(model%fr_anchor, 2)) DEALLOCATE (model%sub_fr_anchor) END IF IF (.NOT. ALLOCATED(model%sub_fr_anchor)) THEN - ALLOCATE (model%sub_fr_anchor(SIZE(model%fr_anchor, 1), SIZE(model%fr_anchor, 2)), STAT=istat) + ALLOCATE (model%sub_fr_anchor(SIZE(model%fr_anchor, 1), SIZE(model%fr_anchor, 2), 2), STAT=istat) IF (istat /= 0) RETURN END IF END IF - model%sub_q0 = model%q - model%sub_v0 = model%v - model%sub_a0 = model%a - IF (model%has_viscoelastic) model%sub_ve_dl_1 = model%ve_dl_1 - IF (model%has_syrope) THEN - model%sub_syrope_slow = model%syrope_slow - model%sub_syrope_tmax = model%syrope_tmax - END IF - IF (model%has_seabed_friction) model%sub_fr_anchor = model%fr_anchor ok = .TRUE. CONTAINS - LOGICAL FUNCTION sized1(x, n) RESULT(yes) - REAL(wp), ALLOCATABLE, INTENT(IN) :: x(:) + LOGICAL FUNCTION sized2(x, n) RESULT(yes) + REAL(wp), ALLOCATABLE, INTENT(IN) :: x(:, :) INTEGER, INTENT(IN) :: n yes = ALLOCATED(x) - IF (yes) yes = SIZE(x) == n - END FUNCTION sized1 - END FUNCTION sub_snapshot + IF (yes) yes = SIZE(x, 1) == n .AND. SIZE(x, 2) == 2 + END FUNCTION sized2 + END FUNCTION sub_alloc + + SUBROUTINE sub_store(model, slot) + !! Save the state a step commits into slot 1 (the step start) or 2 (the plain step's result). + TYPE(CD_ModelType), INTENT(INOUT) :: model + INTEGER, INTENT(IN) :: slot + model%sub_q(:, slot) = model%q + model%sub_v(:, slot) = model%v + model%sub_a(:, slot) = model%a + IF (model%has_viscoelastic) model%sub_ve_dl_1(:, slot) = model%ve_dl_1 + IF (model%has_syrope) THEN + model%sub_syrope_slow(:, slot) = model%syrope_slow + model%sub_syrope_tmax(:, slot) = model%syrope_tmax + END IF + IF (model%has_seabed_friction) model%sub_fr_anchor(:, :, slot) = model%fr_anchor + END SUBROUTINE sub_store - SUBROUTINE sub_restore(model) - !! Return the model to the state sub_snapshot saved. + SUBROUTINE sub_load(model, slot) + !! Return the model to the state saved in slot (sub_store). TYPE(CD_ModelType), INTENT(INOUT) :: model - model%q = model%sub_q0 - model%v = model%sub_v0 - model%a = model%sub_a0 - IF (model%has_viscoelastic) model%ve_dl_1 = model%sub_ve_dl_1 + INTEGER, INTENT(IN) :: slot + model%q = model%sub_q(:, slot) + model%v = model%sub_v(:, slot) + model%a = model%sub_a(:, slot) + IF (model%has_viscoelastic) model%ve_dl_1 = model%sub_ve_dl_1(:, slot) IF (model%has_syrope) THEN - model%syrope_slow = model%sub_syrope_slow - model%syrope_tmax = model%sub_syrope_tmax + model%syrope_slow = model%sub_syrope_slow(:, slot) + model%syrope_tmax = model%sub_syrope_tmax(:, slot) END IF - IF (model%has_seabed_friction) model%fr_anchor = model%sub_fr_anchor - END SUBROUTINE sub_restore + IF (model%has_seabed_friction) model%fr_anchor = model%sub_fr_anchor(:, :, slot) + END SUBROUTINE sub_load SUBROUTINE sub_count(model, nsub, capped) - !! The sub-step count of a converged step (model%q) from the committed state (sub_q0): 1, or - !! max(SUB_SNAP_STEPS, ceil(turn/angle)) when turn > angle, at most cfg%ei0_substep_max - !! (capped when the turn needs more), turn the largest chord turn of a segment that ends - !! taut; at least SUB_SNAP_STEPS when a segment slack at the start ends above - !! SUB_SNAP_FRACTION of the largest step-start tension (the static EA times the strain). + !! The sub-step count of a converged step (model%q) from the committed state (slot 1): 1, + !! or max(SUB_SNAP_STEPS, ceil(turn/angle)) when turn > angle, at most cfg%ei0_substep_max + !! (capped when the turn needs more), turn the largest chord turn of a segment that ends the + !! step taut above SUB_TAUT_FRACTION of the largest step-start tension; at least + !! SUB_SNAP_STEPS when a segment slack at the start ends above SUB_SNAP_FRACTION of it. The + !! tension measure is the static EA times the strain. The strains use model%l0, the lengths + !! the step itself uses (CD_Update_Model_SegmentLength sets them before the step); a length + !! that changes within the step would need its step-start value for the start state here. TYPE(CD_ModelType), INTENT(IN) :: model INTEGER, INTENT(OUT) :: nsub LOGICAL, INTENT(OUT) :: capped @@ -2097,7 +2145,7 @@ SUBROUTINE sub_count(model, nsub, capped) DO e = 1, model%n_elem na = model%elem_conn(1, e) nb = model%elem_conn(2, e) - d0 = model%sub_q0(3*nb - 2:3*nb) - model%sub_q0(3*na - 2:3*na) + d0 = model%sub_q(3*nb - 2:3*nb, 1) - model%sub_q(3*na - 2:3*na, 1) t0max = MAX(t0max, model%ea(e)*(NORM2(d0)/model%l0(e) - CD_ONE)) END DO turn = CD_ZERO @@ -2109,10 +2157,10 @@ SUBROUTINE sub_count(model, nsub, capped) l_e = NORM2(d1) IF (.NOT. l_e > model%l0(e)) CYCLE te = model%ea(e)*(l_e/model%l0(e) - CD_ONE) - d0 = model%sub_q0(3*nb - 2:3*nb) - model%sub_q0(3*na - 2:3*na) + d0 = model%sub_q(3*nb - 2:3*nb, 1) - model%sub_q(3*na - 2:3*na, 1) l_s = NORM2(d0) IF (l_s <= model%l0(e) .AND. te > SUB_SNAP_FRACTION*t0max) snap = .TRUE. - IF (l_s > CD_ZERO) THEN + IF (te > SUB_TAUT_FRACTION*t0max .AND. l_s > CD_ZERO) THEN c = DOT_PRODUCT(d0, d1)/(l_s*l_e) turn = MAX(turn, ACOS(MAX(-CD_ONE, MIN(CD_ONE, c)))*DEG) END IF @@ -2130,6 +2178,19 @@ SUBROUTINE sub_count(model, nsub, capped) IF (snap) nsub = MAX(nsub, MIN(SUB_SNAP_STEPS, nmax)) END SUBROUTINE sub_count + SUBROUTINE CD_Get_Model_Substep_Counts(model, calls, events, max_used, capped, fallbacks) + !! Diagnostics of the rotation- and snap-resolved sub-stepping (CD_Step_Model): the steps it + !! examined, those it solved in sub-steps (the largest count used), those whose turn needed + !! more than cfg%ei0_substep_max, and those that kept the plain step after a sub-step failed. + TYPE(CD_ModelType), INTENT(IN) :: model + INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks + calls = model%sub_calls + events = model%sub_events + max_used = model%sub_max_used + capped = model%sub_capped + fallbacks = model%sub_fallbacks + END SUBROUTINE CD_Get_Model_Substep_Counts + SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q, prescribed_v, prescribed_a) !! One generalized-alpha step of the model over dt, as given (CD_Step_Model without its @@ -2582,8 +2643,9 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt CALL restore_recovery_state(model) ! the audit measures the solver steps of the rung that completes model%audit_hmax = hmax0 - ! the rungs take their sub-steps as given: resolving them as well (sub-steps of sub-steps) - ! left the anchor snap peaks of the Lozon semitaut line 9 % high on average + ! the rungs take their sub-steps as given (step_model_plain, as CD_Step_System's halving + ! does with as_given): resolving them as well (sub-steps of sub-steps) left the anchor snap + ! peaks of the Lozon semitaut line 9 % high on average subdt = dt/REAL(nsub, wp) rung_ok = .TRUE. es = CD_MODEL_OK @@ -5265,6 +5327,17 @@ SUBROUTINE clear_model_audit(model) model%audit_spike_tension = CD_ZERO model%audit_spike_ratio = CD_ZERO model%audit_hmax = CD_ZERO + model%audit_hmax_rollback = CD_ZERO + ! the sub-stepping diagnostics and test hooks start afresh with the model + model%sub_calls = 0 + model%sub_events = 0 + model%sub_max_used = 1 + model%sub_capped = 0 + model%sub_fallbacks = 0 + model%sub_remeasured = 0 + model%sub_test_fail = 0 + model%sub_test_repeat = .FALSE. + model%sub_test_more = .FALSE. END SUBROUTINE clear_model_audit SUBROUTINE CD_End_Model(model, ErrStat, ErrMsg) @@ -5302,9 +5375,9 @@ SUBROUTINE CD_End_Model(model, ErrStat, ErrMsg) IF (ALLOCATED(model%v_rollback)) DEALLOCATE (model%v_rollback) IF (ALLOCATED(model%a_rollback)) DEALLOCATE (model%a_rollback) IF (ALLOCATED(model%recovery_q0)) DEALLOCATE (model%recovery_q0) - IF (ALLOCATED(model%sub_q0)) DEALLOCATE (model%sub_q0) - IF (ALLOCATED(model%sub_v0)) DEALLOCATE (model%sub_v0) - IF (ALLOCATED(model%sub_a0)) DEALLOCATE (model%sub_a0) + IF (ALLOCATED(model%sub_q)) DEALLOCATE (model%sub_q) + IF (ALLOCATED(model%sub_v)) DEALLOCATE (model%sub_v) + IF (ALLOCATED(model%sub_a)) DEALLOCATE (model%sub_a) IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq) IF (ALLOCATED(model%sub_pv)) DEALLOCATE (model%sub_pv) IF (ALLOCATED(model%sub_pa)) DEALLOCATE (model%sub_pa) diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index 73f98480..fa2265f5 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -75,7 +75,8 @@ MODULE CableDyn_OpenFAST_Aggregate CD_Rod_ScatterHostPoints, CD_Rod_HostWrench, CD_Rod_Stage, CD_Rod_Unstage, & CD_Deck_Range_Sample_Aggregate, CD_Deck_Range_Write USE CableDyn_RangeOutput, ONLY: CD_RangeSet, CD_Range_End - USE CableDyn_System, ONLY: CD_System_NLines, CD_System_Line_NDOF, CD_Get_System_Line_State, & + USE CableDyn_System, ONLY: CD_Get_System_Substep_Counts, CD_System_NLines, CD_System_Line_NDOF, & + CD_Get_System_Line_State, & CD_Update_System_Line_SegmentLength, & CD_Update_System_Line_Hydro_Fields, CD_SYSTEM_OK, & CD_System_NHydroPoints, CD_Get_System_HydroPoint_Positions, & @@ -105,6 +106,7 @@ MODULE CableDyn_OpenFAST_Aggregate PUBLIC :: CD_AGG_CalcOutput PUBLIC :: CD_AGG_End PUBLIC :: CD_AGG_NFailures + PUBLIC :: CD_AGG_Get_Substep_Counts PUBLIC :: CD_AGG_Get_Failure_Flags, CD_AGG_Set_Failure_Flags PUBLIC :: CD_AGG_NCtrlChans, CD_AGG_Apply_LineControl PUBLIC :: CD_AGG_IsInitialized @@ -1767,6 +1769,18 @@ INTEGER FUNCTION CD_AGG_NFailures(self) RESULT(n) IF (ALLOCATED(self%failures)) n = SIZE(self%failures) END FUNCTION CD_AGG_NFailures + SUBROUTINE CD_AGG_Get_Substep_Counts(self, calls, events, max_used, capped, fallbacks) + !! The rotation- and snap-resolved sub-stepping diagnostics of the EI=0 lines of the + !! aggregate (CD_Get_System_Substep_Counts; all zero without EI=0 lines): line steps + !! examined, solved in sub-steps (max_used the largest count), beyond ei0_substep_max, and + !! kept the plain step's result after a sub-step failed. + TYPE(CD_AGG_ModuleType), INTENT(IN) :: self + INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks + calls = 0; events = 0; max_used = 1; capped = 0; fallbacks = 0 + IF (self%has_sys) CALL CD_Get_System_Substep_Counts(self%sys%fast%system, calls, events, max_used, capped, & + fallbacks) + END SUBROUTINE CD_AGG_Get_Substep_Counts + SUBROUTINE CD_AGG_End(self, ErrStat, ErrMsg) !! Release all owned resources. Idempotent by design (CD_FMF_End / CD_HFMF_End are safe !! on uninitialized members). diff --git a/src/CableDyn_System.f90 b/src/CableDyn_System.f90 index 64ef1782..eac0be5a 100644 --- a/src/CableDyn_System.f90 +++ b/src/CableDyn_System.f90 @@ -21,6 +21,7 @@ MODULE CableDyn_System CD_Get_Model_EndNodeTangent, CD_Set_Model_EndQuery, CD_Get_Model_EndQuery, & CD_Update_Model_SegmentLength, & CD_Update_Model_CoupledMotion, CD_Update_Model_Interior_State, CD_Step_Model, & + CD_Get_Model_Substep_Counts, & CD_Calc_Model_CoupledLoads, CD_Recompute_Model_Acceleration, & CD_Calc_Model_CoupledKinematicDerivatives, & CD_Calc_Model_CoupledAccelDerivative, CD_Update_Model_CoupledAccelDerivative, & @@ -47,6 +48,7 @@ MODULE CableDyn_System PUBLIC :: CD_SystemPointType PUBLIC :: CD_LineEndpointBinding PUBLIC :: CD_System_Fallback_Count + PUBLIC :: CD_Get_System_Substep_Counts PUBLIC :: CD_System_Fallback_Reset PUBLIC :: CD_System_Snapshot PUBLIC :: CD_System_Restore @@ -1312,11 +1314,13 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, CALL CD_Fatal_Thread_Init() ! this thread can report its own stack overflow !$OMP DO SCHEDULE(STATIC) DO i = 1, system%n_lines + ! the halves of a stall recovery (depth > 0) take their steps as given, as the rungs of + ! CD_Step_Model_Recovering do: no rotation- and snap-resolved sub-steps of sub-steps CALL CD_Step_Model(system%lines(i), dt, system%line_converged(i), system%line_stalled(i), & system%line_iter(i), system%line_stat(i), system%line_msg(i), & prescribed_q=system%lines(i)%q_prescribed_work, & prescribed_v=system%lines(i)%v_prescribed_work, & - prescribed_a=system%lines(i)%a_prescribed_work) + prescribed_a=system%lines(i)%a_prescribed_work, as_given=depth > 0) END DO !$OMP END DO !$OMP END PARALLEL @@ -2940,6 +2944,9 @@ SUBROUTINE save_line_states(system, ErrStat, ErrMsg) system%lines(i)%q_rollback = system%lines(i)%q system%lines(i)%v_rollback = system%lines(i)%v system%lines(i)%a_rollback = system%lines(i)%a + ! the run audit's largest solver step rolls back too: a rolled-back (stalled) full step + ! must not count when its halves are what the line commits + system%lines(i)%audit_hmax_rollback = system%lines(i)%audit_hmax ! the viscoelastic dl_1 state advances with every committed line step, so ! it must roll back with q/v/a (a line that stepped can be rolled back ! when a sibling line or the coupled point solve fails) @@ -2967,6 +2974,7 @@ SUBROUTINE restore_line_states(system) system%lines(i)%q = system%lines(i)%q_rollback system%lines(i)%v = system%lines(i)%v_rollback system%lines(i)%a = system%lines(i)%a_rollback + system%lines(i)%audit_hmax = system%lines(i)%audit_hmax_rollback IF (system%lines(i)%has_viscoelastic) & system%lines(i)%ve_dl_1 = system%lines(i)%ve_dl_1_rollback IF (system%lines(i)%has_syrope) THEN @@ -3206,6 +3214,24 @@ SUBROUTINE CD_System_Restore(system, ErrStat, ErrMsg) END IF END SUBROUTINE CD_System_Restore + SUBROUTINE CD_Get_System_Substep_Counts(system, calls, events, max_used, capped, fallbacks) + !! The rotation- and snap-resolved sub-stepping diagnostics of the EI=0 lines + !! (CD_Get_Model_Substep_Counts) summed over the lines (max_used: the largest count). + TYPE(CD_SystemType), INTENT(IN) :: system + INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks + INTEGER :: i, c, e, m, k, f + calls = 0; events = 0; max_used = 1; capped = 0; fallbacks = 0 + IF (.NOT. ALLOCATED(system%lines)) RETURN + DO i = 1, SIZE(system%lines) + CALL CD_Get_Model_Substep_Counts(system%lines(i), c, e, m, k, f) + calls = calls + c + events = events + e + max_used = MAX(max_used, m) + capped = capped + k + fallbacks = fallbacks + f + END DO + END SUBROUTINE CD_Get_System_Substep_Counts + PURE FUNCTION CD_System_Fallback_Count() RESULT(n) !! Subdivision-retry entries since the last CD_System_Fallback_Reset (see the !! module-level tripwire note). diff --git a/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90 index 9443f1b5..9ddc32dc 100644 --- a/src/openfast/CableDyn_OF.f90 +++ b/src/openfast/CableDyn_OF.f90 @@ -76,7 +76,7 @@ MODULE CableDyn CD_AGG_Step_Moving, CD_AGG_CalcOutput, CD_AGG_GetMovingPointMesh, & CD_AGG_Snapshot, CD_AGG_Restore, & CD_AGG_NMovingPoints, CD_AGG_NDynamicPoints, CD_AGG_Refresh_PointMesh, & - CD_AGG_NFailures, & + CD_AGG_NFailures, CD_AGG_Get_Substep_Counts, & CD_AGG_HasRigid6, CD_AGG_HasRod, & CD_AGG_Rigid6_MirrorSize, CD_AGG_Get_Rigid6_States, & CD_AGG_Set_Rigid6_States, & @@ -2404,6 +2404,7 @@ SUBROUTINE CD_End(u, p, x, xd, z, other, y, m, ErrStat , ErrMsg) character(*), parameter :: RoutineName = 'CD_End' INTEGER(IntKi) :: ErrStat2 INTEGER :: hn_step, hn_resid, hn_solve, hn_am, hn_alloc, hn_tan + INTEGER :: sb_calls, sb_events, sb_max, sb_capped, sb_fallbacks REAL(wp) :: ht_step, ht_resid, ht_eff, ht_solve, ht_am, ht_tan CHARACTER(ErrMsgLen) :: ErrMsg2 @@ -2413,6 +2414,17 @@ SUBROUTINE CD_End(u, p, x, xd, z, other, y, m, ErrStat , ErrMsg) IF (ALLOCATED(Inst)) THEN IF (m%CDInst >= 1 .AND. m%CDInst <= SIZE(Inst)) THEN IF (Inst(m%CDInst)%active) THEN + ! the rotation- and snap-resolved sub-steps of the EI=0 lines (ei0_substeps), as the + ! standalone driver reports them + CALL CD_AGG_Get_Substep_Counts( Inst(m%CDInst)%agg, sb_calls, sb_events, sb_max, sb_capped, & + sb_fallbacks ) + IF (sb_events > 0 .OR. sb_fallbacks > 0) THEN + CALL WrScr( ' CableDyn: ei0_substeps auto solved '//TRIM(Num2LStr(sb_events))//' of '// & + TRIM(Num2LStr(sb_calls))//' EI = 0 line step(s) in sub-steps (at most '// & + TRIM(Num2LStr(sb_max))//' per step); '//TRIM(Num2LStr(sb_capped))// & + ' needed more than ei0_substep_max; '//TRIM(Num2LStr(sb_fallbacks))// & + ' kept the whole step after a sub-step did not converge.' ) + END IF IF (Inst(m%CDInst)%prof_enabled) THEN CALL WrScr( ' CableDyn profile: init_s='// & TRIM(Num2LStr(REAL(Inst(m%CDInst)%prof_t_init, DbKi)))// & diff --git a/tests/test_ei0_slack_dynamics.f90 b/tests/test_ei0_slack_dynamics.f90 index b8a8c4a6..2f8e3739 100644 --- a/tests/test_ei0_slack_dynamics.f90 +++ b/tests/test_ei0_slack_dynamics.f90 @@ -1469,9 +1469,10 @@ SUBROUTINE case_law_slack_runs() ! the light cable as a lightly damped viscoelastic line, 3 m heave at dtM 0.1 s: anchor ! 8.2e4 to 9.5e4 N and fairlead 0.97e5 to 1.02e5 N at dtM 0.5 to 2.5 ms; without the cap ! on its law segments 1.45e5 N at the anchor. At 0.1 s the anchor snap is not resolved in - ! time (the run notes it), so its peak depends on round-off: 8.5e4 N with gfortran on - ! Windows, other values on other platforms. The upper bound is the check of the cap; the - ! lower bound only asks that the snap reaches the anchor. + ! time (the run notes it), so its peak depends on round-off: 9.2e4 N with gfortran on + ! Windows with the default sub-steps (8.5e4 N taking every step as given), other values on + ! other platforms. The upper bound is the check of the cap, well below the 1.45e5 N of the + ! uncapped law; the lower bound only asks that the snap reaches the anchor. CALL write_motion('ei0slack_heave_ve.txt', 1, [5.0_wp, 0.0_wp, -14.0_wp], 3, 3.0_wp, 10.0_wp, 10.0_wp, & 0.1_wp, 40.0_wp) opts(1) = '0.1 dtM' @@ -1488,11 +1489,13 @@ SUBROUTINE case_law_slack_runs() WRITE (*, '(A,ES10.3,A,ES10.3,A,ES10.3,A)') ' viscoelastic light cable, dtM 0.1 s: FairTen1 max ', fair, & ' N, AnchTen1 max ', anch, ' N, smallest segment tension ', seg_min, ' N' CALL require(seg_min <= 0.0_wp, 've-slack:goes-slack') - CALL require(anch > 4.0e4_wp .AND. anch < 1.0e5_wp, 've-slack:anchor-peak') + CALL require(anch > 4.0e4_wp .AND. anch < 1.3e5_wp, 've-slack:anchor-peak') CALL require(fair > 8.0e4_wp .AND. fair < 1.2e5_wp, 've-slack:fairlead-peak') CALL require(.NOT. file_contains('ei0slack_ve_light.log', 'Warning: line'), 've-slack:no-spike-warning') ! a taut Syrope line in 4 m surge that goes slack, dtM 0.1 s: fairlead 1.78 MN at dtM 1 and - ! 2.5 ms + ! 2.5 ms; 1.82 MN with the default sub-steps, 1.64 MN taking every step as given and + ! 1.67 MN with the configuration blend (gfortran, Windows). The bounds catch a spike or a + ! lost snap, not the round-off-dependent peak of the unresolved snap CALL write_syrope_files() CALL write_motion('ei0slack_surge_syr.txt', 1, [5.0_wp, 0.0_wp, -14.0_wp], 1, 4.0_wp, 10.0_wp, 10.0_wp, & 0.1_wp, 40.0_wp) @@ -1504,7 +1507,7 @@ SUBROUTINE case_law_slack_runs() WRITE (*, '(A,ES10.3,A,ES10.3,A)') ' Syrope line, 4 m surge, dtM 0.1 s: FairTen1 max ', fair, & ' N, smallest segment tension ', seg_min, ' N' CALL require(seg_min <= 0.0_wp, 'syrope-slack:goes-slack') - CALL require(fair > 1.5e6_wp .AND. fair < 1.95e6_wp, 'syrope-slack:fairlead-peak') + CALL require(fair > 1.4e6_wp .AND. fair < 2.3e6_wp, 'syrope-slack:fairlead-peak') CALL require(.NOT. file_contains('ei0slack_syrope.log', 'Warning: line'), 'syrope-slack:no-spike-warning') END SUBROUTINE case_law_slack_runs diff --git a/tests/test_model.f90 b/tests/test_model.f90 index e7b8eb0e..db2bb1a0 100644 --- a/tests/test_model.f90 +++ b/tests/test_model.f90 @@ -48,6 +48,8 @@ PROGRAM test_model CALL case_recovery_common_path() CALL case_recovery_subdivision_path() CALL case_resolved_substeps() + CALL case_substep_paths() + CALL case_substep_snap_only() CALL case_coupled_load_sign() CALL case_coupled_motion_update() CALL case_external_load_update() @@ -618,9 +620,145 @@ SUBROUTINE case_resolved_substeps() CALL CD_End_Model(bad_m, es, em) END SUBROUTINE case_resolved_substeps + SUBROUTINE case_substep_paths() + !! The paths of the resolved sub-stepping on a line that carries viscoelastic segments and + !! seabed friction (the 8-segment line of case_resolved_substeps resting 1 cm into a flat + !! seabed, End B on the 0.6 m circle): (1) solving the first sub-stepped pass twice, the + !! second from the restored committed state (TEST-ONLY sub_test_repeat), changes nothing bit + !! for bit, so the restore covers the kinematics, the viscoelastic dl_1 state and the + !! friction anchors; (2) a sub-step that fails (TEST-ONLY sub_test_fail) returns the plain + !! step's own result, the run then equals the run with ei0_substeps off bit for bit; (3) a + !! cap of four sub-steps at a 0.05 deg angle is reached and counted; (4) a re-measured + !! interval that needs more sub-steps (TEST-ONLY sub_test_more: one more) is solved again + !! with them and lands on the prescribed end state. + INTEGER, PARAMETER :: NE = 8, NN = NE + 1, NDOF = 3*NN, NSTEP = 30 + REAL(wp), PARAMETER :: DT = 0.1_wp + INTEGER, PARAMETER :: SUB_MIN = 4 ! the fewest sub-steps of a sub-stepped step + TYPE(CD_ModelType) :: auto_m, rep_m, fb_m, off_m, cap_m, more_m + TYPE(GenAlphaConfig) :: cfg + INTEGER :: conn(2, NE), fixed(6), es, n_iter, k + REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), v0(NDOF), f_ext(NDOF), kn(NN), cn(NN) + REAL(wp) :: ve_ead(NE), ve_ba(NE), ve_bad(NE), pq(NDOF), pv(NDOF), pa(NDOF), dl1_0(NE), fr_0(2, NN) + LOGICAL :: conv, stalled, all_conv, more_lands + CHARACTER(240) :: em + + more_lands = .TRUE. + CALL straight_cable(NE, conn, l0, ea, rho_a, q0, fixed) + v0 = 0.0_wp + f_ext = 0.0_wp + kn = 1.0e4_wp + cn = 1.0e2_wp + ! the even segments are viscoelastic (Es | Ed, Bs | Bd) + ve_ead = 0.0_wp + ve_ba = 0.0_wp + ve_bad = 0.0_wp + ve_ead(2:NE:2) = 2.0e6_wp + ve_ba(2:NE:2) = 1.0e5_wp + ve_bad(2:NE:2) = 1.0e3_wp + CALL CD_Init_Model(auto_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, cfg, es, em, & + seabed_z_floor=0.01_wp, seabed_kn=kn, seabed_cn=cn, seabed_mu=0.5_wp, & + ve_ea_d=ve_ead, ve_ba=ve_ba, ve_ba_d=ve_bad) + CALL require(es == CD_MODEL_OK, 'substep-paths:init: '//TRIM(em)) + IF (es /= CD_MODEL_OK) RETURN + dl1_0 = auto_m%ve_dl_1 + fr_0 = auto_m%fr_anchor + CALL CD_Copy_Model(auto_m, rep_m, es, em) + rep_m%sub_test_repeat = .TRUE. + CALL CD_Copy_Model(auto_m, fb_m, es, em) + fb_m%sub_test_fail = 2 + CALL CD_Copy_Model(auto_m, off_m, es, em) + off_m%cfg%ei0_substeps = CD_EI0_SUBSTEPS_OFF + CALL CD_Copy_Model(auto_m, cap_m, es, em) + cap_m%cfg%ei0_substep_angle = 0.05_wp + cap_m%cfg%ei0_substep_max = 4 + CALL CD_Copy_Model(auto_m, more_m, es, em) + more_m%sub_test_more = .TRUE. + all_conv = .TRUE. + DO k = 1, NSTEP + CALL circle_end_motion(q0, pq, pv, pa, REAL(k, wp)*DT) + CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(rep_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(fb_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(cap_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(more_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, & + prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + more_lands = more_lands .AND. ALL(more_m%q(fixed) == pq(fixed)) + END DO + WRITE (*, '(A,I0,A,I0,A,I0,A,I0,A,I0,A)') ' sub-step paths: ', auto_m%sub_events, ' of ', auto_m%sub_calls, & + ' steps sub-stepped, ', auto_m%sub_remeasured, ' re-measured; fallback ', fb_m%sub_fallbacks, & + ', capped ', cap_m%sub_capped, ' steps' + CALL require(all_conv, 'substep-paths:converged') + CALL require(auto_m%sub_events > 0, 'substep-paths:sub-stepped') + CALL require(ANY(auto_m%ve_dl_1 /= dl1_0) .AND. ANY(auto_m%fr_anchor /= fr_0), 'substep-paths:states-move') + CALL require(ALL(rep_m%q == auto_m%q) .AND. ALL(rep_m%v == auto_m%v) .AND. ALL(rep_m%a == auto_m%a) .AND. & + ALL(rep_m%ve_dl_1 == auto_m%ve_dl_1) .AND. ALL(rep_m%fr_anchor == auto_m%fr_anchor), & + 'substep-paths:restore-is-complete') + CALL require(fb_m%sub_events == 0 .AND. fb_m%sub_fallbacks > 0, 'substep-paths:fallback-counted') + CALL require(ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. ALL(fb_m%a == off_m%a) .AND. & + ALL(fb_m%ve_dl_1 == off_m%ve_dl_1) .AND. ALL(fb_m%fr_anchor == off_m%fr_anchor), & + 'substep-paths:fallback-is-the-plain-step') + CALL require(cap_m%sub_capped > 0 .AND. cap_m%sub_max_used == 4, 'substep-paths:cap') + CALL require(more_m%sub_remeasured == more_m%sub_events .AND. more_m%sub_events > 0 .AND. & + more_m%sub_max_used >= SUB_MIN + 1 .AND. more_lands .AND. & + ANY(more_m%q /= auto_m%q), 'substep-paths:re-measured') + CALL CD_End_Model(auto_m, es, em) + CALL CD_End_Model(rep_m, es, em) + CALL CD_End_Model(fb_m, es, em) + CALL CD_End_Model(off_m, es, em) + CALL CD_End_Model(cap_m, es, em) + CALL CD_End_Model(more_m, es, em) + END SUBROUTINE case_substep_paths + + SUBROUTINE case_substep_snap_only() + !! The snap trigger alone: a straight 4-segment line 5 % slack (no turn in any step) whose + !! End B is pulled 0.5 m along the line in one 0.05 s step snaps taut. The step is solved in + !! four sub-steps; with ei0_substeps off it is taken as given. + INTEGER, PARAMETER :: NE = 4, NN = NE + 1, NDOF = 3*NN + REAL(wp), PARAMETER :: DT = 0.05_wp + TYPE(CD_ModelType) :: auto_m, off_m + TYPE(GenAlphaConfig) :: cfg + INTEGER :: conn(2, NE), fixed(6), es, n_iter + REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), v0(NDOF), f_ext(NDOF), pq(NDOF), pv(NDOF), pa(NDOF) + LOGICAL :: conv, stalled, ok + CHARACTER(240) :: em + + CALL straight_cable(NE, conn, l0, ea, rho_a, q0, fixed) + l0 = 1.05_wp + v0 = 0.0_wp + f_ext = 0.0_wp + CALL CD_Init_Model(auto_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, cfg, es, em) + CALL require(es == CD_MODEL_OK, 'snap-only:init: '//TRIM(em)) + IF (es /= CD_MODEL_OK) RETURN + CALL CD_Copy_Model(auto_m, off_m, es, em) + off_m%cfg%ei0_substeps = CD_EI0_SUBSTEPS_OFF + pq = q0 + pv = 0.0_wp + pa = 0.0_wp + pq(NDOF - 2) = q0(NDOF - 2) + 0.5_wp + CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + ok = es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + ok = ok .AND. es == CD_MODEL_OK .AND. conv + WRITE (*, '(A,I0,A,I0,A)') ' snap-only trigger: ', auto_m%sub_events, ' step(s) sub-stepped, at most ', & + auto_m%sub_max_used, ' sub-steps' + CALL require(ok, 'snap-only:converged') + CALL require(auto_m%sub_events == 1 .AND. auto_m%sub_max_used == 4, 'snap-only:four-sub-steps') + CALL require(ALL(auto_m%q(fixed) == pq(fixed)), 'snap-only:lands-on-end-state') + CALL require(off_m%sub_events == 0 .AND. ANY(off_m%q /= auto_m%q), 'snap-only:off-takes-the-step') + CALL CD_End_Model(auto_m, es, em) + CALL CD_End_Model(off_m, es, em) + END SUBROUTINE case_substep_snap_only + SUBROUTINE circle_end_motion(q0, pq, pv, pa, t) !! End A held, End B (the last node) on the circle x_B + R r(t) (0, sin wt, 1 - cos wt), - !! R = 0.3 m, period 2 s, r the C2 quintic ramp over the first second, so the motion starts + !! R = 0.6 m, period 2 s, r the C2 quintic ramp over the first second, so the motion starts !! from rest (case_resolved_substeps). REAL(wp), INTENT(IN) :: q0(:), t REAL(wp), INTENT(OUT) :: pq(:), pv(:), pa(:) diff --git a/tests/test_syrope.f90 b/tests/test_syrope.f90 index 25d8054b..bed4c957 100644 --- a/tests/test_syrope.f90 +++ b/tests/test_syrope.f90 @@ -16,7 +16,7 @@ PROGRAM test_syrope CD_Syrope_Slow_At_Mean, CD_Syrope_Check_Range, CD_Syrope_Branch_Divider, & CD_SYROPE_OK, CD_SYROPE_NWC, & CD_SYROPE_WC_LINEAR, CD_SYROPE_WC_QUADRATIC, CD_SYROPE_WC_EXP - USE CableDyn_Dynamic, ONLY: GenAlphaConfig + USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_EI0_SUBSTEPS_OFF USE CableDyn_Static, ONLY: CableSolverConfig USE CableDyn_Line, ONLY: CD_LineType, CD_LineSection USE CableDyn_Model, ONLY: CD_ModelType, CD_Init_Model, CD_Init_Line_Model, CD_Step_Model, CD_End_Model, & @@ -73,6 +73,7 @@ PROGRAM test_syrope CALL case_model_held() CALL case_syrope_accessor_roundtrip() CALL case_model_mixed_ve_syrope() + CALL case_substeps_restore_law_states() CALL case_line_model_syrope() CALL case_admissibility() CALL case_ic_rest_point() @@ -685,6 +686,119 @@ SUBROUTINE case_model_mixed_ve_syrope() CALL CD_Syrope_End(td) END SUBROUTINE case_model_mixed_ve_syrope + SUBROUTINE case_substeps_restore_law_states() + !! The rotation-resolved sub-stepping of a model carrying a Syrope and a viscoelastic + !! element (case_model_mixed_ve_syrope), node 2 free and node 3 driven on a 0.4 m circle at + !! 2 s, so the chords turn by more than a degree per 0.02 s step: solving the first + !! sub-stepped pass twice, the second from the restored committed state (TEST-ONLY + !! sub_test_repeat), changes nothing bit for bit, Syrope slow strain and running maximum and + !! viscoelastic dl_1 included; a failing sub-step (TEST-ONLY sub_test_fail) returns the plain + !! step, the run then equals the run with ei0_substeps off bit for bit. + REAL(wp), PARAMETER :: L0E = 1.0_wp, EPS = 0.026_wp, DL = 0.03_wp, DT = 0.02_wp, R = 0.4_wp + INTEGER, PARAMETER :: NSTEP = 40 + TYPE(CD_SyropeType) :: td, stype(2) + TYPE(CD_ModelType) :: auto_m, rep_m, fb_m, off_m + TYPE(GenAlphaConfig) :: cfg + INTEGER :: conn(2, 2), fixed(6), es, k, n_iter + REAL(wp) :: l0(2), eav(2), rho_a(2), q0(9), v0(9), f_ext(9), pq(9), pv(9), pa(9) + REAL(wp) :: ve_ead(2), ve_ba(2), ve_bad(2), sslow(2), stmax(2), w, t, slow0(2), dl0(2) + LOGICAL :: sis(2), conv, stalled, all_conv + CHARACTER(200) :: em + CALL CD_Syrope_Init(td, OWC_EPS, OWC_TEN, CD_SYROPE_WC_LINEAR, 0.6_wp, 0.0_wp, & + ALPHA, BETA, C1, C2, es, em) + CALL require(es == CD_SYROPE_OK, 'substep-law:type-init') + conn(:, 1) = [1, 2] + conn(:, 2) = [2, 3] + l0 = L0E + eav = [1.0e8_wp, 100.0_wp] + rho_a = 50.0_wp + q0 = 0.0_wp + q0(4) = L0E*(1.0_wp + EPS) + q0(7) = q0(4) + L0E*(1.0_wp + DL) + v0 = 0.0_wp + f_ext = 0.0_wp + fixed = [1, 2, 3, 7, 8, 9] + sis = [.TRUE., .FALSE.] + stype(1) = td + stype(2) = td + sslow = [0.021_wp, 0.0_wp] + stmax = [2.0e6_wp, 0.0_wp] + ve_ead = [0.0_wp, 400.0_wp] + ve_ba = [0.0_wp, 7.0_wp] + ve_bad = [0.0_wp, 3.0_wp] + CALL CD_Init_Model(auto_m, q0, v0, conn, l0, eav, rho_a, .TRUE., f_ext, fixed, cfg, es, em, & + ve_ea_d=ve_ead, ve_ba=ve_ba, ve_ba_d=ve_bad, & + syrope_is=sis, syrope_type=stype, syrope_slow0=sslow, syrope_tmax0=stmax) + CALL require(es == CD_MODEL_OK, 'substep-law:init: '//TRIM(em)) + IF (es /= CD_MODEL_OK) RETURN + slow0 = auto_m%syrope_slow + dl0 = auto_m%ve_dl_1 + CALL CD_Copy_Model(auto_m, rep_m, es, em) + rep_m%sub_test_repeat = .TRUE. + CALL CD_Copy_Model(auto_m, fb_m, es, em) + fb_m%sub_test_fail = 1 + CALL CD_Copy_Model(auto_m, off_m, es, em) + off_m%cfg%ei0_substeps = CD_EI0_SUBSTEPS_OFF + w = 2.0_wp*ACOS(-1.0_wp)/2.0_wp + all_conv = .TRUE. + DO k = 1, NSTEP + ! node 3 on the circle q0(7:9) + R ramp(t) (0, sin wt, 1 - cos wt), ramped over the first second + t = REAL(k, wp)*DT + CALL ramped_circle(t, q0, w, R, pq, pv, pa) + CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(rep_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(fb_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv + END DO + WRITE (*, '(A,I0,A,I0,A,I0,A)') ' sub-steps with Syrope and viscoelastic states: ', auto_m%sub_events, & + ' of ', auto_m%sub_calls, ' steps sub-stepped, ', fb_m%sub_fallbacks, ' failing-sub-step fallbacks' + CALL require(all_conv, 'substep-law:converged') + CALL require(auto_m%sub_events > 0, 'substep-law:sub-stepped') + CALL require(ANY(auto_m%syrope_slow /= slow0) .AND. ANY(auto_m%ve_dl_1 /= dl0), 'substep-law:states-move') + CALL require(ALL(rep_m%q == auto_m%q) .AND. ALL(rep_m%v == auto_m%v) .AND. ALL(rep_m%a == auto_m%a) .AND. & + ALL(rep_m%syrope_slow == auto_m%syrope_slow) .AND. & + ALL(rep_m%syrope_tmax == auto_m%syrope_tmax) .AND. ALL(rep_m%ve_dl_1 == auto_m%ve_dl_1), & + 'substep-law:restore-is-complete') + CALL require(fb_m%sub_fallbacks > 0 .AND. ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. & + ALL(fb_m%a == off_m%a) .AND. ALL(fb_m%syrope_slow == off_m%syrope_slow) .AND. & + ALL(fb_m%syrope_tmax == off_m%syrope_tmax) .AND. ALL(fb_m%ve_dl_1 == off_m%ve_dl_1), & + 'substep-law:fallback-is-the-plain-step') + CALL CD_End_Model(auto_m, es, em) + CALL CD_End_Model(rep_m, es, em) + CALL CD_End_Model(fb_m, es, em) + CALL CD_End_Model(off_m, es, em) + CALL CD_Syrope_End(td) + END SUBROUTINE case_substeps_restore_law_states + + SUBROUTINE ramped_circle(time, q0, w, R, pq, pv, pa) + !! Node 3 (DOFs 7:9) on the circle q0 + R ramp(t) (0, sin wt, 1 - cos wt), the C2 quintic + !! ramp over the first second (case_substeps_restore_law_states). + REAL(wp), INTENT(IN) :: time, q0(:), w, R + REAL(wp), INTENT(OUT) :: pq(:), pv(:), pa(:) + REAL(wp) :: u, r5, rd, rdd, g(2), gd(2), gdd(2) + u = MIN(time, 1.0_wp) + r5 = 10.0_wp*u**3 - 15.0_wp*u**4 + 6.0_wp*u**5 + rd = 0.0_wp + rdd = 0.0_wp + IF (time < 1.0_wp) THEN + rd = 30.0_wp*u**2 - 60.0_wp*u**3 + 30.0_wp*u**4 + rdd = 60.0_wp*u - 180.0_wp*u**2 + 120.0_wp*u**3 + END IF + g = R*[SIN(w*time), 1.0_wp - COS(w*time)] + gd = R*w*[COS(w*time), SIN(w*time)] + gdd = R*w*w*[-SIN(w*time), COS(w*time)] + pq = q0 + pv = 0.0_wp + pa = 0.0_wp + pq(8:9) = q0(8:9) + r5*g + pv(8:9) = rd*g + r5*gd + pa(8:9) = rdd*g + 2.0_wp*rd*gd + r5*gdd + END SUBROUTINE ramped_circle + SUBROUTINE case_line_model_syrope() !! The line-object build path with the Syrope pass-through: a straight, !! zero-gravity Syrope line built through CD_Init_Line_Model (which runs the diff --git a/validation/experiments/bergdahl/provenance.json b/validation/experiments/bergdahl/provenance.json index cfe95d40..123ffba1 100644 --- a/validation/experiments/bergdahl/provenance.json +++ b/validation/experiments/bergdahl/provenance.json @@ -2,7 +2,7 @@ "CableDyn_release": "v0.1.1+dev (unreleased)", "validation_date": "2026-10-17", "executable_name": "cabledyn.exe", - "executable_sha256": "51f17f4bee5253961d6b36bd8404d948e815470abff64491deeb99a7e77708b7", + "executable_sha256": "c0504813c19ac8683d6f31cac56063da519cd8867c0facd3fddaef4e70469886", "compiler": "GNU Fortran 16.2.0", "build_type": "Release", "platform": "Windows 11 x86-64", From 368773b80dde89343c3ca2e884a13905d605892a Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Sat, 17 Oct 2026 22:39:22 +0900 Subject: [PATCH 3/5] docs: state that the undamped light-cable snap peaks do not converge A convergence study of the light-cable and stiff-seabed reproducers of the force-blend fix shows that the undamped EI = 0 deck has no converged snap peak: the peak rises as dtM falls (0.32 to 0.46 MN at microsecond steps, also with an explicit lumped-mass solver), as single segments rattle, and falls with mesh refinement at a fixed step. Its 20 ms averages converge to 0.083 / 0.047 MN, and converged finite-EI runs give 0.093 MN at the fairlead and 0.057 MN at the anchor. On the stiff seabed the EI = 0 peak does not converge either. The CHANGELOG, theory and options pages no longer call the light-cable or stiff-seabed figures references; they give the finite-EI values instead of "0.1 to 0.18 MN at rhoInf = 0 and with a finite-EI model". The sub-stepping entry states that on this undamped cable the sub-steps resolve more of the segment rattle and can raise isolated spikes (anchor 0.16 to 0.52 MN at dtM 0.5 ms), and that with physical axial damping they change nothing. The modelling guide and the snap-note entry of the troubleshooting page now advise physical axial damping (BA in N s, not the per-segment damping-ratio form, which changes with the mesh) or finite EI to obtain converged snap peaks. The slack-dynamics test header says the same of its bounds, which catch a spike or a lost snap rather than a reference. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 29 +++++++++++++++++++++-------- doc/modeling.rst | 11 +++++++++++ doc/options.rst | 3 ++- doc/theory.rst | 11 ++++++++--- doc/troubleshooting.rst | 7 ++++++- tests/test_ei0_slack_dynamics.f90 | 6 ++++-- 6 files changed, 52 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27c53753..589f64f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -214,10 +214,14 @@ All notable changes to CableDyn are recorded in this file. The format follows polyester at 1.80 MN as before; the light cable stays at 0.092 / 0.106 MN at `dtM` 0.1 s and its largest segment tension at `dtM` 0.01 s moves from 0.107 to 0.095 MN. Its fairlead and anchor peaks at `dtM` 2.5 ms move from 0.099 / 0.091 to 0.102 / 0.119 MN, and on the stiff - seabed at `dtM` 0.05 s from 0.52 / 0.67 to 0.62 / 0.86 MN; the snap peaks of this light, - stiff cable keep rising as the step is refined (0.14 to 0.23 / 0.14 to 0.19 MN over seven - runs at 0.125 ms and 0.26 to 0.31 / 0.29 to 0.34 MN over four at 0.05 ms, with plain steps), - so none of these is a converged peak. Validation: the + seabed at `dtM` 0.05 s from 0.52 / 0.67 to 0.62 / 0.86 MN. None of these is a converged + peak: the undamped `EI = 0` cable has no converged snap peak (see the force-blend entry + below; converged finite-EI runs give 0.093 / 0.057 MN). On this undamped cable the sub-steps + resolve more of the segment rattle and can raise isolated spikes: at `dtM` 0.5 ms the anchor + peaks at 0.16 to 0.52 MN, depending on `rhoInf`, and its 5 ms averages at 0.12 to 0.21 MN + against 0.09 MN converged. With physical axial damping (`BA` 5.06e5 N·s) `auto` sub-steps + 3 to 4 steps of that run and changes nothing; `ei0_substep_max` and `ei0_substep_angle` do + not change these runs. Validation: the Bergdahl matrix gives RMSE 1.59 N (1.58 N), MAPE 3.13 %, Pearson 0.993 and Lin concordance 0.989, with mesh and time-step halving moving the cycle maxima by at most 0.53 % and 0.13 % (0.52 % and 0.19 %); the WD0050/A2 cell of the L2-2 parity moves within its recorded range @@ -425,8 +429,9 @@ All notable changes to CableDyn are recorded in this file. The format follows work to the motion than its strain energy. Both happened silently at the default `rhoInf = 0.4`, at every `dtM` from 0.002 to 0.2 s, on realistic input: a light, axially stiff cable (80 kg/m, EA 8e8 N) under 3 m heave reported 4.2 MN at the fairlead and 3.4 MN at the - anchor (`dtM` 0.0025 s) and 20 MN at the anchor (`dtM` 0.1 s), against 0.1 to 0.18 MN at - `rhoInf = 0`, at `dtM` down to 0.25 ms and with a finite-EI model; the same cable in an `Hs` + anchor (`dtM` 0.0025 s) and 20 MN at the anchor (`dtM` 0.1 s), where converged finite-EI + runs of the same cable give 0.093 MN at the fairlead and 0.057 MN at the anchor; the same + cable in an `Hs` 8 m JONSWAP sea 0.41 MN at the anchor against 0.043 MN; the shipped viscoelastic polyester in 15 m surge 2.69 MN against 1.80 MN; a semi-taut chain–polyester leg 9.5 MN at the anchor against 4.6 MN; and a line on a stiff seabed failed the plausibility guard. The step now blends @@ -452,8 +457,16 @@ All notable changes to CableDyn are recorded in this file. The format follows 2750 times that with only the elastic share capped); a damped segment that ends taut beyond that band keeps the plain force blend. The seabed contact of a node that lifts off within a step is not capped (see the manual's theory page). At the - default `rhoInf` the reproducers now give 0.10 / 0.09 MN, 0.092 / 0.106 MN, 0.075 / 0.043 MN - and 1.80 MN, as their references, and the stiff-seabed line runs to completion; the + default `rhoInf` the light cable now peaks at 0.10 / 0.09 MN at `dtM` 0.0025 s and at 0.092 / + 0.106 MN at 0.1 s, the same cable in the JONSWAP sea at 0.075 / 0.043 MN and the + viscoelastic polyester at 1.80 MN, as at 0.0025 s; the stiff-seabed line runs to completion. + The light-cable figures are not converged peaks. The undamped `EI = 0` deck has no converged + snap peak: the peak rises as `dtM` falls (0.32 to 0.46 MN at microsecond steps, also with an + explicit lumped-mass solver), as single segments rattle, and falls with mesh refinement at a + fixed `dtM`; its 20 ms averages converge to 0.083 / 0.047 MN, the slack-to-taut event, and + converged finite-EI runs give 0.093 MN at the fairlead and 0.057 MN at the anchor. On the + stiff seabed the `EI = 0` peak does not converge either (0.74 to 0.95 MN at coarse steps, + 1.2 to 1.4 MN at 0.025 to 0.05 ms). The chain–polyester anchor snap peaks at 5.7 MN at `dtM` 0.05 s, a single-step peak (4.6 MN at 0.0025 s) that the new snap note reports. On a linear element the scheme is unchanged, so taut lines keep their accuracy: every MoorDyn-C, OrcaFlex, analytic and experimental comparison that diff --git a/doc/modeling.rst b/doc/modeling.rst index e923c9de..1631fa0f 100644 --- a/doc/modeling.rst +++ b/doc/modeling.rst @@ -149,6 +149,17 @@ ensembles or refine ``dtM`` before drawing conclusions from one peak. The driver sub-stepped steps per line and notes a turn per step it did not resolve (see :doc:`options`, ``ei0_substeps``). +The snap peaks of an undamped tension-only line do not converge in time or mesh: its single +segments rattle against the stiff axial spring, and the peak rises as ``dtM`` falls. On a light, +axially stiff cable (80 kg/m, EA 8e8 N, 2 m segments) in 3 m heave it rises from about 0.1 MN at +``dtM = 2.5 ms`` to 0.32 to 0.46 MN at microsecond steps, also with an explicit lumped-mass +solver, while converged finite-EI runs give 0.093 MN at the fairlead and 0.057 MN at the anchor. +To obtain converged peaks, give such lines physical axial damping, ``BA`` as a material +property in N·s (the negative, per-segment damping-ratio form changes with the mesh: it halves +with each halving of the segment length), or model them with finite ``EI``. With ``BA = 0`` the +sub-steps of ``ei0_substeps auto`` resolve more of the segment rattle and can raise isolated +spikes. + 6. Establish the static initial condition ----------------------------------------- diff --git a/doc/options.rst b/doc/options.rst index 77365207..4e7f2b0c 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -426,7 +426,8 @@ Finite-EI cable controls earlier. On ``EI = 0`` lines ``False`` lets a segment that turns taut within a step carry the stretch extrapolated past the blended state, and lets a release create energy: on a light, axially stiff cable (80 kg/m, EA 8e8 N) under 3 m heave the fairlead peaks at - 4.2 MN against 0.10 MN with ``True`` (see :doc:`theory`). On finite-EI lines the blended + 4.2 MN against 0.10 MN with ``True`` at ``dtM = 2.5`` ms (converged finite-EI runs give + 0.093 MN; see :doc:`theory`). On finite-EI lines the blended tangent vectors are shortened while the line rotates and raise the mean tension at large ``dtM``: on the Lozon Gulf of Mexico 80 m cable in 3 m surge the mean hang-off tension is 12511 / 10097 / 9507 / 9360 N at diff --git a/doc/theory.rst b/doc/theory.rst index 2b226e5d..e05c75be 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1492,9 +1492,14 @@ element. The cap does not act on an element that ends above :math:`\alpha_f/(1 - every line that allows compression keep the force blend. In the slack-cable case above the internal forces created 2.7e8 J over 20 s with the configuration blend, 6.7e7 J with the force blend alone, 0.19 J with a cap on :math:`e_n - e_{n+1}` (the turn of the releasing segments) and -4e-4 J (round-off) with the projected cap. The fairlead peak is 0.10 MN. The snap is not -resolved in time: with the cap the peak ranges from 0.10 to 0.18 MN over :math:`\Delta t` from -2.5 to 0.25 ms, against 0.13 to 0.19 MN at :math:`\rho_\infty = 0`. For a linear element the +4e-4 J (round-off) with the projected cap. The fairlead peak is 0.10 MN at +:math:`\Delta t` = 2.5 ms, which is not a converged peak. The undamped ``EI = 0`` deck has no +converged snap peak: the peak rises as :math:`\Delta t` falls (0.32 to 0.46 MN at microsecond +steps, also with an explicit lumped-mass solver), as single segments rattle, and falls with +mesh refinement at a fixed step; its 20 ms averages converge to 0.083 MN at the fairlead and +0.047 MN at the anchor, the slack-to-taut event, and converged finite-EI runs give 0.093 MN at +the fairlead and 0.057 MN at the anchor (see :doc:`modeling`, snap loads on slack lines). For +a linear element the force blend and the cap reduce to the configuration blend, so the linear spectral properties and the second-order accuracy are unchanged. diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index 77bdf33f..442e894d 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -598,7 +598,12 @@ Warnings and notes that do not stop a run over a segment: the peak is set by a single step. A 15 m surge of a semi-taut chain–polyester line peaks at 4.65 MN at ``dtM`` 0.05 s with the default sub-steps (5.7 MN with ``off ei0_substeps``) against 4.6 MN at 0.0025 s. The run is valid; confirm - design peaks with a smaller ``dtM``. + design peaks with a smaller ``dtM``. On a line without axial damping (``BA = 0``) the + snap peaks do not converge in time or mesh, as single segments rattle; a smaller ``dtM`` + raises them, and the sub-steps of ``ei0_substeps auto`` can raise isolated spikes. Give + the line physical axial damping (``BA`` in N·s, not the per-segment damping-ratio form, + which changes with the mesh) or finite ``EI`` to obtain converged peaks (see + :doc:`modeling`). * - ``Warning: line ...: segment ... carried ... N at t = ... s for a single step, ... times the largest tension on the line one step before and after`` - a non-physical tension spike: the tension of one segment (elastic, viscoelastic or diff --git a/tests/test_ei0_slack_dynamics.f90 b/tests/test_ei0_slack_dynamics.f90 index 2f8e3739..a4c3dbf7 100644 --- a/tests/test_ei0_slack_dynamics.f90 +++ b/tests/test_ei0_slack_dynamics.f90 @@ -5,8 +5,10 @@ PROGRAM test_ei0_slack_dynamics !! Tension-only (EI = 0) lines that go slack and snap taut, at the default rhoInf = 0.4: !! 1. A light, axially stiff cable (80 kg/m, EA 8e8 N, 115 x 2 m segments) under 3 m / 10 s !! heave at dtM 0.1 s. The configuration-blended step reported 0.61 MN at the fairlead and - !! 20 MN at the anchor against about 0.1 MN (rhoInf 0 and small-step references); the - !! force blend stays below 0.2 MN. + !! 20 MN at the anchor; the force blend stays below 0.2 MN. This undamped EI = 0 deck has + !! no converged snap peak (it rises as dtM falls, to 0.32-0.46 MN at microsecond steps, as + !! single segments rattle); converged finite-EI runs give 0.093 MN at the fairlead and + !! 0.057 MN at the anchor, so the bounds catch a spike or a lost snap, not a reference. !! 2. The same cable at dtM 0.01 s, where the force blend alone still fed a rattle of !! single-step segment spikes (2.3 MN by 24 s) through the energy a release creates; !! with the release cap every segment stays below 0.2 MN. From 81781e841d7bf0c4e939e856d721315b5a069c0c Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Mon, 19 Oct 2026 22:35:10 +0900 Subject: [PATCH 4/5] fix(dynamics): keep the EI = 0 sub-steps on the nominal path and count only committed steps The depth-floor rerun of a stalled line-system step now steps every line as the nominal step does, sub-steps included, so its result is again that of the step without the fallback; only the halves of a recovery take their steps as given. The monolithic junction arms the end query only on lines with an active junction DOF, so a line whose ends are all fixed or anchored is sub-stepped there too. The docs and changelog state that the monolithic scheme is the default of standalone decks with bodies, rods or free points, that the lines attached to them are not sub-stepped (7 of the 21 shipped EI = 0 dynamic examples), and what a triggering step costs at most. The trigger takes the segment tensions the run audit takes (the viscoelastic and Syrope law tensions included), floors the step-start tension scale at 0.1 % of the line's initial tension, and treats a slack-to-taut snap as one only when the step does not resolve the axial wave over the segment. The Bergdahl matrix at 0.3125 ms therefore takes no sub-step and is back to its previous record bit for bit; its 0.1 m mesh and 0.625 ms runs keep theirs. The light cable at 0.5 ms takes no sub-step either. Flooring at the full initial tension was tried and left the Lozon semitaut anchor peaks up to 29 % high, so the floor is 0.1 %. The sub-step diagnostics are 64-bit, roll back with the line states (line system rollback, the fallback frame, the system snapshot and the stall recovery) and are reported as steps examined. The ei0 settings are checked when the model is initialised, and the deck parser applies the Python reader's rule to ei0_substep_max. The sub-step slots and the recovery snapshot share one copy routine of the committed state. The OpenMP line loop is scheduled dynamically; results do not depend on the thread count. Tests: a partly taut snap case on each side of the quarter threshold, a case whose step resolves the axial wave, init-time rejection of invalid settings, deck rejection of bad ei0 options, the viscoelastic anchor bound checked against the uncapped figure with every step taken as given, and a sway turn bound relative to the unresolved turn. Figures in the docs, the changelog, VALIDATION.md and the Bergdahl record are updated from reruns. Signed-off-by: Jae Hoon Seo --- ARCHITECTURE.md | 10 +- CHANGELOG.md | 134 +++-- VALIDATION.md | 19 +- doc/driver_format.md | 2 +- doc/modeling.rst | 8 +- doc/options.rst | 34 +- doc/theory.rst | 41 +- doc/troubleshooting.rst | 37 +- python/tests/test_deck_file.py | 2 + src/CableDyn_DeckDriver.f90 | 43 +- src/CableDyn_Model.f90 | 512 +++++++++++------- src/CableDyn_OpenFAST_Aggregate.f90 | 4 +- src/CableDyn_System.f90 | 65 ++- src/openfast/CableDyn_OF.f90 | 19 +- tests/test_deck_driver.f90 | 12 + tests/test_ei0_slack_dynamics.f90 | 27 +- tests/test_model.f90 | 155 ++++-- tests/test_syrope.f90 | 18 +- validation/experiments/bergdahl/README.md | 15 +- .../bergdahl/aggregate_metrics.json | 16 +- .../bergdahl/comparison_summary.csv | 40 +- .../experiments/bergdahl/provenance.json | 14 +- .../bergdahl/refinement_summary.csv | 4 +- .../bergdahl/refinement_summary.json | 32 +- 24 files changed, 809 insertions(+), 454 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 173881ab..082923e3 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -196,10 +196,12 @@ an under-resolved one, is repeated by internal subdivision (4, 16, … up to host time. On `EI = 0` lines `CD_Step_Model` also re-solves a converged step in `max(4, ceil(turn/ei0_substep_angle))` sub-steps on the same trajectory when a taut segment turned by more than `ei0_substep_angle` or a slack segment snapped -taut (`ei0_substeps auto`, the default; at most `ei0_substep_max`). It restores -the committed kinematics and constitutive and friction states first and keeps -the plain step when a sub-step fails. The sub-steps of a recovered step, the -halves of a line-system step halved by `CD_Step_System`, and the monolithic +taut while the step does not resolve its axial wave (`ei0_substeps auto`, the +default; at most `ei0_substep_max`). It restores the committed kinematics and +constitutive and friction states first (`commit_state_copy`, the one list of +that state in `CableDyn_Model`) and keeps the plain step when a sub-step fails. +The sub-steps of a recovered step, the halves of a line-system step halved by +`CD_Step_System`, and the lines attached to the objects of the monolithic body/point step are taken as given. ### Bodies, rods, and points diff --git a/CHANGELOG.md b/CHANGELOG.md index 589f64f8..7a9ac489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,10 +100,13 @@ All notable changes to CableDyn are recorded in this file. The format follows step before and after, ten times the largest tension anywhere on the line one step before and after, and the largest tension of the initial state. The first spike of a line is reported as a warning, once per line, and the run summary counts them. The run ends with a note when a - taut segment turned by more than 1° in one step (the mean and standard deviation of the - tension err by about 1 % and more above it; 1.3 % at 2.9° on a heaving chain), and when - segments snapped taut while the axial wave crosses a segment more than once per step, so the - snap peaks are not resolved in time. The standalone driver also prints a note for a dynamic + taut segment turned by more than 1° in one solver step (with `ei0_substeps auto`, see Changed, + 1.1 times the larger of 1° and `ei0_substep_angle`; the sub-steps of a sub-stepped or + recovered step count as steps; the mean and standard deviation of the tension err by about + 1 % and more above it, 1.3 % at 2.9° on a heaving chain, and near 6° per step snap-load peaks + come out 10 to 20 % low with either generalised-α blend), and when segments snapped taut + while the axial wave crosses a segment more than once per solver step, so the snap peaks are + not resolved in time. The standalone driver also prints a note for a dynamic deck with `rhoInf` above 0.95, on the missing numerical dissipation. See the manual's troubleshooting page. - Anchor uplift channels for the drag-anchor check of a catenary mooring (no vertical load at @@ -170,13 +173,18 @@ All notable changes to CableDyn are recorded in this file. The format follows - Tension-only (`EI = 0`) lines resolve fast segment rotation and slack-to-taut snaps by sub-stepping, on by default (new OPTIONS `ei0_substeps auto|off`, `ei0_substep_angle` - (default 1°) and `ei0_substep_max` (default 16)). A converged step in which a segment that - ends it taut (above 0.1 % of the largest step-start tension) turned by more than - `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of that - tension, is solved again from the same committed - state in `max(4, ceil(turn/angle))` equal sub-steps, at most `ei0_substep_max`, with the end - motion on the quintic of the recovering step and the last sub-step on the given end state; - output and coupling times are unchanged. At `dtM` 0.1 s a taut segment of the Lozon 80 m + (default 1°) and `ei0_substep_max` (default 16), checked when the line is initialised; the + Python deck reader applies the same rules). A converged step in which a segment that ends it + taut (above 0.1 % of the largest step-start tension) turned by more than + `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of that tension + while the step does not resolve the axial wave over it (the wave crosses the segment more + than once per step), is solved again from the same committed state in + `max(4, ceil(turn/angle))` equal sub-steps, at most `ei0_substep_max`, with the end motion on + the quintic of the recovering step and the last sub-step on the given end state; output and + coupling times are unchanged. The tensions are those of the run audit (the elastic tension, + or that of the viscoelastic or Syrope law), and the step-start tension is taken as at least + 0.1 % of the line's initial tension, so a line slack all over does not count barely taut + segments. At `dtM` 0.1 s a taut segment of the Lozon 80 m all-chain mooring turns by up to 6° per step in 5 m / 7 s heave, and the snap-load peaks of both generalised-α blends came out 10 to 20 % low. The release cap was not the cause: it acts in 0.3 % of the element steps, never within 0.5 s of a peak, and the cycle maxima with and @@ -184,51 +192,71 @@ All notable changes to CableDyn are recorded in this file. The format follows `rhoInf` 0, 10 and 40 % high at 0.6). Over seven runs whose amplitude differs by up to 3e-4, against 0.5 and 0.25 ms runs, the fairlead and anchor maxima move from 15 and 17 % low to 4 and 8 % low (the configuration blend of 0.1.1 gave 10 and 18 % low), and the anchor maxima of - the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge from 16 and 26 % high to 1.4 - and 2.6 % low. A single run at that step varies by 15 to 20 points, so a single comparison - can make either blend look accurate. The decision depends only on the committed state and the - step inputs, so restarts repeat it; when a sub-step does not converge the plain step's own - result is kept, and a step recovered after a stall or a half of a line-system step halved - after a failure takes its sub-steps as given. It applies on every route that steps `EI = 0` - lines (standalone lines and line systems, OpenFAST, FAST.Farm and the C API, whose raw lines - always take it) except the monolithic body and point coupling, which needs the end reaction - and tangent of the nominal step; the standalone driver notes that exclusion once per run. + the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge from 16 and 26 % high to 4 % + high and 2 % low (over thirteen runs 5 % high and 0.3 % low, single runs from 4 % low to + 21 % high). A single run at that step varies by 15 to 20 points, so a single comparison + can make either blend look accurate. The decision depends only on the committed state, the + step inputs and the line's initial tension, so restarts repeat it; when a sub-step does not + converge the plain step's own result is kept, and a step recovered after a stall or a half + of a line-system step halved after a failure takes its sub-steps as given (when the halves + fail too, the full step is re-run as the nominal step, sub-steps included). It applies on + every route that steps `EI = 0` lines (standalone lines and line systems, OpenFAST, + FAST.Farm and the C API, whose raw lines always take it) except the lines attached to the + bodies, rods and points of the monolithic body and point coupling, which needs the end + reaction and tangent of the nominal step. `monolithic bodyScheme` is the default of every + standalone deck with `Rigid6` bodies, `Point3` buoys, rods or `Free`/`Connect` points on + `EI = 0` lines, so those lines are not sub-stepped there: 7 of the 21 shipped `EI = 0` + dynamic example decks run this way, and none of them notes an unresolved segment turn. A + line of such a deck whose ends are all fixed or anchored is sub-stepped, `staggered + bodyScheme` sub-steps them all, and the standalone driver notes the exclusion once per run. `False alpha_force_blend` (paper mode) turns it off unless the deck sets it, so the paper - reproduction is unchanged. The standalone driver reports the sub-stepped steps per line, - OpenFAST and FAST.Farm print the counts (steps sub-stepped, largest count, steps that needed - more than `ei0_substep_max`, steps that kept the plain step) at the end of the run, and - `CD_AGG_Get_Substep_Counts` returns them to an aggregate host. The segment-turn note now - measures the turn per solver step and states that peaks come out 10 to 20 % low near 6° per - step. Over the shipped examples 19 of the 21 `EI = 0` dynamic decks - are unchanged bit for bit; in the two `als_volturnus` line-break decks the pre-failure anchor - snap at 250 s, a single-step peak at `dtM` 0.05 s, moves from 2.145 to 1.918 MN (1.963 MN - converged) and from 2.262 to 2.158 MN (2.334 MN converged), with the other tension - statistics within 0.02 %. The 20-run Lozon mooring envelope at `dtM` 0.1 s takes 1.63 times - as long (1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s motions; the steps that do not - trigger cost only the measurement), and the + reproduction is unchanged. A step that triggers costs its plain step and usually four + sub-steps, at most the plain step and three passes of `ei0_substep_max` sub-steps (49 line + solves at the default), and that once for every sub-step where bodies or rods sub-cycle the + lines (`staggered bodyScheme`, coupled runs); the OpenMP loop over the lines of a system + hands them out dynamically, which leaves every line's result unchanged. The standalone + driver reports the sub-stepped steps per line ("solved N of the M line step(s) it + examined"), OpenFAST and FAST.Farm print the counts (steps sub-stepped, largest count, steps + that needed more than `ei0_substep_max`, steps that kept the plain step) at the end of the + run, and `CD_AGG_Get_Substep_Counts` returns them to an aggregate host as 64-bit integers. + Only committed steps count: a step rolled back and taken again (a line-system halving, a + stall recovery, a corrector or a junction iteration) counts once. Over the shipped examples + 19 of the 21 `EI = 0` dynamic decks are unchanged bit for bit; in the two `als_volturnus` + line-break decks the pre-failure anchor snap at 250 s, a single-step peak at `dtM` 0.05 s, + moves from 2.145 to 1.918 MN (1.963 MN converged) and from 2.262 to 2.158 MN (2.334 MN + converged), with the other tension statistics within 0.02 %. The 20-run Lozon mooring + envelope at `dtM` 0.1 s takes 1.67 times as long (1.6 to 2.5 times on the 5 m / 7 s and + 10 m / 14 s motions; the steps that do not trigger cost only the measurement), and the examples whose steps never trigger run as before. Of the reproducers of the force-blend entry below, the semi-taut chain–polyester leg in 15 m surge now peaks at 4.65 MN at the - anchor at `dtM` 0.05 s (5.74 MN before, 4.6 MN at 0.0025 s), the Syrope line at 1.82 MN + anchor at `dtM` 0.05 s (5.74 MN before, 4.6 MN at 0.0025 s), the Syrope line at 1.81 MN (1.64 MN before, 1.78 MN at 1 and 2.5 ms), the lightly damped viscoelastic light cable at - 0.092 MN (0.085 MN before, 0.082 to 0.095 MN at 0.5 to 2.5 ms) and the shipped viscoelastic - polyester at 1.80 MN as before; the light cable stays at 0.092 / 0.106 MN at `dtM` 0.1 s and - its largest segment tension at `dtM` 0.01 s moves from 0.107 to 0.095 MN. Its fairlead and - anchor peaks at `dtM` 2.5 ms move from 0.099 / 0.091 to 0.102 / 0.119 MN, and on the stiff - seabed at `dtM` 0.05 s from 0.52 / 0.67 to 0.62 / 0.86 MN. None of these is a converged - peak: the undamped `EI = 0` cable has no converged snap peak (see the force-blend entry - below; converged finite-EI runs give 0.093 / 0.057 MN). On this undamped cable the sub-steps - resolve more of the segment rattle and can raise isolated spikes: at `dtM` 0.5 ms the anchor - peaks at 0.16 to 0.52 MN, depending on `rhoInf`, and its 5 ms averages at 0.12 to 0.21 MN - against 0.09 MN converged. With physical axial damping (`BA` 5.06e5 N·s) `auto` sub-steps - 3 to 4 steps of that run and changes nothing; `ei0_substep_max` and `ei0_substep_angle` do - not change these runs. Validation: the - Bergdahl matrix gives RMSE 1.59 N (1.58 N), MAPE 3.13 %, Pearson 0.993 and Lin concordance - 0.989, with mesh and time-step halving moving the cycle maxima by at most 0.53 % and 0.13 % - (0.52 % and 0.19 %); the WD0050/A2 cell of the L2-2 parity moves within its recorded range - (largest OrcaFlex summary difference 0.091 to 0.093, MoorDyn-C metric 0.078 to 0.076); the - other L2-2 cells, the one-hour VolturnUS-S record, the L3-2 regular-wave comparison and the - snap-load verification are unchanged bit for bit (the latter two step the generalised-α - kernel directly). `off ei0_substeps` gives the previous results bit for bit. + 0.062 MN at the anchor (0.085 MN before, 0.082 to 0.095 MN at 0.5 to 2.5 ms; its snap is not + resolved at 0.1 s, and over seven runs whose amplitude differs by up to 3e-4 it peaks at + 0.056 to 0.079 MN with the sub-steps and 0.056 to 0.085 MN without) and the shipped + viscoelastic polyester at 1.80 MN as before (in its steps recovered after a stall, taken as + given, a segment now turns by up to 2.0° per solver step, which the run notes); the light + cable stays at 0.092 / 0.106 MN at `dtM` 0.1 s and its largest segment tension at `dtM` + 0.01 s moves from 0.107 to 0.095 MN. Its fairlead and anchor peaks at `dtM` 2.5 ms move from + 0.099 / 0.091 to 0.102 / 0.119 MN, and on the stiff seabed at `dtM` 0.05 s from 0.52 / 0.67 + to 0.62 / 0.86 MN. None of these is a converged peak: the undamped `EI = 0` cable has no + converged snap peak (see the force-blend entry below; converged finite-EI runs give 0.093 / + 0.057 MN). At a step that does not resolve the axial wave the sub-steps resolve more of the + segment rattle of this undamped cable and can raise isolated spikes, as its anchor peak at + 2.5 ms shows. At `dtM` 0.5 ms, where the step resolves the wave, the cable takes no sub-step, + with or without physical axial damping (`BA` 5.06e5 N·s), and its results equal those taken + as given bit for bit; without the axial-wave condition on the snap trigger `auto` sub-stepped + 8081 of the 60000 steps of that run and raised its anchor peak from 0.116 to 0.52 MN. `ei0_substep_max` and `ei0_substep_angle` do not change these runs. Validation: + the Bergdahl matrix at its 0.3125 ms step resolves the axial wave over a segment and takes no + sub-step, so its maxima are unchanged bit for bit (RMSE 1.58 N, MAPE 3.13 %, Pearson 0.993, + Lin concordance 0.989); of its refinement runs the 0.1 m mesh moves the T = 1.25 s mean + cycle maximum from 68.33 to 68.35 N (largest mesh-halving change 0.52 % to 0.56 %) and the + 0.625 ms step from 72.2 to 69.5 N. The WD0050/A2 cell of the L2-2 parity moves within its + recorded range (largest OrcaFlex summary difference 0.091 to 0.093, MoorDyn-C metric 0.078 + to 0.076); the other L2-2 cells, the one-hour VolturnUS-S record, the L3-2 regular-wave + comparison and the snap-load verification are unchanged bit for bit (the latter two step + the generalised-α kernel directly). `off ei0_substeps` gives the previous results bit for + bit. - Finite-EI node tension, curvature and bend moment are recovered from nodal equilibrium. The `TenN`, `CurvN` and `BendMomN` channels, the `Tension`, `Curvature` and `BendMoment` columns of the static profile and the range graph, and the `.t.out` segment @@ -483,7 +511,7 @@ All notable changes to CableDyn are recorded in this file. The format follows deck (`CableDyn_InitLine`, `CableDyn_InitLines`) always take the force blend. The figures of this entry take every step as given, as `off ei0_substeps` now does; the rotation- and snap-resolved sub-steps of the default (under Changed) move the snap peaks among them, for - example the chain–polyester anchor to 4.65 MN and the viscoelastic light cable to 0.092 MN. + example the chain–polyester anchor to 4.65 MN and the viscoelastic light cable to 0.062 MN. - `modified_newton` on `EI = 0` lines (with or without the force blend, so also under `False alpha_force_blend`) rebuilds the tangent when an iterate reduces the residual by less than a factor four, as the manual states; it had kept the first tangent for the whole step, diff --git a/VALIDATION.md b/VALIDATION.md index 44f084d1..3626f377 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -76,7 +76,7 @@ article's methods, are compared in | **L3-6e** | Out-of-plane / 3D whirl response | OrcaFlex 11.6d | 3D curv 0.52%, interior Y env ≤1.0 mm, sag ≤22 mm, tension 0.14/0.17/0.12% | curv <3%, env <5 cm, tension <2–3% | Pass | | **L3-7** | 1-hour VolturnUS-S mooring dynamic | OrcaFlex 11.6d | `FairTen` mean 0.27%, std 0.26%, min/max 0.50/0.43%, Fourier 0.27/1.14% | ≤5% | Pass | | **L3-H** | Holcombe static lazy-wave experiment | measured marker geometry | position RMSE 1.07–1.89% of suspended length; peak marker-curvature error 0.34–5.54% | end-restraint bracket | Pass | -| **L3-B** | Bergdahl chain experiment, 30 orbit conditions | measured upper-end force | RMSE 1.59 N; MAPE 3.13%; Pearson 0.993; Lin concordance 0.989 | full published matrix | Pass | +| **L3-B** | Bergdahl chain experiment, 30 orbit conditions | measured upper-end force | RMSE 1.58 N; MAPE 3.13%; Pearson 0.993; Lin concordance 0.989 | full published matrix | Pass | | **L-fig** | Along-arc curvature overlay (CableDyn / OrcaFlex / MoorDyn-F ±4×) | 3-code committed record | CableDyn peak 0.11% from OrcaFlex | <0.5% | Pass | | **L4-1** | Coupled platform + mooring | synthetic reference | bit-for-bit | — | Pass | | **L4-1b** | VolturnUS-S coupled platform + power cable | OpenFAST v5.0.0 (CompMooring 5 vs 3) | platform DOFs <0.6% (3-seed DLC-1.1); fairlead and anchor <0.001% static | <3% platform | Pass | @@ -289,16 +289,18 @@ scripts, results, and source provenance are in - **L3-B Bergdahl dynamic chain test** ([Bergdahl et al., 2016](https://cabledyn.readthedocs.io/en/latest/references.html#ref-bergdahl2016)): over the full 30-condition period-radius matrix, cycle-maximum upper-end force - has RMSE 1.59 N, mean absolute percentage error 3.13%, Pearson correlation + has RMSE 1.58 N, mean absolute percentage error 3.13%, Pearson correlation 0.993, and Lin concordance 0.989. Two phase-averaged measured histories have waveform RMSEs of 5.95% and 2.54% of their force ranges; these two were computed with the executable of the 2026-10-09 record (the configuration-blended `EI = 0` step, without sub-steps), because the article supplement's `expData.dat` they need was not available for the rerun (see the experiment's README and `provenance.json`). Halving the mesh length - and the time step changes the mean cycle maximum by at most 0.53% and 0.13%. The - 0.3125 ms step resolves the segment axial modes that the snap loads excite; at - 0.625 ms the T = 1.25 s maxima are 2.3% higher (6.5% with every step taken as given), and + and the time step changes the mean cycle maximum by at most 0.56% and 0.19%. The + 0.3125 ms step resolves the segment axial modes that the snap loads excite (and the axial + wave over a segment, so the matrix takes no rotation- and snap-resolved sub-step and equals + the run taken as given bit for bit); at + 0.625 ms the T = 1.25 s maxima are 2.4% higher (6.5% with every step taken as given), and at 1.25 ms they are 2–15% higher and vary from cycle to cycle. ## L4 coupled OpenFAST @@ -391,7 +393,8 @@ scripts, results, and source provenance are in 80 m all-chain mooring in 5 m / 7 s heave are 15% and 17% low when every step is taken as given (`off ei0_substeps`) and 4% and 8% low with the default `auto`; the anchor maxima of the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge are 16% and 26% high and - 1.4% and 2.6% low. In 5 m / 7 s surge the 80 m maxima are within 2.5% either way. On the + 4% high and 2% low (over thirteen runs 5% high and 0.3% low; single runs from 4% low to 21% + high). In 5 m / 7 s surge the 80 m maxima are within 2.5% either way. On the 0.1 s output grid the converged run itself reads the 80 m heave maxima 5% low. - **Implicit and explicit steps**: on the matched near-taut snap, MoorDyn-C's explicit RK2 needs `dtM ≲ 1 ms`, as expected of an explicit scheme at this line @@ -689,9 +692,9 @@ chain–polyester moorings are driven through the same surge-and-heave envelope `dtM = 0.1 s` (72 s each). All 20 runs complete. With the default `ei0_substeps auto`, the steps in which a taut segment turns by more than 1° or a segment snaps taut are solved in 4 to 7 sub-steps: none to 3% of the steps in the 3 m / 10 s and 8 m / 20 s -motions, 31–74% in the 5 m / 7 s and 10 m / 14 s ones. The march takes 0.24–0.94 ms of +motions, 31–75% in the 5 m / 7 s and 10 m / 14 s ones. The march takes 0.24–0.94 ms of wall time per 0.1 s step for the all-chain mooring and 0.32–1.2 ms for the composite, -1.63 times the plain steps over the 20 runs (1.6 to 2.5 times on the 5 m / 7 s and +1.67 times the plain steps over the 20 runs (1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s motions), and the recovering step subdivides at most 12 of the 720 intervals of a run. diff --git a/doc/driver_format.md b/doc/driver_format.md index 74f01f80..83c23521 100644 --- a/doc/driver_format.md +++ b/doc/driver_format.md @@ -1026,7 +1026,7 @@ syntax form. The most frequently edited keywords are: | `tensile_safety` | `False`, `warn`, or `True`; audits the element-mean axial force (three-point Gauss mean of the signed axial resultant, averaged over an element and its two neighbours). `True` rejects. `warn` commits the state, counts accepted-step events, and reports the worst force, threshold, element and time (the printed `xi` is always 0.5, the element centre) | `False` | | `tensile_strain_tolerance` | non-negative strain band for the dynamic tensile audit | `2e-6` | | `recovery_max_substeps` | integer from 4 to 65536; maximum step subdivision for dynamic-step recovery on tension-only and bending lines. Internal prescribed states lie on one C2 quintic trajectory and land on the nominal coupling endpoint. The standalone summary reports recovered intervals and the largest subdivision used | `1024` | -| `ei0_substeps` | `auto` or `off`. `auto` solves a converged `EI = 0` step again in `max(4, ceil(turn/ei0_substep_angle))` equal sub-steps (at most `ei0_substep_max`) when a segment that ends it taut turned by more than `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of the largest step-start tension; the end motion follows the C2 quintic of the recovering step, and output and coupling times are unchanged. `off` takes every step as given. Steps of the monolithic body and point coupling are not sub-stepped | `auto` (`off` with `False alpha_force_blend`) | +| `ei0_substeps` | `auto` or `off`. `auto` solves a converged `EI = 0` step again in `max(4, ceil(turn/ei0_substep_angle))` equal sub-steps (at most `ei0_substep_max`) when a segment that ends it taut turned by more than `ei0_substep_angle`, or a segment slack at its start ends it above a quarter of the largest step-start tension while the step does not resolve the axial wave over it; the end motion follows the C2 quintic of the recovering step, and output and coupling times are unchanged. `off` takes every step as given. The lines attached to the bodies, rods and points of the monolithic body and point coupling (the default `bodyScheme` of decks with them) are not sub-stepped | `auto` (`off` with `False alpha_force_blend`) | | `ei0_substep_angle` | real in (0, 90], deg; largest taut-segment turn per step before `auto` sub-steps it | `1.0` | | `ei0_substep_max` | integer from 2 to 1024; most sub-steps `auto` takes for one step | `16` | | `axial_quadrature_order` | Gauss order 1–6 for the finite-EI axial energy; a value different from the bending order gives selective integration | `4` | diff --git a/doc/modeling.rst b/doc/modeling.rst index 1631fa0f..45bc5616 100644 --- a/doc/modeling.rst +++ b/doc/modeling.rst @@ -156,9 +156,11 @@ axially stiff cable (80 kg/m, EA 8e8 N, 2 m segments) in 3 m heave it rises from solver, while converged finite-EI runs give 0.093 MN at the fairlead and 0.057 MN at the anchor. To obtain converged peaks, give such lines physical axial damping, ``BA`` as a material property in N·s (the negative, per-segment damping-ratio form changes with the mesh: it halves -with each halving of the segment length), or model them with finite ``EI``. With ``BA = 0`` the -sub-steps of ``ei0_substeps auto`` resolve more of the segment rattle and can raise isolated -spikes. +with each halving of the segment length), or model them with finite ``EI``. With ``BA = 0`` and +a ``dtM`` that does not resolve the axial wave over a segment, the sub-steps of +``ei0_substeps auto`` resolve more of the segment rattle and can raise isolated spikes (at +``dtM = 2.5 ms`` the anchor peak of that cable rises from 0.091 to 0.119 MN); at a ``dtM`` that +resolves the wave a snap does not trigger them, and at 0.5 ms the cable takes no sub-step. 6. Establish the static initial condition ----------------------------------------- diff --git a/doc/options.rst b/doc/options.rst index 4e7f2b0c..f01f4ee6 100644 --- a/doc/options.rst +++ b/doc/options.rst @@ -358,22 +358,36 @@ rejected as unknown. The dynamic Newton controls are set with ``dynamic_solver`` - ``auto``; ``off`` with ``False alpha_force_blend`` - ``auto`` or ``off``. ``auto``: a converged step of an ``EI = 0`` line in which a segment that ends the step taut (above 0.1 % of the largest step-start tension) turned by more - than ``ei0_substep_angle``, or a segment slack at - the start of the step ended it above a quarter of the largest step-start tension, is - solved again from the same committed state in ``max(4, ceil(turn/ei0_substep_angle))`` - equal sub-steps (at most ``ei0_substep_max``). The end motion inside the step follows + than ``ei0_substep_angle``, or a segment slack at the start of the step ended it above a + quarter of the largest step-start tension while the step does not resolve the axial wave + over the segment (the wave crosses it more than once per step), is solved again from the + same committed state in ``max(4, ceil(turn/ei0_substep_angle))`` equal sub-steps (at most + ``ei0_substep_max``). The tensions are those of the run audit (the elastic tension, or that + of the viscoelastic or Syrope law), and the step-start tension is taken as at least 0.1 % + of the line's initial tension, so a line slack all over at the step start does not count + barely taut segments. The end motion inside the step follows the C2 quintic of the recovering step and the last sub-step lands on the given end state; the output and coupling times are unchanged. At ``dtM = 0.1`` s a taut segment of the Lozon 80 m all-chain mooring turns by up to 6 deg per step in 5 m / 7 s heave, and both generalised-α blends then give snap-load peaks 10 to 20 % low; with ``auto`` they are 4 % and 8 % low on average, within 4 % of the converged run sampled at the same 0.1 s output times, at 1.6 to 2.5 times the wall time of the plain steps on the 5 m / 7 s and - 10 m / 14 s motions (1.63 times over the 20-case Lozon mooring envelope). If a sub-step - does not converge, the plain step's own result is kept. ``off`` takes every step as - given, as before this option. Steps of the monolithic body and point coupling - (``monolithic bodyScheme``) are never sub-stepped, and the standalone driver notes it - once per run. The standalone driver reports the sub-stepped steps per line, and OpenFAST - and FAST.Farm runs report them at the end of the run. See :doc:`theory` + 10 m / 14 s motions (1.67 times over the 20-case Lozon mooring envelope). A step that + triggers costs its plain step and usually four sub-steps, at most the plain step and + three passes of ``ei0_substep_max`` sub-steps (49 line solves at the default) when the + sub-stepped interval is measured again and that pass fails; where bodies or rods + sub-cycle the lines ``n`` times per ``dtM`` (``staggered bodyScheme``, coupled runs), + each sub-cycle is such a step, so the worst case is ``n (1 + 3 ei0_substep_max)`` line + solves per ``dtM``. If a sub-step does not converge, the plain step's own result is + kept. ``off`` takes every step as given, as before this option. ``monolithic + bodyScheme`` is the default of every standalone deck with ``Rigid6`` bodies, ``Point3`` + buoys, rods or ``Free``/``Connect`` points on ``EI = 0`` lines (7 of the shipped example + decks): its junction Newton needs the end reaction and tangent of the whole step, so the + lines attached to those objects and points are not sub-stepped (a line whose ends are all + fixed or anchored is), and the driver notes it once per run; ``staggered bodyScheme`` + sub-steps them. The standalone driver reports the sub-stepped steps per line, and + OpenFAST and FAST.Farm runs report them at the end of the run. The settings are checked + when the line is initialised. See :doc:`theory` - both (``EI = 0`` lines) - ``off ei0_substeps`` * - ``ei0_substep_angle`` / ``ei0substepangle`` diff --git a/doc/theory.rst b/doc/theory.rst index e05c75be..15713c8a 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1530,8 +1530,10 @@ compilers and platforms give other values) and at 0.145 MN without it, against 0 0.095 MN at :math:`\Delta t` from 0.5 to 2.5 ms. A taut Syrope line in 4 m surge that goes slack peaks at 1.64 MN at 0.1 s, against 1.78 MN at 1 and 2.5 ms, with or without the cap. These figures take every step as given (``off ei0_substeps``); with the -rotation- and snap-resolved sub-steps of the default (below) the two lines peak at 0.092 MN and -1.82 MN. +rotation- and snap-resolved sub-steps of the default (below) the two lines peak at 0.062 MN and +1.81 MN. A single peak of an unresolved snap says little: over seven runs whose heave amplitude +differs by up to :math:`3\times10^{-4}` the viscoelastic anchor peaks at 0.056 to 0.079 MN +(mean 0.063 MN) with the sub-steps and at 0.056 to 0.085 MN (mean 0.065 MN) without them. An elastic segment with axial damping (``BA``) also keeps :math:`\alpha_f T_{d,n}` along :math:`\mathbf{t}_n`, :math:`T_{d,n}` the tension of its dashpot at :math:`t_n`. A segment that @@ -1664,8 +1666,16 @@ partly subdivided state is ever committed. **Rotation- and snap-resolved sub-steps** (``ei0_substeps auto``, the default). A converged ``EI = 0`` step is measured against its committed start: the largest chord turn :math:`\theta` of a segment that ends the step above :math:`10^{-3}\,T_\text{max}`, the -largest step-start tension (tensions from the static ``EA`` and the step's unstretched -lengths), and whether a segment slack at the start ends above :math:`T_\text{max}/4`. A +largest step-start tension, and whether a segment slack at the start ends above +:math:`T_\text{max}/4` while the axial wave crosses it more than once in the step +(:math:`\Delta t\,c/l_0 > 1`, :math:`c` from the dynamic axial stiffness as in the run audit +below); a step that resolves the axial wave resolves the snap as given. The tensions are those +the run audit takes, the elastic tension of a plain segment and the law's tension of a +viscoelastic or Syrope one, with the step's unstretched lengths, and :math:`T_\text{max}` is at +least :math:`10^{-3}` of the line's initial tension, so a line slack all over at the step start +does not count barely taut segments. (A floor at the initial tension itself raised the snap +threshold in the slack phases of the Lozon semitaut line below, whose anchor peaks then came +out up to 29 % high.) A segment slack at the step start counts for the turn: counting only segments taut at both ends of the step left the Lozon semitaut anchor peaks (below) up to 5 % high on average and up to 25 % high in single runs. When :math:`\theta` exceeds ``ei0_substep_angle`` @@ -1677,12 +1687,18 @@ the last sub-step on the target state. The trial step under-turns a line whose r not resolve, so the sub-stepped interval is measured again; when its turn needs more sub-steps it is solved once more with them. If a sub-step does not converge, the plain step's own result is kept. A step recovered after a stall (above) and the halves of a line-system step -halved after a failure take their sub-steps as given. The decision uses only the committed -state and the step inputs, so a restart repeats it, and the host time grid, output and -coupling times are unchanged. Every route that steps ``EI = 0`` lines uses it (standalone lines and line systems, OpenFAST, FAST.Farm and the -C API), except the monolithic body and point coupling, whose junction Newton needs the end -reaction and condensed end tangent of the nominal step; ``off`` takes every step as given, and -``False alpha_force_blend`` turns it off unless the deck sets it. +halved after a failure take their sub-steps as given; when the halves fail too, the full step +is re-run as the nominal step, sub-steps included. The decision uses only the committed state, +the step inputs and the line's initial tension, so a restart repeats it, and the host time +grid, output and coupling times are unchanged. Every route that steps ``EI = 0`` lines uses it +(standalone lines and line systems, OpenFAST, FAST.Farm and the C API), except the lines +attached to the bodies, rods and points of the monolithic body and point coupling, whose +junction Newton needs the end reaction and condensed end tangent of the nominal step (a line of +such a deck whose ends are all fixed or anchored is sub-stepped); ``off`` takes every step as +given, and ``False alpha_force_blend`` turns it off unless the deck sets it. A step that +triggers costs the plain step and usually four sub-steps; at most it costs the plain step and +three passes of ``ei0_substep_max`` sub-steps, once for each object sub-step where bodies or +rods sub-cycle the lines. At ``dtM`` 0.1 s a taut segment of the Lozon 80 m all-chain mooring turns by up to 6° per step under 5 m / 7 s heave. Over seven runs whose heave amplitude differs by up to @@ -1694,12 +1710,13 @@ than 1 %. The peaks follow the algorithmic damping instead: 28 % and 31 % low at :math:`\rho_\infty = 0`, 10 % and 40 % high at 0.6. With ``auto`` they are 4 % and 8 % low (1 % high and 4 % low against the reference sampled on the same 0.1 s output grid), and the anchor maxima of the 200 m semitaut mooring in 10 m / 14 s and 5 m / 7 s surge, 16 % and 26 % -high taken as given, are within 3 %. +high taken as given, are 4 % high and 2 % low (over thirteen runs 5 % high and 0.3 % low, single +runs from 4 % low to 21 % high). Two or three sub-steps of a step that turned by 1 to 3° left those anchor peaks 8 % high on average (up to 22 %); four bring them within 3 %, hence the minimum. Resolving the sub-steps of a step recovered after a stall as well left them 9 % high, so the recovery takes its sub-steps as given. Over the 20 motions of the Lozon mooring envelope at ``dtM`` 0.1 s the march takes -1.63 times as long as with plain steps, 1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s +1.67 times as long as with plain steps, 1.6 to 2.5 times on the 5 m / 7 s and 10 m / 14 s motions. **Step size.** Being implicit, the scheme is not bound by the explicit axial-wave limit. In the diff --git a/doc/troubleshooting.rst b/doc/troubleshooting.rst index 442e894d..bbe679ab 100644 --- a/doc/troubleshooting.rst +++ b/doc/troubleshooting.rst @@ -579,20 +579,30 @@ Warnings and notes that do not stop a run ``off ei0_substeps`` set ``auto`` (the default) or reduce ``dtM``; with ``auto`` the note means steps it did not resolve (more than ``ei0_substep_max`` needed, a step recovered after a stall or a half of a line-system step halved after a failure, whose sub-steps - are taken as given, a step that kept its plain result because a sub-step failed, or the - monolithic body and point coupling, which is not sub-stepped): reduce ``dtM``. - * - ``Note: line ...: ei0_substeps auto solved ... of ... solver step(s) in sub-steps`` + are taken as given, a step that kept its plain result because a sub-step failed, or a + line attached to a body, rod or point of the monolithic body and point coupling, which + is not sub-stepped): reduce ``dtM``. + * - ``Note: line ...: ei0_substeps auto solved ... of the ... line step(s) it examined in sub-steps`` - information: the steps in which a taut segment turned by more than ``ei0_substep_angle`` or a segment snapped from slack to taut were solved in sub-steps (see - ``ei0_substeps``). A companion note counts the steps that needed more than - ``ei0_substep_max`` sub-steps, and another the steps that kept the plain step's result - because a sub-step did not converge. OpenFAST and FAST.Farm print the same counts, summed - over the lines, as ``CableDyn: ei0_substeps auto solved ...`` at the end of the run. - * - ``Note: ei0_substeps auto does not sub-step the EI = 0 lines of the monolithic body/point step`` - - information, once per run of a deck with ``monolithic bodyScheme`` coupling: the lines - stepped inside the body and point junction are taken at ``dtM`` as given, so their - rotation and snaps are resolved only as far as ``dtM`` resolves them. Reduce ``dtM`` when - the segment-turn note above appears for them. + ``ei0_substeps``). Only committed steps count: a step that is rolled back and taken + again (a line-system step halved after a stall, a step recovered after a stall, a + corrector or a re-solved coupling step) counts once, as it is finally taken, so the + steps examined can be fewer than the line's steps. A companion note counts the steps + that needed more than ``ei0_substep_max`` sub-steps, and another the steps that kept the + plain step's result because a sub-step did not converge. OpenFAST and FAST.Farm print the + same counts, summed over the lines, as ``CableDyn: ei0_substeps auto solved ...`` at the + end of the run. + * - ``Note: ei0_substeps auto does not sub-step the EI = 0 lines attached to the bodies, rods and points of the monolithic body/point step`` + - information, once per run of a deck with ``monolithic bodyScheme`` coupling, the default + of every standalone deck with ``Rigid6`` bodies, ``Point3`` buoys, rods or + ``Free``/``Connect`` points on ``EI = 0`` lines (7 of the shipped example decks): the + lines attached to those objects and points are stepped inside the junction Newton and + taken whole at each monolithic step (``dtM``, divided by ``accuracy bodySubstep``, the + default, to resolve the body-mooring modes), so their rotation and snaps are resolved + only as far as that step resolves them; a line whose ends are all fixed or anchored is + sub-stepped as usual. Reduce ``dtM`` when the segment-turn note above appears for them, + or select ``staggered bodyScheme``, which sub-steps them. * - ``Note: line ...: ... segment step(s) went from slack to taut above the initial tension`` - snap loads on an ``EI = 0`` line at a solver step that does not resolve the axial wave over a segment: the peak is set by a single step. A 15 m surge of a semi-taut @@ -600,7 +610,8 @@ Warnings and notes that do not stop a run (5.7 MN with ``off ei0_substeps``) against 4.6 MN at 0.0025 s. The run is valid; confirm design peaks with a smaller ``dtM``. On a line without axial damping (``BA = 0``) the snap peaks do not converge in time or mesh, as single segments rattle; a smaller ``dtM`` - raises them, and the sub-steps of ``ei0_substeps auto`` can raise isolated spikes. Give + raises them, and at a ``dtM`` that does not resolve the axial wave the sub-steps of + ``ei0_substeps auto`` can raise isolated spikes. Give the line physical axial damping (``BA`` in N·s, not the per-segment damping-ratio form, which changes with the mesh) or finite ``EI`` to obtain converged peaks (see :doc:`modeling`). diff --git a/python/tests/test_deck_file.py b/python/tests/test_deck_file.py index e04faf75..c8c783b6 100644 --- a/python/tests/test_deck_file.py +++ b/python/tests/test_deck_file.py @@ -673,6 +673,7 @@ def test_unknown_scalar_option_keyword_fails_closed(tmp_path): ("1", "ei0_substep_max", r"integer in \[2, 1024\]"), ("2.5", "ei0_substep_max", r"integer in \[2, 1024\]"), ("1025", "ei0SubstepMax", r"integer in \[2, 1024\]"), + ("2048.5", "ei0_substep_max", r"integer in \[2, 1024\]"), ], ) def test_invalid_scalar_option_values_fail_closed(tmp_path, value, keyword, message): @@ -754,6 +755,7 @@ def test_zero_e_exponent_waterkin_mode_is_accepted(tmp_path): "90 ei0SubstepAngle", "2 ei0_substep_max", "1024 ei0SubstepMax", + "1.9999999999999998 ei0_substep_max", ], ) def test_native_scalar_option_vocabulary_is_accepted(tmp_path, row): diff --git a/src/CableDyn_DeckDriver.f90 b/src/CableDyn_DeckDriver.f90 index a3df3c59..497f5ffd 100644 --- a/src/CableDyn_DeckDriver.f90 +++ b/src/CableDyn_DeckDriver.f90 @@ -13074,11 +13074,14 @@ SUBROUTINE apply_option(line, opts, ErrStat, ErrMsg) CASE ('ei0_substep_max', 'ei0substepmax') CALL rd(val, x1, ErrStat, ErrMsg) IF (ErrStat == 0) THEN - IF (.NOT. IEEE_IS_FINITE(x1) .OR. x1 < 2.0_wp .OR. x1 > 1024.0_wp) THEN - CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be in [2,1024]'); RETURN + ! the rule of the Python deck reader: an integer to within 16 ulp, whose nearest integer + ! lies in [2, 1024] (a value beyond 2048 in magnitude fails either test there) + IF (.NOT. IEEE_IS_FINITE(x1) .OR. ABS(x1) > 2048.0_wp) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be an integer in [2, 1024]'); RETURN END IF - IF (ABS(x1 - REAL(NINT(x1), wp)) > 16.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, ABS(x1))) THEN - CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be an integer'); RETURN + IF (ABS(x1 - REAL(NINT(x1), wp)) > 16.0_wp*EPSILON(CD_ONE)*MAX(CD_ONE, ABS(x1)) .OR. & + NINT(x1) < 2 .OR. NINT(x1) > 1024) THEN + CALL fail(ErrStat, ErrMsg, 'OPTION ei0_substep_max must be an integer in [2, 1024]'); RETURN END IF opts%ei0_substep_max = NINT(x1) END IF @@ -18045,13 +18048,14 @@ SUBROUTINE write_multibody_dynamic_out(deck_path, out_root, channels, types, bod IF (mb%implicit .AND. mb%n_steps_imp > 0) THEN WRITE (*, '(A,F6.2,A,I0,A,I0)') ' Monolithic body/point step: mean outer iterations ', & REAL(mb%n_outer, wp)/REAL(mb%n_steps_imp, wp), ', max ', mb%max_outer, ', step halvings ', mb%n_subdiv - ! the junction Newton needs the nominal step's end reaction and tangent, so ei0_substeps - ! auto leaves these line steps whole (noted once per run) + ! the junction Newton needs the nominal step's end reaction and tangent of every line + ! attached to a body, rod or point it solves, so ei0_substeps auto leaves those line steps + ! whole (noted once per run); a line with no such end is sub-stepped as usual IF (mb%has_sys) THEN IF (ANY(mb%system%lines(:)%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO)) & - WRITE (*, '(A)') ' Note: ei0_substeps auto does not sub-step the EI = 0 lines of the monolithic '// & - 'body/point step (it needs the end reaction and tangent of the whole step); reduce dtM to resolve '// & - 'their rotation and snaps.' + WRITE (*, '(A)') ' Note: ei0_substeps auto does not sub-step the EI = 0 lines attached to the '// & + 'bodies, rods and points of the monolithic body/point step (it needs the end reaction and tangent '// & + 'of the whole step); reduce dtM to resolve their rotation and snaps.' END IF END IF CALL CD_Classify_Dynamic_Completion('multibody dynamic run', nstep, miss_count, max_consecutive_miss, & @@ -27521,17 +27525,18 @@ SUBROUTINE report_model_audit(model, line_id, dt) CHARACTER(200) :: remedy REAL(wp) :: turn_note auto = model%cfg%ei0_substeps == CD_EI0_SUBSTEPS_AUTO - IF (auto .AND. model%sub_events > 0) THEN + IF (auto .AND. model%sub_stats%events > 0) THEN WRITE (output_unit, '(A,I0,A,I0,A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', line_id, & - ': ei0_substeps auto solved ', model%sub_events, ' of ', model%sub_calls, & - ' solver step(s) in sub-steps to resolve segment rotation and slack-to-taut snaps (at most ', & - model%sub_max_used, ' per step).' - IF (model%sub_capped > 0) WRITE (output_unit, '(A,I0,A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', line_id, & - ': ', model%sub_capped, ' step(s) needed more than ei0_substep_max = ', model%cfg%ei0_substep_max, & - ' sub-steps; raise it or reduce dtM.' - END IF - IF (auto .AND. model%sub_fallbacks > 0) WRITE (output_unit, '(A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', & - line_id, ': ', model%sub_fallbacks, ' step(s) kept the whole step because a resolving sub-step did not converge.' + ': ei0_substeps auto solved ', model%sub_stats%events, ' of the ', model%sub_stats%calls, & + ' line step(s) it examined in sub-steps to resolve segment rotation and slack-to-taut snaps (at most ', & + model%sub_stats%max_used, ' sub-steps per step).' + IF (model%sub_stats%capped > 0) WRITE (output_unit, '(A,I0,A,I0,A,I0,A)', IOSTAT=ios) ' Note: line ', & + line_id, ': ', model%sub_stats%capped, ' step(s) needed more than ei0_substep_max = ', & + model%cfg%ei0_substep_max, ' sub-steps; raise it or reduce dtM.' + END IF + IF (auto .AND. model%sub_stats%fallbacks > 0) WRITE (output_unit, '(A,I0,A,I0,A)', IOSTAT=ios) & + ' Note: line ', line_id, ': ', model%sub_stats%fallbacks, & + ' step(s) kept the whole step because a resolving sub-step did not converge.' ! with ei0_substeps auto a step is solved in sub-steps whose average turn is at most ! ei0_substep_angle; a single sub-step can turn slightly more turn_note = EI0_TURN_NOTE diff --git a/src/CableDyn_Model.f90 b/src/CableDyn_Model.f90 index ea5d2bd2..a3198b82 100644 --- a/src/CableDyn_Model.f90 +++ b/src/CableDyn_Model.f90 @@ -56,8 +56,9 @@ MODULE CableDyn_Model CD_Added_Mass_Element, CD_Added_Mass_Element_Matrix, CD_Added_Mass_Element_Force USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_CableGenAlphaWorkspace, CD_Clear_GenAlpha_Workspace, & CD_Cable_Initial_Acceleration, CD_Cable_Gen_Alpha_Step, CD_DYN_OK, CD_DYN_ALLOCFAIL, & - CD_EI0_SUBSTEPS_AUTO + CD_EI0_SUBSTEPS_AUTO, CD_EI0_SUBSTEPS_OFF USE CableDyn_Mesh, ONLY: CD_Partition_Free_Dofs, CD_Validate_Connectivity + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: int64 USE CableDyn_Linalg, ONLY: CD_Solve_Dense_As_Banded, CD_Solve_Dense_As_Banded_Multiple, CD_Factor_Banded, & CD_Solve_Factored_Banded_Multiple USE CableDyn_Profile, ONLY: CD_Profile_Count_Line_Step @@ -65,6 +66,7 @@ MODULE CableDyn_Model PRIVATE PUBLIC :: CD_ModelType + PUBLIC :: CD_SubstepStats PUBLIC :: CD_Init_Model PUBLIC :: CD_Init_Line_Model PUBLIC :: CD_Step_Model @@ -114,18 +116,45 @@ MODULE CableDyn_Model INTEGER, PARAMETER, PUBLIC :: CD_MODEL_NOT_INITIALIZED = 3 INTEGER, PARAMETER, PUBLIC :: CD_MODEL_ALLOCFAIL = 4 INTEGER, PARAMETER :: MODEL_DEFAULT_MAX_SUBSTEPS = 1024 - ! Rotation- and snap-resolved sub-stepping (CD_Step_Model, cfg%ei0_substeps): a segment that - ! ends the step taut above SUB_TAUT_FRACTION of the largest step-start tension counts for the - ! turn (the run audit's floor, relative to the step-start tension because only the standalone - ! driver knows the initial one), also when it was slack at the start: counting only segments - ! taut at both ends left the Lozon semitaut anchor snap peaks up to 25 % high. One slack at - ! the step start that ends above SUB_SNAP_FRACTION of that tension is a snap. A step solved - ! in sub-steps takes at least SUB_SNAP_STEPS of them: on the Lozon semitaut line two or three - ! sub-steps of a step that turned 1 to 3 deg left the anchor snap peaks 8 % high on average - ! (up to 22 %), four brought them within 3 % of the converged run. + ! Rotation- and snap-resolved sub-stepping (CD_Step_Model, cfg%ei0_substeps). The tension + ! scale of a step is the largest step-start tension, floored at SUB_TAUT_FRACTION of the + ! line's initial tension (sub_t_init, the largest at CD_Init_Model): a line slack all over at + ! the step start would otherwise count any segment that ends it barely taut. (Flooring at the + ! initial tension itself raised the snap threshold in the slack phases of the Lozon semitaut + ! line, whose anchor snap peaks then came out up to 29 % high.) A segment that ends the step + ! taut above SUB_TAUT_FRACTION of the scale counts for the turn (the run audit's floor), also + ! when it was slack at the start: + ! counting only segments taut at both ends left the Lozon semitaut anchor snap peaks up to + ! 25 % high. One slack at the step start that ends above SUB_SNAP_FRACTION of the scale is a + ! snap when the step does not resolve its axial wave (dt c/l0 > 1, c from the dynamic axial + ! stiffness; a step that does resolves the snap as given). A step solved in sub-steps takes + ! at least SUB_SNAP_STEPS of them: on the Lozon semitaut line two or three sub-steps of a step + ! that turned 1 to 3 deg left the anchor snap peaks 8 % high on average (up to 22 %), four + ! brought them within 3 % of the converged run. The tensions are those the run audit takes: + ! the dynamic EA times the strain of an elastic segment, the law's tension of a viscoelastic + ! or Syrope one. REAL(wp), PARAMETER :: SUB_TAUT_FRACTION = 1.0e-3_wp, SUB_SNAP_FRACTION = 0.25_wp INTEGER, PARAMETER :: SUB_SNAP_STEPS = 4 + ! The state a line step commits, as the sub-stepping (CD_Step_Model) saves it in its two + ! slots. commit_state_copy holds the one list of that state. + TYPE :: CD_ModelCommitSlot + REAL(wp), ALLOCATABLE :: q(:), v(:), a(:), ve_dl_1(:), syrope_slow(:), syrope_tmax(:) + REAL(wp), ALLOCATABLE :: fr_anchor(:, :) + END TYPE CD_ModelCommitSlot + + ! Diagnostics of the rotation- and snap-resolved sub-stepping (CD_Step_Model): calls counts + ! the steps it examined, events those it solved in sub-steps (max_used the largest count), + ! capped those whose turn needed more than cfg%ei0_substep_max, fallbacks those that returned + ! to the plain step after a sub-step failed, remeasured those whose sub-stepped interval + ! needed more sub-steps and was solved again. Only committed steps count: the line system + ! rolls these back with the line states (CableDyn_System), and a stalled step that + ! CD_Step_Model_Recovering takes again in its rungs (as given) is not counted. + TYPE :: CD_SubstepStats + INTEGER(int64) :: calls = 0, events = 0, capped = 0, fallbacks = 0, remeasured = 0 + INTEGER :: max_used = 1 + END TYPE CD_SubstepStats + TYPE :: CD_ModelType !! Persistent positions-only EI=0 model state and immutable mesh/properties. LOGICAL :: initialized = .FALSE. @@ -326,20 +355,20 @@ MODULE CableDyn_Model ! step, or a sub-step of the resolved or the recovering step); the audit measures turns and ! axial wave crossings per solver step with it. Diagnostics only. REAL(wp) :: audit_hmax = CD_ZERO - ! Rotation- and snap-resolved sub-stepping (CD_Step_Model), diagnostics only: sub_calls - ! counts the steps it examined, sub_events those it solved in sub-steps (sub_max_used the - ! largest count), sub_capped those whose turn needed more than cfg%ei0_substep_max, and - ! sub_fallbacks those that returned to the plain step after a sub-step failed. The sub_* - ! arrays are scratch: the step-start snapshot and the sub-step boundary motion. - INTEGER :: sub_calls = 0, sub_events = 0, sub_max_used = 1, sub_capped = 0, sub_fallbacks = 0 - ! sub_remeasured: steps whose sub-stepped interval needed more sub-steps and was solved again - INTEGER :: sub_remeasured = 0 + ! Rotation- and snap-resolved sub-stepping (CD_Step_Model): sub_stats its diagnostics and + ! sub_stats_rollback their twin at the last save of the system-rollback state + ! (CableDyn_System). sub_t_init is the line's initial tension, which floors the tension + ! scale of a step (SUB_TAUT_FRACTION of it; the largest segment tension at CD_Init_Model, a + ! parameter of the line, copied with the model). The other sub_* arrays are scratch: + ! sub_slot(1) the committed state at the step start, sub_slot(2) the state the plain step + ! reached, sub_t0 and sub_t1 the segment tensions at the step start and end, and + ! sub_pq/pv/pa the sub-step boundary motion. + TYPE(CD_SubstepStats) :: sub_stats, sub_stats_rollback + REAL(wp) :: sub_t_init = CD_ZERO ! audit_hmax at the last save of the system-rollback state (CableDyn_System) REAL(wp) :: audit_hmax_rollback = CD_ZERO - ! slot 1: the committed state at the step start; slot 2: the state the plain step reached - REAL(wp), ALLOCATABLE :: sub_q(:, :), sub_v(:, :), sub_a(:, :), sub_pq(:), sub_pv(:), sub_pa(:) - REAL(wp), ALLOCATABLE :: sub_ve_dl_1(:, :), sub_syrope_slow(:, :), sub_syrope_tmax(:, :) - REAL(wp), ALLOCATABLE :: sub_fr_anchor(:, :, :) + TYPE(CD_ModelCommitSlot) :: sub_slot(2) + REAL(wp), ALLOCATABLE :: sub_t0(:), sub_t1(:), sub_pq(:), sub_pv(:), sub_pa(:) ! TEST-ONLY hooks of the sub-stepping, never set by a production caller: sub_test_fail > 0 ! makes sub-step number sub_test_fail of every sub-stepped pass report a failure, and ! sub_test_repeat solves the first sub-stepped pass twice (the second from the restored @@ -476,6 +505,17 @@ SUBROUTINE CD_Init_Model(model, q0, v0, elem_conn, l0, ea, rho_a, tension_only, CALL fail(ErrStat, ErrMsg, 'l0, ea, and rho_a must be finite and positive') RETURN END IF + ! the rotation- and snap-resolved sub-stepping settings (CD_Step_Model reads them per step) + IF (cfg%ei0_substeps /= CD_EI0_SUBSTEPS_AUTO .AND. cfg%ei0_substeps /= CD_EI0_SUBSTEPS_OFF) THEN + CALL fail(ErrStat, ErrMsg, 'cfg%ei0_substeps must be CD_EI0_SUBSTEPS_AUTO or CD_EI0_SUBSTEPS_OFF') + RETURN + END IF + IF (.NOT. (CD_Is_Finite(cfg%ei0_substep_angle) .AND. cfg%ei0_substep_angle > CD_ZERO .AND. & + cfg%ei0_substep_angle <= 90.0_wp .AND. cfg%ei0_substep_max >= 2 .AND. & + cfg%ei0_substep_max <= 1024)) THEN + CALL fail(ErrStat, ErrMsg, 'ei0_substep_angle must lie in (0, 90] deg and ei0_substep_max in [2, 1024]') + RETURN + END IF IF (ANY(elem_conn < 1) .OR. ANY(elem_conn > n_dof/3)) THEN CALL fail(ErrStat, ErrMsg, 'elem_conn contains a node index outside q0') RETURN @@ -1300,6 +1340,8 @@ SUBROUTINE CD_Init_Model(model, q0, v0, elem_conn, l0, ea, rho_a, tension_only, RETURN END IF model%initialized = .TRUE. + ! the line's initial tension, the floor of the tension scale of the sub-stepping (sub_count) + model%sub_t_init = initial_tension(model) CONTAINS @@ -1889,17 +1931,19 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, !! previous state. !! !! Rotation- and snap-resolved sub-stepping (cfg%ei0_substeps = CD_EI0_SUBSTEPS_AUTO, the - !! default): the step is solved as given; when it converges and a segment that ends it taut - !! turned by more than cfg%ei0_substep_angle degrees, or a segment slack at its start ends it - !! above SUB_SNAP_FRACTION of the largest step-start tension, the interval is - !! solved again from the same committed state in n = max(SUB_SNAP_STEPS, ceil(turn/angle)) - !! equal sub-steps, at most cfg%ei0_substep_max. The trial step under-turns a line whose - !! rotation it does not resolve, so the sub-stepped interval is measured again and, when its - !! turn needs more sub-steps, solved once more with them. The prescribed end motion inside - !! the interval follows the C2 quintic of CD_Step_Model_Recovering and the last sub-step - !! lands on the given end state exactly. The decision depends only on the committed state - !! and the step's inputs, so a run restarted from a checkpoint repeats it. If a sub-step - !! fails, the plain step's own result is returned. A step of the monolithic junction + !! default; the settings are checked by CD_Init_Model): the step is solved as given; when it + !! converges and a segment that ends it taut turned by more than cfg%ei0_substep_angle + !! degrees, or a segment slack at its start ends it above SUB_SNAP_FRACTION of the tension + !! scale while the step does not resolve its axial wave (see SUB_SNAP_FRACTION), the + !! interval is solved again from the same committed state in + !! n = max(SUB_SNAP_STEPS, ceil(turn/angle)) equal sub-steps, at most cfg%ei0_substep_max. + !! The trial step under-turns a line whose rotation it does not resolve, so the sub-stepped + !! interval is measured again and, when its turn needs more sub-steps, solved once more with + !! them. The prescribed end motion inside the interval follows the C2 quintic of + !! CD_Step_Model_Recovering and the last sub-step lands on the given end state exactly. The + !! decision depends only on the committed state, the step's inputs and the line's initial + !! tension (a parameter of the line), so a run restarted from a checkpoint repeats it. If a + !! sub-step fails, the plain step's own result is returned. A step of the monolithic junction !! coupling (the end query armed, CD_Set_Model_EndQuery) is never sub-stepped: its caller !! needs the end reaction and tangent of the nominal step. as_given = .TRUE. takes the step !! as given as well: the stall recoveries of CD_Step_Model_Recovering and CD_Step_System, @@ -1922,18 +1966,12 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, IF (resolve) resolve = has_pres .OR. .NOT. (PRESENT(prescribed_q) .OR. PRESENT(prescribed_v) .OR. & PRESENT(prescribed_a)) IF (resolve) THEN - IF (.NOT. (CD_Is_Finite(model%cfg%ei0_substep_angle) .AND. model%cfg%ei0_substep_angle > CD_ZERO .AND. & - model%cfg%ei0_substep_angle <= 90.0_wp .AND. model%cfg%ei0_substep_max >= 2 .AND. & - model%cfg%ei0_substep_max <= 1024)) THEN - converged = .FALSE. - stalled = .FALSE. - n_iter = 0 - CALL fail(ErrStat, ErrMsg, 'ei0_substep_angle must lie in (0, 90] deg and '// & - 'ei0_substep_max in [2, 1024]') - RETURN - END IF resolve = sub_alloc(model, has_pres) - IF (resolve) CALL sub_store(model, 1) + IF (resolve) THEN + CALL sub_store(model, 1) + ! the segment tensions at the step start, for the trigger (sub_count) + CALL sub_tensions_scratch(model, 0) + END IF END IF IF (.NOT. resolve) THEN ! absent optional arguments stay absent @@ -1946,10 +1984,10 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, CALL step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) IF (ErrStat /= CD_MODEL_OK) RETURN - IF (model%sub_calls < HUGE(model%sub_calls)) model%sub_calls = model%sub_calls + 1 + model%sub_stats%calls = model%sub_stats%calls + 1 nsub = 1 capped = .FALSE. - IF (converged) CALL sub_count(model, nsub, capped) + IF (converged) CALL sub_count(model, dt, nsub, capped) IF (nsub <= 1) THEN model%audit_hmax = MAX(model%audit_hmax, dt) RETURN @@ -1965,10 +2003,10 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, CALL run_substeps(nsub, ok) IF (ok .AND. model%sub_test_repeat) CALL run_substeps(nsub, ok) IF (ok) THEN - CALL sub_count(model, nsub2, capped2) + CALL sub_count(model, dt, nsub2, capped2) IF (model%sub_test_more) nsub2 = MAX(nsub2, MIN(model%cfg%ei0_substep_max, nsub + 1)) IF (nsub2 > nsub) THEN - IF (model%sub_remeasured < HUGE(model%sub_remeasured)) model%sub_remeasured = model%sub_remeasured + 1 + model%sub_stats%remeasured = model%sub_stats%remeasured + 1 CALL run_substeps(nsub2, ok) IF (ok) THEN nsub = nsub2 @@ -1983,9 +2021,9 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, stalled = .FALSE. ErrStat = CD_MODEL_OK ErrMsg = '' - IF (model%sub_events < HUGE(model%sub_events)) model%sub_events = model%sub_events + 1 - IF (capped .AND. model%sub_capped < HUGE(model%sub_capped)) model%sub_capped = model%sub_capped + 1 - model%sub_max_used = MAX(model%sub_max_used, nsub) + model%sub_stats%events = model%sub_stats%events + 1 + IF (capped) model%sub_stats%capped = model%sub_stats%capped + 1 + model%sub_stats%max_used = MAX(model%sub_stats%max_used, nsub) model%audit_hmax = MAX(model%audit_hmax, dt/REAL(nsub, wp)) RETURN END IF @@ -1996,7 +2034,7 @@ SUBROUTINE CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, n_iter = iter_trial ErrStat = CD_MODEL_OK ErrMsg = '' - IF (model%sub_fallbacks < HUGE(model%sub_fallbacks)) model%sub_fallbacks = model%sub_fallbacks + 1 + model%sub_stats%fallbacks = model%sub_stats%fallbacks + 1 model%audit_hmax = MAX(model%audit_hmax, dt) CONTAINS @@ -2020,7 +2058,7 @@ SUBROUTINE run_substeps(n, ok_run) model%sub_pv = prescribed_v model%sub_pa = prescribed_a ELSE - CALL quintic_model_boundary_state(model%sub_q(:, 1), model%sub_v(:, 1), model%sub_a(:, 1), & + CALL quintic_model_boundary_state(model%sub_slot(1)%q, model%sub_slot(1)%v, model%sub_slot(1)%a, & prescribed_q, prescribed_v, prescribed_a, dt, & REAL(k, wp)/REAL(n, wp), model%sub_pq, model%sub_pv, model%sub_pa) END IF @@ -2041,113 +2079,234 @@ END SUBROUTINE CD_Step_Model LOGICAL FUNCTION sub_alloc(model, has_pres) RESULT(ok) !! Allocate the sub-stepping scratch on first use: two slots of the state a step commits - !! (the kinematics and the viscoelastic, Syrope and friction states) and the sub-step - !! boundary motion. .FALSE. when it cannot be allocated (the step is then taken as given). + !! (CD_ModelCommitSlot), the step-start and end segment tensions and the sub-step boundary + !! motion. .FALSE. when it cannot be allocated (the step is then taken as given). TYPE(CD_ModelType), INTENT(INOUT) :: model LOGICAL, INTENT(IN) :: has_pres - INTEGER :: istat + INTEGER :: istat, k ok = .FALSE. istat = 0 - IF (.NOT. sized2(model%sub_q, model%n_dof)) THEN - IF (ALLOCATED(model%sub_q)) DEALLOCATE (model%sub_q, model%sub_v, model%sub_a) - ALLOCATE (model%sub_q(model%n_dof, 2), model%sub_v(model%n_dof, 2), model%sub_a(model%n_dof, 2), STAT=istat) - IF (istat /= 0) RETURN - END IF - IF (has_pres) THEN - IF (ALLOCATED(model%sub_pq)) THEN - IF (SIZE(model%sub_pq) /= model%n_dof) DEALLOCATE (model%sub_pq, model%sub_pv, model%sub_pa) - END IF - IF (.NOT. ALLOCATED(model%sub_pq)) THEN - ALLOCATE (model%sub_pq(model%n_dof), model%sub_pv(model%n_dof), model%sub_pa(model%n_dof), STAT=istat) - IF (istat /= 0) RETURN - END IF - END IF - IF (model%has_viscoelastic .AND. .NOT. sized2(model%sub_ve_dl_1, SIZE(model%ve_dl_1))) THEN - IF (ALLOCATED(model%sub_ve_dl_1)) DEALLOCATE (model%sub_ve_dl_1) - ALLOCATE (model%sub_ve_dl_1(SIZE(model%ve_dl_1), 2), STAT=istat) + DO k = 1, 2 + ASSOCIATE (s => model%sub_slot(k)) + IF (.NOT. sized(s%q, model%n_dof)) THEN + IF (ALLOCATED(s%q)) DEALLOCATE (s%q, s%v, s%a) + ALLOCATE (s%q(model%n_dof), s%v(model%n_dof), s%a(model%n_dof), STAT=istat) + IF (istat /= 0) RETURN + END IF + IF (model%has_viscoelastic) THEN + IF (.NOT. sized(s%ve_dl_1, SIZE(model%ve_dl_1))) THEN + IF (ALLOCATED(s%ve_dl_1)) DEALLOCATE (s%ve_dl_1) + ALLOCATE (s%ve_dl_1(SIZE(model%ve_dl_1)), STAT=istat) + IF (istat /= 0) RETURN + END IF + END IF + IF (model%has_syrope) THEN + IF (.NOT. sized(s%syrope_slow, SIZE(model%syrope_slow))) THEN + IF (ALLOCATED(s%syrope_slow)) DEALLOCATE (s%syrope_slow, s%syrope_tmax) + ALLOCATE (s%syrope_slow(SIZE(model%syrope_slow)), s%syrope_tmax(SIZE(model%syrope_tmax)), STAT=istat) + IF (istat /= 0) RETURN + END IF + END IF + IF (model%has_seabed_friction) THEN + IF (ALLOCATED(s%fr_anchor)) THEN + IF (SIZE(s%fr_anchor, 1) /= SIZE(model%fr_anchor, 1) .OR. & + SIZE(s%fr_anchor, 2) /= SIZE(model%fr_anchor, 2)) DEALLOCATE (s%fr_anchor) + END IF + IF (.NOT. ALLOCATED(s%fr_anchor)) THEN + ALLOCATE (s%fr_anchor(SIZE(model%fr_anchor, 1), SIZE(model%fr_anchor, 2)), STAT=istat) + IF (istat /= 0) RETURN + END IF + END IF + END ASSOCIATE + END DO + IF (.NOT. sized(model%sub_t0, model%n_elem)) THEN + IF (ALLOCATED(model%sub_t0)) DEALLOCATE (model%sub_t0) + ALLOCATE (model%sub_t0(model%n_elem), STAT=istat) IF (istat /= 0) RETURN END IF - IF (model%has_syrope .AND. .NOT. sized2(model%sub_syrope_slow, SIZE(model%syrope_slow))) THEN - IF (ALLOCATED(model%sub_syrope_slow)) DEALLOCATE (model%sub_syrope_slow, model%sub_syrope_tmax) - ALLOCATE (model%sub_syrope_slow(SIZE(model%syrope_slow), 2), & - model%sub_syrope_tmax(SIZE(model%syrope_tmax), 2), STAT=istat) + IF (.NOT. sized(model%sub_t1, model%n_elem)) THEN + IF (ALLOCATED(model%sub_t1)) DEALLOCATE (model%sub_t1) + ALLOCATE (model%sub_t1(model%n_elem), STAT=istat) IF (istat /= 0) RETURN END IF - IF (model%has_seabed_friction) THEN - IF (ALLOCATED(model%sub_fr_anchor)) THEN - IF (SIZE(model%sub_fr_anchor, 1) /= SIZE(model%fr_anchor, 1) .OR. & - SIZE(model%sub_fr_anchor, 2) /= SIZE(model%fr_anchor, 2)) DEALLOCATE (model%sub_fr_anchor) - END IF - IF (.NOT. ALLOCATED(model%sub_fr_anchor)) THEN - ALLOCATE (model%sub_fr_anchor(SIZE(model%fr_anchor, 1), SIZE(model%fr_anchor, 2), 2), STAT=istat) + IF (has_pres) THEN + IF (.NOT. sized(model%sub_pq, model%n_dof)) THEN + IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq, model%sub_pv, model%sub_pa) + ALLOCATE (model%sub_pq(model%n_dof), model%sub_pv(model%n_dof), model%sub_pa(model%n_dof), STAT=istat) IF (istat /= 0) RETURN END IF END IF ok = .TRUE. CONTAINS - LOGICAL FUNCTION sized2(x, n) RESULT(yes) - REAL(wp), ALLOCATABLE, INTENT(IN) :: x(:, :) + LOGICAL FUNCTION sized(x, n) RESULT(yes) + REAL(wp), ALLOCATABLE, INTENT(IN) :: x(:) INTEGER, INTENT(IN) :: n yes = ALLOCATED(x) - IF (yes) yes = SIZE(x, 1) == n .AND. SIZE(x, 2) == 2 - END FUNCTION sized2 + IF (yes) yes = SIZE(x) == n + END FUNCTION sized END FUNCTION sub_alloc + SUBROUTINE commit_state_copy(model, to_model, q, v, a, ve_dl_1, syrope_slow, syrope_tmax, fr_anchor) + !! The one list of the state a line step commits: the kinematics, the viscoelastic dl_1, the + !! Syrope slow strain and running maximum tension, and the friction anchors. to_model = + !! .FALSE. saves the model's state into the arrays given, .TRUE. returns the model to them. + !! Every snapshot of the committed state in this module goes through here (the sub-step + !! slots of CD_Step_Model, save_recovery_state and restore_recovery_state). A state a step + !! comes to commit (such as the segment length of a line under active tension control) is + !! added here, as an optional array its snapshots pass; the rollback of the line system + !! (CableDyn_System: save_line_states, restore_line_states, CD_System_Snapshot and the + !! frame snapshot of CD_Step_System) lists the same state and must follow. An optional array + !! is passed as an allocatable that is allocated with the state it holds, so it is absent + !! (not allocated) exactly when the model does not carry that state. + TYPE(CD_ModelType), INTENT(INOUT) :: model + LOGICAL, INTENT(IN) :: to_model + REAL(wp), INTENT(INOUT) :: q(:), v(:), a(:) + REAL(wp), INTENT(INOUT), OPTIONAL :: ve_dl_1(:), syrope_slow(:), syrope_tmax(:), fr_anchor(:, :) + IF (to_model) THEN + model%q = q + model%v = v + model%a = a + IF (model%has_viscoelastic .AND. PRESENT(ve_dl_1)) model%ve_dl_1 = ve_dl_1 + IF (model%has_syrope .AND. PRESENT(syrope_slow) .AND. PRESENT(syrope_tmax)) THEN + model%syrope_slow = syrope_slow + model%syrope_tmax = syrope_tmax + END IF + IF (model%has_seabed_friction .AND. PRESENT(fr_anchor)) model%fr_anchor = fr_anchor + ELSE + q = model%q + v = model%v + a = model%a + IF (model%has_viscoelastic .AND. PRESENT(ve_dl_1)) ve_dl_1 = model%ve_dl_1 + IF (model%has_syrope .AND. PRESENT(syrope_slow) .AND. PRESENT(syrope_tmax)) THEN + syrope_slow = model%syrope_slow + syrope_tmax = model%syrope_tmax + END IF + IF (model%has_seabed_friction .AND. PRESENT(fr_anchor)) fr_anchor = model%fr_anchor + END IF + END SUBROUTINE commit_state_copy + SUBROUTINE sub_store(model, slot) !! Save the state a step commits into slot 1 (the step start) or 2 (the plain step's result). TYPE(CD_ModelType), INTENT(INOUT) :: model INTEGER, INTENT(IN) :: slot - model%sub_q(:, slot) = model%q - model%sub_v(:, slot) = model%v - model%sub_a(:, slot) = model%a - IF (model%has_viscoelastic) model%sub_ve_dl_1(:, slot) = model%ve_dl_1 - IF (model%has_syrope) THEN - model%sub_syrope_slow(:, slot) = model%syrope_slow - model%sub_syrope_tmax(:, slot) = model%syrope_tmax - END IF - IF (model%has_seabed_friction) model%sub_fr_anchor(:, :, slot) = model%fr_anchor + CALL commit_state_copy(model, .FALSE., model%sub_slot(slot)%q, model%sub_slot(slot)%v, model%sub_slot(slot)%a, & + model%sub_slot(slot)%ve_dl_1, model%sub_slot(slot)%syrope_slow, & + model%sub_slot(slot)%syrope_tmax, model%sub_slot(slot)%fr_anchor) END SUBROUTINE sub_store SUBROUTINE sub_load(model, slot) !! Return the model to the state saved in slot (sub_store). TYPE(CD_ModelType), INTENT(INOUT) :: model INTEGER, INTENT(IN) :: slot - model%q = model%sub_q(:, slot) - model%v = model%sub_v(:, slot) - model%a = model%sub_a(:, slot) - IF (model%has_viscoelastic) model%ve_dl_1 = model%sub_ve_dl_1(:, slot) - IF (model%has_syrope) THEN - model%syrope_slow = model%sub_syrope_slow(:, slot) - model%syrope_tmax = model%sub_syrope_tmax(:, slot) - END IF - IF (model%has_seabed_friction) model%fr_anchor = model%sub_fr_anchor(:, :, slot) + CALL commit_state_copy(model, .TRUE., model%sub_slot(slot)%q, model%sub_slot(slot)%v, model%sub_slot(slot)%a, & + model%sub_slot(slot)%ve_dl_1, model%sub_slot(slot)%syrope_slow, & + model%sub_slot(slot)%syrope_tmax, model%sub_slot(slot)%fr_anchor) END SUBROUTINE sub_load - SUBROUTINE sub_count(model, nsub, capped) - !! The sub-step count of a converged step (model%q) from the committed state (slot 1): 1, - !! or max(SUB_SNAP_STEPS, ceil(turn/angle)) when turn > angle, at most cfg%ei0_substep_max - !! (capped when the turn needs more), turn the largest chord turn of a segment that ends the - !! step taut above SUB_TAUT_FRACTION of the largest step-start tension; at least - !! SUB_SNAP_STEPS when a segment slack at the start ends above SUB_SNAP_FRACTION of it. The - !! tension measure is the static EA times the strain. The strains use model%l0, the lengths - !! the step itself uses (CD_Update_Model_SegmentLength sets them before the step); a length - !! that changes within the step would need its step-start value for the start state here. + SUBROUTINE sub_tensions(model, tension) + !! The segment tensions at the model's committed state as the run audit takes them + !! (CD_Audit_Model_Step): the dynamic EA times the strain of an elastic segment, the law's + !! tension of a viscoelastic or Syrope segment (model_law_tensions; the static EA times the + !! strain where the law cannot be evaluated). TYPE(CD_ModelType), INTENT(IN) :: model + REAL(wp), INTENT(OUT) :: tension(:) + INTEGER :: e, na, nb, es + REAL(wp) :: strain + CHARACTER(160) :: em + DO e = 1, model%n_elem + na = model%elem_conn(1, e) + nb = model%elem_conn(2, e) + strain = NORM2(model%q(3*nb - 2:3*nb) - model%q(3*na - 2:3*na))/model%l0(e) - CD_ONE + IF (model%ea_dyn(e) > CD_ZERO) THEN + tension(e) = model%ea_dyn(e)*strain + ELSE + tension(e) = model%ea(e)*strain + END IF + END DO + IF (model%has_viscoelastic .OR. model%has_syrope) CALL model_law_tensions(model, tension, es, em) + END SUBROUTINE sub_tensions + + SUBROUTINE sub_tensions_scratch(model, which) + !! sub_tensions into the scratch of the sub-stepping, sub_t0 (which = 0, the step start) or + !! sub_t1 (1, the step end). The array is moved out of the model while the tensions are + !! evaluated (the law evaluation reads the model), which allocates nothing. + TYPE(CD_ModelType), INTENT(INOUT) :: model + INTEGER, INTENT(IN) :: which + REAL(wp), ALLOCATABLE :: tension(:) + IF (which == 0) THEN + CALL MOVE_ALLOC(model%sub_t0, tension) + CALL sub_tensions(model, tension) + CALL MOVE_ALLOC(tension, model%sub_t0) + ELSE + CALL MOVE_ALLOC(model%sub_t1, tension) + CALL sub_tensions(model, tension) + CALL MOVE_ALLOC(tension, model%sub_t1) + END IF + END SUBROUTINE sub_tensions_scratch + + REAL(wp) FUNCTION initial_tension(model) RESULT(t_init) + !! The largest segment tension of the model's committed state (sub_tensions), 0 when none + !! is positive: the line's initial tension when CD_Init_Model sets it. + TYPE(CD_ModelType), INTENT(IN) :: model + REAL(wp), ALLOCATABLE :: tension(:) + INTEGER :: istat + t_init = CD_ZERO + ALLOCATE (tension(model%n_elem), STAT=istat) + IF (istat /= 0) RETURN + CALL sub_tensions(model, tension) + IF (CD_All_Finite(tension)) t_init = MAX(CD_ZERO, MAXVAL(tension)) + END FUNCTION initial_tension + + REAL(wp) FUNCTION segment_wave_stiffness(model, e, tension) RESULT(stiff) + !! The axial stiffness of segment e that sets its wave speed: the dynamic EA of an elastic + !! segment, the fast spring of a law (EA_D of the viscoelastic law, alpha + beta*T of the + !! Syrope law at the segment tension T); the static EA if the law's value is unavailable. + TYPE(CD_ModelType), INTENT(IN) :: model + INTEGER, INTENT(IN) :: e + REAL(wp), INTENT(IN) :: tension + REAL(wp) :: ea_d_eff, ea_1_eff + INTEGER :: es + CHARACTER(200) :: em + stiff = model%ea_dyn(e) + IF (stiff > CD_ZERO) RETURN + stiff = model%ea(e) + IF (model%has_viscoelastic) THEN + IF (model%ve_mode(e) /= 0) THEN + CALL model_viscoelastic_coeffs(model, e, ea_d_eff, ea_1_eff, es, em) + IF (es == CD_MODEL_OK .AND. ea_d_eff > CD_ZERO) stiff = ea_d_eff + RETURN + END IF + END IF + IF (model%has_syrope) THEN + IF (model%syrope_is(e)) & + stiff = model%syrope_type(e)%alpha + model%syrope_type(e)%beta*MAX(tension, CD_ZERO) + END IF + END FUNCTION segment_wave_stiffness + + SUBROUTINE sub_count(model, dt, nsub, capped) + !! The sub-step count of a converged step over dt (model%q) from the committed state (slot 1, + !! its segment tensions in sub_t0): 1, or max(SUB_SNAP_STEPS, ceil(turn/angle)) when + !! turn > angle, at most cfg%ei0_substep_max (capped when the turn needs more), turn the + !! largest chord turn of a segment that ends the step above SUB_TAUT_FRACTION of the tension + !! scale (the largest step-start tension, at least SUB_TAUT_FRACTION of sub_t_init); at least + !! SUB_SNAP_STEPS when a segment slack at the start ends above SUB_SNAP_FRACTION of the scale + !! and its axial wave crosses it more than once in dt. The tensions are those of + !! sub_tensions. The strains use model%l0, the lengths the step itself uses + !! (CD_Update_Model_SegmentLength sets them before the step); a length that changes within + !! the step would need its step-start value for the start state here. + TYPE(CD_ModelType), INTENT(INOUT) :: model + REAL(wp), INTENT(IN) :: dt INTEGER, INTENT(OUT) :: nsub LOGICAL, INTENT(OUT) :: capped REAL(wp), PARAMETER :: DEG = 57.295779513082320876798154814105_wp INTEGER :: e, na, nb, nmax - REAL(wp) :: d0(3), d1(3), l_s, l_e, t0max, te, c, turn, ratio + REAL(wp) :: d0(3), d1(3), l_s, l_e, scale, te, c, turn, ratio, courant LOGICAL :: snap nsub = 1 capped = .FALSE. - t0max = CD_ZERO - DO e = 1, model%n_elem - na = model%elem_conn(1, e) - nb = model%elem_conn(2, e) - d0 = model%sub_q(3*nb - 2:3*nb, 1) - model%sub_q(3*na - 2:3*na, 1) - t0max = MAX(t0max, model%ea(e)*(NORM2(d0)/model%l0(e) - CD_ONE)) - END DO + CALL sub_tensions_scratch(model, 1) + scale = MAX(CD_ZERO, SUB_TAUT_FRACTION*model%sub_t_init) + IF (CD_All_Finite(model%sub_t0)) scale = MAX(scale, MAXVAL(model%sub_t0)) turn = CD_ZERO snap = .FALSE. DO e = 1, model%n_elem @@ -2156,11 +2315,14 @@ SUBROUTINE sub_count(model, nsub, capped) d1 = model%q(3*nb - 2:3*nb) - model%q(3*na - 2:3*na) l_e = NORM2(d1) IF (.NOT. l_e > model%l0(e)) CYCLE - te = model%ea(e)*(l_e/model%l0(e) - CD_ONE) - d0 = model%sub_q(3*nb - 2:3*nb, 1) - model%sub_q(3*na - 2:3*na, 1) + te = model%sub_t1(e) + d0 = model%sub_slot(1)%q(3*nb - 2:3*nb) - model%sub_slot(1)%q(3*na - 2:3*na) l_s = NORM2(d0) - IF (l_s <= model%l0(e) .AND. te > SUB_SNAP_FRACTION*t0max) snap = .TRUE. - IF (te > SUB_TAUT_FRACTION*t0max .AND. l_s > CD_ZERO) THEN + IF (.NOT. snap .AND. l_s <= model%l0(e) .AND. te > SUB_SNAP_FRACTION*scale) THEN + courant = dt*SQRT(segment_wave_stiffness(model, e, te)/model%rho_a(e))/model%l0(e) + IF (courant > CD_ONE) snap = .TRUE. + END IF + IF (te > SUB_TAUT_FRACTION*scale .AND. l_s > CD_ZERO) THEN c = DOT_PRODUCT(d0, d1)/(l_s*l_e) turn = MAX(turn, ACOS(MAX(-CD_ONE, MIN(CD_ONE, c)))*DEG) END IF @@ -2179,16 +2341,18 @@ SUBROUTINE sub_count(model, nsub, capped) END SUBROUTINE sub_count SUBROUTINE CD_Get_Model_Substep_Counts(model, calls, events, max_used, capped, fallbacks) - !! Diagnostics of the rotation- and snap-resolved sub-stepping (CD_Step_Model): the steps it - !! examined, those it solved in sub-steps (the largest count used), those whose turn needed - !! more than cfg%ei0_substep_max, and those that kept the plain step after a sub-step failed. + !! Diagnostics of the rotation- and snap-resolved sub-stepping (CD_Step_Model, + !! CD_SubstepStats): the steps it examined, those it solved in sub-steps (the largest count + !! used), those whose turn needed more than cfg%ei0_substep_max, and those that kept the + !! plain step after a sub-step failed. TYPE(CD_ModelType), INTENT(IN) :: model - INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks - calls = model%sub_calls - events = model%sub_events - max_used = model%sub_max_used - capped = model%sub_capped - fallbacks = model%sub_fallbacks + INTEGER(int64), INTENT(OUT) :: calls, events, capped, fallbacks + INTEGER, INTENT(OUT) :: max_used + calls = model%sub_stats%calls + events = model%sub_stats%events + max_used = model%sub_stats%max_used + capped = model%sub_stats%capped + fallbacks = model%sub_stats%fallbacks END SUBROUTINE CD_Get_Model_Substep_Counts SUBROUTINE step_model_plain(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & @@ -2564,6 +2728,7 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt INTEGER :: recovery_cap, nsub, k, es, iter_sub, max_iter_seen LOGICAL :: has_pres, conv_sub, stall_sub, rung_ok REAL(wp) :: subdt, fraction, hmax0 + TYPE(CD_SubstepStats) :: stats0 REAL(wp), ALLOCATABLE :: pq(:), pv(:), pa(:) CHARACTER(300) :: em, first_em @@ -2609,6 +2774,7 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt CALL save_recovery_state(model) hmax0 = model%audit_hmax + stats0 = model%sub_stats IF (has_pres) THEN CALL CD_Step_Model(model, dt, converged, stalled, n_iter, ErrStat, ErrMsg, & prescribed_q=prescribed_q, prescribed_v=prescribed_v, prescribed_a=prescribed_a) @@ -2627,6 +2793,8 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt first_em = ErrMsg CALL restore_recovery_state(model) + ! the stalled attempt is not committed: the rungs that replace it take their steps as given + model%sub_stats = stats0 IF (has_pres) THEN ALLOCATE (pq(model%n_dof), pv(model%n_dof), pa(model%n_dof), STAT=es) IF (es /= 0) THEN @@ -2712,29 +2880,19 @@ SUBROUTINE CD_Step_Model_Recovering(model, dt, converged, stalled, n_iter, ErrSt END SUBROUTINE CD_Step_Model_Recovering SUBROUTINE save_recovery_state(model) + !! Save the committed state into the recovery snapshot (commit_state_copy). TYPE(CD_ModelType), INTENT(INOUT) :: model - model%recovery_q0 = model%q - model%recovery_v0 = model%v - model%recovery_a0 = model%a - IF (model%has_viscoelastic) model%recovery_ve_dl_1 = model%ve_dl_1 - IF (model%has_syrope) THEN - model%recovery_syrope_slow = model%syrope_slow - model%recovery_syrope_tmax = model%syrope_tmax - END IF - IF (model%has_seabed_friction) model%recovery_fr_anchor = model%fr_anchor + CALL commit_state_copy(model, .FALSE., model%recovery_q0, model%recovery_v0, model%recovery_a0, & + model%recovery_ve_dl_1, model%recovery_syrope_slow, model%recovery_syrope_tmax, & + model%recovery_fr_anchor) END SUBROUTINE save_recovery_state SUBROUTINE restore_recovery_state(model) + !! Return the model to the recovery snapshot (commit_state_copy). TYPE(CD_ModelType), INTENT(INOUT) :: model - model%q = model%recovery_q0 - model%v = model%recovery_v0 - model%a = model%recovery_a0 - IF (model%has_viscoelastic) model%ve_dl_1 = model%recovery_ve_dl_1 - IF (model%has_syrope) THEN - model%syrope_slow = model%recovery_syrope_slow - model%syrope_tmax = model%recovery_syrope_tmax - END IF - IF (model%has_seabed_friction) model%fr_anchor = model%recovery_fr_anchor + CALL commit_state_copy(model, .TRUE., model%recovery_q0, model%recovery_v0, model%recovery_a0, & + model%recovery_ve_dl_1, model%recovery_syrope_slow, model%recovery_syrope_tmax, & + model%recovery_fr_anchor) model%ve_dt = CD_ZERO END SUBROUTINE restore_recovery_state @@ -5244,7 +5402,7 @@ SUBROUTINE CD_Audit_Model_Step(model, time, dt, new_spike) IF (model%audit_t(e, 1) >= CD_ZERO .AND. .NOT. model%audit_t(e, 1) > CD_ZERO .AND. & model%audit_now(e) > model%audit_floor) THEN model%audit_snaps = model%audit_snaps + 1 - c = SQRT(wave_stiffness(e)/model%rho_a(e)) + c = SQRT(segment_wave_stiffness(model, e, model%audit_now(e))/model%rho_a(e)) model%audit_snap_courant = MAX(model%audit_snap_courant, h*c/model%l0(e)) END IF END IF @@ -5284,29 +5442,6 @@ LOGICAL FUNCTION law_element(k) RESULT(is_law) IF (model%has_syrope .AND. .NOT. is_law) is_law = model%syrope_is(k) END FUNCTION law_element - REAL(wp) FUNCTION wave_stiffness(k) RESULT(stiff) - !! The axial stiffness of segment k that sets its wave speed: EA of an elastic segment, - !! the fast spring of a law (EA_D of the viscoelastic law, alpha + beta*T of the Syrope - !! law at the segment tension T); the static EA if the law's value is unavailable. - INTEGER, INTENT(IN) :: k - REAL(wp) :: ea_d_eff, ea_1_eff - INTEGER :: es_k - CHARACTER(200) :: em_k - stiff = model%ea_dyn(k) - IF (stiff > CD_ZERO) RETURN - stiff = model%ea(k) - IF (model%has_viscoelastic) THEN - IF (model%ve_mode(k) /= 0) THEN - CALL model_viscoelastic_coeffs(model, k, ea_d_eff, ea_1_eff, es_k, em_k) - IF (es_k == CD_MODEL_OK .AND. ea_d_eff > CD_ZERO) stiff = ea_d_eff - RETURN - END IF - END IF - IF (model%has_syrope) THEN - IF (model%syrope_is(k)) stiff = model%syrope_type(k)%alpha + & - model%syrope_type(k)%beta*MAX(model%audit_now(k), CD_ZERO) - END IF - END FUNCTION wave_stiffness END SUBROUTINE CD_Audit_Model_Step SUBROUTINE clear_model_audit(model) @@ -5329,12 +5464,8 @@ SUBROUTINE clear_model_audit(model) model%audit_hmax = CD_ZERO model%audit_hmax_rollback = CD_ZERO ! the sub-stepping diagnostics and test hooks start afresh with the model - model%sub_calls = 0 - model%sub_events = 0 - model%sub_max_used = 1 - model%sub_capped = 0 - model%sub_fallbacks = 0 - model%sub_remeasured = 0 + model%sub_stats = CD_SubstepStats() + model%sub_stats_rollback = CD_SubstepStats() model%sub_test_fail = 0 model%sub_test_repeat = .FALSE. model%sub_test_more = .FALSE. @@ -5375,16 +5506,13 @@ SUBROUTINE CD_End_Model(model, ErrStat, ErrMsg) IF (ALLOCATED(model%v_rollback)) DEALLOCATE (model%v_rollback) IF (ALLOCATED(model%a_rollback)) DEALLOCATE (model%a_rollback) IF (ALLOCATED(model%recovery_q0)) DEALLOCATE (model%recovery_q0) - IF (ALLOCATED(model%sub_q)) DEALLOCATE (model%sub_q) - IF (ALLOCATED(model%sub_v)) DEALLOCATE (model%sub_v) - IF (ALLOCATED(model%sub_a)) DEALLOCATE (model%sub_a) + model%sub_slot(1) = CD_ModelCommitSlot() + model%sub_slot(2) = CD_ModelCommitSlot() + IF (ALLOCATED(model%sub_t0)) DEALLOCATE (model%sub_t0) + IF (ALLOCATED(model%sub_t1)) DEALLOCATE (model%sub_t1) IF (ALLOCATED(model%sub_pq)) DEALLOCATE (model%sub_pq) IF (ALLOCATED(model%sub_pv)) DEALLOCATE (model%sub_pv) IF (ALLOCATED(model%sub_pa)) DEALLOCATE (model%sub_pa) - IF (ALLOCATED(model%sub_ve_dl_1)) DEALLOCATE (model%sub_ve_dl_1) - IF (ALLOCATED(model%sub_syrope_slow)) DEALLOCATE (model%sub_syrope_slow) - IF (ALLOCATED(model%sub_syrope_tmax)) DEALLOCATE (model%sub_syrope_tmax) - IF (ALLOCATED(model%sub_fr_anchor)) DEALLOCATE (model%sub_fr_anchor) IF (ALLOCATED(model%recovery_v0)) DEALLOCATE (model%recovery_v0) IF (ALLOCATED(model%recovery_a0)) DEALLOCATE (model%recovery_a0) IF (ALLOCATED(model%f_ext_rollback)) DEALLOCATE (model%f_ext_rollback) @@ -5539,6 +5667,7 @@ SUBROUTINE CD_Copy_Model(src, dst, ErrStat, ErrMsg) work%added_mass_can = src%added_mass_can work%added_mass_cat = src%added_mass_cat work%cfg = src%cfg + work%sub_t_init = src%sub_t_init CALL copy_int2(src%elem_conn, work%elem_conn, 'elem_conn', ErrStat, ErrMsg) IF (ErrStat /= CD_MODEL_OK) RETURN @@ -5752,6 +5881,7 @@ SUBROUTINE commit_model_copy(from, to) to%added_mass_can = from%added_mass_can to%added_mass_cat = from%added_mass_cat to%cfg = from%cfg + to%sub_t_init = from%sub_t_init CALL MOVE_ALLOC(from%elem_conn, to%elem_conn) CALL MOVE_ALLOC(from%fixed_dofs, to%fixed_dofs) diff --git a/src/CableDyn_OpenFAST_Aggregate.f90 b/src/CableDyn_OpenFAST_Aggregate.f90 index fa2265f5..2abb1d4f 100644 --- a/src/CableDyn_OpenFAST_Aggregate.f90 +++ b/src/CableDyn_OpenFAST_Aggregate.f90 @@ -40,6 +40,7 @@ MODULE CableDyn_OpenFAST_Aggregate !! generalised-alpha step carries the Init dt, from the mooring columns). USE CableDyn_Precision, ONLY: wp, CD_ZERO, CD_ONE, CD_All_Finite USE CableDyn_FatalReport, ONLY: CD_Fatal_Thread_Init + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: int64 USE CableDyn_Linalg, ONLY: CD_Blas_Runtime_Check, CD_LINALG_OK USE CableDyn_OpenFAST_FMF, ONLY: CD_FMF_ModuleType, CD_FMF_Init_From_System, CD_FMF_NMovingPoints, & CD_FMF_GetPointMesh, CD_FMF_UpdateStates, & @@ -1775,7 +1776,8 @@ SUBROUTINE CD_AGG_Get_Substep_Counts(self, calls, events, max_used, capped, fall !! examined, solved in sub-steps (max_used the largest count), beyond ei0_substep_max, and !! kept the plain step's result after a sub-step failed. TYPE(CD_AGG_ModuleType), INTENT(IN) :: self - INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks + INTEGER(int64), INTENT(OUT) :: calls, events, capped, fallbacks + INTEGER, INTENT(OUT) :: max_used calls = 0; events = 0; max_used = 1; capped = 0; fallbacks = 0 IF (self%has_sys) CALL CD_Get_System_Substep_Counts(self%sys%fast%system, calls, events, max_used, capped, & fallbacks) diff --git a/src/CableDyn_System.f90 b/src/CableDyn_System.f90 index eac0be5a..34dcc24a 100644 --- a/src/CableDyn_System.f90 +++ b/src/CableDyn_System.f90 @@ -10,6 +10,7 @@ MODULE CableDyn_System !! bypassing it. Rigid6 bodies and rods are marched over a system by the deck driver. USE CableDyn_Precision, ONLY: wp, CD_ZERO, CD_All_Finite, CD_Is_Finite USE CableDyn_FatalReport, ONLY: CD_Fatal_Thread_Init + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: int64 USE CableDyn_Model, ONLY: CD_ModelType, CD_Model_Is_Initialized, CD_End_Model, & CD_Model_NCoupledDOF, CD_Model_NDOF, CD_Model_NElem, & CD_Get_Model_CoupledDofs, CD_Get_Model_CoupledMotion, & @@ -21,7 +22,7 @@ MODULE CableDyn_System CD_Get_Model_EndNodeTangent, CD_Set_Model_EndQuery, CD_Get_Model_EndQuery, & CD_Update_Model_SegmentLength, & CD_Update_Model_CoupledMotion, CD_Update_Model_Interior_State, CD_Step_Model, & - CD_Get_Model_Substep_Counts, & + CD_Get_Model_Substep_Counts, CD_SubstepStats, & CD_Calc_Model_CoupledLoads, CD_Recompute_Model_Acceleration, & CD_Calc_Model_CoupledKinematicDerivatives, & CD_Calc_Model_CoupledAccelDerivative, CD_Update_Model_CoupledAccelDerivative, & @@ -220,6 +221,9 @@ MODULE CableDyn_System ! Stick-slip seabed friction anchors join the snapshot ((x, y) per node, concatenated ! over the friction lines; sized like snap_q, of which it uses two thirds at most). REAL(wp), ALLOCATABLE :: snap_fr_anchor(:) + ! the sub-stepping diagnostics of every line (CD_SubstepStats): they roll back with the + ! states, so a restored and re-advanced step counts once + TYPE(CD_SubstepStats), ALLOCATABLE :: snap_sub(:) LOGICAL :: snap_valid = .FALSE. END TYPE CD_SystemType @@ -455,6 +459,7 @@ SUBROUTINE CD_End_System(system, ErrStat, ErrMsg) IF (ALLOCATED(system%snap_ve_dl_1)) DEALLOCATE (system%snap_ve_dl_1) IF (ALLOCATED(system%snap_syrope_slow)) DEALLOCATE (system%snap_syrope_slow, system%snap_syrope_tmax) IF (ALLOCATED(system%snap_fr_anchor)) DEALLOCATE (system%snap_fr_anchor) + IF (ALLOCATED(system%snap_sub)) DEALLOCATE (system%snap_sub) system%snap_valid = .FALSE. system%initialized = .FALSE. system%n_lines = 0 @@ -1253,7 +1258,8 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, LOGICAL :: conv2, stall2 CHARACTER(160) :: em REAL(wp), ALLOCATABLE :: q0(:), v0(:), a0(:), qm(:), vm(:), am(:), qs(:), vs(:), as(:) - REAL(wp), ALLOCATABLE :: dl1s(:), slows(:), tmaxs(:), frs(:, :) + REAL(wp), ALLOCATABLE :: dl1s(:), slows(:), tmaxs(:), frs(:, :), hmaxs(:) + TYPE(CD_SubstepStats), ALLOCATABLE :: subs(:) converged = .FALSE. stalled = .FALSE. @@ -1312,15 +1318,22 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, n_team = line_team_size(system) !$OMP PARALLEL DEFAULT(SHARED) PRIVATE(i) NUM_THREADS(n_team) IF(n_team > 1) CALL CD_Fatal_Thread_Init() ! this thread can report its own stack overflow - !$OMP DO SCHEDULE(STATIC) + ! DYNAMIC: a line that is sub-stepped (CD_Step_Model) costs several of its plain steps, so the + ! lines take unequal times; each line's result does not depend on the thread that steps it + !$OMP DO SCHEDULE(DYNAMIC) DO i = 1, system%n_lines - ! the halves of a stall recovery (depth > 0) take their steps as given, as the rungs of - ! CD_Step_Model_Recovering do: no rotation- and snap-resolved sub-steps of sub-steps + ! the halves of a stall recovery (0 < depth < MAX_SUBDIV) take their steps as given, as the + ! rungs of CD_Step_Model_Recovering do: no rotation- and snap-resolved sub-steps of + ! sub-steps. The plain full-dt rerun at the depth floor (depth = MAX_SUBDIV) steps every line + ! as the nominal step (depth 0) does, so its result is that of the step without the + ! fallback; the junction step (JUNCTION_NO_SUBDIV = MAX_SUBDIV) likewise, its armed lines + ! being taken as given by CD_Step_Model itself CALL CD_Step_Model(system%lines(i), dt, system%line_converged(i), system%line_stalled(i), & system%line_iter(i), system%line_stat(i), system%line_msg(i), & prescribed_q=system%lines(i)%q_prescribed_work, & prescribed_v=system%lines(i)%v_prescribed_work, & - prescribed_a=system%lines(i)%a_prescribed_work, as_given=depth > 0) + prescribed_a=system%lines(i)%a_prescribed_work, & + as_given=depth > 0 .AND. depth < MAX_SUBDIV) END DO !$OMP END DO !$OMP END PARALLEL @@ -1379,7 +1392,8 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, IF (system%lines(i)%has_syrope) nsy = nsy + SIZE(system%lines(i)%syrope_slow) IF (CD_Model_Has_Friction(system%lines(i))) nfr = nfr + SIZE(system%lines(i)%fr_anchor, 2) END DO - ALLOCATE (qs(ntot), vs(ntot), as(ntot), dl1s(nve), slows(nsy), tmaxs(nsy), frs(2, nfr)) + ALLOCATE (qs(ntot), vs(ntot), as(ntot), dl1s(nve), slows(nsy), tmaxs(nsy), frs(2, nfr), & + hmaxs(system%n_lines), subs(system%n_lines)) lo = 1 lo_ve = 1 lo_sy = 1 @@ -1389,6 +1403,10 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, qs(lo:hi) = system%lines(i)%q vs(lo:hi) = system%lines(i)%v as(lo:hi) = system%lines(i)%a + ! the run audit's largest solver step and the sub-stepping diagnostics restore with the + ! states, so the halves of a fallback that does not complete leave no trace + hmaxs(i) = system%lines(i)%audit_hmax + subs(i) = system%lines(i)%sub_stats lo = hi + 1 IF (CD_Model_Has_Friction(system%lines(i))) THEN ne = SIZE(system%lines(i)%fr_anchor, 2) @@ -1431,6 +1449,8 @@ RECURSIVE SUBROUTINE CD_Step_System(system, dt, q_coupled, v_coupled, a_coupled, system%lines(i)%q = qs(lo:hi) system%lines(i)%v = vs(lo:hi) system%lines(i)%a = as(lo:hi) + system%lines(i)%audit_hmax = hmaxs(i) + system%lines(i)%sub_stats = subs(i) lo = hi + 1 IF (CD_Model_Has_Friction(system%lines(i))) THEN ne = SIZE(system%lines(i)%fr_anchor, 2) @@ -1495,7 +1515,7 @@ SUBROUTINE CD_Step_System_Junction(system, dt, q_coupled, v_coupled, a_coupled, LOGICAL, INTENT(IN), OPTIONAL :: level_dofs(:) INTEGER :: i, j, k, lo, nc, nf LOGICAL :: valid, fresh - LOGICAL, ALLOCATABLE :: act(:), lev(:) + LOGICAL, ALLOCATABLE :: act(:), lev(:), armed(:) REAL(wp), ALLOCATABLE :: r(:), kl(:, :) loads = CD_ZERO @@ -1513,6 +1533,11 @@ SUBROUTINE CD_Step_System_Junction(system, dt, q_coupled, v_coupled, a_coupled, END IF fresh = .TRUE. IF (PRESENT(refresh)) fresh = refresh + ! A line with no active junction DOF (both ends on fixed or anchored points) adds nothing to + ! the junction loads and tangent: its end query stays unarmed, so CD_Step_Model sub-steps + ! it as on any other route (its loads at the inactive DOFs are not returned). Every other + ! line is armed and taken as given. + ALLOCATE (armed(system%n_lines)) DO i = 1, system%n_lines lo = system%line_off(i) nc = system%line_off(i + 1) - lo @@ -1524,7 +1549,10 @@ SUBROUTINE CD_Step_System_Junction(system, dt, q_coupled, v_coupled, a_coupled, act(j) = active(system%coupled_dof_map(lo + j - 1)) IF (PRESENT(level_dofs)) lev(j) = level_dofs(system%coupled_dof_map(lo + j - 1)) END DO - IF (PRESENT(levels)) THEN + armed(i) = ANY(act) + IF (.NOT. armed(i)) THEN + CALL CD_Set_Model_EndQuery(system%lines(i), .FALSE.) + ELSE IF (PRESENT(levels)) THEN CALL CD_Set_Model_EndQuery(system%lines(i), .TRUE., act, warm, fresh, levels, lev) ELSE CALL CD_Set_Model_EndQuery(system%lines(i), .TRUE., act, warm, fresh) @@ -1535,6 +1563,7 @@ SUBROUTINE CD_Step_System_Junction(system, dt, q_coupled, v_coupled, a_coupled, JUNCTION_NO_SUBDIV) IF (ErrStat == CD_SYSTEM_OK .AND. converged) THEN DO i = 1, system%n_lines + IF (.NOT. armed(i)) CYCLE lo = system%line_off(i) nc = system%line_off(i + 1) - lo nf = SIZE(system%lines(i)%fixed_dofs) @@ -2947,6 +2976,8 @@ SUBROUTINE save_line_states(system, ErrStat, ErrMsg) ! the run audit's largest solver step rolls back too: a rolled-back (stalled) full step ! must not count when its halves are what the line commits system%lines(i)%audit_hmax_rollback = system%lines(i)%audit_hmax + ! the sub-stepping diagnostics likewise: a rolled-back step is not counted + system%lines(i)%sub_stats_rollback = system%lines(i)%sub_stats ! the viscoelastic dl_1 state advances with every committed line step, so ! it must roll back with q/v/a (a line that stepped can be rolled back ! when a sibling line or the coupled point solve fails) @@ -2975,6 +3006,7 @@ SUBROUTINE restore_line_states(system) system%lines(i)%v = system%lines(i)%v_rollback system%lines(i)%a = system%lines(i)%a_rollback system%lines(i)%audit_hmax = system%lines(i)%audit_hmax_rollback + system%lines(i)%sub_stats = system%lines(i)%sub_stats_rollback IF (system%lines(i)%has_viscoelastic) & system%lines(i)%ve_dl_1 = system%lines(i)%ve_dl_1_rollback IF (system%lines(i)%has_syrope) THEN @@ -3100,6 +3132,10 @@ SUBROUTINE CD_System_Snapshot(system, ErrStat, ErrMsg) RESHAPE(system%lines(i)%fr_anchor, [2*SIZE(system%lines(i)%fr_anchor, 2)]) lo = hi + 1 END DO + IF (.NOT. ALLOCATED(system%snap_sub)) ALLOCATE (system%snap_sub(system%n_lines)) + DO i = 1, system%n_lines + system%snap_sub(i) = system%lines(i)%sub_stats + END DO IF (ALLOCATED(system%points)) system%snap_points = system%points IF (ALLOCATED(system%bindings)) system%snap_bindings = system%bindings IF (ALLOCATED(system%coupled_dof_map)) system%snap_map = system%coupled_dof_map @@ -3163,6 +3199,11 @@ SUBROUTINE CD_System_Restore(system, ErrStat, ErrMsg) [2, SIZE(system%lines(i)%fr_anchor, 2)]) lo = hi + 1 END DO + IF (ALLOCATED(system%snap_sub)) THEN + DO i = 1, system%n_lines + system%lines(i)%sub_stats = system%snap_sub(i) + END DO + END IF IF (ALLOCATED(system%snap_points)) system%points = system%snap_points ! Roll the detach topology back with the states: a failure fired after the ! snapshot un-fires (its row will re-trigger on the re-advance). @@ -3218,8 +3259,10 @@ SUBROUTINE CD_Get_System_Substep_Counts(system, calls, events, max_used, capped, !! The rotation- and snap-resolved sub-stepping diagnostics of the EI=0 lines !! (CD_Get_Model_Substep_Counts) summed over the lines (max_used: the largest count). TYPE(CD_SystemType), INTENT(IN) :: system - INTEGER, INTENT(OUT) :: calls, events, max_used, capped, fallbacks - INTEGER :: i, c, e, m, k, f + INTEGER(int64), INTENT(OUT) :: calls, events, capped, fallbacks + INTEGER, INTENT(OUT) :: max_used + INTEGER(int64) :: c, e, k, f + INTEGER :: i, m calls = 0; events = 0; max_used = 1; capped = 0; fallbacks = 0 IF (.NOT. ALLOCATED(system%lines)) RETURN DO i = 1, SIZE(system%lines) diff --git a/src/openfast/CableDyn_OF.f90 b/src/openfast/CableDyn_OF.f90 index 9ddc32dc..f280770e 100644 --- a/src/openfast/CableDyn_OF.f90 +++ b/src/openfast/CableDyn_OF.f90 @@ -2390,6 +2390,7 @@ END SUBROUTINE CD_CalcContStateDeriv !---------------------------------------------------------------------------------------------------------------------------------- SUBROUTINE CD_End(u, p, x, xd, z, other, y, m, ErrStat , ErrMsg) + USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY: int64 TYPE(CD_InputType) , INTENT(INOUT) :: u TYPE(CD_ParameterType) , INTENT(INOUT) :: p TYPE(CD_ContinuousStateType) , INTENT(INOUT) :: x @@ -2404,7 +2405,9 @@ SUBROUTINE CD_End(u, p, x, xd, z, other, y, m, ErrStat , ErrMsg) character(*), parameter :: RoutineName = 'CD_End' INTEGER(IntKi) :: ErrStat2 INTEGER :: hn_step, hn_resid, hn_solve, hn_am, hn_alloc, hn_tan - INTEGER :: sb_calls, sb_events, sb_max, sb_capped, sb_fallbacks + INTEGER(int64) :: sb_calls, sb_events, sb_capped, sb_fallbacks + INTEGER :: sb_max, sb_ios + CHARACTER(24) :: sb_txt(5) REAL(wp) :: ht_step, ht_resid, ht_eff, ht_solve, ht_am, ht_tan CHARACTER(ErrMsgLen) :: ErrMsg2 @@ -2419,10 +2422,16 @@ SUBROUTINE CD_End(u, p, x, xd, z, other, y, m, ErrStat , ErrMsg) CALL CD_AGG_Get_Substep_Counts( Inst(m%CDInst)%agg, sb_calls, sb_events, sb_max, sb_capped, & sb_fallbacks ) IF (sb_events > 0 .OR. sb_fallbacks > 0) THEN - CALL WrScr( ' CableDyn: ei0_substeps auto solved '//TRIM(Num2LStr(sb_events))//' of '// & - TRIM(Num2LStr(sb_calls))//' EI = 0 line step(s) in sub-steps (at most '// & - TRIM(Num2LStr(sb_max))//' per step); '//TRIM(Num2LStr(sb_capped))// & - ' needed more than ei0_substep_max; '//TRIM(Num2LStr(sb_fallbacks))// & + ! 64-bit counts, written here (Num2LStr takes the default integer kind) + WRITE (sb_txt(1), '(I0)', IOSTAT=sb_ios) sb_events + WRITE (sb_txt(2), '(I0)', IOSTAT=sb_ios) sb_calls + WRITE (sb_txt(3), '(I0)', IOSTAT=sb_ios) sb_max + WRITE (sb_txt(4), '(I0)', IOSTAT=sb_ios) sb_capped + WRITE (sb_txt(5), '(I0)', IOSTAT=sb_ios) sb_fallbacks + CALL WrScr( ' CableDyn: ei0_substeps auto solved '//TRIM(sb_txt(1))//' of the '// & + TRIM(sb_txt(2))//' EI = 0 line step(s) it examined in sub-steps (at most '// & + TRIM(sb_txt(3))//' sub-steps per step); '//TRIM(sb_txt(4))// & + ' needed more than ei0_substep_max; '//TRIM(sb_txt(5))// & ' kept the whole step after a sub-step did not converge.' ) END IF IF (Inst(m%CDInst)%prof_enabled) THEN diff --git a/tests/test_deck_driver.f90 b/tests/test_deck_driver.f90 index 75ff7106..ff565bac 100644 --- a/tests/test_deck_driver.f90 +++ b/tests/test_deck_driver.f90 @@ -1655,6 +1655,13 @@ PROGRAM test_deck_driver CALL expect_badinput('deck_badtentol.dat', deck_with_bad_tensile_tolerance(), 'negative tensile tolerance') CALL expect_badinput('deck_badrecovery.dat', deck_with_bad_recovery_cap(), 'non-finite recovery cap') CALL expect_badinput('deck_fracrecovery.dat', deck_with_fractional_recovery_cap(), 'fractional recovery cap') + ! the ei0 sub-stepping options take the Python deck reader's rules: ei0_substep_max is an integer + ! to within 16 ulp whose nearest integer lies in [2, 1024] + CALL expect_badinput('deck_ei0mode.dat', deck_with_ei0_option('on ei0_substeps'), 'invalid ei0_substeps') + CALL expect_badinput('deck_ei0angle.dat', deck_with_ei0_option('0 ei0_substep_angle'), 'zero ei0_substep_angle') + CALL expect_badinput('deck_ei0max.dat', deck_with_ei0_option('1025 ei0_substep_max'), 'ei0_substep_max above 1024') + CALL expect_badinput('deck_ei0maxfr.dat', deck_with_ei0_option('2.5 ei0_substep_max'), 'fractional ei0_substep_max') + CALL expect_badinput('deck_ei0maxbig.dat', deck_with_ei0_option('2048.5 ei0_substep_max'), 'large ei0_substep_max') CALL expect_badinput('deck_body.dat', deck_with_bodies(), 'Rigid6 BODY') CALL expect_badinput('deck_ei.dat', deck_with_finite_ei(), 'finite-EI section') CALL expect_badinput('deck_badgj.dat', deck_with_bad_native_finite_ei(), 'explicit finite-EI') @@ -7170,4 +7177,9 @@ CHARACTER(900) FUNCTION deck_with_fractional_recovery_cap() RESULT(s) '4.5 recovery_max_substeps' END FUNCTION deck_with_fractional_recovery_cap + CHARACTER(900) FUNCTION deck_with_ei0_option(row) RESULT(s) + CHARACTER(*), INTENT(IN) :: row + s = 'badei0'//NEW_LINE('a')//'--- OPTIONS ---'//NEW_LINE('a')//row + END FUNCTION deck_with_ei0_option + END PROGRAM test_deck_driver diff --git a/tests/test_ei0_slack_dynamics.f90 b/tests/test_ei0_slack_dynamics.f90 index a4c3dbf7..2abef10d 100644 --- a/tests/test_ei0_slack_dynamics.f90 +++ b/tests/test_ei0_slack_dynamics.f90 @@ -19,7 +19,7 @@ PROGRAM test_ei0_slack_dynamics !! tension spike and is not sub-stepped, the force blend does not warn; rhoInf above !! 0.95 prints its note; a 10 m sway at dtM 0.2 s prints the segment-turn advisory with !! off ei0_substeps, and with the default auto is sub-stepped instead (reported; the turn - !! per solver step drops from about 6 deg to below 2 deg); the unresolved slack-to-taut + !! per solver step drops from about 6 deg to about 1.3 deg); the unresolved slack-to-taut !! snaps of case 1 print the snap note. !! 5. The Newton tangent of the force-blended step against a central finite difference of its !! residual (the step's probe_q hook), on a three-segment tension-only chain with one fixed @@ -693,7 +693,10 @@ SUBROUTINE case_run_audit() CALL require(.NOT. file_contains('ei0slack_audit_sway.log', 'Warning: line'), 'audit:sway-no-warning') ! the default (auto) sub-steps those steps: the run reports the sub-stepping, and the turn ! per solver step drops to about 1 deg (the steps recovered after a stall take their four - ! sub-steps as given, so a note may remain for them) + ! sub-steps as given, so a note may remain for them): 1.27 deg against 6.21 deg taken as + ! given (gfortran, Windows). A step left unresolved turns by the full step's turn, a + ! recovered one by a quarter of it, so half the turn taken as given separates the two + ! without depending on which steps round-off makes stall opts(4) = '' CALL write_deck('ei0slack_audit_sway_auto.dat', CABLE, [205.0_wp, 0.0_wp, -80.0_wp], & [5.0_wp, 0.0_wp, -14.0_wp], 230.0_wp, 115, 80.0_wp, '-', opts) @@ -705,7 +708,8 @@ SUBROUTINE case_run_audit() turn_auto = noted_turn('ei0slack_audit_sway_auto.log') WRITE (*, '(A,F7.3,A,F7.3,A)') ' sway at dtM 0.2 s: largest turn per solver step ', turn_off, ' deg (off), ', & turn_auto, ' deg (auto)' - CALL require(turn_off > 4.0_wp .AND. turn_auto >= 0.0_wp .AND. turn_auto < 2.0_wp, 'audit:sway-auto-resolved-turn') + CALL require(turn_off > 4.0_wp .AND. turn_auto >= 0.0_wp .AND. turn_auto < 0.5_wp*turn_off, & + 'audit:sway-auto-resolved-turn') ! the configuration blend (paper mode) takes every step as given CALL require(.NOT. file_contains('ei0slack_audit_cfg.log', 'ei0_substeps auto solved'), & 'audit:configuration-blend-not-sub-stepped') @@ -1470,17 +1474,18 @@ SUBROUTINE case_law_slack_runs() REAL(wp) :: fair, anch, seg_min ! the light cable as a lightly damped viscoelastic line, 3 m heave at dtM 0.1 s: anchor ! 8.2e4 to 9.5e4 N and fairlead 0.97e5 to 1.02e5 N at dtM 0.5 to 2.5 ms; without the cap - ! on its law segments 1.45e5 N at the anchor. At 0.1 s the anchor snap is not resolved in - ! time (the run notes it), so its peak depends on round-off: 9.2e4 N with gfortran on - ! Windows with the default sub-steps (8.5e4 N taking every step as given), other values on - ! other platforms. The upper bound is the check of the cap, well below the 1.45e5 N of the - ! uncapped law; the lower bound only asks that the snap reaches the anchor. + ! on its law segments 1.45e5 N at the anchor, both taking every step as given. At 0.1 s the + ! anchor snap is not resolved in time (the run notes it), so its peak depends on round-off: + ! 8.5e4 N with gfortran on Windows, other values on other platforms. The run takes every + ! step as given (off ei0_substeps), as the 1.45e5 N without the cap was measured, so the + ! upper bound checks the cap against that figure; the lower bound only asks that the snap + ! reaches the anchor. The sub-steps of the default are checked on this law by test_syrope. CALL write_motion('ei0slack_heave_ve.txt', 1, [5.0_wp, 0.0_wp, -14.0_wp], 3, 3.0_wp, 10.0_wp, 10.0_wp, & 0.1_wp, 40.0_wp) opts(1) = '0.1 dtM' opts(2) = '40.0 TMax' opts(3) = 'ei0slack_heave_ve.txt motionFile' - opts(4) = '' + opts(4) = 'off ei0_substeps' CALL write_deck('ei0slack_ve_light.dat', CABLE_VE, [205.0_wp, 0.0_wp, -80.0_wp], [5.0_wp, 0.0_wp, -14.0_wp], & 230.0_wp, 115, 80.0_wp, 't', opts) CALL run_driver_logged('ei0slack_ve_light.dat', 'ei0slack_ve_light', 'ei0slack_ve_light.log', ok) @@ -1491,11 +1496,11 @@ SUBROUTINE case_law_slack_runs() WRITE (*, '(A,ES10.3,A,ES10.3,A,ES10.3,A)') ' viscoelastic light cable, dtM 0.1 s: FairTen1 max ', fair, & ' N, AnchTen1 max ', anch, ' N, smallest segment tension ', seg_min, ' N' CALL require(seg_min <= 0.0_wp, 've-slack:goes-slack') - CALL require(anch > 4.0e4_wp .AND. anch < 1.3e5_wp, 've-slack:anchor-peak') + CALL require(anch > 4.0e4_wp .AND. anch < 1.0e5_wp, 've-slack:anchor-peak') CALL require(fair > 8.0e4_wp .AND. fair < 1.2e5_wp, 've-slack:fairlead-peak') CALL require(.NOT. file_contains('ei0slack_ve_light.log', 'Warning: line'), 've-slack:no-spike-warning') ! a taut Syrope line in 4 m surge that goes slack, dtM 0.1 s: fairlead 1.78 MN at dtM 1 and - ! 2.5 ms; 1.82 MN with the default sub-steps, 1.64 MN taking every step as given and + ! 2.5 ms; 1.81 MN with the default sub-steps, 1.64 MN taking every step as given and ! 1.67 MN with the configuration blend (gfortran, Windows). The bounds catch a spike or a ! lost snap, not the round-off-dependent peak of the unresolved snap CALL write_syrope_files() diff --git a/tests/test_model.f90 b/tests/test_model.f90 index db2bb1a0..b8063fcd 100644 --- a/tests/test_model.f90 +++ b/tests/test_model.f90 @@ -532,11 +532,11 @@ SUBROUTINE case_resolved_substeps() !! than the plain march at dt, and repeats bit for bit from a copy of its state (a restart). !! With off, or with an angle no step reaches, every step is the plain step bit for bit; a !! junction step (end query armed) is never sub-stepped (it matches the plain march to the - !! Newton tolerance: its warm start differs); an invalid angle fails closed. + !! Newton tolerance: its warm start differs); invalid settings fail at CD_Init_Model. INTEGER, PARAMETER :: NE = 8, NN = NE + 1, NDOF = 3*NN, NSTEP = 30, NFINE = 8 REAL(wp), PARAMETER :: DT = 0.1_wp TYPE(CD_ModelType) :: auto_m, off_m, wide_m, twin_m, junc_m, fine_m, bad_m - TYPE(GenAlphaConfig) :: cfg + TYPE(GenAlphaConfig) :: cfg, bad_cfg INTEGER :: conn(2, NE), fixed(6), es, n_iter, k, j REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), v0(NDOF), f_ext(NDOF) REAL(wp) :: pq(NDOF), pv(NDOF), pa(NDOF), err_auto, err_off @@ -555,8 +555,6 @@ SUBROUTINE case_resolved_substeps() wide_m%cfg%ei0_substep_angle = 90.0_wp CALL CD_Copy_Model(auto_m, junc_m, es, em) CALL CD_Copy_Model(off_m, fine_m, es, em) - CALL CD_Copy_Model(auto_m, bad_m, es, em) - bad_m%cfg%ei0_substep_angle = 0.0_wp all_conv = .TRUE. lands = .TRUE. @@ -595,22 +593,32 @@ SUBROUTINE case_resolved_substeps() twin_ok = ALL(twin_m%q == auto_m%q) .AND. ALL(twin_m%v == auto_m%v) .AND. ALL(twin_m%a == auto_m%a) err_auto = MAXVAL(ABS(auto_m%q - fine_m%q)) err_off = MAXVAL(ABS(off_m%q - fine_m%q)) - WRITE (*, '(A,I0,A,I0,A,I0,A,ES10.3,A,ES10.3,A)') ' resolved sub-steps: ', auto_m%sub_events, ' of ', & - auto_m%sub_calls, ' steps (at most ', auto_m%sub_max_used, '); position error against dt/8 ', err_auto, & + WRITE (*, '(A,I0,A,I0,A,I0,A,ES10.3,A,ES10.3,A)') ' resolved sub-steps: ', auto_m%sub_stats%events, ' of ', & + auto_m%sub_stats%calls, ' steps (at most ', auto_m%sub_stats%max_used, '); position error against dt/8 ', err_auto, & ' m (plain ', err_off, ' m)' CALL require(all_conv, 'resolved:converged') - CALL require(auto_m%sub_events > 0 .AND. auto_m%sub_max_used >= 4, 'resolved:sub-stepped') + CALL require(auto_m%sub_stats%events > 0 .AND. auto_m%sub_stats%max_used >= 4, 'resolved:sub-stepped') CALL require(lands, 'resolved:lands-on-prescribed-end') CALL require(err_auto < 0.75_wp*err_off, 'resolved:closer-to-fine-march') CALL require(twin_ok, 'resolved:restart-bit-identical') - CALL require(off_m%sub_calls == 0 .AND. off_m%sub_events == 0, 'resolved:off-not-examined') - CALL require(wide_m%sub_events == 0 .AND. ALL(wide_m%q == off_m%q) .AND. ALL(wide_m%v == off_m%v) .AND. & + CALL require(off_m%sub_stats%calls == 0 .AND. off_m%sub_stats%events == 0, 'resolved:off-not-examined') + CALL require(wide_m%sub_stats%events == 0 .AND. ALL(wide_m%q == off_m%q) .AND. ALL(wide_m%v == off_m%v) .AND. & ALL(wide_m%a == off_m%a), 'resolved:untriggered-is-plain') - CALL require(junc_m%sub_calls == 0 .AND. MAXVAL(ABS(junc_m%q - off_m%q)) < 1.0e-6_wp, & + CALL require(junc_m%sub_stats%calls == 0 .AND. MAXVAL(ABS(junc_m%q - off_m%q)) < 1.0e-6_wp, & 'resolved:junction-not-sub-stepped') - CALL circle_end_motion(q0, pq, pv, pa, DT) - CALL CD_Step_Model(bad_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + ! the settings are checked once, at CD_Init_Model + bad_cfg = cfg + bad_cfg%ei0_substep_angle = 0.0_wp + CALL CD_Init_Model(bad_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, bad_cfg, es, em) CALL require(es == CD_MODEL_BADINPUT .AND. INDEX(em, 'ei0_substep_angle') > 0, 'resolved:invalid-angle') + bad_cfg = cfg + bad_cfg%ei0_substep_max = 1025 + CALL CD_Init_Model(bad_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, bad_cfg, es, em) + CALL require(es == CD_MODEL_BADINPUT .AND. INDEX(em, 'ei0_substep_max') > 0, 'resolved:invalid-max') + bad_cfg = cfg + bad_cfg%ei0_substeps = 7 + CALL CD_Init_Model(bad_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, bad_cfg, es, em) + CALL require(es == CD_MODEL_BADINPUT .AND. INDEX(em, 'ei0_substeps') > 0, 'resolved:invalid-mode') CALL CD_End_Model(auto_m, es, em) CALL CD_End_Model(off_m, es, em) CALL CD_End_Model(wide_m, es, em) @@ -691,22 +699,22 @@ SUBROUTINE case_substep_paths() all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv more_lands = more_lands .AND. ALL(more_m%q(fixed) == pq(fixed)) END DO - WRITE (*, '(A,I0,A,I0,A,I0,A,I0,A,I0,A)') ' sub-step paths: ', auto_m%sub_events, ' of ', auto_m%sub_calls, & - ' steps sub-stepped, ', auto_m%sub_remeasured, ' re-measured; fallback ', fb_m%sub_fallbacks, & - ', capped ', cap_m%sub_capped, ' steps' + WRITE (*, '(A,I0,A,I0,A,I0,A,I0,A,I0,A)') ' sub-step paths: ', auto_m%sub_stats%events, ' of ', auto_m%sub_stats%calls, & + ' steps sub-stepped, ', auto_m%sub_stats%remeasured, ' re-measured; fallback ', fb_m%sub_stats%fallbacks, & + ', capped ', cap_m%sub_stats%capped, ' steps' CALL require(all_conv, 'substep-paths:converged') - CALL require(auto_m%sub_events > 0, 'substep-paths:sub-stepped') + CALL require(auto_m%sub_stats%events > 0, 'substep-paths:sub-stepped') CALL require(ANY(auto_m%ve_dl_1 /= dl1_0) .AND. ANY(auto_m%fr_anchor /= fr_0), 'substep-paths:states-move') CALL require(ALL(rep_m%q == auto_m%q) .AND. ALL(rep_m%v == auto_m%v) .AND. ALL(rep_m%a == auto_m%a) .AND. & ALL(rep_m%ve_dl_1 == auto_m%ve_dl_1) .AND. ALL(rep_m%fr_anchor == auto_m%fr_anchor), & 'substep-paths:restore-is-complete') - CALL require(fb_m%sub_events == 0 .AND. fb_m%sub_fallbacks > 0, 'substep-paths:fallback-counted') + CALL require(fb_m%sub_stats%events == 0 .AND. fb_m%sub_stats%fallbacks > 0, 'substep-paths:fallback-counted') CALL require(ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. ALL(fb_m%a == off_m%a) .AND. & ALL(fb_m%ve_dl_1 == off_m%ve_dl_1) .AND. ALL(fb_m%fr_anchor == off_m%fr_anchor), & 'substep-paths:fallback-is-the-plain-step') - CALL require(cap_m%sub_capped > 0 .AND. cap_m%sub_max_used == 4, 'substep-paths:cap') - CALL require(more_m%sub_remeasured == more_m%sub_events .AND. more_m%sub_events > 0 .AND. & - more_m%sub_max_used >= SUB_MIN + 1 .AND. more_lands .AND. & + CALL require(cap_m%sub_stats%capped > 0 .AND. cap_m%sub_stats%max_used == 4, 'substep-paths:cap') + CALL require(more_m%sub_stats%remeasured == more_m%sub_stats%events .AND. more_m%sub_stats%events > 0 .AND. & + more_m%sub_stats%max_used >= SUB_MIN + 1 .AND. more_lands .AND. & ANY(more_m%q /= auto_m%q), 'substep-paths:re-measured') CALL CD_End_Model(auto_m, es, em) CALL CD_End_Model(rep_m, es, em) @@ -717,44 +725,101 @@ SUBROUTINE case_substep_paths() END SUBROUTINE case_substep_paths SUBROUTINE case_substep_snap_only() - !! The snap trigger alone: a straight 4-segment line 5 % slack (no turn in any step) whose - !! End B is pulled 0.5 m along the line in one 0.05 s step snaps taut. The step is solved in - !! four sub-steps; with ei0_substeps off it is taken as given. + !! The snap trigger alone, on straight 4-segment lines whose End B is pulled along the line in + !! one 0.05 s step (no turn in any step; the axial wave crosses a segment 15 times per step): + !! (1) a line 5 % slack all over (step-start and initial tension 0) snaps taut and is solved + !! in four sub-steps, and with ei0_substeps off it is taken as given; (2) on a line whose + !! End A half is taut (52.6 kN) and End B half 20 % slack, the taut half recoils and snaps the + !! slack half taut: with End B pulled 0.2 m its segments end at 0.42 of the step-start tension, + !! above a quarter of it (a snap, four sub-steps), with End B held at 0.22, below it (the plain + !! step, bit for bit); (3) on the 5 % slack line made 1000 times heavier + !! the axial wave crosses a segment 0.48 times per step, so the step resolves the snap as + !! given and is not sub-stepped. INTEGER, PARAMETER :: NE = 4, NN = NE + 1, NDOF = 3*NN REAL(wp), PARAMETER :: DT = 0.05_wp TYPE(CD_ModelType) :: auto_m, off_m - TYPE(GenAlphaConfig) :: cfg - INTEGER :: conn(2, NE), fixed(6), es, n_iter - REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), v0(NDOF), f_ext(NDOF), pq(NDOF), pv(NDOF), pa(NDOF) - LOGICAL :: conv, stalled, ok + INTEGER :: conn(2, NE), fixed(6), es + REAL(wp) :: l0(NE), ea(NE), rho_a(NE), q0(NDOF), pq(NDOF) + REAL(wp) :: t_start, t_end_big, t_end_small + LOGICAL :: ok, auto_ok, off_ok CHARACTER(240) :: em CALL straight_cable(NE, conn, l0, ea, rho_a, q0, fixed) + ! (1) slack all over l0 = 1.05_wp - v0 = 0.0_wp - f_ext = 0.0_wp - CALL CD_Init_Model(auto_m, q0, v0, conn, l0, ea, rho_a, .TRUE., f_ext, fixed, cfg, es, em) + CALL snap_pull(conn, l0, ea, rho_a, q0, fixed, DT, 0.5_wp, auto_m, off_m, pq, auto_ok, off_ok) + WRITE (*, '(A,I0,A,I0,A)') ' snap-only trigger, slack line: ', auto_m%sub_stats%events, & + ' step(s) sub-stepped, at most ', auto_m%sub_stats%max_used, ' sub-steps' + CALL require(auto_ok .AND. off_ok, 'snap-only:converged') + CALL require(auto_m%sub_stats%events == 1 .AND. auto_m%sub_stats%max_used == 4, 'snap-only:four-sub-steps') + CALL require(ALL(auto_m%q(fixed) == pq(fixed)), 'snap-only:lands-on-end-state') + CALL require(off_m%sub_stats%events == 0 .AND. ANY(off_m%q /= auto_m%q), 'snap-only:off-takes-the-step') + ! (2) partly taut: the floor is the step-start tension of the taut half + l0(1:2) = 0.95_wp + l0(3:4) = 1.20_wp + t_start = ea(1)*(1.0_wp/0.95_wp - 1.0_wp) + CALL snap_pull(conn, l0, ea, rho_a, q0, fixed, DT, 0.2_wp, auto_m, off_m, pq, auto_ok, off_ok) + t_end_big = slack_half_tension(off_m, ea, l0) + ok = auto_ok .AND. off_ok .AND. auto_m%sub_stats%events == 1 .AND. auto_m%sub_stats%max_used == 4 + CALL snap_pull(conn, l0, ea, rho_a, q0, fixed, DT, 0.0_wp, auto_m, off_m, pq, auto_ok, off_ok) + t_end_small = slack_half_tension(off_m, ea, l0) + WRITE (*, '(A,F6.3,A,F6.3,A)') ' snap-only trigger, partly taut line: the slack half ends at ', & + t_end_big/t_start, ' (End B pulled 0.2 m) and ', t_end_small/t_start, ' (held) of the step-start tension' + CALL require(t_end_big > 0.25_wp*t_start .AND. t_end_small > 0.0_wp .AND. t_end_small < 0.25_wp*t_start, & + 'snap-partly-taut:pulls-cross-the-threshold') + CALL require(ok, 'snap-partly-taut:above-threshold-sub-stepped') + CALL require(auto_ok .AND. off_ok .AND. auto_m%sub_stats%calls == 1 .AND. auto_m%sub_stats%events == 0 .AND. & + ALL(auto_m%q == off_m%q) .AND. ALL(auto_m%v == off_m%v) .AND. ALL(auto_m%a == off_m%a), & + 'snap-partly-taut:below-threshold-plain') + ! (3) a step that resolves the axial wave takes the snap as given + l0 = 1.05_wp + rho_a = 1.0e3_wp*rho_a + CALL snap_pull(conn, l0, ea, rho_a, q0, fixed, DT, 0.5_wp, auto_m, off_m, pq, auto_ok, off_ok) + CALL require(auto_ok .AND. off_ok .AND. auto_m%sub_stats%calls == 1 .AND. auto_m%sub_stats%events == 0 .AND. & + ALL(auto_m%q == off_m%q) .AND. slack_half_tension(off_m, ea, l0) > 0.0_wp, 'snap-resolved-wave:plain') + CALL CD_End_Model(auto_m, es, em) + CALL CD_End_Model(off_m, es, em) + END SUBROUTINE case_substep_snap_only + + SUBROUTINE snap_pull(conn, l0, ea, rho_a, q0, fixed, dt, dx, auto_m, off_m, pq, ok_auto, ok_off) + !! case_substep_snap_only: a fresh pair of models (auto, off) of the straight line at rest, + !! End B pulled along the line by dx in one step of dt. + INTEGER, INTENT(IN) :: conn(:, :), fixed(:) + REAL(wp), INTENT(IN) :: l0(:), ea(:), rho_a(:), q0(:), dt, dx + TYPE(CD_ModelType), INTENT(INOUT) :: auto_m, off_m + REAL(wp), INTENT(OUT) :: pq(:) + LOGICAL, INTENT(OUT) :: ok_auto, ok_off + TYPE(GenAlphaConfig) :: cfg + INTEGER :: n_it, es, n + LOGICAL :: conv, stalled + REAL(wp) :: pv(SIZE(q0)), pa(SIZE(q0)), zero(SIZE(q0)) + CHARACTER(240) :: em + n = SIZE(q0) + zero = 0.0_wp + CALL CD_Init_Model(auto_m, q0, zero, conn, l0, ea, rho_a, .TRUE., zero, fixed, cfg, es, em) CALL require(es == CD_MODEL_OK, 'snap-only:init: '//TRIM(em)) - IF (es /= CD_MODEL_OK) RETURN CALL CD_Copy_Model(auto_m, off_m, es, em) off_m%cfg%ei0_substeps = CD_EI0_SUBSTEPS_OFF pq = q0 pv = 0.0_wp pa = 0.0_wp - pq(NDOF - 2) = q0(NDOF - 2) + 0.5_wp - CALL CD_Step_Model(auto_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) - ok = es == CD_MODEL_OK .AND. conv - CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) - ok = ok .AND. es == CD_MODEL_OK .AND. conv - WRITE (*, '(A,I0,A,I0,A)') ' snap-only trigger: ', auto_m%sub_events, ' step(s) sub-stepped, at most ', & - auto_m%sub_max_used, ' sub-steps' - CALL require(ok, 'snap-only:converged') - CALL require(auto_m%sub_events == 1 .AND. auto_m%sub_max_used == 4, 'snap-only:four-sub-steps') - CALL require(ALL(auto_m%q(fixed) == pq(fixed)), 'snap-only:lands-on-end-state') - CALL require(off_m%sub_events == 0 .AND. ANY(off_m%q /= auto_m%q), 'snap-only:off-takes-the-step') - CALL CD_End_Model(auto_m, es, em) - CALL CD_End_Model(off_m, es, em) - END SUBROUTINE case_substep_snap_only + pq(n - 2) = q0(n - 2) + dx + CALL CD_Step_Model(auto_m, dt, conv, stalled, n_it, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + ok_auto = es == CD_MODEL_OK .AND. conv + CALL CD_Step_Model(off_m, dt, conv, stalled, n_it, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) + ok_off = es == CD_MODEL_OK .AND. conv + END SUBROUTINE snap_pull + + REAL(wp) FUNCTION slack_half_tension(m, ea, l0) RESULT(t_max) + !! case_substep_snap_only: the largest tension of segments 3 and 4 (EA times the strain). + TYPE(CD_ModelType), INTENT(IN) :: m + REAL(wp), INTENT(IN) :: ea(:), l0(:) + INTEGER :: e + t_max = 0.0_wp + DO e = 3, 4 + t_max = MAX(t_max, ea(e)*(NORM2(m%q(3*e + 1:3*e + 3) - m%q(3*e - 2:3*e))/l0(e) - 1.0_wp)) + END DO + END FUNCTION slack_half_tension SUBROUTINE circle_end_motion(q0, pq, pv, pa, t) !! End A held, End B (the last node) on the circle x_B + R r(t) (0, sin wt, 1 - cos wt), diff --git a/tests/test_syrope.f90 b/tests/test_syrope.f90 index bed4c957..31658bc6 100644 --- a/tests/test_syrope.f90 +++ b/tests/test_syrope.f90 @@ -688,8 +688,10 @@ END SUBROUTINE case_model_mixed_ve_syrope SUBROUTINE case_substeps_restore_law_states() !! The rotation-resolved sub-stepping of a model carrying a Syrope and a viscoelastic - !! element (case_model_mixed_ve_syrope), node 2 free and node 3 driven on a 0.4 m circle at - !! 2 s, so the chords turn by more than a degree per 0.02 s step: solving the first + !! element (case_model_mixed_ve_syrope, the viscoelastic element 1000 times stiffer so that + !! its law tension counts as taut against the 0.8 MN of the Syrope element), node 2 free and + !! node 3 driven on a 0.4 m circle at 2 s, so the chords turn by more than a degree per + !! 0.02 s step: solving the first !! sub-stepped pass twice, the second from the restored committed state (TEST-ONLY !! sub_test_repeat), changes nothing bit for bit, Syrope slow strain and running maximum and !! viscoelastic dl_1 included; a failing sub-step (TEST-ONLY sub_test_fail) returns the plain @@ -710,7 +712,7 @@ SUBROUTINE case_substeps_restore_law_states() conn(:, 1) = [1, 2] conn(:, 2) = [2, 3] l0 = L0E - eav = [1.0e8_wp, 100.0_wp] + eav = [1.0e8_wp, 1.0e5_wp] rho_a = 50.0_wp q0 = 0.0_wp q0(4) = L0E*(1.0_wp + EPS) @@ -723,7 +725,7 @@ SUBROUTINE case_substeps_restore_law_states() stype(2) = td sslow = [0.021_wp, 0.0_wp] stmax = [2.0e6_wp, 0.0_wp] - ve_ead = [0.0_wp, 400.0_wp] + ve_ead = [0.0_wp, 4.0e5_wp] ve_ba = [0.0_wp, 7.0_wp] ve_bad = [0.0_wp, 3.0_wp] CALL CD_Init_Model(auto_m, q0, v0, conn, l0, eav, rho_a, .TRUE., f_ext, fixed, cfg, es, em, & @@ -754,16 +756,16 @@ SUBROUTINE case_substeps_restore_law_states() CALL CD_Step_Model(off_m, DT, conv, stalled, n_iter, es, em, prescribed_q=pq, prescribed_v=pv, prescribed_a=pa) all_conv = all_conv .AND. es == CD_MODEL_OK .AND. conv END DO - WRITE (*, '(A,I0,A,I0,A,I0,A)') ' sub-steps with Syrope and viscoelastic states: ', auto_m%sub_events, & - ' of ', auto_m%sub_calls, ' steps sub-stepped, ', fb_m%sub_fallbacks, ' failing-sub-step fallbacks' + WRITE (*, '(A,I0,A,I0,A,I0,A)') ' sub-steps with Syrope and viscoelastic states: ', auto_m%sub_stats%events, & + ' of ', auto_m%sub_stats%calls, ' steps sub-stepped, ', fb_m%sub_stats%fallbacks, ' failing-sub-step fallbacks' CALL require(all_conv, 'substep-law:converged') - CALL require(auto_m%sub_events > 0, 'substep-law:sub-stepped') + CALL require(auto_m%sub_stats%events > 0, 'substep-law:sub-stepped') CALL require(ANY(auto_m%syrope_slow /= slow0) .AND. ANY(auto_m%ve_dl_1 /= dl0), 'substep-law:states-move') CALL require(ALL(rep_m%q == auto_m%q) .AND. ALL(rep_m%v == auto_m%v) .AND. ALL(rep_m%a == auto_m%a) .AND. & ALL(rep_m%syrope_slow == auto_m%syrope_slow) .AND. & ALL(rep_m%syrope_tmax == auto_m%syrope_tmax) .AND. ALL(rep_m%ve_dl_1 == auto_m%ve_dl_1), & 'substep-law:restore-is-complete') - CALL require(fb_m%sub_fallbacks > 0 .AND. ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. & + CALL require(fb_m%sub_stats%fallbacks > 0 .AND. ALL(fb_m%q == off_m%q) .AND. ALL(fb_m%v == off_m%v) .AND. & ALL(fb_m%a == off_m%a) .AND. ALL(fb_m%syrope_slow == off_m%syrope_slow) .AND. & ALL(fb_m%syrope_tmax == off_m%syrope_tmax) .AND. ALL(fb_m%ve_dl_1 == off_m%ve_dl_1), & 'substep-law:fallback-is-the-plain-step') diff --git a/validation/experiments/bergdahl/README.md b/validation/experiments/bergdahl/README.md index 0f372ba9..29b3335f 100644 --- a/validation/experiments/bergdahl/README.md +++ b/validation/experiments/bergdahl/README.md @@ -70,11 +70,11 @@ committed summary file (`sha256sum`, or `Get-FileHash` in PowerShell). `comparison_summary.csv`, `aggregate_metrics.json` and `provenance.json` hold the compact results and the checksum of the executable used. The calculated force is `FairTen1`, the force -at the upper line end. Across the 30 conditions, the cycle maxima have an RMSE of 1.59 N, a -mean absolute percentage error of 3.13%, a mean bias of +0.45 N, a Pearson correlation of 0.993 +at the upper line end. Across the 30 conditions, the cycle maxima have an RMSE of 1.58 N, a +mean absolute percentage error of 3.13%, a mean bias of +0.46 N, a Pearson correlation of 0.993 and a Lin concordance coefficient of 0.989. For the two waveform conditions, halving the nominal -element length and the time step changes the mean cycle maximum by no more than 0.53% and -0.13%, respectively, and the phase-averaged force histories have RMSEs of 5.95% and 2.54% of +element length and the time step changes the mean cycle maximum by no more than 0.56% and +0.19%, respectively, and the phase-averaged force histories have RMSEs of 5.95% and 2.54% of the measured force range (computed with the executable of the 2026-10-09 record; see `provenance.json`). The waveform CSVs carry the measured phase averages computed from the supplement's `expData.dat`. @@ -87,9 +87,12 @@ step only once the step resolves these modes, roughly dtM ≲ l/(2c) ≈ 0.29 ms on slack lines" in the [modelling guide](https://cabledyn.readthedocs.io/en/latest/modeling.html)). At a coarser step the maxima do not settle: at the T = 1.25 s, 0.20 m condition they are 69.5 N at 0.625 ms (72.2 N with every step taken as given, `off ei0_substeps`), against -68.0 N at 0.3125 ms and 67.9 N at 0.15625 ms. Coarse steps also +68.0 N at 0.3125 ms and 67.8 N at 0.15625 ms. At 0.3125 ms and below the step resolves the +axial wave over a 0.2 m segment, so the rotation- and snap-resolved sub-steps of +`ei0_substeps auto` take no part in the primary matrix (its results equal those taken as +given); the 0.1 m mesh at 0.3125 ms and the 0.625 ms step use them. Coarse steps also leave the maxima sensitive to the Newton tolerance and to small changes in the solver's iteration path. With a 1.25 ms step and a relative tolerance of 1e-5, the five cycle maxima of a condition have standard deviations of up to 1.6 N, their means are 2–15% above the converged values, and the 30-condition RMSE is 3.7 N. At the 0.3125 ms step the standard deviation is at -most 0.17 N. +most 0.19 N. diff --git a/validation/experiments/bergdahl/aggregate_metrics.json b/validation/experiments/bergdahl/aggregate_metrics.json index afbc23da..7e090b78 100644 --- a/validation/experiments/bergdahl/aggregate_metrics.json +++ b/validation/experiments/bergdahl/aggregate_metrics.json @@ -1,12 +1,12 @@ { "completed_cases": 30, - "mean_bias_N": 0.4463738400000018, - "mean_bias_percent_of_measured": 1.5566744346055916, - "mae_N": 1.3322167866666672, - "mape_percent": 3.1345007652497823, - "rmse_N": 1.5877613664615542, + "mean_bias_N": 0.4616683466666679, + "mean_bias_percent_of_measured": 1.5855886766627234, + "mae_N": 1.327560893333332, + "mape_percent": 3.1267980284256174, + "rmse_N": 1.5827470765235303, "maximum_absolute_error_percent": 7.717337853107351, - "pearson_correlation": 0.9931905701837782, - "correlation_r_squared": 0.9864275087019785, - "lin_concordance_correlation": 0.9890602173780585 + "pearson_correlation": 0.9932561631491675, + "correlation_r_squared": 0.9865578056338057, + "lin_concordance_correlation": 0.9891388894227845 } diff --git a/validation/experiments/bergdahl/comparison_summary.csv b/validation/experiments/bergdahl/comparison_summary.csv index fec0f964..cb97a7df 100644 --- a/validation/experiments/bergdahl/comparison_summary.csv +++ b/validation/experiments/bergdahl/comparison_summary.csv @@ -1,31 +1,31 @@ case,period_s,radius_m,measured_maximum_N,dt_s,number_of_elements,element_length_m,total_cycles,ramp_cycles,rho_inf,published_ground_modulus_Pa_per_m,published_ground_damping_ratio,published_contact_diameter_m,equivalent_volume_diameter_m,kbot_Pa_per_m,cbot_Pa_s_per_m,contact_coefficients_overridden,ba_N_s,friction_mu,solver_relative_tolerance,analysis_start_s,deck_sha256,motion_sha256,samples_analysed,predicted_mean_N,predicted_minimum_N,predicted_absolute_maximum_N,predicted_mean_cycle_maximum_N,predicted_cycle_maximum_std_N,predicted_range_N,maximum_error_N,maximum_error_percent -bergdahl_T1p25_R0p075_h0p200_dt0p0003,1.25,0.075,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,9a15c83cd584db2d41b7425c2464d45b951e064312e22d2bd5f2bdc5d62c78be,200c532b956836233ff1706360190a636fa05d658c6e4dc8b0eeda6ac38665d7,20001,22.761262326175693,0.6118298,41.58885,41.51824520000001,0.087761545968037,40.9770202,-0.9817547999999903,-2.3100112941176243 -bergdahl_T1p25_R0p100_h0p200_dt0p0003,1.25,0.1,46.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,35f623bef1aa930eca217ccf056b72d26a2a3003af68a8efbce83fadb8921146,deb435829efdb15fd5c8f0b8db9dd0c83cfa10aab269a24dcd1fae02d0156547,20001,23.41468092322619,0.080218397,47.33166,47.2240214,0.08104350965561587,47.251441602999996,0.4240214000000009,0.9060286324786344 -bergdahl_T1p25_R0p125_h0p200_dt0p0003,1.25,0.125,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,3db8b8c41f6fd9b122135c92bb6311db9c79ed022cea0e9341c82e382ea2d8c4,350bd646ce87b6afcfec808548ada2624a25186efabbcd00dc72864f1b20fbf0,20001,24.473830476762014,0.080218397,53.097523,52.9544852,0.09836654800134037,53.017304603,-1.1455148000000008,-2.1174025878003713 -bergdahl_T1p25_R0p150_h0p200_dt0p0003,1.25,0.15,60.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,6db3b6e1e3a34c320567820a2b227905aea57c8940efdebb14afb0b1a4bb6b8b,a8a5c083de018445740094b398496386e405db1c896d75c8e01c6acd0c985d3c,20001,25.735719992589374,0.080218397,58.297697,58.1087224,0.11443742252340404,58.217478602999996,-2.291277600000001,-3.793505960264902 -bergdahl_T1p25_R0p200_h0p200_dt0p0003,1.25,0.2,70.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,79b6ad075892ffbad6f63343cb55454aa2380387002b23c95dd63ec99ad89757,a3f02e630a2f80e08b9367d4362b4bb09c37f3fb5935ecdc3f548d38fb0f22da,20001,28.523775550869306,0.046140683,68.182784,67.9888416,0.1332818584496762,68.136643317,-2.3111583999999965,-3.287565291607392 +bergdahl_T1p25_R0p075_h0p200_dt0p0003,1.25,0.075,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,9a15c83cd584db2d41b7425c2464d45b951e064312e22d2bd5f2bdc5d62c78be,200c532b956836233ff1706360190a636fa05d658c6e4dc8b0eeda6ac38665d7,20001,22.75729029778711,0.84961577,41.55663,41.518083000000004,0.0364163607119109,40.70701423,-0.9819169999999957,-2.3103929411764605 +bergdahl_T1p25_R0p100_h0p200_dt0p0003,1.25,0.1,46.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,35f623bef1aa930eca217ccf056b72d26a2a3003af68a8efbce83fadb8921146,deb435829efdb15fd5c8f0b8db9dd0c83cfa10aab269a24dcd1fae02d0156547,20001,23.423043792491978,0.080218397,47.463795,47.3005878,0.10685080749437453,47.383576602999995,0.5005878000000052,1.0696320512820625 +bergdahl_T1p25_R0p125_h0p200_dt0p0003,1.25,0.125,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,3db8b8c41f6fd9b122135c92bb6311db9c79ed022cea0e9341c82e382ea2d8c4,350bd646ce87b6afcfec808548ada2624a25186efabbcd00dc72864f1b20fbf0,20001,24.476081125954803,0.080218397,53.264162,53.1698942,0.0748986296049524,53.183943602999996,-0.9301057999999998,-1.7192343807763397 +bergdahl_T1p25_R0p150_h0p200_dt0p0003,1.25,0.15,60.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,6db3b6e1e3a34c320567820a2b227905aea57c8940efdebb14afb0b1a4bb6b8b,a8a5c083de018445740094b398496386e405db1c896d75c8e01c6acd0c985d3c,20001,25.732057802401027,0.080218397,58.343019,58.232365200000004,0.0759659228615041,58.262800602999995,-2.1676347999999948,-3.588799337748336 +bergdahl_T1p25_R0p200_h0p200_dt0p0003,1.25,0.2,70.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,8.75,79b6ad075892ffbad6f63343cb55454aa2380387002b23c95dd63ec99ad89757,a3f02e630a2f80e08b9367d4362b4bb09c37f3fb5935ecdc3f548d38fb0f22da,20001,28.52452245713629,0.047432814,68.254513,67.9673104,0.20436951680913815,68.207080186,-2.332689599999995,-3.3181928876244595 bergdahl_T1p50_R0p075_h0p200_dt0p0003,1.5,0.075,41.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,c84e640a68f2f9a806a08b3afb2b220a49025cf6cf3f75a4439df1e5007eb536,c93b19181604134c73d29a1e343dadd769c4cf5510d2214a929e96ad98bab6d7,24001,22.592768295391856,2.1826476,39.942296,39.862761,0.06165540456034704,37.759648399999996,-1.137239000000001,-2.7737536585365876 -bergdahl_T1p50_R0p100_h0p200_dt0p0003,1.5,0.1,45.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,89df9b353f05c33ad5b47160fb17b0ef2fb9aaaddc5f9c1bb6faa1aa651345b0,08aff391d95ba06a6e36de8101f986e34725034f826dcb56c079f6de0e8c63db,24001,23.093700958486732,0.080218397,46.141903,45.9667182,0.16534378531925498,46.061684602999996,0.6667182000000054,1.4717841059602768 -bergdahl_T1p50_R0p125_h0p200_dt0p0003,1.5,0.125,51.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,b08f6f7411a4c6bf6c51479886cdd5e5ec05048995f7df56b314f38602a6ac68,8da6cf5077f315d1445f9fa86597eb0c45f4a47ea564b2a14f53dbfcb12d70c0,24001,24.045022168526646,0.080218397,51.734981,51.58838060000001,0.16784017486525726,51.654762602999995,0.0883806000000078,0.17161281553399574 -bergdahl_T1p50_R0p150_h0p200_dt0p0003,1.5,0.15,59.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4adab994765aca18aa52757ef82e30d15cd9ad09a908cf44bae00cd890218bcb,d399fa50a0dcd35fa3a55d5e8cfddae96652df14bc08b3707dae3766fb725531,24001,25.233665231943505,0.080218397,56.563023,56.470973,0.10221066959960627,56.482804603,-2.5290269999999992,-4.286486440677965 -bergdahl_T1p50_R0p200_h0p200_dt0p0003,1.5,0.2,68.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4087f2ecb4c0dc5d8d29440397162646e11ea24585c1bff5229079b1c9e4bda0,80096d02b10970eabc9320273215f978a016c2ea4add6012ca7ecd21c68c2851,24001,27.95158491895067,0.049653031,66.994316,66.9071382,0.08601608688320998,66.94466296899999,-1.0928617999999943,-1.6071497058823445 +bergdahl_T1p50_R0p100_h0p200_dt0p0003,1.5,0.1,45.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,89df9b353f05c33ad5b47160fb17b0ef2fb9aaaddc5f9c1bb6faa1aa651345b0,08aff391d95ba06a6e36de8101f986e34725034f826dcb56c079f6de0e8c63db,24001,23.099262985012874,0.080218397,46.163762,45.9797466,0.12750091794885285,46.083543602999995,0.6797466000000014,1.5005443708609303 +bergdahl_T1p50_R0p125_h0p200_dt0p0003,1.5,0.125,51.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,b08f6f7411a4c6bf6c51479886cdd5e5ec05048995f7df56b314f38602a6ac68,8da6cf5077f315d1445f9fa86597eb0c45f4a47ea564b2a14f53dbfcb12d70c0,24001,24.037791008454146,0.080218397,51.738263,51.5905316,0.10014122989208964,51.658044603,0.09053159999999849,0.17578951456310388 +bergdahl_T1p50_R0p150_h0p200_dt0p0003,1.5,0.15,59.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4adab994765aca18aa52757ef82e30d15cd9ad09a908cf44bae00cd890218bcb,d399fa50a0dcd35fa3a55d5e8cfddae96652df14bc08b3707dae3766fb725531,24001,25.22877844669226,0.080218397,56.421491,56.337508400000004,0.07367940691129274,56.341272603,-2.6624915999999956,-4.512697627118636 +bergdahl_T1p50_R0p200_h0p200_dt0p0003,1.5,0.2,68.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,10.5,4087f2ecb4c0dc5d8d29440397162646e11ea24585c1bff5229079b1c9e4bda0,80096d02b10970eabc9320273215f978a016c2ea4add6012ca7ecd21c68c2851,24001,27.95913363490667,0.049391599,67.036091,66.92867720000001,0.09692043402812402,66.986699401,-1.0713227999999901,-1.5754747058823384 bergdahl_T2p00_R0p075_h0p200_dt0p0003,2.0,0.075,36.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,788d6c963eaccba31443ed29b33d8dd37dcde8e5945ac02f4c63728f4bcede11,06b2ee6b12d716e9c4757c91d6e330d7985b118f411d8673f0e3be1317cd10b7,32001,22.50825846114497,7.1153458,36.047917,36.035346999999994,0.011414748069932139,28.932571199999998,0.035346999999994466,0.09818611111109574 -bergdahl_T2p00_R0p100_h0p200_dt0p0003,2.0,0.1,39.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,66b4e4070897810cc0c2db78a9da33350dbf480ff297311b5ade518c36518e72,7cfeecfbc7673140d72af2c7a475ead3ce77736e54552c663e5df1b72cf6afdd,32001,22.72410170257179,0.49445707,41.953784,41.9163164,0.04256154826601123,41.459326929999996,2.4163163999999995,6.117256708860758 -bergdahl_T2p00_R0p125_h0p200_dt0p0003,2.0,0.125,47.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,11d53518b7f6d58facee9b5d62e582bbdc94a289098bbf6d3ac61defaf82c7e8,b2a8c64acddab4c852169269cca4e60bb258479eda2a6495d094c99f39cf76d3,32001,23.43402956827424,0.080218397,47.666255,47.5752832,0.06737417150288458,47.586036603,0.07528320000000122,0.15849094736842362 -bergdahl_T2p00_R0p150_h0p200_dt0p0003,2.0,0.15,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,d423c8a5aeb69a63655c03060d6f2b45742420795e5d8004b716da8908cd126d,71ae7988f4e286c2a5c4f8b21cbdf9cf0c5138bb68f74c9e2e7083d2bd8a9c39,32001,24.44396749566129,0.080218397,52.90618,52.83243280000001,0.06172464578432187,52.825961602999996,-1.267567199999995,-2.3430077634010997 -bergdahl_T2p00_R0p200_h0p200_dt0p0003,2.0,0.2,62.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,a640e7f76fa6bb1ae074d28e43f3958084d3e75bf7d9d368fd414b9849f14e25,5211abe84187c30899ee1759f47f60ddd307427b5aaa577a132c9269b8d0b0f1,32001,26.994398577719945,0.067488668,63.10472,63.0812954,0.017040065692363174,63.037231332,0.7812954000000047,1.254085714285722 +bergdahl_T2p00_R0p100_h0p200_dt0p0003,2.0,0.1,39.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,66b4e4070897810cc0c2db78a9da33350dbf480ff297311b5ade518c36518e72,7cfeecfbc7673140d72af2c7a475ead3ce77736e54552c663e5df1b72cf6afdd,32001,22.725582901798692,0.20156104,41.949945,41.8937148,0.043681995812919115,41.74838396,2.393714799999998,6.060037468354425 +bergdahl_T2p00_R0p125_h0p200_dt0p0003,2.0,0.125,47.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,11d53518b7f6d58facee9b5d62e582bbdc94a289098bbf6d3ac61defaf82c7e8,b2a8c64acddab4c852169269cca4e60bb258479eda2a6495d094c99f39cf76d3,32001,23.438071037375487,0.080218397,47.713108,47.5727352,0.1101758711342915,47.632889602999995,0.07273519999999678,0.1531267368420985 +bergdahl_T2p00_R0p150_h0p200_dt0p0003,2.0,0.15,54.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,d423c8a5aeb69a63655c03060d6f2b45742420795e5d8004b716da8908cd126d,71ae7988f4e286c2a5c4f8b21cbdf9cf0c5138bb68f74c9e2e7083d2bd8a9c39,32001,24.44123775418168,0.080218397,53.034022,52.9313364,0.08391372617039487,52.953803603,-1.1686636000000021,-2.160191497227361 +bergdahl_T2p00_R0p200_h0p200_dt0p0003,2.0,0.2,62.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,14.0,a640e7f76fa6bb1ae074d28e43f3958084d3e75bf7d9d368fd414b9849f14e25,5211abe84187c30899ee1759f47f60ddd307427b5aaa577a132c9269b8d0b0f1,32001,26.998362808274205,0.069770449,63.216109,63.1520804,0.03968285901746634,63.146338551,0.8520804000000055,1.3677052969502497 bergdahl_T2p50_R0p075_h0p200_dt0p0003,2.5,0.075,31.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,87645fbd5487107bb7b4710a95d6eebc3da8d0309ba5de053694f17590581d35,b3a5ceda599c59b5516c7f95d48a53c5a9082ba4573eb87d0f4ebdb816c9918d,40001,22.573128677483066,10.591124,33.062585,33.0596916,0.003054553044227603,22.471460999999998,1.9596915999999993,6.301259163987136 bergdahl_T2p50_R0p100_h0p200_dt0p0003,2.5,0.1,35.4,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,9898a74d88ffedf8e9585d680862587b7382f129aa1cbf90dcec137bcd6f3f7d,69865be17566563fed41360b3b26602dd059e960ddf492a02bb8474239fe8617,40001,22.64237321955451,4.7312149,38.136158,38.1319376,0.002738401960999871,33.404943100000004,2.731937600000002,7.7173378531073515 -bergdahl_T2p50_R0p125_h0p200_dt0p0003,2.5,0.125,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6c1845719020a1b825f0878b9722de394658a468d2576549e8ac44e3854c1943,4606eb29aac566ef9436af19d60063e21915d8e535ee1a29cb8164bf36832ac1,40001,23.06433277538484,0.080218397,43.631724,43.5970626,0.021472816228896,43.551505602999995,1.097062600000001,2.5813237647058846 -bergdahl_T2p50_R0p150_h0p200_dt0p0003,2.5,0.15,49.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6ebf7ca718808043f57a87bb177c1d5a25f86e13ebcf6a1129e7ef8d9f73fe77,f96b5df08fdfbafbf1a73f3a476ab4bd83f366340e729a555fff4abfbdcb128f,40001,23.951675601070225,0.080218397,48.954134,48.9199924,0.03121052419136763,48.873915603,-0.08000760000000184,-0.16328081632653438 -bergdahl_T2p50_R0p200_h0p200_dt0p0003,2.5,0.2,57.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,2d0261069c6689ebe857731f237f70a2883a5980112b9f277246377d0230c9cf,da167b278b0560de961de703952a1e36a22f7e4ff637e7a8453f90eeada7281d,40001,26.269534998201692,0.075057922,59.592596,59.5669956,0.014613585675665251,59.517538078,2.2669956000000013,3.956362303664924 +bergdahl_T2p50_R0p125_h0p200_dt0p0003,2.5,0.125,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6c1845719020a1b825f0878b9722de394658a468d2576549e8ac44e3854c1943,4606eb29aac566ef9436af19d60063e21915d8e535ee1a29cb8164bf36832ac1,40001,23.06203512397165,0.080218397,43.671052,43.619687400000004,0.03978410596331384,43.590833603,1.1196874000000037,2.634558588235303 +bergdahl_T2p50_R0p150_h0p200_dt0p0003,2.5,0.15,49.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,6ebf7ca718808043f57a87bb177c1d5a25f86e13ebcf6a1129e7ef8d9f73fe77,f96b5df08fdfbafbf1a73f3a476ab4bd83f366340e729a555fff4abfbdcb128f,40001,23.951691448754932,0.080218397,48.966114,48.918578600000004,0.03350533006552719,48.885895602999994,-0.08142139999999642,-0.1661661224489723 +bergdahl_T2p50_R0p200_h0p200_dt0p0003,2.5,0.2,57.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,17.5,2d0261069c6689ebe857731f237f70a2883a5980112b9f277246377d0230c9cf,da167b278b0560de961de703952a1e36a22f7e4ff637e7a8453f90eeada7281d,40001,26.27020682526119,0.074341225,59.599114,59.5508086,0.03514053619112935,59.524772775,2.2508086000000063,3.928112739965107 bergdahl_T3p00_R0p075_h0p200_dt0p0003,3.0,0.075,29.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,302324da0849af35df6392af12635f08555aba2a6e69de515e79fb9705bbab04,d9ad6838f7015b0e7d32a70eb86534166089bd80a096e0a2989cf5cef41dbd05,48001,22.653205223224518,13.239237,31.054133,31.053350599999998,0.0007923962392643522,17.814896,1.5533505999999981,5.265595254237282 bergdahl_T3p00_R0p100_h0p200_dt0p0003,3.0,0.1,33.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,eb00be510264d4ead391c24cc9a240da7dec29658c898bbc9b481e894d73bd07,8a90048a3f3bab35a054f704a11342f580f746ec87972031da7d49d02217f6cc,48001,22.68028505046978,7.8264702,35.57996,35.577183000000005,0.0018532568629307379,27.7534898,2.4771830000000037,7.483936555891249 bergdahl_T3p00_R0p125_h0p200_dt0p0003,3.0,0.125,39.3,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,ced08cb707dbc660e07d97949e7422b7326d083dc99d18a5ae84378a21fc84ef,bde9b1a9923f0d4e4c3158d7df37ba31838710c39d672bb8241ec6cab8e55722,48001,22.90058616806525,1.1527348,40.40689,40.401079200000005,0.005300698180428831,39.2541552,1.101079200000008,2.80172824427483 -bergdahl_T3p00_R0p150_h0p200_dt0p0003,3.0,0.15,45.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,47aa51d93408ca527f8a8ac85613ab9b0f7a4f9a2459ec9bca396e62de32dfb2,402811dda2da329a55b8e7816c5134f5aecb0a59bdbefc6b13eeb232cb4fb15b,48001,23.530868768436324,0.080218397,45.373699,45.348763999999996,0.022267908725337952,45.293480603,-0.4512360000000015,-0.9852314410480383 -bergdahl_T3p00_R0p200_h0p200_dt0p0003,3.0,0.2,54.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,96e1dda1aa324b9669d601026fb6ad0831cadaf6dcc32492235ee05cd7d7d3b5,f03dc52610fa2de64c497f78321355d34ea6fad14109005aafde665c707b0e35,48001,25.690994785671446,0.078386477,55.741428,55.7089604,0.023063043409316825,55.663041523,1.7089604000000023,3.1647414814814856 +bergdahl_T3p00_R0p150_h0p200_dt0p0003,3.0,0.15,45.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,47aa51d93408ca527f8a8ac85613ab9b0f7a4f9a2459ec9bca396e62de32dfb2,402811dda2da329a55b8e7816c5134f5aecb0a59bdbefc6b13eeb232cb4fb15b,48001,23.530885720303036,0.080218397,45.358404,45.3450974,0.010693752699590463,45.278185603,-0.45490259999999694,-0.9932371179039235 +bergdahl_T3p00_R0p200_h0p200_dt0p0003,3.0,0.2,54.0,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,21.0,96e1dda1aa324b9669d601026fb6ad0831cadaf6dcc32492235ee05cd7d7d3b5,f03dc52610fa2de64c497f78321355d34ea6fad14109005aafde665c707b0e35,48001,25.689062797173765,0.080218397,55.736209,55.698312599999994,0.03162717803250884,55.655990603,1.6983125999999942,3.1450233333333224 bergdahl_T3p50_R0p075_h0p200_dt0p0003,3.5,0.075,27.8,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,235d4acffaff2133c0833b4dde65d4f746a980e483bf1a184fbda1789d26d32b,832f1074f37014ce95341e0baea190a6c995ca381de72b85ef1d8e4ffbecc7ed,56001,22.741663554740096,15.199221,29.866848,29.8664992,0.0004117046271295802,14.667627000000001,2.066499199999999,7.433450359712226 bergdahl_T3p50_R0p100_h0p200_dt0p0003,3.5,0.1,31.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,dfd71b038e2016e837ca8d2976ff4dabbdbc579d663b3e4d6cc02c867bde1e35,d70c6750c97b8271d7f0604166e62a41a1e57b583932f16598c4ebe75de573aa,56001,22.765204520883554,10.515801,33.721231,33.7197632,0.001419329313444277,23.205430000000003,2.2197632000000027,7.0468673015873105 bergdahl_T3p50_R0p125_h0p200_dt0p0003,3.5,0.125,37.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,0c91662ea48cc2fa12539fc97fc123c1b3dff743ead2bace86bdf2ac3ac53997,2fe336ce9ff36b4af7c8d698c3e68f372b762b8127ecdda730fb5e07c46f68ea,56001,22.890783096641133,5.7432455,38.029771,38.027166,0.002623257802807864,32.286525499999996,0.5271660000000011,1.405776000000003 -bergdahl_T3p50_R0p150_h0p200_dt0p0003,3.5,0.15,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,f2a0f779cd4f722e64114a1d24d297d7b71ce71b3234ebf98d0ee02349768a0e,fd49ce4e3dce2c1d034faeedf52a60633dfb26a3a6cfbc935c66a29ea7297d3c,56001,23.270113562783166,0.30571667,42.757722,42.7187964,0.047317708649088665,42.45200533,0.21879640000000222,0.5148150588235346 -bergdahl_T3p50_R0p200_h0p200_dt0p0003,3.5,0.2,50.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,7bdf322dbff579b866971969ad11b066c3aa1da0fb8bd19bf7f64c3e05b85e00,de9d5e2bf50d61ca47a1fb69f0cfabab511139a97cff5ccdf79fc257b156f438,56001,25.190993396198962,0.080218397,52.378952,52.3630118,0.013188911031619902,52.298733602999995,2.263011800000001,4.516989620758485 +bergdahl_T3p50_R0p150_h0p200_dt0p0003,3.5,0.15,42.5,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,f2a0f779cd4f722e64114a1d24d297d7b71ce71b3234ebf98d0ee02349768a0e,fd49ce4e3dce2c1d034faeedf52a60633dfb26a3a6cfbc935c66a29ea7297d3c,56001,23.270828354333318,0.38777922,42.77665,42.75414859999999,0.026079876654231008,42.38887078,0.2541485999999935,0.5979967058823377 +bergdahl_T3p50_R0p200_h0p200_dt0p0003,3.5,0.2,50.1,0.0003125,165,0.2,12,3,0.4,3000000000.0,1.0,0.0022,0.003654133499998645,1806173748.168327,402155.67857087706,False,0.0,0.3,1e-08,24.5,7bdf322dbff579b866971969ad11b066c3aa1da0fb8bd19bf7f64c3e05b85e00,de9d5e2bf50d61ca47a1fb69f0cfabab511139a97cff5ccdf79fc257b156f438,56001,25.18984178717771,0.080218397,52.364122,52.35406759999999,0.00952333220569378,52.283903603,2.254067599999992,4.499136926147688 diff --git a/validation/experiments/bergdahl/provenance.json b/validation/experiments/bergdahl/provenance.json index 123ffba1..9cdba7c6 100644 --- a/validation/experiments/bergdahl/provenance.json +++ b/validation/experiments/bergdahl/provenance.json @@ -1,8 +1,8 @@ { "CableDyn_release": "v0.1.1+dev (unreleased)", - "validation_date": "2026-10-17", + "validation_date": "2026-10-19", "executable_name": "cabledyn.exe", - "executable_sha256": "c0504813c19ac8683d6f31cac56063da519cd8867c0facd3fddaef4e70469886", + "executable_sha256": "88d2bba2da6fb0801656d4bacd30e9d0e916f768c7047161457edea324274c66", "compiler": "GNU Fortran 16.2.0", "build_type": "Release", "platform": "Windows 11 x86-64", @@ -12,14 +12,14 @@ "completed_cases": 30, "nonlinear_misses": 0, "refinement_cases": 8, - "maximum_spatial_refinement_difference_percent": 0.5265703061372087, - "maximum_temporal_refinement_difference_percent": 0.12568365771083198, - "force_maxima_sha256": "83df076fba89f1e759e084b78956283f6f08c7300b93b30576447f11c34fed3c", - "aggregate_metrics_sha256": "ffbd4c82f8191dc67f18b53717afd4d521f8f172612e8d11bffc1d50d233d03c", + "maximum_spatial_refinement_difference_percent": 0.5580722740928493, + "maximum_temporal_refinement_difference_percent": 0.18888172026785752, + "force_maxima_sha256": "978889378964c6d6749bc27c11d99d6584956e3c8eac146ae79bf5f7a05e2e95", + "aggregate_metrics_sha256": "35d800fa34137a3a1500cbd0081a490bc1b61cf636cfef5a923b5c18947ba1a7", "case_manifest_sha256": "8da5e7b4a8a92755363807902aba48e0ff42abab04ac44912041853db9e56604", "waveform_T1p25_sha256": "65c8c846636c378b800bb3c7a95ccd2bde766d789af3cdffce26a2e688e1a134", "waveform_T3p50_sha256": "b3ca65ebfc1d61b5510e54876fc11d1604fc18ffcca3eab523dc7d67f50da4d8", "waveform_metrics_sha256": "2803a57cb7726f966a00e00bf6eb070231b9c702ae67a81685da50991d0adb11", "waveform_note": "Waveform metrics were computed with the executable of the 2026-10-09 validation (sha256 71090e2e28c9e1d99c5180d05a395ebcc891a77cc5294d315a57c691904745ac); the development builds since then (the force-blended EI = 0 step and its rotation- and snap-resolved sub-steps) were not rerun on them because the article supplement's expData.dat, which reduce_bergdahl_waveforms.py reads, was not available. The measured phase averages are those of expData.dat, as carried in the waveform CSVs.", - "refinement_summary_sha256": "8b5c2665ca10154ac0abf9c737971f7c02bf74029ac9898ab065bc785071670c" + "refinement_summary_sha256": "9039f6c9b91ed2d15d7c609dd8d2300eef34d0363700487a8dfc0a8f15be1087" } diff --git a/validation/experiments/bergdahl/refinement_summary.csv b/validation/experiments/bergdahl/refinement_summary.csv index b590407f..24985b11 100644 --- a/validation/experiments/bergdahl/refinement_summary.csv +++ b/validation/experiments/bergdahl/refinement_summary.csv @@ -1,3 +1,3 @@ period_s,radius_m,force_h0p400_dt0p0003125_N,force_h0p200_dt0p0003125_N,force_h0p100_dt0p0003125_N,force_h0p200_dt0p00015625_N,force_h0p200_dt0p000625_N,spatial_difference_h0p400_dt0p0003125_percent,spatial_difference_h0p200_dt0p0003125_percent,temporal_difference_h0p200_dt0p0003125_percent,temporal_difference_h0p200_dt0p000625_percent -1.25,0.2,67.93431739999998,67.9888416,68.3487458,67.903498,69.497535,-0.6063438255512507,-0.5265703061372087,0.12568365771083198,2.3475035115274916 -3.5,0.2,52.36749339999999,52.3630118,52.342603399999994,52.3527778,53.2401192,0.0475520864137837,0.03899003617387512,0.01954815089105754,1.6949270645959955 +1.25,0.2,68.15018140000001,67.9673104,68.3487458,67.8391746,69.497535,-0.2905165232746598,-0.5580722740928493,0.18888172026785752,2.4445468415236173 +3.5,0.2,52.3714018,52.35406759999999,52.342603399999994,52.3533266,53.2401192,0.05501904400881702,0.021902234996585834,0.0014153828383290867,1.6938610353749701 diff --git a/validation/experiments/bergdahl/refinement_summary.json b/validation/experiments/bergdahl/refinement_summary.json index 4dcdae59..26d26521 100644 --- a/validation/experiments/bergdahl/refinement_summary.json +++ b/validation/experiments/bergdahl/refinement_summary.json @@ -4,34 +4,34 @@ "temporal_reference_time_step_s": 0.00015625, "primary_nominal_element_length_m": 0.2, "primary_time_step_s": 0.0003125, - "maximum_primary_spatial_difference_percent": 0.5265703061372087, - "maximum_primary_temporal_difference_percent": 0.12568365771083198, + "maximum_primary_spatial_difference_percent": 0.5580722740928493, + "maximum_primary_temporal_difference_percent": 0.18888172026785752, "rows": [ { "period_s": 1.25, "radius_m": 0.2, - "force_h0p400_dt0p0003125_N": 67.93431739999998, - "force_h0p200_dt0p0003125_N": 67.9888416, + "force_h0p400_dt0p0003125_N": 68.15018140000001, + "force_h0p200_dt0p0003125_N": 67.9673104, "force_h0p100_dt0p0003125_N": 68.3487458, - "force_h0p200_dt0p00015625_N": 67.903498, + "force_h0p200_dt0p00015625_N": 67.8391746, "force_h0p200_dt0p000625_N": 69.497535, - "spatial_difference_h0p400_dt0p0003125_percent": -0.6063438255512507, - "spatial_difference_h0p200_dt0p0003125_percent": -0.5265703061372087, - "temporal_difference_h0p200_dt0p0003125_percent": 0.12568365771083198, - "temporal_difference_h0p200_dt0p000625_percent": 2.3475035115274916 + "spatial_difference_h0p400_dt0p0003125_percent": -0.2905165232746598, + "spatial_difference_h0p200_dt0p0003125_percent": -0.5580722740928493, + "temporal_difference_h0p200_dt0p0003125_percent": 0.18888172026785752, + "temporal_difference_h0p200_dt0p000625_percent": 2.4445468415236173 }, { "period_s": 3.5, "radius_m": 0.2, - "force_h0p400_dt0p0003125_N": 52.36749339999999, - "force_h0p200_dt0p0003125_N": 52.3630118, + "force_h0p400_dt0p0003125_N": 52.3714018, + "force_h0p200_dt0p0003125_N": 52.35406759999999, "force_h0p100_dt0p0003125_N": 52.342603399999994, - "force_h0p200_dt0p00015625_N": 52.3527778, + "force_h0p200_dt0p00015625_N": 52.3533266, "force_h0p200_dt0p000625_N": 53.2401192, - "spatial_difference_h0p400_dt0p0003125_percent": 0.0475520864137837, - "spatial_difference_h0p200_dt0p0003125_percent": 0.03899003617387512, - "temporal_difference_h0p200_dt0p0003125_percent": 0.01954815089105754, - "temporal_difference_h0p200_dt0p000625_percent": 1.6949270645959955 + "spatial_difference_h0p400_dt0p0003125_percent": 0.05501904400881702, + "spatial_difference_h0p200_dt0p0003125_percent": 0.021902234996585834, + "temporal_difference_h0p200_dt0p0003125_percent": 0.0014153828383290867, + "temporal_difference_h0p200_dt0p000625_percent": 1.6938610353749701 } ] } From ee045a0dc616b328534b4283912615f59a0b6fb4 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Mon, 19 Oct 2026 23:21:19 +0900 Subject: [PATCH 5/5] fix(dynamics): bound the kept dashpot share of start-slack segments The release cap of the force-blended EI = 0 step skipped every segment slack at the step start. A damped segment whose ends separate there still keeps alpha_f T_d,n of its step-start dashpot force along its old chord, and returns alpha_f T_d,n p to the motion when the step turns or reverses its ends, with no strain energy behind it. The kept share of such a segment now has the dashpot's own one-step dissipation as its budget, W_d = T_d,n |ldot_n| dt, ldot_n the dashpot's elongation rate at t_n (the axial rate, less l_n l0_dot/l0 while the line pays out, so W_d > 0 whenever T_d,n /= 0). When p > 0 the kept force alpha_f T_d,n is replaced by (W_d + N_d)/p when that is smaller, with the end share's credit N_d = max((1 - alpha_f) T_d,n+1 p_n+1, 0); a compressive T_d,n is capped alike for p < 0. The kept dashpot share of an element slack at the step start then returns at most its own one-step dissipation plus the end share's credit. The capped force grows without bound as p -> 0, so it is continuous there, and alpha_f |p| <= |ldot_n| dt is a sufficient test of an inactive cap. The tangent takes dp/dd = -t_n and, while the credit is positive, the dependence of T_d,n+1 and p_n+1 on q_n+1 (through v_n+1) on the banded, dense and probe paths. Taut-start and undamped segments are unchanged. In the test chain (a segment slack at t_n moving at 0.05 to 2 m/s, either sense, turning by 0 to 180 degrees) the kept share returned up to 45.6 times W_d + N_d (44.6 W_d above the bound) before; with the cap it stays within the bound to 8e-14 W_d on the 29 of 448 rows where it acts, a segment with no step-start dashpot force keeps the plain blend bit for bit, and the tangent of capped rows matches the finite difference to 1.2e-10 on both paths. Of the 52 shipped examples 50 are byte-identical. The two Volturnus line break decks (chain with zeta damping in a JONSWAP sea) diverge from t = 246 s pointwise, as slack segments do, while their tension peaks change by at most 0.01 %, means by at most 0.02 % and standard deviations by at most 0.04 %. The light-cable, viscoelastic and Syrope reproducer bounds still hold. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 5 +- doc/theory.rst | 24 ++++- src/CableDyn_Dynamic.f90 | 67 ++++++++++++-- tests/test_ei0_slack_dynamics.f90 | 142 ++++++++++++++++++++++++++++++ 4 files changed, 227 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9ac489..4cd9946e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -483,7 +483,10 @@ All notable changes to CableDyn are recorded in this file. The format follows the dashpot's end share, so that the whole blend of a segment ending slack returns at most its strain energy unless that end share alone returns more (in the test chain it returned up to 2750 times that with only the elastic share capped); a damped segment that ends taut beyond - that band keeps the plain force blend. The seabed contact of + that band keeps the plain force blend. A damped segment slack at the step start keeps its + step-start dashpot force under a cap too, so that this kept share returns at most the + dashpot's own one-step dissipation `T_d,n |l̇_n| Δt` plus the end share's credit (up to 46 + times that in the test chain before). The seabed contact of a node that lifts off within a step is not capped (see the manual's theory page). At the default `rhoInf` the light cable now peaks at 0.10 / 0.09 MN at `dtM` 0.0025 s and at 0.092 / 0.106 MN at 0.1 s, the same cable in the JONSWAP sea at 0.075 / 0.043 MN and the diff --git a/doc/theory.rst b/doc/theory.rst index 15713c8a..eb199e87 100644 --- a/doc/theory.rst +++ b/doc/theory.rst @@ -1487,8 +1487,8 @@ difference (:math:`\partial p/\partial \mathbf{d}_{n+1} = -\mathbf{t}_n`). With state crosses the rest length, so the residual stays continuous in :math:`\mathbf{q}_{n+1}`. A cap on the slack end states alone would jump there, by up to :math:`\alpha_f T_n` for a turned element. The cap does not act on an element that ends above :math:`\alpha_f/(1 - \alpha_f)\,T_n` -(0.4 :math:`T_n`), nor on one that keeps its direction and ends taut, nor on one slack at -:math:`t_n`: those elements, every element going taut (where the force blend dissipates), and +(0.4 :math:`T_n`), nor on one that keeps its direction and ends taut, nor (but for the share of +its dashpot, below) on one slack at :math:`t_n`: those elements, every element going taut (where the force blend dissipates), and every line that allows compression keep the force blend. In the slack-cable case above the internal forces created 2.7e8 J over 20 s with the configuration blend, 6.7e7 J with the force blend alone, 0.19 J with a cap on :math:`e_n - e_{n+1}` (the turn of the releasing segments) and @@ -1563,6 +1563,26 @@ so the force-blended dashpot of a taut segment keeps the standard generalised-α which a linear dashpot is dissipative; :math:`\phi` is continuous, and so is the capped force. The viscoelastic law keeps its total tension, dashpots included, as :math:`T_n` (above). +A damped segment slack at :math:`t_n` (:math:`T_n = 0`, :math:`e_n \le 0`) whose ends separate +there keeps :math:`\alpha_f T_{d,n}` along :math:`\mathbf{t}_n` with no strain energy behind it, +and returns :math:`\alpha_f T_{d,n} p` when the step turns or reverses its ends. It has no +:math:`W_n` (and an empty band, :math:`\phi = 1`); its budget is the dashpot's own one-step +dissipation :math:`W_d = T_{d,n}\,|\dot l_n|\,\Delta t`, :math:`\dot l_n` the dashpot's +elongation rate at :math:`t_n` (the axial rate, less :math:`l_n \dot l_0/l_0` while the line +pays out), so that :math:`T_{d,n} = (BA/l_0)\,\dot l_n` and :math:`W_d > 0` whenever +:math:`T_{d,n} \ne 0`. When :math:`p > 0` the kept force :math:`\alpha_f T_{d,n}` is replaced by +:math:`(W_d + N_d)/p` when that is smaller, with the end share's credit +:math:`N_d = \max((1 - \alpha_f) T_{d,n+1} p_{n+1}, 0)`, and the tangent takes the difference as +above (a compressive :math:`T_{d,n}` is capped alike when :math:`p < 0`). The kept dashpot share +of an element slack at the step start returns at most its own one-step dissipation +:math:`T_{d,n} |\dot l_n| \Delta t` plus the end share's credit. The capped force grows without +bound as :math:`p \to 0^+`, so it is continuous there; it acts only where +:math:`\alpha_f |p| > |\dot l_n| \Delta t`, a turn or reversal well beyond the step-start motion +whose end share does little work (a reversal along the chord feeds the end share's dashpot, +whose credit covers it). In the test chain the kept share returned up to 46 times +:math:`W_d + N_d` before the cap covered slack starts. Taut-start and undamped segments are +unchanged. + The one-sided seabed contact is not capped. A node that leaves the floor within a step keeps :math:`\alpha_f` of its step-start contact force :math:`N_n` for the whole step: over a lift-off distance :math:`d` it returns at most :math:`\alpha_f N_n d` to the motion, against the energy diff --git a/src/CableDyn_Dynamic.f90 b/src/CableDyn_Dynamic.f90 index 3d8fde49..06274e55 100644 --- a/src/CableDyn_Dynamic.f90 +++ b/src/CableDyn_Dynamic.f90 @@ -2089,7 +2089,8 @@ SUBROUTINE apply_release_cap(q_eval, Rout, effout, effbandout) !! For an elastic element T^_1 = T_1: its blend returns at most W_0 over every step (an !! element that ends slack carries the discrete energy gradient W_0/p and returns exactly !! W_0), and the cap acts on a taut end state only when the element turned and - !! T_1 < alpha_f/(1 - alpha_f) T_0. An element slack at t_n keeps the force blend. + !! T_1 < alpha_f/(1 - alpha_f) T_0. An element slack at t_n keeps the force blend, but for + !! the kept share of its dashpot (below). !! N >= W_0/2 always (k e_0 <= T_0), so 4 alpha_f p <= e_0 is a sufficient test of an !! inactive cap. The residual and the tangent are corrected by the difference. !! An element whose axial law a load callback carries (ea = 0, T_0 from start_tension) is @@ -2119,17 +2120,34 @@ SUBROUTINE apply_release_cap(q_eval, Rout, effout, effbandout) !! dashpot, the cap is the one above, so the force-blended dashpot of a taut line keeps the !! standard generalised-alpha treatment. The weight is continuous, so is the capped force; !! the tangent carries dT_d,1/dq_{n+1} through v_{n+1} (gamma/(beta dt)). + !! An element with a dashpot that is slack at t_n (T_0 = 0, e_0 <= 0) keeps only + !! alpha_f T_d,0 along t_0, which returns alpha_f T_d,0 p, with no strain energy behind it, + !! when the step reverses or turns its ends against the step-start rate. Its budget is the + !! dashpot's own one-step dissipation W_d = T_d,0 ldot_0 dt, ldot_0 = l0 T_d,0/BA the + !! dashpot's elongation rate at t_n (the axial rate less the paid-out rate l_n l0_dot/l0; + !! the axial rate itself without payout), so W_d > 0 whenever T_d,0 /= 0. When + !! alpha_f T_d,0 p > 0 exceeds W_d + N_d, N_d = max((1 - alpha_f) T_d,1 p_1, 0) the end + !! share's credit (phi = 1: the band of a slack start is empty), the element carries + !! (W_d + N_d)/p instead of alpha_f T_d,0 along t_0, so the kept dashpot share of an + !! element slack at the step start returns at most its own one-step dissipation + !! T_d,0 |ldot_0| dt plus the end share's credit. The capped force grows without bound as + !! p -> 0 (W_d > 0), so the force is continuous there; alpha_f |p| <= |ldot_0| dt is a + !! sufficient test of an inactive cap. The same law covers a compressive T_d,0 (p < 0). REAL(wp), INTENT(IN) :: q_eval(:) REAL(wp), INTENT(INOUT) :: Rout(:) REAL(wp), INTENT(INOUT), OPTIONAL :: effout(:, :), effbandout(:, :) INTEGER :: e, na, nb, i, j, gi(6), fi, fj REAL(wp) :: d1(3), l1, e1, e0, t0, p, p1, num, ln, k0, ten1, cosang, dg, delta, t1(3), g(3), blk(3, 3), sgn - REAL(wp) :: band, phi, dphi, td1, dv(3), dp1(3), dtd1(3), kc - LOGICAL :: taut_end, damped + REAL(wp) :: band, phi, dphi, td1, dv(3), dp1(3), dtd1(3), kc, credit + LOGICAL :: taut_end, damped, slack band = alpha_f/(CD_ONE - alpha_f) DO e = 1, n_elem t0 = tension_n(e) - IF (.NOT. t0 > CD_ZERO) CYCLE + ! an element slack at t_n is capped only for the kept share of a step-start dashpot force + slack = .NOT. t0 > CD_ZERO + IF (slack) THEN + IF (.NOT. (dcoef_n(e) > CD_ZERO .AND. ABS(damp_n(e)) > CD_ZERO)) CYCLE + END IF na = elem_conn(1, e) nb = elem_conn(2, e) d1 = q_eval(3*nb - 2:3*nb) - q_eval(3*na - 2:3*na) @@ -2137,10 +2155,43 @@ SUBROUTINE apply_release_cap(q_eval, Rout, effout, effbandout) ! projected shortening p = l_n - t_0 . d_1 (l_n = l0 + e_0); the common case, an element ! that does not release, is decided here without a root p = e0 + (l0(e) - (chord_n(1, e)*d1(1) + chord_n(2, e)*d1(2) + chord_n(3, e)*d1(3))) - ! a damped element whose end state lies below the band edge l0 + band e_0 - damped = dcoef_n(e) > CD_ZERO - IF (damped) damped = d1(1)*d1(1) + d1(2)*d1(2) + d1(3)*d1(3) < (l0(e) + band*e0)**2 - IF (damped) THEN + ! a damped element taut at t_n whose end state lies below the band edge l0 + band e_0 + damped = .FALSE. + IF (.NOT. slack) THEN + damped = dcoef_n(e) > CD_ZERO + IF (damped) damped = d1(1)*d1(1) + d1(2)*d1(2) + d1(3)*d1(3) < (l0(e) + band*e0)**2 + END IF + IF (slack) THEN + ! the kept dashpot share alpha_f T_d,0 returns work only when T_d,0 p > 0, and stays + ! within W_d = T_d,0^2 dt/(BA/l0) while alpha_f |p| <= |ldot_0| dt + IF (.NOT. damp_n(e)*p > CD_ZERO) CYCLE + IF (alpha_f*ABS(p)*dcoef_n(e) <= ABS(damp_n(e))*dt) CYCLE + l1 = NORM2(d1) + IF (.NOT. l1 > CD_ZERO) CYCLE + ln = l0(e) + e0 + t1 = d1/l1 + cosang = t1(1)*chord_n(1, e) + t1(2)*chord_n(2, e) + t1(3)*chord_n(3, e) + p1 = (l1 - ln) + 0.5_wp*ln*((t1(1) - chord_n(1, e))**2 + (t1(2) - chord_n(2, e))**2 + & + (t1(3) - chord_n(3, e))**2) + dv = v_eval(3*nb - 2:3*nb) - v_eval(3*na - 2:3*na) + td1 = dcoef_n(e)*(DOT_PRODUCT(t1, dv) - l1*rl0dot_n(e)) + credit = (CD_ONE - alpha_f)*td1*p1 + num = damp_n(e)*damp_n(e)*dt/dcoef_n(e) + MAX(credit, CD_ZERO) + dg = num/p + IF (ABS(dg) >= alpha_f*ABS(damp_n(e))) CYCLE + delta = dg - alpha_f*damp_n(e) + Rout(3*na - 2:3*na) = Rout(3*na - 2:3*na) - delta*chord_n(:, e) + Rout(3*nb - 2:3*nb) = Rout(3*nb - 2:3*nb) + delta*chord_n(:, e) + IF (.NOT. (PRESENT(effout) .OR. PRESENT(effbandout))) CYCLE + ! d(delta)/d(x_b) = g, d(delta)/d(x_a) = -g: dp/dd_1 = -t_0, and while the credit is + ! positive dp_1/dd_1 and dT_d,1/dx_b as on the taut damped path + g = (num/(p*p))*chord_n(:, e) + IF (credit > CD_ZERO) THEN + dp1 = t1 - (ln/l1)*(chord_n(:, e) - cosang*t1) + dtd1 = dcoef_n(e)*((dv - DOT_PRODUCT(t1, dv)*t1)/l1 + (gamma/(beta*dt) - rl0dot_n(e))*t1) + g = g + ((CD_ONE - alpha_f)/p)*(td1*dp1 + p1*dtd1) + END IF + ELSE IF (damped) THEN IF (.NOT. p > CD_ZERO) CYCLE l1 = NORM2(d1) IF (.NOT. l1 > CD_ZERO) CYCLE diff --git a/tests/test_ei0_slack_dynamics.f90 b/tests/test_ei0_slack_dynamics.f90 index 2abef10d..195ef517 100644 --- a/tests/test_ei0_slack_dynamics.f90 +++ b/tests/test_ei0_slack_dynamics.f90 @@ -57,6 +57,12 @@ PROGRAM test_ei0_slack_dynamics !! 9. A lightly damped viscoelastic version of the light cable at dtM 0.1 s (the cap on its !! law segments) and a long taut Syrope line in 4 m surge that goes slack: no spike !! warning, and peaks within the band of small-step references. + !! 10. An elastic segment with an axial dashpot that is slack at t_n and whose ends separate + !! (or approach) there, then turn or reverse within the step: the kept dashpot share + !! returns at most the dashpot's one-step dissipation T_d,n |ldot_n| dt plus the end + !! share's credit (it returned many times that before the cap covered slack starts), a + !! slack segment with no step-start dashpot force keeps the plain blend, and the tangent + !! of a capped row matches the finite difference on the banded and the dense path. USE CableDyn_Precision, ONLY: wp USE CableDyn_DeckDriver, ONLY: CD_Run_Deck_Driver, CD_DECKDRV_OK USE CableDyn_Dynamic, ONLY: GenAlphaConfig, CD_CableGenAlphaWorkspace, CD_Cable_Gen_Alpha_Step, CD_DYN_OK @@ -91,6 +97,7 @@ PROGRAM test_ei0_slack_dynamics CALL case_law_release_cap() CALL case_law_damped_release() CALL case_damped_elastic_release() + CALL case_slack_dashpot_release() CALL case_load_share_tangent() CALL case_warm_resolve_reuse() CALL case_light_cable_coarse_step() @@ -1206,6 +1213,141 @@ SUBROUTINE damped_tangent_case(label, qn, vn, q1, l0, ea, ad, t0) CALL fd_tangent_check(label, qn, vn, z, q1, l0, ea, [2.0_wp, 3.0_wp, 1.5_wp], .FALSE., axial_damping=ad) END SUBROUTINE damped_tangent_case + SUBROUTINE case_slack_dashpot_release() + !! The dashpot segment of case_damped_elastic_release slack at t_n (e_n = -1.6 mm), its far + !! end moving at +-0.05, 0.5 or 2 m/s along the chord (dashpot tension T_d,n = BA rate/l0, a + !! compressive one for the negative rate), turning by 0 to 180 degrees within the step and + !! ending slack or taut. The kept share alpha_f T_d,n t_n returns T_k p (T_k the kept + !! tension the residual carries, p the projected shortening): at most + !! W_d + N_d, W_d = T_d,n ldot_n dt the dashpot's one-step dissipation and + !! N_d = max((1 - alpha_f) T_d,n+1 p_n+1, 0) the end share's credit. Without the cap (no + !! axial_damping) it returns alpha_f T_d,n p, up to 46 times W_d + N_d on these rows (the cap + !! acts where the end share does little work: turns that end near the projection of the + !! step-start chord; a reversal along the chord feeds the end share's dashpot instead). + !! A slack segment with no step-start dashpot + !! force keeps the plain blend, and the tangent matches the finite difference where the + !! cap acts. + REAL(wp), PARAMETER :: L0(3) = [1.0_wp, 1.2_wp, 0.8_wp], EA(3) = [1.0e6_wp, 1.5e6_wp, 0.8e6_wp] + REAL(wp), PARAMETER :: DIRS(3, 3) = RESHAPE([1.0_wp, 0.2_wp, 0.1_wp, 0.3_wp, 1.0_wp, -0.2_wp, & + -0.2_wp, 0.4_wp, 1.0_wp], [3, 3]) + REAL(wp), PARAMETER :: THETA(8) = [0.0_wp, 2.0_wp, 5.0_wp, 20.0_wp, 45.0_wp, 90.0_wp, 135.0_wp, 180.0_wp] + REAL(wp), PARAMETER :: S1(9) = [-0.5_wp, -0.1_wp, -0.01_wp, -2.0e-3_wp, -1.0e-4_wp, 1.0e-4_wp, & + 1.0e-3_wp, 0.01_wp, 0.05_wp] + REAL(wp), PARAMETER :: OFS(5) = [-0.02_wp, -0.003_wp, 0.0_wp, 0.003_wp, 0.02_wp] + REAL(wp), PARAMETER :: RATE(4) = [0.05_wp, 0.5_wp, 2.0_wp, -0.5_wp], DT = 0.05_wp, RHO = 0.4_wp + REAL(wp), PARAMETER :: BA = 2.0e4_wp, AD(3) = [0.0_wp, 0.0_wp, BA] + REAL(wp), PARAMETER :: RHO_TINY(3) = [1.0e-12_wp, 1.0e-12_wp, 1.0e-12_wp] + REAL(wp) :: qn(12), q1(12), vn(12), z(12), v1(12), R(12), Rp(12), K(9, 9), tn(3), u(3), dir(3) + REAL(wp) :: d0(3), d1(3), t1(3), l1, td0, td1, p, p1, am, af, beta, gamma, wd, nd, tk, wk, wu + REAL(wp) :: worst, unc_ratio, unc_excess, dev + INTEGER :: i, j, ir, nact, nrow + CALL reset_chain_load() + cb_dash_elem = 3 + cb_ba_dash = BA + cb_l0_dash = L0(3) + am = (2.0_wp*RHO - 1.0_wp)/(RHO + 1.0_wp) + af = RHO/(RHO + 1.0_wp) + beta = 0.25_wp*(1.0_wp - am + af)**2 + gamma = 0.5_wp - am + af + CALL chain_nodes(DIRS, [0.010_wp, 0.020_wp, -0.002_wp], L0, qn) + z = 0.0_wp + d0 = qn(10:12) - qn(7:9) + tn = d0/NORM2(d0) + u = [tn(2), -tn(1), 0.0_wp] + u = u/NORM2(u) + worst = -HUGE(1.0_wp) + unc_ratio = 0.0_wp + unc_excess = 0.0_wp + nact = 0 + nrow = 0 + DO ir = 1, SIZE(RATE) + vn = 0.0_wp + vn(10:12) = RATE(ir)*tn + td0 = BA*RATE(ir)/L0(3) + wd = td0*RATE(ir)*DT + DO i = 1, SIZE(THETA) + DO j = 1, SIZE(S1) + SIZE(OFS) + dir = COS(THETA(i)*PI/180.0_wp)*tn + SIN(THETA(i)*PI/180.0_wp)*u + IF (j <= SIZE(S1)) THEN + l1 = L0(3)*(1.0_wp + S1(j)) + ELSE + ! the end near the projection of the step-start chord (p_n+1 ~ OFS): a turn whose + ! end share does little work, where the cap acts + l1 = MAX(NORM2(d0)*COS(THETA(i)*PI/180.0_wp) + OFS(j - SIZE(S1)), 0.05_wp*L0(3)) + END IF + q1 = qn + q1(10:12) = qn(7:9) + l1*dir + CALL probe_chain(qn, vn, z, q1, L0, EA, RHO_TINY, .TRUE., R, K, axial_damping=AD) + CALL probe_chain(qn, vn, z, q1, L0, EA, RHO_TINY, .TRUE., Rp, K) + v1 = gamma/(beta*DT)*(q1 - qn) + (1.0_wp - gamma/beta)*vn + v1(1:3) = 0.0_wp + d1 = q1(10:12) - q1(7:9) + l1 = NORM2(d1) + t1 = d1/l1 + p = NORM2(d0) - DOT_PRODUCT(tn, d1) + p1 = l1 - DOT_PRODUCT(t1, d0) + td1 = BA*DOT_PRODUCT(t1, v1(10:12) - v1(7:9))/L0(3) + nd = MAX((1.0_wp - af)*td1*p1, 0.0_wp) + ! the kept tension: alpha_f T_d,n plus the cap's correction along t_n at node b + tk = af*td0 + DOT_PRODUCT(R(10:12) - Rp(10:12), tn) + wk = tk*p + wu = af*td0*p + nrow = nrow + 1 + IF (MAXVAL(ABS(R(10:12) - Rp(10:12))) > 1.0e-9_wp*ABS(td0)) nact = nact + 1 + worst = MAX(worst, (wk - (wd + nd))/wd) + unc_ratio = MAX(unc_ratio, wu/(wd + nd)) + unc_excess = MAX(unc_excess, (wu - (wd + nd))/wd) + IF (j > SIZE(S1)) CYCLE + IF (THETA(i) == 0.0_wp .AND. S1(j)*RATE(ir) > 0.0_wp) THEN + ! a segment that keeps its direction and moves on at its step-start sense: uncapped + CALL require(MAXVAL(ABS(R(10:12) - Rp(10:12))) == 0.0_wp, 'slack-dashpot:same-sense-uncapped') + END IF + END DO + END DO + END DO + WRITE (*, '(A,I0,A,I0,A,ES10.3,A,ES10.3,A,ES10.3)') ' slack dashpot: cap active at ', nact, ' of ', nrow, & + ' rows; kept-share work over W_d + N_d, / W_d: ', worst, ' (uncapped ', unc_excess, & + '; uncapped / (W_d + N_d) up to ', unc_ratio + CALL require(nact >= 20, 'slack-dashpot:cap-active') + CALL require(unc_ratio > 10.0_wp, 'slack-dashpot:uncapped-exceeds') + CALL require(worst <= 1.0e-9_wp, 'slack-dashpot:bound') + ! a slack segment with no step-start dashpot force (ends at rest along the chord) keeps the + ! plain blend bit for bit, reversed or not + vn = 0.0_wp + vn(10:12) = 0.5_wp*u + q1 = qn + q1(10:12) = qn(7:9) - 0.9_wp*L0(3)*tn + CALL probe_chain(qn, vn, z, q1, L0, EA, RHO_TINY, .TRUE., R, K, axial_damping=AD) + CALL probe_chain(qn, vn, z, q1, L0, EA, RHO_TINY, .TRUE., Rp, K) + dev = MAXVAL(ABS(R - Rp)) + CALL require(dev == 0.0_wp, 'slack-dashpot:no-start-dashpot-uncapped') + ! the tangent where the cap acts: turning 60 degrees with the end at p_n+1 = 3 mm (end + ! share pushing, no credit) and 20 mm (a positive credit), extending at 0.5 m/s at t_n + vn = 0.0_wp + vn(10:12) = 0.5_wp*tn + dir = COS(PI/3.0_wp)*tn + SIN(PI/3.0_wp)*u + q1 = qn + q1(10:12) = qn(7:9) + (0.5_wp*NORM2(d0) + 3.0e-3_wp)*dir + CALL slack_tangent_case('slack-dashpot-no-credit', qn, vn, q1, L0, EA, AD, BA*0.5_wp/L0(3)) + q1(10:12) = qn(7:9) + (0.5_wp*NORM2(d0) + 2.0e-2_wp)*dir + CALL slack_tangent_case('slack-dashpot-credit', qn, vn, q1, L0, EA, AD, BA*0.5_wp/L0(3)) + CALL reset_chain_load() + END SUBROUTINE case_slack_dashpot_release + + SUBROUTINE slack_tangent_case(label, qn, vn, q1, l0, ea, ad, td0) + !! A capped row of case_slack_dashpot_release: the cap is active, and the tangent matches + !! the finite difference on both paths. + CHARACTER(*), INTENT(IN) :: label + REAL(wp), INTENT(IN) :: qn(12), vn(12), q1(12), l0(3), ea(3), ad(3), td0 + REAL(wp) :: Ra(12), Rb(12), Kd(9, 9), z(12) + z = 0.0_wp + CALL probe_chain(qn, vn, z, q1, l0, ea, [1.0e-12_wp, 1.0e-12_wp, 1.0e-12_wp], .TRUE., Ra, Kd, axial_damping=ad) + CALL probe_chain(qn, vn, z, q1, l0, ea, [1.0e-12_wp, 1.0e-12_wp, 1.0e-12_wp], .TRUE., Rb, Kd) + CALL require(MAXVAL(ABS(Ra(10:12) - Rb(10:12))) > 1.0e-2_wp*ABS(td0), label//':cap-active') + CALL fd_tangent_check(label, qn, vn, z, q1, l0, ea, [2.0_wp, 3.0_wp, 1.5_wp], .TRUE., axial_damping=ad) + CALL fd_tangent_check(label, qn, vn, z, q1, l0, ea, [2.0_wp, 3.0_wp, 1.5_wp], .FALSE., axial_damping=ad) + END SUBROUTINE slack_tangent_case + SUBROUTINE law_cap_config(label, strain_n, strain_1, dirs_trial) CHARACTER(*), INTENT(IN) :: label REAL(wp), INTENT(IN) :: strain_n(3), strain_1(3)