Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 fluid inertia force at each node
- a – tangential fluid inertia force at each node
- 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
2 changes: 1 addition & 1 deletion source/Misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ enum QTypeEnum : int
MZ = 25,
Sub = 26,
TenA = 27,
TenB = 28
TenB = 28,
};

// The following are some definitions for use with the output options in
Expand Down
17 changes: 11 additions & 6 deletions source/MoorDyn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ 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
"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
};

std::atomic<size_t> __systems_counter(0);
Expand Down
145 changes: 137 additions & 8 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>

#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 tangential fluid inertia force
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 fluid inertia force
if (channels.find("A") != string::npos) {
for (unsigned int i = 0; i <= 3 * N + 2; i++)
*outfile << "(N) \t";
}
// output tangential 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 @@ -988,12 +1077,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 +1521,48 @@ Rod::Output(real time)
*outfile << Fnet[i][J] << "\t ";
}
}

*outfile << "\n";
// 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 ";
// output buoyancy forces
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 ";
// output tangential drag forces
if (channels.find("Y") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Dq[i][J] << "\t ";
// output transverse drag forces
if (channels.find("X") != string::npos)
for (unsigned int i = 0; i <= N; i++)
for (unsigned int J = 0; J < 3; J++)
*outfile << Dp[i][J] << "\t ";
// output transverse fluid inertia forces
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 ";
// output tangential fluid inertia forces
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 ";
// output dynamic pressure forces
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 ";
// output seabed bottom contact forces
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