ansys (53) ansys cfd (3) ansys cfx (29) ansys cfx centrifugal pump (2) ansys cfx in Spanish (16) ansys cfx impeller (2) ansys designmodeler (2) ansys design modeler (2) ansys in Spanish (7) ANSYS FLUENT (25) ansys fluent centrifugal pump (2) ansys fluent in Spanish (14) ansys fluent heat transfer (3) ansys fluent heat transfer (2) ansys mesh (5) ansys meshing (13) ansys tutorial (49) bluecfd (1) cavity openfoam (2) cfd (8) design modeler (2) elbow tutorial (3) FVM (2) install ansys (2) install openfoam (3) install openfoam on Windows (1) install salome (2) fluid mechanics (4) mesh (2) finite volume method (2) turbulence models (2) naca 2412 (3) openfoam (34) openfoam cavitation (2) openfoam in Spanish (26) openfoam tutorial (30) openfoam vs ansys cfx (8) openfoam water channel (2) salome (9) salome in Spanish (2) salome mesh (2) salome openfoam (2) heat transfer (2) tutorial ansys fluent (2) finite volumes (2)
-
Finite Volume Method – Source Term

In this tutorial we will solve the same exercise, but adding a heat generation source, and we will …
-
Finite Volume Method

Diffusion problems are the simplest ones to start with in order to understand how the finite volume method (FVM) works.
-
Navier–Stokes Equations

They are a set of mathematical equations that describe the motion of viscous fluids. They are one of the most important tools in …
-
Reynolds Number

It is a dimensionless parameter in fluid mechanics that describes the ratio between inertial forces and viscous forces in a moving fluid.
-
Steady vs. Transient Regime (CFD)

One of the questions we ask ourselves when we start running simulations is whether we should run a steady or a transient simulation.
-
Turbulence Models

Turbulence consists of fluctuations of the flow field in time and space. It is a complex process, mainly because it is three-dimensional, unsteady and made up of many scales.
-
Bernoulli's Equation

A classic linear momentum analysis yields a relation between pressure, velocity and elevation in a frictionless flow, now known as Bernoulli's equation. It was stated (vaguely) in words in 1738 in a textbook by Daniel Bernoulli. Leonhard Euler gave a complete derivation of the equation in 1755. The equation…
-
What Is Fluid Mechanics?

Fluid mechanics is a branch of physics that studies the behavior of fluids (liquids and gases) at rest and in motion. Fluid mechanics is divided into two main branches: hydrostatics, which deals with fluids at rest, and hydrodynamics, which deals with…
Navier–Stokes Equations¶
1. What Are the Navier-Stokes Equations?¶
They are a set of mathematical equations that describe the motion of viscous fluids. They are among the most important tools in fluid mechanics and are used to predict and understand the behavior of fluids in many different situations, from flow in a pipe to ocean circulation.
These equations are based on the conservation of mass, momentum and energy of the fluid, and they also include terms that describe viscosity and turbulence. Solving them makes it possible to estimate the velocity, pressure and density of the fluid at a given point in space and at a given instant.
The Navier-Stokes equations are very complex and often cannot be solved analytically, so numerical and simulation methods are used to solve them in real situations. Despite their complexity, these equations are a valuable tool in a wide range of practical applications, such as wind turbine design, simulation of flow in pipes and ducts, and prediction of ocean circulation.
Continuity Equation
\begin{equation} \frac{∂\rho}{∂t} + \nabla.\rho\vec{V}=0 \tag{1} \end{equation}Momentum Equation
\begin{equation} \rho \left[\frac{∂V}{∂t}+(V.\nabla) V \right] = -\nabla p + \rho \vec{g} + \mu \nabla^2 \vec{V} \tag{2} \end{equation}
Where:
- $\frac{dV}{dt}$; Change of velocity over time
- $(V.\nabla) V$; Convective term
- $-\nabla p$; Pressure gradient
- $\rho \vec{g}$; Forces acting on the body
- $\mu \nabla^2 \vec{V}$; Diffusive term
2. Newton's Second Law¶
Newton's second law states that: “The acceleration of an object is directly proportional to the net force acting on it and inversely proportional to its mass.”
In other words, for a fluid particle, the rate of increase of its momentum is equal to the sum of all the forces acting on it. The forces acting on a fluid particle are:
Surface forces:
- Pressure difference
- Viscous force
- Surface tension
Body forces:
- Gravitational force
- Coriolis force
- Centrifugal force
- Electromagnetic force
Where:
- $F_p$; Pressure forces
- $F_v$; Viscous Forces
- $W$; Peso
- $S$; Additional body forces
- $m$; Masa
- $a$; Acceleration
The figure shows that the greater the force applied to an object, the greater its acceleration. The same holds for fluids.
3. Fluid Motion¶
If we consider fluid flow as a set of particles (Lagrangian approach), we can study a single particle whose velocity at a given time is V, so its components along the three coordinate axes are $V = (V_x,V_y,V_z)$. In turn, each velocity component can be written as follows, including time:
Where $x,y,z$ represent the position of the particle along the three coordinate axes and $t$ represents the time for that position.
If we differentiate each component of the velocity $V$ with respect to time, we obtain the following for $V_x$:
Remember that the symbol «d» is used for ordinary differential equations, while «∂» is used for partial differential equations.
Since the function $f_1$ is equal to $V_x$, we can substitute equation (5) and obtain:
We also know that the derivative of position with respect to time is velocity, so we have:
Substituting the velocities (7a), (7b) and (7c) into equation (6) we get:
Likewise, we know that acceleration is the derivative of velocity with respect to time, so we can write the acceleration along the three coordinate axes as:
Substituting equation (9a) into equation (8) we have:
If we repeat the same process for the $y$ and $z$ axes, the acceleration components are:
4. Pressure Acting on the Fluid¶
Imagine an infinitesimal volume within a fluid flow. Assume this volume is a cube with dimensions $dx, dy, dz$, and inside it (at the center) is the point $A(x, y ,z)$, where the pressure is $P = f(x, y, z)$. If we analyze only the $x$ axis (note the direction of the $x$ axis in the figure), there will be a pressure on the faces perpendicular to the $x$ axis.

