Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
9337720b
Commit
9337720b
authored
1 year ago
by
Martin Schneider
Committed by
Timo Koch
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[ff][ns] Implement class for slip conditions
parent
3a9d1d51
No related branches found
No related tags found
1 merge request
!3762
Generalize Slip Condition
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/freeflow/navierstokes/slipcondition.hh
+93
-0
93 additions, 0 deletions
dumux/freeflow/navierstokes/slipcondition.hh
with
93 additions
and
0 deletions
dumux/freeflow/navierstokes/slipcondition.hh
0 → 100644
+
93
−
0
View file @
9337720b
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
//
// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
// SPDX-License-Identifier: GPL-3.0-or-later
//
/*!
* \file
* \ingroup NavierStokesModel
* \brief Navier Stokes slip condition
*/
#ifndef DUMUX_NAVIERSTOKES_SLIPCONDITION_HH
#define DUMUX_NAVIERSTOKES_SLIPCONDITION_HH
#include
<dumux/discretization/method.hh>
namespace
Dumux
{
namespace
SlipConditions
{
struct
BJ
:
public
Utility
::
Tag
<
BJ
>
{
static
std
::
string
name
()
{
return
"Beavers-Joseph"
;
}
};
inline
constexpr
BJ
bj
{};
}
// end namespace SlipModel
template
<
class
GridGeometry
,
class
SlipCondition
>
class
SlipVelocityHelper
;
/*!
* \ingroup NavierStokesModel
* \brief Navier Stokes slip velocity helper
*/
template
<
class
GridGeometry
>
class
SlipVelocityHelper
<
GridGeometry
,
SlipConditions
::
BJ
>
{
using
GridView
=
typename
GridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVElementGeometry
=
typename
GridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
using
Scalar
=
typename
GridView
::
ctype
;
using
Vector
=
Dune
::
FieldVector
<
Scalar
,
dimWorld
>
;
public:
template
<
class
Problem
,
class
ElementVolumeVariables
>
static
Vector
velocity
(
const
Problem
&
problem
,
const
FVElementGeometry
&
fvGeometry
,
const
SubControlVolumeFace
&
scvf
,
const
ElementVolumeVariables
&
elemVolVars
,
Scalar
tangentialVelocityGradient
)
{
if
constexpr
(
GridGeometry
::
discMethod
==
DiscretizationMethods
::
fcstaggered
)
{
assert
(
scvf
.
isLateral
());
assert
(
scvf
.
boundary
());
const
auto
&
scv
=
fvGeometry
.
scv
(
scvf
.
insideScvIdx
());
// create a unit normal vector oriented in positive coordinate direction
Vector
tangent
(
0.0
);
tangent
[
scv
.
dofAxis
()]
=
1.0
;
// du/dy + dv/dx = beta * (u_boundary-uPM)
// beta = alpha/sqrt(K)
const
Scalar
betaBJ
=
problem
.
betaBJ
(
fvGeometry
,
scvf
,
tangent
);
const
Scalar
distanceNormalToBoundary
=
(
scvf
.
ipGlobal
()
-
scv
.
dofPosition
()).
two_norm
();
static
const
bool
onlyNormalGradient
=
getParamFromGroup
<
bool
>
(
problem
.
paramGroup
(),
"FreeFlow.EnableUnsymmetrizedVelocityGradientForBeaversJoseph"
,
false
);
if
(
onlyNormalGradient
)
tangentialVelocityGradient
=
0.0
;
const
auto
&
porousMediumVelocity
=
problem
.
porousMediumVelocity
(
fvGeometry
,
scvf
);
const
Scalar
scalarSlipVelocity
=
(
tangentialVelocityGradient
*
distanceNormalToBoundary
+
porousMediumVelocity
*
tangent
*
betaBJ
*
distanceNormalToBoundary
+
elemVolVars
[
scv
].
velocity
())
/
(
betaBJ
*
distanceNormalToBoundary
+
1.0
);
return
scalarSlipVelocity
*
tangent
;
}
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"Slip velocity currently only implemented for fcstaggered"
);
}
};
}
// end namespace Dumux
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment