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

From OpenFOAMWiki
(The PISO algorithm)
m (Category:Numerical_methods)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{VersionInfo}}{{Version1.4}}{{Version1.5}}{{Version1.6}}
 +
 
== The PISO algorithm ==
 
== The PISO algorithm ==
  
Line 5: Line 7:
 
* No under-relaxation is applied.
 
* No under-relaxation is applied.
 
* The momentum corrector step is performed more than once.
 
* The momentum corrector step is performed more than once.
 +
 +
The algorithm can be summed up as follows:
 +
 +
# Set the boundary conditions.
 +
# Solve the discretized momentum equation to compute an intermediate velocity field.
 +
# Compute the mass fluxes at the cells faces.
 +
# Solve the pressure equation.
 +
# Correct the mass fluxes at the cell faces.
 +
# Correct the velocities on the basis of the new pressure field.
 +
# Update the boundary conditions.
 +
# Repeat from 3 for the prescribed number of times.
 +
# Increase the time step and repeat from 1.
 +
 +
As already seen for the [[The SIMPLE algorithm in OpenFOAM | SIMPLE]] algorithm, the steps 4 and 5 can be repeated for a prescribed number of time to correct for non-orthogonality.
  
 
== Implementation of the PISO algorithm in OpenFOAM ==
 
== Implementation of the PISO algorithm in OpenFOAM ==
Line 30: Line 46:
  
 
<cpp>
 
<cpp>
  volScalarField AU = UEqn().A();
+
  volScalarField rUA = 1.0/UEqn().A();
  U = UEqn().H()/AU;
+
  U = rUA*UEqn().H();
 
</cpp>
 
</cpp>
  
Line 38: Line 54:
 
<cpp>
 
<cpp>
 
  phi = (fvc::interpolate(U) & mesh.Sf())  
 
  phi = (fvc::interpolate(U) & mesh.Sf())  
       + fvc::ddtPhiCorr(1/AU, U, phi);
+
       + fvc::ddtPhiCorr(rUA, U, phi);
 
  adjustPhi(phi, U, p);
 
  adjustPhi(phi, U, p);
 
</cpp>
 
</cpp>
Line 47: Line 63:
 
  fvScalarMatrix pEqn
 
  fvScalarMatrix pEqn
 
  (
 
  (
     fvm::laplacian(1.0/AU, p) == fvc::div(phi)
+
     fvm::laplacian(rUA, p) == fvc::div(phi)
 
  );
 
  );
 
  pEqn.setReference(pRefCell, pRefValue);
 
  pEqn.setReference(pRefCell, pRefValue);
Line 56: Line 72:
  
 
<cpp>
 
<cpp>
  phi -= pEqn.flux();
+
  if (nonOrth == nNonOrthCorr)
 +
{
 +
    phi -= pEqn.flux();
 +
}
 
</cpp>
 
</cpp>
  
Line 68: Line 87:
  
 
<cpp>
 
<cpp>
  U -= fvc::grad(p)/AU;
+
  U -= rUA*fvc::grad(p);
 
  U.correctBoundaryConditions();
 
  U.correctBoundaryConditions();
 
</cpp>
 
</cpp>
Line 79: Line 98:
  
 
H. Jasak, Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flows, Ph.D. Thesis, Imperial College, London, 1996.
 
H. Jasak, Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flows, Ph.D. Thesis, Imperial College, London, 1996.
 +
 +
 +
[[Category:Numerical_methods]]

Latest revision as of 08:21, 7 September 2013

Valid versions: OF version 14.png OF version 15.png OF version 16.png

1 The PISO algorithm

The PISO (Pressure Implicit with Splitting of Operators) is an efficient method to solve the Navier-Stokes equations in unsteady problems. The main differences from the SIMPLE algorithm are the following:

  • No under-relaxation is applied.
  • The momentum corrector step is performed more than once.

The algorithm can be summed up as follows:

  1. Set the boundary conditions.
  2. Solve the discretized momentum equation to compute an intermediate velocity field.
  3. Compute the mass fluxes at the cells faces.
  4. Solve the pressure equation.
  5. Correct the mass fluxes at the cell faces.
  6. Correct the velocities on the basis of the new pressure field.
  7. Update the boundary conditions.
  8. Repeat from 3 for the prescribed number of times.
  9. Increase the time step and repeat from 1.

As already seen for the SIMPLE algorithm, the steps 4 and 5 can be repeated for a prescribed number of time to correct for non-orthogonality.

2 Implementation of the PISO algorithm in OpenFOAM

The PISO algorithm is implemented in OpenFOAM as follows (Details can be found in the icoFoam standard solver provided with OpenFOAM):

  • Define the equation for U
 
 fvVectorMatrix UEqn
 (
   	fvm::ddt(U)
      + fvm::div(phi, U)
      - fvm::laplacian(nu, U)
 );
  • Solve the momentum predictor
 
 solve (UEqn == -fvc::grad(p));
  • Calculate the a_p coefficient and calculate U
 
 volScalarField rUA = 1.0/UEqn().A();
 U = rUA*UEqn().H();
  • Calculate the flux
 
 phi = (fvc::interpolate(U) & mesh.Sf()) 
       + fvc::ddtPhiCorr(rUA, U, phi);
 adjustPhi(phi, U, p);
  • Define and solve the pressure equation and repeat for the prescribed number of non-orthogonal corrector steps
 
 fvScalarMatrix pEqn
 (
    fvm::laplacian(rUA, p) == fvc::div(phi)
 );
 pEqn.setReference(pRefCell, pRefValue);
 pEqn.solve();
  • Correct the flux
 
 if (nonOrth == nNonOrthCorr)
 {
    phi -= pEqn.flux();
 }
  • Calculate continuity errors
 
# include "continuityErrs.H"
  • Perform the momentum corrector step
 
 U -= rUA*fvc::grad(p);
 U.correctBoundaryConditions();
  • Repeat from the calculation of a_p for the prescribed number of PISO corrector steps.

3 References

J. H. Ferziger, M. Peric, Computational Methods for Fluid Dynamics, Springer, 3rd Ed., 2001.

H. Jasak, Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flows, Ph.D. Thesis, Imperial College, London, 1996.