This page provides several examples of code blocks that may be used to define boundary conditions in cs_user_boundary_conditions.
Here is the list of examples dedicated to different physics: