Consider the reaction kinetics and boundary conditions as in exercise 3.2 but now with counter-current convection instead of diffusion. Assume that reactant and product move from left to right, and reactant and product from right to left. One can imagine counter-current liquid and gas flows where some of the components are liquid and others gas. This is modeling a counter-current process where any mass-transfer resistance are neglected.
| Parameter | Value |
|---|---|
| Reactor length | |
| Kinetic constant | |
| Kinetic constant | |
| Velocity | |
| Velocity |
Questions:
Write down the governing time-dependent evolution equations.
Write down the spatially discretized equations in terms of matrices corresponding to the discretization of the divergence and gradient operator. Discuss, how the boundary conditions contribute to the discretized equations.
Use backwards Euler time discretization for all terms. Write down the root-seeking problem that needs to be solved. Also provide the Jacobian of the function that needs to be solved.
Formulate the solution algorithm applying the Newton-Raphson method.
Provide a Python implementation for the set of equations and its Jacobian using the pymrm building blocks:
construct_grad,construct_divandnumjac.Implement the numerical solution using the
newtonfunction from thepymrmpackage.Provide an unsteady solution using Newton-Raphson iteration for each time-step.
Play with the reaction rates and boundary conditions. For higher reaction rates, when do numerical issues arise? How can these be resolved? Hint: the
pymrmfunctionclip_approachcan be used as a callback function innewton, to make sure that values stay within bounds also inside iterations.