Function set 'define' to define a specific Stirling engine configuration

One of the main purposes of this course is to develop a computer simulation of a Stirling engine. Before any simulation can take place we need to define a specific configuration. Thus we need to specify the type and geometry of the engine, the three heat exchangers, the working gas and the operating conditions. Once these have been specified then we can go to three levels of simulation: an isothermal Schmidt analysis, an Ideal Adiabatic analysis, and a Simple analysis to evaluate the effect of non ideal heat exchangers.

In this section we consider the function 'define', which includes the system definition and the Schmidt analysis. The program system is written in the ANSI C language and currently resides under the UNIX operating system on a SUN Sparc10 workstation 'condor' at Ohio University. It can be conveniently accessed from the web by the 'Telnet' option and each student will be assigned a login account. The Stirling engine directory including all the relevant files is located at: /home/condor/stirling, however the various files may be viewed from this web page for convenience.

Consider first the functional block diagram of the function set 'define', which has three main purposes:

The seventeen functions comprizing the set are included in the six files: 'define.c', 'engine.c', 'heatex.c', 'regen.c', 'gas.c', and 'operat.c'. All the global variables required for the simulation are declared in the header file 'define.h', and the main purpose of invoking 'define' is to assign values to these global variables. Notice that there are only two engine configurations specified: 'sinedr()' for a basic sinusoidal drive and 'yokedr()' for a Ross yoke-drive machine. Similarly the heat exchangers and regenerator have a limited set of options. This is a tutorial system and user is expected to augment it as required for any specific requirements. To this end the program system has been written in a universal and uniform style with strict rules regarding structure, variable names, and commenting, thus making it a self documenting system.

The system can be tested by compiling it with the main function module in the file 'stimdef.c'. It is an arduous task to compile and recompile a large system of functions, hence we use the 'make' command available in UNIX systems. It has the advantage of automatically recompiling only those functions which have been modified since the previous compilation. Use of this command requires the existance of a special file named 'makefile' which contains the relevant compilation and linking options. The 'makefile' shown in the 'define' directory will compile and link the system according to the scheme shown in the above diagram. For more information on 'makefile' refer to the book "Managing Projects with make", by Andrew Oram and Steve Talbot.

A typical execution output of the program is saved as 'print.data'. Not very exciting, however recall that this set of routines were not designed to be executed independently, but as a precursor to the Ideal Adiabatic simulation or the Simple simulation routines, which will be discussed in detail later.

__________________________________________________________________________

Telnet: "condor"

The process of logging on and using a UNIX machine including a tutorial on useful UNIX commands and the basic 'vi' editor can be reviewed in the "Computer Methods in Engineering" website.

After logging on to "condor" change directory to the 'define' sub-directory as follows:
cd /home/condor/stirling/define
All of the computer program modules specified above are in this directory, and should be copied to your home directory as follows:
cp * ~
The system of funtions including the main function 'stimdef' can be compiled, linked and executed as follows:
make stimdef
stimdef

One of your tasks will be to augment the various modules to simulate and design the specific engine assigned to you. Currently the engine modules are for Alpha machines, including a Sinusoidal drive and a Ross Yoke-drive machine. The heat exchanger types include tubular, annular gap, and slot heat exchangers, and the regenerator matrix types include screen mesh and rolled foil matrices. Working gas types include air, helium, and hydrogen.

__________________________________________________________________________

On to the Ideal Adiabatic Analysis

On to the Simple Analysis

Back to the Stirling Cycle Machines home page