Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
397c2064
Commit
397c2064
authored
Dec 21, 2017
by
Kilian Weishaupt
Browse files
[staggered][navierstokes] Rename outerNormalScalar() to directionSign()
* can be either -1 or 1, depending on the face's orientation
parent
d6f2abcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh
View file @
397c2064
...
...
@@ -210,7 +210,8 @@ public:
return
normalInPosCoordDir_
;
}
Scalar
outerNormalScalar
()
const
//! Returns the sign of the unit outer normal's vector
Scalar
directionSign
()
const
{
return
outerNormalScalar_
;
}
...
...
dumux/freeflow/navierstokes/staggered/fluxvariables.hh
View file @
397c2064
...
...
@@ -101,7 +101,7 @@ public:
bool
isOutflow
=
false
)
{
const
Scalar
velocity
=
elemFaceVars
[
scvf
].
velocitySelf
();
const
bool
insideIsUpstream
=
s
ign
(
scvf
.
outerNormalScalar
()
)
==
sign
(
velocity
);
const
bool
insideIsUpstream
=
s
cvf
.
directionSign
(
)
==
sign
(
velocity
);
static
const
Scalar
upWindWeight
=
getParamFromGroup
<
Scalar
>
(
GET_PROP_VALUE
(
TypeTag
,
ModelParameterGroup
),
"Implicit.UpwindWeight"
);
const
auto
&
insideVolVars
=
elemVolVars
[
scvf
.
insideScvIdx
()];
...
...
@@ -112,7 +112,7 @@ public:
const
Scalar
flux
=
(
upWindWeight
*
upwindTerm
(
upstreamVolVars
)
+
(
1.0
-
upWindWeight
)
*
upwindTerm
(
downstreamVolVars
))
*
velocity
*
scvf
.
area
()
*
s
ign
(
scvf
.
outerNormalScalar
()
);
*
velocity
*
scvf
.
area
()
*
s
cvf
.
directionSign
(
);
return
flux
;
}
...
...
@@ -216,7 +216,7 @@ public:
{
// advective part
const
Scalar
vAvg
=
(
velocitySelf
+
velocityOpposite
)
*
0.5
;
const
Scalar
vUp
=
(
s
ign
(
scvf
.
outerNormalScalar
()
)
==
sign
(
vAvg
))
?
velocityOpposite
:
velocitySelf
;
const
Scalar
vUp
=
(
s
cvf
.
directionSign
(
)
==
sign
(
vAvg
))
?
velocityOpposite
:
velocitySelf
;
normalFlux
+=
vAvg
*
vUp
*
insideVolVars
.
density
();
}
...
...
@@ -229,17 +229,17 @@ public:
normalFlux
-=
insideVolVars
.
viscosity
()
*
2.0
*
deltaV
/
deltaX
;
// account for the orientation of the face
const
Scalar
sgn
=
-
1.0
*
s
ign
(
scvf
.
outerNormalScalar
()
);
const
Scalar
sgn
=
-
1.0
*
s
cvf
.
directionSign
(
);
Scalar
result
=
normalFlux
*
sgn
*
scvf
.
area
();
// treat outflow conditions
if
(
navierStokes
&&
scvf
.
boundary
())
{
const
auto
&
upVolVars
=
(
s
ign
(
scvf
.
outerNormalScalar
()
)
==
sign
(
velocitySelf
))
?
const
auto
&
upVolVars
=
(
s
cvf
.
directionSign
(
)
==
sign
(
velocitySelf
))
?
elemVolVars
[
insideScvIdx
]
:
elemVolVars
[
scvf
.
outsideScvIdx
()]
;
result
+=
velocitySelf
*
velocitySelf
*
upVolVars
.
density
()
*
s
ign
(
scvf
.
outerNormalScalar
()
)
*
scvf
.
area
()
;
result
+=
velocitySelf
*
velocitySelf
*
upVolVars
.
density
()
*
s
cvf
.
directionSign
(
)
*
scvf
.
area
()
;
}
return
result
;
}
...
...
@@ -302,7 +302,7 @@ private:
const
auto
insideScvIdx
=
normalFace
.
insideScvIdx
();
const
auto
outsideScvIdx
=
normalFace
.
outsideScvIdx
();
const
bool
innerElementIsUpstream
=
(
sign
(
normalFace
.
outerNormalScalar
()
)
==
sign
(
transportingVelocity
)
);
const
bool
innerElementIsUpstream
=
(
normalFace
.
directionSign
(
)
==
sign
(
transportingVelocity
)
);
const
auto
&
upVolVars
=
innerElementIsUpstream
?
elemVolVars
[
insideScvIdx
]
:
elemVolVars
[
outsideScvIdx
];
...
...
@@ -311,9 +311,8 @@ private:
faceVars
.
velocityParallel
(
localSubFaceIdx
);
const
Scalar
momentum
=
upVolVars
.
density
()
*
transportedVelocity
;
const
int
sgn
=
sign
(
normalFace
.
outerNormalScalar
());
return
transportingVelocity
*
momentum
*
sgn
*
normalFace
.
area
()
*
0.5
;
return
transportingVelocity
*
momentum
*
normalFace
.
directionSign
()
*
normalFace
.
area
()
*
0.5
;
}
FacePrimaryVariables
computeDiffusivePartOfTangentialMomentumFlux_
(
const
Problem
&
problem
,
...
...
@@ -358,8 +357,7 @@ private:
const
Scalar
parallelDerivative
=
parallelDeltaV
/
scvf
.
pairData
(
localSubFaceIdx
).
parallelDistance
;
tangentialDiffusiveFlux
-=
muAvg
*
parallelDerivative
;
const
Scalar
sgn
=
sign
(
normalFace
.
outerNormalScalar
());
return
tangentialDiffusiveFlux
*
sgn
*
normalFace
.
area
()
*
0.5
;
return
tangentialDiffusiveFlux
*
normalFace
.
directionSign
()
*
normalFace
.
area
()
*
0.5
;
}
};
...
...
dumux/freeflow/navierstokes/staggered/localresidual.hh
View file @
397c2064
...
...
@@ -373,13 +373,13 @@ private:
const
Scalar
deltaP
=
normalizePressure
?
problem
.
initialAtPos
(
scvf
.
center
())[
pressureIdx
]
:
0.0
;
Scalar
result
=
(
insideVolVars
.
pressure
()
-
deltaP
)
*
scvf
.
area
()
*
-
1.0
*
s
ign
(
scvf
.
outerNormalScalar
()
);
Scalar
result
=
(
insideVolVars
.
pressure
()
-
deltaP
)
*
scvf
.
area
()
*
-
1.0
*
s
cvf
.
directionSign
(
);
// treat outflow BCs
if
(
scvf
.
boundary
())
{
const
Scalar
pressure
=
problem
.
dirichlet
(
element
,
scvf
)[
pressureIdx
]
-
deltaP
;
result
+=
pressure
*
scvf
.
area
()
*
s
ign
(
scvf
.
outerNormalScalar
()
);
result
+=
pressure
*
scvf
.
area
()
*
s
cvf
.
directionSign
(
);
}
return
result
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment