From vapor temperature to vapor abv

Distillation methods and improvements.

Moderator: Site Moderator

Post Reply
User avatar
Edwin Croissant
Swill Maker
Posts: 256
Joined: Sat Jul 06, 2013 5:11 am
Location: The Netherlands

From vapor temperature to vapor abv

Post by Edwin Croissant »

Some time ago I made some functions to convert mole fractions to ABV and back and some functions to calculate the boiling point of an ethanol water mixture and the resulting vapor concentration. It has been asked several times on this forum if there are formula's available to calculate the reverse: from vapor temperature to vapor concentration. Now I have made some functions that do exactly that.

The funny thing with VLE formula's that they are not very accurate. At near vacuum condition they will show an azeotrope that in reality is not there. So my functions are not accurate near vacuum. Experimental data is scarce and mostly beyond pay walls so I cannot check the validity of my functions. So use at your own risk.

Please feel free to pick this apart and if you find errors, and you will, please let me know :-)

The functions can be found in the attached example

Now:

X = mole fraction liquid
Y = mole fraction vapor
T = temperature in Celsius
P = pressure in mmHg
A = Azeotrope


X2T(X, P) Result is T for given X and P
X2Y(X, P, T) Result is Y for given X and P and an optional T
Y2X(X, P) You should get it by now
T2X(T, P, xAzeo) xAzeo is optional
P2XA(P) Result is the mole fraction at the azeotrope
P2TA(P) Result is the temperature at the azeotrope

The optional parameters are calculated if not present, when available it will save some calculation time.

Fro those of you wondering why there is no P2YA(P) I suggest to study some more :)

The example I made work in LibreOffice 5.0.2.2 and in Open Office 4.
In the example you can enter a minimum barometric pressure, a maximum barometric pressure, a pressure step and a minimum ABV in the sheet named "MAIN". Make sure you leave the last cell you edited by selecting another cell before you click the button "Start".
After clicking the button a new sheet is made and filled like this example:
VLE example.png
I made this example to eventually generate a look up table that could be read by an Arduino type micro controller to show the ABV that matches the temperature and barometric pressure. Why a look up table? Some of these routines are rather slow as many iterations are needed to get a result. Try out the example and you will understand why :)

I hope this is useful for somebody.
Attachments
VLE example.zip
(23.86 KiB) Downloaded 241 times
"In all affairs, it’s a healthy thing now and then to hang a question mark on the things you have long taken for granted.”
Bertrand Russell
Mr98398
Novice
Posts: 20
Joined: Wed Feb 04, 2015 4:32 pm

Re: From vapor temperature to vapor abv

Post by Mr98398 »

Thanks Edwin. I always wanted to build an Android app to do just that but have been too lazy busy with important stuff to figure out the math. Guess I'm out of reasons not to start coding...
User avatar
Edwin Croissant
Swill Maker
Posts: 256
Joined: Sat Jul 06, 2013 5:11 am
Location: The Netherlands

Re: From vapor temperature to vapor abv

Post by Edwin Croissant »

–--Please consider the above spreadsheet as obsolete---


I stumbled upon Technical Paper 19 by Herminio M. Brau some time ago when I was searching for fusel oil behavior. The paper is a compilation of experimental data from Noyes and Warfel from 1901 for the boiling points and Data from Cornell and Montonna from 1933.

There is not much experimental data available that is not behind a pay-wall.
Now I thought that the above equation was accurate, however compared to the expirimental data it is not.
Difference.png
I think that until the forces between the molecules during boiling are fully understood an accurate equation is not possible.

From the Technical Paper 19 I interpolated a table that will give the liquid and vapor ABV for a given temperature. Please note that the original data set for the boiling point consisted of 60 data points and the original data set for the liquid and vapor ABV's consisted of 45 data points.
VLE-small.png
Attachments
VLE.zip
(77.18 KiB) Downloaded 188 times
TXY C-ABV for PDF.pdf
(60.36 KiB) Downloaded 236 times
"In all affairs, it’s a healthy thing now and then to hang a question mark on the things you have long taken for granted.”
Bertrand Russell
Maritimer
Rumrunner
Posts: 716
Joined: Sun Jul 01, 2012 6:09 am
Location: Nova Scotia, Canada

Re: From vapor temperature to vapor abv

Post by Maritimer »

Hi Edwin,

