Takes you to Manual page This is the Examples page

Tutorial (TOC) > Daemons > States > Examples


Ex-1 (a) Calculate the mass of air (in kg and lbm) in a closed chamber of size 6000 ft 3 at a temperature 20 oC and pressure 14.7 psia. (b) What-if scenario: How would the answer change if the chamber contained CO2. Assume ideal gas (IG model) behavior.



 
 

Solution Mass being a property of the system (air in the chamber), the problem clearly requires evaluation of the state of a fixed volume of air under the given conditions. The system state daemon is the right tool for the job. There are several gas models offered by TEST - the IG (ideal gas) or PG (perfect gas) model is suitable for gases that are not at very high pressure or very low temperature, and there is no possiblity of any change of phase.

Navigate to the Daemons.States.System page and click on the Ideal Gas (IG) model to launch the IG state daemon.  Note that the Perfect Gas (PG) model would produce the same answer.


The Steam Table Daemon
Fig.1.1 Image of  State Panel of  Daemons.States.System.IG Model  page. To enter a variable,
click on the checkbox, type in the value and then choose unit. The variables are registered only after you click the Calculate button or press the Enter key.

 

Air is the default gas, so there is no need to select the working fluid.

The default State number is State-1. Enter the known properties p1 and T1, and Vol1 in appropriate units. To enter a variable simply click on the checkbox, enter the value in the yellow field, and select a unit.

Press the Enter key or Calculate to produce the entire state. The system mass, m1, is 204.7 kg. To get the answer in lbm, simply select lbm from the unit selector. The mass is now displayed as 451.3 lbm.

What-if Scenario To repeat the analysis for CO2, change the gas to CO2 from the gas selector, click  the Calculate button (or press the Enter key) to register the change, and click the Super-Calculate button to update all calculated states.

Discussion You can calculate many relevant quantities using I/O Panel as a calculator. For instance, the energy stored in the chamber, whatever that means, can be obtained by evaluating the expression '=m1*e1' in the I/O panel. It depends on the arbitrary reference value used for evaluating the internal energy u. The stored exergy, on the other hand, is the maximum value of useful energy that can be extracted from the system. To calculate that, first calculate state-0 as the dead-state by entering the atmopheric temperature and pressure. Super-Calculate to update State-1. Notice that phi1, specific stored exergy at state-1, is now found. On the I/O panel calculate the stored exergy as '=m1*phi1'.

The solution procedure can be succinctly described by the TEST-codes, generated on the I/O panel when the Super-Calculate button is pressed after a solution. TEST-codes can be very useful in quickly reproducing a solution. To do so, launch the appropriate daemon, copy and paste the codes on the I/O panel, and use the Load and Super-Calculate buttons.



#  TEST-codes for Ex-1;
#  Daemon Path: TEST>Daemons>States>System>IG Model ;

  States { 
             State-1:  Air;
             Given:    { p1= 14.7 psia;   T1= 20.0 deg-C;   Vel1= 0.0 m/s;  z1= 0.0 m;  Vol1= 6000 ft^3;   }
    }
 




Ex-2 Evaluate the following states for R-134a and plot them on a T-s diagram. (a) State-1: T= - 60oC, saturated vapor; (b) State-2: 1000 kPa, isentropic to State-1; (c)  State-3: isobaric (constant p) to state-2, saturated vapor; (d)  State-4 : isobaric to state-3, saturated liquid; (e) State-5 : isobaric to state-1, isenthalpic (constant h) to state-4.



 


 
Solution This problem is about evaluating properties - clearly a state problem. We select the system state daemon although the flow state daemon (used for flow properties) can be used as well. PC model is the best model for R-134a, which may exist in different phases under the given conditions.

Navigate to the Daemons.States.System page and click on the PC (phase-change) model to launch the PC state daemon. Select R-134a from the fluid selector. 

State-1: Choose State-1, enter T1 (60 deg-C) and x1 (1, note that saturated liquid is identified by x or y =0 and saturated vapor by x or y=1). Calculate.

State-2: Choose State-2, enter p2 and s2 ('=s1'). Calculate. Note the use of the algebraic expression.

State-3 : Choose State-3, enter p3 ('=p2') and x3 (1). Calculate.

State-4 Choose State-4, enter p4  ('=p3') and x4 (0). Calculate.

State-5: Choose State-5, enter p5 ('=p1') and h5 ('=h4'). Calculate.

Choose T-s from the diagram selector. The plot appears on a pop-up window (your pop-up blocker will not block it).
 



 
The Steam Table Daemon
Fig. 2.1 Image of the T-s diagrams in Ex. 2.

 

What-if Scenario Change T1 to its new value, Calculate and Super-Calculate. All the states are now adjusted to the new value of T1 (as shown in the T-s diagram above).

What if State-2 pressure, p2, was given in terms of p4? In that case, State-2 cannot be fully evaluated until p4 is found. This is indicated by a white background of p2. After all the known information are entered, a click on Super-Calculate propagates the information back and forth (for a fixed number of iterations) and p2 is calculated. If more iterations are necessary, the Super-Iterate button can be used to continue the iterations. 


#  TEST-codes for Ex-2;
#  Daemon Path: TEST>Daemons>States>System>PC Model;

   States { 
           State-1:  R-134a;
           Given:    { T1= -60.0 deg-C;  x1= 100.0 %; Vel1= 0.0 m/s;   z1= 0.0 m;   }

           State-2:  R-134a;
           Given:   { p2= 1000.0 kPa;   s2= "s1" kJ/kg.K;  Vel2= 0.0 m/s;   z2= 0.0 m;   }

           State-3:  R-134a;
           Given:  { p3= "p2" kPa;   x3= 100.0 %;   Vel3= 0.0 m/s; z3= 0.0 m;   }

           State-4:  R-134a;
           Given: { p4= "p3" kPa;   x4= 0.0 %;   Vel4= 0.0 m/s;  z4= 0.0 m;   }

           State-5:  R-134a;
           Given:  { p5= "p1" kPa;   h5= "h4" kJ/kg; Vel5= 0.0 m/s;   z5= 0.0 m;   }
  }




Ex-3 Steam enters a turbine at 1000 kPa, 500 deg-C at a mass flow rate of 2 kg/s. If the velocity is not to exceed 30 m/s, (a) what is the minimum area of the inlet? (b) What-if scenario: How would the flow velocity change if the inlet temperature was increased to 900 deg-C?



 
Solution This problem is about evaluating properties of a flow; therefore, the flow state daemon is the right tool. Steam is the poster fluid for the PC model since phase change is always a possibility.

Navigate to the Daemons.States.Flow page and click on the PC (phase-change) model to launch the PC flow state daemon.  H2O is the default fluid.

State-1 : Enter p1 (1000 kPa), T1 (500oC), mdot1 (2 kg/s), and Vel1 (30 m/s).  Calculate. The inlet area is found to be 236 cm^2.

State-2 : Enter p2 ('=p1')), T2 (900oC), mdot2 ('=mdot1'), and A2 ('=A1'). Vel2 must be made an unknown by de-selecting its checkbox. Calculate. The daemon calculates Vel2=45.8 m/s .

Solution You can calculate the rate of energy transported by the flow on the I/O panel by evaluating the expression '=mdot1*j1' or '=mdot2*j2'.  



#  TEST-codes for Ex-3;
#  Daemon Path:TEST>Daemons>States>Flow>PC Model ;

  States { 
  State-1:  H2O;
  Given:       { p1= 1000.0 kPa;   T1= 500.0 deg-C;   Vel1= 30.0 m/s; z1= 0.0 m;   mdot1= 2.0 kg/s;   }

  State-2:  H2O;
  Given:       { p2= "p1" kPa;   T2= 900.0 deg-C;   z2= 0.0 m;   mdot2= "mdot1" kg/s;   A2= "A1" m^2;   }
 }
 



 


Ex-4 Superheated water vapor flows through a pipe of diameter 20 cm at 1000 kPa, 400 deg-C, and  30 m/s. Determine the rate of transport of (a) mass, (b) kinetic energy, (c) stored energy, (d) flow energy, (d) entropy, and (e) flow exergy. Use the PC (phase-change) model. Assume the atmospheric conditions to be 100 KPa, 25°C. (f) What-if scenario: How would the answers change if superheated vapor was treated as an ideal gas (IG model)? 



 

 

