.. _navier_stokes-stokes_slip_bc: navier_stokes/stokes_slip_bc.py =============================== **Description** Incompressible Stokes flow with Navier (slip) boundary conditions, flow driven by a moving wall and a small diffusion for stabilization. This example demonstrates the use of `no-penetration` boundary conditions as well as `edge direction` boundary conditions together with Navier or slip boundary conditions. Find :math:`\ul{u}`, :math:`p` such that: .. math:: \int_{\Omega} \nu\ \nabla \ul{v} : \nabla \ul{u} - \int_{\Omega} p\ \nabla \cdot \ul{v} + \int_{\Gamma_1} \beta \ul{v} \cdot (\ul{u} - \ul{u}_d) + \int_{\Gamma_2} \beta \ul{v} \cdot \ul{u} = 0 \;, \quad \forall \ul{v} \;, \int_{\Omega} \mu \nabla q \cdot \nabla p + \int_{\Omega} q\ \nabla \cdot \ul{u} = 0 \;, \quad \forall q \;, where :math:`\nu` is the fluid viscosity, :math:`\beta` is the slip coefficient, :math:`\mu` is the (small) numerical diffusion coefficient, :math:`\Gamma_1` is the top wall that moves with the given driving velocity :math:`\ul{u}_d` and :math:`\Gamma_2` are the remaining walls. The Navier conditions are in effect on both :math:`\Gamma_1`, :math:`\Gamma_2` and are expressed by the corresponding integrals in the equations above. The `no-penetration` boundary conditions are applied on :math:`\Gamma_1`, :math:`\Gamma_2`, except the vertices of the block edges, where the `edge direction` boundary conditions are applied. Optionally, Dirichlet boundary conditions can be applied on the inlet, see the code below. The mesh is created by ``gen_block_mesh()`` function - try different mesh dimensions and resolutions below. For large meshes use the ``'ls_i'`` linear solver - PETSc + petsc4py is needed in that case. See also :ref:`navier_stokes-stokes_slip_bc_penalty`. .. image:: /../gallery/images/navier_stokes-stokes_slip_bc.png :download:`source code ` .. literalinclude:: /../examples/navier_stokes/stokes_slip_bc.py