Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
lbmpy
Commits
95834204
Commit
95834204
authored
Sep 26, 2021
by
Markus Holzer
Committed by
Michael Kuron
Sep 26, 2021
Browse files
Fix smagorinsky
parent
d52eb84c
Changes
3
Hide whitespace changes
Inline
Side-by-side
lbmpy/creationfunctions.py
View file @
95834204
...
...
@@ -638,14 +638,14 @@ class LBMConfig:
entropic_newton_iterations
:
int
=
None
omega_output_field
:
Field
=
None
smagorinsky
:
bool
=
False
fluctuating
:
bool
=
False
fluctuating
:
dict
=
False
temperature
:
Any
=
None
output
:
dict
=
field
(
default_factory
=
dict
)
velocity_input
:
Field
=
None
density_input
:
Field
=
None
kernel_type
:
str
=
'default_stream_collide'
kernel_type
:
Union
[
str
,
PdfFieldAccessor
]
=
'default_stream_collide'
streaming_pattern
:
str
=
'pull'
timestep
:
lbmpy
.
advanced_streaming
.
Timestep
=
Timestep
.
BOTH
...
...
lbmpy/turbulence_models.py
View file @
95834204
...
...
@@ -44,8 +44,9 @@ def add_smagorinsky_model(collision_rule, smagorinsky_constant, omega_output_fie
method
=
collision_rule
.
method
omega_s
=
get_shear_relaxation_rate
(
method
)
found_symbolic_shear_relaxation
=
Fals
e
found_symbolic_shear_relaxation
=
Tru
e
if
isinstance
(
omega_s
,
float
)
or
isinstance
(
omega_s
,
int
):
found_symbolic_shear_relaxation
=
False
for
eq
in
collision_rule
.
all_assignments
:
if
eq
.
rhs
==
omega_s
:
found_symbolic_shear_relaxation
=
True
...
...
lbmpy_tests/test_smagorinsky.py
0 → 100644
View file @
95834204
import
sympy
as
sp
from
pystencils.simp.subexpression_insertion
import
insert_constants
from
lbmpy
import
create_lb_collision_rule
,
LBMConfig
,
LBStencil
,
Stencil
,
Method
def
test_smagorinsky_with_constant_omega
():
stencil
=
LBStencil
(
Stencil
.
D2Q9
)
config
=
LBMConfig
(
stencil
=
stencil
,
method
=
Method
.
SRT
,
smagorinsky
=
True
,
relaxation_rate
=
sp
.
Symbol
(
"omega"
))
collision_rule
=
create_lb_collision_rule
(
lbm_config
=
config
)
config
=
LBMConfig
(
stencil
=
stencil
,
method
=
Method
.
SRT
,
smagorinsky
=
True
,
relaxation_rate
=
1.5
)
collision_rule2
=
create_lb_collision_rule
(
lbm_config
=
config
)
collision_rule
=
collision_rule
.
subs
({
sp
.
Symbol
(
"omega"
):
1.5
})
collision_rule
=
insert_constants
(
collision_rule
)
assert
collision_rule
==
collision_rule2
\ No newline at end of file
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