Adding Other Reactor Types - Working with multiple Drivers and Introduction to DETCHEM channel

Here you will learn how to simulate other reactor types like annular channels and channels in monoliths by implementing the DETCHEM channel driver. We will also show you how to deal with multiple drivers in your simulations.

In this tutorial we will therefore show you how to implement the DETCHEM channel driver by adding a third experimental data set (case) to the case you created in the tutorial Adding a Second Experiment. We will also show you how to expand mixins to work with multiple drivers. Please complete the tutorial Adding a Second Experiment before starting with the present one.

Steps

  1. Description of the Example Setup
  2. Adding the New Experimental Data
    1. Consolidating Files into the Project Directory
    2. Adding Resources
    3. Adding the New Case
  3. Modifying the Mixins to include a Second Driver
  4. Concluding Remarks

1. Description of the Example Setup

In this tutorial we will add experimental data collected by Sui et al. 1 for the heterogeneous combustion of CH4 over Rh at 5 bar. The measured data consists of spatially resolved concentration profiles of CH4, O2, H2, and CO and temperature profiles along the length of a flat slit rectangular reactor covered with a dense Rh-layer. As we already mentioned, we want simulate this experiment using the DETCHEM channel driver. The DETCHEM channel code however is only designed to simulate cylindrical geometries. In order to recreate the experimental setup we will use the annular configuration of DETCHEM channel consisting of a cylindrical reactor with an inner and an outer wall forming a ring-shaped slit. In order for this approach to be valid the length, the slit hight, and the geometrical surface area of both the experimental and the simulated reactor must be equal. Further details on the experimental setup can be found in Sui and coworkers publication 1. The original experimental data is also available for download as a .zip-file from DETCHEM's homepage (http://www.detchem.com/html/downloads.html#Carmen).

The following table summarizes the experimental conditions. All values are given in SI-units.

name value unit
Gas temperature at inlet 429 K
Gas velocity at inlet 0.47 m/s
Gas mole fraction of CH4 0.173
Gas mole fraction of O2 0.19
Gas mole fraction of N2 0.637
Slit length 0.300 m
Slit width 0.104 m
Slit hight 0.007 m
Reactor pressure 500000 Pa
Reactor wall temperature profile K

Here is a preview of the experimentally measured concentration profiles data when opened with either Pages or Excel:

CPOX\_slit\_5bar

Here is a preview of the experimentally measured reactor wall temperature profile data when opened with either Pages or Excel:

CPOX\_slit\_5bar\_temp

2. Adding the New Experimental Data

We will start by adding the new experimental data for our simulations.

i. Consolidating Files into the Project Directory

Before we start writing the case we must consolidate the experimental data file into the Project Directory. The original files from Sui and coworkers 1 are in the folder downloaded from DETCHEM's homepage under the path /PCCP 2018 10.1039_c7cp07777g/experiments/published data/Sui 2016 partial_ox 10.1016_j.proci.2016.06.001/CPOX_Spatial_P=5bar_CH4toO2=0.9.

Now copy the files containing the experimental data into the Project Directory. We will take the original data files called concentration_profile.csv and temperature_profile.csv and rename it to CPOX_slit_5bar.csv and CPOX_slit_5bar_temp.csv. In this example both the concentration profile and the temperature data are written in CSV format, however, using semicolons ; as delimiters, so we have to define a resource for each of them in order for CaRMeN to load the data correctly.

PENDING: Resource definitions will be restructured in future versions of CaRMeN. The present documentation corresponds to version 0.0.20.

ii. Adding Resources

We will now define the resources for the experimental data starting with the concentration profile data. Open your carmen.yml file from the Project Directory and create a new array entry under resources:. In this example we are loading a csv file for which we need a one-to-one resource. One-to-one resources, in the present version of CaRMeN, do not follow the general structure of transforming loaders in their definition (e.g. of the chemical_model loader). One-to-one resources allow four keys in their definition: name, path, format, and options. The first key is written by convention on the line below the hyphen with one additional level of indentation (i.e. two additional blank spaces) with respect to the hyphen. The name of each key is followed by a colon :, a blank space, and the value of the key.

#...
resources:
  -
    #..
  -
    #...
  -
    input: ./CPOX_slit_5bar.csv
    options:
      #...

