TUTORIAL 18 Gas Mixtures & Excel Workbook PROBLEM DESCRIPTION: TUTORIAL 18 A natural gas pipeline needs to supply natural gas at two outlets. The outlets are located between two sources of natural gas. The natural gas consists of methane, ethane, propane, butane, pentane, hexane, nitrogen and carbon dioxide. Only experimental data of the properties of butane is available and is presented in an Excel spreadsheet. The gas properties of butane need to be specified in Flownex as a pure fluid. The flow network is given in the figure below. Segment Length NPS Schedule L1 20 km 20 STD L2 25 km 20 STD L3 5 km 8 STD L4 22 km 12 STD L5 5 km 24 STD L6 25 km 20 STD L7 5 km 12 STD Source A L1 L2 L3 L4 L5 Source B L7 P = 5500 kPa T = 6°C L6 Outlet A Outlet B P = 6000 kPa T = 6°C PROBLEM DESCRIPTION: TUTORIAL 18 (CONTINUE) The composition of the natural gas is given in the Excel spreadsheet. The Excel spreadsheet will be linked to the Flownex project and the mass fractions transferred to the respective boundary conditions of the natural gas pipeline. Component Source A (Mole %) Source B (Mole %) Ethane 0.98 1.18 CO2 0.11 0.31 Propane 0.31 0.58 Butane 0.10 0.30 Pentane 0.02 0.02 Hexane 0.01 0.01 Nitrogen 0.80 1.10 Methane 97.67 96.5 Notice the composition of the natural gas is given in mole percentage and needs to be converted to mass fraction first before it can be entered into Flownex. Excel will be used to perform the conversion from mole percentage to mass fraction. Flownex only accepts mass fractions to specify a mixed stream composition. The objective of Tutorial 18 is to specify butane as a pure fluid in Flownex, create the natural gas mixture and determine the composition of the natural gas at each outlet due to the mixture of the two sources of gas. SUMMARY: TUTORIAL 18 • Step 1: Open the project template • Step 2: Define a new fluid • Step 3: Specify the fluid properties • Step 4: Calculate the compressibility constants • Step 5: Enter the compressibility constants • Step 6: Specify the fluid properties • Step 7: Create a new mixture • Step 8: Specify the mixture components • Step 9: Assign the operating fluid • Step 10: Specify the mass fraction of the background fluid • Step 11: Add an Excel Workbook to the network • Step 12: Add the Excel file to the project files SUMMARY: TUTORIAL 18 (CONTINUE) • Step 13: Open the Excel file in Flownex • Step 14: View the Excel Workbook • Step 15: Specify the outputs of source A • Step 16: Specify the outputs of source B • Step 17: Verify the mass fractions (1) • Step 18: Verify the mass fractions (2) • Step 19: Change the steady state behavior of the Excel Workbook • Step 20: Link the Excel Workbook component (1) • Step 21: Link the Excel Workbook component (2) • Step 22: Save and Solve Steady State • Step 23: View the results STEP 1: OPEN THE PROJECT TEMPLATE a. Select the Open icon. b. Select the directory where Flownex is installed, and open Tutorials. c. Select All files (*.*) to display the compressed folders. To extract Template 14, right click on the folder and choose Extract All. Save the file in a preferred location (not in Program Files). d. Select Tutorial 18 and Press Open. a b c d STEP 2: DEFINE A NEW FLUID a. Select the Charts and Lookup Tables tab in the Flownex libraries window. b. b Expand the Flow Solver tree. c. Browse to Materials and Fluids > Pure Fluids > Gases. c d d. Right click on Gases f and select Add new Pure Fluid. e. Rename the new Chart or Lookup Table item to Butane. f. e Right click on Butane and select Edit. a STEP 3A: SPECIFY THE FLUID PROPERTIES a. The properties of Butane needs to be imported from an Excel spreadsheet. b b. Select the Compressible Gas radio button. c. Set the Density to Equation. d. Set the Equation to Compressible. e. Click on Edit. c a d e STEP 3B: INSERT THE EXCEL SOLVER IN THE DATA RIBBON In Microsoft Excel, do the following: a. Select File, then Options. b. In the Excel Options window, select Add-Ins and then Solver Add-In. c. Click on Go (not OK). d. Mark the Solver Add-in checkbox and click Ok. b b d The Solver should now be available in the Data ribbon. c a STEP 4: CALCULATE THE COMPRESSIBILITY CONSTANTS a. The values of a0 and a1 needs to be solved in Excel. b. c Open the Excel d spreadsheet. The current e values for both a0 and a1 is f 1. c. Open Solver on the Data ribbon in Excel. d. a Select the Target Cell in the spreadsheet as Set Objective. e. Select the Min radio button g at Equal to and enter a value of 0. f. Select a0 and a1 at By Changing Cells. g. Press Solve. Tip: In this tutorial experimental data regarding the density of Butane is given. We want Flownex to calculate the density of Butane with the compressibility equation. The correlations factors, a0 and a1, needs To be determined from the experimental data. We will use Excel to determine the correlation factors. STEP 5: ENTER THE COMPRESSIBILITY CONSTANTS a. The Density equation fits the experimental data. b. Copy the solved values for a0 and a1. c. Copy the value of the Gas Constant (R). d. Press OK. Calculated vs. Table Density b 3 b 2.5 c Density (kg/m3) 2 Density (kg/m³) 1.5 Density Using a0 & a1 1 0.5 0 0 2 4 6 d STEP 6: SPECIFY THE FLUID PROPERTIES (A) a. Set the Viscosity to Table. b. Set the Unit to kPa. c. Enter a pressure of 100 kPa. This b a c d is the pressure at which the experimental data was determined. d. Set the temperature unit to K and copy the temperature data from the Excel spreadsheet. e. Set the viscosity unit to kg/m.s and copy the viscosity data from the Excel spreadsheet. f. Repeat steps (a) to (e) to specify the Conductivity data. f e STEP 6: SPECIFY THE FLUID PROPERTIES (B) a. Enter a constant Specific Heat (Cp) of 1.88598 a kJ/kgK. b. Enter a constant Entropy of 2.76142 kJ/kgK. c. b Enter a Mole Mass of 58.122 kg/kmol at the general tab. d. Press OK. c d STEP 7: CREATE A NEW MIXTURE a. Select the Charts and Lookup Tables tab in the libraries window. b. Open the Flow Solver tree. c. Browse to Materials and b Fluids > Mixed Fluids. d. Right click on Mixed Fluids c and select Add Category. e. Rename the new category to d Natural Gas Mixture. f. Right click on Natural Gas Mixture and select Add new Mixed Fluid. a e f STEP 8: SPECIFY THE MIXTURE COMPONENTS a. Rename the new Chart or Lookup Table item to NG Mixture 1. b. Right click on NG Mixture 1 c and select Edit. c. Add each gas of the Natural Gas Mixture to the pane on the right. d. Set the Background Fluid to Gasses – Methane (Refprop). e. a d b Press OK. e STEP 9: ASSIGN THE OPERATING FLUID a. Right click on any component in the flow network and select Assign Fluids. b. Select the drop down list. c. Select Mixed Fluids under Type. d. Select Natural Gas Mixture a under Category. e. Select NG Mixture 1 under Description. f. b Press OK. c d e f STEP 10: SPECIFY THE MASS FRACTION OF THE BACKGROUND FLUID a. Select the Boundary Condition at Source A and open the property window. b. Expand Mass fractions. c. Change the value Methane (Refprop) to 1, and the rest of the components to 0. a b c STEP 11: ADD AN EXCEL WORKBOOK TO THE NETWORK a. Select the Components tab in the libraries window. b. Expand the Excel tree. c. Drag the Excel Workbook component onto the drawing canvas. c b a STEP 12: ADD THE EXCEL FILE TO THE PROJECT FILES a. Open the file GasMixture.xls. b. Select Save As. c. Browse to the ExcelWorkBooks folder. The folder is located at Tutorial 18.project\Tasks\ExcelWorkBooks. d. Press Save. c a d STEP 13: OPEN THE EXCEL FILE IN FLOWNEX a. Select the Excel Workbook component and open the property window through double clicking on the Excel icon. b. Select the browse icon at Workbook name. c. Select Gas Mixtures. d. Press Open. a c b d STEP 14: VIEW THE EXCEL WORKBOOK a. The Molar Mass of each component is given in column B. b. To obtain the Mass per kmol of Mixture, the Molar Mass in column B is multiplied by the Mole Fraction. c. To obtain the Mass Fraction the Mass per kmol of Mixture is divided by the total of the Mass per kmol Mixture. a b c STEP 15: SPECIFY THE OUTPUTS OF SOURCE A a. Select the browse icon at Outputs. b. Press Add. c. Select Outputs[0]. d. Enter Ethane Source A at Description. e. Enter the Cell name as Sheet!Cell, in this case Mole & c e d b Mass Fractions!I3. (NB make sure the spelling and spaces are correct as this instruction is Spell and Case sensitive). f. Repeat steps (a) to (e) for the rest of the remaining components. a f STEP 16: SPECIFY THE OUTPUTS OF SOURCE B a. The mass fractions of the components at Source B must also be specified. b. Press Add. c. Select Outputs[8]. d. Enter Ethane Source B at Description. e. Enter the Cell name as Sheet!Cell, in this case Mole & Mass Fractions!J3. f. Repeat steps (b) to (e) for the rest of the remaining components. g. Press OK. e d c f b g STEP 17: VERIFY THE MASS FRACTIONS (1) a. Press Execute and test. b. The mass fractions from the Excel spreadsheet will now be displayed at the Value of each output value. c. Verify the values. b b a STEP 18: VERIFY THE MASS FRACTIONS (2) c. c Verify the values (continue). STEP 19: CHANGE THE STEADY STATE BEHAVIOR a. Set Execute before steady state to Yes. b. Close the Excel Workbook window. b a STEP 20: LINK THE EXCEL WORKBOOK COMPONENT (1) a. Select the Data Transfer Link. b. Select the Excel Workbook and drag the data link to the Boundary Condition at Source A. c. The Setup Data Transfer Link window will now open automatically. d. Select the Value of Ethane Source A in the left pane and drag it onto Ethane (Refprop) under Mass Fraction in the pane on the right. e. Repeat step (d) for all the components of Source A. f. Press OK. a b STEP 21: LINK THE EXCEL WORKBOOK COMPONENT (2) a. Select the Data Transfer tool. b. Select the Excel Workbook and drag the data link to the Boundary Condition at Source B. c. The Setup Data Transfer Link window will now open automatically. d. Select the Value of an Ethane Source B in the left pane and drag it onto Ethane (Refprop) under Mass Fraction in the pane on the right. e. Repeat step (d) for all the components of Source B. f. Press OK. b STEP 22: SAVE AND SOLVE STEADY STATE a. Save the network. b. Solve the network in Steady State. c. Select the Boundary Condition at Source A and open the property window. d. Select the Inputs tab to view the Mass fractions. e. Select the Boundary Condition at Source B and open the property window. f. Select the Inputs tab to view the Mass fractions. d e STEP 23: VIEW THE RESULTS a. Select the output Node on the left and open the property window. b. Select the Results tab. c. The Mass Fraction of each component at the outlet on the left can be obtained. c d. Select the output Node on the right and open the property window. e. Select the Results tab. f. The Mass Fraction of each component at the outlet on the right can be b obtained. f a d e YOU HAVE SUCCESSFULLY COMPLETED THIS TUTORIAL! Join today to start receiving Flownex® updates.