Repository navigation
Conversation
…-vector helper Morison_CalcOutput only consumed the axial unit vector k_hat from GetOrientationAngles; its tilt/heading trig outputs were unused. Replace that routine with a slim GetElementAxialVec(p1,p2,k_hat,...) that returns only k_hat and keeps the zero-length-element fatal guard (do not assume rigid structure). Convert the marine-growth weight moments F_WMG(4)/F_WMG(5) from sinPhi*sinBeta / sinPhi*cosBeta to the exact identities k_hat(2)/k_hat(1), update all four call sites, and drop the now-dead trig locals. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…helper Collapse the three duplicated external end-plate buoyancy blocks into a single contained AddEndBuoyancy subroutine, replace the brittle EqualRealNos partial-wetting arc test with the secStat classification returned by GetSectionFreeSurfaceIntersects_Cyl, drop the dead SetErrStat after that call, and convert the section-geometry branch to SELECT CASE. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Convert bare SetErrStat propagation sites to 'if (Failed()) return' so fatal errors from sub-calls abort instead of continuing with bad data. Fixes two lost-error cases: paired GetTotalWaveElev calls that shared one SetErrStat (first status overwritten), and the VisMesh Transfer_Point_to_Line2 call that passed ErrStat/ErrMsg directly and clobbered accumulated errors. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…tput Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Store each member's undisplaced section direction-cosine matrix as member%CMatrix at initialization instead of recomputing it every step via Morison_DirCosMtrx inside Morison_CalcOutput and getMemBallastHiPt. The reference DCM is constant per (straight) member, so the per-step calls built from the static u%Mesh%Position were redundant. CMatrix is computed once in SetMemberProperties_Cyl (spin 0, axisymmetric) and SetMemberProperties_Rec (spin = MSpinOrient), then combined with the instantaneous u%Mesh%Orientation at each use site, preserving results bit-for-bit. - Add CMatrix(3,3) to Morison_MemberType (registry + regenerated types). - YawMember now yaw-rotates x_hat/y_hat for all section geometries, and deliberately leaves CMatrix in the undisplaced frame since it is composed with the full nodal orientation downstream. - Remove dead Morison_DirCosMtrx calls, unused CMatrix/CMatrix0 locals, and the redundant MSecGeom checks in SetMemberProperties_Rec and YawMember. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Delete dead code with no callers: Morison_DirCosMtrx_noSpin (generic interface collapsed to Morison_DirCosMtrx), ElementCentroid, ElementVolume, FindInterpFactor, InterpWrappedStpInt, InterpWrappedStpLogical, DistributeElementLoads, and AddEndLoad, plus stale commented references. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Replace the trig-based incline angle (phi/sinPhi/cosPhi via acos/sin/cos) in member initialization with direct axial-unit-vector expressions, remove the now-redundant cosPhi_ref member field (consumers use k(3)), and guard the inclination-threshold checks with ABS(cosPhi) so a reversed member is still treated as vertical. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Replace the yaw-only YawMember/YawJoint helpers with RotateMemberNode and RotateJoint, which rotate reference-configuration member and joint properties to either the reference-yaw orientation (WaveDisp=0) or the full instantaneous node orientation (WaveDisp=1). Rotate per node in all three hydrodynamic loops (smoothing, no-smoothing, UpdateDiscState) and at the free-surface-crossing element, reading from the pristine parameter copy to avoid compounding. Keep hydrostatic loads on exact orientation. Remove the input constraint forbidding PtfmYMod=1 with WaveDisp=0 and clean up error handling in Morison_UpdateDiscState. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Add a PtfmRefXY pipeline so strip-theory (Morison) members translate with the low-frequency / instantaneous horizontal drift of the HydroDyn origin when WaveDisp=0, mirroring the existing PtfmRefY reference-yaw treatment and the WAMIT ExctnDisp filter. The drift follows the user-specified ExctnDisp/ExctnCutOff regardless of whether potential-flow bodies are present: the raw ExctnDisp is captured into p%PtfmXYMod before HydroDynInput_ProcessInitData may force it to 0 for the WAMIT grid, and the ExctnCutOff>0 validation is checked beforehand and broadened to ExctnDisp=2. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Update the WaveDisp input comment and documentation to reflect the clearer interpretation: WaveDisp=0 places strip-theory members/joints at a potential-flow-consistent reference configuration (reference yaw plus horizontal x-y drift governed by ExctnDisp/ExctnCutOff), and WaveDisp=1 uses the exact instantaneous displaced position and orientation. Updates input_files.rst, appendix.rst, api_change.rst, and the FAST_writer.py comment string. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…heory Remove the hidden logic that dropped the vertical (Z) displacement of strip-theory member nodes when wave stretching was disabled. The member submergence status now checks every node (members are no longer assumed rigid/straight), and load smoothing is applied for right-side-up members crossing the free surface once whenever wave stretching is enabled or WaveDisp=1, since both can drive nodes in and out of the water. Smoothing is skipped only when WaveStMod=0 and WaveDisp=0. Update input_files.rst to drop the obsolete Z-displacement explanation. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…d loads The AMMod switch selected whether the distributed strip-theory added-mass force was evaluated only up to the SWL (0) or followed the instantaneous wetted section (1). With the improved solver stability in 5.1.0 the SWL-only option is no longer needed, so AMMod is removed and the added-mass force is now computed the same way as the other distributed loads: up to the instantaneous free surface when wave stretching is enabled (WaveStMod > 0) and up to the SWL otherwise. Removes AMMod from the Morison registry/types, HydroDyn input parsing and validation, the Python reader/writer, and the documentation (with an api_change.rst entry). Bumps the r-test pointer to the input files with the AMMod line removed (required because HydroDyn uses fixed-form line-position input parsing). Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…thing Use the SWL (z=0) as the free surface when wave stretching is disabled in the smoothing loop, matching how nodeInWater/MemSubStat are determined. Previously the instantaneous wave elevation was used to locate the crossing element while in-water status used the SWL, so the WaveStMod=0 + WaveDisp=1 combination could leave FSElem unset (-1) and segfault when indexing arrays. Also add a fatal-error guard if no free-surface-crossing element is found. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Drag, added-mass, and inertia side loads are now written only to memberLoads and added to the output mesh in a single pass after the side-load block. The load-redistribution moment correction is split by component and stored in the moment rows of F_D, F_A, and F_I instead of being added directly to the mesh, so member load totals now include it. This prepares for nodal blending with the upcoming shallow-angle member model. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Add memberLoads%F_WE and F_WE_End for the upcoming water entry/exit force, included in the mesh loads and member/joint totals. Add HM_w and HM_nw misc arrays for per-node blending of the baseline and shallow-angle strip-theory models. No change in results. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Add module constants (blend angles, Table 1 polynomial coefficients) and PURE helpers for the horizontal-member model: smooth step and blend weight, submerged area and wetted circumference fraction, normalized heave/sway added mass with analytic derivatives (heave via half-angle form to avoid cancellation near Hbar=+1), section submergence depth, and partially-submerged Froude-Krylov section force. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
…members Compute per-node blend weights from the local free-surface normal and member axis, skip the baseline model when all weights are zero, and blend in a shallow-angle model for circular members: submergence-dependent drag, Froude-Krylov force on the wetted arc, Greenhow/Taylor added mass and scattering, and smoothed water entry/exit loads. Extract the nodal taper into GetNodeTaper. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Add GetJointWetting for the wetted area fraction of joint end plates. Scale joint added mass, inertia, and drag by the wetted fraction, add the water entry/exit load, and use free-surface kinematics for joints above water. Apply the same scaling in the joint drag filter update. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Weight the joint relative normal velocity by sqrt(r) instead of r in CalcOutput and in the drag filter update, so the quadratic endplate drag scales with r in both the filtered and unfiltered branches. Fully wetted joints are unchanged. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Only warn about the PRP yaw violating the small-angle assumption when there are potential-flow bodies or strip-theory members with WaveDisp=0, the only users of PtfmRefY. Co-authored-by: GitHub Copilot <copilot@github.com> Co-authored-by: Claude <noreply@anthropic.com>
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.
This PR is NOT ready to be merged. The core new functionality has been implemented and tested, but it is still a work in progress. Also depends on merging PR #3487 first.
Feature or improvement description
This PR provides an important upgrade to HydroDyn's strip-theory formulation by introducing a more accurate hydrodynamic load model for circular members on or near the free surface. It corrects the distributed hydrodynamic loads along the member both when the member is surface piercing (in a ship-like configuration) or at shallow submergence when the member is at a shallow inclination angle relative to the free surface. It also includes corrections to the joint/endplate loads to account for partial wetting.
HydroDyn already computes nonlinear hydrostatic loads on strip-theory (Morison) members by directly integrating the hydrostatic pressure on the instantaneous wetted surface (
MHstLMod=2). This method is general and correctly evaluates the hydrostatic loads for any member/free-surface intersection. It also correctly handles partially wetted end plates.However, the strip-theory hydrodynamic load model was still greatly simplified. More specifically, if the center of a section is below the wave free surface when wave stretching is enabled (
WaveStMod>0in SeaState) or below the still water level without wave stretching (WaveStMod=0in SeaState), the hydrodynamic loads on this section were computed as if the entire section is submerged. Alternatively, if the section center is above the free surface or still water level, the section was treated as completely dry with zero hydrodynamic load. As a result, HydroDyn strip-theory members could not provide realistic hydrodynamic loads if the member is on and nearly parallel to the free surface with the section centers going in and out of water. The joints/endplates were handled in a similar fashion, being treated as either fully submerged or fully dry with no in-between states.To address the fidelity gap between hydrodynamic and hydrostatic loads for near-surface/surface-piercing members with shallow inclination relative to the free surface, this PR adds improved strip-theory hydrodynamic load models for circular members specifically for these situations. The key changes relative to the baseline strip-theory load models, which are retained for members at a steeper angle relative to the free surface, are:
r. More specifically, the added-mass and wave-scattering force are scaled byr^(3/2)while the Froude-Krylov force and drag are scaled byr. If velocity filtering is used, the normal relative velocity filtered is also scaled byr. The von Kármán water entry/exit force is also generalized for the joints and is included in the model.Currently, the above new capabilities are only implemented for circular members. There is no plan to generalize it to rectangular members due to the greatly increased complexity and a lack of reference data.
The core feature has been implemented and preliminarily tested and verified, including a stress test where a light horizontal rigid cylinder (the fully submerged added mass is 4.6x the structural mass) is dropped from 10 m above water. After the initial impact, the member subsequently bounced back out of water before settling over time. This is a numerically highly challenging case because the initial Jacobian encodes zero added mass (member is in the air), and as the member hits the water, the added mass rapidly increases from 0 to 4x structural mass. Nevertheless, the glue code remains stable with the help of automatic Jacobian update and underrelaxation.
Related issue, if one exists
N/A
Impacted areas of the software
HydroDyn (Morison)
Additional supporting information
Formulation and implementation details to come.
Generative AI usage
Formulated by human. This PR page is also written by human for readability and focus.
Code implementation assisted by LLM:
Co-authored-by: Anthropic Claude claude@anthropic.com
Assisted by: GitHub Copilot support@github.com
Test results, if applicable
Existing r-tests are not affected because the scenario addressed by this improvement was purposely avoided in the past. New r-tests will be prepared and require merging.