Sei sulla pagina 1di 24

1. Overview of Sim42 (as brief as it gets!).

Sim42 is a powerful steady state process simulator. In order to properly use sim42 the user
first needs to be familiar with 3 basic aspects of its design which are summarized in the
following subsections.

1.1. Components involved.


 The simulator: In a nutshell, the simulator provides 3 basic things:
a) Unit operations.
b) Solution algorithms.
c) Mechanisms to request flash calculations and other thermophysical
properties.

 The command line interface (CLI): Simulations are driven by written


commands. These written commands “drive” the simulator. A user interface to the
simulator is “anything” that can pass such commands. For example, “Simba” is a
web based application capable of passing commands to the CLI through web page
(more on simba later).

 The thermodynamics: Sim42 does not provide a thermodynamic package for


performing equilibrium calculations. These calculations are done in external
packages. So far, sim42 has been successfully linked to the property packages of
the Virtual Materials Group.

Putting it all together...


The user “talks” to an interface. This interface passes commands to the CLI. The CLI
manipulates the Unit Operations based on the commands received. Finally, the unit
operations communicate to thermodynamic cases and the solver in order to obtain
solutions.

1.2 Building blocks of a simulation:


 Unit operations: This might represent a flash drum, a valve, a distillation tower or
even an entire sub flow sheet contained within a larger one. Unlike some other
process simulators, a stream is just another unit operation.
An important concept in sim42 is that any unit operation can contain “child” unit
operations.

 Ports: This is a key concept in the design of sim42. Unit operations exchange
information with other unit operations by means of ports. A port is essentially an
attachment point for the flow of information into and out of the unit operation
calculation.
A port might be a material port, which carries all of the information normally
associated with a process stream (temperature, pressure, flow, composition etc.) or
it might be an energy port that just carries an energy flow or even a Signal Port
that transmits a single piece of information such as pressure drop.
As a final comment, you can think of a material port as a carrier of the information
that is usually kept in streams in other process simulators.

 Parameters: A parameter is a structural value that does not change during the
solution of a simulation. Examples of such values are the number of inlet ports of a
mixer, the amount of liquid phases used or the maximum amount of iterations.

 ThermoCase: For all practical purposes, it can be said that a Thermodynamic


Case contains a group of selected compounds and an associated property package.
It is important to know that unit operations do not “own” ThermoCases, they only
“connect” to them. Different unit operations can connect to different ThermoCases
within the same simulation. If a unit operation is not “connected” to a

2
ThermoCase, then that unit operation attempts to use the ThermoCase of the parent
unit operation.

1.3.Basic steps to a build and interact with a simulation.

Introduction.
There are two objects that are always provided when a new simulation is created: The
Flowsheet “/” and the Thermodynamic Administrator “$”. The Flowsheet is intended to
contain the unit operations. The Thermodynamic Administrator is intended to contain
the ThermoCases. The Flowsheet (or any child unit operation) can connect to any of the
ThermoCases.

A simulation.
a) The first step in a simulation is to create a ThermoCase in the ThermoAdmin
(known as “$”) and then attach it to the Flowsheet (known as “/”). Note that this is
done in one shot by Simba (more on this in the following section).

b) The second step is to add compounds (you could even do hypothetical compounds
or characterize an oil) to the ThermoCase.

c) The next step is to add unit operations TO THE FLOWSHEET. I made the last
words uppercase because this has been a major source of confusion to newcomers to
Simba. Sim42 allows nesting unit operations in any depth and it is easy to end up
nesting unit operations in a non intended way. For example, imagine you want to
add a mixer and then a separator and then a tower. Most likely you want all of these
unit operations to be direct children of “/” but if you are not careful in Simba, you
could end up with the mixer containing the separator and the separator containing
the tower.

3
d) You can start connecting ports and inputting properties at any time. As you will
soon find out, the solver of sim42 monitors the known information and
automatically solves anything that can be solved.
2. Introduction to Simba and a first flash calculation.

Simba is a wrapper for the Command Line Interface (CLI) and operates through commands
sent into a text box located in the top section of the application. A simulation always has a
“root” object (a Flowsheet unit operation) which in turn contains different objects such as
parameters or child unit operations. The “root” object is identified by the “/” character. The
complete hierarchy of objects can be explored in the left column of Simba (see Figure 1) by
clicking in the desired object. The “main view” of Simba displays the “active” object and
its design depends of the type of object being inspected.

