HOMEWORK FOR SEE-T9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) Assignment 1 a) Investigate the SUM-function in EES. Your lecturer (deliberately ;-) completely forgot to explain you how it works so you have to find out about it on your own! This function can turn out quite handy when operating on arrays within an equation set. HINT: Look in the built in help file in EES. SOLUTION: See the built in help file in EES! b) Write an EES program for solving the following Integral: 7 1 1 3 x sin x 3 dx x (HINT: You can use either the built in INTEGRAL function or write your own routine programmed as a PROCEDURE using a numerical integration method of your own choice – for instance Simpson’s method or similar). SOLUTION: Enter F=INTEGRAL((1/3)*x^3*SIN(x)/SQRT(x),x,1,7) and solve. c) Write a FUNCTION that can tell whether the function argument (a positive integer number) is a prime or not and test the function by calling it from the main program investigating whether the number 1747 is a prime! (Note that functions and procedures must be placed before the equation set). SOLUTION: The function could look as follows; {If '1' is returned number is a prime if '0' is returned number is not a prime} FUNCTION prime(x) prime:=1 {Initially set that number is a prime} IF (x<2) THEN prime:=0 {1 is not a prime} IF (MOD(x;2)=0) THEN prime:=0 {Equal numbers cannot be primes} divisor:=3; REPEAT IF (MOD(x;divisor)=0) THEN prime:=0 divisor:=divisor+2; UNTIL (Divisor^2>x) END {Main equation set} x=1747 test=prime(x) (In this case the variable ‘test’ will have the value ‘1’ indicating that 1747 is a prime! Note that we do only have to check divisors up the square root of the number. If you were a computer hacker searching for the key needed to decode some encrypted information, this would half the decoding time compared to searching the full key-space. However, there are much more advanced and way more efficient methods than the one shown here :-) MPN ’02 Page 1 af 6 HOMEWORK FOR SEE-9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) Assignment 2 Consider the oil cooler from the assignment you had during last lecture: a) Set up the continuity equation and the energy conservation equation (1 st law of thermodynamics in the complete version) for the shown heat exchanger. You may choose to base the energy conservation equation on either enthalpy or temperature. SOLUTION: Continuity: Energy conservation: b) Can variations in kinetic and potential energy be neglected in this case? SOLUTION: Yes, so that the energy conservation may be written: c) Give examples of processes where kinetic and potential energy variations cannot be neglected (one example regarding each energy form is acceptable – that is two overall!). SOLUTION: Examples could be a gas turbine (kinetic) or a pump system (potential). d) Prove that “your teacher” calculated the two functions below (the ones you solved last times). Pressure drops in the tubes can be neglected so you don’t have to consider the loss of momentum. f 1 T2 , T4 m water c p , water T1 T2 m 3 c p ,oil T3 T4 0 f 2 T2 , T4 m oil c p ,oil T3 T4 UA MPN ’02 T4 T1 T3 T2 T T ln 4 1 T3 T2 Page 2 of 6 HOMEWORK FOR SEE-T9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) In deriving the two equations with two unknowns you should use the LMTD method to calculate the transferred heat. You have not learned about this method yet but we will derive it in the next lessons. However, the function is as follows: T T T3 T2 Q oilwater UA 4 1 T T ln 4 1 T3 T2 SOLUTION: If we set up conservation equations for the oil side we find the following equations describing continuity and energy conservation: Since the inlet mass flows are know we can rewrite the above equations to: Combining this with the LMTD-method we find the searched equations (Q.E.D.). MPN ’02 Page 3 af 6 HOMEWORK FOR SEE-9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) Assignment 3 An ideal gas mixture has the following composition (numbers represents molar fractions – remember to use correct units treating these numbers by choosing ‘Mole Basis’ calculation in ‘Unit System’). Note that since the pressure is atmospheric the molar fractions equals the partial pressures: Gas: xi [-] CH4 ~ 0.50 CO2 ~ 0.15 N2 ~ 0.10 O2 ~ 0.08 H2O ~0.17 Sum: 1.00 Index (i=1) (i=2) (i=3) (i=4) (i=5) The gas temperature is 800K and the pressure is 1.013 bar (atmospheric). Write EES programs that calculate the following data for the gas (you can use the built in thermal property functions): a) Explain the terms ‘enthalpy’ and ‘entropy’ using the 1st and 2nd law of thermodynamics. SOLUTION: Read your notes about modelling of energy systems page 1-6! b) Calculate enthalpy and entropy properties for the gas mixture. SOLUTION: (Enter in EES – temperature unit set to [K] and use molar basis) hmix 0.5 * enthalpy (CH 4, T 800) 0.15 * enthalpy (CO 2, T 800) 0.10 * enthalpy ( N 2, T 800) 0.08 * enthalpy (O 2, T 800) 0.17 * enthalpy ( H 2O, T 800) smix 0.5 * entropy (CH 4, T 800, p 1) 0.15 * entropy (CO 2, T 800, p 1) 0.10 * entropy ( N 2, T 800, p 1) 0.08 * entropy (O 2, T 800, p 1) 0.17 * entropy ( H 2O, T 800, p 1) c) Explain the terms ‘conductivity’ and ‘viscosity’ – what do they express? SOLUTION: See your notes about modelling of energy systems page8-9. d) What is the difference between dynamic- and kinematic viscosity? SOLUTION: See your notes about modelling of energy systems page 9. e) Calculate mixture transport properties (conductivity and viscosity) in for the gas using Wilke’s simplified approach as described in your notes. f) Calculate mixture transport properties by only weighting the viscosities and conductivities with the molar fractions i.e.: 5 mix i 1 5 xi i and mix x i i i 1 This is obviously not the correct method of calculating mixture transport properties due to gas interactions though the approach is correct for enthalpies and entropies!! How much does the values deviate from the values you obtained in e)? MPN ’02 Page 4 of 6 HOMEWORK FOR SEE-T9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) SOLUTION (e+f): The following EES program calculates the mixture viscosity and conductivity of the gas mixture (e) and compares it with the error compared to the mean averaged method (f). Note that the program is written in European format (comma is decimal separator and list delimiter is semicolon): MPN ’02 Page 5 af 6 HOMEWORK FOR SEE-9 - ANALYSIS, MODELLING AND SIMULATION OF ENERGY SYSTEMS (PART II) g) Could we have used the methods for ideal gasses if the media we needed to calculate mixture properties was a liquid, vapor or a binary mixture consisting of both gas and liquid or solid? SOLUTION: No, we would need to consider the interaction between the fluids differently. MPN ’02 Page 6 of 6