DWSIM/C3/Custom-Unit-Operation-using-Scilab/English-timed

From Script | Spoken-Tutorial
Jump to: navigation, search


Time Narration
00:01 Welcome to this tutorial on simulating a Custom Unit Operation using Scilab.
00:07 In this tutorial, we will learn to:

Create a custom unit operation using Scilab

00:14 Calculate the Outlet pressure of product stream
00:18 Calculate Molar flow rate and Enthalpy
00:22 To record this tutorial, I am using

DWSIM 5. 6 update 8 (Classic UI) and Windows 10

00:32 But, this process is identical in Linux, Mac OS X or FOSSEE OS on ARM.
00:40 To practice this tutorial, you should know to-

Add components to a flowsheet

00:46 Select thermodynamic packages
00:49 Add material streams and specify their properties
00:54 The prerequisite tutorials are available on our website.
00:59 You can access these tutorials and all the associated files from this site.
01:05 You should also have Scilab 5.02 (or higher) installed on your system.
01:12 First let us learn what is Scilab CAPE-OPEN Unit Operation.
01:17 It is an unit operation implementation for which the calculations can be entered in Scilab.
01:25 More information on this is given in the Additional reading material link of this tutorial.
01:31 We will develop a flowsheet to determine the product stream Temperature, Pressure,

Molar flow rate and Molar enthalpy from a Mixer model created using Scilab.

01:42 Here we give Inlet Stream Conditions of the product stream.
0147 Now let me open DWSIM (Classic UI).
01:52 To open DWSIM, go to the Desktop.

Right-click on DWSIM (Classic UI) and click Run as Administrator.

02:04 Welcome to DWSIM window opens.

Close this window.

02:10 Now go to the File menu and select New Steady-state Simulation.
02:18 Simulation Configuration Wizard window appears.
02:22 At the bottom, click on the Next button.
02:26 In the Compounds search tab, type Water.
02:30 Select Water from the ChemSep database.
02:34 Similarly, add Methanol.
02:38 Followed by Ethanol.
02:41 And then click on the Next button at the bottom.
02:45 The Property Packages window opens.
02:49 From Available Property Packages list, double-click on Raoult’s Law.
02:55 Then click on the Next button at the bottom.
02:59 The next option after this, is System of Units.
03:04 Under System of Units, select SI.
03:08 Click on the Finish button at the bottom.
03:12 Let us maximize the simulation window.
03:16 Let’s insert the feed streams that enter the Custom Mixer.
03:21 Go to Streams tab, at the bottom of the main simulation.
03:26 From the displayed list, drag and drop three Material Streams to the Flowsheet.
03:32 Click on the first material stream named as MSTR-000
03:38 Let’s change the name of this stream to Water.
03:42 Now we will specify the Water stream properties.
03:47 Go to Input Data.
03:49 Under Stream Conditions tab, select Flash Spec as Temperature and Pressure (TP).
03:55 By default, Temperature and Pressure should already be selected as Flash Spec.
04:01 Change Temperature to 300 Kelvin and press Enter.
04:07 Change Pressure to 100000 Pascals and press Enter.
04:12 Change Mass Flow to 10 kg per second and press Enter.
04:17 Now let us specify the Water stream compositions.
04:21 For this, click on Compound Amounts tab under Input Data.
04:27 Choose the Basis as Mole Fractions, if not already selected.
04:32 By default, Mole Fractions is already selected as Basis.
04:37 Now for Water, enter the Amount as 1 and press Enter.
04:43 For Methanol, enter 0 and press Enter.
04:48 For Ethanol, enter 0 and press Enter.
04:53 On the right, click on the Accept Changes button.
04:57 Similarly, we will define the other two material streams.
05:02 Click on the second material stream named MSTR-001.
05:07 Let’s change the name of this stream to Methanol.
05:12 Now we will specify the Methanol stream properties.
05:17 Go to Input Data.
05:19 Under Stream Conditions tab, select Flash Spec as Temperature and Pressure (TP).
05:25 Change Temperature to 305 Kelvin and press Enter.
05:31 Change Pressure' to 150000 Pa'scals and press Enter.
05:37 Change Mass Flow to 15 kg per second and press Enter.
05:43 Now click on the Compound Amounts tab under Input Data.
05:48 Choose Basis as Mole Fractions.
05:52 Now for Water, enter the Amount as 0 and press Enter.
05:59 For Methanol, enter 1 and press Enter.
06:04 For Ethanol, enter 0 and press Enter.
06:09 On the right, click on the Accept Changes button.
06:13 Now, click on the third material stream named as MSTR-002.
06:20 Let’s change the name of this stream to Ethanol.
06:25 Now we will specify the Ethanol stream properties.
06:30 Go to Input Data.

Under Stream Conditions tab, select Flash Spec as Temperature and Pressure (TP)

06:39 Change Temperature to 310 Kelvin and press Enter.
06:45 Change Pressure to 200000 Pascal and press Enter.
06:51 Change Mass Flow to 20 kg per second and press Enter.
06:57 Then under Input Data click on Compound Amounts tab.
07:03 Choose the Basis as Mole Fractions.
07:07 For Water, enter the Amount as 0 and press Enter.
07:13 For Methanol, enter 0 and press Enter.
07:18 For Ethanol, enter 1 and press Enter.
07:23 On the right side, click on the Accept Changes button.
07:27 Now, let us insert another material stream that exits the custom mixer.
07:33 To do that, let us drag one material stream to the flowsheet.
07:38 Let us arrange the stream.
07:41 We will leave that stream as unspecified.
07:45 Then we will change the name of this stream to Mixed Product.
07:50 At the bottom of the main simulation window, go to CAPE-OPEN tab.
07:55 Drag and drop CAPE-OPEN Unit Operation to the flowsheet area.
08:01 Add CAPE-OPEN Unit Operation window opens.
08:05 From the displayed list, select SciLab Unit Operation.

