ChemEng stuff followers

Monday, September 8, 2025

Key Excel features into Python add-in

 In this post, two very common features of Excel are tested within an add-in for Python from Anaconda. These features are:

  • cell fixing with $ and
  • repeated calculation by the drag and drop function of Excel.



For short, you should relax since YES, these two features are actually available in the Python add-in from Anaconda. In other words, you may use the $ to fix cells so that some data remains constant within a formula. See for reference the image below,



Also, if you inserted your code in a given cell, say B9, for example, you can drag and drop from that cell so that other cells fill in with the same formula while some cells remain fixed, just like B4, B5 and B8.



I hope you find this post helpful.

Sunday, August 17, 2025

A case of conversion - From $lb_m$ to $gpm$

 Imperial units prove to be somtimes hard to use. Here the case of conversion from mass to volumetric flowrate is presented.

As one may imagine a physical property of the fluid is required: the density $\rho$. This can be written as,

$\dot{Q}= Q\, \rho$        Eq. (01)

where $\dot{Q}$ is the mass flow rate, in $lb_m/hr$ for example, and $Q$ is the volumetric flow rate, in $gpm$, for example.

Let us now consider the case of $40,000.00\, lb_m/hr$ flowing liquid water at $190\,^\circ \, C$. In this case, its density would be $\rho=54.70\,lb_m/ft^3$.

Using Eq. (01), it follows,


$Q=\dfrac{\dot{Q}}{\rho}=\dfrac{40,000.00\, lb_m/hr}{54.70\, lb_m/ft^3}$
$Q=924.56\,ft^3/hr=115.27\,gpm$

which is the desired conversion. If you were working with steam, working pressure must be considered to get the proper fluid density.

Sunday, August 10, 2025

Commercial steel pipe Schedule 80 data

 You should be familiar with the data provided in the Appendix B of Flow of fluids through valves, fittings and pipes, for commercial steel pipes with schedule 40 for the flow of water and air.



Several questions always arise: what is the data for schedule 80 commercial steel pipe? what are the data for other pipes (PVC, copper, etc.)? This  data is available on the internet and you should search for it. However, this post is devoted to provide the data for commercial steel pipe schedule 80 and to serve as proof that this information is provided by the manufacturers.

Here, two files are provided:

Make a comparison with the data provided in the reference mentioned early. These files data are for water too.


Monday, May 12, 2025

Mass balance on rectifying and stripping plates

 This post deals with the mass balance aplied to a distillation column. This has to do with something called fractional distillation. As you may know in this kind of operation, the column top section is called: rectifying section; while that of the bottom is called: stripping section; provided the feed is in the middle plate.


Mass balance on the rectifying section

Or better said, on the plates of the top section. This applies for a binary mixture. In Fig. 01 a general representation of this is presented. 

  • All plates are numbered from the top
  • $n$ is the last plate on the rectifying section. Of course, $n$ is also a counter going from 1 to the last plate.
  • The referred component on the mol fractions $(x,y,z)$ is the most volatile

Fig. 01 Mass balance on the rectifying section.


In this way a global mass balance can be easily writen as,

$G_{n+1}=L_n+D$        Eq. (01)

On the other hand, a mass balance for the component of interest (say component $A$)  on each plate on this section can be easily written as,

$G_{n+1}\, y_{n+1}\, -\, L_n\, x_n \,=\,D\, z_D$        Eq. (02)

From Eq. (02), the mole fraction in the vapor entering the nth plate can be isolated to be,

$y_{n+1}=\dfrac{L_n}{G_{n+1}}x_n+\dfrac{D}{G_{n+1}}z_D$        Eq. (03) 

One important simplification on Eq. (03) can be made on the nature of the flow rates entering and leaving the plates: the flow rates of the liquid and vapor are constant always. This is a very strong assumption and is at the heart of the method of calculation called after Sorel and Lewis.

In this way, Eq. (03) becomes,

$y_{n+1}=\dfrac{L}{G}x_n+\dfrac{D}{G}z_D$        Eq. (04)

Mass balance on the stripping section

In this case, we just repeat the same process as before. Fig. 02 shows an schematic of this section.

Fig. 02 Mass balance on the stripping section.


In. Fig. 02 variables for vapor and liquid have been barred $(\bar{V},\bar{L})$ to avoid confusion with those of the rectifying section. Also, the counter $m$ has been introduced to number the plates of the stripping section. The global mass balance is,

$\bar{L}_m=\bar{G}_{m+1}+W$        Eq. (05)

In the same way as before, from the mass balance for the component $A$ the following equations arise.

$\bar{L}_m x_m=\bar{G}_{m+1}y_{m+1}+Wx_W$        Eq. (06)

and

$y_{m+1}=\dfrac{\bar{L}_m}{\bar{G}_{m+1}} x_m-\dfrac{W}{\bar{G}_{m+1}}x_W$        Eq. (07)

Again, using the idea of constant liquid and vapor flow rate art each plate, Eq. (07) reduces to,

$y_{m+1}=\dfrac{\bar{L}}{\bar{G}} x_m-\dfrac{W}{\bar{G}}x_W$        Eq. (08)

Recall that Eq. (08) comes from a rough approximation.

Sunday, May 11, 2025

A simple mass and enthalpy balance on single stage distillation

 Here the case of distillation in a single stage is presented. This is a simple case corresponding to just boiling the mixture and then separating it in the column. Of course, neither plates nor packing is needed. Despite its simplicity it is worth to discuss the physics of the process.

Instantaneous evaporation


In sketch above a mixture feed $F$ is passed to a heat exchanger that boils the  liquid and then to a separator. In the separator, the vapor goes to the top while  the liquid goes to the bottom. A mass balance for this very schematic case is twofold: there is a global balance and a balance on the component of interest (which can be more than one). For the global mass balance we have,

$F=D+W$        Eq. (01)

and for the component of interest the balance is written as,

$Fz_F=Dy_D+Wx_W$        Eq. (02)

An energy balance based on the enthalpy of each stream can be written as,

$FH_D+Q=DH_D+WH_W$        Eq. (03)

where $Q$ is the heat supplied in the heat exchanger to boil the feed F. Equations (01-02) can be combined to give,

$\dfrac{W}{D}=\dfrac{y_D-z_F}{z_F-z_W}$        Eq. (04)

which can be a more useful relationship. Also, Eqs. (01,03) can also be combined. The result is,

$-\dfrac{W}{D}=\dfrac{H_D-\left( H_F+Q/F \right)}{H_W-\left( H_F+Q/F \right)}$        Eq. (05)

This is the end. Enjoy.

Most popular posts