# Boundary Conditions in CFD | SimFlow (OpenFOAM)

## Boundary Conditions   Boundary Conditions in CFD

Boundary conditions are crucial in Computational Fluid Dynamics (CFD) simulations. They define fluid behavior at the boundaries of the computational domain, providing necessary information about the outside world, which the governing equations (Navier-Stokes) do not cover.

These conditions act as constraints on the fluid flow equations, specifying values like velocity, pressure, and temperature (Fixed Value), or enforcing derivative constraints (Fixed Gradient). Properly chosen boundary conditions ensure accurate and stable simulations, matching real-world interactions. Incorrect boundary conditions can lead to unstable and divergent results.

The number of solution variables (solution fields) depends on the problem and determines how many variables should be constrained on each domain’s boundary. For incompressible flow, the solution field includes velocity components and pressure. For compressible flow, it includes velocity components, pressure, and temperature. Additional fields like turbulence quantities and species concentration can also be included.

Boundary conditions must be set for all solution fields in the simulation. However, the combination of boundary condition types is often limited. Selecting a type for velocity may require a specific type for pressure. For example, a velocity inlet typically uses a Fixed Value for velocity and a Zero Gradient for pressure. This means that while we think about boundary conditions, we should always focus on the whole set of solution fields, not only on a particular one. In SimFlow, the concept of boundary conditions set is introduced as a Boundary Condition Character, and by selecting the character, the appropriate boundary conditions for all solution fields are chosen automatically.

...

## Boundary Conditions   Boundary Conditions Types

There are several types of boundary conditions that can be applied in CFD simulations. From the mathematical point of view, the boundary conditions can be divided into three main types:

• Dirichlet - the value of the solution field is fixed at the boundary.
• Neumann - the derivative of the solution field is fixed at the boundary.
• Robin - a linear combination of the dirichlet and neumann boundary conditions.

In CFD, above types like Dirichlet (Fixed Value in SimFlow) are sometimes used directly. However, typically users rely on derived types that implement Dirichlet, Neumann, Robin, etc., with coefficients, enforced values, and blending factors calculated based on the physical context and flow conditions. For instance, a Total Pressure boundary condition uses the Dirichlet condition applied to static pressure, while the enforced value is calculated based on the user-provided total pressure and flow velocity at the boundary.

...

## Boundary Conditions   Boundary Conditions Categories

To facilitate the selection process, we have categorized boundary conditions into distinct groups based on their application and the physical quantities they influence. This structured approach allows users to easily identify and apply the appropriate boundary conditions for various aspects of their CFD simulations. For example, boundary conditions related to velocity, such as flow rate and velocity slip, are grouped separately from those related to pressure, like total pressure and fan pressure. By organizing boundary conditions into specific categories, we provide a clear and systematic way to address the different solution fields or physical contexts encountered in simulations. Each category focuses on a particular type of boundary condition, ensuring that users can efficiently choose the most suitable options for accurate and stable simulation results.

## Boundary Conditions   General

General Boundary Conditions

In this group, we have collected the most generic and fundamental boundary conditions that can be applied to a wide range of problems. These include fundamental boundary conditions implementing core concepts such as Dirichlet, Neumann, and Robin boundary conditions. Additionally, you will find derivative yet universal conditions, such as symmetry or generic inlet-outlet, applicable to all solution variables.

Boundary ConditionDescription

Specifies a constant value at a domain boundary, known as the Dirichlet or First-Type boundary condition.

Derived from Fixed Value, sets a uniform value across the entire boundary, either constant or time-dependent, and is applicable to all variable types.

A Neumann condition or Second-Type boundary condition, sets the gradient of a quantity to zero at the domain boundary, effectively extrapolating the quantity from the nearby area to the boundary. This condition ensures that the value at the boundary approximates the value at the nearest cell center to the boundary patch during equation discretization.

A mixed type boundary condition, switches between Zero Gradient when fluid flows out and Fixed Value when fluid flows in, allowing fluid to enter or exit based on local flow conditions.

Derived from Inlet Outlet, specifies a variable that functions as both inlet and outlet at a specific boundary in a computational domain, commonly used for variables like velocity or mass flow rate that may vary with flow conditions.

Outlet-Inlet

A mixed type inflow boundary condition, switches between user-specified Fixed Value when fluid flows out and Zero Gradient when fluid flows in, allowing fluid to enter or exit based on local flow conditions.

Specifies the gradient perpendicular to the boundary face, known as the Neumann or Second-Type boundary condition.

A derivative of Fixed Gradient, sets a uniform gradient value across the entire boundary, either as a constant or as a function of time.

Fixed Mean Value

Extrapolates the field to the patch using values from nearby cells and adjusts the distribution to ensure it matches a specified mean value.

