Sig Turbomachinery Library turboPerformance
Contents
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 which comprises two components: . The first component is the rate of work output (in Watts, W) and is computed through the equation:
where
, outflow of the mechanical energy, positive since the flow is outwards from the boundaries , inflow of the mechanical energy, negative since the flow is into the boundaries , total pressure divided by the density at the out/inlet
The quantities , and refer to , 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:
where
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 and are denoted as and respectively.
Note: For turbines, the flow is reversed, so must be multiplied by
The forces and moments on the rotating patches are computed according to the formulations in the file "forces.C". The function has an output , which has 4 components:
here
is the sum of pressure forces on all faces in the patch with being the area normal vector for each face.
is the sum of viscous forces on all faces in the patch with being the effective viscous stress tensor.
is the sum of pressure moments on all faces in the patch with being the position vector with respect to CofR.
is the sum of viscous moments on all faces in the patch.
The application turboPerformance gives the following pieces of information:
: total force as the sum of pressure and viscous forces
: total moment as the sum of pressure and viscous moments
: the axial power (W)
: PUMP efficiency (%)
: TURBINE efficiency (%)
5 Download and compile
- For OpenFOAM-2.0:
svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/OSIG/TurboMachinery/src/turboPerformance
- For OpenFOAM-1.6-ext, foam-extend 3.0 and foam-extend 3.1:
svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.6/OSIG/TurboMachinery/src/turboPerformance
- For OpenFOAM-1.5-dev:
svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_1.5/OSIG/TurboMachinery/src/turboPerformance
Then to compile the library, run:
wmake libso turboPerformance
6 Forks
The following is a list of known forks/variants of this library:
- Unofficial adaptation of this library turboPerformance by Bruno Santos for OpenFOAM 2.1.x, 2.2.x and 2.3.x: OSIG-TurboMachinery-turboPerformance-OF2.x @ github
- Note: at the time of this writing (21:16, 8 June 2014 (CEST)), it has not been thoroughly tested.
- Unofficial adaptation of this library turboPerformance by Bruno Santos for foam-extend 3.2 and 4.0: OSIG-TurboMachinery-turboPerformance-foam-extend @ github
- Note: at the time of this writing (00:31, 26 April 2017 (CEST)), it has not been thoroughly tested.