Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setFreeSlip(self):
"""
sets free slip conditions at the boundary
"""
self.reset()
self.BC_type = 'FreeSlip'
self.p_advective = constantBC(0.)
self.u_advective = constantBC(0.)
self.v_advective = constantBC(0.)
self.w_advective = constantBC(0.)
self.vof_advective = constantBC(0.)
self.k_dirichlet = constantBC(0.)
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
self.dissipation_diffusive = constantBC(0.)
def setFreeSlip(self):
"""
sets free slip conditions at the boundary
"""
self.reset()
self.BC_type = 'FreeSlip'
self.p_advective = constantBC(0.)
self.u_advective = constantBC(0.)
self.v_advective = constantBC(0.)
self.w_advective = constantBC(0.)
self.vof_advective = constantBC(0.)
self.k_dirichlet = constantBC(0.)
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
self.dissipation_diffusive = constantBC(0.)
def setTank(self):
b_or = self._b_or[self._b_i]
if b_or[0] == 1 or b_or[0] == -1:
self.hx_dirichlet = constantBC(0.)
self.u_stress = None
elif b_or[1] == 1 or b_or[1] == -1:
self.hy_dirichlet = constantBC(0.)
self.v_stress = None
elif len(b_or) > 2 and (b_or[2] == 1 or b_or[2] == -1):
self.hz_dirichlet = constantBC(0.)
self.w_stress = None
a0 = pRef - rho*g[vert_axis]*refLevel
a1 = rho*g[vert_axis]
# This is the normal velocity, based on the boundary orientation
def get_outlet_ux_dirichlet(i):
def ux_dirichlet(x, t):
b_or = self._b_or[self._b_i]
if b_or[i] == 0:
return 0.
return ux_dirichlet
self.u_dirichlet = get_outlet_ux_dirichlet(0)
self.v_dirichlet = get_outlet_ux_dirichlet(1)
if len(g) == 3:
self.w_dirichlet = get_outlet_ux_dirichlet(2)
self.p_dirichlet = linearBC(a0, a1, vert_axis)
self.vof_dirichlet = constantBC(vof)
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
return constantBC(0.)
if orientation is None and self._b_or[self._b_i] is not None:
b_or = self._b_or[self._b_i]
elif orientation is not None:
b_or = orientation
else:
print('Boundary orientation needs to be defined')
self.reset()
self.p_dirichlet = constantBC(0.)
self.u_dirichlet = get_ux_dirichlet(0)
self.v_dirichlet = get_ux_dirichlet(1)
if len(b_or) > 2:
self.w_dirichlet = get_ux_dirichlet(2)
self.vof_dirichlet = constantBC(1.) # air
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
self.k_diffusive = constantBC(0.)
self.dissipation_diffusive = constantBC(0.)
def setFreeSlip(self):
"""
sets free slip conditions at the boundary
"""
self.reset()
self.BC_type = 'FreeSlip'
self.p_advective = constantBC(0.)
self.u_advective = constantBC(0.)
self.v_advective = constantBC(0.)
self.w_advective = constantBC(0.)
self.vof_advective = constantBC(0.)
self.k_dirichlet = constantBC(0.)
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
self.dissipation_diffusive = constantBC(0.)
def setFreeSlip(self):
"""
sets free slip conditions at the boundary
"""
self.reset()
self.BC_type = 'FreeSlip'
self.p_advective = constantBC(0.)
self.u_advective = constantBC(0.)
self.v_advective = constantBC(0.)
self.w_advective = constantBC(0.)
self.vof_advective = constantBC(0.)
self.k_dirichlet = constantBC(0.)
self.u_diffusive = constantBC(0.)
self.v_diffusive = constantBC(0.)
self.w_diffusive = constantBC(0.)
self.dissipation_diffusive = constantBC(0.)
def get_ux_dirichlet(i):
if b_or[i] == 1. or b_or[i] == -1.:
return None
else:
return constantBC(0.)
def setFixedNodes(self):
"""
For moving domains: fixes nodes/boundary
"""
self.hx_dirichlet = constantBC(0.)
self.hy_dirichlet = constantBC(0.)
self.hz_dirichlet = constantBC(0.)
self.u_stress = None
self.v_stress = None
self.w_stress = None