Specifies constant free-stream velocity and pressure in the far-field region, commonly used in external aerodynamics to represent undisturbed flow away from the object of interest.

Models inflow conditions for turbulent flow by generating a spatially and time-varying turbulent field at the inlet boundary, adding a random component to a reference (mean) field.

Specifies boundaries not to participate in the simulation, allowing 3D meshes to be used for 2D or 1D simulations, preventing the solver from solving equations in the normal direction of those boundaries.

Models flow behavior at symmetrical boundaries, typically planes or surfaces where flow properties are mirrored, allowing for a reduction in the number of cells and solution time.

Utilizes in simulating axisymmetric problems, where the computational domain represents a wedge-shaped slice of the axisymmetric geometry, aiding in reducing complexity and computational costs.

Calculated

Automatically determines boundary values based on other existing primary solution fields, ensuring consistency and reducing manual input.

## Boundary Conditions   Velocity

Velocity Boundary Conditions

In this group, you can find a list of boundary conditions suitable for the velocity field. Most of these boundary conditions directly impose velocity values based on user input and the flow configuration. For example, Surface Normal Velocity or Cylindrical Inlet apply a Dirichlet condition, where the enforced value is computed based on mesh boundary properties. These conditions are mostly applicable to inlets, outlets, and walls, as no-slip or variations of slip conditions.

Boundary ConditionDescription

Slip

Enforce zero mass flux through the wall allowing parallel motion of the fluid along the boundary, used when surface roughness or fluid-wall interaction is minimal.

No-Slip

Specify the fluid velocity at the boundary matches the velocity of the boundary itself, ensuring no relative movement between the fluid and solid surfaces, particularly applicable in viscous flows.

Pressure Inlet-Outlet Velocity

Determine the velocity at a boundary based on neighboring cell values and the specified patch pressure, accommodating both inlet and outlet flows driven by pressure differences.

Pressure Normal Inlet-Outlet Velocity

Determines the velocity at a boundary based on neighboring cell values and the specified patch pressure, enforcing normal inflow velocity, applicable for pressure-driven flow.

Pressure Directed Inlet-Outlet Velocity

Determines the velocity at a boundary based on volumetric flow rates and allows the user to determine the inflow direction. It manages both inlet and outlet flow based on pressure differentials, and is especially useful in scenarios like ventilation systems.

Flow Rate Inlet Velocity

Adjust the extrapolated velocity field perpendicular to the patch to match specified flow rates, with input values expressed in terms of mass or volumetric flow rates.

Flow Rate Outlet Velocity

Adjusts the extrapolated velocity to match the specified flow rate, with input values expressed in terms of either mass or volumetric flow rates.

Surface Normal Fixed Value

Set a specific value for a field variable normal to a boundary surface, while leaving tangential components determined by other constraints or calculated by the solver.

Cylindrical Inlet

Specify a velocity profile at the inlet boundary, which has a specific profile according to the radial position, applicable in cylindrical systems like pipes and nozzles.

Swirl Inlet

Define the inlet velocity field with a swirling component, specify the axial, radial and tangential velocity components at the inlet, allowing for the simulation of swirling flows entering a domain.

Swirl Flow Rate Inlet

Specify an inlet flow rate with a swirling component, defines the velocity field based on the desired flow rate (either mass or volumetric) and the swirl characteristics.

Atmospheric Inlet

Used to simulate atmospheric boundary layers, creating log-law type ground-normal inflow conditions for wind velocity and turbulence, crucial for analyzing scenarios requiring developed velocity profiles at the inlet.

Moving Wall Velocity

Used to simulate the motion of a boundary within a fluid domain, allows defining the velocity of a moving wall in simulations, especially useful in cases involving dynamic meshes where boundaries are in motion relative to the fluid.

Rotating Wall Velocity

Apply a tangential velocity to the wall that corresponds to its angular velocity, used when the wall’s velocity is directly related to its rotation around a specific axis, such as in pumps, fans, and turbines.

## Boundary Conditions   Pressure

Pressure Boundary Conditions

In this group, we have assembled a variety of boundary conditions specifically tailored for pressure fields. These conditions are designed to handle diverse scenarios in simulations, ranging from low-speed aerodynamics to high-speed compressible flows, and even multiphase flows. Each condition addresses unique aspects of pressure behavior in different flow configurations. Whether you need to model hydrostatic effects, account for fan-induced pressures, or maintain uniform total pressure, you will find a suitable boundary condition in this group.

Boundary ConditionDescription

Fixed Flux Pressure

Adjusts pressure at boundaries to handle scenarios where the flux of a quantity (such as velocity) across the boundary is known and specified, rather than directly setting the pressure itself. The pressure at the boundary is adjusted to ensure that the specified flux is maintained.

Total Pressure

Defines a total pressure on the domain boundary and adjusts the static pressure based on this specified total pressure, considering the dynamic pressure component. It is recommended for stability in both incompressible and compressible pressure-driven flows.

Uniform Total Pressure

Defines a total pressure at the domain boundary and adjusts the static pressure based on this specified total pressure, considering the dynamic pressure component. It is recommended for stability in both incompressible and compressible pressure-driven flows. It is a derivative of Total Pressure boundary condition which allows to define either constant or time-dependent value throughout the entire boundary.

Hydrostatic Pressure

Adjusts static pressure to account for hydrostatic effects, ensuring accurate representation of pressure variations due to gravitational forces, especially in buoyant and multiphase flows. Beneficial for simulations involving open domains subject to atmospheric pressure variations.

Hydrostatic Total Pressure

Sets the modified pressure at the boundary, which includes both the static pressure and the potential energy due to gravity. Similar to the Total Pressure but consider the gravitational potential energy component. It is useful when considering fluid velocity and potential energy due to gravity.

Phase Hydrostatic Pressure

Applies in multiphase flow simulations, balances the pressure to account for the hydrostatic pressure head caused by the weight of specific phases, crucial for accurate simulations involving standing fluids or scenarios heavily influenced by gravitational forces.

Fan

Simulates a fan in fluid flow by imposing pressure jump conditions, simplifying simulation by removing the need for intricate fan geometry, just its characteristics. It is applicable to both inlets and outlets in various flow types.

Plenum Inlet

Sets the pressure at an inlet or outlet based on the specified pressure in an external plenum, adjusting the boundary pressure to match the plenum pressure.

Wave Transmissive

Simulates open boundaries, such as in atmospheric or marine flows, allowing waves or free streams to pass through without significant reflection, addressing limitations of traditional conditions like Fixed Value or Zero Gradient by minimizing wave reflections at the boundary.

Porous Baffle

Used to model the pressure drop across a porous baffle, simulating the resistance of porous materials like filters or membranes. The specified pressure difference influences the fluid flow without requiring detailed modeling of the porous structure.

## Boundary Conditions   Temperature

Temperature Boundary Conditions

In the Temperature group, we have curated a range of boundary conditions tailored specifically for managing temperature fields. These conditions are crucial for accurately simulating thermal effects across various flow scenarios. Some of these boundary conditions are suitable for application to walls, while others are designed for use with inlets and outlets.

Boundary ConditionDescription

Total Temperature

Specifies the total temperature at the domain boundary, used to calculate the static temperature adapting to changes in the velocity field, crucial for accurately simulating thermal effects in high-speed flows.

Inlet-Outlet Total Temperature

A mixed type boundary condition, applying an outflow condition for total temperature under reverse flow conditions, otherwise, it defaults to the Zero Gradient boundary condition.

Heat Flux

Specifies the heat flux at the boundary, determining the boundary temperature based on the material’s thermal properties. It is used when a wall’s temperature is affected by an external heat flux, commonly in CHT simulations.

Wall Heat Transfer

Convective heat transfer boundary condition links the heat exchange rate to the temperature difference between the object and the ambient surrounding temperature.

Power

Specifies the heat flux at the boundary, given by a power, determining the boundary temperature based on the material’s thermal properties. It is used when a wall’s temperature is affected by an external heat source.

Lumped Mass

Models the temperature of a wall by considering the wall as a lumped thermal mass, accounts for heat transfer between the fluid and the wall, assuming the wall has a uniform temperature but with thermal inertia.

Recycled Temperature

Averages the temperature over the specified outlet patch and applies it as a uniform temperature on this patch. Allows for applying an extra heat source for mapped temperature.

Within this category, we compile boundary conditions specifically designed for handling radiative heat transfer in simulations. These boundary conditions are essential for capturing the interplay of radiation with other thermal effects in computational simulations.

Boundary ConditionDescription

Provides a grey-diffuse radiation intensity condition, for the finite-volume discrete-ordinates model (fvDOM), where the radiation temperature is derived from the temperature field boundary condition, integrating both radiative and convective heat transfer in high-temperature applications.

Marshak

Simulates radiative heat transfer in high-temperature environments, particularly with participating media like gases or plasmas. It models the absorption and emission of radiation by semi-transparent boundaries, crucial for accurately capturing radiative heat flux in such conditions.

Marshak Fixed Temperature

Applies to radiative heat transfer simulations where the boundary temperature is fixed and known, calculating radiative heat flux based on this temperature and material properties, suitable for controlled temperature scenarios.

## Boundary Conditions   Turbulence

Turbulence Boundary Conditions

In this group, you will find boundary conditions suitable for RANS and LES simulations. These conditions are compatible with both the k-epsilon and k-omega RANS model families, enabling users to define inlet turbulence characteristics using intensity and mixing length parameters.

Boundary ConditionDescription

Turbulent Intensity Inlet

Provides a turbulent kinetic energy condition, deriving it from known turbulent intensity and velocity field at inlet boundaries.

Turbulent Mixing Length Inlet

Specifies the turbulent mixing length and the dissipation rate at the inlet of the computational domain.

Standard Wall Function

Provides a simple wrapper around the zero-gradient condition for the turbulence fields in high Reynolds number flow cases using wall functions.

Standard Wall Function (k)

Provides a wall function for turbulent viscosity (nut) based on turbulent kinetic energy (k) for both low- and high-Reynolds number applications.

Rough Wall Function

Used to model the effects of surface roughness on turbulent flow near walls, adjust the turbulent viscosity to account for the increased friction and turbulence generated by rough surfaces.

Rough Wall Function (k)

Applies a wall constraint on the turbulent viscosity for rough walls, based on the turbulent kinetic energy. It adjusts the wall roughness parameter E to account for the effects of roughness.

Atmospheric Wall Function

Provides a turbulent kinematic viscosity for atmospheric velocity profiles, designed to be used in conjunction with the Atmospheric Inlet boundary condition. This is used for simulating wind profiles and turbulence near the ground in outdoor environments.

Low Re Wall Function

Provides a turbulence kinetic energy wall function for both low- and high-Reynolds numbers. The function uses different formulas depending on the computed laminar-to-turbulent transition y+ value.

Jayatilleke Wall Function

Provides a thermal wall function for turbulent thermal diffusivity, utilizing the Jayatilleke model.

## Boundary Conditions   Multiphase

Multiphase Boundary Conditions

In this group, we have gathered specialized boundary conditions for modeling multiphase flows. In many cases, it is sufficient to use the standard boundary conditions for the individual phases, but in some cases, specialized boundary conditions are needed. This set of boundary conditions enables users to define parameters such as inlet water level via water flow rate, specify the contact angle of a droplet on a solid surface, or impose physical outlet conditions for multiphase flows.

Boundary ConditionDescription

Variable Height

Defines a phase fraction based on local flow conditions, constrained within specified upper and lower bounds. Allow dynamic adaptation such as controlling water levels in a tank inlet.

Variable Height Inlet

Adjusts inlet velocity based on prescribed volumetric flow rate accounting for changes in patch area, ensuring constant mass flow rate in multiphase simulations.

Interstitial Inlet Velocity

Calculate the actual interstitial velocity by dividing the specified velocity field by the local phase fraction. This is useful in multiphase flow simulations where both phases exist at the inlet, ensuring correct mass flow rates.

Outlet Phase Mean Velocity

Multiphase flow boundary condition that adjusts the outlet velocity to match a specified mean value, combining Zero Gradient and Fixed Value methods. This approach ensures mass conservation and maintains consistent phase levels in simulations.

Constant Contact Angle

Determines the wall contact angle field, with a crucial limit parameter controlling angle gradient options on the wall.

Wave

Used to simulate wave motions at boundaries, generates waves based on specified parameters such as wave height, period, and direction. Applicable for velocity and phase fraction.

## Boundary Conditions   Coupled

Coupled Boundary Conditions

This category specializes in boundary conditions that enable seamless interaction and exchange of physical quantities between different computational boundaries within a simulation. These boundary conditions facilitate the modeling of coupled interfaces, transforming physical parameters such as mass flux, heat flux, and pressure. They allow for modification of these parameters, for example, by applying resistance, adding pressure jumps, or introducing heat sources.

Boundary ConditionDescription

Mapped Inlet

Specifies flow condition at the inlet by mirroring variables like temperature or phases/species composition from another boundary within the same domain, using values obtained from a source boundary.

Matched Outlet

Adjusts the extrapolated velocity to align with the flow rate of the specified corresponding inlet patch.

Coupled Temperature

Couples temperature and heat flux between two mesh regions, ensuring they are equal at the interface, with an option to add thermal resistance.

Couples temperature and heat flux including radiation between two mesh regions, ensuring they are equal at the interface, with an option to add thermal resistance.

Cyclic (AMI/ACMI)

Simulates periodic geometries or flow fields with non-aligned mesh faces, using interpolation methods to handle rotating machinery and complex geometries.

Fixed Jump (AMI)

Applies a fixed offset to a field value between two cyclic (AMI) boundaries, useful for simulations with rotating or sliding meshes where consistent value differences across interfaces are needed.

Uniform Jump (AMI)

Imposes a time-dependent offset in field values between two cyclic (AMI) boundaries, useful for simulations with rotating or sliding meshes where a consistent, time-varying deviation across interfaces is required.