Repository navigation
Conversation
The velocity head was multiplied by a sign that depended on the flow direction, so an injector got the opposite pressure change to a producer. Momentum flux is even in velocity: p + rho v^2 is conserved along a pipe in either direction, so the closed end of a segment sits rho v^2 above its outlet for both. Friction keeps its sign, since it opposes the flow. The flip came with e9d040a, whose message asks whether it is correct and says the reference simulator seems to do this. That comparison is not recorded and has not been repeated here, so injecting MSW wells using HFA may now differ from the reference. tests/msw_acceleration.DATA has an injector and a producer with identical horizontal pipes at 10000 sm3/d, where acceleration dominates. Pressure change along the segments against the momentum balance, bar (closed-end pair): injector producer before fix -0.555 vs +0.525 +0.555 vs +0.555 after fix +0.531 vs +0.531 +0.555 vs +0.555 Results change for wells using HFA, the WELSEGS default, with flow towards the toe in a segment: injectors, and producers with reversed segment flow. In opm-tests, with the flags the tests use (--enable-tuning=true), WINJMULT_MSW (final FOPT +0.02 %, injector BHP up to 0.7 % against 0.08 % from halving the time step) and WINJDAM_MSW (FOPT +0.06 %) need new reference data. MSW-2D-VERT-02, an HFA producer, keeps its summary output within tolerance but two XGRP entries exceed it, so it may need an update too. SPE1CASE2_MSW uses H-- and is identical. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Jenkins build this please |
| if abs(measured - expected) > TOLERANCE: | ||
| failed = True | ||
| # Keeps the check sensitive to the acceleration term. | ||
| if seg != 2 and abs(flux) < 10 * abs(friction): |
There was a problem hiding this comment.
A shut well has zero flux, friction and pressure differences, so every balance holds, and this check passes too because 0 < 0 is false. Since Flow can shut a well it cannot solve and still finish successfully, the test can pass without checking either flow direction. Checking that both wells deliver their target rate, e.g. SWFR of segment 2 at 10000 sm3/d, would close that.
There was a problem hiding this comment.
It does not say that the PR uses SHUT wells, but the script will have problems if the script is used for SHUT wells.
|
e9d040a also removed the 1/2 factor, which needs a reference results to justify. |
|
From what I can understand, the PR is correct. However, I would like to invite @totto82 to have a look, both the sign issue and also the 0.5 factor issue. Maybe some reference results need to be checked. |
|
This was 6 years ago, so my memory is a bit blurred. I don't even remember which case I was working on at that time. I think removing 2 was correct, but the suggested sign change might be wrong. I will do some more testing and digging and report back. |
Velocity changes along a segment because fluid crosses the wall, so the momentum balance depends on the axial speed u of that fluid: A dp = -m dv - (v - u) dm Fluid leaving already moves with the pipe (u = v), so p + rho v^2 / 2 is conserved. Fluid entering has none (u = 0) and is accelerated by mixing, so p + rho v^2 is conserved. The previous commit used the second form in both directions, which raises the injector's total pressure along the flow. Use a coefficient of 1/2 at a perforated segment with net outflow through the wall and where flow divides into several inlets, with the inlet heads entering as their flow-weighted mean. Everything else keeps coefficient 1, which is also exact when only the density changes along a pipe. tests/msw_acceleration.DATA gains an injector and a producer that branch. From segment 1 to the closed end the injector's p + rho v^2 / 2 changes by -0.121 bar, equal to the reported friction. The check now also requires each well to deliver its target rate, since a shut well satisfies every balance. No reference run has been compared. In opm-tests, with the flags the tests use, WINJMULT_MSW (final FOPT +0.011 %) and WINJDAM_MSW (+0.042 %) change, as do MSW_MODEL_1, FAULTS_MODEL_1 and MSW_MODEL_1_SHORT, whose producers have perforated segments with net outflow (FOPT at most 1.4e-3), so they need new reference data. MSW-2D-VERT-02 and MSW-3D-TWO-PRODUCERS differ only in a few restart entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A producer segment that loses fluid through the wall takes coefficient 1/2, but no test well covered it. PRODX has two isolated cells with a pressure contrast, so segment 3 loses about 3900 sm3/d to the low-pressure cell. Master and the sign change alone give -1.97 bar there against -0.96 from the balance. The numbers of the other wells do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The velocity head was multiplied by a sign that depended on the flow direction, so an injector got the opposite pressure change to a producer. Momentum flux is even in velocity: p + rho v^2 is conserved along a pipe in either direction, so the closed end of a segment sits rho v^2 above its outlet for both. Friction keeps its sign, since it opposes the flow.
The flip came with e9d040a, whose message asks whether it is correct and says the reference simulator seems to do this. That comparison is not recorded and has not been repeated here, so injecting MSW wells using HFA may now differ from the reference.
tests/msw_acceleration.DATA has an injector and a producer with identical horizontal pipes at 10000 sm3/d, where acceleration dominates. Pressure change along the segments against the momentum balance, bar (closed-end pair):
injector producer
before fix -0.555 vs +0.525 +0.555 vs +0.555
after fix +0.531 vs +0.531 +0.555 vs +0.555
Results change for wells using HFA, the WELSEGS default, with flow towards the toe in a segment: injectors, and producers with reversed segment flow. In opm-tests, with the flags the tests use (--enable-tuning=true), WINJMULT_MSW (final FOPT +0.02 %, injector BHP up to 0.7 % against 0.08 % from halving the time step) and WINJDAM_MSW (FOPT +0.06 %) need new reference data. MSW-2D-VERT-02, an HFA producer, keeps its summary output within tolerance but two XGRP entries exceed it, so it may need an update too. SPE1CASE2_MSW uses H-- and is identical.