Modeling Inlet and Outlet Boundary Conditions

../_images/vortex.png

What is a Boundary Condition?

In fluid dynamics, the governing equations cannot be solved without specifying additional information at the boundaries of the domain. Constraints must be imposed at the domain limits to obtain a unique and physically meaningful solution. Boundary conditions are the constraints applied at the edges of the computational domain to define how the fluid behaves.

From this definition, we understand that a boundary condition prescribes one or more flow variables (such as velocity, pressure, species concentration, or temperature) on the surface enclosing the fluid domain. In general, boundary conditions fall into three main categories:

  • Dirichlet: Value Boundary Condition -> Specifies the value of a fluid variable

  • Neumann: Gradient Boundary Condition -> Specifies the gradient of a variable

  • Robin: Mixed Boundary Condition -> Specifies a combination of value and gradient

In M-Star, we primarily use Dirichlet and Neumann boundary conditions. Although boundaries can be defined as walls (no‑slip, slip, adiabatic, etc.) or as inlets and outlets, in this document we will focus on inlet and outlet boundary conditions—how to create them, the different types available, and the best practices for their effective use.

If you are interested in further details regarding wall boundary conditions, please visit the Main Lattice and Static Body pages.

What are Inlet and Outlet Boundary Conditions?

Inlet and outlet boundary conditions determine how the flow enters and leaves the fluid domain. These boundary conditions can be defined by prescribing velocity, pressure, or flow rate, among other variables. For a detailed explanation of the available inlet and outlet boundary conditions, see Boundary Condition Types.

Create Inlet Outlet Boundary Conditions

To create inlets and outlets, we use the Create function in M‑Star Pre under Fundamentals, where you can choose between Static Inlet Outlet or Moving Inlet Outlet boundary conditions.

From this point forward, we will focus exclusively on Static Inlet Outlet Boundary Conditions, as they are the most used and offer a wider range of configuration options.

To create a Static Inlet/Outlet boundary condition, select Create and then choose Static Inlet/Outlet. This action adds a new item to the Model Tree and opens a selection window. The window allows you to choose how the boundary (where the condition will be applied) is identified:

  • Point on bounding box: You can place a point anywhere on the bounding box to select the corresponding region as an inlet or outlet. If multiple boundaries lie on the same bounding box face, the software automatically detects the distinct regions defined by the geometry. You can then click within the desired region to select it while excluding the others. This method allows you to define multiple boundary conditions on a single bounding box face.

../_images/bc-1.png

Selection Method: Point on Bounding Box

  • Surface: Select the surface directly from the geometry where you want to apply the inlet or outlet boundary condition by clicking on the desired face (hold Shift to select multiple surfaces). When this option is chosen, a dialog box appears that allows you to filter which geometric elements should be considered during selection. This is especially helpful for large or complex geometries where inlet or outlet surfaces may be hidden or embedded within other components.

../_images/bc-2.png

Selection Method: Surfaces

  • Edges: Select the edges in the geometry that form a closed contour (hold Shift to select multiple edges). If no face exists for the selected contour, M-Star will automatically generate one to close the control volume. As with the surface selection method, a filtering dialog will appear to help refine which geometric elements are considered during selection.

../_images/bc-3.png

Selection Method: Edges

Once the inlet or outlet has been created, all of its characteristics can be configured through the options in the Property Grid—including boundary condition type, magnitude, operation duration, and more (for additional details, refer to the previously provided documentation). Whether the boundary condition functions as an inlet or an outlet depends on how these parameters are defined.

For example, if the boundary condition type is set to Velocity and the direction vector points into the control volume, the boundary acts as an inlet, since fluid enters the domain. If the same settings are used but the direction is reversed—pointing outward from the control volume—the boundary becomes an outlet. This logic applies broadly to velocity and flow-rate boundary conditions.

Some boundary condition types are restricted by design: certain options can only be used as inlets (such as inlet single pulse, inlet multipulse, and recirculation return), while others can only function as outlets, based on how they are implemented in the solver.

Guidelines, Best Practices, and Recommendations

As a general guideline, inlets and outlets should be defined using realistic physical properties, such as velocity, pressure, or flow rate. Whenever possible, they should be positioned far from regions of strong disturbances to minimize backflow or artificial acceleration effects.

Ensure that inlet and outlet regions are sufficiently resolved—typically with at least 10 lattice points across each opening—to avoid poorly captured boundary behavior.

Static Inlet Outlet boundary conditions must always be applied to static bodies. They should never be assigned to moving bodies. If a moving boundary is required, the Moving Inlet/Outlet option must be used instead.

For single phase simulations, maintain mass or volume balance within the system—because volume is conserved, the total inflow must equal the total outflow. In practical terms, defining an inlet requires defining at least one outlet to satisfy mass continuity (if the mass is not conserved, the LB density will increase/decrease leading to an incorrect solution or simulation divergence).

Whenever possible, align inlets and outlets with the lattice (on-lattice boundary conditions) when using lattice-based boundary conditions. An on-lattice boundary condition is a boundary treatment where the physical boundary aligns exactly with lattice nodes or links, allowing boundary conditions to be applied locally without interpolation; geometrically, an on-lattice boundary condition is one where the boundary surface coincides with lattice planes, has normals aligned with the Cartesian lattice axes, and does not cut through lattice cells or links at arbitrary angles. This improves numerical stability, enhances boundary resolution, reduces noise and artifacts, and ultimately leads to more accurate and realistic simulation results.

../_images/bc-4.png

The image above illustrates how volume discretization affects off-lattice boundary conditions. Because of the discretization, the off-lattice inlet exhibits a stairstep pattern on both the pipe walls and the inlet surface. This reduces the effective boundary condition area—from 10 voxels across in the on-lattice case, to only 7 elements in the off-lattice model. As a result, the region becomes underresolved, and the stairstep geometry leads to poor wall representation. This, in turn, impacts local mass and velocity fields, as well as the overall flow rate.

Tip

The most reliable way to obtain an on‑lattice boundary condition is to reposition the geometry so the boundary aligns with one of the main lattice axes. However, this is not always feasible, and some boundaries must remain off‑lattice (for example, a vessel with two inlets rotated 45 degrees). In such cases, several strategies can help improve simulation quality:

  • Increase lattice refinement to boost the number of cells across the boundary surface and reduce the stairstep effect.

  • Extend the inlet/outlet pipe until it intersects the bounding box. This creates a new inlet/outlet surface on the bounding box, which is inherently on‑lattice. This approach can be useful for certain boundary types—particularly pressure boundaries—but may be problematic for others because the resulting inlet/outlet face becomes oblique, increasing its effective area and potentially distorting flow‑rate values. Adding a pressure filter can help stabilize the inlet, though additional refinement may still be needed to further reduce stair‑stepping.

../_images/bc-5.png

Extend the inlet/outlet pipe, intersect with the bounding box, and define the boundary condition on the bounding box.

Behind any boundary condition—whether inlet or outlet—there must be a solid region rather than fluid. If a boundary condition is defined with fluid on both sides, the software cannot determine which direction is “in” or “out,” leading to ambiguity and potential solver failure.

Boundary conditions can also be applied directly on the domain limits. In this case, no solid body is required behind the inlet or outlet because the back side of the boundary is not exposed to any fluid.