Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,15 @@ outputs are wanted. Eight output properties are currently possible:
- c – internal damping force at each segment
- s – strain of each segment
- d – rate of strain of each segment

- f – net node force
- W – weight at each node
- B – buoyancy force at each node
- P – dynamic pressure at each node
- X – transverse drag force at each node
- Y – tangential drag force at each node
- A – transverse inertia force at each node
- a – axial fluid inertia force at each node
Comment thread
RyanDavies19 marked this conversation as resolved.
Outdated
- b – bottom contact force
For example, outputting node positions and segment tensions could be achieved by writing “pt” for
this last column. These outputs will go to a dedicated output file for each rod. For sending
values to the global output file, use the Outputs section instead.
Expand Down
24 changes: 23 additions & 1 deletion source/Misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,29 @@ enum QTypeEnum : int
MZ = 25,
Sub = 26,
TenA = 27,
TenB = 28
TenB = 28,
Comment thread
KylerF229 marked this conversation as resolved.
Outdated
WZ = 31,
DpX = 32,
DpY = 33,
DpZ = 34,
DqX = 35,
DqY = 36,
DqZ = 37,
ApX = 38,
ApY = 39,
ApZ = 40,
AqX = 41,
AqY = 42,
AqZ = 43,
PdX = 44,
PdY = 45,
PdZ = 46,
BX = 47,
BY = 48,
BZ = 49,
BoX = 50,
BoY = 51,
BoZ = 52
};

// The following are some definitions for use with the output options in
Expand Down
27 changes: 21 additions & 6 deletions source/MoorDyn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,27 @@ namespace moordyn {

/// The list of units for the output
const char* UnitList[] = {
"(s) ", "(m) ", "(m) ", "(m) ", "(deg) ",
"(deg) ", "(deg) ", "(m/s) ", "(m/s) ", "(m/s) ",
"(deg/s) ", "(deg/s) ", "(deg/s) ", "(m/s2) ", "(m/s2) ",
"(m/s2) ", "(deg/s2) ", "(deg/s2) ", "(deg/s2) ", "(N) ",
"(N) ", "(N) ", "(N) ", "(Nm) ", "(Nm) ",
"(Nm) ", "(frac) "
"s", // 0: Time
Comment thread
RyanDavies19 marked this conversation as resolved.
"m", "m", "m", // 1: PosX 2: PosY 3: PosZ
"deg", "deg", "deg", // 4: RX 5: RY 6: RZ
"m/s", "m/s", "m/s", // 7: VelX 8: VelY 9: VelZ
"deg/s", "deg/s", "deg/s", // 10: RVelX 11: RVelY 12: RVelZ
"m/s^2", "m/s^2", "m/s^2", // 13: AccX 14: AccY 15: AccZ
"deg/s^2", "deg/s^2", "deg/s^2", // 16: RAccX 17: RAccY 18: RAccZ
"N", // 19: Ten
"N", "N", "N", // 20: FX 21: FY 22: FZ
"N*m", "N*m", "N*m", // 23: MX 24: MY 25: MZ
"(frac)", // 26: Sub
Comment thread
KylerF229 marked this conversation as resolved.
Outdated
"N", "N", // 27: TenA 28: TenB
"N", // 29: WZ
"N", "N", "N", // 30: BoX 31: BoY 32: BoZ
"N", "N", "N", // 33: DpX 34: DpY 35: DpZ
"N*m", "N*m", "N*m", // 36: DqX 37: DqY 38: DqZ
"N", "N", "N", // 39: ApX 40: ApY 41: ApZ
"N", "N", "N", // 42: AqX 43: AqY 44: AqZ
"Pa", "Pa", "Pa", // 45: PdX 46: PdY 47: PdZ
"N", "N", "N", // 48: BX 49: BY 50: BZ
"N", "N", "N" // 51: BoX 52: BoY 53: BoZ
};

std::atomic<size_t> __systems_counter(0);
Expand Down
188 changes: 181 additions & 7 deletions source/Rod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "Line.hpp"
#include "Waves.hpp"
#include <tuple>
#include <iomanip>
Comment thread
KylerF229 marked this conversation as resolved.

#ifdef USE_VTK
#include <vtkCellArray.h>
Expand Down Expand Up @@ -267,6 +268,54 @@ Rod::openoutput()
<< i << "Fz \t ";
}
}
// Output Weight
if (channels.find("W") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Wx \t Node" << i << "Wy \t Node"
<< i << "Wz \t ";
}
// output Buoyancy
if (channels.find("B") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Box \t Node" << i << "Boy \t Node"
<< i << "Boz \t ";
}
// output transverse drag
if (channels.find("X") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Dpx \t Node" << i << "Dpy \t Node"
<< i << "Dpz \t ";
}
// output tangential drag
if (channels.find("Y") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Dqx \t Node" << i << "Dqy \t Node"
<< i << "Dqz \t ";
}
// output transverse inertia force
if (channels.find("A") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "ApX \t Node" << i << "ApY \t Node"
<< i << "ApZ \t ";
}
// output axial fluid inertia force
Comment thread
RyanDavies19 marked this conversation as resolved.
Outdated
if (channels.find("a") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "AqX \t Node" << i << "AqY \t Node"
<< i << "AqZ \t ";
}
// output dynamic pressure
if (channels.find("P") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Pdx \t Node" << i << "Pdy \t Node"
<< i << "Pdz \t ";
}
// output bottom contact force
if (channels.find("b") != string::npos) {
for (unsigned int i = 0; i <= N; i++)
*outfile << "Node" << i << "Bx \t Node" << i << "By \t Node"
<< i << "Bz \t ";
};

