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
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 that a 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
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
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.
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.
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)
: efficiency (%)
5 Download and compile
svn co https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.5/OSIG/TurboMachinery/src/turboPerformance wmake libso turboPerformance