User:Smuratet
Sean Muratet is a GSOC 2012 student from Huntsville, AL, USA. He is currently pursuing a Master of Science degree in Modeling and Simulation at Center for Modeling, Simulation, and Analysis of the University of Alabama in Huntsville. Mr. Muratet graduated from the University of Alabama in Huntsville with a BSE in Chemical Engineering in 2011. He has previously worked as a Graduate Research Assistant at the Center for Modeling, Simulation, and Analysis at UAH.
GSOC 2012 Goals
- Complete and test Peng Robinson EOS code currently in the FPROPS 2 branch.
- Integrate PR code into Ascend
- Code additional cubic EOS('s) into Ascend, and possible MWBR
- Continue the work of Richard_Towers on an XML based component file format
Progress Reports
6 July 2012
To this point, the main effort has been to determine the failure conditions of the current Peng Robinson code. A preliminary investigation dealing strictly with the case of water found that known accurate values of density at temperatures within the 2 phase region return negative pressure values. My first line involved tracing possible unit and conversion errors within the code. This turned out to be a dead end. At this point, I am fairly certain of the accuracy and appropriateness of the units within the PR code, at least as it applies to the saturation and pressure functions. Other function such as enthalpy and entropy have not been fully vetted at this point, but that will come soon. After more debugging, it became apparent that densities outside a certain range returned negative pressure values for a given temperature. This brings up an interesting numerical issue. The PR code takes a density and temperature as arguments to return pressure. This seems to be the tail wagging the dog in a sense. Obviously, at a certain temperature and density, the thermodynamic state of the system is set (Two intensive variables=system defined). However, in the two phase region, more than one density can map to the same pressure. In addition, one density root of the PR equation (the middle value of the three) is not physically significant.
This puts the onus on the user to ensure an appropriate density value is entered, consistent with the PR EOS. This may not be the case in many instances for someone not very familiar with the PR EOS in conjunction with a given fluid. It could be difficult to know a priori how to proceed. I will briefly try to provide examples of common situations which could prove troublesome:
1. Taking the fluid water at 298.15 K and density 997. This is generally known to be a situation where a two phase region is possible. With the PR EOS, this density would return a negative pressure. This could mean one of a few things. Either the fluid is in tension (a physical possibility in general but not here) or we are outside the range of physical significance of the PR EOS. Based on my own investigations, the maximum density must be less than 1/b or in this case approximately 951.752 where the PR EOS exhibits asymptotic behavior. There seems to be an additional asymptote around 2297, beyond which a positive pressure may be found.
2. Under the same temperature conditions, a density of 40 is a root of pressure 1.27 bar. However, this is a pressure root which is not physically significant. The two other roots 12.37 and 850.66 are the physically significant roots. However, without some mechanism to stop it, the user could enter this density and a pressure would be returned which is neither correct nor proper.
3. In general, a cubic will have three roots. For the case of the PR EOS a solution will have three real density roots or one real and two complex roots. If three real roots are found, it seems to indicate a two phase region although there is some disagreement as to whether the phases are in equilibrium as a consequence. If two complex solutions and one real is found, a single phase is indicated with density of the real root. However, a condition arises that is unexpected (to me at least). There is a case when three real roots are returned, but the system should be single phase. For example with carbon dioxide at 300 K and a density of 555, three real roots are returned. one is 555, the other two are -636 and -889.66. Just below at 554, two complex and one real roots (554) are returned. This point at which the transition is made seems to vary with temperature. The pressure from PR EOS is 237 bar (.237 GPa) at 555. This pressure does seem to be well within the range of possibility in terms of a pressure which could be reached. I don't currently know the implications of this behavior, or whether to ignore it or not. It is a situation though which would have to be dealt with in any code to try and find a saturation condition. We then can't simply say if three real roots are returned from a single pressure that the system is two phase and that the highest and lowest roots are the liquid and gas phases, respectively. We could be in the situation just described, and return values of -889.66 and 555 as vapor and liquid densities. Right now I believe it is sufficient to ignore roots which are negative or larger than 1/b.
Generally speaking, the PR EOS does not describe water very well at all. Still, the same problems might occur for other fluids which are better described. The end user must have some knowledge of equations of state generally to use them. We cannot hope to protect people from the poor results which will come from misuse, while at the same time providing software which is useful. I hope to write code which is a balance between the two principles. At this time, I think that means throwing an error for a density input at or above that which is 1/b. There may be a need to write a more elegant routine, but this should be the beginning.