The name: field is optional and it defines the name of the resource by which it can be referred to within the file. If no name is defined the name of the resource falls back to the path of the loaded file. In this example we omit the name key.

The path: field is obligatory. It defines the path to the file to be loaded, starting with a point . followed by a slash / and the path to the file. In this example we write input: ./CPOX_slit_5bar.csv.

The format: field is optional. It defines the loader to be used and is necessary if the format of the data file cannot be interpreted from its extension (e.g. csv data files with the extension .data or no extension at all). In this example we omit the format: field since the file containing the experimental data has the extension .csv.

The options: field is optional. It defines eventually required parameters for interpreting the data. The available options depend on the loader at hand. For more information on the options available for resource loaders see the chapter Resource Loaders under the reference section of this documentation. In this example the data file uses semicolons ; as delimiters, so we need a delimiter key to define this.

#...
resources:
  -
    #..
  -
    #...
  -
    input: ./CPOX_slit_5bar.csv
    options:
      delimiter: ;
#...

The delimiter: field defines the character used in the file to separate the data. Since in this example the data is separated by semicolons ; we write delimiter: ;. The definition of this resource is now completed. Repeat the described procedure and define a resource for the temperature profile data.

#...
resources:
  -
    #..
  -
    #...
  -
    #...
  -
    input: ./CPOX_slit_5bar_temp.csv
    options:
      delimiter: ;
#...

In this example we omit again the name key and only define the path to the file ./CPOX_slit_5bar_temp.csv and the data to be delimited by semicolons ;.

NOTE: A number of file formats can be directly read by CaRMeN without having to define a resource, if they follow a default configuration. This is the case for: .csv files using commas , as delimiters and with no additional options, .json files, .yaml/.yml files, .ckt files, moldata files, and .ckr files with no additional options. For more information on resource loaders see the chapter Resource Loaders under the reference section of this documentation.

iii. Adding the New Case

We will now define the case for the new experimental data set. Create a new array entry under cases: and start typing the general structure of a case.

cases:
  -
    #...
  -
    title: Slit simulation - CPOX 5bar
    data: ./CPOX_slit_5bar.csv
    view:
      label:
        x: axial position (z/m)
        y: mole fractions
    configuration:
      driver: detchem_channel
      parameters:
        #...

Here we name the new case Slit simulation - CPOX 5bar. We want to simulate the concentration profiles of the species along the reactor length so we define the data of the case to be taken from the file ./CPOX_slit_5bar.csv containing the measured concentration profiles. For this we use the default name of the resource we just created, which is the same as the path to the file containing the measured concentration profiles, so we write data: ./CPOX_slit_5bar.csv.

NOTE: Whenever a resource is defined using the path to the pertinent file as the name CaRMeN will not directly refer to the file under the path, but to the resource definition.

In this example we also make use of the optional view key containing a label key in order to modify the labels of the plot shown by CaRMeN. In this case we want to plot mole fraction of species against the axial position z in meters (m), so we write x: axial position (z/m) and y: mole fractions under the label: field. We implement the DETCHEM channel driver by writing driver: detchem_channel under the configuration: field. The parameters: field for the DETCHEM channel driver requires an inlet key, a channel key, an f_cat_geo key, a pressure key, and a wall_temperature key.

      #...
      parameters:
        inlet:
          #...
        channel:
          #...
        catalytic_activity:
          #...
        f_cat_geo: 0.94
        pressure: 500000
        wall_temperature:
          #...

The inlet: field follows the same structure as for the DETCHEM stagnation driver, so we provide the conditions of the gas flow entering the reactor by writing

      #...
        inlet:
          temperature: 429
          gas_velocity: 0.47
          mole_fractions:
            CH4: 0.173
            O2: 0.19
            N2: "*"
        #...

The channel: field defines the geometry of the cannel and it requires a length key and a radius key.

        #...
        channel:
          length: 0.3
          radius:
            inner: 0.0131
            outer: 0.0201
        #...

The length: field defies the length of the channel in meters (m). In this example we need to set the length of the channel to be equal to that of the slit, one of the conditions for the approach we are following. Here we write 0.3.

The radius: field defines the radius of the channel in meters (m). In case of a single channel a numerical value for the radius would suffice. In this example, however, we are simulating the slit in the experimental setup using an annular configuration. Therefore we need to define the radius of the inner and the outer channel wall. We do so by writing an inner key and an outer: key under the radius: field.

