1.2: Code examples

This manual contains several dozen code examples to illustrate the use of the ChemApp subroutines and to support the method of learning-by-changing. Virtually all example codes are part of the distribution of the online manual, and you should feel encouraged to take these examples and start changing and editing them to take your own steps in programming with ChemApp. After receiving your distribution of ChemApp, it is reommended though to first run the program CADEMO1 and compare the results it produces on your computer with the master results which are normally included in the distribution. If you are using a FORTRAN or C distribution of ChemApp, you might also want to have a look at Appendix F and G for that purpose.

The code examples have been designed to be both concise and easy to understand in terms of the ChemApp features involved. In terms of the application language used (FORTRAN and C), they require only basic knowledge. To keep these code examples short and easy to read, error handling has usually been neglected. In your own ChemApp programs, you should as early as possible adopt the policy to check the value of the error variable that every ChemApp subroutine returns.

The code examples used throughout this manual and the results they produce are not simply copied and pasted into the document. When the manual is produced, each code example is automatically compiled, linked to ChemApp, run, and checked for runtime errors reported by ChemApp. Only if no error occurred the code is mixed with the output produced during runtime, syntax-highlighted, and included into the manual. This guarantees that all example programs compile and run without problems with the ChemApp version that has been used to produce the manual. For the production of this edition of the manual Version 5.0.2 of ChemApp was used.



1.3: About ChemApp and ChemApp light

This is the documentation of the light version of ChemApp. It differs from the documentation of the regular version of ChemApp only by this chapter and by some additional notes relating to ChemApp light in the subsequent parts of this manual. Both ChemApp light (the library itself) and this online documentation are distributed free of charge for non-commercial uses through GTT's Technical Thermochemistry Web Page and are available to anyone. Before you start using it, please

If you have any questions or suggestions relating to ChemApp light and this documentation, please contact us by e-mail: support@gtt-technologies.de. Please also note that in order to receive technical support for ChemApp light beyond questions relating to the download and installation, you need to be registered, which is free (see below).

1.3.1: What is ChemApp light?

ChemApp light is a free version of ChemApp, and although it is restricted in two ways compared to the regular version, it gives you almost the same functionality.

To learn more about ChemApp in general, our programmer's library for the calculation of complex, multicomponent, multiphase equilibria, read through the following chapters of this manual. Also, our web site (GTT's Technical Thermochemistry Web Page) has its own section on ChemApp with lots of valuable information.

1.3.2: How does it differ from the regular version?

First of all, it is free of charge. This of course means that its power is restricted compared to the regular version. The restrictions are related to two aspects of ChemApp:

In all other calculational aspects, ChemApp light has the same capabilities as the regular version. This includes the calculation of thermochemical equilibria and their associated extensive property balances, the calculation of thermochemical function values, and the choice between using global conditions or streams (see Chapter 1.6.1), to name just a few.

It exhibits the same speed and ability to converge that the regular version of ChemApp is famous for.

Also, this online documentation is virtually the same as the one for the regular version of ChemApp, apart from the present chapter.

Both ChemApp light and this manual are only available from GTT's Technical Thermochemistry Web Page, though it might be distributed through other selected channels in the future. This manual of ChemApp light is only available in online form, not as a printed version.

1.3.3: What are the terms and conditions of use?

  1. By using ChemApp light (or anything produced with it or including it) you indicate your acceptance of this license, and all its terms and conditions.

  2. GTT-Technologies remains the sole owner and copyright holder of every copy of ChemApp light. ChemApp light may at any time be modified by GTT-Technologies without prior notice.

  3. Conditions of use of ChemApp light

  4. If, as a private or educational/academic user, you distribute programs containing ChemApp light under the conditions given above, you must accompany it with the information as to where the corresponding ChemApp light object code may be obtained. For this purpose, a reference to the web page http://www.gtt-technologies.de/ should be included.

    Your program must display a ChemApp light copyright notice. For this purpose, the copyright notice given by the ChemApp subroutine TQCPRT should be used.

    You must include a copy of this license with all your programs which make use of ChemApp light, stating that using your programs means accepting this license of ChemApp light and its terms and conditions of use.

  5. You may not modify or sublicense ChemApp light and its documentation in any way. Any attempt to modify or sublicense will automatically terminate your rights to use ChemApp light under this license.

  6. Distributing ChemApp light and/or making available its documentation in any of the following manners is prohibited, unless you have the prior written consent of GTT-Technologies:

    Note: This does not mean that the above ways of distribution are prohibited or unwanted, it just means that you need to get the prior written consent of GTT-Technologies.

  7. GTT-Technologies may publish revised and/or new versions of this license from time to time. Such new versions will be similar to the present version, but may differ in details.

  8. BECAUSE ChemApp light IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR IT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE ChemApp light "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND SUITABILITY FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF ChemApp light IS WITH THE USER. SHOULD THE PROGRAM PROVE DEFECTIVE, THE USER ASSUMES THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  9. If you are unsure whether your use of ChemApp light is carried out according to this license, contact GTT-Technologies for clarification, but do not use ChemApp light in a manner which is not covered by the above guidelines unless you have the prior written consent of GTT-Technologies.

