GENG4405 2019 – Assignment 2, Part 2
Part 2 of the Assignment: What is the fluid volume?
The geothermal fluid from the reservoir reaches the surface as a two-phase fluid. As previously mentioned, the vapor fraction will be separated off and run through a turbine and the liquid fraction will be reinjected to the reservoir. For the purposes of sizing pipes and equipment it is necessary to know the specific volume (on a mass basis) of the liquid and vapor phases. Your team has been tasked with developing code to calculate the volumes based on the pressure to be used in the separator and turbine inlet. While the final pressure has yet to be determined, through some optimization procedure, you can demonstrate that your code works by using 8 bar absolute pressure. The geothermal fluid may be approximated as pure water.
Since the system being modeled is two-phase the pressure and temperature are linked. It is suggested that you think of your code as containing two loops. On the outer loop you guess a value for the temperature, starting from a temperature that should correspond to a super-heated vapor. On the inner loop you run your algorithm(s) for finding a value of v (the specific volume) that will be a root for the equation of state. By stepping down in temperature on the outer loop you should eventually cross the saturation temperature and the value of the root, corresponding to the specific volume, should become much smaller (~2 orders of magnitude). You can check if this has happened by taking the ratio of specific volumes from successive temperature steps.
Update: I wasn’t thinking straight, my apologies. If you plot it, you will find that there are three roots to 𝑃(𝑣, 𝑇) − 800,000 Pa = 0 for reasonable guesses of T. The smallest root is the predicted liquid phase volume, the largest root is the predicted vapor phase volume and the middle root isn’t physically meaningful. There’s another step to the process (that we may do as a bonus problem) that checks if the calculated roots satisfy the conditions for vapor-liquid equilibrium or not. For the time being, please just guess a temperature based on the provided T-v diagram. Don’t worry about iterating to find the correct temperature.
Assignment Questions:
1. (5%) Plot the function 𝑃(𝑣, 𝑇) − 800,000 Pa = 0 and show the approximate location of the three roots. Use the equation of state previously provided.
2. (20%) Write MATLAB code to determine the predicted liquid and vapor phase volumes. In your writeup to the assignment please report these as specific volumes on a mass basis (the EOS is on a molar basis) along with some statement about the accuracy or relative error in the values. You may use any of the methods for finding zeros and roots discussed in class but may not use in built MATLAB functions (such as fzero) in your code (of course you can use that function as a means of checking your code).