| |
| Tutorial (TOC) > Daemons > States > Manual |
| | A: Background - States | B: Background - Material Models | C: State Daemon Manual | D: Specific State Daemons | |
|
| 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.
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%.
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.
|
|
| 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 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.
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. |
|
| 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. |
|
| 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).
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.
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).
|
|
| 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 x1, h1 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). |
|
| 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. |
|
| 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. 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. |
|
| 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. |
| |
| Copyright 1998-: Subrata Bhattacharjee |