Figure 1 shows the different sections of simba. In this particular case, Simba is running
locally in the Mozilla web browser. The different sections are described as follows:

a) Tree of simulation objects: This tree displays the hierarchy of the objects that are
present in a simulation. All the items in this tree are live links which can be used for
inspecting the desired object (for example a unit operation, a port or a parameter)
b) Simba menu bar: This section contains menus. Some of these menus are always
there such as the File menu the Units menu and the Language menu. Other menus
change depending on the active object, for example, the Add Unit Operation menu
is only available when unit operation is the active object.
c) Main View of Active Object: This section is where most of the work occurs and it
displays the contents of the active object. Its design depends on the object being
displayed.
d) Command Text Box: This text box is where the sim42 commands are input. In
many cases, these commands are automatically filled in by simba but a user can
always type a command directly.
e) Active Object: This line indicates the name and the type of object being displayed
(the active object)

4
f) Status Bar: This section is used to display all the messages being sent by sim42.
g) History Navigator: This links are used to explore the history of commands sent to
sim42 along with the messages passed back by the simulator.

Tree of simulation Main view of


objects Simba menu bar
active object

Command
text box

Active object

Status bar
History navigator

Figure 1. Snapshot of SIMBA

2.1. Adding a thermodynamic case

The first step in creating a simulation is the creation of a thermodynamic case, which in the
simplest case involves the selection of a thermodynamic package and a set of chemical
compounds. This can be achieved by selecting a property package from the menu called
“Add Thermo Package”. In this case “VirtualMaterials.SRK” is selected and the name
“ThermoCase” is assigned to it when prompted to do so.

5
Notice that the CLI command triggered for such action is:
ThermoCase = VirtualMaterials.SRK
This means that typing the previous line is equivalent to using the more “user friendly”
“Add Thermo Package”.

It is also important to notice that the thermodynamic case created became the active object
and that the menus available changed in order to match the needs of the case.

2.2. Adding compounds to the thermodynamic case


The following command can be typed in order to add compounds to the ThermoCase
(instead of selecting from the provided list). Figure 2 shows a snapshot of the creation of
this thermodynamic case after adding Benzene and Toluene.
/ThermoCase + Benzene Toluene

6
Figure 2. Snapshot of ThermoCase in Simba.

2.3. Adding a unit operation.

After creating a thermodynamic case, the next step in creating a simulation is to add unit
operations to the flowsheet. To accomplish this it is necessary to make the flowsheet the
“active” object by clicking in the “/(Flowsheet)” located in the left column of Simba. Unit
operations can be added by using the menu labeled “Add Unit Operation”. In this case
“Material Stream” is selected and the name “s” is assigned to it.

The newly created unit operation automatically becomes the “active” object and properties
can be added to its “In” or “Out” port. The displayed units use the default set “SI” but can
be changed to any available set by modifying the corresponding combo box. For this

7
example values are input into the “In” port with the values P = 100 (kPa); T = 80 (C) and
Composition = 0.5 0.5 (molar). It is important to note that all the intensive variables of the
ports from the stream appear “filled in” after inputting the previous values. Sim42
constantly monitors the degrees of freedom and performs calculations as information
becomes available. Specifying any extensive variable such as mass flow would fully
calculate the stream. An input of 100 kg/h is used for this example and the simulation
results are displayed in Figure 3.

All the previous steps could have been coded in a text file as a series of commands and then
run as a script using the "Read Script" option of the “File” combo box in Simba. This same
combo box provides options for storing and recalling simulation cases among other
operations. Simba also provides an option for changing the active language to any of the
currently supported languages; Spanish, French, Portuguese, Malay or English.

8
Figure 3. Snapshot of stream “s”.

9
3. Ethanol separation tower simulation.
This example uses live steam to fractionate an ethanol-water mixture into near azeotrope
ethanol/water at the top and negligible concentration of ethanol in the bottoms product
stream.

3.1. Setting up the case and the feeds to the tower.

a) Start a new simulation by going to the “File” menu and selecting “Clear Case”.
b) Go to the “Add Thermo Package” menu and select “VMG.PSRK. Use the name
“thermo” for the new thermodynamic case.
c) Add ETHANOL and WATER. Note that the main view of the thermodynamic case
includes a menu called “Change Filter of Compounds”. You can select “Ethanol
Processing” for easy addition of the compounds.

