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
4d131457
Commit
4d131457
authored
Jan 25, 2022
by
Markus Holzer
Browse files
Added hydro pressure as option
parent
13df23c8
Pipeline
#37056
failed with stages
in 34 minutes and 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/phasefield_allen_cahn/kernel_equations.py
View file @
4d131457
...
...
@@ -530,20 +530,24 @@ def initializer_kernel_phase_field_lb(lb_phase_field, phi_field, velocity_field,
return
h_updates
def
initializer_kernel_hydro_lb
(
lb_velocity_field
,
velocity_field
,
mrt_method
):
def
initializer_kernel_hydro_lb
(
lb_velocity_field
,
velocity_field
,
mrt_method
,
density_field
=
None
):
r
"""
Returns an assignment list for initializing the velocity distribution functions
Args:
lb_velocity_field: source field of velocity distribution function
velocity_field: velocity field
mrt_method: lattice Boltzmann method of the hydrodynamic lattice Boltzmann step
density_field: for example to prescribe the hydrodynamic pressure at initialisation
"""
stencil
=
mrt_method
.
stencil
weights
=
get_weights
(
stencil
,
c_s_sq
=
sp
.
Rational
(
1
,
3
))
u_symp
=
sp
.
symbols
(
f
"u_:
{
stencil
.
D
}
"
)
gamma
=
mrt_method
.
get_equilibrium_terms
()
gamma
=
gamma
.
subs
({
sp
.
symbols
(
"rho"
):
1
})
if
density_field
:
gamma
=
gamma
.
subs
({
sp
.
symbols
(
"rho"
):
density_field
.
center
})
else
:
gamma
=
gamma
.
subs
({
sp
.
symbols
(
"rho"
):
1
})
gamma_init
=
gamma
.
subs
({
x
:
y
for
x
,
y
in
zip
(
u_symp
,
velocity_field
.
center_vector
)})
g_updates
=
list
()
...
...
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