The inner: field defines the radius of the wall of the inner channel in meters (m). The outer: field defines the radius of the wall of the outer channel also in meters (m). Two of the conditions of this approach were to recreate the slit hight and the geometrical surface area of the reactor. The experimental setup had a slit hight of 7 mm and a geometrical surface area of 0.0624 m^2. By setting the inner radius to 0.0131 and the outer radius to 0.0201 we achieve a separation between the inner and the outer wall of 7 mm and a geometrical surface area of about 0.0625 m^2, a fairly good approximation to the experimental reactor geometry.

The catalytic_activity key is optional. It defines which of the walls in an annular configuration are catalytically active. If no catalytic_activity: field is defined the DETCHEM channel code assumes the outer wall to be catalytically active and the inner wall to be catalytically inactive. In this example we set both walls to be catalytically active by writing inner: true and outer: true.

        #...
        catalytic_activity:
          inner: true
          outer: true
        #...

NOTE: A wall can be defined as catalytically inactive by replacing true with false.

The f_cat_geo: field has the same purpose as for the DETCHEM stagnation driver. By measuring the total and the active surface area Sui and coworkers 1 confirmed the lack of porosity of the Rh-layer in their reactor. A perfectly flat Rh-layer would have a ratio of catalytic to geometrical area of 1. Previous work done with this data set suggests a ratio of 0.94 to be more suitable. A ratio of catalytic to geometrical area smaller than 1 indicates that not all of the inner surface of the reactor was catalytically active. We set the f_cat_geo variable to 0.94 by writing f_cat_geo: 0.94 under the parameter: field. The pressure: field has the same purpose as for the DETCHEM stagnation driver. Here we set the measured reactor pressure by writing pressure: 500000 under the parameters: field.

The wall_temperature: field defines the temperature of the reactor (inner and outer) wall in kelvin (K). Under isothermal conditions a numerical value for the wall temperature would suffice, however, in this example the temperature of the reactor wall was measured at several points along the reactor length. We already defined the ./CPOX_slit_5bar_temp.csv resource for the file containing the temperature profile data, so we write $resource: ./CPOX_slit_5bar_temp.csv under the wall_temperature: field.

        #...
        wall_temperature:
          $resource: ./CPOX_slit_5bar_temp.csv
#...

The new case in your carmen.yml file should look by now as follows:

cases:
  -
    #...
  -
    title: Slit simulation - CPOX 5bar
    data: ./CPOX_slit_5bar.csv
    view:
      label:
        x: axial position (z/m)
        y: mole fractions
    configuration:
      driver: detchem_channel
      parameters:
        inlet:
          temperature: 429
          gas_velocity: 0.47
          mole_fractions:
            CH4: 0.173
            O2: 0.19
            N2: "*"
        channel:
          length: 0.3
          radius:
            inner: 0.0131
            outer: 0.0201
        catalytic_activity:
          inner: true
          outer: true
        f_cat_geo: 0.94
        pressure: 500000
        wall_temperature:
          $resource: ./CPOX_slit_5bar_temp.csv
#...

3. Modifying the Mixins to include a Second Driver

Now we have to expand the mixins so that they also work with the DETCHEM channel driver. In the tutorial Adding a Second Experiment we created two mixins called model 1 and model 2 to define the chemical models from Deutschmann et al. 2 model 1 and Schwiedernoch et al. 3 model 2. As you have learned in the tutorial Modifying your First Own Simulation mixins can only modify simulation parameters of a case after the driver at hand has been defined, so we have to add the DETCHEM channel driver to the definition of both the model 1 and the model 2 mixins.

Copy the driver: field and all contained values from the model 2 mixin and paste it so that you create a new array entry under the configuration: field of the mixin. Then change the defined driver from detchem_stagnation to detchem_channel.

mixins:
  -
    title: model 2
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          chemical_model:
            $resource: model 2
      -
        driver: detchem_channel
        parameters:
          chemical_model:
            $resource: model 2
#...

Repeat this procedure for the model 1 mixin.

  #...
  -
    title: model 1
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          chemical_model:
            $resource: model
      -
        driver: detchem_channel
        parameters:
          chemical_model:
            $resource: model
#...

We have now completed all necessary modifications to account for the new experimental data and for the new driver. Your carmen.yml file should look by now as follows:

