Sie sind auf Seite 1von 9

# February, 2005

## Introduction to EES (Engineering Equation Solver)

Introduction
EES is a powerful tool for solving engineering problems and is relatively easy to learn. It is particularly useful in solving thermodynamic and heat transfer problems since it offers several built-in libraries comprising of thermodynamic and thermophysical properties, hence there is no need to look these values up in tables. Moreover, algebraic mistakes are not a concern and the use of EES is time efficient in solving complicated engineering problems. One major advantage to EES is that it can solve a system of simultaneous equations, which is not easy to do using Excel. This includes a system with a transcendental equation (i.e. one in which the dependent variable cannot be isolated). This introduction is to help you get started with EES. If additional help is required, you can refer to the Help Window within the software or the PDF manual available on line. To aide in your introduction of the software an example problem from your textbook (Moran and Shapiro) is solved using EES. The solution of the problem and description of specific functions in EES are based on the PC version of EES, however there is little difference in the Mac version. There are additional example problems listed under the Examples menu in EES. When you are working on your homework sets, it may be useful to search for similar problems in this menu.

Availability

February, 2005

The latest EES manual is also on the menet server as a PDF file. The new version of EES has a direct link to the manual, hence it is convenient to place the EES manual (EES manual.pdf) in the EES directory. Installing on a Mac Download the EES_PPC.sea file into your EES folder, double click on the file and then click the Extract button. The folder that EES is installed into must contain the file EES.DFT for EES to run. The manual (EES Manual.sea.bin) is on the menet server. The expanded manual must be placed in the same folder as the other EES files.

Getting Started

February, 2005

Example Problem:
Example 3.4, Fundamentals of Thermodynamics, 5th Edition, Moran and Shapiro To solve this problem in EES, type the following comments and equations in the Equations Window. See WebCT for postings of the example EES file.

" Example 3.4, Moran and Shapiro, Fundamentals of Thermodynamics" "Water contained in a piston-cylinder assembly undergoes two processes. The initial state is 10 bar, 400 C. Process 1-2: Constant pressure cooling to saturated vapor Process 2-3: Constant volume cooling to 150 C (a) Sketch the processes on T-v and P-v diagrams (b) Determine the work (kJ/kg) for the overall process (c) Determine the heat transfer (kJ/kg) for the overall process" "Assumptions The water is a closed system. Neglect changes in potential and kinetic energy. Neglect friction between piston and wall" "Given:" Pb_1 = 10 [bar] T_1 = 400 [C] x_2 = 1.0 T_3 = 150 P_2 = P_1 v_2 = v_3 "units may be specified using [ ] ...." "state 2 given as saturated vapor, thus quality, x = 1.0" "..... or specify units in Options => Variable Info" "constant pressure process" "constant volume process" "unit conversion, now P_1 is in kPa"

## P_1 = Pb_1 * 100[kPa/bar]

"Governing equations" "Conservation of energy: First Law for a closed system" q_12 - w_12 = u_2 - u_1 q_23 - w_23 = u_3 - u_2 w_12 = P_1*(v_2 - v_1) w_23 = 0. w_net = w_12 + w_23 q_net = q_12 + q_23 "Analysis" {using Calculate => Check/Format, above we have 13 eq's and 18 unknowns. We need 5 more equations, listed below, to solve for all variables} u_1 = intenergy(WATER,T=T_1,P=P_1) v_1 = volume(WATER,T=T_1, P=P_2) u_2 = intenergy(WATER,x=x_2,P=P_2) v_2 = volume(WATER,x=x_2,P=P_2) u_3 = intenergy(WATER,V=v_3,T=T_3) "Options=>Function Info=> Fluid properties" {NOTE: in or on the vapor dome, T and P are not independent properties, thus, alone, these two properties do not fix the state of the system} "equations written in specific form (per kg)" "constant pressure process" "constant volume process"

February, 2005

Note that comments are included in brackets {} and quotation marks .Also, EES is case insensitive and ignores spaces. Thermodynamic properties No need to look up values in the tables in the back of your textbook! EES has a large database of thermodynamic properties for many substances. Recall that the state of a system (and all corresponding properties) can be determined if two independent properties are known. Go to Options => Function Info and select Fluid Properties. Choose a substance (water, refrigerant, air), the property you desire to find (internal energy, temperature, fugacity), and specify which two properties you would like to use to specify the resulting property. NOTE: Within the vapor dome, temperature and pressure are not independent properties. u1 = INTENERGY(Water,v=v1,P=P1) x1 = QUALITY(Xenon,u=u1,T=T1) In the first example above, the specific internal energy of water can be found knowing the specific volume and temperature. In the second example, the quality of xenon is found from the temperature and specific internal energy. Units correspond to those specified in Options =>Unit System. Solve When your problem is set-up and you are ready to solve: Calculate => Check/format: are there the same number of equations and unknown variables? (for parametric table, there will be n-1 eqs and n unknowns) Calculate => Solve: solution is produced in Solution window. Notice if unit error occurs. Successful solution is when no unit errors are detected Solution Window PLEASE highlight or box individual variables of interest (the answers) by right-clicking on that variable in the Solution window (note, T2 and P3 do not appear until a later step, discussed below).
Pb1 = 10 [bar] q23 = -1000 [kJ/kg] u1 = 2957 [kJ/kg] v3 = 0.1945 [m3/kg] P1 = 1000 [kPa] qnet = -1486 [kJ/kg] u2 = 2583 [kJ/kg] w12 = -112.1 [kJ/kg] P2 = 1000 [kPa] T1 = 400 [C] u3 = 1583 [kJ/kg] w23 = 0 [kJ/kg] P3 = 475.7 [kPa] T2 = 179.9 [C] v1 = 0.3066 [m3/kg] wnet = -112.1 [kJ/kg] q12 = -486.1 [kJ/kg] T3 = 150 [C] x2 = 1 v2 = 0.1945 [m3/kg]

Units A calculation of numbers may be mathematically correct, but it is meaningless without the specification of units. Units corresponding to every variable in the Equations Window must be defined, either explicitly (by the user), or implicitly (automatically determined by EES). There are several ways to do this:

February, 2005

Options => Unit System. This unit system corresponds to variables in thermodynamic property tables. Example, in Unit System choose SI, mass basis, Celcius, kPa, and kJ. Now, use the EES property database to find the internal energy of water: u1 = INTENERGY(WATER, p = p1, T = T1) According to the chosen system of units, the input variables of pressure and temperature must be in kPa and C, respectively, and the output internal energy is provided in kJ/kg. Options => Variable Info, units of each variable may be defined here Units may also be defined explicitly within the Equations Window, using [ ]: P1 = 10 [bar] Conversions may also be specified explicitly. For Pb in bar and Pk in kPa: Pk = Pb * 100 [kPa/bar]

Unit errors Upon solving, EES indicates if units are consistent or not. If unit errors are detected: Check Variable Info. Are all units specified and correct? Check EES functions. Are input variables in units as specified in Unit System? Equation format are units consistent? For example, if W = P1(v2 v1), and P is in bars, this will NOT result in units of kJ for W, and WILL cause a unit error. P-v and other interesting diagrams Construct a P-v diagram in EES showing each of the states found in our analysis. First, create an ARRAY (indicated by X[i], for variable X at state i) of each of the variables you desire to plot; P and v, in this case. Continuing on with example 3.4, construct the necessary arrays by adding several lines to those already in the Equations Window.
Define arrays for diagrams P = P_1 P = P_2 P = P_3 v = v_1 v = v_2 v = v_3 T = T_1 T = T_2 T = T_3 P_3 = pressure(WATER, V=v_3,T=T_3) T_2 = temperature(WATER,u=u_2,v=v_2)

Again select Solve. Initially in this case (before adding the last two lines, above), we find that P_3 has not been specified. Add any additional equations that are required for additional variables. When enough information is provided, an array table appears when Solve is selected. If any values are still missing from array table, add additional equations to the Equations Window to define values.

February, 2005

Next, construct a property plot by selecting Plots => Property Plots. Select the substance (water, in this example) and type of diagram (P-v). Adjust graph parameters if necessary. For clarity in this example problem, it is recommended that you deselect lines of constant entropy, s. Click ok and a plot will appear. Finally, place the states of your array on the P-v diagram by selecting Plots => Overlay Plot to open a setup window. Under Table, select Arrays Table. Choose the appropriate variables for the X-axis (v[i]) and Y-axis (P[i]). BE SURE to activate Show array indices, to display the state labels on your diagram. You MUST LABEL your graphs! Axis, units, states, significant temperatures and pressures..to name a few things. Adjust axis to maintain a clear view of the plotted states. See Figure 1.
105

Water

10

P [kPa]

103

180C 150C

3
2

10

500C 400C

101 10-3

10-2
3

10-1

100

101

v [m /kg]
500

Water
1

400

T [C]

300

200

2 3

## 100 10-3 10-2

3

10-1

100

101

v [m /kg]
Figure 1. P-v and T-v diagrams. Process 1-2 is constant pressure, and 2-3 maintains constant volume.

February, 2005

Water

(Liquid-Vapor)

## Constant volume cooling (condensation occurs)

Discussion The water initially is in the superheated region. As heat is transferred from the cylinder, the steam (losing energy) is kept at constant pressure by the piston and thus compresses. Work is input to the system at this time (negative), but more energy is lost through heat (negative value) than is added to the system via work. The system reaches the point of saturation, on the edge of the vapor dome. Any slight disturbance would cause a drop of condensation to occur on the piston wall. As heat continues to leave the system and the temperature decreases, condensation indeed does occur. The volume is held constant during this time (Process 2-3). As heat is lost, more water moves from the vapor phase to the liquid phase. The pressure decreases during this time because fewer and fewer molecules exist in the gas form to cause pressure against the walls. The process stops at T3, and the amounts of liquid and vapor present can be determined by calculating the quality at that location.

Tables
For further intriguing investigation of the piston-cylinder assembly, consider how the initial temperature is related to the required compression work and heat transfer. Maintaining the same initial pressure, and final state, we will vary the initial temperature and evaluate the compression work and heat loss. In EES, calculating and plotting the results over a range of initial temperatures is made simple by creating a Parametric Table. A Parametric Table allows you to vary one variable in a system of equations to study the effect on other specified variables. To build a Parametric Table, first comment out parameter that is to be varied, (T 1) with brackets or quotes in the Equations Window. {T_1 = 400}

February, 2005

Click the New Parametric Table command under the Tables menu. A pop-up window will appear where you can select the variables to be included in the table. Choose T_1, w_net, and q_net. Select add and click OK. The number of cells can also be adjusted in this window but for this problem keep the number of cells at the default value of 10. A Parametric Table then appears listing all cells and selected variables. In the table, click the black down-arrow in the T_1 cell (or right-click on the T_1 cell and select Alter Values). Enter the minimum and maximum values for T_1 (labeled first and last). In this example the temperature is varied from 200 to 600 C. Lastly, click the green side-arrow in the upper left-hand corner of the table. This will generate the solution for each variable.

Plots
After generating a table, the results can be displayed graphically by creating a plot in EES. To plot the results determined above, select New Plot Window under the Plots menu. Then choose X-Y Plot. In the pop-up window, select Parametric Table under the Table setting. Select T_1 for the X-axis and w_net, and q_net for the Y-axis. The style and look of the plot can also be chosen here, however, this can be done after plot generation as well. You can generate the plot by clicking OK See Figure 2. The axis, labels, and other looks of the plot can be modified by right-clicking on these items. Comments and lines can be added to the plot using the small icon menu in the plot window or by selecting Add Text or Add Line under the Plot menu. Also, you can copy and paste plots using the Edit menu.
0

wnet
-400

## qnet, wnet, kJ/kg

-800

-1200

-1600

qnet

-2000 200

250

300

350

400

450

500

550

600

T1 [C]

Figure 2. Initial steam temperature effect on net heat and work transfer.

Discussion Both work and heat transfer are negative quantities here, thus work is input (done ON the system) and heat is output (lost FROM the system). As the temperature gap increases between the initial and final states, the heat loss increases as well. The work input also increases, but to a lesser magnitude than the heat transfer change. 8

February, 2005

HAVE FUN!! This document was prepared by  Michael J. Hebert, Department of Mechanical Engineering, University of Minnesota.  Sarah J. Warthesen, Department of Mechanical Engineering, University of Minnesota.