Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Markus Holzer
lbmpy
Commits
b40aeaf1
Commit
b40aeaf1
authored
3 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Implemented different weights
parent
29f8f286
No related branches found
No related tags found
No related merge requests found
Pipeline
#35279
passed
3 years ago
Stage: pretest
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lbmpy/maxwellian_equilibrium.py
+2
-2
2 additions, 2 deletions
lbmpy/maxwellian_equilibrium.py
lbmpy_tests/test_weights.py
+1
-8
1 addition, 8 deletions
lbmpy_tests/test_weights.py
with
3 additions
and
10 deletions
lbmpy/maxwellian_equilibrium.py
+
2
−
2
View file @
b40aeaf1
...
@@ -32,8 +32,8 @@ get_weights.weights = {
...
@@ -32,8 +32,8 @@ get_weights.weights = {
2
:
sp
.
Rational
(
1
,
36
),
2
:
sp
.
Rational
(
1
,
36
),
},
},
7
:
{
7
:
{
0
:
sp
.
Rational
(
1
,
4
),
0
:
sp
.
simplify
(
0.0
),
1
:
sp
.
Rational
(
1
,
8
),
1
:
sp
.
Rational
(
1
,
6
),
},
},
15
:
{
15
:
{
0
:
sp
.
Rational
(
2
,
9
),
0
:
sp
.
Rational
(
2
,
9
),
...
...
This diff is collapsed.
Click to expand it.
lbmpy_tests/test_weights.py
+
1
−
8
View file @
b40aeaf1
...
@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights
...
@@ -5,10 +5,6 @@ from lbmpy.maxwellian_equilibrium import get_weights
from
lbmpy.stencils
import
LBStencil
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
):
def
compare_weights
(
method
,
maxwellian_moments
,
stencil_name
):
stencil
=
LBStencil
(
stencil_name
)
stencil
=
LBStencil
(
stencil_name
)
hardcoded_weights
=
get_weights
(
stencil
)
hardcoded_weights
=
get_weights
(
stencil
)
...
@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name):
...
@@ -17,10 +13,7 @@ def compare_weights(method, maxwellian_moments, stencil_name):
weights
=
method
.
weights
weights
=
method
.
weights
for
i
in
range
(
len
(
weights
)):
for
i
in
range
(
len
(
weights
)):
if
stencil_name
==
Stencil
.
D3Q7
and
maxwellian_moments
is
True
:
assert
hardcoded_weights
[
i
]
==
weights
[
i
]
assert
hardcoded_weights
[
i
]
!=
weights
[
i
]
else
:
assert
hardcoded_weights
[
i
]
==
weights
[
i
]
@pytest.mark.parametrize
(
'
method
'
,
[
Method
.
SRT
,
Method
.
TRT
])
@pytest.mark.parametrize
(
'
method
'
,
[
Method
.
SRT
,
Method
.
TRT
])
...
...
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