Click on OK at the bottom.

08:13 Let us change the name of this Unit Operation to Custom Mixer.
08:19 Now, we will create the inlet and outlet connection ports for the Custom Mixer.
08:26 For this, click on Custom Mixer.
08:30 From Property Editor window, click on Open CAPE-OPEN Object Editor.
08:36 Scilab CAPE-OPEN Unit Operation window opens.
08:40 Click on Ports tab.
08:43 Under Feed ports, there is an Add button at the bottom.
08:49 Click on Add button thrice to create three inlet ports for the three input material streams.
08:55 Under Product ports, click on Add button at the bottom.
09:02 This will create an outlet port for the output material stream.
09:07 Click on the Close button at the bottom.
09:11 Go to Property Editor Window.
09:14 Under Connections, go to inlet tab.
09:18 Click on the drop-down against Feed 1 and select Water.
09:25 Next, click on the drop-down against Feed 2 and select Methanol.
09:33 Next, click on the drop-down against Feed 3 and select Ethanol.
09:42 Now click on the Outlet tab.
09:45 Click on the drop-down against Product 1 and select Mixed Product.
09:52 All the connections now are completed.
09:56 Now we will write the code to perform the computation.
10:01 Click on Open CAPE-OPEN Object Editor.
10:05 Click on SciLab tab.
10:08 First we will get the feed properties of the material streams.
10:13 Then we will write the calculation routines.
10:17 Type this code in the Script tab.
10:20 This is to read the molar flow rate of the compounds from the inlet material streams.
10:26 Here, f1, f2 and f3 are the variables.
10:31 They store molar flow rate of the compounds from the inlet material streams.
10:37 getFeedProp is the command used to read the specified feed property.
10:42 1, 2 and 3 are the feed port numbers in SciLab to which the material streams in DWSIM is connected.
10:52 flow is the keyword.
10:54 flow indicates that components in the streams, has to be stored in f1,f2,f3 in form of an array.
11:03 Type this code in the Script tab.
11:06 This is to read the molar enthalpy of the inlet streams from the added inlet material stream.
11:13 Here, variables h1, h2 and h3 store the molar enthalpy of the added input material streams.
11:21 enthalpy is the keyword.
11:24 It indicate that molar enthalpy of material streams has to be stored in h1, h2 and h3.
11:32 Next, type this code.
11:35 This is to read the pressure of the inlet streams from the added inlet material stream.
11:41 Here, variables p1, p2 and p3 store the pressures of Water, Methanol and Ethanol streams.
11:49 pressure is the keyword.
11:51 It indicates that the pressure of material streams has to be stored in the variables p1, p2 and p3.
11:59 Now we will code the calculation routine
12:03 First we will calculate the outlet pressure.
12:07 For this let us consider the outlet pressure to be average pressure of all the 3 inlet streams.
12:15 Now, type this code.

Outlet pressure is calculated and stored in the variable p.

12:24 Now we will calculate the molar flow rate of the compounds in the output stream.
12:30 Type this code in the Script tab.
12:33 Molar flow rate of compounds in the product stream is calculated.

It is stored in the variable f in form of an array.

12:43 Now we will calculate the total molar flow rate of the product stream.
12:49 Type this code in the Script tab.

Molar flow rate of product stream is calculated and stored in the variable totF.

12:58 Now we will calculate the enthalpy of the product stream.
13:04 Type this code.

Enthalpy of the product stream is calculated and stored in the variable h.

13:12 Now we will pass the calculated variables to the Mixed Product material stream.
13:18 Type this code.

setProduct indicates that, variables in the braces are to be passed to the stream in the product.

13:28 At the bottom, click Test.
13:31 Values stored and calculated in all the variables, are displayed in the Output tab.
13:37 Click Close button at the bottom.
13:40 Now we will run the simulation.
13:43 So, from the toolbar, click on Solve Flowsheet button.
13:48 When the calculations are completed, click on the Mixed Product in the flowsheet.
13:53 Under Stream Conditions, check Temperature, Pressure, Molar Flow.
14:02 Let's summarize.
14:04 In this tutorial, we have learnt to

Create a custom unit operation using Scilab , Calculate the Outlet pressure of product stream, Calculate Molar flow rate and Enthalpy

14:19 As an assignment,

Create a custom model for a heater to heat the given mixture of compounds for different Inlet stream conditions.

14:29 Watch the video available at following link.

It summarizes the Spoken Tutorial project.

14:37 The Spoken Tutorial Project Team

Conducts workshops and Gives certificates.

14:42 For more details, please write to us.
14:46 Please post your times queries in this forum.
14:50 The FOSSEE team coordinates conversion of existing flow sheets into DWSIM.
14:56 We give honorarium and certificates.

For more details, please visit this site.

15:03 The FOSSEE team coordinates coding of solved examples of popular books.
15:09 We give honorarium and certificates.

For more details, please visit this site.

15:16 The FOSSEE team helps migrate commercial simulator labs to DWSIM.
15:22 We give honorarium and certificates.

For more details, please visit this site.

15:29 Spoken Tutorial and FOSSEE projects are funded by NMEICT, MHRD, Government of India.
15:38 This tutorial is contributed by Kaushik Datta and Priyam Nayak. Thanks for joining.

Contributors and Content Editors

PoojaMoolya