Let's first analyze the left face. If the pressure at point $A(x ,y ,z)$ is $P(x ,y ,z)$, then to determine the pressure on the left face we must use a Taylor series. Recall that the Taylor series is a functional series that lets us approximate a function. In our case the function is pressure, and we want to know it on the left (and then the right) face of the infinitesimal cube.
The Taylor series has the following form:
Expanding the Taylor series we get:
Let's consider only the first two terms of the Taylor series and develop the approximation for the pressure function P, along the x.
From the figure we know that, in the $x$ direction, the size of the infinitesimal cube is $dx$. This means that the distance between the center and the left face of the cube is $\frac{dx}{2}$. If we also consider that the point at the center of the left face is $(x_0,y_0,z_0)$, where we want to know the pressure $p(x_0)$, then we can write the equation (14) axis only, as:
Then the pressure on the left face is:
Note that $(x-x_0)$ is the distance between the center of the infinitesimal cube and the left face. If the distance between the left and right faces is $dx$, then $(x-x_0)=\frac{dx}{2}$. Also note that $p(x_0)$ is the pressure at point $A$ plus a pressure differential $dp$, that is, $p(x_o) = p + dp$
If we repeat the process for the right face, we get a similar equation with the opposite sign, as shown below:
- Left face
- Right face
Adding the pressures gives their differential. Note in the figure that the pressure on the right face is negative because it acts opposite to the $x$ axis
From which the pressure differential on the infinitesimal cube is:
From theory we know that $P=\frac{F}{A}$, that is, $F = P \cdot A$, where $F$ is force, $P$ is pressure and $A$ is area. For the infinitesimal cube we can write (following the same process for the three axes):
Where the areas are $A_x = dydz$, $A_y = dxdz$ and $A_z = dxdy$
5. Effect of Gravity¶
If we consider the weight, it acts only along the $z$ axis (due to gravity), giving the equation:
Where $W$ is the weight, $m$ is the mass and $g$ is gravity. Rewriting it in differential form we have the following:
In equation (23) the negative sign refers to the direction of gravity, which is opposite to the direction of the $z$ axis
6. Viscous Stresses¶
These stresses play an important role in fluid flow. Assume the flow moves only in the $x$ direction. Using the same infinitesimal cube studied previously, the viscous stresses (in $x$) develop as shown in the following figure, where the letters $E,W,N,S,T,B$ represent the faces of the cube and mean the following:
- $E \hspace{0.2cm} (East – Este) $
- $W \hspace{0.2cm}(West-Oeste) $
- $N \hspace{0.2cm}(North-Norte) $
- $S \hspace{0.2cm}(South-Sur) $
- $T \hspace{0.2cm}(Top-Arriba) $
- $B \hspace{0.2cm}(Bottom-Abajo)$

