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
fa8a9939
Commit
fa8a9939
authored
Aug 15, 2021
by
Markus Holzer
Browse files
Fix entropic
parent
7847d614
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
lbmpy/methods/momentbased/entropic_eq_srt.py
View file @
fa8a9939
...
...
@@ -27,6 +27,10 @@ class EntropicEquilibriumSRT(AbstractLbMethod):
def
weights
(
self
):
return
self
.
_weights
@
property
def
relaxation_rates
(
self
):
return
tuple
([
self
.
_relaxationRate
for
i
in
range
(
len
(
self
.
stencil
))])
@
property
def
zeroth_order_equilibrium_moment_symbol
(
self
,
):
return
self
.
_cqc
.
zeroth_order_moment_symbol
...
...
@@ -86,4 +90,8 @@ def create_srt_entropic(stencil, relaxation_rate, force_model, compressible):
if
not
compressible
:
raise
NotImplementedError
(
"entropic-srt only implemented for compressible models"
)
density_velocity_computation
=
DensityVelocityComputation
(
stencil
,
compressible
,
force_model
)
return
EntropicEquilibriumSRT
(
stencil
,
relaxation_rate
,
force_model
,
density_velocity_computation
)
lbmpy_tests/phasefield/test_entropic_model.ipynb
View file @
fa8a9939
This diff is collapsed.
Click to expand it.
lbmpy_tests/test_entropic.py
View file @
fa8a9939
...
...
@@ -28,6 +28,16 @@ def test_entropic_methods():
def
test_entropic_srt
():
stencil
=
get_stencil
(
"D2Q9"
)
method
=
create_srt_entropic
(
stencil
,
1.8
,
Guo
((
0
,
1e-6
)),
True
)
relaxation_rate
=
1.8
method
=
create_srt_entropic
(
stencil
,
relaxation_rate
,
Guo
((
0
,
1e-6
)),
True
)
assert
method
.
zeroth_order_equilibrium_moment_symbol
==
sp
.
symbols
(
"rho"
)
assert
method
.
first_order_equilibrium_moment_symbols
==
sp
.
symbols
(
"u_:2"
)
eq
=
method
.
get_equilibrium
()
terms
=
method
.
get_equilibrium_terms
()
rel
=
method
.
relaxation_rates
for
i
in
range
(
len
(
terms
)):
assert
sp
.
simplify
(
eq
.
main_assignments
[
i
].
rhs
-
terms
[
i
])
==
0
assert
rel
[
i
]
==
1.8
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