Solution This problem is about evaluating properties of a flow; therefore, the flow state daemon is the right tool. Steam is the poster fluid for the PC model since phase change is always a possibility.

Navigate to the Daemons.States.Flow page and click on the PC (phase-change) model to launch the PC flow state daemon.  H2O is the default fluid.

Launch the Flow State Daemon with the PC model. Evaluate State-1 by entering the given properties. To enter the area you can use the expression '=3.14*(0.2^2)/4'. The mass flow rate is found as mdot1=3.07 kg/s. Also evaluate state-0, the dead state from p0 and T0 supplied.

To find the flow rate of KE, notice that e=u+ke+pe and pe=0. Therefore, KEdot =mdot1*(e1-u1)=1.38 kW. Similarly, type in '=mdot1*e1', '=mdot1*j1', '=mdot1*s1', and '=mdot1*psi1' in the I/O Panel to evaluate these as 9087 kW,  10029 kW,  22.94 kW/K, and  3205 kW respectively.

What-if Scenario Generate the TEST-codes by clicking Super-Calculate button. Launch the IG flow state daemon on a separate browser window. Copy the TEST-codes into the new I/O panel. Click the Load button and then the Super-Calculate button to produce the solution for the IG model.

Discussion Evaluate the flow rates on the I/O Panel. The mass flow rate is 3.03 kg/s, very close to the prediction from the PC model.  Similarly, the flow rate of kinetic energy is calculated  by '=mdot1*(e1-u1)' as 1.36 kW. However, the flow rate of  stored and flow energy are found as 1288 kW and 2230 kW, almost an order of magnitude smaller than the corresponding PC calculations. This is because the reference values used for internal energy in the two models are quite different. Entropy also is referenced differently in different models. The exergy on the other hand is based on difference in properties, and, therefore, independent of those reference values. The flow rate of flow exergy with the ideal gas model is calculated as 1757 kW. The difference, about 50%, from the PC model result is not attributable to reference values - the ideal gas model simply is not good enough to model steam under the given conditions.


The Steam Table Daemon
Fig. 4.1 Image of the I/O panel used as a post processor.


#  TEST-codes for Ex-4;
#  Daemon Path: TEST>Daemons>States>Flow>PC Model ;

States {
State-0: H2O;
Given: { p0= 100.0 kPa; T0= 25.0 deg-C; Vel0= 0.0 m/s; z0= 0.0 m; }

State-1: H2O;
Given: { p1= 1000.0 kPa; T1= 400.0 deg-C; Vel1= 30.0 m/s; z1= 0.0 m; A1= "pi*(0.2^2)/4" m^2; }
}



Ex-5 Evaluate c_p of carbon dioxide at (a) 300 K, (b) 2000 K, and (c) 4000 K by calculating the partial derivative of enthalpy with respect to temperature at constant pressure. Use the ideal gas model. (d) What-if scenario: How would the answer in part (b) change if the pressure is increased to 1000 kPa? 


 

Solution This problem is about evaluating the partial derivative of a property. We select the system state daemon with the IG model, located at TEST.Daemons.States.System.IG Model.

Evaluate state-1 and state-2 as described in the TEST-codes below. On the I/O Panel calculate '=(h2-h1)/(T2-T1)' as 1.06 kJ/kg.K. Note that c_p is also evaluated as part of the state and is equal to this calculated value.

To evaluate c_p at a different temperature, change T1 to a new value, press the Enter key and Super-Calculate. At 2000 K c_p is evaluated as 1.37 kJ/kg.K. To see the effect of pressure on c_p, increase p1 to 1000 kPa and Super-Calculate. As can be expected  for an ideal gas model, c_p remains unchanged with a change of pressure.



