Skip to content

Commit df67d5e

Browse files
authored
Merge pull request WEC-Sim#1436 from WEC-Sim/main
Pull bug fixes from main into dev
2 parents af019ab + d8a2314 commit df67d5e

1 file changed

Lines changed: 53 additions & 23 deletions

File tree

docs/_include/added_mass.rst

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ shown in the manipulation of the governing equation below:
1919
(M+A)\ddot{X_i} &= \Sigma F(t,\omega) \\
2020
M_{adjusted}\ddot{X_i} &= \Sigma F(t,\omega)
2121
22-
where capital :math:`M` is the mass matrix, :math:`A` is the added mass, and subscript :math:`i` represents the timestep being solved for.
22+
where :math:`F_{am} = -A\ddot{X_i}` is the added mass component of the radiation force that is pulled out of the force summation for manipulation,
23+
:math:`M` is the mass matrix, :math:`A` is the single frequency or infinite frequency added mass, and subscript :math:`i` represents the timestep being solved for.
2324
In this case, the adjusted body mass matrix is defined as the sum of the translational mass (:math:`m`), inertia tensor (:math:`I`), and the added mass matrix:
2425

2526
.. math::
@@ -28,8 +29,8 @@ In this case, the adjusted body mass matrix is defined as the sum of the transla
2829
m + A_{1,1} & A_{1,2} & A_{1,3} & A_{1,4} & A_{1,5} & A_{1,6} \\
2930
A_{2,1} & m + A_{2,2} & A_{2,3} & A_{2,4} & A_{2,5} & A_{2,6} \\
3031
A_{3,1} & A_{3,2} & m + A_{3,3} & A_{3,4} & A_{3,5} & A_{3,6} \\
31-
A_{4,1} & A_{4,2} & A_{4,3} & I_{1,1} + A_{4,4} & -I_{2,1} + A_{4,5} & -I_{3,1} + A_{4,6} \\
32-
A_{5,1} & A_{5,2} & A_{5,3} & I_{2,1} + A_{5,4} & I_{2,2} + A_{5,5} & -I_{3,2} + A_{5,6} \\
32+
A_{4,1} & A_{4,2} & A_{4,3} & I_{1,1} + A_{4,4} & I_{1,2} + A_{4,5} & I_{1,3} + A_{4,6} \\
33+
A_{5,1} & A_{5,2} & A_{5,3} & I_{2,1} + A_{5,4} & I_{2,2} + A_{5,5} & I_{2,3} + A_{5,6} \\
3334
A_{6,1} & A_{6,2} & A_{6,3} & I_{3,1} + A_{6,4} & I_{3,2} + A_{6,5} & I_{3,3} + A_{6,6} \\
3435
\end{bmatrix}
3536
@@ -53,24 +54,25 @@ There is a 1-1 mapping between the body's inertia tensor and rotational added ma
5354
These added mass coefficients are entirely lumped with the body's inertia.
5455
Additionally, the surge-surge (1,1), sway-sway (2,2), heave-heave (3,3) added mass coefficients correspond to the translational mass of the body, but must be treated identically.
5556

56-
WEC-Sim implements this added mass treatment using both a modified added mass matrix and a modified body mass matrix:
57+
WEC-Sim implements this added mass treatment by adding a change in mass matrix ($$dM$$) to both sides of the equation, creating both a modified added mass matrix and a modified body mass matrix:
5758

5859
.. math::
5960
6061
M\ddot{X_i} &= \Sigma F(t,\omega) - A\ddot{X_i} \\
61-
(M+dMass)\ddot{X_i} &= \Sigma F(t,\omega) - (A-dMass)\ddot{X_i} \\
62+
M\ddot{X_i} + dM\ddot{X_i} &= \Sigma F(t,\omega) - A\ddot{X_i} + dM\ddot{X_i}\\
63+
(M+dM)\ddot{X_i} &= \Sigma F(t,\omega) - (A-dM)\ddot{X_i} \\
6264
M_{adjusted}\ddot{X_i} &= \Sigma F(t,\omega) - A_{adjusted}\ddot{X_i} \\
6365
64-
where :math:`dMass` is the change in added mass and defined as:
66+
where :math:`dM` is the change in added mass and defined as:
6567

6668
.. math::
6769
68-
dMass &= \begin{bmatrix}
70+
dM &= \begin{bmatrix}
6971
\alpha Y & 0 & 0 & 0 & 0 & 0 \\
7072
0 & \alpha Y & 0 & 0 & 0 & 0 \\
7173
0 & 0 & \alpha Y & 0 & 0 & 0 \\
72-
0 & 0 & 0 & A_{4,4} & -A_{5,4} & -A_{6,4} \\
73-
0 & 0 & 0 & A_{5,4} & A_{5,5} & -A_{6,5} \\
74+
0 & 0 & 0 & A_{4,4} & A_{5,4} & A_{6,4} \\
75+
0 & 0 & 0 & A_{5,4} & A_{5,5} & A_{6,5} \\
7476
0 & 0 & 0 & A_{6,4} & A_{6,5} & A_{6,6} \\
7577
\end{bmatrix} \\
7678
Y &= (A_{1,1} + A_{2,2} + A_{3,3}) \\
@@ -80,25 +82,25 @@ The resultant definition of the body mass matrix and added mass matrix are then:
8082

