Difference between revisions of "ASCEND/C2/Simulating-flowsheet/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 10: Line 10:
  
 
Title slide
 
Title slide
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Welcome to the tutorial on Modelling a Flowsheet in '''ASCEND'''
+
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Welcome to the tutorial on how to model a '''Flowsheet''' in '''ASCEND'''
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Show Slide 2
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Show Slide 2
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| In this tutorial,
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| In this tutorial,we will learn how to
 
+
We will learn how to
+
 
+
* Model a mixer and execute it
+
* Model a reactor
+
* Design a reactor
+
* Connect different components in a single flowsheet
+
* Run the flowsheet
+
 
+
  
 +
* Model a '''mixer''' and execute it
 +
* Model a '''reactor'''
 +
* Connect different components in a single '''flowsheet'''
 +
* Run the '''flowsheet'''
  
 
|-
 
|-
Line 32: Line 27:
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here I am using
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here I am using
  
'''Ubuntu Linux''' OS v. 12.04
+
*'''Ubuntu Linux''' OS v. 12.04
 
+
'''ASCEND''' v. 0.9.8
+
 
+
 
+
  
 +
*'''ASCEND''' v. 0.9.8
  
 
|-
 
|-
Line 45: Line 37:
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| To follow this tutorial, user must have basic knowledge of
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| To follow this tutorial, user must have basic knowledge of
  
'''Linux''' and
+
*'''Linux''' and
 
+
*'''ASCEND'''
'''ASCEND'''
+
  
To know more about ASCEND please visit '''ascend4.org'''
+
To know more about '''ASCEND''' please visit '''ascend4.org'''
  
For relevant tutorials please visit our website
 
  
http://spoken-tutorial.org
+
For relevant tutorials, please visit our website http://spoken-tutorial.org
  
 
|-
 
|-
Line 60: Line 50:
 
Show the complete Flowsheet
 
Show the complete Flowsheet
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's begin the tutorial with the example problem '''10.32''' from the book ''''Elementary Principles of Chemical Processes by Felder and Rousseau'''.'  
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's begin the tutorial with the example problem '''10.32''' from the book ''''Elementary Principles of Chemical Processes by Felder and Rousseau'''.'  
 +
  
 
This example is available on page 508 of the book.  
 
This example is available on page 508 of the book.  
  
We will model the 3 components of this Flowsheet- mixer, reactor and separator and we will then assemble them to model the complete flow sheet.  
+
 
 +
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| We will model the 3 components of this''' Flowsheet- mixer, reactor''' and '''separator'''.
 +
 
 +
 
 +
We will then assemble them to '''model''' the '''complete flowsheet'''.  
  
 
|-
 
|-
Line 71: Line 68:
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here''' Ethane''' is dehydrogenated to''' ethylene''' and '''acetylene''' in the following pair of reactions.
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here''' Ethane''' is dehydrogenated to''' ethylene''' and '''acetylene''' in the following pair of reactions.
  
The equilibrium conditions are also given as follows
 
 
Here '''yi''' signifies mole-fraction
 
  
 +
The '''equilibrium conditions''' are also given as follows
  
  
 +
Here '''yi''' signifies mole-fraction
  
 
|-
 
|-
Line 82: Line 78:
  
 
Flowsheet
 