The commands that summarize the previous steps are:


clear
thermo = VirtualMaterials.PSRK
thermo + Ethanol Water

d) Make the Flowsheet the active object by clicking on “/(Flowsheet)” from the tree.
e) Add a material stream from the “Add Unit Operation” menu and call it “Feed”.
f) The new material stream should be the active object. Now input MoleFlow = 34.43;
VapFrac = 0.0 and P = 101.325 into the In port (assuming the selected unit set is SI).
Input a molar composition of 0.3 and 0.7

The commands that summarize the previous steps are:


Feed = Stream.Stream_Material()
Feed.In.MoleFlow = 34.43
Feed.In.Fraction = 0.3 0.7
Feed.In.VapFrac = 0.0

10
Feed.In.P = 101.325

g) Make the Flowsheet the active object by clicking on “/(Flowsheet)” from the tree.
h) Add a material stream from the “Add Unit Operation” menu and call it “Steam”.
i) The new material stream should be the active object. Now input MoleFlow = 51.1;
VapFrac = 1.0 and P = 24.7 psia (Note that units are picked up on the fly). Finally
input a molar composition of 0.0 and 0.1

The commands that summarize the previous steps are:


Steam = Stream.Stream_Material()
Steam.In.P = 24.7 psia
Steam.In.Fraction = 0 1
Steam.In.MoleFlow = 51.1
Steam.In.VapFrac = 1.0

3.2. Setting up the tower.

a) Make the Flowsheet the active object by clicking on “/(Flowsheet)” from the tree.
b) Add a tower (Basic Tower) from the “Add Unit Operation” menu and call it “dist”.
You will notice that besides Basic Tower, there are other distillation operations such
as a Distillation Column or Absorber. Don’t worry about this for now. The initial
display of the tower is shown in figure 3. The important things to notice in this
figure are that it contains only two stages with no feeds and no draws.
c) Click on the parameter “MaxOuterLoops” and change it to 40.
d) Add 12 stages below stage 0. To do this, click on the link “0” in the “Stage” column
from the main view. This makes Stage_0 the active object. You could also select
“Stage_0” from the tree. Stages can be added in the corresponding “Add the
following number of stages below this stage” text box. In this case “12” is the input.
Note how the menus changed when a stage was selected as the active object.

11
e) Still with “Stage_0” as the active object go to the “Add Feed or Draw” menu and
select “Liquid Draw”. Use the name “l’ for this new draw.
f) Adding the liquid draw makes this object the “active” object and the following
values are introduced: P = 101.325; MoleFlow = 12.91

Figure 3. Initial view of a tower in Simba.

g) Add an energy draw to stage 0. To do this, make “Stage_0” the active object and
select “Energy Draw” from the “Add Feed or Draw” menu. Use the name “cond” for
this energy draw.

12
h) Now add a temperature estimate to stage 0. Again make “Stage_0” the active object
and select “Temperature Est.” from the “Add Spec or Est” menu. Use the name
“estT’ for this estimate. Temperature estimates are not always needed and in fact
this tower solves fine with such value but it is added here just as a part of the
example. Set a value of 78 C to this estimate.

Figure 4 shows the main view of the tower up to this point. Note that it displays one
material port (the draw coming from stage 0) one energy port (the condenser duty) and
one signal port (the temperature estimate)

13
Figure 4. Tower view after setting stage 0.

i) Create a feed into “Stage_11” of the tower. In order to do this it is first necessary to
make “Stage_11” the “active” object. This can be done by selecting “dist” from the
left column of Simba and then selecting “11” from the list of stages displayed. The
feed is added by selecting “Add Feed” from the “Add Feed or Draw” menu. The
name “f” is used in this example.

14
j) Once “f” is created, it can be connected to the “Out” port of the “Feed” stream by
clicking in the “->” link of the “Connected to” row (assuming /dist.Stage_11.f is the
“active” object). It is important to mention at this point that Sim42 has a novel port-
wise design in which information to unit operations is passed by using ports. In this
example, the information in the “In” port of the “Feed” stream could had been input
directly into the “f” port of the “Stage_11” of the Tower without the need to create
an external stream.
k) The only ports missing from the column are the steam inlet and the bottoms product
outlet. Both ports are created at the bottom of the Tower, “Stage_13”. The “steam”
inlet port is created by adding a feed. The “bottoms” port is created by adding a
liquid draw. Both objects are added after making “Stage_13” the “active” object and
are called “f” and “l”, respectively in this example.
l) Connect the newly created feed to the “Out” port of the “Steam” stream.
m) Set the pressure of the liquid draw from stage 13 to 101.325.

