Course:CHBE376/2019Wprojects/P-33

From UBC Wiki

Building a Membrance Reactor using Aspen Custom Modeler (ACM)

ACM allows the creation of unique process and equipment blocks that does not exist in Apsen Plus's pre-installed library.[1]

Learning Objectives

At the end of this tutorial, you will be able to

  1. Identify the variables and relevant formulas involved in a reactor
  2. Use the Aspen Custom Modeler(ACM) to create a customized model of a block type which is not available in Aspen Plus
  3. Add ACM model in Aspen Plus

Problem Definition

The purpose of this tutorial is to model a membrane reactor with known reaction kinetics, membrane properties, inlet composition and conditions; this allows us to solve for the outlet composition and conditions for a reactor of a given size. This example is based on the dehydrogenation reaction of propane to form propylene and hydrogen. Breaking down the necessary steps of this problem:

  1. Identify the reaction and the components involved:

The dehydrogenation process using a membrane reactor can be represented using the following reaction:

C3H8  🠒 C3H6 + H2

This reaction can be represented as:

A  ⇋  B + C

The components relevant to the simulation are listed in table 1 below.

Table 1. List of Components in the simulation

Name Formula Representation
Propane C3H8 A
Propylene C3H6 B
Hydrogen H2 C
  1. Identify the known variables given in the question
Variable Name Symbol Type Unit Value Comment
Equilibrium constant Kc Constant mol/dm3 0.05 Equilibrium constant of the reaction at 227⁰C
Reaction rate constant k Constant 1/min 0.7
Inlet concentration of toluene Cto Constant mol/dm3 0.2
Mass transport coefficient kc Constant 1/min 0.2 Mass transport coefficient of H2 through the membrane
  1. Identify the unknown variables that we are looking for
Variable Name Symbol Type Unit
Molar flow rate of A FA Variable mol/min
Molar flow rate of B FB Variable mol/min
Molar flow rate of C FC Variable mol/min

Comment: All molar flow rates are as a function of reactor volume → need to define an array of volumes from 0 dm3 to 500 dm3.

  1. Identify the relevant equations
  1. Total molar flow: Ft = FA + FB +FC

           Where, Ft is the total molar flow rate [mol/min]

  1. Reaction rate equations:

- rA = k( CA - CBCCKC)

Where, rA = rate of reaction for species A [mol/dm3.min]

C = concentration of A [mol/dm3] CB = concentration of B [mol/dm3]

CC = concentration of C [mol/dm3]

rB = - rA

Where, rB = rate of reaction for species B [mol/dm3.min]

rC = - rA

Where, rC = rate of reaction for species C [mol/dm3.min]

  1. Mass transport equations:

RB = kcCB

Where, RB = rate of diffusion of B out of the reactor          per unit volume [mol/dm3.min]

kc = mass transport coefficient [1/min]

CB = concentration of B [mol/dm3]

  1. Mole balances on the species
Species Differential Equation
A
B
C

Membrane Reactor Setup

