Modelling & Simulation of Binary Distillation Column
Modelling & Simulation of Binary Distillation Column
Modelling & Simulation of Binary Distillation Column
DISTILLATION COLUMN”
CONTE
NTS
• Introduction
• Vapour Liquid Equilibrium
• Types of Distillation
1. Batch Distillation
2. Continuous Distillation
• Simple Distillation
• Flash Evaporation
• Fractional Distillation
• Types of Azeotropes
• Separation of Azeotropes
• Steam Distillation
• Vacuum Distillation
• Extractive Distillation
• Theoretical plates
• Methods of calculating no. of stages
1. Fenske Equation
2. McCabe-Thiele Method
• Modelling of McCabe-Thiele Method
• Assumptions of McCabe-Thiele Method
• Introduction to Simulation
• Flow Chart of Simulation Program
• Problem
• Discussion & Conclusion
• Appendix
• Bibliography
Introduction
A process in which a liquid or vapour mixture of two or more substances is
separated into its component fractions of desired purity, by the application
and removal of heat.
Distillation is based on the fact that the vapour of a boiling mixture will be
richer in the components that have lower boiling points.
Therefore, when this vapour is cooled and condensed, the condensate will
contain more volatile components. At the same time, the original mixture
will contain more of the less volatile material. Distillation columns are
designed to achieve this separation efficiently.
Although many people have a fair idea what “distillation” means, the
important aspects that seem to be missed from the manufacturing point of
view are that:
• Distillation is the most common separation technique.
• It consumes enormous amounts of energy, both in terms of cooling
and heating requirements.
• It can contribute to more than 50% of plant operating costs.
The best way to reduce operating costs of existing units, is to improve their
efficiency and operation via process optimization and control. To achieve
this improvement, a thorough understanding of distillation principles and
how distillation systems are designed is essential.
The Distillation of the Crude Oil in Oil Refinery can be represented by:
Vapor-Liquid Equilibrium
Vapor-liquid equilibrium, abbreviated as VLE by some, is a condition where
a liquid and its vapor (gas phase) are in equilibrium with each other, a
condition or state where the rate of evaporation (liquid changing to vapor)
equals the rate of condensation (vapor changing to liquid) on a molecular
level such that there is no net (overall) vapor-liquid inter conversion.
Although in theory equilibrium takes forever to reach, such an equilibrium is
practically reached in a relatively closed location if a liquid and its vapor are
allowed to stand in contact with each other long enough with no interference
or only gradual interference from the outside.
If the liquid and vapor are pure, in that they consist of only one molecular
component and no impurities, then the equilibrium state between the two
phases is described by the following equations:
And
where and are the pressures within the liquid and vapor,
and are the temperatures within the liquid and vapor, and
and are the molar Gibbs free energies (units of energy per amount of
substance) within the liquid and vapor, respectively.[4] In other words, the
temperature, pressure and molar Gibbs free energy are the same between the
two phases when they are at equilibrium.
An equivalent, more common way to express the vapor-liquid equilibrium
condition in a pure system is by using the concept of fugacity. Under this
view, equilibrium is described by the following equation:
Multicomponent systems
where and are the temperature and pressure for each phase, and
and are the partial molar Gibbs free energy also called chemical
potential (units of energy per amount of substance) within the liquid and
vapor, respectively, for each phase. The partial molar Gibbs free energy is
defined by:
where is the (extensive) Gibbs free energy, and is the amount of
substance of component .
Batch Columns
In batch operation, the feed to the column is introduced batch-wise. That
is, the column is charged with a 'batch' and then the distillation process is
carried out. When the desired task is achieved, a next batch of feed is
introduced.
Continuous Columns
In contrast, continuous columns process a continuous feed stream. No
interruptions occur unless there is a problem with the column or surrounding
process units. They are capable of handling high throughputs and are the
most common of the two types. We shall concentrate only on this class of
columns.
3. Where the extra feed exits when it is used to help with the
separation
In simple distillation, all the hot vapors produced are immediately channeled
into a condenser which cools and condenses the vapors. Therefore, the
distillate will not be pure its composition will be identical to the composition
of the vapors at the given temperature and pressure, and can be computed
from Raoult's law.
As a result, simple distillation is usually used only to separate liquids whose
boiling points differ greatly (rule of thumb is 25 °C) [25] or to separate
liquids from in volatile solids or oils. For these cases, the vapor pressures of
the components are usually sufficiently different that Raoult's law may be
neglected due to the insignificant contribution of the less volatile
component. In this case, the distillate may be sufficiently pure for its
intended purpose.
The liquid mixture that is to be processed is known as the feed and this is
introduced usually somewhere near the middle of the column to a tray
known as the feed tray. The feed tray divides the column into a top
(enriching or rectification) section and a bottom (stripping) section. The feed
flows down the column where it is collected at the bottom in the reboiler.
Heat is supplied to the reboiler to generate vapour. The source of heat input
can be any suitable fluid, although in most chemical plants this is normally
steam. In refineries, the heating source may be the output streams of other
columns. The vapour raised in the reboiler is re-introduced into the unit at
the bottom of the column. The liquid removed from the reboiler is known as
the bottoms product or simply, bottoms.
The vapour moves up the column, and as it exits the top of the unit, it is
cooled by a condenser. The condensed liquid is stored in a holding vessel
known as the reflux drum. Some of this liquid is recycled back to the top of
the column and this is called the reflux. The condensed liquid that is
removed from the system is known as the distillate or top product.
Thus, there are internal flows of vapour and liquid within the column as well
as external flows of feeds and product streams, into and out of the column.
Flash Evaporation
Flash (or partial) evaporation is the partial vaporization that occurs when
a saturated liquid stream undergoes a reduction in pressure by passing
through a throttling valve or other throttling device. This process is one of
the simplest unit operations. If the throttling valve or device is located at the
entry into a pressure vessel so that the flash evaporation occurs within the
vessel, then the vessel is often referred to as a flash drum.
where:
X = weight percent vaporized
(Note: The words "upstream" and "downstream" refer to before and after the
liquid passes through the throttling valve or device.)
Where:
zi is the mole fraction of component i in the feed liquid (assumed to be
known);
β is the fraction of feed that is vaporised;
Ki is the equilibrium constant of component i.
The equilibrium constants Ki are in general functions of many parameters,
though the most important is arguably temperature; they are defined as:
Where:
xi is the mole fraction of component i in liquid phase;
yi is the mole fraction of component i in gas phase.
Then that β is the solution; if there are multiple such β's, it means that
either Kmax<1 or Kmin>1, indicating respectively that no gas phase can be
sustained (and therefore β=0) or conversely that no liquid phase can exist
(and therefore β=1).
Fractional Distillation
Fractional distillation is the separation of a mixture into its component parts,
or fractions, such as in separating chemical compounds by their boiling
point by heating them to a temperature at which several fractions of the
compound will evaporate. It is a special type of distillation. Generally the
component parts boil at less than 25 °C from each other under a pressure of
one atmosphere (atm). If the difference in boiling points is greater than
25 °C, a simple distillation is used.
The Vapour
This new vapour will again move further up the fractionating column until it
gets to a temperature where it can condense. Then the whole process repeats
itself.
Each time the vapour condenses to a liquid, this liquid will start to trickle
back down the column where it will be reboiled by up-coming hot vapour.
Each time this happens the new vapour will be richer in the more volatile
component.
The aim is to balance the temperature of the column so that by the time
vapour reaches the top after huge numbers of condensing and reboiling
operations, it consists only of the more volatile component - in this case, B.
Whether or not this is possible depends on the difference between the
boiling points of the two liquids. The closer they are together, the longer the
column has to be.
The Liquid
So what about the liquid left behind at each reboiling? Obviously, if the
vapour is richer in the more volatile component, the liquid left behind must
be getting richer in the other one.
As the condensed liquid trickles down the column constantly being reboiled
by up-coming vapour, each reboiling makes it richer and richer in the less
volatile component - in this case, A. By the time the liquid drips back into
the flask, it will be very rich in A indeed.
So, over time, as B passes out of the top of the column into the condenser,
the liquid in the flask will become richer in A. If you are very, very careful
over temperature control, eventually you will have separated the mixture
into B in the collecting flask and A in the original flask.
Finally, what is the point of the packing in the column?
To make the boiling-condensing-reboiling process as effective as possible, it
has to happen over and over again. By having a lot of surface area inside the
column, you aim to have the maximum possible contact between the liquid
trickling down and the hot vapour rising.
If you didn't have the packing, the liquid would all be on the sides of the
condenser, while most of the vapour would be going up the middle and
never come into contact with it.
Azeotrope
An Azeotrope (pronounced /ay-ZEE-ə-trope/) is a mixture of two or more
liquids (chemicals) in such a ratio that its composition cannot be changed by
simple distillation. This occurs because, when an azeotrope is boiled, the
resulting vapor has the same ratio of constituents as the original mixture.
Because their composition is unchanged by distillation, azeotropes are also
called (especially in older texts) constant boiling mixtures. The
word azeotrope is derived from the Greek words ζέειν (boil) and τρόπος
(change) combined with the prefix α- (no) to give the overall meaning, “no
change on boiling.”
Types of Azeotropes
Each azeotrope has a characteristic boiling point. The boiling point of an
azeotrope is either less than the boiling points of any of its constituents (a
positive azeotrope), or greater than the boiling point of any of its
constituents (a negative azeotrope).
A well known example of a positive azeotrope is 95.6% ethanol and 4.4%
water (by weight). Ethanol boils at 78.4°C, water boils at 100°C, but the
azeotrope boils at 78.1°C, which is lower than either of its constituents.
Indeed 78.1°C is the minimum temperature at which any ethanol/water
solution can boil. In general, a positive azeotrope boils at a lower
temperature than any other ratio of its constituents. Positive azeotropes are
also called minimum boiling mixtures.
An example of a negative azeotrope is hydrochloric acid at a concentration
of 20.2% hydrogen chloride and 79.8% water (by weight). Hydrogen
chloride boils at –84°C and water at 100°C, but the azeotrope boils at 110°C,
which is higher than either of its constituents. The maximum temperature at
which any hydrochloric acid solution can boil is 110°C. In general, a
negative azeotrope boils at a higher temperature than any other ratio of its
constituents. Negative azeotropes are also called maximum boiling mixtures.
Azeotropes consisting of two constituents, such as the two examples above,
are called binary azeotropes. Those consisting of three constituents are
called ternary azeotropes. Azeotropes of more than three constituents are
also known.
More than 18,000 azeotropic mixtures have been documented.
Combinations of solvents that do not form an azeotrope when mixed in any
proportion are said to be zeotropic.
When running a binary distillation it is often helpful to know the azeotropic
composition of the mixture.
Azeotropic Distillation
Other methods of separation involve introducing an additional agent, called
an Entrainer, that will affect the volatility of one of the azeotrope
constituents more than another. When an entrainer is added to a binary
azeotrope to form a ternary azeotrope, and the resulting mixture distilled, the
method is called azeotropic distillation. The best known example is adding
benzene or cyclohexane to the water/ethanol azeotrope. With cyclohexane as
the entrainer, the ternary azeotrope is 7% water, 17% ethanol, and 76%
cyclohexane, and boils at 62.1°C. Just enough cyclohexane is added to the
water/ethanol azeotrope to engage all of the water into the ternary azeotrope.
When the mixture is then boiled, the azeotrope vaporizes leaving a residue
composed almost entirely of the excess ethanol.
Examples of azeotropes
A rare type of complex binary azeotrope is one where the boiling point and
condensation point curves touch at two points in the phase diagram. Such a
system is called a double azeotrope, and will have two azeotropic
compositions and boiling points. An example is water and N-
methylethylenediamine.
Steam Distillation
Steam distillation is a special type of distillation (a separation process)
for temperature sensitive materials like natural aromatic compounds.
Many organic compounds tend to decompose at high sustained temperatures.
Separation by normal distillation would then not be an option, so water
or steam is introduced into the distillation apparatus. By adding water or
steam, the boiling points of the compounds are depressed, allowing them to
evaporate at lower temperatures, preferably below the temperatures at which
the deterioration of the material becomes appreciable. If the substances to be
distilled are very sensitive to heat, steam distillation can also be combined
with vacuum distillation. After distillation the vapors are condensed as usual,
usually yielding a two-phase system of water and the organic compounds,
allowing for simple separation.
Principle
When a mixture of two practically immiscible liquids is heated while being
agitated to expose the surfaces of both the liquids to the vapor phase, each
constituent independently exerts its own vapor pressure as a function of
temperature as if the other constituent were not present. Consequently, the
vapor pressure of the whole system increases. Boiling begins when the sum
of the partial pressures of the two immiscible liquids just exceeds
the atmospheric pressure (approximately 101 kPa at sea level). In this way,
many organic compounds insoluble in water can be purified at a temperature
well below the point at which decomposition occurs. For example, the
boiling point of bromobenzene is 156 °C and the boiling point of water is
100 °C, but a mixture of the two boils at 95 °C. Thus, bromobenzene can be
easily distilled at a temperature 61 C° below its normal boiling point.
Applications
Steam distillation is employed in the manufacture of essential oils, for
instance, perfumes. In this method, steam is passed through the plant
material containing the desired oils. It is also employed in the synthetic
procedures of complex organic compounds. Eucalyptus oil and orange
oil are obtained by this method on the industrial scale.
Steam distillation is also widely used in petroleum
refineries and petrochemical plants where it is commonly referred to as
"steam stripping".
Other industrial uses of steam distillation include the production of
consumer food products such as sprayable or aerosolized condiments such as
sprayable mayonnaise.
Vacuum Distillation
Vacuum distillation is a method of distillation whereby the pressure above
the liquid mixture to be distilled is reduced to less than its vapor
pressure(usually less than atmospheric pressure) causing evaporation of the
most volatile liquid(s) (those with the lowest boiling points). This distillation
method works on the principle that boiling occurs when the vapor pressure
of a liquid exceeds the ambient pressure. Vacuum distillation is used with or
without heating the solution.
Applications
Laboratory-scale vacuum distillation is used when liquids to be distilled
have high atmospheric boiling points or chemically change at temperatures
near their atmospheric boiling points. Temperature sensitive materials (such
as beta carotene) also require vacuum distillation to remove solvents from
the mixture without damaging the product. Another reason vacuum
distillation is used is that compared to steam distillation there is a lower level
of residue build up. This is important in commercial applications
where temperature transfer is produced using heat exchangers.
Vacuum distillation is sometimes referred to as low temperature distillation.
Typical industrial applications utilize the heat pump cycle to maximize
efficiency. This type of distillation is in use in the oil industry where
common ASTM standards are D1160, D2892, D5236. These standards
describe typical applications of vacuum distillation at pressures of about 1-
100 mbar. Pilot plants up to 60 L can be built in accordance with these
standards. Industrial-scale vacuum distillation has several advantages. Close
boiling mixtures may require many equilibrium stages to separate the key
components. One tool to reduce the number of stages needed is to utilize
vacuum distillation.[6] Vacuum distillation columns (as depicted in the
drawing to the right) typically used in oil refineries have diameters ranging
up to about 14 meters (46 feet), heights ranging up to about 50 meters (164
feet), and feed rates ranging up to about 25,400 cubic meters per day
(160,000 barrels per day).
Vacuum distillation increases the relative volatility of the key components in
many applications. The higher the relative volatility, the more separable are
the two components; this connotes fewer stages in a distillation column in
order to effect the same separation between the overhead and bottoms
products. Lower pressures increase relative volatilities in most systems.
A second advantage of vacuum distillation is the reduced temperature
requirement at lower pressures. For many systems, the products degrade or
polymerize at elevated temperatures.
Vacuum distillation can improve a separation by:
Extractive Distillation
Extractive distillation is similar to azeotropic distillation, except in this case
the entrainer is less volatile than any of the azeotrope's constituents. For
example, the azeotrope of 20%acetone with 80% chloroform can be broken
by adding water and distilling the result. The water forms a separate layer in
which the acetone preferentially dissolves. The result is that the distillate is
richer in chloroform than the original azeotrope.
Theoretical Plate
A theoretical plate in many separation processes is a hypothetical zone or
stage in which two phases, such as the liquid and vapor phases of a
substance, establish an equilibrium with each other. Such equilibrium stages
may also be referred to as an equilibrium stage or a theoretical tray. The
performance of many separation processes depends on having a series of
equilibrium stages and is enhanced by providing more such stages. In other
words, having more theoretical plates increases the efficacy of the separation
process be it either a distillation, absorption, chromatographic, adsorption or
similar process.
Applications
The concept of theoretical plates and trays or equilibrium stages is used in
the design of many different types of separation.
In Distillation Columns
The concept of theoretical plates in designing distillation processes has been
discussed in many reference texts. Any physical device that provides good
contact between the vapor and liquid phases present in industrial-
scale distillation columns or laboratory-scale glassware distillation columns
constitutes a "plate" or "tray". Since an actual, physical plate is rarely a
100% efficient equilibrium stage, the number of actual plates is more than
the required theoretical plates.
where:
Na = the number of actual, physical plates or trays
Nt = the number of theoretical plates or trays
E = the plate or tray efficiency
So-called bubble-cap or valve-cap trays are examples of the vapor and liquid
contact devices used in industrial distillation columns. Another example of
vapor and liquid contact devices are the spikes in laboratory Vigreux
fractionating columns.
The trays or plates used in industrial distillation columns are fabricated of
circular steel plates and usually installed inside the column at intervals of
about 60 to 75 cm (24 to 30 inches) up the height of the column. That
spacing is chosen primarily for ease of installation and ease of access for
future repair or maintenance.
Typical bubble cap trays used in industrial distillation columns
For example, a very simple tray would be a perforated tray. The desired
vapor and liquid contacting would occur as the vapor flowing upwards
through the perforations would contact the liquid flowing downwards
through the perforations. In current modern practice, as shown in the
adjacent diagram, better contacting is achieved by installing bubble-caps or
valve caps located at each perforation to promote the formation of vapor
bubbles flowing through a thin layer of liquid maintained by a weir on each
tray.
To design a distillation unit or a similar chemical process, the number of
theoretical trays or plates (that is, hypothetical equilibrium stages), N t,
required in the process should be determined, taking into account a likely
range of feedstock composition and the desired degree of separation of the
components in the output fractions. In industrial continuous fractionating
columns, N t is determined by starting at either the top or bottom of the
column and calculating material balances, heat balances and equilibrium
flash vaporizations for each of the succession of equilibrium stages until the
desired end product composition is achieved. The calculation process
requires the availability of a great deal of vapor-liquid equilibrium data for
the components present in the distillation feed, and the calculation procedure
is very complex.
In an industrial distillation column, the N t required to achieve a given
separation also depends upon the amount of reflux used. Using more reflux
decreases the number of plates required and using less reflux increases the
number of plates required. Hence, the calculation of N t is usually repeated
at various reflux rates. N t is then divided by the tray efficiency, E, to
determine the actual number of trays or physical plates, Na, needed in the
separating column. The final design choice of the number of trays to be
installed in an industrial distillation column is then selected based upon an
economic balance between the cost of additional trays and the cost of using a
higher reflux rate.
There is a very important distinction between the theoretical plate
terminology used in discussing conventional distillation trays and the
theoretical plate terminology used in the discussions below of packed bed
distillation or absorption or in chromatography or other applications. The
theoretical plate in conventional distillation trays has no "height". It is
simply a hypothetical equilibrium stage. However, the theoretical plate in
packed beds, chromatography and other applications is defined as having a
height.
Distillation and absorption packed beds
Distillation and absorption separation processes using packed beds for vapor
and liquid contacting have an equivalent concept referred to as the plate
height or the height equivalent to a theoretical plate (HETP). HETP arises
from the same concept of equilibrium stages as does the theoretical plate and
is numerically equal to the absorption bed length divided by the number of
theoretical plates in the absorption bed (and in practice is measured in this
way).
where:
Nt = the number of theoretical plates (also called the "plate count")
H = the total bed height
HETP = the height equivalent to a theoretical plate
The material in packed beds can either be random dumped packing (1-3" wide) such
as Raschig rings or structured sheet metal. Liquids tend to wet the surface of the
packing and the vapors contact the wetted surface, where mass transfer occurs.
Chromatographic Processes
where:
Nt = the number of theoretical plates (also called the "plate count")
H = the total column length
HETP = the height equivalent to a theoretical plate
Other Methods for Calculating No. of Trays
There are two different methods for calculating the no. of trays in
Distillation Column.
Fenske Equation
The Fenske equation in continuous fractional distillation is an equation used
for calculating the minimum number of theoretical plates required for the
separation of a binary feed stream by a fractionation column that is being
operated at total reflux (i.e., which means that no overhead product distillate
is being withdrawn from the column).
The equation was derived by Merrell Fenske in 1932, a professor who
served as the head of the chemical engineering department at
the Pennsylvania State University from 1959 to 1969.
This is one of the many different but equivalent versions of the Fenske
equation:
where:
For ease of expression, the more volatile and the less volatile components
are commonly referred to as the light key (LK) and the heavy key (HK),
respectively.
If the relative volatility of the light key to the heavy key is constant from
the column top to the column bottom, then αavg. is simply α. If the
relative volatility is not constant from top to bottom of the column, then the
following approximation may be used:
where:
αt = relative volatility of light key to heavy key at top of column
αb = relative volatility of light key to heavy key at bottom of column
The above Fenske equation can be modified for use in the total reflux
distillation of multi-component feeds.
where:
N = number of equilibrium stages
Zn = mole fraction of component n in the vapor phase
Xn = mole fraction of component n in the liquid phase
= vapor pressure of pure component n
McCabe-Thiele Method
The graphical approach presented by McCabe and Thiele in 1925,
the McCabe-Thiele method is considered the simplest and perhaps most
instructive method for analysis of binary distillation. This method uses the
fact that the composition at each theoretical tray (or equilibrium stage) is
completely determined by the mole fraction of one of the two components.
The McCabe-Thiele method is based on the assumption of constant molar
overflow which requires that:
Why Do Simulation?
You may wonder whether simulation must be used to study dynamic
systems. There are many methods of modeling systems which involve the
solution of a closed form system. Simulation is often essential in the
following case:
1. The model is very complex with many variables and interacting
component;
2. The underlying relationships are nonlinear;
3. The model contain random varieties;
4. The model output is to be visual as in a 3D computer animation.
The power of simulation is that ---even for easily solvable linear systems---a
uniform model execution technique can be used to solve a large variety of
systems without resorting to a “bag of tricks” where one must choose
special-purpose and sometimes arcane solution methods to avoid simulation.
Continuous Simulators
This class of tools solves differential equations that describe the evolution of
a system using continuous equations. These types of simulators are the most
appropriate if the material or information that is being simulated can be
described as evolving or moving smoothly and continuously, rather than
infrequent discrete steps or packets.
A common class of continuous simulators is system dynamics tools based
on the standard stock and flow approach developed by Professor Jay
W.Forrester at MIT in the early 1960s.
Hybrid Simulator
These tools combine the features of continuous simulators and discrete
simulators. That is, they solve differential equations, but can superimpose
discrete events on the continuously varying system. Goldsim is a hybrid
simulator.
Problem
Included in table are the data for the McCabe-Thiele method at R=1.029, the
reflux ratio used for exact Ponchon-Savarit calculation. It is noteworthy that
for either method each at 1.5 times its respective value of Rm, the no. of
stages is essentially the same, and the maximum flow rates which would be
used to set the mechanical design of the tower are sufficiently similar for the
same final design to result.
Appendix
#include<iostream.h>
#include<math.h>
#include<conio.h>
# define R 8.314
# define t0 298
# define lpha 2.69
double pj_sat(double pj1,double pjx,double pjg1,double pjg2,double
pjp1,double pjp2);
double pj_satb(double pj1,double pjy,double pjg1,double pjg2,double
pjp1,double pjp2);
double bubl_t (double ax) ;
double dew_t(double ay,int flag );
double equili(double y);
double setq();
double liq(double th);
double vap(double th );
double inter();
double equi(double ax);
double stri(double x1);
double enri(double x);
class bubl { double t1,t2,t3,tn,y1,y2,temp;
double a1,a2,b1,b2,c1,c2;
public : double p1,x1,x2;
bubl()
{
a1=16.5938;
a2=16.262;
b1=3644.3;
b2=3799.89;
c1=239.76;
c2=226.35;
}
double anto(double p2sat,int flag) ;
double ant(double ta,int flag) ;
void read_data();
void show_data();
double solve_y();
};
void main ()
{ // double xxd,xxf,xxw,rr,qq,n=0,ix,iy,xx2,t,p,x2,y2;
clrscr();
cout<<"ENTER THE MOLE FRACTION OF TOP PRODUCT: \n";
cin>>xxd;
cout<<"ENTER THE MOLE FRACTION OF BOTTOM PRODUCT:
\n";
cin>>xxw;
cout<<"ENTER THE MOLE FRACTION OF FEED: \n";
cin>>xxf;
cout<<"ENTER THE REFLUX RATIO: \n";
cin>>rr;
// cout<<"enter the operating conditions :"<<endl;
cout<<"ENTER THE TEMPERATURE OF FEED IN
CENTIGRADES:\n";
cin>>t;
cout<<"ENTER THE PRESSURE OF FEED IN kPa:\n";
cin>>p;
qq=setq();
ix=inter();
iy=enri(ix);
x2=equili(xxd);
for(;x2>xxw;n++)
{
if(n==0)
{
if(x2>=ix)
y2=enri(x2);
else
y2=stri(x2);
}
else
{
x2=equili(y2);
if(x2>=ix)
y2=enri(x2);
else
y2=stri(x2);
}
conc_prof[n]=x2;
temp_prof[n]=bubl_t(conc_prof[n]);
}
cout<<"THE THEORETICAL NUMBER OF PLATES ARE "<<endl;
cout<<n<<"\n";
for(int ii=0;ii<=n;ii++)
cout<<conc_prof[ii]<<"\n";
for( ii=0;ii<=n;ii++)
cout<<temp_prof[ii]<<"\n";
getch();
}
double bubl_t (double ax )
{
//clrscr();
double a1,a2,a3,a4,T;
double g1,g2;
bubl b;
activity a;
//b.read_data();/*READ VALUES OF PRESSURE AND X1*/
a1=b.anto(p,1);
a2=b.anto(p,2);
T=(a1*ax)+(a2*(1-ax));
while(1)
{
a1=b.ant(T,1);
a2=b.ant(T,2);
a3=T;
/* double temp;
cout<<"ENTER THE VALUE OF TEMPERATURE \n ";
cin>> temp;
activity a;*/
a.set_tou(T);
a.set_G();
// a.read_x();
a.set_gamma(ax,(1-ax));
g1=a.gamma1;
g2=a.gamma2;
a2=pj_sat(p,ax,g1,g2,a1,a2);/*SPECIES 2 IS J*/
T= b.anto(a2,2);
a4=(T-a3);
if( a4<0 )
a4=a4*-1;
if(a4 <.001)
break;
}
a3=(ax*g1*a1)/p;
return T;
}
double setq()
{
bubl b;
clrscr();
double hg,hl,hf,t1,t2,qe,fl,fg;
int ch;
cout<<"ENTER THE CONDITION OF FEED\n";
cout<<"1. Liquid \n";
cout<<"2. Saturated liquid\n";
cout<<"3. Mixture of saturated liquid & saturated vapor\n";
cout<<"4. Saturated vapor\n";
cout<<"5. Superheated vapor\n";
// cout<<"enter the feed condition : \n";
cin>>ch;
double bub_ret,dew_ret;
bub_ret= bubl_t(xxf);
hl=liq(bub_ret);
dew_ret=dew_t(xxf,1);
hg=vap(dew_ret);
switch(ch)
{
case 1:
hf=liq(t);
t1=hg-hf;
t2=hg-hl;
qe= t1/t2;
break;
case 2:
hf=hl;
qe=1;
break;
case 3:
cout<<"enter the total number of moles in the liquid feed :\n";
cin>>fl;
cout<<"enter the total number of moles in the vapor feed :\n";
cin>>fg;
hf=(hl*fl)+(hg*fg);
t1=hg-hf;
t2=hg-hl;
qe= t1/t2;
break;
case 4:
hf=hg;
qe=0;
break;
case 5:
hf=vap(t);
t1=hg-hf;
t2=hg-hl;
qe= t1/t2;
break;
};
return qe;
}
double liq(double th)
{
double t1, cl1=88.92;
// cl=(xxf*cl1)+((1-xxf)*cl2);
t1=th-t;
t1=cl1*t1;
return t1;
}
double vap(double th )
{
float t1,t2,t3,t4,v1=33536.268,v2=41157.68,y2 , cl1=87.18, cl2=75.44914;
t1=th-t;
t2=cl1*t1;
t3=cl2*t1;
t2=t2+v1;
t3=t3+v2;
t1=xxf*t2+(1-xxf)*t3;
return t1;
}
double inter()
{
double t1,t2,t3,t4;
t1=rr/(rr+1);
t2=xxf/(qq-1);
t3=qq/(qq-1);
t4=xxd/(rr+1);
return (t4+t2)/(t3-t1);
}
double equi(double ax )
{
double t1,t2,t3,g1;
bubl b;
activity a;
t1=bubl_t(xxd);
t3=b.ant(t1,1);
t2=dew_t(ax,2);
a.set_tou(t1);
a.set_G();
a.set_gamma(t2,t2-1);
g1=a.gamma1;
return (ax*p)/(g1*t3);
}
double enri(double x)
{
double t1,t2,t3;
t2=(rr+1);
t1=rr/t2;
t3=xxd/t2;
t1=(t1*x)+t3;
return t1;
}
double stri(double x1)
{
double s,t1,t2,t3,t4,i;
t1=iy-xxw;
t2=ix-xxw;
t3=-ix+x1;
t4=t1/t2;
s=t4;
t4=t4*t3;
t1=iy+t4;
i=s*ix;
i=-i+iy;
// cout<<"the slope"<<s<<endl;
// cout<<"the intercept"<<i;
return t1;
}
double equili(double y)
{
double a;
a=4.5;
double t1,t2;
t1=(a-(a*y) +y);
t2=y/t1;
return t2;
}
Bibliography
www.wikipedia.com
www.scienceworld.com