3.3. Solving the tower and inspecting the results.

a) At this point the Tower is ready to be solved and the only thing that is left to do is
setting the parameter TryToSolve = 1 (in the main view of the tower “dist”).

There are two important parameters in the tower that are uses to trigger the solver of the
tower. TryToSolve is used to “tell” the tower if it should attempt to solve automatically
every time that something changes in the tower. The other important parameter is
TryToRestart. This parameter “tells” the tower if it should attempt to solve based on the
previous obtained values (equal to 1). If TryToRestart is equal to 0, then the tower will
attempt to solve from scratch.

Figure 4 shows the top part of the tower “main view” before solving. Figure 5 shows the
bottom part of the same tower before solving. Figure 4 shows that the tower “view”
provides links such as “Summary”, “Degrees of Freedom” and “Profiles” for navigating

15
within the same form. The results of the simulation are summarized in Table 1. Figure 6
shows the top part of the tower “main view” after it is solved.

Property Feed Steam Distillate Bottoms


VapFrac 0.0 1.0 0.0 0.0
T (C) 82.30 115.12 78.35 99.788
P (kPa) 101.325 170.30 101.325 101.325
MoleFlow (kgmole/h) 34.3 51.1 12.91 72.62
MassFlow (kg/h) 910.026 920.56 521.75 1308.84
H (kJ/kmol) -26999.078 12894.15 -23523.779 -28474.91
Energy (W) -258216.18 183025.39 -84358.88 -574401.94
MolecularWeight 26.43 18.01 40.41 18.023
Zfactor 0.00134 0.987 0.002188 0.000832
ETHANOL 0.3 0.0 0.798 0.000289
WATER 0.7 1.0 0.201 0.9997

Table 1. Results of Ethanol production tower.

Figure 5 shows a summary of the tower. This summary is very helpful because it provides a
quick look of the structure of the tower providing information such as location of draws,
specifications, internal connections (for pump arounds or side strippers) or pressure
profiles. A lot of these items are “live” links for navigating through the objects of the tower.

The last item shown in figure 5 is a link called “Add Tower Profiles”. This link will be used
later in this section.

16
Figure 4. Top part of tower in simba before solving.

17
Figure 5. Bottom part of tower in simba before solving.

18
Figure 6. Top part of tower in simba after solving.

Now that the tower is solved, most of the results are readily available in the “main view”.
The following steps show how to display the graphical representation of the simulation and
how to add profiles to the tower.

b) Make the Flowsheet the active object by clicking on “/(Flowsheet)” from the tree.
c) Click on the “PFD” button which is located on the top right corner in the menu
section of Simba. Figure 7 shows the PFD of the example created in this section.

19
Figure 7. Simba PFD.

d) To add a profile, now make the tower the active object by clicking on “dist” in the
tree.
e) Scroll all the way down the page of “dist” or just click on the link “Profiles” which
is located at the top.
f) Click on the link Add Tower Profile. Figure 8 shows the displayed form.
g) Input L_Fraction.ETHANOL L_Cp as the desired profiles and press “Enter”. This
will display the ethanol composition in the liquid phase along the tower and the Cp
of the liquid phase.
Figure 9 shows the values of the profiles. Figure 10 shows the plots of the profiles.
Both figures come from the “main view” of the tower.

20
Figure 8. Profiles form in Simba.

21
Figure 9. Values of the profiles in the tower “dist”.

22
Figure 10. Plots of the profiles in the tower “dist”.

23
3.4. Storing and recalling cases.
a) To store the case in simba just go to the Simba “File” menu and select “Store
Case”.
b) To recall case, just go to the Simba “File” menu and select “Recall”.

3.5 Final remarks on the tower simulation.


The tower simulation is presented here to show the usage and creation of distillation
towers in Sim42. It is important to note that Sim42 offers pre-built towers such as
“Distillation Column”, “Rebolied Absorber”, “Refluxed Absorber” and “Absorber”
which already contain ports for feeds and material and energy draws.

These pre-built towers can be modified like the tower described here and already
contain liquid draws, feed ports, energy draws depending on the unit operation
selected. Using these towers save up some time when configuring the distillation
unit.

24

Potrebbero piacerti anche