*outfile << "\n";

Expand All @@ -282,16 +331,56 @@ Rod::openoutput()
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(m) \t";
}
// output velocities?
// output velocities
if (channels.find("v") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(m/s) \t";
}
// output net node force?
// output net node force
if (channels.find("f") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// Output Weight
if (channels.find("W") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output Buoyancy
if (channels.find("B") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output transverse drag
if (channels.find("X") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output tangential drag
if (channels.find("Y") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output transverse inertia force
if (channels.find("A") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output axial fluid inertia force
if (channels.find("a") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output dynamic pressure
if (channels.find("P") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(Pa) \t";
}
// output bottom contact force
if (channels.find("b") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}

*outfile << "\n";
}
Expand Down Expand Up @@ -422,6 +511,51 @@ Rod::GetRodOutput(OutChanProps outChan)
return Fnet[outChan.NodeID][1];
else if (outChan.QType == FZ)
return Fnet[outChan.NodeID][2];
else if (outChan.QType == WZ)
Comment thread
RyanDavies19 marked this conversation as resolved.
Outdated
return W[outChan.NodeID][2];
else if (outChan.QType == BoX)
return Bo[outChan.NodeID][0];
else if (outChan.QType == BoY)
return Bo[outChan.NodeID][1];
else if (outChan.QType == BoZ)
return Bo[outChan.NodeID][2];
else if (outChan.QType == DpX)
return Dp[outChan.NodeID][0];
else if (outChan.QType == DpY)
return Dp[outChan.NodeID][1];
else if (outChan.QType == DpZ)
return Dp[outChan.NodeID][2];
else if (outChan.QType == DqX)
return Dq[outChan.NodeID][0];
else if (outChan.QType == DqY)
return Dq[outChan.NodeID][1];
else if (outChan.QType == DqZ)
return Dq[outChan.NodeID][2];
else if (outChan.QType == ApX)
return Ap[outChan.NodeID][0];
else if (outChan.QType == ApY)
return Ap[outChan.NodeID][1];
else if (outChan.QType == ApZ)
return Ap[outChan.NodeID][2];
else if (outChan.QType == AqX)
return Aq[outChan.NodeID][0];
else if (outChan.QType == AqY)
return Aq[outChan.NodeID][1];
else if (outChan.QType == AqZ)
return Aq[outChan.NodeID][2];
else if (outChan.QType == PdX)
return Pd[outChan.NodeID][0];
else if (outChan.QType == PdY)
return Pd[outChan.NodeID][1];
else if (outChan.QType == PdZ)
return Pd[outChan.NodeID][2];
else if (outChan.QType == BX)
return B[outChan.NodeID][0];
else if (outChan.QType == BY)
return B[outChan.NodeID][1];
else if (outChan.QType == BZ)
return B[outChan.NodeID][2];

}
LOGWRN << "Unrecognized output channel " << outChan.QType << endl;
return 0.0;
Expand Down Expand Up @@ -988,12 +1122,12 @@ Rod::doRHS()
// get scalar for submerged portion

if (h0 < 0.0) { // Upside down case
if (Lsum + dL >= h0) // if fully submerged
if (Lsum >= -h0) // if fully submerged
VOF0 = 1.0;
else if (Lsum > h0) // if partially below waterline
VOF0 = (h0 - Lsum) / dL;
else if (Lsum + dL > -h0) // if partially below waterline
VOF0 = (Lsum + dL + h0) / dL; // partially submerged
else // must be out of water
VOF0 = 0.0;
VOF0 = 0.0; // fully out of water
} else {
if (Lsum + dL <= h0) // if fully submerged
VOF0 = 1.0;
Expand Down Expand Up @@ -1432,8 +1566,48 @@ Rod::Output(real time)
*outfile << Fnet[i][J] << "\t ";
}
}
// individual forces
if (channels.find("W") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << W[i][J] << "\t ";

*outfile << "\n";
if (channels.find("B") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Bo[i][J] << "\t ";

if (channels.find("Y") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Dp[i][J] << "\t ";
Comment thread
RyanDavies19 marked this conversation as resolved.
Outdated

if (channels.find("X") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Dq[i][J] << "\t ";
Comment thread
RyanDavies19 marked this conversation as resolved.
Outdated

if (channels.find("A") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Ap[i][J] << "\t ";

if (channels.find("a") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Aq[i][J] << "\t ";

if (channels.find("P") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Pd[i][J] << "\t ";

if (channels.find("b") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << B[i][J] << "\t ";

*outfile << "\n"; // end of row
}
return;
}
Expand Down
Loading