cases:
  -
    title: My first simulation - CPOX 873 Rh
    data: ./CPOX_stag_873.csv
#   view:
#     label:
#       x: distance from disc (x/m)
#       y: mole fractions
    configuration:
      driver: detchem_stagnation
#     output: mole_fractions
      parameters:
        inlet:
          temperature: 313.15
          gas_velocity: 0.5088
          mole_fractions:
            CH4: 0.053
            O2: 0.0257
            Ar: "*"
        surface:
          temperature: 873.15
        f_cat_geo: 30
        distance_inlet_disk: 0.039
        pressure: 49994
        washcoat:
          thickness: 0.0001
          porosity: 0.4
          tortuosity: 8
          pore_diameter: 1.0e-08
          diffusion_limiting_species:
            - O2

  -
    title: My second experiment - SR 973 Rh
    data: ./SR_stag_973.csv
    view:
      label:
        x: axial position (z/m)
        y: mole fractions
    configuration:
      driver: detchem_stagnation
      parameters:
        inlet:
          temperature: 419.15
          gas_velocity: 0.7108
          mole_fractions:
            CH4: 0.05163
            H2O: 0.053796
            Ar: "*"
        surface:
          temperature: 1008.15
        f_cat_geo: 16
        distance_inlet_disk: 0.039
        pressure: 49993.755
        washcoat:
          thickness: 0.0001
          porosity: 0.4
          tortuosity: 8
          pore_diameter: 1.0e-08
          diffusion_limiting_species:
          - CH4
          - H2O

  -
    title: Slit simulation - CPOX 5bar
    data: ./CPOX_slit_5bar.csv
    view:
      label:
        x: axial position (z/m)
        y: mole fractions
    configuration:
      driver: detchem_channel
      parameters:
        inlet:
          temperature: 429
          gas_velocity: 0.47
          mole_fractions:
            CH4: 0.173
            O2: 0.19
            N2: "*"
        channel:
          length: 0.3
          radius:
            inner: 0.0131
            outer: 0.0201
        catalytic_activity:
          inner: true
          outer: true
        f_cat_geo: 0.94
        pressure: 500000
        wall_temperature:
          $resource: ./CPOX_slit_5bar_temp.csv


mixins:
  -
    title: model 2
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          chemical_model:
            $resource: model 2
      -
        driver: detchem_channel
        parameters:
          chemical_model:
            $resource: model 2

  -
    title: model 1
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          chemical_model:
            $resource: model
      -
        driver: detchem_channel
        parameters:
          chemical_model:
            $resource: model

resources:
  -
    name: model
    loader: chemical-model
    options:
      species_database:
        - ./moldata
        - ./thermo.ckt
      reactions:
        surface: ./surface.ckr

  -
    name: model 2
    loader: chemical-model
    options:
      species_database:
        - ./model_2/moldata
        - ./model_2/thermo.ckt
      reactions:
        surface: ./model_2/surface.ckr

  -
    input: ./CPOX_slit_5bar.csv
    options:
      delimiter: ;

  -
    input: ./CPOX_slit_5bar_temp.csv
    options:
      delimiter: ;

You may now proceed to load the Project Directory into CaRMeN and run the simulation as shown in the tutorial Quick Start. If you have followed all steps correctly you should see the following result in CaRMeN's Combiner View window.

Result Second Reactor

4. Concluding Remarks

Thank you for completing this tutorial. You should now be able to simulate other reactor types like annular channels and channels in monoliths by implementing the DETCHEM channel driver and to create mixins that work with multiple drivers.

In the next tutorial Adding an End-Of-Pipe (EOP) Simulation we will introduce you to the so called end-of-pipe simulations and to the $data macro.

1. R. Sui, J. Mantzaras and R. Bombach, Proc. Combust. Inst., 2017, 36, 4313–4320, DOI: 10.1016/j.proci.2016.06.001
2. [O. Deutschmann, R. Schwiedemoch, L. I. Maier and D. Chatterjee, Stud. Surf. Sci. Catal., 2001, 251–258, DOI: 10.1016/S0167-2991(01)80312-8]
3. R. Schwiedernoch, S. Tischer, C. Correa and O. Deutschmann, Chem. Eng. Sci., 2003, 58, 633–642. DOI: 10.1016/S0009-2509(02)00589-4

results matching ""

    No results matching ""