Labels

Showing posts with label Numbers. Show all posts
Showing posts with label Numbers. Show all posts

Sunday, June 12, 2016

Compressibility Factor For Air on HP50g

     The compression factor is related to the difference between the behavior of real and ideal gases. The ideal gas model tends to fail at low temperatures or high pressures, requiring correction. In the image below is shown an example of this misbehavior, in the case for nitrogen.

 Source: http://www.chem.ufl.edu/~itl/4411/lectures/lec_e.html

The compressibility factor is expressed by the relationship:


     There are several methods for finding the compressibility factor under certain conditions of pressure and temperature. The classic method is to search for the information on diagrams available in the relevant literature, but here is shown another method that is based on a modification of the Redlich-Kwong equation of state. It is an iterative method.

      The algorithm shown is proposed by Tapan Kumar Sen and published by Breno Tresoldi Minzon and Fabio Malavazzi Santilio. The original program, that operates in Reverse Polish Notation (RPN), is available in http://www.hpcalc.org/details.php?id=5806.

     The proposed approach is iterative, making an interesting use of programmable computers. The method is to guess an initial value for "Z" and iteratively achieve convergence between the following formulas:
 
  
Pr is the reduced pressure, given by Pr equals  P / Pc.
Tr is the reduced temperature, given by Tr equals T / Tc.

      The constant Pc and Tc are the critical pressure and the critical temperature of the gas. The values for some gases are shown in the table below.

 

     As my interest lies in the properties of air (applied to compressors, internal combustion engines) the code shown is built to deal directly with this gas.
    The following example is in USER RPL, to use with HP50g calculator in Algebraic mode.

The program also can be downloaded here.

Thanks for reading.

Eddie

Tuesday, March 15, 2016

Thermophysical Properties of Ammonia-Water mixture (NH3-H2O) - Absorption refrigeration - HP50g

      After some trouble reading NH3-H2O equilibrium diagram, I decided to implement a code to run an algorithm to give me the values without having to search in the fuss of lines of the graphical diagram (see image below). The plataform I used was the HP50g calculator.  

 NH3-H2O equilibrium diagram
source: ASHRAE

     One good thing in doing that is the elimination of the gross errors while reading the diagram. 

       The functions used to code is referenced in:

PÁTEK. J.; KLOMFAR, J. Simple functions for fast calculations of selected thermodynamics properties of the ammonia-water system. International Journal of Refrigeration, 18(4), pp. 228-234, 1995.  

T=temperature; P=pressure; x=molar fraction of ammonia (NH3) for the mixture in the liquid phase ; y=molar fraction of ammonia (NH3) for the mixture in vapour phase

Equation for temperature in function of pressure and molar fraction of ammonia (NH3) for the mixture in the liquid phase

 

Equation for specific entalphy in function of pressure and molar fraction of ammonia (NH3) for the mixture in the liquid phase


Equation for temperature in function of pressure and molar fraction of ammonia (NH3) for the mixture in the vapour phase

Equation for specific entalphy in function of pressure and molar fraction of ammonia (NH3) for the mixture in the vapour phase


      Altough the equations are fully empirical, they have shown excellent results for pressures up to 30 bar. 

      Setting the equations in the calculator is undertaking, but for HP50g users I will provide a link with the files. 

The files can be found here.

How to use?

Very simple, First you download the files and move them to the calculator. There are two ways to do that, one is via the connectivity kit, or easier yet, using a SD card.

In the calculator you call the numeric solver function (press orange button then 7), browse to the files and you're in the business.

Thanks for reading. 

Eddie