Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (1)
......@@ -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)
......