Adding a Second Experiment - Introduction to Dealing with Multiple Cases Using the Same Driver

Here you will learn the important aspects to pay attention to in your simulations when adding a second set of experimental data obtained from one reactor type. in other words, we will show you how to modify your mixins so that they are compatible with all cases using the same driver. By doing so we will restrict mixins only to the implementation of different chemical models, a typical procedure for case studies like the one performed by Gossler and coworkers1.

In this tutorial we will therefore add, to the case you created in the tutorial Modifying your First Own Simulation, a second case containing experimental data obtained rom the same stagnation flow reactor setup but under different conditions. We will then move all parameters corresponding to the experimental setup from the mixins into their respective cases so that only the definition of the chemical models is left in the mixins. Please complete the tutorial Modifying your First Own Simulation before starting with the present one.

Steps

  1. Universality of Mixins
  2. Description of the Example Setup
  3. Adding the New Experimental Data
    1. Consolidating Files into the Project Directory
    2. Adding the New Case
  4. Modifying the Mixins
  5. Concluding Remarks

1. Universality of Mixins

As you already learned in the tutorial Modifying your First Own Simulation we can use mixins to add (or overwrite) almost every simulation parameter of a case, except for its name and the experimental data. By defining a series of different mixins we were able to quickly vary a number of things like fitting variables, catalyst structure, or reaction mechanisms. This flexibility of the mixins reduces however the moment we introduce a second set of experimental data obtained for example in a different setup of the same reactor type or with a differently structured washcoat.

Before we start lets quickly review the mixins we created in the tutorial Modifying your First Own Simulation for the experimental data from Karakaya and coworkers 2 for the catalytic conversion of CH4 over Rh at 873 K in a stagnation flow reactor using the DETCHEM stagnation driver.

#...
mixins:
  -
    title: With washcoat
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          washcoat:
            thickness: 0.0001
            porosity: 0.4
            tortuosity: 8
            pore_diameter: 1.0e-08
            diffusion_limiting_species:
              - O2

  -
    title: With washcoat, f_cat_geo = 30
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          washcoat:
            thickness: 0.0001
            porosity: 0.4
            tortuosity: 8
            pore_diameter: 1.0e-08
            diffusion_limiting_species:
              - O2
          f_cat_geo: 30

  -
    title: With washcoat, f_cat_geo = 30, model 2
    configuration:
      -
        driver: detchem_stagnation
        parameters:
          washcoat:
            thickness: 0.0001
            porosity: 0.4
            tortuosity: 8
            pore_diameter: 1.0e-08
            diffusion_limiting_species:
              - O2
          f_cat_geo: 30
          chemical_model:
            $resource: model 2
#...

The With washcoat mixin adds the definition of a washcoat which was originally not defined in the case. The With washcoat, f_cat_geo = 30 defines additionally a new value for the f_cat_geo variable to improve the result of the simulation after having added the washcoat. The With washcoat, f_cat_geo = 30, model 2 defines, in addition to the washcoat and the f_cat_geo variable, a new chemical model model 2, allowing to compare the results of the simulations using each of the models.

Now imagine the situation of having to simulate data obtained in the same setup, for which you would use the same driver DETCHEM satgantion, but using a washcoat with either a different thickness, porosity, and/or pore diameter. In such a case you would still be able to combine any of the mixins shown above with your new experimental data (case), because the driver at hand would be the same, but you would obtain false results, since you would have used the wrong parameters for the washcoat. This situation applies as well to all other experimental conditions or structural parameters which are experiment-specific.

Creating mixins which are compatible with all cases at hand and which provide the right simulation conditions forces us therefore to exclude all case-specific parameters, i.e. all parameters that cannot or are not wished to be applied to all cases, from the mixins themselves. Which parameters or conditions fall under this criteria depends on the experiment at hand and on the aim of your study.

2. Description of the Example Setup

In this tutorial we will add another set of experimental data collected by Karakaya and coworkers 2 for the steam reforming of CH4 over Rh at 973 K in a stagnation flow reactor. The measured data consists of the concentration profile of CH4, CO, H2, and H2O with respect to the distance to the catalytic plate. Further details on the experimental setup can be found in Karakaya and coworkers publication 2. 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 419.15 K
Gas velocity at inlet 0.7108 m/s
Gas mole fraction of CH4 0.0518
Gas mole fraction of H2O 0.053796
Gas mole fraction of Ar 0.8944
Distance inlet to disc 0.039 m
Reactor pressure 49993.755 Pa
Surface temperature 973.15 K

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

SR\_stag\_973K

3. Adding the New Experimental Data

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

i. Consolidating Files into the Project Directory

The first step to add new data is to consolidate the experimental data file into the Project Directory. The original file from Karakaya and coworkers 2 is in the folder downloaded from DETCHEM's homepage under the path /PCCP 2018 10.1039_c7cp07777g/experiments/unpublished data/Stagnation/SR_Spatial_973K_StoC=1.

Now copy the file containing the experimental data into the Project Directory. We will take the original data file called 09012011-700C-SR-dusty_processed.csv and rename it to SR_stag_973.csv. In this example the data is written in the CSV format using , commas as delimiters, which means that CaRMeN is be able to read it directly.

ii. Adding the New Case

We will now start to define the case for the new experimental data set. Open your carmen.yml file and create a new array entry under cases: and start typing the general structure of a case.

cases:
  -
    #...
  -
    title: My second experiment - SR 973 Rh
    data: ./SR_stag_973.csv
    view:
      label:
        x: distance from disc (x/m)
        y: mole fractions
    configuration:
      driver: detchem_stagnation
      output: ./mole_fractions
      parameters:
        #...

