This is the Manual page Takes you to Examples page
Click to go to TEST home page
Tutorial (TOC) > Daemons > States > Manual

| A: Background - States | B: Background - Material Models | C: State Daemon Manual | D: Specific State Daemons |

 



 
 
 
 

A. STATES -A BRIEF BACKGROUND
 [
advanced users can skip the background and go straight to Section B, the manual.]
A.a. Global vs. Local States

In thermodynamics we deal with systems - a system is defined as anything (e.g. a block of copper, a piston-cylinder device, a nozzle, a combustion chamber, an entire power plant, etc.) with a clearly defined boundary. Everything outside the system is called the surroundings. Thermodynamic problems generally involve interactions  of mass, heat, and/or work between the system and its surroundings.

A state is the mathematical description of a system at a given instant. An overall system is described by its global state while a small neighborhood at  any location within the system is described by the local state. Obviously, the global state of a system can be obtained from the distribution of  local states. In a uniform system, a single state describes the global state.

A property is an attribute of a state that does not depend on the history of the system. Temperature is a property while heat transfer responsible for heating a system to a specific temperature is not.

A.b System vs. Flow States When we evaluate a state, say, at a turbine inlet, we evaluate the state at the inlet port at a given instant. It is assumed that the state does not vary across the cross-section, that is the flow is uniform.  Such states are called aflow state in TEST. Similarly, when we say that a gas in a piston-cylinder device is at a particular state , it is implicitly assumed that the system is uniform so that a single state describes the entire system. This is called a system state. Note that an open uniform system can also be descried by a single system state at a given time.


A.c State Properties At the core of a state are properties such as molar mass, critical temperature, enthalpy of formation etc., which have constant values for a given working substance. These properties are intrinsic to a material and are called material properties. An important material property is the molar mass, MM , defined as the mass of a mole (kmol or pound-mole) of the material - a mole is a standard count (Avogadro Number) of molecules just as dozen is used as a standard count of eggs in a supermarket.  

Properties such as temperature T , static pressure p , specific volume v , density rho , internal energy u , enthalpy h , entropy s, etc., are  intrinsic to a state (not to a material). The velocity or location of an observer will not change the values of such properties. They are called the thermodynamic properties and are tabulated in thermodynamic tables such as the steam table. 

There are quite a few dynamic properties, such as velocity,  kinetic energy, dynamic pressure, etc., that depend on the velocity of the observer. There are others, such as the potential energy, that depend on the location of the reference point or datum. Such properties that depend on the velocity or location of the observer are called extrinsic properties . Examples include velocity Vel , height z , specific kinetic energy ke=Vel^2/2 , specific potential energy pe=gz , specific stored energy e=u+ke+pe , specific flow energy j=h+ke+pe, specific stored exergy phi , and specific flow energy psi.

There are some other variables, such as the total mass m, total volume Vol, etc. in the case of a system state, which are called the total properties of a system. For the flow state variables such as the mass flow rate mdot, volume flow rate Voldot, etc. are called the flow properties. Total and flow properties are also called system properties because they depend on other state properties as well as system configuration. A flow state differs from a system state in terms of systems properties as shown in the following (Fig. 1) Van diagram.


The Steam Table Daemon
Fig. 1 System and flow states are extensions of the core thermodynamic state. Visit VT,
Chapter 1, to see animations to explain different types of states and properties.
 

 
| A: Background - States | B: Material Models | C: State Daemon Manual | D: Specific State Daemons |





 

 



 









B.a Modeling a Working Substance The analysis of thermodynamic systems is greatly simplified if the system of interest can be assumed to be a simple compressible system. The working substance of a simple compressible system must be a pure substance, a substance with a fixed chemical composition. Air, a mixture of nitrogen and oxygen,  moist air, a mixture of dry air and water vapor,  wet steam, a mixture of saturated liquid and saturated vapor, pure oxygen -  they all satisfy the definition of a pure substance. Air at very low temperature, on the other hand, may not be a pure substance as oxygen may begin to liquefy before nitrogen, creating a heterogeneous composition. Despite these restrictions a great number of practical systems can be shown to qualify as simple compressible systems.

