RT3D User-Defined Reactions Workflow

From XMS Wiki
This is the approved revision of this page, as well as being the most recent.
Jump to navigationJump to search

Creating a user-defined reaction in RT3D is considered an advanced option and is not recommended for beginning or casual users. To use a user-defined reaction in a RT3D model, use the following steps:

1. Code new reaction package.
1. Select package coding approach.
  1. Dynamically linked library (DLL) DLL option.
  2. Linked subroutine option
2. Select method for coding a new user-defined package.
  1. In the first method, all reaction parameter values are explicitly assigned within the reaction module prior to compilation. This is not an efficient method since it requires recompilation of the reaction routine whenever a reaction parameter value is modified. However, this method is recommended for testing a new reaction module with the BATCHRXN utility.
  2. In the second method, all of the reaction parameter values are spatially constant but are assigned/modified externally, as input data, via the RCT file (to run RT3D) or batch.in file (to run BATCHRXN).
  3. In the third method, some or all of the reaction parameters are treated as spatially variable (i.e., a different value may be assigned to each cell). The parameter values should be externally assigned/modified as input data via the RCT file. This option should be used with caution because it may require significant computer resources, both execution time and memory.
3. Edit source code of the reaction module.
  1. Open and edit the package file using an ASCII editor (Notepad, WordPad, etc.).
4. Compile source code.
  1. Use a command prompt to compile the DLL file.
2. Set the basic transport package to "User-defined".
1. Assign the basic transport package as a RT3D model.
  1. Select the MT3DMS | Basic Transport Package menu command if the dialog does not appear when creating the simulation.
  2. In the Basic Transport Package dialog, select the RT3D option.
2. Select RT3D packages.
  1. In the Basic Transport Package dialog, select the Packages button.
  2. Select packages in the MTD3DMS/RT3D Packages dialog.
    • For RT3D, select "User-Defined Reaction" option for the RT3D reaction option.
3. Define the species.
  1. In the Basic Transport Package dialog, select the Define Species button.
  2. Select species in the Define Species dialog.
3. Set rest of parameters for the RT3D project using the user-defined options.