THERMOPTIM®
MODEL CONSTRUCTION AND VERIFICATION METHODOLOGY
© R. GICQUEL JUNE 2011
2
TABLE OF CONTENTS
MODEL CONSTRUCTION AND VERIFICATION METHODOLOGY ...................................................... 3 THINK BEFORE YOU START ENTERING THE MODEL ............................................................................................... 3 BUILD THE MODEL IN SEVERAL STEPS, AND PERFORM THE CALCULATIONS STEP BY STEP .................................... 3 HOW TO RENAME THE ELEMENTS OF AN EXISTING PROJECT ................................................................................. 4 TEST THE MODEL VERY CAREFULLY BEFORE USING IT ......................................................................................... 4 INVESTIGATION OF MODELING DISCREPANCIES .................................................................................................... 4 SUBSTANCE MANAGER......................................................................................................................................... 5 INTERACTIVE CHARTS ......................................................................................................................................... 5 DIAGNOSIS TOOLS ............................................................................................................................................... 5 TEST THE AUTOMATIC RECALCULATION .............................................................................................................. 7 CONTROLLING THE FLOW RATE ........................................................................................................................... 7
© R. GICQUEL 1997 - 2011. All Rights Reserved. This document may not be reproduced in part or in whole without the author's express written consent, except for the licensee's personal use and solely in accordance with the contractual terms indicated in the software license agreement.
Information in this document is subject to change without notice and does not represent a commitment on the part of the author
June 2011
3
Model construction and verification methodology
Thanks to their powerful modeling environments, simulators as Thermoptim allow one to rapidly develop models of energy systems which can be very complex. They can lead to considerable productivity gains, but on one condition which is to be wisely used, which means to avoid a number of pitfalls that their apparent ease of use can mask. To truly benefit from their potential, you must take a number of precautions, or if you prefer, it requires a good methodology for construction and model verification. The purpose of this note is to provide Thermoptim users with a number of recommendations based on past experience.
Think before you start entering the model
One of the most common mistakes made by beginners is to start implementation of their model before they really thought about what to do: they open the package and start building a diagram without really knowing where they go. It is essential to first understand the problem: what is it, what results should I get, what information do we have, which ones are missing, which thermodynamic components should we select, depending on which global architecture, what are the working fluids, are there changes of state, chemical reactions (combustion ...), are the core Thermoptim components enough to represent their processes? At this stage there is often a need to reformulate or transform the original statement of the problem, and the paper or the blackboard are good supports for this work. Once the problem is defined, you will try where possible to reduce complexity, starting by broking it down into simpler parts, then get a first estimate of the solution through the use of simplifying assumptions allowing an analytical approach for each par (perfect gas) and performing dimensional analysis, to get a first idea of the magnitudes of the flow-rates and energies put in.
Build the model in several steps, and perform the calculations step by step
This is only after this preliminary work that you can begin to build the model in Thermoptim, if possible by performing iterations to solve the different sub-problems identified in advance and check the consistency of the results for each (including mass and energy balances), building necessary external components, then assemble the complete model and verify its validity. When building the model, it is recommended to keep backups of different versions of project and diagram files, both in case of loss of data due to a mistake, the software package or computer, but also to be able to go back if necessary. It is also important to document the best possible the model, both overall and in certain details. The different types of Thermoptim primitive except substances, have a comment field that allows you to give some indication of the meaning of a setting, the role of a point or a process... In the diagram editor , one can easily add text, to distinguish the main groups of components representing parts of the model. The documentation is always easier to do when the model is being realized than several months later. It is much easier to get back into a documented model that keeps track of the choices made, than trying to remember them later. As long as your model has not been well tested (next step), it is preferable not to use the automatic recalculation engine, and perform the calculations step by step, component after component, following the flow logic of fluids put in. By operating in this way, you do not automatically propagate errors that could distort all your settings. Despite all the precautions taken in developing the software, experience shows that the simulator may have abnormal behavior, including management of automatic recalculation, when building a model for the first time, but that these abnormalities disappear when one performs a full reset. Make it a habit, when you create a new model, especially if you start from an existing model by adding and removing components or by renaming some, to save your work, that is to say the project and diagram files, and
June 2011
4 then exit Thermoptim. Reopen it and reload your model. You will be certain and eliminate the problems associated with the initial construction.
How to rename the elements of an existing project
Start from an existing template and modify it is very economical to operate, but some precautions should be taken if you do not want to spend long hours testing the new model. In particular, it is necessary to carefully renaming substances, points and components. It is highly recommended for this to use function "Rename" (Ctrl R) available from the substance manager (see below) for the former, and the diagram editor for others, because it makes the change not only in the primitive selected, but also in all those that are logically related.
Test the model very carefully before using it
Provided that the model puts into play a significant number of components, the risks of error are many: - overall architecture modeling errors - Connection errors of points to processes - component logic or thermodynamic setting errors It is therefore necessary to test the model with great care, ensuring that its structure is sound and that its results are consistent, especially with the orders of magnitude revealed during initial thoughts. Thermoptim already performs various consistency checks when you enter your model, and displays messages when it detects an anomaly, but there are many mistakes that only the designer of the model can identify. To facilitate this difficult and delicate task, the software provides users with various features (interface diagram / Simulator, substance manager, interactive charts), and offers in addition, from the standard version, diagnosis tools, accessible from the Special menu in the main window of the project.
Investigation of modeling discrepancies
To help diagnose the differences between the diagram editor and the simulator, their interface has been supplemented by two red buttons, allowing firstly to look for modeling discrepancies, and secondly to eliminate those selected (those whose last column is checked).
Diagram / Simulator Interface Modeling discrepancies include: - The elements of the simulator absent from the diagram editor - The elements of the diagram editor absent from the simulator
June 2011
5 - Unconnected points present in the simulator - Unused substances The implementation of these new features is very similar to the previous ones: by clicking on the "Look for discrepancies" all the dubious elements are displayed in the list. Clicking the button "Suppress discrepancies" offers to delete the selected items only. Note that once some elements are removed, new discrepancies may appear, such as non-connected points or unused substances that were not discrepancies before. It may therefore be necessary to iterate for all discrepancies to be removed. To avoid inadvertent operation, the buttons for updating the simulator and the diagram editor are disabled when you click on the search for discrepancies, as well as that for suppressing the discrepancies when the interface is used in the usual way.
Substance manager
The substance manager, available from the Special menu of the simulator (except in the demo version), allows you to display all the substances used by the project. If you click one of the lines, the points associated with this substance are shown in the table below. You can thus easily check the substances being involved in the project and points associated with them. If a substance is connected to no point, you can delete it. If a line is selected and you click the "Display the substance properties", its composition appears if it is a gas, and its characteristic parameters if it is a vapor.
Substance manager
This screen also allows you to replace a substance in an entire project, for example to test the influence of a change in the substance (such as using the perfect gas instead of ideal gases, which can help you make comparisons with analytical results). You can rename a substance only if it is an unprotected compound gas or an external substance. Obviously, the new name must not be that of a pure or protected gas, or that of a vapor.
Interactive Charts
The plot of the cycle on several interactive charts also proves a good way to control the relevance of a model, once we know the general shape of cycles, which can be learned quickly. An input error on the pressure or temperature is often quite obvious.
Diagnosis Tools
We recommend starting the tests by using these tools to check for point or process parameter errors that may have occurred if you inadvertently clicked in the wrong place. Look closely at the calculation modes (direct, reverse, open or closed system, etc.), the energy types that determine the balance, etc. For the points, the search options are as follows:
June 2011
6 no prerequisite other than the substance that is associated to them or a pressure setting: theoretically, these points are never modified by the software, unless the composition of the associated substance changes or if the pressure setting is changed. They are initial parameters of a model. multiple prerequisites: if a point has more than one prerequisite, it means that it can be modified by more than one component. This is generally because, during modeling, it was incorrectly connected either to the outlet of two different processes, or to the outlet of one process and the inlet of the main process of a mixer. Additional explanations are provided below. calculated in open system with either p and T or p and h known. calculated in closed system with either v and T or v and u known; with a saturation pressure setting or a saturation temperature setting; not connected to a process: these points are not used and generally should be deleted. Note that when a process is deleted, the points are conserved to avoid losing their settings and so they can be used with other processes.
-
Diagnosis tools For the processes, the search options are as follows: - open or closed system; - type of energy: useful, purchased or other; - pressure analysis: in Thermoptim, the pressures are initialized by default at 1 bar, then the user must set the values, since the software does it in only a very few cases. If the user forgets to do so or makes an error, convergence problems may appear. This search option covers on the one hand all of the processes other than compression, expansion and throttling in which the outlet pressure is greater than the input pressure (physical impossibility except for certain external processes), or is less than 80% of the inlet pressure (excessive pressure drop), and on the other hand all of the nodes through which the pressure increases (physical impossibility except for certain external nodes). - direct or reverse calculation; - set flow rate: this option facilitates checking of flow rate propagation consistency in complex projects.
June 2011
7
Test the automatic recalculation
If everything looks good after these checks, save your model, then test it in automatic recalculation mode. As we said before, this step must not be performed too early, on a model that has not been tested as described above. However, an error-free model will be recalculated without difficulty, and the recalculation engine will perform various sensitivity analyses that are extremely valuable for judging the validity of the model. If you want the flow rates to be propagated automatically, make sure that the option "auto flow rate" is selected, that the processes with preset flow rates are specified, and test the consistency of your model using the diagnostic tools. Once you have checked the model thoroughly, open the recalculation tools screen and click on the "Recalculate" button if the number of calculable types is not zero. Otherwise, you first have to calculate an element located upstream of the system. When you use the automatic recalculation engine, the calculable invalidated types are calculated as well, in parallel as the case may be. As soon as a type is calculated, it invalidates its subordinates, rendering the process iterative. When all the types that were initially calculable have been recalculated, the global balance is performed and the values of the indicators are updated. In most cases, new types have been invalidated. Iterate until the indicator values stabilize (5 to 10 iterations are usually enough). If the processes do not converge, it is probably because there is a problem in the interconnections or the flow rate propagation: It may be necessary to set the flow rate of one of the processes, especially in the different loops. In the Professional version, you can make the repeated recalculation automatic from the optimization method screen, with stop criteria based on the convergence of the model. If you select the "locked" option, the invalidation system is disabled, which means that when an element is recalculated, it remains validated, even if one of its prerequisites is invalidated. This makes it possible to finish the recalculation process in just a few iterations. If difficulties appear during the automatic recalculations, in most cases the thermodynamic parameter settings are incorrect, or the model itself must be revised.
Controlling the flow rate
In practice, it is very important to be able to control the flow rate. In Thermoptim, this control is performed by the nodes and the connections between processes. In the mixers and the separators, the flow rate propagation is quite simple: in a mixer the flow rate of the main vein is the sum of all branch flow rates, and in a separator, it depends on the quality of the vapor entering the node and the drying effectiveness. In a divider, the flow rate of the main vein is generally distributed among the different branches proportionally to their flow rate factors. There is one exception however: it is possible to set the flow rate in a process at the outlet of a divider, provided that this node has two branches, namely the one with the set flow rate and another one. In this case the flow rate of the second process is set equal to the flow rate of the main vein, minus that of the branch with the set flow rate, and the flow-rate factors are recalculated accordingly. Flow rate can be automatically propagated between two processes when the following rules are met: First, the two processes must be directly connected. If the point connecting them is also connected to the third process, the problem becomes much more complex, and cannot be solved unless there is a diagram in which the valid connection is the only one (this issue is discussed in more detail later in the manual). Second, the automatic flow rate propagation system must be enabled by selecting the "autoflow" checkbox located next to the "recalculate' button. Third, one may wish to simultaneously enable the automatic flow rate propagation in most processes and disable it in some of them. This is particularly useful when there are loops in the process networks. It can be June 2011
-
8 done by checking or unchecking the "set flow" checkbox that appears in each process frame close to the "Delta H" field. When the "set flow" checkbox of a process is checked, its flow rate remains unchanged, except if it is connected to a node (except for the divider with a set flow mentioned above).
June 2011