The membrane reactor is modelled using the Aspen Custom Modeler (ACM).

  1. Open Aspen Custom Modeler
  2. Go to Custom Modeling > Models > Add Model, name the model “MembReactor”, and click OK
  3. The default view of the script editor has comments outlining different sections of a model block. In this membrane reactor, we will only define the variables, define domain and domain based variables using submodel, define port names, make calculations, and write procedure calls.
  4. Variables are defined in the ACM language directly in the script editor, or via Model Assistant.
  5. Documentation on the ACM language can be found under “Help > Aspen Custom Modeler Contents”
  6. Model Assistant is accessed by right clicking in the script editor window or via the shortcut Ctrl+M.
  7. For example, defining the equilibrium constant, Kc, using Model Assistant, and referring to our known variable table:
    • The name of the variable is “Kc”
    • Variable type is selected as “RealVariable” from the dropdown list
    • There are many other options, but setting it as RealVariable keeps things simple and the variables are all real numbers
    • Assign a descriptive name with the unit of this variable
    • Spec is set as Fixed because it is a value specified by the user, not being solved for [3]
  8. Define the rest of the known variables similarly
  9. Define a domain for the discretized volume to be used for the numerical solution
    • Additional information in Aspen Help: Declaring Domains for PDE Modeling
  10. Define molar flowrates for each component, with V as the x-domain
    • Additional information in Aspen Help: Declaring Distributions for Distributed Variables
  11. Define “Nodes” of discretized volume as IntegerSet
    • Redefine the values as [0 + V.Interior + V.EndNode] , to define nodes as an array of integer values starting from 0, increasing by one, to match the number of the discretized volume
    • This will be used an index numbers for corresponding F and X values
  12. Initialize arrays for total molar flowrate (Ft) and rate of reaction (ra) as RealVariable sets with the same size as Nodes
  13. Define the variables: Temperature, Pressure and Enthalpy
    • Use the Model Assistant to define these variables. For instance, Temperature is defined using the following selections in the Model Assistant
    • Similarly, define enthalpy flow and pressure
  14. Define the inlet variables for the feed stream to the MembReac.
    • Define the inlet molar flow rate (Fin), inlet mole fraction (zin), molecular weight (MWin), inlet molar volume (Vin) and inlet molar enthalpy (hin). This is done using the Model Assistant. For instance, zin is defined as the mole fraction and the array type is selected as Component List which denotes the list of components in the feed stream.
  15. Define the Retentate variables. These variables denote the properties of the retentate i.e. part of the feed that didn’t permeate through the membrane reactor. Define the retentate flow rate (Fret), mole fraction (zret), molar enthalpy (hret), molar density (rhoVret), molar volume (Vret) and molecular weight (MWret). This is done using the Model Assistant.
  16. Similarly, define the permeate variables which denote the properties of the permeate i.e. part of the feed which passes through the membrane. These variables are permeate flow rate (Fper), mole fraction (zper), molar enthalpy (hper), molar density (rhoVper), molar volume (Vper) and molecular weight (MWper).
  17. Define the input and output ports (where inlet and outlet material streams are connected) using the Model Assistant. Specify the port type as Material Port and depending on whether the port is inlet or outlet, select input/output as the Flag. PortRet denotes the port for the rententate and PortPer denotes the port for the permeate.
  18. Define the inlet condition for solving the problem. This includes the inlet flow rate (Fin), temperature (T), pressure (P), mole fraction (zin), enthalpy (hin), volume (Vin) and the total molar concentration (Cto).
  19. Define boundary conditions which are the flow rates Fa, Fb and Fc of A,B and C respectively based on the inlet mole fractions of the components.Component flow rates are defined as the total inlet flow rates multiplied by the mole fraction.
  20. Now, define the component mole balance for each volumetric differential. These are calculated based on numerical methods using the values of i from 1 to 40. Fa, Fb and Fc have been defined as 1D distributions and Fa(i).ddx is the first order partial derivative.
    • Aspen Help: Specifying Partial Derivatives in PDEs (can/should we include screenshots from Aspen Help?)
  21. Add equation for total molar flow
    • Aspen Help: Writing Equations in Models
  22. Add equation for reaction rate
  23. Use Aspen’s pre-defined function “pMolWeight” on each stream component list to find the average molecular weight of each stream (inlet, retentate, permeate). Right click on the editor window and select Edit --> Procedure types. 
    • Look for ‘pMolWeight’ from the list and assign it to the respective MWin, Mwret and MWper.
  24. Use Aspen’s pre-defined function “pEnth_Mol_Vap” on each stream to find the vapour molar enthalpy of retentate and permeate streams. Again, right click on the editor window and select Edit --> Procedure types to choose “pEnth_Mol_Vap”. Assign it to the respective hret and hper.
  25. Similarly, use the predefined function “pDens_Mol_Vap” on each stream to find the vapour molar density of retentate and permeate streams and storing it as rhoVret and rhoVper.
  26. Define mass balance based on molar flow rates and average molecular weight of each stream
  27. Define energy balance based on molar flow rates and vapour molar enthalpy of each stream
  28. Assign the final results to retentate conditions.
  29. Define the permeate condition.
    • Since the membrane is only permeable to B, the permeate would contain purely B--set the mole fraction of propylene (B) in the permeate to 1 and the mole fraction of A and C to 0.
  30. Save file as "MembModel_v1.acmf"

Create an Icon for the Model (and crash the model loll)

  1. Go to Custom Modeling > Models > MembReactor, click “Add Icon” to open Icon Editor
  2. Draw a rectangle, right click on it to fill it as “Cylinder (sideways)”
  3. Drag and drop the inlet and outlet stream ports from the list on the left side to the diagram at desired locations
  4. Exit and save the icon
  5. Right click on the newly created icon and make default
  6. Save file (v2)

References

  1. ↑ "Aspen Technology". Retrieved 2020-03-31.