In order to evaluate the state of a pure substance, it must be modeled with one of the following models that best suites the condition of the working substance. The accuracy and simplicity offered by a model are also important consideration in this regard.

solid/liquid
B.b.1 Solids/Liquids (SL) Model  When all the states of interest involve a solid or a liquid without any possibility of a change of phase, the SL model is the simplest model to use. The model is based on the assumptions that (i) rho (=1/v) is a material property,  and (ii) cv is a material property. These properties are easily available for a number of solids and liquids. Simple formulas can be derived from thermodynamic relations to find changes in internal energy and entropy of a solid or a liquid.

solid/liquid
B.b.2 Phase-Change (PC) Model
In many situations, a pure substance may exist in different phases - liquid, vapor or a mixture of the two - at the states of interest. It is modeled as a phase-change fluid. The PC model is a very accurate model since the properties are derived from experimental correlations, which are generally listed as tables. A familiar example of such tables is the steam table. A phase-change fluid can be found in various phase compositions: (a) subcooled-liquid; (b) saturated mixture of liquid and vapor; (c) superheated vapor; (d) super-critical vapor; (e) super-critical liquid; (f) sub-cooled solid; (g) saturated mixture of solid and liquid; (h) saturated mixture of solid and vapor. Of these, (a) through (c) are often encountered in thermodynamic systems.

In a manual state evaluation, the phase-composition of the working substance is first determined. If the phase composition is superheated vapor or a saturated mixture, an appropriate table - the saturation or superheated table - is  interpolated to obtain the desired state properties. For a subcooled liquid, the compressed liquid model, which assumes v, u, and s to be function of T only, offers a great compromise between accuracy and simplicity. Liquid properties, thus, can be obtained from the saturation table with v, u, and s read from the saturation table as properties of saturated liquid, i.e., v(T)=vf@T, u(T)=uf@T, and s(T)=sf@T. Enthalpy, of course, is a function of pressure also and can be obtained as h(p,T)=uf@T+pvf@T. For higher accuracy, compressed liquid tables are used. In TEST the suffix *  (for instance, H2O* vs. H2O) is added after a fluid name to indicate that the compressed liquid table is used for determining liquid states.

Modern refrigerants are sometimes derived by mixing several phase-change fluids. Such mixtures of phase-change fluids creates a variable saturation pressure at a given saturation temperature. Although these mixtures are not generally covered in textbooks, TEST handles many of such refrigerant mixture under the same category as other phase-change fluids. A  % suffix is added at the end of such mixtures (R-407c%, for instance). 

The PC model is quite accurate as it is based on actual data and fundamental thermodynamic relations. The error is mostly due to interpolation which is typically less than 1%.

Phase Composition
Fig. 2. A gas is really a superheated vapor

solid/liquid
B.b.3 Ideal Gas (IG) Model
  Superheated vapor at  high temperatures (relative to the critical temperature) or low pressure (relative to the critical pressure) obeys simplified equations of states and is called a gas. A gas that follows the ideal gas equation of state pv=RT , where R=Rbar/Mbar is a material property, is called an ideal gas. As a consequence of this relation, u and h can be shown to be functions of temperature alone. For high variation in temperature these functions are not linear. Therefore, the slope of these functions with respect to temperature -specific heats  cp and cv - are also functions of temperature themselves. The accuracy of the ideal gas model is quite adequate for engineering purposes, especially at temperatures above twice the critical temperature and pressure below one tenth of the critical pressure.

The IG model data are based on correlations published by NIST (www.nist.gov). They are quite accurate between 298-6000 K for most gases (the range is displayed on Message Panel if the pointer is hovered over the selected gas name). Beyond this range data is extrapolated, assuming constant cp, that is, using the PG model.

solid/liquid
B.b.4  Perfect Gas (PG) Model  In many practical problems involving gases the temperature variation may not be significant (tens of degrees as opposed to hundreds). The variation in specific heats, therefore, can be neglected to simplify the ideal gas model further. Because variation of cv with T arises due to molecular rotation and vibration, monatomic gases such as He, Ar, Ne, etc., which only translate, exhibit a constant cv at all temperatures. Ideal gases for which cv can be regarded as a material property are called perfect gases. A perfect gas, therefore, is a simplified ideal gas. Beside a large selection of gases, the PG model in TEST also allows you to create a custom gas by specifying any two of the material properties MM, cp, cv, or k.  

solid/liquid
B.b.5  Real Gas (RG Model)
  Deviation from ideal gas behavior can be quantified through the compressibility factor Z=v/v_ideal, which can be correlated to the non-dimensional pressure (reduced pressure p_R=p/p_cr )  and temperature (reduced temperature T_R=p/p_cr ) through the use of universal generalized compressibility chart. Enthalpy and entropy departures from the values predicted by the ideal gas model can similarly be correlated to the reduced properties. The charts used in TEST are based on the Lee and Kesler ideal fluid model. With the use of these charts, any fluid whose material properties are known, can be treated as a real gas. You can also create a custom fluid by entering critical properties and c_p. Although the answers maybe approximate, the custom fluid feature can be used to design a phase-change fluid for a particular application. The generality, covering all fluids over a huge range of temperature and pressure, of course, comes at the expense of accuracy. The real gas model, therefore, is applied to a fluid as a last resort when the ideal gas assumption is questionable (at very high pressure or very low temperature), and/or phase-change tables are not available. Gas under almost any condition - even in a vapor or liquid state - can be treated as a real gas if an approximate answer is acceptable.

solid/liquidsolid/liquidsolid/liquid
B.b.6  Mixture (MX) Models
   A mixture of two or more working fluids, each a pure IG, PG, RG of PC fluid, can qualify as a pure substance as long as the mixture maintains a uniform chemical composition. Mixtures of solids or liquids are treated in TEST as custom solids or liquids with user-specified material properties. Gas mixtures of two components are called binary mixtures and depending on the model used for the components, TEST offers PG/PG, IG/IG and RG/RG binary mixture models. For any number of constituents two general mixture models - n-PG and n-IG mixture models - allow any number (up to more than 60) of gases to be mixed in any proportions to create the working fluid. Mixtures are discussed in Chapter 10 of the textbook. Moist air is a special case of binary mixture of dry air and water vapor (modeled as a PG/PG mixture) and is discussed in Chapter 11.



 

 
 
B.b Rules to Pick a Model

If the working substance is not a solid, try the phase-change model,  provided  saturation and superheated tables are available (TEST : Material must be listed in the phase-change database). Even nitrogen and oxygen, well-known ideal gases, have their own saturation and superheated tables. However, if the reduced pressure is too high (more than 2) , the superheated table runs out of range and an ideal gas model is, probably, more appropriate.

If the working fluid is gaseous and no phase-change tables are available, start with the ideal gas model. For T>2T_cr or p<0.01p_cr, this model yields quite reasonable results. (TEST: The particular gas must be listed in the ideal gas database).

If the gas happens to be monatomic (He, Ar, Ne etc.) or the temperature variation is not large, use the perfect gas model.   (TEST: If a particular gas is not in database, you can create a custom gas by specifying the material properties).

Suppose the ideal gas assumptions breaks down because T<2T_cr and/or p>0.01p_cr, and there are no phase-change tables available. In that case try the real gas model as the last resort. This is quite an universal model capable of handling  gas, vapor, liquid-vapor mixture and even liquid phase. Of course, such generality comes at the expense of accuracy. The critical properties, the generalized compressibility chart and the enthalpy and entropy departure charts must be available to apply the real gas model (TEST: The particular gas must be listed in the real gas database).

If the phase of the working substance is consistently a solid or a liquid with no possibility of a phase change, the solid/liquid model is the best choice.  (TEST: If a particular solid or liquid is not available, you can create a custom solid or liquid by specifying the material properties).

If the working substance has multiple chemical components, it still can be treated as a pure substance, a mixture. (TEST: Select a binary or general mixture model.)



 
The Steam Table Daemon
Fig. 3   Image of the state panel of the PC system state daemon. 


 
| A: Background - States | B: Background - Material Models | C: State Daemon Manual | D: Specific State Daemons |












.
 































 

C. STATE DAEMON MANUAL

C.a.  Layout of a State Daemon:
The state daemons are at the core of all TEST daemons, and learning how to use just one of those effectively is the key to understanding all others.

There are  two variations of state daemons - the system state and the flow state daemons, which characterize the states in a uniform system and a uniform flow (at a given cross-section) respectively. Built on the same core (thermodynamic state), the differences between system and flow states arise from total vs. flow properties, that is, system properties (which are dependent on system configuration). For a system state, it is the total system properties such as stored total mass, volume, stored energy,  stored exergy, total entropy etc. that are of interest. On the other hand, the corresponding rates of transport - mass flow rate, volume flow rate, flow rate of energy or exergy - are of interest in a flow state. Accordingly, the system variables are different in the two types of state daemons. While total properties such as m, Vol, etc., appear in system state daemons, flow properties mdot, Voldot, flow area A, etc. appear in the flow state daemons. Other system properties of interest (for instance, the total stored energy in a system or the rate of transport of entropy by a flow) can be calculated in the I/O panel once a state is evaluated. All other properties (blue and green properties in Fig. 3) are identical between the two types of state daemons

Let us discuss a system state daemon shown in Fig. 3 in some details. To launch the particular daemon open the page with the following pathname: TEST> Daemons> States> System> PC-Model. You can navigate systematically starting with the TEST>Daemon page or use the TEST>Map to directly get to the system state page, where all the material models are displayed in a table. Simply click on the PC (phase-change) model icon to launch the daemon. In case the daemon does not show up as shown above and only a gray box appears, consult the help page, your browser may have to be configured to run Java applets.

Most state daemons look quite similar; so, always double-check the hierarchical page name which is displayed in text and icons on top of every daemon. The daemon itself is bounded within a rectangular boundary and you may have to resize your browser window and scroll down the page to make the entire daemon visible.

Fig. 4 The hierarchical page address should match the pathname of a daemon.

The pathname of a daemon is stamped in Title Panel located on the north border. The version number specific to a daemon, e.g., v7.0bw (see Fig. 4) is also displayed along with copyright information. In reporting any specific problem with a daemon this version number should be mentioned to facilitate diagnosis of the problem. At the south border you will find an one-line text panel, called Message Panel. When you roll the pointer over a widget (window gadgets), a short explanation of the widget appears on this panel. If the widget happens to be a variable, whose value is known, a double precision value of the variable appears in the panel. If the widget contains a species name (say, R-134a), then the chemical formula, molar mass and other relevant material properties are listed. Error messages, warnings, and solution tips are also displayed in the Message Panel. Whenever a daemon does not produce results as expected, keep an eye on this panel for helpful tips. For instance, if a problem has multiple solutions, only one of those can be displayed by the daemon. The alternative solutions are reported in the Message Panel.

The first layer of buttons below the title is for overall control of the daemon is known as the global control panel.  The radio-buttons, Mixed, SI and English, are used to set the units at the beginning of a solution as well as for converting units at any time during solution for the visible screen. To make the change effective to all calculated values (visible or hidden), the global button Super-Calculate must be pressed after making a new unit choice. The rest of the  buttons in this row will be discussed later. The second row of the global control panel consists of a few buttons - two buttons labeledState Panel and I/O Panel for state daemons - which work as tabs for panels that are stacked  like a deck of cards.  Click the two tabs to toggle between State Panel and I/O Panel (see Fig. 5), which are discussed next.

   
The Steam Table Daemon
Fig. 5   Image of the I/O panel. 
 
C.b. I/O (Input/Output) Panel: Figure 5 shows an image of  the I/O panel, which is shared by most daemons. The panel serves various purposes. First, it works as a scientific calculator. Simply type in an expression in Microsoft Excel equation format beginning with the '=' sign and press the Enter key to evaluate its value. Valid expressions include '=1+10*2.31-3/4', '=PI*2.4^2', '=ln(5)+log(10) +Sin(30) +aln(2) + exp(-5)' . Note that '=1/0' yields infinity and zero divided by zero results in NAN (not a number). It is a good practice to break complex expressions into multiple blocks inside parentheses. If you like using this calculator, you can open a floating desktop calculator located in TEST.Daemons.Basics.DeskCal.

The built-in calculator in I/O Panel, however, goes one step further. It parses expressions that include calculated state properties - p1, T2, rho3, etc. This makes it very convenient to calculate quantities that are not calculated as part of states. For example, after two states, say, State-1 and 2, are calculated, the change in stored energy between the states can be obtained by evaluating the expression '=m2*e2-m1*e1'.  Of course, a property must be already calculated before it can be used in a valid expression.

The second purpose of I/O Panel is to act as an output device for a detailed solution report produced by Super-Calculate (discussed later). The report can be copied and pasted into any word processor for printing or saving for later use.

Super-Calculate operation at the end of a solution also generates a few lines of solution macro called TEST-codes (discussed later) in I/O Panel, which can be used to instantly reproduce a solution. However, before discussing TEST-codes any further let us introduce State Panel.

The Steam Table Daemon
Fig. 6   Selecting a working fluid . 
  

 
 
 
 
 
 
  





 













 

C.c State Panel: The area between Global Control Panel and Message Panel is State Panel (see Fig. 3), which appears as the front most panel among the panels stacked like cards. It consists of three zones: a row of widgets called State Control Panel (see Fig. 6), a large block of property widgets, and a dynamic image panel. The first widget is State Choice where a state is identified by an integer. The number of states that can be created is limited only by the available memory of your computer.  State identified by the number zero, State-0,  is reserved for atmospheric conditions. Calculation of stored and flow exergy depends on State-0 being designated as the dead state. When you select a state number, say, 15,  from State Choice (only 6 states are listed at a time, you have to select 'More States..' before you can choose 15), each property symbol assumes the state number as suffix (p15, T15, etc). If the state has been already evaluated, it is loaded from the memory; otherwise, a new state is initialized.

Once the known properties are entered (property entry is discussed later), a state can be calculated by pressing the Enter key or the Calculate button. The next widget is Plot Choice where you select a particular type of thermodynamic plot, which is displayed on a floating window (see Fig. 7 below). All the calculated states are displayed on this plot as shown below.

The data used in this plot can be obtained in a tab-delimited format by clicking the button named Data Used and copied to a spreadsheet such as Microsoft Excel for further processing. Using mouse-drag you can resize the window and scribble on this plot, which can be a helpful feature during a presentation, especially if a digital pen can be used as a mouse (as in a Tablet PC, for instance).

.
Fig. 7 The  T-s plot on a floating window. 

Beside T-s, several other choices for thermodynamic plots are available. The automatic plot feature can be turned off by selecting No-Plots from the Plot Choice.

The Initialize button should be pressed whenever a state needs to be cleared from memory and evaluated from scratch. Note that it affects only the state that is currently displayed. The next widget is a short text panel, called Phase Panel, that displays the phase composition, which is calculated as a part of the state attributes. Finally , the working substances offered by the daemon is listed in Material Choice. Simple hover the pointer over the selected material to see more information appear on Message Panel.

The main body of State Panel consists of a bunch of properties - material, thermodynamic, extrinsic and system properties - that are most relevant to a system state or flow state. Although some of the properties are unique to a particular material model, most properties are shared among all models. Each property is wrapped into a Property Widget shown below. The property symbols are color coded - red for material, blue for thermodynamic, green for extrinsic, and black for system properties.

Fig. 8 Property widgets (window gadgets) for thermodynamic properties p and T

In most daemons velocity and elevation (Vel and z) are initialized to zero (negligible kinetic and potential energy). As you select a working substance, its material properties are automatically displayed. Although no such properties are displayed for the PC model, density for the SL model or molar mass in the IG model are material properties.

To enter a property (see Fig. 8 above), simply click on the checkbox, type in the value (do not press Enter) and select the appropriate unit. The background color of the value field turns yellow. According to the state postulate, for a simple compressible system two independent thermodynamic prosperities are sufficient to evaluate the thermodynamic state. The daemon keeps tracks of how many independent properties are checked. After two independent blue (thermodynamic) properties are entered, the daemon will not allow you to over specify the state by entering a third thermodynamic property. The checked properties are read only after the Enter key is pressed or the Calculate button is clicked. The state is calculated to the fullest extent possible from the entered properties. Properties that are calculated assume a cyan background while entered properties have a green background with their checkboxes checked. If the value entered cannot be read due to a syntax error, the background turns white.

A property can also be entered as an expression written in the same syntax as the I/O Panel calculator. For instance, the expression '=h1-(h1-h2)*0.95' for h3 is evaluated if State-1 and State-2 are already known. Using '=s2' for s1, when State-2 is yet to be calculated, will result in a white background for s1. The Super-Calculate and Super-Iterate buttons, when clicked, iterate among the states and s1 is evaluated when State-1 is recalculated  in a second sweep.

Suppose we would like  to evaluate the enthalpy, h , of steam at a pressure of 100 kPa and quality 0.5 %. Select State-1 from State Choice, H2O from Material Choice, enter p1 as 100 kPa and x1 as 0.5 %. Press the Enter key or the Calculate button (see Fig. 9 below).




State panel of the Smart Steam Table
Fig. 9 Clicking the checkbox of a variable can turn it on (ready for input) or off (make it an unknown) .
 
 

The desired variable, enthalpy h, is calculated as 1546.36 kJ/kg.  To express it in another unit, say, cal/g, simply select it from Unit Choice and the unit conversion is done on-the-fly producing a value of 396.325 cal/g for h. If you click on the English radio-button, the entire state is converted to english system. You can go back to SI units by clicking the SI button.

Suppose instead of known  x1h1 is supplied and the quality x1 is sought. For that simply uncheck x1 to make it an unknown and click on the h1-checkbox. The value of  h1 remains unaltered (you do not have to type it in again). Calculate the state to find x1 to be 0.5, the expected result. Now suppose h1 and s1 are supplied instead. As you Calculate the state following the same procedure x1 is evaluated as 0.5 and the pressure as 100.025 kPa. The 0.025% error in p1 is negligible considering how laborious it is to manually evaluate pressure if enthalpy and entropy (you do not even know whether to start at the superheated table or the saturation table).




 

The state daemon determines the phase composition as part of the solution. But how do you enter the phase composition as an input if the state is known to be saturated or critical?

The quality x and the volumetric quality y can be used to enter phase information. To see how y is defined, hover the pointer over the y-widget and its definition, "Vapor Volume Fraction (y=Vol_vap/Vol): %", appears on Message Panel. For saturated liquid (f-points) x=y=0 and for saturated vapor (g-points) x=y=1. Suppose State-2 is defined as saturated vapor at the same pressure as State-1. The state can be calculated by entering p2 as '=p1' and either x2 as 1 or y2 as 1.

At the critical point the f-line and g-line meet; therefore, using x=0 and y=1 forces the state to be critical.

Suppose a third state, isentropic to State-2 at a pressure 10 times p1, is desired. Choose State-3 from State Choice, enter p3 as '=10*p1', s3 as '=s2', and Calculate. The visual solution along with the h-s plot are shown below (Fig. 10). 



 
The Steam Table Daemon
Fig. 10  Image of Daemons.States.System.PC Model   page.  The calculated states are plotted on a h-s diagram.



 .

Sometimes there are multiple solutions for a particular pairs of state properties - s4=4.45 kJ/kg.K and x4=50% for H2O, for instance. Calculate State-4 with these properties. Although the solution with the highest temperature is displayed, alternative temperatures at which the same entropy is obtained at a quality of 0.5 are listed in Message Panel. You have to click the Calculate button for this message (pressing the Enter key will overwrite this message).

Below the property widgets, a dynamic image of the state is displayed. The image is dynamic in the sense that when a particular state is selected, the state number in the image adjusts to the selected state.


 

C.d. Super-Calculate The Super-Calculate button recalculates all the states from the given input making a fixed number of passes. Ordinarily a single pass is sufficient if states are built up in the forward direction - State-3 may depend on State-2 and State-2 on State-1, for instance. However, if State-1 is related to State-2 (say, s1 is entered as '=s2'), it cannot be calculated in the first pass. Depending on the complexity of the backward relations, a fixed number of passes may not be sufficient. The Super-Iterate button is then used to continue this iteration.

Since all the calculations are started from scratch during a Super-Calculation operation, it can be used for what-if studies. For instance, suppose you are interested to see what happens of the pressure is raised to 300 kPa for the three states calculated above and shown in Fig. 9. For that simply change p1 to the new value, press the Enter key and press Super-Calculate. All the states are updated to the new value of pressure since p2 and p3 entered through expressions rather than as absolute values. To facilitate parametric studies, algebraic relations should be used as much as possible when evaluating related states. Because all the variables are visually exposed, any conceivable combination of variables can be changed in a parametric study. The working fluid can be changed in a similar manner. Just choose a different fluid from Material Choice and Super-Calculate the entire solution.

As already mentioned, Super-Calculate produces a detailed solution report in I/O Panel. By copying (select, ctrl-c, and then ctrl-v) the content of this window to any word processor, you can print or save the output. 

It also produces a table of properties (for the calculated states) that can be copied into any spreadsheet for further processing. 

And, finally, a few lines of TEST-codes are produced that can be used to instantly reproduce the visual solution at a later session. For example, TEST-codes produced for the three states calculated above are shown in Fig. 11 below. 



 
The Steam Table Daemon
Fig. 11  Image of I/O Panel displaying TEST-codes generated by Super-Calculate.

 

 
 
 





 

C.e. Load

The syntax of TEST-codes is quite similar to the one used in C or Java programming language. All comments line start with the symbol '#'. All the states calculated appear within the States block as shown in the figure above. For each state the working substance and the known properties (including default values) are listed. Note that expressions are within double quotes and all units used are SI (even if English units are used in a solution). From a conceptual standpoint, TEST-codes simply list the known parameters of a problem. They can be saved as a text file by copying the generated codes from the I/O Panel to your favorite word processor.

To load the solution back at a later session, launch the appropriate daemon, copy TEST-codes from the saved file into the I/O Panel, and click Load.  The loading process simply places the known variables in the appropriate states. To recreate the visual solution, click Super-Calculate button. The original solution is obtained unless there is an error in TEST-codes. A floating window (see Fig. 12 below) reports compilation errors, if any, by line numbers (comment lines are also counted). If there is not error, simply close the window.  

Fig. 12 Messages during loading are reported on a floating window.

There are many uses for TEST-codes beside storing a solution. Suppose a problem requires calculation of 15 different states. If the solution has to be paused prematurely, TEST-codes can be saved so that the solution can be restarted exactly at the same point at a later session. A teacher may distribute TEST-codes for the base case (say, a cascade refrigeration cycle) of a complex problem for students to perform parametric studies.  TEST-codes can be e-mailed making it possible for remote collaboration. To apply different material models (say, PG vs. IG model) to the same problem, TEST-codes obtained from one model can be exported to the second model.




 
| A: Background - States | B: Background - Material Models | C: State Daemon Manual | D: Specific State Daemons |

 
 


 

 





D. MODEL SPECIFIC STATE DAEMONS

There are slight variations among different state daemons depending on the underlying material model. In what follows the PC-model discussed above is used as the baseline model.

D.1 Solids/Liquids (SL) Daemon   There are only a few differences between a SL daemon and the corresponding PC daemon. In a SL daemon there is no need for Phase Panel in the state control panel since phase change  is not allowed by the SL model. Properties  rho (=1/v), v, and  cv are material properties (notice the color used for these symbols) and are immediately displayed as soon as a working substance is selected from Material Choice. Obviously, there is no need for properties x and y used in the PC model.  A custom solid or liquid can be created by selecting Custom (you may have to scroll up Material Choice) and entering the material properties  rho ( or v), and  cv to any desired values.

D.2 Phase-Change (PC) Daemon The entire discussion of section B is based on PC System-State Daemon. Some of the important features are recapped here.  There are three entries for water in Material Choice - H2O, Ice and H2O (Comp. Liq. Table). H2O and Ice share the same database allowing sublimation states between saturated solid and vapor. For sublimation, properties x and y should be interpreted as mass and volume fraction of saturated vapor in a mixture of saturated water vapor and saturated ice. While the compressed liquid model (see Background B.d.2) is used for calculating sub-cooled states of all PC fluids, compressed liquid tables are used for better accuracy at high pressures in H2O(Comp.Liq.Tab.). Entries with a % sign as suffix - R401a% for example - indicates refrigerant mixtures. Additional information on the selected working substance is displayed on Message Panel when the mouse is rolled over Material Choice. The volume fraction y is a non-conventional property introduced for saturated mixture. It can be quite useful in finding the state of a mixture where the total volume and the volume of one of the phases are given. As an example, suppose you are interested to find the quality of steam kept at 400 deg-C in a 10 L tank. If the liquid or vapor volume is supplied, the state becomes easy to evaluate from known T and y.  To obtain the critical state use x=0 and y=1.

