The major routine for three-dimensional Navier-Stokes Calculations (compressible and incompressible fluids) is compfluidfem.c. The flow diagram for incompressible and compressible fluids is shown in Figure 173 and 174, respectively. Right now, compfluidfem.c is called once in routine nonlingeo.c. Later on, combined fluid-structure calculations are planned.

The theory behind the fluid calculations is explained in Section 6.9.19. Incompressible fluids (liquids) are calculated using a semi-implicit scheme (the variables compressible and explicit take the value 0), for compressible fluids (gases) an explicit scheme is used ( , the variables compressible and explicit take the value 1).

Depending on the application different systems of equations have to be solved, corresponding to the transport equations of mass, momentum, total internal energy, turbulent kinetic energy and turbulence frequency . According to the Characteristic Based Split Method (CBS) [99], a complete increment in time consists of the following steps :

- First part of the momentum equation: determination of the first time change of the momentum
- Conservation of mass: determination of the pressure time change for incompressible fluids and the density time change for compressible fluids
- Second part of the momentum equation: determination of the second time change of the momentum
- Conservation of energy: determination of the time change of the total internal energy per unit of volume
- Turbulence equations: calculation of the time change of the total kinetic energy and the turbulence frequency

The total time change of the momentum is . Notice that all variables are written in their conservative form. Indeed, it is not which is conserved, but and so on.

Each of the above sets leads to a linear equation system to be solved for that increment.

- Renumbering
- Topological information
- Determining the structure of the system matrices
- Initial calculations
- The left hand sides of the equation systems
- Determining the time increment
- Determining the loading
- Step 1: determining
- Step 2: determining the pressure/density correction
- Step 3: determining the second momentum correction
- Step 4: determining the energy correction
- Step 5: determining the turbulence corrections
- Updating the conservative variables
- Smoothing the conservative variables for gases
- Determining the physical variables
- Application of BC's
- Calculation of the smoothing field
- Convergence check
- Result output