|
|
Use and design of external classes
Last modified:
04/25/2012 01:36 AM
This document is an introduction to the mechanism of external classes of Thermoptim , which allows one to extend the software features.
Use and design of external classes
The mechanism of external classes
One great advantage of Thermoptim is that its graphic environment can be used to visually build models for a large number of energy systems, from the simplest refrigerator to complex integrated gasification combined cycle electric power plants using several hundred elements.
Not only does this greatly simplify the modeling process and facilitate subsequent use and maintenance of the model, but it also makes the models more reliable. The connections between the different elements are made automatically, thus ensuring consistency.
Until version 1.4, only the components available in Thermoptim primitive type set could be assembled in this manner, which limited the potential of the software. A number of users wished to be able to define their own elements and/or their own substances.
Thermoptim interface with external classes (Java code elements) provides the solution and facilitates the interoperability of the software with the outside world, especially with other applications developed in Java.
The benefits are two-fold:
Practically speaking, adding a new external process is quite easy. Simply create a specific class, which inherits from the abstract parent class extThopt.ExtProcess. The interaction with Thermoptim is ensured on two levels:
The mechanism of external classes also allows to link Thermoptim to thermodynamic property servers (TPS) in order to provide access to models not available in the fluid core, including mixtures of vapors.
By 2011, the TPSs which have been coupled Thermoptim are TEP Thermosoft, TEP Lib, ThermoBlend , NH3H2O, and , developed by the Center for Energy and Processes of École des Mines de Paris, and Refprop distributed by NIST in the U.S.A.
If you are interested in these developments, please contact info-th@thermoptim.org .
Using external classes
The use of already developed external classes is very simple: just add these classes to Thermoptim libraries, placing them in an archive named extUser.zip for version 1.5 and extUser2.zip for version 2.5. The only constraint is that the structure of the archive must comply with a well-defined format.
These classes call upon some libraries contained in another archive called extThopt.zip for version 1.5 and extThopt2.zip for version 2.5. You must also ensure that the version of this package is compatible with the classes used. Please find below the extThopt.zip and extThopt2.zip versions valid for versions 1.5 and 2.5.
The Thermoptim model library offers five categories of external classes:
Volume 3 of the Thermoptim reference manual will explain how to use and design external classes and Diapason session S07En_ext will guide you through your first steps.
Creation of new external classes
Without being very difficult, the creation of new external classes requires a minimum of Java programming skills. The examples presented in Volume 3 of the reference manual will help you get started with this exercise, and a development environment for external classes is offered below.
Specific explanations on the use of external classes to calculate the properties of moist mixtures are also available.
Development environment for external classes (version 1.5)
To develop the external classes, if you do not already have a Java development environment, you can use a freeware tool called JCreator.
JCreator allows you to write your classes in Java, compile them and directly test their integration into Thermoptim.
A Web page explaining how to install and configure this environment has been prepared for your consideration.
Of course you can also configure JCreator to develop external classes for version 2.5 of Thermoptim. We leave it to you to configure JCreator , taking inspiration from the information given in the link above, using the libraries supplied with the Eclipse Workspace presented below.
Development environment for external classes (version 2.5)
To develop the external classes, if you do not already have a Java development environment, you can use a freeware tool called Eclipse.
Eclipse allows you to write your classes in Java, compile them and directly test their integration into Thermoptim.
A Web page explaining how to install and configure this environment has been prepared for your consideration.
Of course you can also configure Eclipse to develop external classes for version 1.5 of Thermoptim. We leave it to you to configure Eclipse, taking inspiration from the information given in the link above, using the libraries supplied with the JCreator Workspace presented above.
Creation of external drivers
The technological design of components requires to refine the phenomenological models used in the Thermoptim core, supplemented appropriately.
The implementations of these new Thermoptim features are mostly made in the form of external classes, which provides great flexibility for users to customize them.
The classic phenomenological Thermoptim version remains unchanged: it is supplemented by a software layer to take into account the technological design and off-design models.
Technological design classes are complementary to those of the core allowing the consideration of the equations specific to technological choices made, such as calculating the heat transfer coefficient U of a heat exchanger, or the flow-rate and isentropic efficiency a compressor.
The driver is responsible for the systemic coordination of calculations of the various components put into play. It looks for a matching set of variables consistent with the physical and technological problems posed, and is used to change the setting of the Thermoptim project.
You will find all the details of these new developments in Volume 4 of the reference manual of the software, and concrete examples in the Methodological guides section.
|
|
Hosted by Center for Energy and Processes of Ecole des Mines de Paris -This site is powered by Zope,CPS, which includes CPSSkins. |