The fixed bed reactor model was previously developed for "stand alone" use. Modifications were needed to incorporate the model into a process simulation program. To explain the differences, let's begin with the original model.
The "stand alone" model
Mathcad will compute a function or variable from previously defined variables. This means that not all of the variables used in a single line function or in a program structure need to be listed in the function or program arguments. Only variables that change need to be listed as arguments. Thus, the structure shown below was used for the original model.
Everything written above the blue box was defined on the Mathcad whiteboard prior to the call to the model program.
Requirements for the process simulation program
The routines needed for the simulation program are being collected in a Mathcad worksheet. This worksheet is included or called by reference at the beginning of the project worksheet. Because this "include" worksheet does not have access to the basic data of the project, all of the parameters needed by the routines must be defined as arguments to the routines, otherwise errors occur.
We must also consider that the reactor routine may be needed for more than one reactor in the process. Also, it may be called repeatedly in a loop. These considerations also dictate that the program requires all input in the form of arguments, as depicted below.
The model for process simulator
The alpha parameters produced by fb_parms are the dimensionless parameters for radial dispersion of heat and mass, and for transfer of both heat and mass across the film surrounding the catalyst.
The difference functions provide the point values of the temperatures and mass fractions in the flowing fluid and at the catalyst surface. In other words, these functions are the local solutions of the transport equations in difference form.
That is the overview of the fixed bed reactor model. The main program is fb_ss, with fb_diff and fb_parms as subroutines. Posts that follow will zoom in on some of the details.