You are on page 1of 5

ChE 3E04 – Process Model Formulation and Solution

Fall 2012 – Homework 3


Due: Fri Nov 2, In Class Note: to be performed in groups of up to three.
Weight: 5% of total course grade.
Version 2

OBJECTIVES

Learn and demonstrate skills with:


 Development of nonlinear mass & energy balance models
 Formulation of a solution strategy for nonlinear multivariate equations
 Implementation of nonlinear root finding solvers in MATLAB.
 Construction of good initial guesses for nonlinear solvers.
 Analysis of computational complexity from empirical data

SUBMISSION

The method of submission of your answer for each question or part of question will vary. Typically,
anything that can be checked by computer will be submitted to Avenue to Learn, and anything
which must be viewed by humans will be submitted in hardcopy.

[A2LQuiz] - This symbol means to submit your answer to the online quiz on Avenue to Learn

[A2LDropBox] - This symbol means to submit your answer to the drop box on Avenue to Learn

[ONPaper] - This symbol means to submit your answer in hard copy.

Always have all names and student numbers on any printed out / hardcopies.

PART 1: MODELING

We return again to the previous assignment to revisit our model for the CO2 capture membrane for
treating raw natural gas recovered from the field. In the previous assignment, we made some

1|Page
convenient assumptions which resulted in a linear system. Let’s look at what happens once we get rid
of those assumptions.

All of the same assumptions from the previous assignment hold, including the way we have divided up
the membrane unit into N equal parts (see the second figure of HW2) except for the following:

 Diffusion of CO2 through the membrane is now more realistically modeled by a concentration
gradient, as opposed to a difference in flow rates (not realistic):

( )

Where k is a mass transfer coefficient, and a is the surface area of the membrane in
segment i, so a = 2πrtubeΔL and C is the concentration in kmol/m3.

We can compute the concentration of a species using the partial pressures and the ideal
gas law assumption:

( ) ( )( )

Where is the partial pressure of CO2 at stage i in the NG side, R is the ideal gas
constant (8.3144621 m3-bar/kmol-K), is the temperature of the natural gas at stage i
in Kelvin, is the mole fraction of CO2 at stage i in the NG side, is the total
pressure of the natural gas, is the molar flow rate of CO2 at stage i in the NG side
and is the molar flow rate of methane. Similarly, the concentration on the permeate
side is:

( ) ( )( )

 Assume that the pressure of the natural gas is 30 bar everywhere and the pressure of the
permeate is 1.2 bar everywhere.
 The mass transfer coefficient is now different to reflect the new model:

k = 107.61 m/min (often expressed as m3/m2-min instead of m/min)

 The heat capacities are no longer constant. Instead, they are weak functions of
temperature (note T is in K if not obvious to you):

2|Page
The other assumptions and conditions remain the same:

 200 kmol/min of steam in (with no CO2) at 220°C (493.15 K)


 100 kmol/min of CH4 and 8 kmol/min of CO2 in at 50°C (323.15 K)
 2 m tube radius, 20 m length
 u = 40 kJ/k-m2-s
 The temperature of the gas diffusing through the membrane in section i is assumed to be TNGi.
 Qi = u a (TNGi – T Pi+1) although we will be changing this later to see how good of an
assumption it is.

Q1) 5 points [ONPaper] – Write the mass and energy balances for a single segment i. Simplify as much
as possible such that the terms Qi, Zi, ΔL, Cp, and a, do not appear. Do not leave your energy balances
in terms of enthalpies: simplify as much as possible.

Q2) 1 point [ONPaper] – How many equations are there for one segment?

Q3) 1 point [ONPaper] – How many equations are there for the entire model? Note you may have to
describe it as a function of N.

Q4) 1 point [ONPaper] – For this assignment, N will always be known as it is a model construct. Define
your variable x, written in compact mathematical notation. Use whatever style you want, just make it
obvious what you mean.

Q5) 1 point [ONPaper] – How many variables are there in the entire model?

Q6) 1 point [ONPaper] – Is your model linear or nonlinear?

Q7) 1 point [ONPaper] – Given all of the information and assumptions above, how many degrees of
freedom do you have?

Q8) 1 point [ONPaper] – Rewrite your model in terms of f(x) = 0. Replace any variables you have written
with their equivalent in x. For example, might be replaced with xi. We will call this model
Model 1.

Q9) 20 points [ONPaper] [A2LDropBox] – Implement and solve your model in MATLAB with N=50. You
may use any Matlab functions you wish, including code you have written in prior assignments or
tutorials. Here are some hints:

 You will need a good initial guess for x since guessing all zeros to start is not likely to converge.
Options including coming up with your own, or, even better, using the results from the model
developed in HW2.

3|Page
 To debug, try stepping (F10) through how you build your model line by line with N=1. That way
you can more easily identify where you have made a mistake.
 For big equations, it’s ok to break it up into steps and intermediate calculations if that helps.
 You’ll have to decide the solution approach yourself.

Q10) 1 point [ONPaper] – What is the total percentage of CO2 removed?

Q11) 1 point [ONPaper] – Plot the “membrane profiles” of your result. That is, plot FNGCO2,i vs i, FPCO2,i vs
i, TNGi vs i, and TPi vs i. You might want to check the total mass and energy balances to ensure you
didn’t violate physics.

PART 2: MODEL IMPROVEMENTS

If you recall, our Q was approximated as a linear difference of the temperatures. However, a more
accurate model is to use the log-mean temperature difference which you are familiar with:

( )

Where is the temperature difference on the left side of the segment, and is the
temperature difference on the right side of the segment. One such possible formulation is:

Q8) 5 point [ONPaper] – Use this new equation in your model, which we will now call Model 2. Solve
Model 2 for N=50. Plot the temperature profile of the natural gas and permeate for Model 2 on the
same plot as Model 1. (I suggest you use lines for one of the models and circles for the other so it is
easy to see). As a hint, you may have to build some “if” statements into your model to handle what
should happen in the event that is near-zero or is near-one or negative.

Q9) 1 point [ONPaper] – What is the total percentage of CO2 removed?

Q10) 1 point [ONPaper] – Comment on the accuracy of the assumption for Q used in Model 1. Is it a
good assumption? Why? When is it a bad assumption? You may have to think back to your heat
transfer course.

PART 3: ALGORITHM COMPLEXITY

Q11) 10 points [ONPaper] – Using Model 1, make a plot of the total CPU time required to solve using
fsolve as a function of N between 50 and 300 (note, you may not be able to get up to 300 if your
computer is slow, that is ok). You should consider at least 10 different values of N.

Q12) 10 points [ONPaper] [A2LDropBox] – Using the results from the previous question, compute the
computational complexity of your method with respect to N. You may use Matlab, excel, or any

4|Page
other means to do this. Make it explicitly clear how you determined this value. If you used matlab
code or some other program, provide both a hard copy and a soft copy in the drop box.

Q13) 1 points [ONPaper] – Using the results from the previous question, estimate the CPU time
required to solve the simulation for N=10,000.

5|Page

You might also like