Flowsheet
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's now model the mixer in '''ASCEND.'''
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's now '''model''' the '''mixer''' in '''ASCEND.'''
  
In mixer, a fresh feed of '''ethane''' with '''n0''' moles is mixed with a recycle stream of '''ethane''' with '''n6 '''moles
 
  
The outlet stream consists of 100 moles of '''ethane'''
+
In '''mixer''', a fresh feed of '''ethane''' with '''n0 (n knot)''' '''moles''' is mixed with a recycled stream of '''ethane''' with '''n6 ''''''moles'''
 +
 
 +
 
 +
The outlet stream consists of 100 '''moles''' of '''ethane'''.
  
 
|-
 
|-
Line 92: Line 90:
  
 
Equations for Mixer
 
Equations for Mixer
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Thus the equation for mixer is
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Thus the equation for '''mixer''' is
  
 
'''n0+n6 =100'''
 
'''n0+n6 =100'''
  
I already have the code for this mixer in a text file.
+
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| I already have the '''code''' for'''mixer''' in a text file.
  
 
Let me explain the code.
 
Let me explain the code.
Line 102: Line 102:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open code file in text editor
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open code file in text editor
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open the file '''flowsheet.a4c '''in a text editor
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open the file '''flowsheet.a4c '''in a text editor.
  
 
|-
 
|-
Line 108: Line 108:
  
 
MODEL mixer;
 
MODEL mixer;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here we require '''atoms.a4l''' to use the variable type ''''mole''''.
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Here we require '''atoms.a4l library''' to use the '''variable type 'mole''''.
  
I have named the model as '''mixer'''.
+
I have named the '''model''' as '''mixer'''.
  
 
|-
 
|-
Line 116: Line 116:
  
 
IS_A mole;
 
IS_A mole;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let’s Name the three streams of mixer as:
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let’s name the three '''streams of mixer''' as:
  
'''n_0, n_6 and n_tot'''.
+
'''n_0 (n knot), n_6 and n_tot'''.
  
Define the stream as a '''mole'''.
+
 
 +
 
 +
Define the '''streams''' as a '''mole'''.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| n_tot= n_0+n_6;
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| n_0+n_6=n_tot;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now we define the equation for mixture as simple mole balance as :
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now we define the equation for mixer by simple''' mole balance''' as :
  
Output = Input
+
'''n_0+n_6 = n_tot'''<nowiki>;</nowiki>
  
That is :
+
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Note that label like ''''equation 1'''' is not necessary to write.
  
'''n_tot= n_0+n_6'''<nowiki>;</nowiki>
 
  
Note that label like ''''equation 1'''' is not necessary to right, but this helps in debugging the code
+
But this helps in debugging the '''code.'''
  
 
|-
 
|-
Line 140: Line 143:
  
 
  END specify;
 
  END specify;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's now define '''METHODS''' for solving the mixer.
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let's now define '''METHODS''' for solving the '''mixer'''.
 
+
Under '''METHOD specify''',
+
 
+
We fix the variable '''n_tot'''
+
 
+
  
  
 +
Under '''METHOD specify''', we fix the variable '''n_tot'''
  
 
|-
 
|-
Line 155: Line 154:
  
 
END values;
 
END values;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Under '''METHOD values''',
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Under '''METHOD values''', '''n_tot''' is assigned the value 100 '''mole'''.
 
+
'''n_tot''' is assigned the value 100 mole
+
 
+
 
+
 
+
  
 
|-
 
|-
Line 174: Line 168:
  
 
END mixer;
 
END mixer;
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| '''METHOD seqmod '''signifies setting the model in sequential modular simulation.
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| '''METHOD seqmod '''signifies setting the '''model''' in '''sequential modular simulation'''.
  
This signifies that given feed stream and unit operations specification, '''ASCEND''' will calculate the intermediate and outlet streams
+
This signifies that given '''feed stream''' and '''unit operations specification, ASCEND''' will calculate the intermediate and outlet '''streams.'''
  
Under this method,
+
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Under this '''method''',
  
 
'''RUN specify''' and
 
'''RUN specify''' and
Line 184: Line 180:
 
'''RUN values'''
 
'''RUN values'''
  
Now END the model mixture
+
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now '''END''' the '''model mixer'''
  
Note that '''model mixer '''is not square as there is one equation and two unknowns.
 
  
Thus one can’t solve the '''model mixture''' separately in '''ASCEND'''
+
Note that '''model mixer '''is not '''square''', as there is one equation and two unknowns.
 +
 
 +
 
 +
Thus, one can’t solve the '''model mixer''' separately in '''ASCEND'''.
  
 
|-
 
|-
Line 194: Line 194:
  
 
Flowsheet
 
Flowsheet
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let us now model the second component of the flowsheet i.e. the reactor
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let us now '''model''' the second component of the '''flowsheet''' i.e. the '''reactor'''
  
As you can see there is one stream entering the reactor, and four streams leaving it.
+
|-
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|Point as per narration.
 +
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|As you can see, there is one '''stream''' entering the '''reactor''' and four '''streams''' leaving it.
  
Here '''ethane '''is dehydrogenated to '''ethylene''' and '''acetylene''', so the out stream consists of '''ethane, ethylene, acetylene '''and''' hydrogen'''
+
 
 +
Here '''ethane '''is dehydrogenated to '''ethylene''' and '''acetylene''', so the '''outstream''' consists of '''ethane, ethylene, acetylene '''and''' hydrogen'''.
  
 
|-
 
|-
Line 204: Line 207:
  
 
Equations for Reactor
 
Equations for Reactor
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| These are the set of equations to be used for modelling the reactor
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| These are the set of '''equations''' to be used for '''modelling''' the '''reactor'''.
  
To understand these equations, please refer the textbook
 
  
Now let’s look at the code for reactor
+
To understand these '''equations''', please refer the textbook.
 +
 
 +
 
 +
Now let’s look at the '''code''' for '''reactor'''.
  
 
|-
 
|-
 
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open flowsheet.a4c in a text editor and highlight the code text sequentially
 
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open flowsheet.a4c in a text editor and highlight the code text sequentially
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| I have named the model as reactor
+
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| I have named the '''model''' as '''reactor'''.
  
Define all the input and the output stream as the mole.
 
  
The reaction extent''' ksi1''' and '''ksi2''' is also defined as '''mole'''
+
Define all the input and the output '''streams''' as a '''mole'''.
  
Equation 2-6 are defined as shown in the slide
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| The reaction extent''' ksi1''' and '''ksi2''' is also defined as '''mole'''
  
Note that equation 7 and 8 are written as numerator on the left hand side equal to right hand side into denominator of the right hand side
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Equations 2-6 are defined as shown in the slide
  
We don’t use division to avoid a poor initialization for solving the problem
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Note that equations 7 and 8 are written as
 +
*numerator of the left hand side equal to  
 +
*right hand side into denominator of the right hand side
  
Now under '''METHODS''' section, we define methods in a similar way as that for mixer.
+
We don’t use division to avoid a poor '''initialization''' for solving the problem.
  
Under '''values '''section, instead of giving a direct value, we initialize the value of the reaction extent '''ksi1''' and '''ksi2''' , we thus give a '''nominal''' value of '''ksi1''' and '''ksi2'''
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now under '''METHODS''' section, we define '''methods''' in a similar way as that for '''mixer'''.
  
We also set '''upper bound''' for '''ksi1''' and '''ksi2.'''
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Under '''values '''section, instead of giving a direct value, we initialize the value of the reaction extent '''ksi1''' and '''ksi2'''.
 +
 
 +
We thus give a '''nominal''' value of '''ksi1''' and '''ksi2'''
 +
 
 +
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| We also set '''upper bound''' for '''ksi1''' and '''ksi2.'''
  
 
For assigning the nominal value, we write
 
For assigning the nominal value, we write
Line 234: Line 256:
 
'''ksi_1.nominal is equal to ksi_1'''
 
'''ksi_1.nominal is equal to ksi_1'''
  
similarly for assigning the upper bound, we write
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Similarly, for assigning the '''upper bound''', we write
  
 
'''ksi_1.upper_bound is equal to n_tot into 2'''
 
'''ksi_1.upper_bound is equal to n_tot into 2'''
  
Now, end the '''Method values'''
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now, '''END''' the '''Method values'''.
  
Define the '''method seqmod''' and '''END''' the reactor
+
 
 +
Define the '''METHOD seqmod''' and '''END''' the '''reactor'''.
  
 
|-
 
|-
Line 246: Line 273:
  
 
Assignment: Equations for Separator  
 
Assignment: Equations for Separator  
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now these are the set of equations for separation process
+
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now these are the set of equations for separation process.
  
Using these model the separator on similar lines as that of mixture
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Using these, model the '''separator''' on similar lines as that of '''mixer.'''
  
Once we have modelled each component of the flowsheet
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Once we have modelled each component of the '''flowsheet''', let’s now wire them together.
  
Let’s now wire them together. I have the code for modelling the flowsheet.
 
  
Let me explain the logic of connecting different components via code.
+
I have the '''code''' for '''modelling''' the '''flowsheet'''.
 +
 
 +
Let me explain the logic of connecting different components via '''code'''.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open flowsheet.a4c in a text editor and highlight the code text sequentially  
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open flowsheet.a4c in a text editor and highlight the code text sequentially  
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| I have named the model '''flowsheet'''
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| I have named the '''model'''  as '''flowsheet'''
 +
 
  
 
We define  
 
We define  
Line 266: Line 299:
 
'''r1 IS_A reactor; '''and
 
'''r1 IS_A reactor; '''and
  
'''s1 IS_A separator'''<nowiki>;</nowiki>
+
'''s1 IS_A separator''';
  
Note that the variable mixer, reactor and separator is used by '''ASCEND '''from the models defined before
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Note that the variable mixer, reactor and separator is used by '''ASCEND '''from the models defined before.
  
Now let us state that output from mixture is same as input for the reactor and the output of the reactor is same as the input to the separator.  
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Now let us state that  
 +
*output from '''mixer''' is same as input for the '''reactor''' and  
 +
*the output of the '''reactor''' is same as the input to the '''separator'''.  
  
We equate the two by the help of the operator
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| We equate the two by the help of the operator
  
'''ARE_THE_SAME'''
+
'''ARE underscore THE underscore SAME'''
  
'''ARE_THE_SAME''' is a merging operator
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| '''ARE_THE_SAME''' is a merging operator.
  
It merges different models or variables into one, for example, we write
 
  
'''m1.n_tot,r1.n_tot ARE_THE_SAME'''<nowiki>;</nowiki>
+
It merges different '''models''' or '''variables''' into one.
  
This saves us from creating additional different equations
 
  
Under''' METHODS section''', we will again write the same methods as '''specify, values and seqmod'''.
+
For example, we write
  
Note that under '''method specify''' and''' method values''', we run methods for each individual component under each method. For example, under method specify we have written
+
'''m1.n_tot,r1.n_tot ARE_THE_SAME''';
  
'''RUN m1.specify''' and
 
  
'''RUN r1.specify'''
+
This saves us from creating additional different equations.
  
This command will execute the specify method for mixer under the method specify for flowsheet
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Under''' METHODS section''', we will again write the same methods as '''specify, values and seqmod'''.
  
Now define the '''method seqmod''' and '''END''' the flowsheet
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Note that under '''METHODS specify''' and''' values''', we run '''methods''' for each individual component under each '''method'''.
  
  
 +
For example, under '''METHOD specify''' we have written
  
 +
'''RUN m1.specify''' and
 +
 +
'''RUN r1.specify'''
 +
 +
This command will execute the '''specify method''' for '''mixer''' under the '''METHODS specify''' for '''flowsheet'''
 +
 +
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|Now define the '''method seqmod''' and '''END''' the flowsheet
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open the model in '''ASCEND'''
 
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open the model in '''ASCEND'''
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open this model in '''ASCEND'''
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Open this '''model''' in '''ASCEND'''.
  
Now click on '''m1 mixer''', you will see '''ASCEND''' has assigned some default values to the streams '''n_0,n_6 and n_tot'''
 
  
Now under '''method section''', click on '''seqmod''', then click on''' RUN'''
+
Now click on '''m1 mixer'''.
  
Now click on the '''solve''' icon.
+
You will see '''ASCEND''' has assigned some default values to the '''streams n_0, n_6 and n_tot'''
  
You will see the message converged in the panel below
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|Now under '''METHODS section''', click on '''seqmod''', then click on''' RUN'''
  
Now click on '''m1 mixer''', you will see '''ASCEND''' has calculated the values for the streams '''n_0 and n_6'''
+
Now click on the '''Solve''' icon.
  
It is also satisfying the equation
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|You will see the message converged in the panel below.
  
'''n_0+n_6 = n_tot'''
 
  
We encourage the learner to observe the values of remaining two components before and after solving the flowsheet for better understanding.
+
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Highlight as per narration.
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|Now click on '''m1 mixer'''.
 +
 
 +
You will see '''ASCEND''' has calculated the values for the '''streams n_0  (n knot) and n_6'''.
 +
 
 +
It is also satisfying the equation '''n_0 (n knot) +n_6 = n_tot'''
 +
 
 +
|-
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|
 +
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"|We encourage the learner to observe the values of remaining two components before and after solving the flowsheet for better understanding.
  
 
|-
 
|-
Line 323: Line 389:
  
 
Summary
 
Summary
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let’s summarize. In this tutorial, we have learnt,How to
+
| style="border:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Let’s summarize. In this tutorial, we have learnt, how to
 
+
* Model a mixer and execute it
+
* Model a reactor
+
* Connect different components in a single flowsheet
+
* Run the flowsheet
+
 
+
  
 +
* Model a '''mixer'''
 +
* Model a '''reactor'''
 +
* Connect different components in a '''flowsheet'''
 +
* Run the '''flowsheet'''
  
 
|-
 
|-
Line 336: Line 400:
  
 
About the spoken tutorial project
 
About the spoken tutorial project
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Information on spoken tutorial project is available on our website [http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org]
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Information on spoken tutorial project is available on our website http://spoken-tutorial.org
 
+
 
+
 
+
  
 
|-
 
|-
Line 351: Line 412:
  
 
Acknowledgements
 
Acknowledgements
 
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Spoken Tutorial Project is funded by NMEICT,MHRD.
 
+
 
+
| style="border-top:none;border-bottom:0.5pt solid #00000a;border-left:0.5pt solid #00000a;border-right:0.5pt solid #00000a;padding-top:0in;padding-bottom:0in;padding-left:0.0069in;padding-right:0.0069in;"| Spoken Tutorial Project is funded by NMEICT,MHRD
+
  
 
|-
 
|-

Latest revision as of 15:21, 7 July 2014

Tutorial 5: Model a Flowsheet


Visual Cue
Narration
Slide number 1

Title slide

Welcome to the tutorial on how to model a Flowsheet in ASCEND
Show Slide 2 In this tutorial,we will learn how to
  • Model a mixer and execute it
  • Model a reactor
  • Connect different components in a single flowsheet
  • Run the flowsheet
Slide number 3

System Requirement

Here I am using
  • Ubuntu Linux OS v. 12.04
  • ASCEND v. 0.9.8
Slide number 4

Pre-requisites

To follow this tutorial, user must have basic knowledge of
  • Linux and
  • ASCEND

To know more about ASCEND please visit ascend4.org


For relevant tutorials, please visit our website http://spoken-tutorial.org

Slide number 5

Show the complete Flowsheet

Let's begin the tutorial with the example problem 10.32 from the book 'Elementary Principles of Chemical Processes by Felder and Rousseau.'


This example is available on page 508 of the book.


We will model the 3 components of this Flowsheet- mixer, reactor and separator.


We will then assemble them to model the complete flowsheet.

Slide number 6

Reactions

Here Ethane is dehydrogenated to ethylene and acetylene in the following pair of reactions.


The equilibrium conditions are also given as follows


Here yi signifies mole-fraction

Slide number 7

Flowsheet

Let's now model the mixer in ASCEND.


In mixer', a fresh feed of ethane with n0 (n knot) moles is mixed with a recycled stream of ethane with n6 'moles


The outlet stream consists of 100 moles of ethane.

Slide number 8

Equations for Mixer

Thus the equation for mixer is

n0+n6 =100

I already have the code formixer in a text file.

Let me explain the code.

Open code file in text editor Open the file flowsheet.a4c in a text editor.
REQUIRE "atoms.a4l";

MODEL mixer;

Here we require atoms.a4l library to use the variable type 'mole'.

I have named the model as mixer.

n_0, n_6 and n_tot.

IS_A mole;

Let’s name the three streams of mixer as:

n_0 (n knot), n_6 and n_tot.


Define the streams as a mole.

n_0+n_6=n_tot; Now we define the equation for mixer by simple mole balance as :

n_0+n_6 = n_tot;

Note that label like 'equation 1' is not necessary to write.


But this helps in debugging the code.

METHOD specify;

FIX n_tot ;

END specify;
Let's now define METHODS for solving the mixer.


Under METHOD specify, we fix the variable n_tot

METHOD values;

n_tot := 100.0 {mole};

END values;

Under METHOD values, n_tot is assigned the value 100 mole.
METHOD seqmod;

RUN clear;

RUN specify;

    RUN values;

END seqmod;

END mixer;

METHOD seqmod signifies setting the model in sequential modular simulation.

This signifies that given feed stream and unit operations specification, ASCEND will calculate the intermediate and outlet streams.

Highlight as per narration. Under this method,

RUN specify and

RUN values

Highlight as per narration. Now END the model mixer


Note that model mixer is not square, as there is one equation and two unknowns.


Thus, one can’t solve the model mixer separately in ASCEND.

Slide number 9

Flowsheet

Let us now model the second component of the flowsheet i.e. the reactor
Point as per narration. As you can see, there is one stream entering the reactor and four streams leaving it.


Here ethane is dehydrogenated to ethylene and acetylene, so the outstream consists of ethane, ethylene, acetylene and hydrogen.

Slide number 10

Equations for Reactor

These are the set of equations to be used for modelling the reactor.


To understand these equations, please refer the textbook.


Now let’s look at the code for reactor.

Open flowsheet.a4c in a text editor and highlight the code text sequentially I have named the model as reactor.


Define all the input and the output streams as a mole.

Highlight as per narration. The reaction extent ksi1 and ksi2 is also defined as mole
Highlight as per narration. Equations 2-6 are defined as shown in the slide
Highlight as per narration. Note that equations 7 and 8 are written as
  • numerator of the left hand side equal to
  • right hand side into denominator of the right hand side

We don’t use division to avoid a poor initialization for solving the problem.

Highlight as per narration. Now under METHODS section, we define methods in a similar way as that for mixer.
Highlight as per narration. Under values section, instead of giving a direct value, we initialize the value of the reaction extent ksi1 and ksi2.

We thus give a nominal value of ksi1 and ksi2

Highlight as per narration. We also set upper bound for ksi1 and ksi2.

For assigning the nominal value, we write

ksi_1.nominal is equal to ksi_1

Highlight as per narration. Similarly, for assigning the upper bound, we write

ksi_1.upper_bound is equal to n_tot into 2

Highlight as per narration. Now, END the Method values.


Define the METHOD seqmod and END the reactor.

Slide 11

Assignment: Equations for Separator

Now these are the set of equations for separation process.
Highlight as per narration. Using these, model the separator on similar lines as that of mixer.
Highlight as per narration. Once we have modelled each component of the flowsheet, let’s now wire them together.


I have the code for modelling the flowsheet.

Let me explain the logic of connecting different components via code.

Open flowsheet.a4c in a text editor and highlight the code text sequentially I have named the model as flowsheet


We define

m1 IS_A mixer;

r1 IS_A reactor; and

s1 IS_A separator;

Note that the variable mixer, reactor and separator is used by ASCEND from the models defined before.
Highlight as per narration. Now let us state that
  • output from mixer is same as input for the reactor and
  • the output of the reactor is same as the input to the separator.
Highlight as per narration. We equate the two by the help of the operator

ARE underscore THE underscore SAME

Highlight as per narration. ARE_THE_SAME is a merging operator.


It merges different models or variables into one.


For example, we write

m1.n_tot,r1.n_tot ARE_THE_SAME;


This saves us from creating additional different equations.

Highlight as per narration. Under METHODS section, we will again write the same methods as specify, values and seqmod.
Highlight as per narration. Note that under METHODS specify and values, we run methods for each individual component under each method.


For example, under METHOD specify we have written

RUN m1.specify and

RUN r1.specify

This command will execute the specify method for mixer under the METHODS specify for flowsheet

Highlight as per narration. Now define the method seqmod and END the flowsheet
Open the model in ASCEND Open this model in ASCEND.


Now click on m1 mixer.

You will see ASCEND has assigned some default values to the streams n_0, n_6 and n_tot

Highlight as per narration. Now under METHODS section, click on seqmod, then click on RUN

Now click on the Solve icon.

Highlight as per narration. You will see the message converged in the panel below.


Highlight as per narration. Now click on m1 mixer.

You will see ASCEND has calculated the values for the streams n_0 (n knot) and n_6.

It is also satisfying the equation n_0 (n knot) +n_6 = n_tot

We encourage the learner to observe the values of remaining two components before and after solving the flowsheet for better understanding.
Open slide number 12

Summary

Let’s summarize. In this tutorial, we have learnt, how to
  • Model a mixer
  • Model a reactor
  • Connect different components in a flowsheet
  • Run the flowsheet
Slide Number 13

About the spoken tutorial project

Information on spoken tutorial project is available on our website http://spoken-tutorial.org
Slide number 14

Spoken Tutorial Workshops

Details of the workshops based on spoken tutorials is also available on the website
Slide number 15

Acknowledgements

Spoken Tutorial Project is funded by NMEICT,MHRD.
Slide number 16

Thanks you

This is Priya Bagde from IIT Bombay signing off. Thank you for joining.

Contributors and Content Editors

Nancyvarkey, Tarung