As the figure shows, the shear stress along the $x$ axis is present on all 6 faces of the infinitesimal cube. Each viscous stress equation is obtained with a Taylor series, just as we did for the pressure $p$ in chapter (4). The viscous stress is denoted by $\tau$, and subscripts $ij$, as in $(\tau_{xx},\tau_{yx},\tau_{zx})$, represent the viscous stresses on the faces of the cube.
The total stress on the infinitesimal cube is the sum of the stresses acting on faces $E$ and $W$, giving:
Similarly, for faces $N, S$ and faces $T , B$ we have:
Since force equals pressure times area, $F = P \cdot A$, and stress is a tangential force per unit area, we can write $F = \tau \cdot A$. So we can write the viscous force along the $x$ axis as the sum of all the stresses (equations (24a), (24b) y (24c)) multiplied by the areas of the infinitesimal cube:
If we follow the same process for the $y$ and $z$ axes, we obtain the following:
7. Newton's Second Law for a Fluid Flow¶
Recall that Newton's second law is:
Remember that:
Substituting in differential form, knowing that $Vol = dxdydz$, we have:
Now we substitute everything we have developed to obtain the same expression as equation (26) but applied to a fluid flow.
Keep in mind that $S_x(dxdydz)$ represents the additional body forces (Coriolis, centrifugal, electromagnetic) that may exist in the fluid flow; if they are not considered, their value is zero.
If equation (29) is divided by the volume (dxdydz), we obtain the following expressions for the three axes:
8. Shear Stress as a Function of Viscosity¶
If we have a water flow as shown in the figure and a constant pressure is applied at the top, the fluid will deform continuously.

For a Newtonian fluid such as water or air, the shear stress can be expressed as:
If we analyze along the $y$ axis, we obtain the following equation:
Where:
- $\mu$; viscosidad dinámica
- $\tau_{x}$; esfuerzo cortante en $x$
- $\tau_{y}$; esfuerzo cortante en $y$
- $V_x$: velocity in the $x$ direction
- $V_y$: velocity in the $y$ direction
Likewise, the shear stresses $\tau_{xy}$ and $\tau_{yx}$ are equal in magnitude but act in opposite directions, as shown in the following figure:

The same holds for the other shear stresses, with the following equalities: $\tau_{xy}$ = $\tau_{yx}$, $\tau_{yz}$ = $\tau_{zy}$ and $\tau_{xz}$ = $\tau_{zx}$. The shear stresses applied on each face are then:
To find the equations for $\tau_{xx}$, $\tau_{yy}$ and $\tau_{zz}$, we need a relationship between the normal stresses and the velocity field. Look at the following figure. Point $A$ is fixed; however, if the body deforms, point $A$ moves to a new location $A’$. If we define this displacement as $S$, we can write it as:

We can describe the normal deformations of the volume in the figure as:
Assuming the deformation is small, we can write the equations in terms of the normal strain and the normal stresses as follows:
Where:
- $E$; Modulo de elasticidad de Young
- $\varepsilon$; Deformación normal
- $\sigma$; Esfuerzo normal
- $\nu_p$; Coeficiente de Poisson
Adding equations (36a), (36b) and (36c) we obtain the following expression:
We can also relate Young's modulus of elasticity and Poisson's ratio to the shear modulus $G$ with the following expression:
In addition, the total normal stress can be represented by the following equation:
Substituting equation (38) into (36d):
From equations (35a) and (36a) we can write:
Substituting Equation (38) into (36a) we have:
Substituting equation (37) into equation (42) we obtain the following:
We can rewrite equation (43) as:
So we have the following equality:
Solving equation (45) we are left with:
Equation (46) represents the equality seen in equation (39), so equation (44) is correct. Factoring equation (44) we obtain:
By analogy for fluids, we replace the shear modulus $G$ with the dynamic viscosity $\mu$ and the displacement components $S$ with the velocity $V$, finally obtaining the following expressions for the normal stress components along the three axes.
If we consider an incompressible fluid, then:
Equation (49) is known as the divergence of the velocity. It represents the change in velocity with respect to position $(x ,y , z)$. If its value is negative, we can say there is a sink; if it is greater than zero, there is a source. In these cases the flow is compressible, because the volumetric flow rate entering differs from the one leaving (while the mass flow rates are equal), which means the density is changing. If the value is zero, the mass flow and volumetric flow rate entering equal those leaving, so the density is constant and the flow is incompressible, $\nabla.V = 0$
The normal stresses for an incompressible fluid are:
Expressing the same equations in terms of the viscous stresses, we have:
Substituting equations (51a) and (33a) into equation (30a), respectively, we obtain the following equation:
For incompressible flow without external forces: