mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixed bug in calculation of gravity contribution to boundary flux in the darcyfluxmodule
There was a sign mistake and a missing division by cell size.
This commit is contained in:
parent
a0be8f8ed4
commit
4dedbeee19
@ -373,7 +373,7 @@ protected:
|
|||||||
// the distance between the face center and the center of the control volume
|
// the distance between the face center and the center of the control volume
|
||||||
DimVector distVecIn(posIn);
|
DimVector distVecIn(posIn);
|
||||||
distVecIn -= posFace;
|
distVecIn -= posFace;
|
||||||
Scalar absDist = distVecIn.two_norm();
|
Scalar absDistSquared = distVecIn.two_norm2();
|
||||||
Scalar gTimesDist = gIn*distVecIn;
|
Scalar gTimesDist = gIn*distVecIn;
|
||||||
|
|
||||||
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
||||||
@ -385,15 +385,13 @@ protected:
|
|||||||
Evaluation pStatIn = - gTimesDist*rhoIn;
|
Evaluation pStatIn = - gTimesDist*rhoIn;
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(pStatIn);
|
Opm::Valgrind::CheckDefined(pStatIn);
|
||||||
|
// compute the hydrostatic gradient between the control volume and face integration
|
||||||
// compute the hydrostatic gradient between the two control volumes (this
|
// point (this gradient exhibitis the same direction as the vector between the
|
||||||
// gradient exhibitis the same direction as the vector between the two
|
// control volume center and face integration point (-distVecIn / absDist) and the
|
||||||
// control volume centers and the length (pStaticExterior -
|
// length: -pStaticInterior) / absDist. Note that the two negatives become + and the
|
||||||
// pStaticInterior)/distanceInteriorToExterior. Note that for the
|
// 1 / (absDist * absDist) -> absDistSquared.
|
||||||
// boundary, 'pStaticExterior' is zero as the boundary pressure is
|
|
||||||
// defined on boundary face's integration point...
|
|
||||||
EvalDimVector f(distVecIn);
|
EvalDimVector f(distVecIn);
|
||||||
f *= - pStatIn/absDist;
|
f *= pStatIn / absDistSquared;
|
||||||
|
|
||||||
// calculate the final potential gradient
|
// calculate the final potential gradient
|
||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
||||||
|
Loading…
Reference in New Issue
Block a user