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

From OpenFOAMWiki
 
(Implementation of the PISO algorithm in OpenFOAM)
Line 5: Line 5:
 
== Implementation of the PISO algorithm in OpenFOAM ==
 
== Implementation of the PISO algorithm in OpenFOAM ==
  
The PISO algorithm is implemented in OpenFOAM as follows:
+
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
 
* Define the equation for U

Revision as of 22:47, 12 March 2007

1 The PISO algorithm

TODO: Add a description of the algorithm here.

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 AU = UEqn().A();
 U = UEqn().H()/AU;
  • Calculate the flux
 
 phi = (fvc::interpolate(U) & mesh.Sf()) 
       + fvc::ddtPhiCorr(1/AU, 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(1.0/AU, p) == fvc::div(phi)
 );
 pEqn.setReference(pRefCell, pRefValue);
 pEqn.solve();
  • Correct the flux
 
 phi -= pEqn.flux();
  • Calculate continuity errors
 
# include "continuityErrs.H"
  • Perform the momentum corrector step
 
 U -= fvc::grad(p)/AU;
 U.correctBoundaryConditions();
  • Repeat from the calculation of a_p for the prescribed number of PISO corrector steps.