#  TEST-codes for Ex-5;
#  Daemon Path: TEST>Daemons>States>System>IdealGas;


   States    { 
     State-1:  CO2;
     Given:       { p1= 100.0 kPa;   T1= 300.0 K;   Vel1= 0.0 m/s;   z1= 0.0 m;   }

     State-2:  CO2;
     Given:       { p2= "p1" kPa;   T2= "T1+1" K;   Vel2= 0.0 m/s;   z2= 0.0 m;   }
    }




 


Ex-6 A 10 gallon rigid tank contains saturated propane vapor at 20 deg-C.  Due to heat transfer into the tank, the temperature increases to 40 deg-C. Determine the change in (a) pressure, (b)  stored energy, (c) entropy, and (d) stored exergy.  Assume the atmospheric conditions to be 100 kPa and 25 deg-C. Use the PC model for propane. What-if scenario:   How would the answers change if propane is treated as (e) a perfect gas, (f) an ideal gas, (g) a real gas with Lee Kesler chart, (h) a real gas with Nelson-Obert chart?




Solution Obviously, the PC (phase-change) model is the most accurate model for a saturated vapor. Launch the system state daemon with the PC model and select propane. Calculate the three states as described in the TEST-codes below. On the I/O panel, evaluate '=p2-p1' as 79.9 kPa, '=m1*(e2-e1)' as 22.27 kJ , '=m1*(s2-s1)' as 0.071 kJ/K, and '=m1*(phi2-phi1)' as 1.1 kJ.

To repeat the solution with a different model, generate the TEST-codes by clicking Super-Calculate button. Start the system state daemon with a different model, say, perfect gas. Copy and paste the code onto the I/O panel of the new daemon, Load and Super-Calculate. Notice that State-1 and 2 are not successfully calculated. This is because the property quality (x1) is not understood by the perfect gas model. To rectify the situation , modify the TEST-codes to replace x1=100% with p1=828.5 kPa. Or, evaluate the states without using TEST-codes. The change in pressure, energy and exergy are calculated as 52.5 kPa,  18.1 kJ, and  0.29 kJ. The TEST-codes generated by Super-Calculate will, now, work with the IG or the RG model. With the IG model, the pressure difference remains unchanged, and the energy and exergy differences become 18.3 kJ and  0.3 kJ respectively. There is no significant difference between the PG and IG model because the temperature change in this problem is rather mild.

With the real gas (RG)  model, the results are not much improved. Changes in p, E, S and Phi are calculated as   83.7 kPa,  27.0 kJ, 0.087 kJ/K, and  1.07 kJ respectively.

States close to the saturation dome is modeled  more accurately by the RG model. Of course, the PC (phase-change) model is the most accurate and should be used whenever possible.



#  TEST-codes for Ex-6;
#  Daemon Path: Home>Daemons>States>System>PC Model ;

 
  States    { 
     State-0:  Propane(C3H8);
     Given:       { p0= 100.0 kPa;   T0= 25.0 deg-C;   Vel0= 0.0 m/s;   z0= 0.0 m;   }

     State-1:  Propane(C3H8);
     Given:       { T1= 20.0 deg-C;   x1= 100.0 %;   Vel1= 0.0 m/s;   z1= 0.0 m;   Vol1= 10.0 gallon;   }

     State-2:  Propane(C3H8);
     Given:       { T2= 40.0 deg-C;   Vel2= 0.0 m/s;   z2= 0.0 m;   m2= "m1" kg;   Vol2= "Vol1" gallon;   }
    }


 



 


Ex-7 A piston cylinder device of volume 10 L contains 50 g of air (a mixture of 77% N2 and 23% O2 by mass)  at -195 deg-C. If the air is compressed in an isentropic manner to a final volume of 1 L, (a) determine the final temperature. Use the real gas mixture model. (b) What-if scenario: How would the answer change if the final volume was 2 L instead?

Solution The problem, clearly, is a closed-process problem ( read the Navigation section of the tutorial). However, in this particular case, it can be also solved as a state problem as no process quantities such as work or heat transfer is involved.  Launch the state daemon from the Home.States.System.RealGasMixture location. Select N2 as gas-A and O2 as gas-B.

State-1: Choose State-1, enter x_A1 (77%), m1 , Vol1 and T1, Calculate. Note that the daemon can also handle a pure gas if you enter x-A as 1 (pure gas A) or 0 (pure gas B).

State-2: Choose State-2, enter x_A2 (77% or '=x_A1'), m2(='m1'), Vol2 (='Vol1/10') and  s2 ('=s1'), Calculate . The final temperature is -143 o C.

To explore the effect of compression ratio, simply change Vol2 (='Vol1/5') and Calculate the new answer as: -174oC.
 



#  TEST-codes for Ex-7;
#  Daemon Path: Home>Daemons>States>System>RG/RG Model;

   States    { 
     State-1:  N2, O2;
     Given:       { T1= -195.0 deg-C;   m1= 50.0 g;   Vol1= 10.0 L;   x_A1= 77.0 %;   }

     State-2:  N2, O2;
     Given:       { s2= "s1" kJ/kg.K;   m2= "m1" g;   Vol2= "Vol1/10" L;   x_A2= "x_A1" %;   }

     State-3:  N2, O2;
     Given:       { s3= "s1" kJ/kg.K;   m3= "m1" g;   Vol3= "Vol1/5" L;   x_A3= "x_A1" %;   }
    }
 



The Steam Table Daemon
Fig. 7.1  Mixture daemons of two gases look very similar to other state daemons. The only new properties
are x_A, mass fraction of species A and y_A, mole fraction of species A, one of which must be prescirbed
before any state can be evaluated.


 

 


Ex-8 A gas mixture made of equal proportions (by mass) of N2, O2, and CO2 enters a constant area duct at a pressure of 100 kPa, temperature 500 K, velocity 10 m/s and a mass flow rate of 6 kg/min. If the exit pressure and temperature are 90 kPa and 700 K, determine (a) the partial pressure of N2, (b) the cross-sectional area of the duct, and (c) exit velocity. Use the IG mixture model. (c) What-if scenario: How would the duct area change if the mixture contained only N2 and O2? 

Solution Launch the Flow State Daemon with the general mixture model (n-IG model). To set up the mixture, select N2, select  'Percent by Mass', enter 33.33 and click the Add/Modify button. Repeat with other species. The mole fractions are displayed on the right hand list. The partial pressure of N2 can be calculated as 100*0.398=39.8 kPa.

Now that the mixture composition is known, evaluate the states as described in the TEST-codes. Note that Velocity must be made an unknown (by removing its default value of zero) in state-2. The duct area is calculated as  124.3 cm^2 ,  and the exit velocity is found as Vel2= 15.55 m/s.

To change the mixture composition, select CO2, enter a value of zero and click Add/Modify. To update all calculations, Super-Calculate. The new duct area is calculated as 139.2 cm^2. 

Notice that although the gas is lighter due to the absence of CO2, the exit velocity does not change. 


 
daemon image
Fig.  8.1 The General Mixture daemon can handle any number of species. The mixture needs to be
set up only once.



#  TEST-codes for Ex-8;
#  Daemon Path: Test>Daemons>States>Flow>IG-GenMixModel; Version: v-7.5cf4;
#
#--------------------Start of TEST-Code-----------------------------------------------------------------------------

States {
State-1: mixture;
Given: { p1= 100.0 kPa; T1= 500.0 K; Vel1= 10.0 m/s; z1= 0.0 m; mdot1= 6.0 kg/min; }

State-2: mixture;
Given: { p2= 90.0 kPa; T2= 700.0 K; z2= 0.0 m; mdot2= "mdot1" kg/min; A2= "A1" m^2; }
}

 


 

Ex-9 Consider 100 m3 of moist air at  100 kPa, 30 o C and 70% relative humidity. Calculate (a) the mass of dry air and (b) mass of vapor. Also calculate (c) the amount of water vapor condensed if the mixture is cooled to 5oC in a constant-pressure process.  (d) What-if scenario:   How would the answer change if the total pressure was 200 kPa?


 

Solution Once again we have a closed process described in the problem (read Navigation), which can also be solved with the moist air state daemon. Launch the moist air state daemon by navigating to TEST.Daemons.States.System.MoistAir page. Moist air is the default working fluid.