A while ago I turned the Cornell and Montonna data into ascii. Here it is, if you or anyone else wants to use it:
Cornell and Montonna OCR.pdf
(29.12 KiB) Downloaded 231 times
And here is the original:
true %ABV at temp.pdf
(1.45 MiB) Downloaded 327 times
It is in the form of a list of 201 lists. Each of the sublists is one line in the table of data. It has been thoroughly checked.

Thanks for the new data.

M
sungazer
Bootlegger
Posts: 123
Joined: Sat Dec 05, 2015 11:45 pm

Re: From vapor temperature to vapor abv

Post by sungazer »

This may not be the correct thread to ask this question so please forgive me.

What I have always wondered is what the "other components " that we could expect in a wash to be at Vapor temperature at the top of the column? Along with this I have noticed that some washes will have a different "hearts" temperature that is a temperature where the still will run completely stable for the majority (95%) of the run. Is the still producing pure ethanol or has this wash produced something slightly different?

I am aware of the temperature measurement error components and have minimized them or taken these into account.

Is it just barometric pressure on the day or something else.

My examples are washes that would vary from 77.6 to 78.6 (just to be clear these difference's are the stable temperatures from different washes run on different days ) Have I produced something slightly different or is it just in the variables?
User avatar
Yummyrum
Global moderator
Posts: 7653
Joined: Sat Jul 06, 2013 2:23 am
Location: Fraser Coast QLD Aussie

Re: From vapor temperature to vapor abv

Post by Yummyrum »

Edward , sorry I have little Idea what you are doing here and I can't contribute anything but I see the Graph with the blue and Red lines and it seems very similar to the one that's been bandied around here fore years .

However I see quite a distinct kink in both these red and blue curves . Do you now what that's all about and is the familiar curves we see around here a "normalized " version of this
freaky_cutout
Novice
Posts: 69
Joined: Sat Jan 16, 2016 9:32 pm
Location: New Zealand

Re: From vapor temperature to vapor abv

Post by freaky_cutout »

Right, interesting stuff.
Getting back into stilling after a few years off.
User avatar
Edwin Croissant
Swill Maker
Posts: 256
Joined: Sat Jul 06, 2013 5:11 am
Location: The Netherlands

Re: From vapor temperature to vapor abv

Post by Edwin Croissant »

sungazer wrote:This may not be the correct thread to ask this question so please forgive me. [...] Is it just barometric pressure on the day or something else. My examples are washes that would vary from 77.6 to 78.6 (just to be clear these difference's are the stable temperatures from different washes run on different days )
I think the question is appropriate as the boiling temperature varies with the barometric pressure. The pressure varied from below 980 to above 1020 millibar in a couple of days last week where I live. That is a boiling point change for water from 99.3 to 100.3 °C. So today you can make a combined barometer and thermometer that calculates the ABV for you like this:
eParrot test with VM.jpg
This will give you the ABV of the boiler and the ABV of the top of the column. The output reading of the Alcometer (92%) was corrected for temperature (13 °C) ~93.7 % ABV.
I am now working on one that uses a temperature sensor that is accurate within 0.1 °C and can convert to 0.01 °C resolution within 15 milliseconds. :)

I attached a spreadsheet (warning contains macro's) that can calculate the shift in boiling point and , thanks to Maritimer, compensate your alcometer for temperature using the equation from the Organisation Internationale de Métrologie Légale. I think this is the same equation that is used to correct the alcometer readings for the excise duty.
Yummyrum wrote:Edward , sorry I have little Idea what you are doing here and I can't contribute anything but I see the Graph with the blue and Red lines and it seems very similar to the one that's been bandied around here fore years . However I see quite a distinct kink in both these red and blue curves . Do you now what that's all about and is the familiar curves we see around here a "normalized " version of this
The familiar curve is from an equation that is not very accurate. This graph is based on experimental data. One day I am going to redo Brau's work from 1957 with the computer to see if I get different results.
Maritimer wrote:A while ago I turned the Cornell and Montonna data into ascii. Here it is, if you or anyone else wants to use it:

First pdf is the table from Brau (without the misprints :clap: ), second pdf is for correcting an alcometer.
Thank you, thank you very much :thumbup: for making that nasty equation from the Organisation Internationale de Métrologie Légale into a manageable format. The coefficients are not exactly the same but I suspect that the program you used did a simplification. The output matches the table to the last digit as far as I can see. :clap:
Attachments
ABV temperature correction en.zip
(14.3 KiB) Downloaded 219 times
"In all affairs, it’s a healthy thing now and then to hang a question mark on the things you have long taken for granted.”
Bertrand Russell
Maritimer
Rumrunner
Posts: 716
Joined: Sun Jul 01, 2012 6:09 am
Location: Nova Scotia, Canada

Re: From vapor temperature to vapor abv

Post by Maritimer »

Hi Edwin,

How are you doing your calculations these days?

Any chance to convert you to Mathematica? I've got tons of stuff to share. (That applies to anybody else who is using Mathematica.)

Did you find an error in the coefficients? There were a lot of corrections in the OCR conversion.

M
sungazer
Bootlegger
Posts: 123
Joined: Sat Dec 05, 2015 11:45 pm

Re: From vapor temperature to vapor abv

Post by sungazer »

Thanks for the information. I can get quite large pressure changes however the average would vary by about 20hpa my weather station has shown from 980 up to 1048. You will need to use a RTD thermometer to be able to go into the sub 0.1 degree resolution. Thermocouples or thermistors just don't have the capacity.

Do you have the formula for barometetric pressure changes to the boiling point of ethanol ? I might make up a bit of a table just so I am more at ease with the number on my thermometer and the product coming over and out.
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

Sorry to dig out an old post, but I was reading some other threads and is there finally an equation to convert vapor temp to %ABV corrected with a measured pressure ?
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

cede wrote:Sorry to dig out an old post, but I was reading some other threads and is there finally an equation to convert vapor temp to %ABV corrected with a measured pressure ?
+1

I need that formula too ;)


Отправлено с моего iPhone используя Tapatalk
User avatar
Edwin Croissant
Swill Maker
Posts: 256
Joined: Sat Jul 06, 2013 5:11 am
Location: The Netherlands

Re: From vapor temperature to vapor abv

Post by Edwin Croissant »

To comment on a old post:
I made a Arduino library for the SMT172 temperature sensor, resolution 0.01 C, conversion time about 20 ms.

In reply to the two recent posts:
I made a eParrot based on the Arduino. I use the Clausius Clapeyron relation to compensate for pressure. Unfortunately I misplaced the conversion of this equation to programming code :oops:
You can find the source here: https://github.com/EdwinCroissant
"In all affairs, it’s a healthy thing now and then to hang a question mark on the things you have long taken for granted.”
Bertrand Russell
The Baker
Master of Distillation
Posts: 4659
Joined: Sun Aug 27, 2006 4:48 am
Location: Northern Victoria, Australia

Re: From vapor temperature to vapor abv

Post by The Baker »

cede wrote:Sorry to dig out an old post, but I was reading some other threads and is there finally an equation to convert vapor temp to %ABV corrected with a measured pressure ?
There seems to be a very strange sort of internet etiquette that says you ought not to 'dig out an old post'.

Why the hell not??

Geoff
The Baker
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

Nice piece of code Edwin.
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

Edwin Croissant wrote:To comment on a old post:
I made a Arduino library for the SMT172 temperature sensor, resolution 0.01 C, conversion time about 20 ms.

In reply to the two recent posts:
I made a eParrot based on the Arduino. I use the Clausius Clapeyron relation to compensate for pressure. Unfortunately I misplaced the conversion of this equation to programming code :oops:
You can find the source here: https://github.com/EdwinCroissant
Cool!
Just checked your code
Only one thing I can't get yet, how calculated index become AbV value. Sorry, I'm not familiar with Arduino so far :)

