Skip to content

Latest commit

 

History

History
267 lines (215 loc) · 11.8 KB

EXAMPLE_WORKFLOWS.md

File metadata and controls

267 lines (215 loc) · 11.8 KB

Example workflows

Pointers to runnable examples in the SEA-Stack tree: standalone libraries, the full simulation app, and packaged demos. For a separate CMake project that links against an installed SDK, see DOWNSTREAM_PROJECT.md.

Standalone hydrodynamics

Evaluate hydrodynamic forces without Chrono — see examples/standalone_hydro.

Standalone PTO and control

Run PTO and control models without Chrono or Eigen — see examples/standalone_controller.

Chrono-integrated simulation

Full time-domain multibody dynamics with run_seastack and YAML configuration. After a build or package install, start from the Quick start section of the main README; case YAML and assets live under data/demos/run_seastack/.

Hydrodynamic bodies and BEM numbering

The BEM file (BEMIO HDF5) defines the hydrodynamic bodies and their order: groups body1, body2, ... in the order the bodies were given to the BEM solver. The coupled coefficients use the same order. For N bodies, each body's added mass and radiation kernels hold its six rows against all 6N degrees of freedom.

  • name: bodyN under hydrodynamics.bodies refers to BEM group bodyN: row block N and column block N of the coupled coefficients.
  • The model YAML body that receives these loads has the same name, bodyN.
  • List every body in the BEM file, body1 to bodyN, once each, all with the same h5_file. A subset of a multibody file is rejected, because its coefficients couple all of the bodies.
  • The order of hydrodynamics.bodies and of the model's bodies list does not matter. Per-body settings (damping, hydrostatics, wetted surface) follow the name.
  • Bodies without hydrodynamics, such as a crane arm or a payload, appear only in the model YAML. They take no part in the BEM numbering.

For the two-body RM3 file, the float is body1 and the plate is body2:

hydrodynamics:
  bodies:
    - name: body1                        # float: BEM body 1, DOFs 1-6
      h5_file: ../assets/hydroData/rm3.h5
    - name: body2                        # plate: BEM body 2, DOFs 7-12
      h5_file: ../assets/hydroData/rm3.h5

A missing, duplicate or out-of-range body, a missing model body, a second BEM file or an incomplete body set stops the run before the first time step, naming the bodies and the BEM file.

Demo-driven cases

Preconfigured models (RM3, 5SA, OSWEC, IEA sphere, F3OF, and others) with documented command lines: demo suite README.

Initial body velocity

A body in the model YAML can start moving. Chrono's model parser reads two optional body keys (Chrono 10.0):

bodies:
  - name: body1
    location: [0, 0, -2.0]               # equilibrium for the IEA sphere
    initial_linear_velocity: [0, 0, 0.5]  # [m/s]
    initial_angular_velocity: [0, 0, 0]   # [rad/s]
  • initial_linear_velocity is the velocity of the centre of mass, in world axes.
  • initial_angular_velocity is in the body's own axes (the axes of its centre-of-mass frame), not world axes. For a body that starts rotated, the two differ.
  • Both default to zero. Give a velocity that the joints allow (for the heave-only sphere, z only).
  • SEA-Stack does not change these velocities. Radiation memory starts empty, so the start is impulsive, as for an offset decay.
  • The output file starts at the first time step, not at t = 0.

test_initial_velocity runs the IEA sphere decay from equilibrium with 0.5 m/s upward and checks it against the 1 m offset decay: same damped period (4.35 s) within 0.03%.

Wave elevation records (eta_file)

A measured or generated elevation record (lines of time:elevation, in s and m) can drive the waves. The record stands for a long-crested sea at the origin; waves.direction gives its propagation direction:

waves:
  type: irregular
  eta_file: eta_record.txt
  direction: 30.0          # [deg], counter-clockwise from +x; default 0
  method: irf_convolution  # optional; omit for the DFT import
  • Without method: irf_convolution, the record is split into Fourier components (DFT import), and all components travel along direction.
  • With method: irf_convolution, the record is used as is and convolved with the excitation impulse response for direction (the BEM heading, or a linear blend of the two nearest headings).
  • Before v1.1 direction was ignored for eta records: the DFT import used 0 deg and the IRF path used the first BEM heading. Cases without direction and with a 0 deg first BEM heading are unchanged.

test_comparison_oswec_compare_excitation_heading_oswec_irreg runs the OSWEC with a record of a 30 deg sea and matches the run with the same sea built from components.

Large waves: nonlinear Froude-Krylov

New in v1.1. See RELEASE_NOTES_v1.1.md.

Set wetted_surface: instantaneous and a mesh_file on a body. At each time step SEA-Stack then integrates the static and incident-wave pressure over the part of the hull that is below the wave surface. It subtracts the linear Froude-Krylov force that the BEM excitation already contains, so only diffraction and radiation stay linear. Use it when heave or relative motion is a sizeable fraction of the draft or freeboard. Example: iea_sphere/regular_waves_nlfk.

hydrodynamics:
  bodies:
    - name: body1
      h5_file: ../assets/hydroData/sphere.h5
      mesh_file: ../assets/geometry/sphere.obj   # closed hull, body frame
      wetted_surface: instantaneous              # mean (default) | calm_water | instantaneous

wetted_surface says which hull surface the static and incident-wave pressure act on:

