# Sig Turbomachinery Library turboPerformance

Valid versions:

## 1 Description

The purpose of this functionObject library is to provide simple functionality that is useful in turbomachinery CFD analysis.

### 1.1 Contributions

Mikko Auvinen, Helsinki University of Technology, Finland

Håkan Nilsson, Chalmers University of Technology, Sweden

David Boger, Penn State University - ARL, USA (Porting to OpenFOAM-1.6-ext)

Bryan Lewis, Penn State University, USA (Adding turbine analysis capability)

### 1.2 Invitation for contributions

The scope of this library are functionObjects that are

• useful for turbomachinery CFD analysis
• general enough to be used with more than one solver
• don't destroy any other feature

Anybody who thinks something is missing from the library and feels able to implement it is invited to do so (you just need write access to the OpenFOAM-extend subversion archive)

## 2 Usage

### 2.1 Additions to controlDict (OpenFOAM-1.5-dev)

The functionObject is activated by adding an entry like this to the system/controlDict of a case:

functions
(
turboPerformance
{
type turboPerformance;
functionObjectLibs ("libturboPerformance.so");
inletPatches (inlet);   // inlet patches, can be multiple
outletPatches (outlet); // outlet patches, can be multiple
patches (rotor);        // rotor/impeller patches, can be multiple
log true;               // write data to screen (true/false, false by default)
rhoInf 998.0;           // density
CofR (0 0 0);           // center of rotation
omega (0 0 62.8);       // Rotational velocity (rad/s)
// The following are optional, if the code uses different nomenclature:
// pName  p;
// Uname U;
// phiName phi;
}


The turboPerformance functionObject actually uses two other functionObjects that can each be used explicitly:

    fluidPower
{
type fluidPower;
functionObjectLibs ("libturboPerformance.so");
inletPatches (inlet);   // inlet patches, can be multiple
outletPatches (outlet); // outlet patches, can be multiple
log true;               // write data to screen (true/false, false by default)
rhoInf 998.0;           // reference density needed for incompressible solvers
}
forces
{
type forces;
functionObjectLibs ("libturboPerformance.so");
patches (rotor);        // rotor/impeller patches, can be multiple
log true;               // write data to screen (true/false, false by default)
rhoInf 998.0;           // reference density needed for incompressible solvers
CofR (0 0 0);           // center of rotation
}
);


I.e., there can be more than one functionObject; each entry just has to be one named dictionary. The forces functionObject is a direct copy of the one in OpenFOAM-1.5 (\$FOAM_SRC/postProcessing/forces/forces). The reason for this is to make the turboPerformance functionObject completely independent of changes in the original files.

The entries pre-defined by the OpenFOAM-functionObject mechanism are

functionObjectLibs
Libraries that have to be loaded in order for this functionObject to work
type
the type of the functionObject

The entries for the functionObjects in this library are:

inletPatches
used in the fluidPower(and therefore also turboPerformance) functionObject to calculate the power removed from (or given to) the fluid between the inlet and the outlet
outletPatches
used in the fluidPower (and therefore also turboPerformance) functionObject to calculate the power removed from (or given to) the fluid between the inlet and the outlet
patches
used in the forces (and therefore also turboPerformance) functionObject to calculate the viscous and pressure forces on the specified patches
log
If set to true, will give information also to the screen. Information will always be printed in the output file.
rhoInf
The reference density, needed for incompressible solvers to get the correct units on the output.
CofR
Center of rotation, used in the forces (and therefore also turboPerformance) functionObject, to calculate the moment.
omega
Used by the turboPerformance functionObject to calulate the shaft power.

The following are optional, if the code uses different nomenclature:

pName
Specify the name used for "p" in the code
Uname
Specify the name used for "U" in the code
phiName phi
Specify the name used for "phi" in the code

### 2.2 Additions to controlDict (OpenFOAM-1.6-ext)

The functionObject is activated by adding an entry like this to the system/controlDict of a case:

functions
(
turboPerformance
{
type turboPerformance;
functionObjectLibs ("libturboPerformance.so");
turbine false;                        // Turbine mode, (false if Pump)
//
log true;                                // write data to screen (true/false)
outputControl timeStep;    // write data to file (same options as case output)
outputInterval 1;                 // interval to write data to file
//
inletPatches (inlet);           // inlet patches, can be multiple
outletPatches (outlet);      // outlet patches, can be multiple
patches (roter);                  // rotor/impeller patches, again can be multiple
//
rhoInf 998.0;                      // density
CofR (0 0 0);                      // center of rotation
omega (0 0 52.2395);      // Rotational velocity (rad/s)
/*
pName  p;               //Optional: if p field is not called "p", give a new name here
Uname Uabs;         //Optional: if U field is not called "U", give a new name here
phiName phi;         //Optional: if phi (flux) field is not called "phi", give a new name here
*/
}

   fluidPower
{
type fluidPower;
functionObjectLibs ("libturboPerformance.so");
//
turbine false;             // Turbine mode, (false if Pump)
//
log true;                  // write data to screen (true/false)
outputControl timeStep;    // write data to file (same options as case output)
outputInterval 1;          // interval to write data to file
//
inletPatches (inlet);
outletPatches (outlet);
rhoInf 998.0;
}

   forces
{
type forces;
functionObjectLibs ("libturboPerformance.so");
//
log true;                  // write data to screen (true/false)
outputControl timeStep;    // write data to file (same options as case output)
outputInterval 1;          // interval to write data to file
//
patches (rotor);
rhoInf 998.0;
CofR (0 0 0);
}

);


Just as in in the 1.5 version ,there can be more than one functionObject, or the turboPerformance, fluidPower, and 'forces functionObject can be used individually.

The new entries pre-defined by the OpenFOAM-1.6-ext-functionObject mechanism are

turbine
A bool flag to specify if the equations for pumps or turbines should be used. [true=turbine, false=pump]
outputControl
Control when the data is written to the file and screen, and uses the same options as the case output
outputInterval
Control the output interval to both the file and the screen

--Bryan Lewis 18:07, 21 June 2011 (CEST)

## 3 Tutorial

A simple tutorial is provided in turboPerformance/tutorials/mixerVessel2DpumpMRF-1.5-dev, which is the mixer2D case, but with an inlet and an outlet. The case set-up is questionable, but it illustrates the use of the functionObject. Run the tutorial by typing:

./Allrun


Note that you must have MRFSimpleFoam compiled for this to work. MRFSimpleFoam is located in the tutorials directory of the OpenFOAM installation, and is thus not automatically compiled when you do Allwmake.

### 3.1 Plotting

A Python script (plotTurbo.py) is provided in the tutorial case directory, plotting the results of the turboPerformance functionObject. Simply run the script by typing:

./plotTurbo.py


Ideally, this script should be copied to a location that is in the path.

Note that the efficiency is larger than 100%, which is most likely due to errors in the case setup.

You need the following for this to work: numpy, python-matplotlib, scipy

## 4 Theory

The file fluidPower.C gives an output named ΔEMH which comprises two components: ΔEMH = (ΔEMH1EMH2). The first component is the rate of work output (in Watts, W) and is computed through the equation:

   ΔEMH1 = EM,outlet + EM,inlet


where

   EM,outlet = ρΣΦbpt,outlet, outflow of the mechanical energy, positive since the flow is outwards from the boundaries
EM,inlet = ρΣΦbpt,inlet, inflow of the mechanical energy, negative since the flow is into the boundaries
$P_{t}=\frac{p_b}{\rho}+\frac{U_b^2}{2}$, total pressure divided by the density at the out/inlet


The quantities pb, Ub and Φb refer to p, U and Φ at the boundaries respectively, where Φ is the face flux and ρ is the fluid density. The sum operator Σ means a sum over all faces in each boundary. Notice that the outflow and inflow of the mechanical energy are added together since they have opposite signs. That is to say, by definition the outflow of the mechanical energy has a positive sign and the inflow of the mechanical energy has a negative sign.

The second component gives the hydrodynamic head (in meters, m) and is computed as below:

    $\Delta E_MH_2=\frac{E_{M,outlet}+E_{M,inlet}}{-\dot m_{f,inlet}*9.81}$


where

    $\dot m_{f,inlet}=\rho\Sigma\Phi_b$ is the mass flow rate at the inlet, negative


The mass flow at the inlet is negative since the velocity vectors and area normal vectors at the inlet are in opposite directions. Note that in the code the quantities ΔEMH1 and ΔEMH2 are denoted as dEmH.first() and dEmH.second() respectively.

Note: For turbines, the flow is reversed, so ΔEMH2 must be multiplied by ( − 1)

The forces and moments on the rotating patches are computed according to the formulations in the file "forces.C". The function has an output fm, which has 4 components:

    $f_m=\left[\begin{array}{rl}\vec f_{m1,1}\ \vec f_{m1,2}\\\vec f_{m2,1}\ \vec f_{m2,2}\end{array}\right]$


here

   $\vec f_{m1,1}=\rho\Sigma (p\vec A)$ is the sum of pressure forces on all faces in the patch with $\vec A$ being the area normal vector for each face.

   $\vec f_{m1,2}=\Sigma(\vec A.\vec v_f)$ is the sum of viscous forces on all faces in the patch with $\vec v_f=\vec\tau_{\nu,eff}$ being the effective viscous stress tensor.

   $\vec f_{m2,1}=\rho\Sigma(\vec M_d \times (p\vec A))$ is the sum of pressure moments on all faces in the patch with $\vec M_d$ being the position vector with respect to CofR.

   $\vec f_{m2,2}=\Sigma(\vec M_d\times\vec v_f)$ is the sum of viscous moments on all faces in the patch.


The application turboPerformance gives the following pieces of information:

   $\vec F_{tot}=\vec f_{m1,1}+\vec f_{m1,2}$: total force as the sum of pressure and viscous forces

   $\vec M_{tot}=\vec f_{m2,1}+\vec f_{m2,2}$: total moment as the sum of pressure and viscous moments

   $T.\omega=|\vec M_{tot}.\vec\omega|$: the axial power (W)

   $\eta_P=\frac{\Delta E_MH_1}{T.\omega}*100$: PUMP efficiency (%)

   $\eta_T=\frac{T.\omega}{\Delta E_MH_1}*100$: TURBINE efficiency (%)


For OpenFOAM-2.0

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/OSIG/TurboMachinery/src/turboPerformance


To compile For OpenFOAM-1.6

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.6/OSIG/TurboMachinery/src/turboPerformance


To compile For OpenFOAM-1.5-dev

svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.5/OSIG/TurboMachinery/src/turboPerformance


To compile

wmake libso turboPerformance


## 6 Forks

The following is a list of known forks/variants of this library: