0% found this document useful (0 votes)
43 views2 pages

Process Modeling and Simulation

This document presents the solution to a chemical engineering assignment problem involving the simulation of a continuous stirred tank reactor (CSTR) process. The problem involves determining the number of tanks in series needed to achieve 90% conversion of reactant A. The document includes: 1) Initialization of constants such as conversions, rate constants, and initial concentrations 2) Calling of an ODE solver function to model the CSTR process over time 3) Plotting of concentration profiles over time for reactants A, B, and C 4) Use of a root-finding function to determine the number of tanks needed 5) Calculation of total residence time based on the number of tanks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views2 pages

Process Modeling and Simulation

This document presents the solution to a chemical engineering assignment problem involving the simulation of a continuous stirred tank reactor (CSTR) process. The problem involves determining the number of tanks in series needed to achieve 90% conversion of reactant A. The document includes: 1) Initialization of constants such as conversions, rate constants, and initial concentrations 2) Calling of an ODE solver function to model the CSTR process over time 3) Plotting of concentration profiles over time for reactants A, B, and C 4) Use of a root-finding function to determine the number of tanks needed 5) Calculation of total residence time based on the number of tanks
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Process, Modelling and Simulation MREG831

Assignment - 1

MPDE - 2014-16
Sumbission - 20.02.2015

Sample Solution
clc
clear all
%-----------------------------------------------------------------------%A tank of N CSTR's are chosen for computation
%-----------------------------------------------------------------------%-----------------------------------------------------------------------%This problem is attempted to find number of tanks in series given a
%conversion of "90%"
%-----------------------------------------------------------------------%Initiation of constants
%-----------------------------------------------------------------------xa=0.9;%conversion of A (-) no unit
cao=354; % in mol/litre
k1=354*10-3; % inverse of minute
k2=k1/2;% inverse of minute
k=k1/k2;%Equilibrium constant of reactant "A" ; no unit
m=0; % mole ratio of "A" and "B" at first instant
ca=cao*(1-xa);%concentration of reactant "A"
cb=cao*(m+xa); %concentration of reactant "B"
ra=(k1*ca)-(k2*cb) %rate of reaction of reactant "A"
tibar=(cao-ca)/(-ra) %mean residence time in every reactor; N times for N tanks. page
rat=ca/cao;% ratio of concentration of A; also= conversion
nguess=10;% guess for number of tanks
%-----------------------------------------------------------------------%Calling of function to plot
%-----------------------------------------------------------------------[T,C]=ode15s(@tankin func,[0 100],[354 0 0]);
%-----------------------------------------------------------------------%Actual plotting command
%-----------------------------------------------------------------------subplot(2,2,1)
plot(T,C(:,1))
title('Plot of concentration versus time for "A" ')
xlabel('time')
ylabel('conc of "A"')
subplot(2,2,2)
plot(T,C(:,2))
title('Plot of concentration versus time for "B" ')
xlabel('time')
ylabel('conc of "B"')
subplot(2,2,3)
plot(T,C(:,3))
title('Plot of concentration versus time for "C" ')
xlabel('time')
ylabel('conc of "C"')
%-----------------------------------------------------------------------Nre=fzero(@(N) (1-xa)-((1+k*tibar)/N)-N,nguess)
%this variable displays output of number tanks
totresidence=Nre*tibar
%this variable shows the total residence time in N reactors
%------------------------------------------------------------------------

Process, Modelling and Simulation MREG831


Assignment - 1

MPDE - 2014-16
Sumbission - 20.02.2015

%-----------------------------------------------------------------------%Function file containing material balance differential equation


%-----------------------------------------------------------------------function [cdash]=assignment1 varaha(t,c)
cdash=zeros(3,1);
cao=354; %mol/litre ; initital concentrations
cbo=0;%mol/litre
cco=0;%mol/litre
%-----------------------------------------------------------------------%Rate constants from roll number
%-----------------------------------------------------------------------k1=354*10-3;%inverse of minute
k2=k1/2; %inverse of minute
k3=354.45*10-3;%inverse of minute
k4=0.25*k3;%inverse of minute
%-----------------------------------------------------------------------%Constants as per roll number
%-----------------------------------------------------------------------V=4; % volume of rector in kilolitre
q=4.2/60;% flow rate of reactor
theta=V/q; %residence time
thi=1/theta;% inverse of residence time (space velocity)
%-----------------------------------------------------------------------%Actual DE being entered
%-----------------------------------------------------------------------cdash(1)= (1/theta*(cao))-((thi+k1)*c(1))+(k2*c(2));
cdash(2)= (1/theta*(cbo))-((thi+k3+k2)*c(2))+(k1*c(1))+(k4*c(3));
cdash(3)= (1/theta*cco)-((thi+k4)*c(3))+(k3*c(2));
end
%-----------------------------------------------------------------------%The rate constants as per given data are entered, along with the
%differential equation
%------------------------------------------------------------------------

You might also like