domingo, 2 de marzo de 2025

Working with equations of state

 Working on implementation of equations of state, which involved solving the following problems:

 

a) Calculate the compressibility factor and the molar volume of methanol vapor at 200 °C and 10 bar. Virial equation versus ideal gas law.


b) Calculate the pressure of 1 mol of CO2 in a container of 2.5 dm3 at 40 °C. Virial equation versus Redlich-Kwong equation versus ideal gas.


c) Retrieve the vapor pressure and the liquid density data for methane from the DDBSP data base. Implement a liquid vapor pressure calculation for the Van der Waals equation of state and compare the results along the vapor-liquid coexistence curve to the experimental data.


d) Calculate the vapor pressures of benzene between 280 K and 540 K using the Soave-Redlich-Kwong equation of state.

The solutions can be found in the following Jupyter notebook.

The supplementary information is here and here.



sábado, 2 de noviembre de 2024

Excel: Sum is more robust than the "+" operator

 Did you know?, in Excel the SUM function is more robust than simply writing the "+" operator,

Check cell E7, where the SUM function is used, and cell E6, where the "+" operator is used, both for two inputs: C6, which contains a number, and D6, which contains the character "a".

Example: Fórmulas.


Example: results.


As you can see, the "+" operator fails with an error message, but the SUM function returns the result based on the numeric input only.

This is something to have in mind when designing a spreadsheet!


domingo, 11 de abril de 2021

Thermodynamics fundamentals - Part 2

Still working on thermodynamics problems....

 

We have the change in Gibbs free energy for the following reactions (every compound is a separate phase:

$Al_2O_3(s)+SiO_2(s)=Al_2SiO_5(s)$ $\Delta G^{\circ}=-8320-0.4T$ $J$

 

$3Al_2O_3(s) +2SiO_2(s)=Al_6Si_2O_{13}(s)$ $\Delta G^{\circ}=22770-31.8T$ $J$


a) Compute $\Delta G^{\circ}$ for the following reactions:

 

$3Al_2SiO_5=Al_6Si_2O_{13}+SiO_2$

 

$Al_6Si_2O_{13}=2Al_2SiO_5+Al_2O_3$

 

also compute the temperatures for which $\Delta G^{\circ}=0$

 

b) Plot the phase diagram for the system $SiO_2\cdot Al_2O_3$ between 45 and 65% mol percent $Al_2O_3$ at atmospheric pressure and the temperatures computed on a9)


c) For the reaction $3Al_2SiO_5=Al_6Si_2O_{13}+SiO_2$, $\Delta V>0$ ¿How would the coexistence temperature of these phases change if pressure increases?


The solution can be found on this Juypter notebook.

You can also check part one of this series here.


domingo, 4 de abril de 2021

Thermodynamics fundamentals

 Recently I have been reading Principles of extractive metallurgy , I'm currently at the starting chapters, mostly thermodynamics review. I will create an entry for every chapter with a couple of solved problems. 

So for this week these are the exercises:

1) For the reaction $H_2\text{(g, 1 atm)}+\frac{1}{2}O_2\text{(g, 1 atm)}=H_2O\text{(l)}$, $\Delta H^{\circ}_{298}=-285.9$ kJ and $\Delta G^{\circ}_{298}=-238$ kJ.

a) Compute $\Delta S^{\circ}_{298}$

b) The reaction can proceed at 298 K and 1 atm in a reversible way, for example, in a fuel cell, or in a completely irreversible form, that is, by combustion with no other work besides volume. Compute for both cases the heat $q$ absorbed from the environment and, for case a), the work $w'$ done on the environment. Show that your results are in agreement with the second law of thermodynamics.

Now I will try using a jupyter notebook for storing the solutions, I think the possibility of combining text and code could be useful for problems that requires several calculations.

The solution can be found here.

 

 

 

 

 

 

 

 

 

 





martes, 4 de agosto de 2020

Finding drying time from drying curve

This post shows how you can find the time that will take for a product to reduce its moisture content if you have a drying curve at hand.

Definition of drying rate

The drying rate $R$ is defined as:
$$R = -\frac{m_s}{A}\frac{dX}{dt}$$ Where $m_s$ is the mass of dry solid, $A$ is the area of heat/mass transfer and $X$ is humidity in mass of water per mass of dry solid. The rate also can be given in the form $R'=RA/m_s$. A drying rate curve shows $R$ as a function of $X$. To find the total drying time a simple integration is performed. But keep in mind that a drying curve is valid only for a specific equipment under specific operating conditions. 

Example

This example was taken from Seader's Book. Experimental data is provided for drying of rayon waste and it's required to estimate the drying time starting from $X=1$ to $X=0.10$.

Experimental data


A numerical integration using the average value of $R'$ between every pair of points gives a drying time equal to 5 [min]. The detailed calculation can be found on this file.

jueves, 23 de julio de 2020

Calculation of adiabatic saturation temperature

We will review how to calculate the adiabatic saturation temperature. The definition of this quantity was given in a previous post.

Problem definition


Given a gas-vapor mixture, if the inlet temperature and humidity are known, find the adiabatic saturation temperature.  The following equation is used:

From the inlet conditions we know $T_{\text{air}}$, Y and C. The main problem is that the humidity at saturation $Y_{\text{sat}}$ and the enthalpy of vaporization $\lambda$ depend on $T_{\text{as}}$. So an iterative calculation needs to be employed. Fortunately it can be easily implemented in Excel.

Example

This example comes from Seader's book. Air with inlet temperature 140 [F] and 12.5% relative humidity of water enters an process. Find the adiabatic saturation temperature of this current.
To solve this we also need enthalpy of vaporization and vapor pressure of water, and specific heat of both air and water, all as functions of temperature. All the required correlations can be found on Perry's book.

After a few trials by hand, the result is found using solver, and is equal to 87 [F]. The detailed calculations are on this file.




Starting with IDAES: Steady state CSTR