Boundary Conditions - CFD#
This subsection defines the boundary conditions associated with fluid dynamics physics. Lethe supports the following boundary conditions:
noneboundary condition (default).noslipboundary conditions strongly impose the velocity on a boundary to be \(\mathbf{u}=[0,0]^T\) and \(\mathbf{u}=[0,0,0]^T\) in 2D and 3D respectively.slipboundary conditions impose \(\mathbf{u} \cdot \mathbf{n}=0\), with \(\mathbf{n}\) the normal vector of the boundary. Imposing slip boundary conditions strongly is not trivial in FEM. We refer the reader to the deal.II documentation for explanations on how this is achieved.partial slipboundary condition simulates an intermediary betweenslipandnoslipboundary conditions, in which the fluid feels an attenuated stress due to the walls. The attenuation is controlled by the boundary layer thickness (m). Thepartial slipboundary condition introduces the “penalization factor”betato the \(\mathbf{n}\) normal vector of the boundary, and theboundary layer thickness(m) as a parameter to calculate the shear stress at the boundaries.periodicboundary conditions, in which fluid exiting the domain will reenter on the opposite side.functionwhere a Dirichlet boundary condition is set from an arbitrary function. These functions can be used to define all sorts of steady-state and transient velocity boundary conditions such as rotating walls. It is also possible to weakly impose a Dirichlet boundary condition. In this case, the type should be set tofunction weak. This will result in Nitsche method being used to weakly impose the boundary condition instead of it being strongly imposed by overwriting the values of the degrees of freedom. Thefunction weakboundary type should only be used in very specific cases where the problem is very stiff, for example when it is fully enclosed and a non-trivial velocity profile is imposed. It can also be used to impose an outbound dirichlet boundary condition.outletwhere a do nothing boundary condition (equivalent tonone), which is a zero traction, is imposed when the fluid is leaving the domain (\(\mathbf{u} \cdot \mathbf{n}>0\)) and a penalization is imposed when the fluid is inbound. This is useful when turbulent structures or vortices are leaving the domain since it prevents the re-entry of the fluid. The boundary condition imposed is thus:
or in Einstein notation:
where \(\beta\) is a constant and \((\mathbf{u}\cdot \mathbf{n})_{-}\) is \(\min (0,\mathbf{u}\cdot \mathbf{n})\). We refer the reader to the work of Arndt et al 2015 for more detail.
subsection boundary conditions
set number = 2
set time dependent = false
set fix pressure constant = false
subsection bc 0
set id = 0
set type = function
subsection u
set Function expression = -y
end
subsection v
set Function expression = x
end
subsection w
set Function expression = 0
end
# Center of rotation used for torque calculation
subsection center of rotation
set x = 0
set y = 0
set z = 0
end
set periodic id = 1
set periodic direction = 0
set beta = 1
end
subsection bc 1
set type = noslip
end
end
numberspecifies the number of boundary conditions of the problem. Periodicity between 2 boundaries counts as 1 condition even if it requires two distinct boundary ids.
Warning
The number of boundary conditions must be specified explicitly. This is often a source of error.
Note
The index in subsection bc .. must be coherent with the number of boundary conditions set: if number = 2, bc 0 and bc 1 are created but bc 2 does not exist.
Likewise, if number = 2 and there is no subsection bc 0 explicitly stated, the boundary is still created, with none by default.
time dependentspecifies if a boundary condition is time-dependent (true) or steady (false). By default, this parameter is set tofalse. This is here to improve the computational efficiency for transient cases in which the boundary conditions do not change.fix pressure constantspecifies if a zero pressure constraint should be applied on a single node of the coarse grid solver when using geometric multigrid preconditioning combined with the lethe-fluid-matrix-free solver. Essentially, this condition should be set to true whenever a user is using the lethe-fluid-matrix-free solver and simulating the flow within a closed domain (that is a domain on which all boundaries are either periodic or Dirichlet boundary conditions).- Each fluid dynamics boundary condition is stored in a
bc #subsection : idis the number associated with the boundary condition. By default, Lethe assumes that the id is equivalent to the number#of the bc.typeis the type of the boundary condition.The subsections
u,vandware used to specify the individual components of the velocity at the boundary using function expressions. These functions can depend on position (\(x,y,z\)) and on time (\(t\)).The
center of rotationsubsection is only necessary when calculating the torque applied on a boundary. See See Force and Torque Calculation for more information.periodic idandperiodic directionspecify the id and direction of the matching periodic boundary condition. For example, if boundary id 0 (located at xmin) is matched with boundary id 1 (located at xmax), we would setid = 0,periodic id = 1andperiodic direction = 0.betais a penalization parameter used for both theoutlet,partial slip, andfunction weakboundary conditions. For the outlet boundary conditionsbetashould be close to unity, whereasbetaof 10 or a 100 can be appropriate for thefunction weakboundary condition. For thepartial slipcondition, use high values ofbeta(i.e. > 50).boundary layer thickness(\(d_w\)) is the parameter applied to thepartial slipboundary condition. It is used to estimate the tangential shear stress \(\tau_t = -\mu \frac{u}{d_w}\). For very highboundary layer thicknes, the boundary layer should behave exactly like theslipcondition.
- Each fluid dynamics boundary condition is stored in a
Caution
While using the lethe-fluid-sharp solver, it is wise to assign a weak type of boundary (outlet, partial slip, or function weak) to at least one boundary. The presence of particle(s) has a non-null contribution to the divergence of the problem, making it much harder for the linear solver to converge unless it is given some flexibility through of boundaries.
Caution
The lethe-fluid-matrix-free application does not support the pressure and partial slip boundary conditions.