Btw, check out this calculation - https://planetcalc.ru/275/" onclick="window.open(this.href);return false;" rel="nofollow
It helps me calculate boiling temperature with given AbV and pressure with Herminio M. Brau table
Only opposite function left...
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

DenisO wrote: Only one thing I can't get yet, how calculated index become AbV value. Sorry, I'm not familiar with Arduino so far :)
The index is a function of temperature and pression.

Code: Select all

// Calculate the index for the table (1251 is the the azeotrope at 1013.25 hPa and the
// starting point of the table) in °DC
int16_t IndexABV = int16_t((T + 0.03125 + 78.174 - azeotrope(P)) / 0.0625 ) - 1251;
Then the index is checked and the ABV is looked up in the table.
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

cede wrote: Then the index is checked and the ABV is looked up in the table.
Exactly
But I have no idea how "eeRead16(3389)" become to (lets say) 845, to divide by 10 and finnaly get 84,5%
Another words, how exactly "eeRead16(3389)" points to particular value in a table
I just do not understand this part of code

Code: Select all

uint16_t eeRead16(uint16_t address) {
	union {
		uint8_t as8[];
		uint16_t as16;
	} value;
	I2c.start();
	I2c.sendAddress(SLA_W(0x50));
	I2c.sendByte(highByte(address));
	I2c.sendByte(lowByte(address));
	I2c.start();
	I2c.sendAddress(SLA_R(0x50));
	I2c.receiveByte(1, &value.as8[0]);
	I2c.receiveByte(0, &value.as8[1]);
	I2c.stop();
	return value.as16;
}
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