8183
.. math::
8284
83-
M &= \begin{bmatrix}
85+
M_{adjusted} &= \begin{bmatrix}
8486
m + \alpha Y & 0 & 0 & 0 & 0 & 0 \\
8587
0 & m + \alpha Y & 0 & 0 & 0 & 0 \\
8688
0 & 0 & m + \alpha Y & 0 & 0 & 0 \\
87-
0 & 0 & 0 & I_{4,4} + A_{4,4} & -(I_{5,4} + A_{5,4}) & -(I_{6,4} + A_{6,4}) \\
88-
0 & 0 & 0 & I_{5,4} + A_{5,4} & I_{5,5} + A_{5,5} & -(I_{6,5} + A_{6,5}) \\
89+
0 & 0 & 0 & I_{4,4} + A_{4,4} & I_{5,4} + A_{5,4} & I_{6,4} + A_{6,4} \\
90+
0 & 0 & 0 & I_{5,4} + A_{5,4} & I_{5,5} + A_{5,5} & I_{6,5} + A_{6,5} \\
8991
0 & 0 & 0 & I_{6,4} + A_{6,4} & I_{6,5} + A_{6,5} & I_{6,6} + A_{6,6} \\
9092
\end{bmatrix} \\
9193
A_{adjusted} &= \begin{bmatrix}
9294
A_{1,1} - \alpha Y & A_{1,2} & A_{1,3} & A_{1,4} & A_{1,5} & A_{1,6} \\
9395
A_{2,1} & A_{2,2} - \alpha Y & A_{2,3} & A_{2,4} & A_{2,5} & A_{2,6} \\
9496
A_{3,1} & A_{3,2} & A_{3,3} - \alpha Y & A_{3,4} & A_{3,5} & A_{3,6} \\
95-
A_{4,1} & A_{4,2} & A_{4,3} & 0 & A_{4,5} + A_{5,4} & A_{4,6} + A_{6,4} \\
96-
A_{5,1} & A_{5,2} & A_{5,3} & 0 & 0 & A_{5,6} + A_{6,5} \\
97+
A_{4,1} & A_{4,2} & A_{4,3} & 0 & A_{4,5} - A_{5,4} & A_{4,6} - A_{6,4} \\
98+
A_{5,1} & A_{5,2} & A_{5,3} & 0 & 0 & A_{5,6} - A_{6,5} \\
9799
A_{6,1} & A_{6,2} & A_{6,3} & 0 & 0 & 0 \\
98100
\end{bmatrix}
99101
100102
.. Note::
101-
We should see that :math:`A_{4,5} + A_{5,4} = A_{4,6} + A_{6,4} = A_{5,6} + A_{6,5} = 0`, but there may be numerical differences in the added mass coefficients which are preserved.
103+
The inertia tensor is symmetric, so we should see that :math:`A_{4,5} - A_{5,4} = A_{4,6} - A_{6,4} = A_{5,6} - A_{6,5} = 0`. There may be numerical differences in the added mass coefficients which are preserved.
102104

103105
Though the components of added mass and body mass are manipulated in WEC-Sim, the total system is unchanged.
104106
This manipulation does not affect the governing equations of motion, only the implementation.
@@ -108,26 +110,54 @@ Advanced users may change this weighting factor in the ``wecSimInuptFile`` to cr
108110
To see its effects, set ``body(iB).adjMassFactor = 0`` and see if simulations become unstable.
109111

110112
This manipulation does not move all added mass components.
111-
WEC-Sim still contains an algebraic loop due to the acceleration dependence of the remaining added mass force from :math:`A_{adjusted}`, and components of the Morison Element force.
112-
WEC-Sim solves the algebraic loop using a `Simulink Transport Delay <https://www.mathworks.com/help/simulink/slref/transportdelay.html>`_ with a very small time delay (``1e-8``).
113-
This blocks extrapolates the previous acceleration by ``1e-8`` seconds, which results in a known acceleration for the added mass force.
114-
The small extraplation solves the algebraic loop but prevents large errors that arise when extrapolating the acceleration over an entire time step.
113+
WEC-Sim still contains an algebraic loop due to the dependence of the remaining added mass force :math:`A_{adjusted}\ddot{X_i}`, and components of the Morison Element force.
114+
WEC-Sim solves the algebraic loop using a `Simulink Transport Delay <https://www.mathworks.com/help/simulink/slref/transportdelay.html>`_ with a very small time delay (``1e-7``).
115+
This blocks extrapolates the previous acceleration by ``1e-7`` seconds, which results in a known acceleration for the added mass force.
116+
The small extrapolation solves the algebraic loop but prevents large errors that arise when extrapolating the acceleration over an entire time step.
115117
This will convert the algebraic loop equation of motion to a solvable one:
116118

117119
.. math::
118120
119-
M_{adjusted}\ddot{X_i} &= \Sigma F(t,\omega) - A_{adjusted}\ddot{X}_{i - (1 + 10^{-8}/dt)} \\
121+
M_{adjusted}\ddot{X_i} &= \Sigma F(t,\omega) - A_{adjusted}\ddot{X}_{i - (1 - 10^{-7}/dt)} \\
122+
123+
Body-to-body Interactions
124+
"""""""""""""""""""""""""""
125+
F = A * acc
126+
first dimension/index = down, 2nd = across
127+
non b2b: A = [6x6], acc = [6x1],
128+
b2b: A = [6x12], acc = [12x1] in order of body numbers regardless of the current body number
129+
130+
The above implementation extends readily to the case where there are body interactions to account for.
131+
In this example, we assume there are two bodies with body interaction.
132+
Then the right hand side added mass and acceleration matrices above are (without generalized modes)
133+
of size 6x12 and 12x1 respectively. Note that in this subsection the subscript on acceleration and added mass
134+
now refers to the body number to differentiate between the acceleration and added mass matrices of different bodies.
135+
136+
.. math::
137+
138+
M_i\ddot{X_i} &= \Sigma F_i(t,\omega) - \begin{bmatrix} A_1 & A_2 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} \\
139+
M_i\ddot{X_i} + dM\ddot{X_i} &= \Sigma F_i(t,\omega) - \begin{bmatrix} A_1 & A_2 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} + dM\ddot{X_i} \\
140+
141+
With body interactions, the derivation for the added mass adjustment for *body 1* is:
142+
143+
.. math::
144+
M_i\ddot{X_1} + dM\ddot{X_1} &= \Sigma F_1(t,\omega) - \begin{bmatrix} A_1 & A_2 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} + dM\ddot{X_1} \\
145+
M_1\ddot{X_1} + dM\ddot{X_1} &= \Sigma F_1(t,\omega) - \begin{bmatrix} A_1 & A_2 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} + \begin{bmatrix} dM & 0 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} \\
146+
(M_1+dM)\ddot{X_1} &= \Sigma F_1(t,\omega) - \begin{bmatrix} A_1-dM & A_2 \end{bmatrix} \begin{bmatrix} \ddot{X_1} \\ \ddot{X_2} \\ \end{bmatrix} \\
147+
M_{adjusted}\ddot{X_i} &= \Sigma F(t,\omega) - A_{adjusted}\ddot{X_i} \\
148+
149+
So when body-to-body interactions are considered, the term :math:`dM` is still only dependent on and only affects the added mass of the body in question (e.g. body 1 above).
120150

121151
Working with the Added Mass Implementation
122-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152+
"""""""""""""""""""""""""""""""""""""""""""
123153

124154
WEC-Sim's added mass implementation should not affect a user's modeling workflow.
125155
WEC-Sim handles the manipulation and restoration of the mass and forces in the bodyClass functions ``adjustMassMatrix()`` called by ``initializeWecSim`` and ``restoreMassMatrix``, ``storeForceAddedMass`` called by ``postProcessWecSim``.
126156
However viewing ``body.mass, body.inertia, body,inertiaProducts, body.hydroForce.hf*.fAddedMass`` between calls to ``initializeWecSim`` and ``postProcessWecSim`` will not show the input file definitions.
127157
Users can get the manipulated mass matrix, added mass coefficients, added mass force and total force from ``body.hydroForce.hf*.storage`` after the simulation.
128-
However, in the rare case that a user wants to manipulate the added mass force *during* a simulation, the change in mass, :math:`dMass` above, must be taken into account. Refer to how ``body.calculateForceAddedMass()`` calculates the entire added mass force in WEC-Sim post-processing.
158+
However, in the rare case that a user wants to manipulate the added mass force *during* a simulation, the change in mass, :math:`dM` above, must be taken into account. Refer to how ``body.calculateForceAddedMass()`` calculates the entire added mass force in WEC-Sim post-processing.
129159

130-
.. Note:: If applying the method in ``body.calculateForceAddedMass()`` *during* the simulation, the negative of ``dMass`` must be taken: :math:`dMass = -dMass`. This must be accounted for because the definitions of mass, inertia, etc and their stored values are flipped between simulation and post-processing.
160+
.. Note:: If applying the method in ``body.calculateForceAddedMass()`` *during* the simulation, the negative of ``dM`` must be taken: :math:`dM = -dM`. This must be accounted for because the definitions of mass, inertia, etc and their stored values are flipped between simulation and post-processing.
131161

132162
.. Note::
133163
Depending on the wave formulation used, :math:`A` can either be a function of wave frequency :math:`A(\omega)`, or equal to the added mass at infinite wave frequency :math:`A_{\infty}`

0 commit comments

Comments
 (0)