Sig Turbomachinery Library turboPerformance

From OpenFOAMWiki
Revision as of 13:42, 16 April 2010 by Hani (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Valid versions: OF version 15.png

1 Description

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

The code is not available yet, but should be posted at OpenFOAM-extend by the time of the 5th OpenFOAM Workshop.

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 Compilation and installation

Follow the instructions on compiling and installing libOpenFOAMTurbo (right now this functionObject is not there, but should be there by the time of the 5th OpenFOAM Workshop)

2.2 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 ("libperformance.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 ("libperformance.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 ("libperformance.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 (at the time of the 5th OpenFOAM Workshop), 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

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

Some equations should be added here to describe the functionality.

5 Download

Follow the instructions of libOpenFOAMTurbo (will be included by the time of the 5th workshop)