For superheated or sub-cooled fluid, properties x and y should be ignored. When a state is outside the the range of superheated tables, the perfect gas model is applied to extrapolate data (with appropriate message on Message Panel).

It should be mentioned that enthalpies produced by PC daemons may not always match with published tabular data for some fluids (say, R-134a). However, the difference in enthalpy between two states, which is more important in most problems, should match regardless of tables or charts. 

D.3 Perfect-Gas (PG) Daemon The hallmark of PG model is that specific heats are material properties. Altogether the PG model contains five material properties -MM, R, c_p, c_v, and k - only two of which are independent. Therefore any two of these can be specified for a Custom Gas (scroll up Material Choice). Notice that the daemon does not allow you to over specify properties- you cannot activate a third material property after assigning two independent material properties. Enthalpy for all gases is set to zero at the standard reference temperature (25 deg-C). If this rule is not applied, an asterisk is added to the gas name.

D.4 Ideal-Gas (IG) Daemon Specific heats of an ideal gas being functions of temperature, only MM and R are material properties. Notice that u, h, c_p and T are evaluated if any one of these properties is known. The variable c_p data extends to 6000 K for most gases beyond which the PG model is used. To display the exact range of data on Message Panel, hover the pointer over the selected gas. Since monatomic gases are truly perfect gases, they can be modeled by either PG or IG model with identical results. It is instructive to apply both PG and IG models to the same problem. The difference in results, if any, is solely due to variation of specific heats with temperature.

D.5 Real-Gas (RG) Daemon The RG state daemons look quite similar to the corresponding PC daemons. The additional properties are p_r, T_r and Z. The critical properties can be obtained by assigning p_r=1 and T_r=1 or using x=0 and y=1 as in the PC daemons. Currently only Lee-Kesler ideal fluid model is used by the RG daemons. Therefore, there can be significant errors, especially for fluids with asymmetric molecules such as H2O. The RG model  should be used as a model of last resort - its generality comes at the expense of accuracy.

D.6 Binary Mixture (BMX) Daemon The state control panel of all binary mixture daemons has two material selectors one for gas-A and one for gas-B. Their amounts in the mixture is specified through properties x_A or y_A, the mass or mole fraction of gas-A in the mixture. The mixture must be defined before any state property can be evaluated. To compose a pure gas simply enter x_A (or y_A) as 1 (gas-A) or 0 (gas-B).

Moist air is a special binary mixture of perfect gases, dry air and water vapor. Moist air daemons are discussed separately in the HVAC/Psychrometry section.

D.7 General Mixture (GMX) Daemon The general mixture daemon is available only for perfect and ideal gases. Any number (n) of species are allowed by the General Mixture daemons. The dynamic image of the state panel found in most other state panels is replaced by a composition panel as shown in Fig. 13 below. 


  
The Steam Table Daemon
Fig. 13  Composing a general mixture on the state panel.

 
 

To compose a general mixture, select a species, enter its amount according to any of the available schemes (absolute amount, percentage by mass, volume or mole, etc.) and press the Add/Modify button. To delete a species enter its amount as zero. As a mixture is composed, the composition bloc updates the mixture composition in terms of mass and mole fractions. Once a mixture is formed, it is not changed in a given problem.

The general mixture daemons allow the formation enthalpies of each species to be included in the mixture enthalpy through the radio-button that appear on the composition panel. An additional thermodynamic property, specific Gibb's function g, is also calculated by these mixture daemons. In understanding chemical equilibrium, the Gibb's function plays an important role. Advanced users should work with the equilibrium daemons, which build on the general mixture daemon and can calculate equilibrium composition as well state.



This is the Manual page Takes you to Examples page

Copyright 1998-: Subrata Bhattacharjee