Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
lbmpy
Commits
07be81fe
Commit
07be81fe
authored
Nov 16, 2022
by
Helen Schottenhamml
Browse files
Merge branch 'OutFlowBC' into 'master'
Sanity checks for normal directions See merge request
!137
parents
ed6cae82
f927a48f
Pipeline
#48074
passed with stages
in 105 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/boundaries/boundaryconditions.py
View file @
07be81fe
...
...
@@ -140,7 +140,10 @@ class FreeSlip(LbBoundary):
"the normal direction is not defined for this class"
)
if
normal_direction
:
self
.
mirror_axis
=
normal_direction
.
index
(
*
[
dir
for
dir
in
normal_direction
if
dir
!=
0
])
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
normal_direction
]),
\
"Only -1, 0 and 1 allowed for defining the normal direction"
self
.
mirror_axis
=
normal_direction
.
index
(
*
[
d
for
d
in
normal_direction
if
d
!=
0
])
self
.
normal_direction
=
normal_direction
self
.
dim
=
len
(
stencil
[
0
])
...
...
@@ -369,7 +372,9 @@ class SimpleExtrapolationOutflow(LbBoundary):
if
name
is
None
:
name
=
f
"Simple Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
self
.
normal_direction
=
normal_direction
self
.
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
self
.
normal_direction
]),
\
"Only -1, 0 and 1 allowed for defining the normal direction"
super
(
SimpleExtrapolationOutflow
,
self
).
__init__
(
name
)
def
get_additional_code_nodes
(
self
,
lb_method
):
...
...
@@ -436,7 +441,9 @@ class ExtrapolationOutflow(LbBoundary):
if
name
is
None
:
name
=
f
"Outflow:
{
offset_to_direction_string
(
normal_direction
)
}
"
self
.
normal_direction
=
normal_direction
self
.
normal_direction
=
tuple
([
int
(
n
)
for
n
in
normal_direction
])
assert
all
([
n
in
[
-
1
,
0
,
1
]
for
n
in
self
.
normal_direction
]),
\
"Only -1, 0 and 1 allowed for defining the normal direction"
self
.
streaming_pattern
=
streaming_pattern
self
.
zeroth_timestep
=
zeroth_timestep
self
.
dx
=
sp
.
Number
(
dx
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment