*3.1.1. Velocity inlet*

The "velocity inlet" condition was conceived to prescribe a uniform velocity profile at the entrance of a computational domain (bi-dimensional or tri-dimensional). This boundary condition was created to analyze incompressible flows, such as external flows over complex geometries or internal flows in different sections of piping or machinery. It is not recommend‐ ed for compressible flows. It also allows to specify the magnitude and the direction of a uniform velocity profile. Other velocity profiles such as parabolic, sinusoidal, and logarithm can be imposed using a user-defined function code (UDF). For turbulent flows, the software allows prescribing the turbulence levels required at the entrance or the domain using different methods. A hydraulic diameter and a value of turbulence intensity can be used to do so for internal flows. For example, for square ducts, the hydraulic diameter can be calculated as 4A/ P, where A is the cross section area and P is the perimeter of the same area, also known as the wetted perimeter. For external flows, it is required to provide a characteristic length (for example, the diameter of a cylinder if the flow over a circular cylinder is studied). In this case, the turbulence intensity represents a percentage of the value of the fluctuating values of velocity based on the mean value. For example, if the magnitude of the fluid velocity is 5 m/s and a turbulence level of 10% is prescribed, the inlet velocity would present values from 4.5 to 5.5 m/s. Additionally, different parameters like flow temperatures or heat flux can be established at the entrance of the domain, which are important for energy studies and heat and mass transfer analysis.

## *3.1.2. Pressure inlet*

**Dirichlet boundary condition:** The value of the flow variable is specified at the boundary. This kind of boundary condition is typically linked to problems involving flow inlets and

**Neumann boundary condition:** For this kind of boundary condition, the value of the gradient normal to the flow variable is specified. These boundary conditions are often associated with

**Mixed boundary conditions:** These are the conditions resulting from a combination of

The boundary conditions can be classified by its physical meaning as follows: physical boundaries, such as solid walls, or artificial boundaries, such as outflow. The latter are mathematical approximations to the real behavior of the flow in certain zones. Artificial boundaries can be applied, if the computational domain constitutes part of the total flow field, to research the most interesting region and to reduce computational costs. Artificial boun‐ dary conditions require mathematical formulations that are physically significant to the real

Regarding ANSYS FLUENT, there are different types of boundary conditions that can be used to simulate different flow problems. Next, a general description of the most common boun‐ dary conditions used in most hydrodynamic studies is presented. The authors recommend

The "velocity inlet" condition was conceived to prescribe a uniform velocity profile at the entrance of a computational domain (bi-dimensional or tri-dimensional). This boundary condition was created to analyze incompressible flows, such as external flows over complex geometries or internal flows in different sections of piping or machinery. It is not recommend‐ ed for compressible flows. It also allows to specify the magnitude and the direction of a uniform velocity profile. Other velocity profiles such as parabolic, sinusoidal, and logarithm can be imposed using a user-defined function code (UDF). For turbulent flows, the software allows prescribing the turbulence levels required at the entrance or the domain using different methods. A hydraulic diameter and a value of turbulence intensity can be used to do so for internal flows. For example, for square ducts, the hydraulic diameter can be calculated as 4A/ P, where A is the cross section area and P is the perimeter of the same area, also known as the wetted perimeter. For external flows, it is required to provide a characteristic length (for example, the diameter of a cylinder if the flow over a circular cylinder is studied). In this case, the turbulence intensity represents a percentage of the value of the fluctuating values of velocity based on the mean value. For example, if the magnitude of the fluid velocity is 5 m/s and a turbulence level of 10% is prescribed, the inlet velocity would present values from 4.5 to 5.5 m/s. Additionally, different parameters like flow temperatures or heat flux can be established at the entrance of the domain, which are important for energy studies and heat

isothermal walls.

flow behavior.

*3.1.1. Velocity inlet*

and mass transfer analysis.

symmetric boundaries and adiabatic walls.

324 Numerical Simulation - From Brain Imaging to Turbulent Flows

boundary conditions of the kind of Neumann and Dirichlet.

readers to consult Ref. [8] for more detailed information.

The "pressure inlet" boundary condition is used to define the pressure characteristics at the entrance of the domain for cases where the mass flow or the velocity is unknown at the inlet of the domain. This boundary condition can be used for compressible and incompressible flows. For incompressible flows, the total pressure can be modeled as follows:

$$P\_{\text{total}} = P\_{\text{static}} + \frac{1}{2}\rho V^2 \tag{1.14}$$

where the total pressure or "gauge total pressure" is known, and it is equivalent to the sum of the static pressure at the inlet, also known as supersonic/initial gauge pressure and a dynam‐ ic pressure, which is not necessarily known, but can be manually calculated and compared to the velocity assigned to the normal direction to the boundary condition.

$$P\_{\text{total},abs} = P\_{\text{ereatic}} \left[ 1 + \frac{k-1}{2} M^2 \right]^{\frac{k}{k-1}} \tag{1.15}$$

Regarding the compressible flows, Eq. (1.15) is used, where "k" is the specific heats ratio and M is the Mach number.

#### *3.1.3. Outflow*

The "outflow" boundary condition represents and artificial cut through the flow field, similar to the velocity inlet condition, but set up at the outlet of the flow domain. The outflow conditions are used when the characteristics looked for in the flow are developed at a fraction of the total flow field. When this is true, this boundary condition allows to avoid numerical‐ ly modeling the complete domain (which can be computationally expensive). In those cases, a distance from the domain inlet is defined as the flow outlet, imposing there the outflow condition. The main difference between an inflow and an outflow condition is that there is not flow information available outside the computational domain for an outflow condition. In contrast, for the inflow condition, there is always information about the entering flow.

The flow variables in an outflow condition have to be approximated in a physically signifi‐ cant way in a manner that does not affect the solution of the governing equations in the computational domain. For an outflow boundary condition, the numerical effects found upstream that are generated have to be eliminated or reduced. Conventionally, in the CFD programming for laminar and steady RANS models, the fully developed conditions in the streamwise direction are expressed by *∂φ*/*∂x<sup>i</sup>* = 0. However, for more complex cases where recirculating flow structures exist, there can be problems due to the reentrance of mass circulating in a vortex for example. For these cases, a generalized convective boundary condition is used:

$$\left.\frac{\partial\phi}{\partial t} + U\_{\text{conv}}\frac{\partial\phi}{\partial x\_l}\right|\_{\text{outlar}} = 0\tag{1.16}$$

The correct use of that equation warrants the vortices can get near or cross the outlet boun‐ dary without significantly perturbing the computational solution inside the domain. In the last equation, *xi* represents the main flow direction, and *Uconv* denotes the mean convective velocity at the outlet position, approximated using the outlet mass flow value [9].

#### *3.1.4. Pressure outlet*

The "pressure outlet" boundary condition is conventionally used for the solution of coupled problems (high Mach number values and compressibility effects), where the outflow boun‐ dary condition is not convenient. It requires to specify the static pressure (gauge pressure) at the domain outlet. Such value is exclusively respected for subsonic flow cases (M < 1). When the flow is supersonic, the specified pressure will not be used, and a new value will be extrapolated based on previous values.

**Figure 2.** Pressure components of the pressure outlet boundary condition, adapted with permission from [10].

To use this boundary condition correctly, it is required to establish a set of flow relations for reversing flow at the outlet during the solution process (a set of backflow relations). Such relations are important because incorrect values for these parameters can cause convergence problems.

Specifically for the coupled solver in the option density based, pressure values at the outlet faces are calculated using a splitting procedure based on the AUSM scheme developed by Liou [11].

For subsonic flow conditions at the outlet, pressure is determined using a weighted average based on the left and right states at the domain boundary (**Figure 2**). This average value is a mix of polynomial adjustments of fifth order based on the Mach number values at the outlet face. Then, the pressure value is finally stated *Pf* = *f*(*Pc*, *Pe*, *Mn*) where *Pc* is the pressure at the pressure value at the inside neighbor cell next the exit face f, being *Pe* the specified pressure and *Mn* the Mach number at the normal direction. If there is a supersonic flow, the pressure at the exit face is extrapolated from the inlet cell value. For incompressible flow, the exit face pressure is calculated as an average between the outlets specified pressure and the average pressure value.

$$P\_f = \frac{1}{2} (P\_c + P\_e) \tag{1.17}$$

The "pressure outlet" boundary condition does not guarantee a constant pressure along the outlet of the domain. However, once the solution of the model converges, the average pressure value at the outlet will tend to reach a value close to the static pressure imposed at the exit.

#### *3.1.5. Walls*

<sup>0</sup> ¶ ¶ + =

 f

*i outlet*

The correct use of that equation warrants the vortices can get near or cross the outlet boun‐ dary without significantly perturbing the computational solution inside the domain. In the last

The "pressure outlet" boundary condition is conventionally used for the solution of coupled problems (high Mach number values and compressibility effects), where the outflow boun‐ dary condition is not convenient. It requires to specify the static pressure (gauge pressure) at the domain outlet. Such value is exclusively respected for subsonic flow cases (M < 1). When the flow is supersonic, the specified pressure will not be used, and a new value will be

**Figure 2.** Pressure components of the pressure outlet boundary condition, adapted with permission from [10].

To use this boundary condition correctly, it is required to establish a set of flow relations for reversing flow at the outlet during the solution process (a set of backflow relations). Such relations are important because incorrect values for these parameters can cause convergence

Specifically for the coupled solver in the option density based, pressure values at the outlet faces are calculated using a splitting procedure based on the AUSM scheme developed by

For subsonic flow conditions at the outlet, pressure is determined using a weighted average based on the left and right states at the domain boundary (**Figure 2**). This average value is a

represents the main flow direction, and *Uconv* denotes the mean convective velocity

(1.16)

¶ ¶ *conv*

*U t x*

f

at the outlet position, approximated using the outlet mass flow value [9].

equation, *xi*

problems.

Liou [11].

*3.1.4. Pressure outlet*

extrapolated based on previous values.

326 Numerical Simulation - From Brain Imaging to Turbulent Flows

For viscous flows, the nonslip condition has to be imposed at the walls. This can be attained prescribing *u*= *v* = *w* = 0 at the walls, to reproduce the formation of the dynamic boundary layer. In some cases, when solving the flow within the boundary layer is not needed (e.g., in external flows over an immerse body, there is no need to solve the boundary layer on the walls that delimitate the domain), values of shear stresses equal to zero are imposed, which is known as slip walls [12]. In addition to prescribing values for shear stresses, temperature values (Dirichlet type) or normal heat flux values (Neumann type) can be imposed and they are particularly useful for thermal analysis. It is also possible to define wall roughness values, which are especially useful in turbulent flows studies, as well as translational and rotational movement of the walls related to the same frame of reference.

**Figure 3.** Rotational periodicity of a cylindrical recipient, adapted with permission from [10].

**Figure 4.** Translational periodicity in a heat exchanger array.

#### *3.1.6. Periodic boundary condition*

Periodic boundary condition is useful to cut down the size of the studied domain, saving simulation time in cases where the geometry of the given problem and the flow pattern have characteristics that are repetitive and periodic along a certain characteristic length "L". The periodic flow behavior can be found in many applications such as heat exchanger channels, flow over pipe banks, and fully developed flow in pipes and ducts. There exist two types of periodicity, such as translational and rotational periodicity (**Figure 3**). For rotational perio‐ dicity a constant pressure is defined along the periodicity planes, also defining a rotational axis in the fluid in studies related to turbomachinery.

Regarding translational periodicity, a finite pressure drop can be defined between two periodic Planes (**Figure 4**). Also, a mass flow can be defined.

### **3.2. Some technical suggestions for an adequate solving**

To solve adequately a CFD problem, it is recommended a series of best practices whose Application can help to obtain better convergence values for CFD simulations. The first one is to verify that the skewness value of most of the mesh elements is between 0 and 0.5, being the values closest to 0 the most desirable ones. This is to minimize the numerical dissipation for the algorithms responsible of carrying out the flow balances at the cell faces. Another important suggestion to improve initial convergence in fluid, heat transfer, and multiphase flow problems is to first obtain solutions using single precision and first-order discretization models. After that, based on these solutions, change the discretization models to second order models. This should be carried out considering that second-order schemes produce lower error values. From this point, it is recommended to activate the energy equation (if needed) or any multiphase flow or reactive flow parameters (if needed) to obtain adequate convergence. It is

also needed to consider that final runs have to be performed using double precision. Finally, having previously obtained convergence, relaxation factor values can be increased to obtain a better solution in each iterative process. It is necessary to remember the importance of the results validation, using for that, experimental values of the same phenomenon in a control‐ led environment.
