Difference between revisions of "OpenFOAM guide/The SIMPLE algorithm in OpenFOAM"

From OpenFOAMWiki
(The SIMPLE algorithm)
(The SIMPLE algorithm)
Line 13: Line 13:
 
The solution of this couple of equations is not straightforward because an explicit equation for the pressure is not available. One of the most common approaches is to derive an equation for the pressure by taking the divergence of the momentum equation and by substituting it in the continuity equation.
 
The solution of this couple of equations is not straightforward because an explicit equation for the pressure is not available. One of the most common approaches is to derive an equation for the pressure by taking the divergence of the momentum equation and by substituting it in the continuity equation.
  
The momentum equation can be re-written in a semi discretized form as follows:
+
The momentum equation can be re-written in a semi discretised form as follows:
  
 
<math>
 
<math>
Line 27: Line 27:
 
The first term of <math>H(\vec{U})</math> represents the matrix coefficients of the neighbouring cells multiplied by their velocity, while the second part contains the unsteady term and all the sources except the pressure gradient.
 
The first term of <math>H(\vec{U})</math> represents the matrix coefficients of the neighbouring cells multiplied by their velocity, while the second part contains the unsteady term and all the sources except the pressure gradient.
  
The continuity equation is discretized as:
+
The continuity equation is discretised as:
  
 
<math>
 
<math>
Line 33: Line 33:
 
</math>
 
</math>
  
where <math>\vec{S}</math> is outward-pointing face area vector and <math>U_f</math> the velocity on the face.
+
where <math>\vec{S}</math> is outward-pointing face area vector and <math>\vec{U}_f</math> the velocity on the face.
 +
 
 +
The velocity on the face is obtained by interpolating the semi discretised form of the momentum equation as follows:
 +
 
 +
<math>
 +
\vec{U}_f = \left( \frac{H(\vec{U})}{a_p}\right)_f - \frac{\left( \nabla p\right)_f }{\left( a_p\right)_f}
 +
</math>
 +
 
 +
By substituting this equation into the discretised continuity equation obtained above, we obtain the pressure equation:
 +
 
 +
<math>
 +
\nabla \cdot \left( \frac{1}{a_p} \nabla p \right) = \nabla \cdot \left( \frac{H(\vec{U})}{a_p} \right) = \sum_f \vec{S} \left( \frac{H(\vec{U})}{a_p}\right)_f
 +
</math>
  
 
== Implementation of the SIMPLE algorithm in OpenFOAM ==
 
== Implementation of the SIMPLE algorithm in OpenFOAM ==
  
 
== References ==
 
== References ==

Revision as of 13:22, 12 March 2007

1 The SIMPLE algorithm

The Navier-Stokes equations for a single-phase flow with a constant density and viscosity are the following:


 \nabla \cdot \left( \rho \vec{U} \right) = 0


 \frac{\partial U}{\partial t} + \nabla \cdot \left( \vec{v} \vec{v} \right) - \nabla \cdot \left( \nu \nabla \vec{v} \right) = - \nabla p

The solution of this couple of equations is not straightforward because an explicit equation for the pressure is not available. One of the most common approaches is to derive an equation for the pressure by taking the divergence of the momentum equation and by substituting it in the continuity equation.

The momentum equation can be re-written in a semi discretised form as follows:


 a_p \vec{U_p} = H(\vec{U}) - \nabla p \Longleftrightarrow \vec{U_p} = \frac{H(\vec{U})}{a_p} - \frac{\nabla p}{a_p}

where


H(\vec{U}) = - \sum_n a_n \vec{U}_n + \frac{\vec{U}^o}{\Delta t}

The first term of H(\vec{U}) represents the matrix coefficients of the neighbouring cells multiplied by their velocity, while the second part contains the unsteady term and all the sources except the pressure gradient.

The continuity equation is discretised as:


 \nabla \cdot \vec{U} = \sum_f \vec{S} \vec{U}_f

where \vec{S} is outward-pointing face area vector and \vec{U}_f the velocity on the face.

The velocity on the face is obtained by interpolating the semi discretised form of the momentum equation as follows:

 
 \vec{U}_f = \left( \frac{H(\vec{U})}{a_p}\right)_f - \frac{\left( \nabla p\right)_f }{\left( a_p\right)_f}

By substituting this equation into the discretised continuity equation obtained above, we obtain the pressure equation:


 \nabla \cdot \left( \frac{1}{a_p} \nabla p \right) = \nabla \cdot \left( \frac{H(\vec{U})}{a_p} \right) = \sum_f \vec{S} \left( \frac{H(\vec{U})}{a_p}\right)_f

2 Implementation of the SIMPLE algorithm in OpenFOAM

3 References