Commit 4d131457 authored by Markus Holzer's avatar Markus Holzer
Browse files

Added hydro pressure as option

parent 13df23c8
Pipeline #37056 failed with stages
in 34 minutes and 45 seconds
......@@ -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):
Returns an assignment list for initializing the velocity distribution functions
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"):})
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()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment