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
ce317615
Commit
ce317615
authored
Jun 20, 2022
by
Markus Holzer
Browse files
Use Pull scheme now
parent
349bf1bc
Pipeline
#40894
passed with stages
in 106 minutes and 9 seconds
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
doc/notebooks/10_tutorial_conservative_allen_cahn_two_phase.ipynb
View file @
ce317615
This diff is collapsed.
Click to expand it.
lbmpy/phasefield_allen_cahn/kernel_equations.py
View file @
ce317615
...
...
@@ -2,6 +2,7 @@ from pystencils.fd.derivation import FiniteDifferenceStencilDerivation
from
pystencils
import
Assignment
,
AssignmentCollection
,
Field
from
lbmpy
import
pdf_initialization_assignments
from
lbmpy.fieldaccess
import
StreamPullTwoFieldsAccessor
as
accessor
from
lbmpy.methods.abstractlbmethod
import
LbmCollisionRule
from
lbmpy.utils
import
second_order_moment_tensor
from
lbmpy.phasefield_allen_cahn.parameter_calculation
import
AllenCahnParameters
...
...
@@ -154,7 +155,8 @@ def viscous_force(lb_velocity_field, phi_field, lb_method, tau, density_heavy, d
iso_grad
=
sp
.
Matrix
(
isotropic_gradient_symbolic
(
phi_field
,
fd_stencil
)[:
stencil
.
D
])
f_neq
=
lb_velocity_field
.
center_vector
-
lb_method
.
get_equilibrium_terms
()
reads
=
accessor
.
read
(
lb_velocity_field
,
stencil
)
f_neq
=
sp
.
Matrix
(
reads
)
-
lb_method
.
get_equilibrium_terms
()
stress_tensor
=
second_order_moment_tensor
(
f_neq
,
lb_method
.
stencil
)
normal_stress_tensor
=
stress_tensor
*
iso_grad
...
...
@@ -285,7 +287,8 @@ def hydrodynamic_force_assignments(lb_velocity_field, velocity_field, phi_field,
cqc
=
lb_method
.
conserved_quantity_computation
u_symp
=
cqc
.
velocity_symbols
cqe
=
cqc
.
equilibrium_input_equations_from_pdfs
(
lb_velocity_field
.
center_vector
)
reads
=
accessor
.
read
(
lb_velocity_field
,
stencil
)
cqe
=
cqc
.
equilibrium_input_equations_from_pdfs
(
reads
)
cqe
=
cqe
.
new_without_subexpressions
()
cqe_velocity
=
[
eq
.
rhs
for
eq
in
cqe
.
main_assignments
[
1
:]]
...
...
@@ -355,7 +358,8 @@ def add_hydrodynamic_force(update_rule: LbmCollisionRule, force, phi_field,
update_rule
=
update_rule
.
subs
(
force_subs
)
update_rule
.
subexpressions
+=
[
Assignment
(
rho
,
sum
(
hydro_pdfs
.
center_vector
))]
reads
=
accessor
.
read
(
hydro_pdfs
,
method
.
stencil
)
update_rule
.
subexpressions
+=
[
Assignment
(
rho
,
sum
(
reads
))]
update_rule
.
subexpressions
+=
force
update_rule
.
topological_sort
(
sort_subexpressions
=
True
,
sort_main_assignments
=
False
)
...
...
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