Thermodynamic Properties of Fluids Tutorial

Thermodynamic Properties of Fluids Tutorial

A live version of this calculation is available at EngineeringPaper.xyz.

EngineeringPaper.xyz now has the capability to provide thermodynamic fluid properties for numerous fluids including air, humid air (psychrometrics), water/steam, numerous refrigerants, and common heat transfer fluids including ethylene glycol and propylene glycol aqueous solutions. The thermodynamic property capabilities of EP rely on the excellent CoolProp library. If you’re familiar with CoolProp, EngineeringPaper.xyz is providing a wrapper for the PropsSI, HAPropsSI, and PhaseSI functions.

In order to use the fluid property capabilities of EngineeringPaper.xyz, the first step is to create a fluid properties cell by clicking the fluid drop icon,

. This will provide several drop down menus to setup the fluid you are interested in and the property you would like to obtain. For our first example, let’s calculate the mass density of water at a temp of 20 degC and a pressure of 1 atm. After creating the fluid cell, you’ll see that the fluid is already set to water and that the output is already set to mass density. Additionally, the inputs are already set to temperature and pressure. Since everything is setup correctly, we’re ready to go! With each fluid properties cell, EP creates either a function, for properties that depend on state, or a constant, for properties that do that depend on state. In this case, a function called WaterDGivenTP is created that we can call in any EP expression (see the fluid property cell below):

Now that the function is defined, we can use it as we would use any built-in function like the sine or cosine functions. Note, that for convenience, we can use the copy button,

, next to the function name so that we can copy and paste it into a new math cell. For example, let’s get the density of water at 1 degC and 1 atm:

$$ \mathrm{WaterDGivenTP}\left(20\left\lbrack degC\right\rbrack,:1\left\lbrack atm\right\rbrack\right)= 998.207150467928 \left\lbrack \frac{kg}{m^{3}}\right\rbrack $$

Notice that we use units the same way as anywhere else in EngineeringPaper.xyz. For example, we could just as easily obtain the density of water at 75 degF in lbm/ft^3:

$$ \mathrm{WaterDGivenTP}\left(75\left\lbrack degF\right\rbrack,:1\left\lbrack atm\right\rbrack\right)=\left\lbrack\frac{lbm}{ft^3}\right\rbrack =62.2610746354152 \left\lbrack\frac{lbm}{ft^3}\right\rbrack $$

So far, we’ve only used the default settings of the fluid properties cell. Let’s be a little more adventuresome and change things up a bit. Let’s obtain the latent heat of fusion of water. To do so, we’ll need to create a new fluid properties cell with enthalpy as the output this time. Note that it might be tempting to change the previous fluid cell that we created, however, doing so would break the water density calculations that depend on it. We’ll leave the second input as pressure, but we’ll need to change the first input to the molar vapor quality, Q. Q can take any value between and including 0 and 1, where 0 is saturated liquid and 1 is saturated vapor. See the new fluid properties cell with these settings below:

Notice that a new function name is automatically created that indicates the fluid, the output, and the two inputs. You can use your own function name, if you prefer, by editing the function name in the fluid properties cell. Now, let’s calculate the latent heat of vaporization. To do so, we need to subtract the enthalpy of the saturated vapor from the enthalpy of the saturated fluid, as shown in the following math cell:

$$ \mathrm{WaterHGivenQP}\left(1,1\left\lbrack atm\right\rbrack\right)-\mathrm{WaterHGivenQP}\left(0,1\left\lbrack atm\right\rbrack\right)=\left\lbrack\frac{kJ}{kg}\right\rbrack =2256.47159240668 \left\lbrack\frac{kJ}{kg}\right\rbrack $$

So far, we’ve only obtained properties that depend on state. However, there are some properties of a fluid that do not depend on state. Molar mass is an example of one such property. Let’s get the molar mass of the R32 refrigerant (finally, something besides water!). Yes, you guessed it, we need another fluid properties cell (note that the order of the cells in your sheet doesn’t impact the results, so you can safely put all of your fluid property cells at the end of your sheet so they don’t clutter things up). See the fluid properties cell below for the molar mass of R32:

Notice that when choosing molar mass as the output, the inputs are now grayed out since they are not needed. The other difference is that a constant is created instead of a function. Therefore, we can use the _R32MolarMass _as we would any other variable in EP:

$$ R32MolarMass= 0.052024 \left\lbrack \frac{kg}{mol}\right\rbrack $$

There’s one special fluid in a fluid properties cell that is different than the rest since it requires three inputs to define its state. That fluid is humid air (moist air or psychrometrics, if you prefer). Since the properties of humid air depend of the relative ratio of water vapor to air, three inputs are now required to fully define state. Let’s calculated dew point as a function of dry bulb temperature and relative humidity. Here’s the setup for the fluid properties cell to make this calculation possible:

Now we can calculate the dew point for 75 degF air and 55% relative humidity at 1 atm:

$$ \mathrm{HumidAirTdpGivenTRhP}\left(75\left\lbrack degF\right\rbrack,0.55,:1\left\lbrack atm\right\rbrack\right)=\left\lbrack degF\right\rbrack =57.7584822911452 \left\lbrack degF\right\rbrack $$

We can also create plots using this functions. However, it is necessary to first create a user defined function as covered in the Plotting and Functions Tutorial. Let’s plot dew point versus relative humidity. First, create the user defined function leaving one unbound variable RH:

$$ T_{dp}=\mathrm{HumidAirTdpGivenTRhP}\left(75\left\lbrack degF\right\rbrack,:RH,:1\left\lbrack atm\right\rbrack\right) $$

Now the plot can be created by providing a range for the RH variable:

You now know enough to get started using fluid properties in EngineeringPaper.xyz. It’s designed to be self documenting, so go ahead and explore. If you have questions or run into issues, the official subreddit or the EngineeringPaper.xyz GitHub discussions page are good places to get help. If public forums aren’t your thing, you can also contact us at support@engineeringpaper.xyz

You may of noticed that a new fluid properties cell needs to be added for each new output or each different set of inputs. This can make it tedious to quickly compare different fluids since you’ll need to switch the fluid selection in all of the fluid property cells. Well, there’s a feature to make this easier as well! If you check the “Use sheet fluid” check box, the fluid selection is now tied to the sheet rather than to the cell and if you change the fluid selection in a fluid properties cell with this check box checked, the fluid selection will be updated in every fluid property cell that is using the sheet fluid. This is best shown using an example. Let’s get the viscosity, mas density, and specific heat for a ethylene glycol aqueous solution (20% by mass):

$$ \text{Dynamic viscosity: }\mathrm{VGivenTP}\left(20\left\lbrack degC\right\rbrack,:1\left\lbrack atm\right\rbrack\right)=\left\lbrack cP\right\rbrack =1.66242023854237 \left\lbrack cP\right\rbrack $$

$$ \text{Mass Density: }:::::\mathrm{DGivenTP}\left(20\left\lbrack degC\right\rbrack,:1\left\lbrack atm\right\rbrack\right)= 1024.10384134376 \left\lbrack \frac{kg}{m^{3}}\right\rbrack $$

$$ \text{Specific Heat:}:::::\mathrm{CGivenTP}\left(20\left\lbrack degC\right\rbrack,:1\left\lbrack atm\right\rbrack\right)=\left\lbrack\frac{kJ}{kg\cdot K}\right\rbrack =3.89619860367942 \left\lbrack\frac{kJ}{kg\cdot K}\right\rbrack $$

Let’s say, you want to switch to a 30% by mass propylene glycol solution. Easy, just change the first fluid properties cell below and all of the values will update since they are tied to the sheet fluid. Go ahead, try it!