1.3.4: What about support?

If you have any questions relating to ChemApp light, you should first consult the ChemApp FAQ, which is available at http://gttserv.lth.rwth-aachen.de/~sp/tt/chemapp/ca-faq.htm. It addresses a multitude of standard questions about ChemApp, ChemApp light, and related topics. If you cannot find the answer to your questions there, contact us by e-mail.

To receive e-mail support for ChemApp light beyond questions relating to download and installation, you must register. Registration is free. While registration is not absolutely necessary, we strongly encourage you to do so, since support is not the only benefit from registration (see below, Do I need to register?).

All your support issues relating to ChemApp light, this documentation, as well as the data-files and programs that come with it should be directed by e-mail to support@gtt-technologies.de.

GTT-Technologies cannot guarantee that every technical question about ChemApp light or its application for the project you have in mind can be answered, and is answered in a timely fashion.

If you want or need full support for ChemApp, we will be happy to quote you for the regular version of ChemApp, which includes extensive support.

1.3.5: Do I need to register?

While you do not necessarily have to register your free copy of ChemApp light, we would very much like you to do so. You will benefit from registration in several ways:

To register, either

1.3.6: What about thermochemical data?

ChemApp itself is the engine that performs the equilibrium calculations. The thermochemical data that describe the chemical system in terms of its system components, phases, and phase constituents, are contained in a separate thermochemical data-file. These ChemSage-compatible data-files can come from various sources (see Chapter 1.11), and can also be assembled by you.

ChemApp light, like the regular version of ChemApp, comes with a selection of example data-files, which give you everything you need to start doing real-life equilibrium calculations right away. See Chapter 1.12 for a list of example data-files that are included, and what their potential application areas are.

1.3.7: What else do I need to start working with it?

Apart from the version of ChemApp light suitable for your system, you just need your compiler and linker and you are ready to go. Use any of the code examples to verify that you are compiling and linking correctly. A suitable program for this purpose is cademo1, either the FORTRAN (cademo1.f) or the C (cademo1.c) version. Compile any of these programs, link it against your version of the ChemApp light library, and compare the results with those in Chapters F and G.

1.3.8: When should I opt for the regular version of ChemApp instead?

You should consider stepping up to the regular version of ChemApp, if you experience any of the following:

The need to handle larger chemical systems:
The regular version of ChemApp can handle systems of up to 30 system components, 1500 constituents, and 40 mixture phases.

The need to perfom target calculations:
The regular version offers the complete range of fast, numerically stable target calculations. These include phase targets (formation and precipitation phase targets), as well as extensive property targets (heat capacity, enthalpy, entropy, Gibbs energy, and volume targets; example: determination of a adiabatic flame temperature).

The need to perform one-dimensional phase mapping calculations:
As of version 3.0.0, ChemApp is able to to perform one-dimensional phase mapping calculations. One-dimensional phase mapping is generally used to search for phase boundaries within the range of a given variable (temperature, pressure, or composition). With only a few lines of code it allows the programmer to automatically locate every phase boundary within a specified range.

The need to commercially distribute your product which contains ChemApp:
The regular version of ChemApp is available for licensing if you wish to include ChemApp in your commercial software.

The need to use ChemApp in fee-charging consultancy services:
If you wish to use ChemApp for your fee-charging consultancy services, you also need the regular version.

The need for full support:
The regular version of ChemApp includes support and technical assistance by e-mail, fax, and phone.


ChemApp Programmer's Manual, Edition 3.6© GTT-Technologies, 2003