State-1: Choose State-1, enter T1, phi1 , and Vol1. The default pressure is 100 kPa.  Calculate. The mass of  dry air and water vapor are calculated as: m1=111.5 kg and m_v1=2.125 kg respectively.

State-2: Choose State-2. Note that T2 being less than the dew point temperature, T_dp1=23.9oC, there will be condensation in this process, and, therefore, air must be saturated at  state-2 .  Enter T2 , phi2(100%), and m2 ('=m1'),( the mass of dry air will remain unchanged during the process). Enter p2 as '=p1' in preparation to the parametric study. Calculate . The mass of water vapor  m_v2=0.61 kg. Hence the amount of condensation must be 2.12-0.61 or 1.51 kg.

Get back to state-1, change the p1 to 200 kPa, Calculate and Super-Calculate . The amount of vapor, m_v1 and m_v2, can be found to be  completely unaffected by a change in the  total pressure.

To solve the problem more formally using the appropriate process daemon, visit the HVAC chapter of the tutorial.


The Steam Table Daemon
Fig. 9.1  Image of the Moist Air State daemon with a psychrometric plot superposed. 


#  TEST-codes for Ex-9;
#  Daemon Path: TEST>Daemons>States>System>MoistAir;

   States { 
                State-1:  MoistAir;
               Given:       { p1= 100.0 kPa;   T1= 30.0 deg-C; 
                          Vel1= 0.0 m/s;   z1= 0.0 m;   Vol1= 100.0 m^3; 
                          RH1= 70.0 %;   }

               State-2:  MoistAir;
               Given:       { p2= "p1" kPa;   T2= 5.0 deg-C; 
                           Vel2= 0.0 m/s;   z2= 0.0 m;   m2= "m1" kg; 
                            RH2= 100.0 %;   }
   }
 



Ex-10 Use the real-gas uniform-system state daemon to investigate how the internal energy of air changes with temperature over a range  of 200 K to 1500 K at (a) 100 kPa, (b) 1 MPa and (c) 10 MPa. Use the real gas model. (d) What-if scenario: How would the behavior change if the gas was argon instead?
 


Solution Clearly the problem involves nothing more than state evaluation. Launch the appropriate State daemon at Daemons. States. System. RealGas page. Select Air as the working fluid.

State-1 : Enter p1 (100 kPa), T1 (200 K), and Calculate. 

State-2 : Enter p2 ('=p1')) and T2 ('=T1+100'), and Calculate. 
..
..
State-13 : Enter p13 ('=p1')) and T2 ('=T1+1200'), and Calculate. 

Select  u-T from the pull-down plot menu. Click the ‘Plot-Data’ button to display the data used for the plot. Copy the data to a spreadsheet. To repeat the calculation with a different pressure, change p1 to 1 MPa and  T1 to 250 K (this shift will help avoid having data points on top of each other). A Super-Calculate will update all the states and generate detailed output on the I/O window. Go back to the States panel, plot the u-T  diagram, and copy the data to the spreadsheet. Repeat the same procedure with the third value of pressure and then with the second gas argon. Note that the table of thermodynamic properties for all the calculated states generated by the Super-Calculate operation can also be similarly copied to a spreadsheet for plotting or further processing.


Fig. 10.1 u-T plots (T on the x-axis) at three different pressures for air and argon. The plot was made with Microsoft Excel. Note that the behavior is linear for argon, a truly perfect gas. 

 



#  TEST-codes for Ex-10;
#  Daemon Path: TEST>Daemons>States>System>RG Model;

  States    { 
     State-1:  Air;
     Given:       { p1= 100.0 kPa;   T1= 200.0 K;   Vel1= 0.0 m/s;   z1= 0.0 m;   }

     State-2:  Air;
     Given:       { p2= "p1" kPa;   T2= "T1+100" K;   Vel2= 0.0 m/s;   z2= 0.0 m;   }

     State-3:  Air;
     Given:       { p3= "p1" kPa;   T3= "T2+100" K;   Vel3= 0.0 m/s;   z3= 0.0 m;   }

   .........

    }

 


Takes you to Manual page You are currently on the Examples page

Copyright 1998-: Subrata Bhattacharjee