Repository navigation
perf(hermite): assemble a cable reaction from its node's elements - #37
Merged
Merged
Conversation
The reaction of a finite-EI cable at a node (the fairlead load the OpenFAST module returns on every CalcOutput) assembled the residual and the added mass of the whole line and multiplied the whole mass by the acceleration, to read three rows. With a 248-element power cable this was 20 s of a 212 s coupled run. assemble_residual takes an optional node_only with a caller residual R_out: it assembles only the elements that reach the node and the node's own terms (attachments, contact, end connection), each in the order of the full assembly, so the node's rows are bit-identical and the model's scratch is not touched. The contact and attachment assemblies take node bounds, and contact writes through the residual it is given. The reaction builds the node's rows of the added mass from the same one or two element matrices and forms the inertia column by column as band_matvec does. A line with torsion, which couples every element, keeps the full assembly, as does full_assembly = .TRUE. test_hermite_node_reaction compares the two at every node, bit for bit, on hand-built cables with every load section (contact with friction on a controlled seabed, attachments, axial damping, drag, added mass, Airy waves or a held field, finite, rigid or no end connections) at scattered states, and along a coupled trajectory of the IEA-15 MW mixed mooring example, also after a fairlead transfer; it fails when the inertia sum is reordered. All 51 examples write byte-identical outputs, and the coupled chain-only and mixed OpenFAST runs write byte-identical outputs, the mixed one in 194 s instead of 212 s. 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. More of your lovely PRs please. 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.
Summary
Second optimisation from the profiles of #34 and #35, after #36. The reaction of a finite-EI cable at a node is the fairlead load the OpenFAST module returns on every
CalcOutput. To read three rows, it assembled:What changes:
assemble_residualtakes an optionalnode_onlywith a caller residualR_out. It assembles only:Each term is added in the order of the full assembly, so the node's rows are bit-identical. The model's scratch (residual and mass) is not touched.
Contact and attachments take node bounds. Contact writes through the residual it is given instead of the model's.
Added mass: the per-element matrix moves into
added_mass_element, shared byassemble_added_massand the reaction.The reaction builds the node's rows of the added mass from the same one or two element matrices. It forms the inertia column by column, in the same order as
band_matvec.Full assembly is kept for a line with torsion, which couples every element, and when
full_assembly = .TRUE.is passed.Why the shared scratch is safe to leave alone. Every other reader rebuilds it first:
assemble_committed_force.Measurement
IEA-15 VolturnUS-S, DLC-1.6 environment, 600 s at
dtM = DT = 0.025 s,OMP_NUM_THREADS=1,CABLEDYN_PROFILE=1, chain + 248-element power cable.CalcOutput/ loads.outand CableDyn.CD.out(chain-only and mixed)Tests
hermite_node_reaction. Compares the node reaction with the full-assembly reaction at every node, bit for bit, at 2835 node evaluations. It also checks that the residual and mass scratch are untouched.Hand-built cables: a seabed run and a riser with:
at the rest state and at scattered positions (some below the bed), velocities and accelerations.
The IEA-15 MW mixed mooring example: along 4 s of coupled surge and heave in a current, and after a fairlead transfer without a step (the
CalcOutputstate).Mutation check: reversing the column order of the inertia sum makes it fail, at 1644 nodes.
pre-commit run --all-filesand the Sphinx build with-Wpass. OpenFAST builds.Checklist
pre-commit run --all-filespassesctest --test-dir build --output-on-failurepassespython -m pytest tests python/testspasses (if Python or validation records changed)[Unreleased](heading added if missing) for user-visible changesdoc/updated for changed inputs, options, or outputs (no input, option or output changed)feat:,fix:,docs:, ...)git commit -s) under theDeveloper Certificate of Origin