Value Static pressure (buoyancy) Incident-wave pressure (Froude-Krylov) Use
mean (default) BEM stiffness on the mean hull BEM excitation on the mean hull Small motions; fastest
calm_water Mesh below z = 0 BEM excitation on the mean hull v1.0.0 hydrostatics: nonlinear; eta-table waves; cross-checks
instantaneous Mesh below the incident wave Mesh below the incident wave Large waves and motions

instantaneous sets both parts together, so the hull never sees buoyancy from one surface and wave pressure from another. calm_water is valid only while the relative motion stays well below the draft and freeboard; in large waves it can throw the body clear of the water, and the run logs a warning. In still water the two nonlinear options give the same force, and instantaneous uses the cheaper calm-water integrator. The start-up log states the model chosen for each body.

wave_pressure (only with instantaneous) selects the wave pressure model: airy_wheeler (default) is Airy pressure with Wheeler stretching above z = 0; long_wave is p = rho g (eta - z). Pick long_wave only for long waves: it ignores the decay of the wave pressure with depth, so its error grows with wavenumber times draft (about 4% heave for the IEA sphere at T = 4.2 s).

v1.0.0 inputs still work: hydrostatics: nonlinear (scalar, block or inline form) and the deprecated global nonlinear_hydrostatics: true both mean calm_water.

Rules (checked at start-up; each stops the run with an explicit error):

  • calm_water and instantaneous need a closed hull mesh_file. If both the body-level mesh_file and hydrostatics.mesh_file are given, they must be the same file.
  • Set wetted_surface or hydrostatics on a body, not both.
  • instantaneous needs include_excitation: true: the diffraction force still comes from the BEM excitation.
  • instantaneous needs waves defined by discrete components (regular, spectral, or a DFT eta import). Eta-table imports (waves.method: irf_convolution) are rejected; use calm_water there.

The nonlinear Froude-Krylov force ramps in with the same ramp as the excitation (waves.ramp_type, or the excitation method's default when it is omitted). A warning is logged if a body starts away from its BEM position (the subtracted linear force is phased for that position) or if it leaves the water completely.

Verification: unit, comparison and external tests are listed in docs/theory/NONLINEAR_FROUDE_KRYLOV.md, section 9 onwards. Against the IEA OES Task 10 weakly nonlinear codes (MARIN, NREL) at steepness H/(gT²) = 0.01, the sphere heave RAO lies within 1% of the range spanned by the two codes at every period, free and with optimum PTO.

Limits:

  • Radiation and diffraction stay linear, about the mean position. The incident wave is not disturbed by the body. Slamming, breaking and green water are not modelled.
  • Cost scales with mesh vertices times wave components. For the 8064-face IEA sphere mesh: about 0.1 ms per time step in a regular wave (test_benchmark_sphere_reg_nlfk), and about 1.5 ms in an irregular sea with 512 components (test_benchmark_sphere_irreg_nlfk; 16-core desktop, 11 ms on one thread). With more than 8 wave components the wave evaluation runs in parallel with OpenMP; set OMP_NUM_THREADS to limit it. Use the coarsest mesh that resolves the waterline.

Regular waves: constant-coefficient radiation

For a regular wave, radiation.method: constant_coefficients applies the BEM coefficients at the wave frequency directly:

F_rad = -A(w) xddot - B(w) xdot

A(w) and B(w) are the full coupled 6N x 6N matrices from the .h5 file (added_mass/all, radiation_damping/all). A(w) replaces the infinite-frequency added mass A_inf in the Chrono added-mass load, so added mass is never counted twice. B(w) is applied as the radiation force, in place of the RIRF convolution or state-space model. Example: rm3/regular_waves_cc.

hydrodynamics:
  waves:
    type: regular
    height: 2.0
    period: 7.853984            # must be a BEM grid period
  radiation:
    method: constant_coefficients
    frequency_tolerance: 1.0e-4  # optional; relative |w_k - w| / w_k

Use it when the BEM frequency grid is coarse (for example design-screening runs with a dozen periods). On such grids the RIRF is built from few frequencies and can misrepresent A(w) and B(w) even at the grid points. On dense grids both methods agree closely.

Rules (checked at startup; violations stop the run with an explicit error):

  • Regular waves only. Irregular, bimodal, spread, eta_file, still water and free decay are rejected: a single frequency cannot represent them.
  • The period must be on the BEM grid. No interpolation and no extrapolation. The match uses frequency_tolerance (default 1e-4, relative). On failure the error lists the nearest grid period and all available periods.
  • RIRF-only options are rejected: smoothing, taper, and radiation truncation_time.
  • The .h5 must contain added_mass/all and radiation_damping/all for every body (standard BEMIO output).

Startup log: the requested and matched period and frequency, the frequency difference, the A(w), B(w) and A_inf diagonals per body, and a line confirming that A(w) replaces A_inf.

Limitations:

  • Steady state only. The start-up transient is wrong: it decays at the rate set by B(w) at the wave frequency, not by the true radiation damping at the body's natural frequency. If B(w) is small, the transient can take minutes of simulated time to decay. Use an excitation ramp, run long enough, and discard the transient before post-processing.
  • Radiation damping is evaluated once per time step from the current velocity (as for the other radiation methods). The resulting error is first order in the time step: about 0.6% amplitude near heave resonance at dt = 0.01 s for the IEA sphere, halving at dt = 0.005 s.