The tables are transfered to an external eeprom thus the eeread. Check the ABVtoEeprom.ino.
Tables are here.

It reads the N th element in the eeprom and returns it.

Do you just need the formulas ?
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

cede wrote:It reads the N th element in the eeprom and returns it.

Do you just need the formulas ?
So, what AbV for 3386 th element then, in LiquidABV[] table? If in table just about 2200 elements only :)
And index can be in range 0 - 4364
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

Code: Select all

float TtoLiquidABV(float T, float P) {
	...
	if (IndexABV < 0) return float(IndexABV) * 0.01; // Below azeotrope
	if (IndexABV + 7818 > 10000) return 0; // Above 100 °C
	...
From Edwin's code, you'll never go over the maximum index, I hope :)
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

cede wrote: From Edwin's code, you'll never go over the maximum index, I hope :)
You forgot one string in code, most important one :D

Code: Select all

---
if (IndexABV < 0) return float(IndexABV) * 0.01; // Below azeotrope 
if (IndexABV + 7818 > 10000) return 0; // Above 100 °C 
return float(eeRead16( 0 + IndexABV * 2)) / 10;  // <- range 0 - 4364
---
Based on this, function can return index value in range 0 - 4364, for table with about 2200 values, as I wrote before.

So, its not about index range(max value), its about Arduino hardware memory access way, and that part of code not clear for me.
User avatar
Edwin Croissant
Swill Maker
Posts: 256
Joined: Sat Jul 06, 2013 5:11 am
Location: The Netherlands

Re: From vapor temperature to vapor abv

Post by Edwin Croissant »

The eeprom is 8 bit. The array in the eeprom consist of 16 bit values. First value start at address zero and occupies two bytes, next value starts at address two, etc. Thats why the index is multiplied with two to get the right eeprom address.
"In all affairs, it’s a healthy thing now and then to hang a question mark on the things you have long taken for granted.”
Bertrand Russell
User avatar
DenisO
Novice
Posts: 28
Joined: Wed Jan 10, 2018 8:00 pm
Location: Moscow

Re: From vapor temperature to vapor abv

Post by DenisO »

Edwin Croissant wrote:The eeprom is 8 bit. The array in the eeprom consist of 16 bit values. First value start at address zero and occupies two bytes, next value starts at address two, etc. Thats why the index is multiplied with two to get the right eeprom address.
Thanks Edwin!
If I decide to touch Arduino, that will help me for sure
Btw, here one guy made distillation automation hardware based on Arduino - https://homesamogon.ru/basic/basic_read/" onclick="window.open(this.href);return false;" rel="nofollow
There is a detailed instruction, schemas and firmware
User avatar
cede
Site Donor
Site Donor
Posts: 363
Joined: Wed Jan 12, 2011 6:39 am
Location: Canada

Re: From vapor temperature to vapor abv

Post by cede »

Sorry Denis, it was so obvious to me, but Edwin came to the rescue ! :clap:

This month, I'm coding all day long and I have tendencies to forget that not everyone talks C and micro controllers... :)
tjsc5f
Swill Maker
Posts: 198
Joined: Sun Nov 28, 2021 9:18 pm
Location: MO, USA

Re: From vapor temperature to vapor abv

Post by tjsc5f »

Going to try to resurrect an old thread here...
Edwin Croissant wrote: Wed Jan 17, 2018 7:02 am I made a Arduino library for the SMT172 temperature sensor, resolution 0.01 C, conversion time about 20 ms.
Edwin, if you're still around, could you give a little more info on the "Hot Vapor" portion of your library? From the comments in the code, it looks like it was for a CM type reflux condenser. Would a VM reflux condenser positioned above the vapor path have the same effect and require three same compensation?
Post Reply