Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Holzer
lbmpy
Commits
b40aeaf1
Commit
b40aeaf1
authored
Nov 02, 2021
by
Markus Holzer
Browse files
Implemented different weights
parent
29f8f286
Pipeline
#35279
passed with stages
in 38 minutes and 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/maxwellian_equilibrium.py
View file @
b40aeaf1
...
...
@@ -32,8 +32,8 @@ get_weights.weights = {
2
:
sp
.
Rational
(
1
,
36
),
},
7
:
{
0
:
sp
.
Rational
(
1
,
4
),
1
:
sp
.
Rational
(
1
,
8
),
0
:
sp
.
simplify
(
0.0
),
1
:
sp
.
Rational
(
1
,
6
),
},
15
:
{
0
:
sp
.
Rational
(
2
,
9
),
...
...
lbmpy_tests/test_weights.py
View file @
b40aeaf1
...
...
@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights
from
lbmpy.stencils
import
LBStencil
# if the equilibrium for the methods with D3Q7 stencil is derived from the continuous Maxwell Boltzmann equation, we do
# not get the same lattice weights as found in the literature. It is a question weather this is problematic or not.
# Especially, that w_0 is zero is very unusual. However, still the method can be used successfully for thermal
# flow problems as shown in tutorial 7. Thus it might even be correct.
def
compare_weights
(
method
,
maxwellian_moments
,
stencil_name
):
stencil
=
LBStencil
(
stencil_name
)
hardcoded_weights
=
get_weights
(
stencil
)
...
...
@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name):
weights
=
method
.
weights
for
i
in
range
(
len
(
weights
)):
if
stencil_name
==
Stencil
.
D3Q7
and
maxwellian_moments
is
True
:
assert
hardcoded_weights
[
i
]
!=
weights
[
i
]
else
:
assert
hardcoded_weights
[
i
]
==
weights
[
i
]
assert
hardcoded_weights
[
i
]
==
weights
[
i
]
@
pytest
.
mark
.
parametrize
(
'method'
,
[
Method
.
SRT
,
Method
.
TRT
])
...
...
Write
Preview
Markdown
is supported
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