FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0074 — SeineOperation::CalcOutput tests Phase_SetFirstLeg twice when zeroing the net speeds
ID 0074
Class BUG
Severity 1
Status blocked
Models Seine/Operation
Found 2026-09-26, OpenWiki pass
Decision needed Which phases should report zero net speed: Phase_NotSet and Phase_SetFirstLeg (the net not yet in the water), or Phase_SetFirstLeg and Phase_SetNet?

Evidence

src/seine/SeineOperation.cpp:290:

if (m_EPhase == Phase_SetFirstLeg || m_EPhase == Phase_SetFirstLeg) {
m_netTangentialSpeed = 0;
m_netNormalSpeed = 0;
} else { ... project NetVel on the wing-to-wing normal and tangent ... }

Both operands are the same, so the condition is just m_EPhase == Phase_SetFirstLeg. The line is unchanged since the initial post-split commit (da4111b, CSeineOperation.cpp:268), so history does not say which phase was meant. The phases are, in order, Phase_NotSet, Phase_SetFirstLeg, Phase_SetNet, Phase_SetSecondLeg, Phase_Towing, Phase_Hauling, Phase_Finished (SeineOperation.h:136-145). The net is paid out from Phase_SetNet on; before that, in Phase_NotSet (the first 10 s, SeineOperation.cpp:84-85) and Phase_SetFirstLeg, the net speeds have no operational meaning. The most likely intent is therefore Phase_NotSet || Phase_SetFirstLeg; Phase_SetNet is the other adjacent candidate. This is an inference from the phase order, not something the code states.

m_netNormalSpeed and m_netTangentialSpeed are only written to the output file (SeineOperation.cpp:327-328) and the HUD (SeineOperation.cpp:486-487); no outport or force reads them.

Effect

During Phase_NotSet the log file and the HUD show the projected net speeds instead of zero. No simulated state is affected.

Possible fix

Replace the second operand with the phase the owner names.

Test that would prove it

Run a seine case with Fileoutput = "1" and assert that the net speed columns are 0 for every row in the phases chosen, and non-zero once the net is set.

Risk

Low: output-only values. Any baseline that includes the log file would change in the first 10 s.