Here we name the new case My second experiment - SR 973 Rh. We want to simulate the concentration profiles of the species along the distance to the catalytic plate so we define the data of the case to be taken from the file ./SR_stag_973.csv. 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 distance to the catalytic plate x in meters, so we write x: distance from disc (x/m) and y: mole fractions under the label: field. We implement the DETCHEM stagnation driver by writing driver: detchem_stagnation under the configuration: field. We write the following keys under the parameters: field of the driver: an inlet, a surface, an f_cat_geo, a distance_inlet_disk, a pressure, and a washcoat key.

      #...
      parameters:
        inlet:
          #...
        surface:
          temperature: 973.15
        f_cat_geo: 16
        distance_inlet_disk: 0.039
        pressure: 49993.755
          washcoat:
            #...

The inlet: field follows the same structure as described in the tutorial Creating your First Own Simulation. We provide the conditions of the gas flow entering the reactor by writing

      #...
        inlet:
          temperature: 419.15
          gas_velocity: 0.7108
          mole_fractions:
            CH4: 0.05163
            H2O: 0.053796
            Ar: "*"
        #...

We define the temperature of the catalytic surface by writing temperature: 973 under the surface: field. Measurements of the specific active catalyst surface area performed by Karakaya and coworkers 2 provided a value for the ratio of the catalytic to the geometrical area of the plate of approximately 16, so we write f_cat_geo: 16 under the parameters: field. The distance of the gas inlet to the catalytic plate and the reactor pressure were set to the setup conditions by writing distance_inlet_disk: 0.039 and pressure: 49993.755 respectively. In this example we want to define the washcoat directly in the case. The washcoat used in this experiment is structurally equal to the one used for the experiment described in the My first simulation - CPOX 873 Rh case, the species diffusion in the washcoat under steam reforming conditions is however slightly different. We therefore copy the definition of the washcoat, which we wrote in the With washcoat mixin, including the values for the thickness, the porosity, the tortuosity, and the pore_diameter and paste it into the new case under the parameters: field. Karakaya and coworkers 2 determined both the CH4 and the H2O to be diffusion limiting in the washcoat, so we write - CH4 and - H2O for the diffusion_limiting_species: field under the washcoat: field.

        #...
        washcoat:
          thickness: 0.0001
          porosity: 0.4
          tortuosity: 8
          pore_diameter: 1.0e-08
          diffusion_limiting_species:
            - CH4
            - H2O

In this example we will not define the chemical model in the case itself, as we did in the tutorial Creating your First Own Simulation, but in a mixin, as we did in the tutorial Modifying your First Own Simulation. The new case in your carmen.yml file should look by now as follows:

cases:
  -
    #...
  -
    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
      output: ./mole_fractions
      parameters:
        inlet:
          temperature: 419.15
          gas_velocity: 0.7108
          mole_fractions:
            CH4: 0.05163
            H2O: 0.053796
            Ar: "*"
        surface:
          temperature: 973.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
#...

4. Modifying the Mixins

As we already mentioned, we want to use mixins in this example solely to define the chemical models to be used. In the tutorial Modifying your First Own Simulation we created three mixins: With washcoat, With washcoat, f_cat_geo = 30, and With washcoat, f_cat_geo = 30, model 2. The mixins With washcoat and With washcoat, f_cat_geo = 30 only define setup parameters while the With washcoat, f_cat_geo = 30, model 2 mixin defines additionally the chemical model model 2.

Since we are now only interested in working with chemical models in the mixins we delete the definitions of the With washcoat and the With washcoat, f_cat_geo = 30 mixins. Now we move the f_cat_geo: and the washcoat: fields, with their respective values, from the With washcoat, f_cat_geo = 30, model 2 mixin into the My first simulation - CPOX 873 Rh case under the parameters: field. Don't forget to delete/overwrite the originally used value f_cat_geo: 1 in the My first simulation - CPOX 873 Rh case. Finally we rename in this example the With washcoat, f_cat_geo = 30, model 2 mixin simply to model 2. Your model 2 mixin should look by now as follows:

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

In the tutorial Creating your First Own Simulation we defined the chemical model to be used by the My first simulation - CPOX 873 Rh case in the case itself. In this example we want to move this definition to an individual mixin. For that first delete the chemical_model: field and its value from the My first simulation - CPOX 873 Rh case. Now copy the syntax of the model 2 mixin we just created and paste it so that you create a new array entry under mixins:. For the new mixin we chose the name model 1 so we write

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

Notice that we define the chemical model to be used by referencing to the model resource, which we already defined in the tutorial Creating your First Own Simulation and is still present in our carmen.yml file.

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
      output: ./mole_fractions
      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

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

  -
    title: model 1
    configuration:
      -
        driver: detchem_stagnation
        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

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. Notice the different axis labels shown on the plot of the My first simulation - CPOX 873 Rh and the My second experiment - SR 973 Rh case. This is the effect of using the optional view key plus the label key.

Result Second Experiment

5. Concluding Remarks

Thank you for completing this tutorial. You should now be aware of the important aspects to pay attention to when simulating two cases using the same driver.

In the next tutorial Adding Other Reactor Types we will show you how to simulate experimental data sets obtained with other reactor types by introducing the DETCHEM channel driver. We will also show you how to deal with multiple drivers for your simulations.

1. H. Gossler, L. Maier, S. Angeli, S. Tischerb and O. Deutschmann, Phys. Chem. Chem. Phys., 2018, Advance Article, DOI: 10.1039/C7CP07777G
2. C. Karakaya, L. Maier and O. Deutschmann, Int. J. Chem. Kinet., 2016, 48, 144–160. DOI: 10.1002/kin.20980

results matching ""

    No results matching ""