Repository navigation
fix(capi): sample a deck current at the line nodes on the point route - #137
Conversation
A deck of EI = 0 lines initialised through the C API (CableDyn_InitDeck, and Python's CableDyn) runs on the point route (CD_Init_Deck_System). Each line model took its drag's fluid velocity at the nodes of its straight seed between its ends, while the static solve samples a depth profile or grid at its own node positions, and nothing sampled the current again: the standalone driver samples it at every node before every step. In a current that varies in space (a profile current, a Currents 1 table, a steady grid) the start was not the static state (end loads off the driver's by up to 1.7 % of a component), and a line held at rest drifted (a chain catenary in a 1.3 to 0.23 m/s profile: 0.4 % of its fairlead tension and 12 % of a force component in 2 s). A uniform current is the same at every node and was not affected. CD_Init_Deck_System now samples the current at the static nodes (the t = 0 state, re-deriving the line accelerations where the field changed) and returns the deck current for the caller to sample again; the C API samples it at the step-start nodes before every CableDyn_Step on the point route, as the driver does. A model built from raw lines or on the aggregate drops it. With the fix the start equals the driver's static state and a held line stays at rest to 1e-10; a 150-deck campaign of C API stepping against the driver no longer shows the profile-current mismatches (up to 14 % before). The new python/tests/test_point_current_profile.py holds the chain at rest for 100 steps and compares its start with the driver's. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
The [Unreleased] entries of the open changes are added together in one change, so that they do not conflict with each other. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 304aaa5fc5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
On the point route, CableDyn_Step samples the deck current at the step-start nodes before CD_FAST_Step validates dt and the motion. A step refused there (dt <= 0, non-finite motion) or a hard solver failure left the new fluid field in place, so CableDyn_CalcOutput afterwards returned different loads from those before the failed call. The step now keeps every line's drag fluid velocity and waterline before sampling and puts them back when the step does not commit. test_point_current_profile gains test_a_refused_step_leaves_the_loads: after a 2 m surge, a step with dt = -1 and one with a NaN motion leave calc_output and the channels bit-identical (it failed before). CTest 369/369 on both BLAS kernels. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
On the EI = 0 point route (
CD_Init_Deck_System, used by the C API and Python), each line took its drag fluid velocity at the nodes of its straight seed, and nothing sampled the current again. In a current that varies in space (a depth profile, aCurrents 1table or a steady grid), the start therefore differed from the driver's static state, by up to 1.7 % of an end-load component on the test deck and up to 14 % in the fuzz campaign. A held chain also drifted by 0.4 % of its fairlead tension in 2 s.CableDyn_Stepon the point route, as the driver does.Check. The start now matches the driver within 2e-7, and a held line stays at rest to 1e-6 (1e-10 measured).
Test.
python/tests/test_point_current_profile.py. CTest passes on both BLAS kernels; pytest passes. Examples are identical.