Repository navigation
fix: TMax = 0 static checks, faster elevation-record waves, WvHiCOff - #64
Merged
Merged
Conversation
Checking the static start of a dynamic deck meant editing it down: with dtM and TMax removed, the deck stopped on its first dynamic input with a message about a dynamic run, and with TMax = 0 a RangeStart or a motion record longer than the run was refused. Now: - motionFile (point and TURBINES rows) and vesselMotion records may run past TMax. Rows after TMax are parsed, range-checked and placed on the dtM grid (to 100 eps max(1, t)), and are not used, so a long record also serves a shorter run. Off-grid rows and rows before 0 are still refused. - RangeStart is accepted at TMax = 0, where the range graphs hold the t = 0 row; after a TMax > 0 it is still refused. - A standalone deck without TMax whose error asks for dtM and TMax (or for a dynamic deck) ends with "to check a dynamic deck's static start only, give dtM with TMax = 0", in the driver and in the Python deck validator. Every shipped dynamic example runs at TMax = 0. On both shipped motion-record decks, a 1 s run on the 36 s record writes the same output, byte for byte, as one on the record cut to 1 s (static_check). A TURBINES record 2 s longer than TMax gives the same run (shared_anchor). Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A WaterKin elevation history (WaveKinMod 1) is reduced to about TMax/(2 dtWave) Fourier components, up to the Nyquist frequency of dtWave: 600 for a 300 s run at 0.25 s, against the 200 of a jonswap sea. Every node summed all of them with a cos, a sin and two exps each, so a lazy-wave cable ran 2.9 times slower than with the jonswap option. CD_Component_Wave_Kinematics takes an optional tail_sums table: the sums over j >= i of a_j omega_j, a_j omega_j^2 and a_j omega_j^2/k_j, for a table whose k does not decrease. On -depth <= z' <= 0 both depth ratios fall as k grows, so the cosh ratio of the last summed component times the tail sums bounds the rest of the velocity, acceleration and pressure sums; they stop once that bound is below half an ulp of the magnitude already summed. The elevation still sums every component. The sums run in blocks of 32 in component order, so without tail_sums the result is bit for bit the same, and the underflow fallback reuses the block's exponentials instead of recomputing two per component. The deck driver builds the table, and the exp(-2kd) table it already kept for jonswap, for the elevation-history components and for jonswap. On a 1024-element lazy-wave cable over 300 s, a record at dtWave 0.25 s runs in 103 s instead of 226 s and one at 0.1 s in 189 s instead of about 660 s, with output identical to the printed digits; the jonswap run changes in its eighth printed digit. Reading the WaveKinFile appended one row at a time, copying the whole record per row: a 10 s run on a 168,000-row record took 107 s. The rows now grow by doubling, and the same run takes 3.5 s. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A WaterKin WaveKinMod 1 record kept every Fourier component up to the Nyquist frequency of dtWave: 18,000 for a one-hour record at 0.1 s, each summed at every node for the surface elevation. Measured on a user's 600 s twin case, keeping only the components up to 0.5 Hz changed the curvature fatigue load by 0.02 % and cut the wave time by 8.5 times. The new OPTION WvHiCOff (rad/s, SeaState's name and meaning) drops the components of an elevation record above it, by default pi rad/s, the 0.5 Hz at which MoorDyn-C cuts WaveKin 3; WaveKin 3 now follows the option too (bit for bit at the default). none WvHiCOff keeps every component, as MoorDyn-F and earlier CableDyn did. A record with no component at or below the cut-off (a run shorter than 2 s at the default) is refused by name. The WaveKin 3 components are stored in preallocated arrays instead of growing by one per component. On the 300 s lazy-wave case (1024 elements), records at dtWave 0.25 s and 0.1 s both run in 72 s (103 s and 189 s with none), and every output channel's standard deviation moves by at most 0.002 %. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
A WaterKin WaveKinMod 1 deck sizes its Fourier window from TMax, as MoorDyn-F does, and refused TMax = 0, the check of a dynamic deck's static start. At TMax = 0 the window is now the record's own length. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes from a user's digital-twin feedback, in one PR. Each is a separate commit: the static check of a dynamic deck, the speed of elevation-record waves, and their high cut-off.
1.
TMax = 0checks the static start of any dynamic deckChecking the static start of a dynamic deck meant cutting the deck down first.
TMax. This coversmotionFilepoint rows,TURBINESrows andvesselMotion. Rows afterTMaxare still parsed and placed on thedtMgrid, then not used; off-grid rows are still refused. A shared helper,motion_grid_index, replaces three copies of the grid lookup.RangeStartatTMax = 0is accepted, and the range graphs hold the t = 0 row. After aTMax > 0it is still refused.TMaxwhose error asks for a dynamic run now ends with; to check a dynamic deck's static start only, give dtM with TMax = 0. The Python validator gives the same text.static_checktest: a 1 s run on a 36 s record writes byte-identical output to a run on the record cut to 1 s.shared_anchor: aTURBINESrecord longer than the run gives the same run, bit for bit.2. Faster elevation-record waves
A WaterKin
WaveKinMod 1record becomes aboutTMax/(2 dtWave)Fourier components, which every node summed. The JONSWAP option has 200.Tail bound.
CD_Component_Wave_Kinematicsgains an optionaltail_sumstable, for tables whose k does not decrease.a ω,a ω²anda ω²/k, bounds the rest of the velocity, acceleration and pressure sums.tail_sumsthe result is bit for bit the same.exp(-2kd)cache, for elevation records and JONSWAP.WaveKinFile reading. The file was read one row at a time, copying the whole record per row. The rows now grow by doubling.
Measured on a 1024-element lazy-wave cable over 300 s:
dtWave0.25 sdtWave0.1 sBoth elevation decks give output identical to the printed digits. The JONSWAP run changes in its eighth printed digit.
New kernel test in
hermite_irregular_waves: a 1500-component table, from the surface to the seabed, with and without stretching.3.
WvHiCOff: high cut-off of an elevation record, 0.5 Hz by defaultWvHiCOff(rad/s, SeaState's name and meaning) drops the record's components above it. The default is π rad/s, the 0.5 Hz at which MoorDyn-C cutsWaveKin 3.WaveKin 3now follows the option too, bit for bit at the default.none WvHiCOffkeeps every component, as MoorDyn-F and earlier CableDyn did.dtWave0.1 s drops from 18,000 components to 1,800. On the 300 s case both records then run in 72 s. Every output channel's standard deviation moves by at most 0.002 %.TMax = 0. AWaveKinMod 1deck atTMax = 0now reduces its record over the record's own length, instead of failing for want of a positiveTMax.wavekin_modes: 1 rad/s keeps only the record's 8 s harmonic, exactly;nonereproduces the record.deck_driver: the refusal, and theTMax = 0run.WvHiCOff, and refuses 0 and text other thannone.Checks
lazy_wave_bend_stiffenerchanges in its eighth printed digit.lazy_wave_vessel_raohas one step, at 46.8 s, that converges one iteration apart under its 1e-4 solver tolerance. That movesFairTenby 1.5 N (1.7e-4) for half a second. At a 1e-9 tolerance, old and new agree to the last printed digit.Signed-off-by: Jae Hoon Seo jaehoon.seo@inha.ac.kr