Kinetic parameter affects the output while kinetics are desabled

Hi,
I have registered a custom isotherm model in CADET, that is more or less a Langmuir isotherm (equilibrium approach) with a transformation for gradient runs (organic modifier).
While the simulation ran smoothly I noticed the following:

  1. When I disable kinetics by IS_KINETIC = 0, the kkin parameter still affects the output, which it shouldn’t.
  2. Note that if I enable kinetics I get different results to when I disable them, for the same set of parameters and control variables.
  3. The simulation outcome is the same regardless of whether I simulate with the analytic Jacobian or the AD Jacobian. I report this in case one thinks that there might be something wrong with the Jacobian implementation in C++.

I would appreciate any ideas as to why this is happening.

Could you please open a PR so that we can review your code?

Thank you for your rapid response, Johannes. I did a pull request under the name “disabled_kinetics”.
Thank you in advance

Your contribution is highly appreciated. Can you please post the model equations here, so we can compare them with the existing model(s).

Certainly! The transport phenomena model that I’ve been using is the Lumped Rate Model without pores coupled with the following equation:

\frac{dq_i}{dt} = k_{kin,i}(q_i^*-q_i) with q_i^*=\frac{k_i e^{-S_{a,i} \varphi} c_i}{1 + \sum_{j=1}^{n_{comp}}{\frac{k_j}{q_{sat,j}} e^{-S_{a,j}\varphi} c_j}}

where k is the retention factor (i.e. not the equilibrium constant), \varphi is the fraction of the organic modifier, and S_a and S_b are the solvent strength parameters.

Thanks for posting the equation. Do you have a reference for it? I would have expected some extension of the classical Langmuir model q_i^*=\frac{q_{m,i} k_{eq,i} c_i}{1 + \sum_{j=1}^{n_{comp}}{k_{eq,j} c_j}}. However, I am missing q_m and unsure about the role of q_{sat}. Where does S_b come in? Is \varphi meant to be provided as an external function or is it modeled as a pseodo component?

Thank you for your response and apologies for the confusion. The S_b should be the solvent strength in the denominator (instead of S_a); there is a typo in the equation I sent in. The formulation, although different, is equivalent to the CADET implementation of the Langmuir isotherm.
This Langmuir isotherm with parameters that only account for isocratic elution is taken from the book of Schmidt-Traub Eq. 2.42:
q = q_{sat} \frac{b c}{1 + b c} = \frac{H c}{1 + b c}
where b = \frac{H}{q_{sat}}.
Adapting to the notation I used H \equiv k. Now, in terms of CADET notation b \equiv k_{eq} and q_{sat} \equiv q_{m}. In the pull request that I sent, I’ve modelled \varphi as a pseudo-component.

For the modified Langmuir isotherm you can refer to: Leśko, M., Åsberg, D., Enmark, M., Samuelsson, J., Fornstedt, T., & Kaczmarski, K. (2015). Chromatographia, 78(19–20), 1293–1297.

3 Likes

Hey Kostas,

I built CADET with your code but can’t reproduce the error. The kinetic constant behaves just as expected. Can you please send us a parameter set/ HDF5 file that produces the error for you?

Hi Ronald,

thank you for the rapid response. Here are two HDF5 files, Langmuir_1 simulated with a relatively low value of k_{kin} and Langmuir_2 with a higher value. Note that both simulations were performed by disabling the kinetics.
langmuir_1.h5 (4.1 MB)
langmuir_2.h5 (4.0 MB)

so that was quite the brain teaser and I won’t admit how long it took me :smiley:
The problem is this setting in your files:

sim.root.input.model.unit_001.adsorption.is_kinetic = [0, 0, 0]

What it’s trying to do, is set is_kinetic to False. But a list of length > 0 is evaluated as True.

>>>bool([0, 0, 0])
True

at least in Python. I’d wager, that it’s similar in C++, but I haven’t checked.

Changing that line to

sim.root.input.model.unit_001.adsorption.is_kinetic = 0

solves all irregularities related to kinetics.

Another thing I’ve noticed is that my simulations with your isotherm were crashing a lot if I had use_analytic_jacobian set True but ran fine with False. So you might need to look at those again. If you’re stuck on the analytic Jacobian let us know. :slight_smile:

1 Like

Hi Ronald,

Thank you for taking the time to look through it. In all honest, I thought I should set a boolean value for its component in the system that’s why I used a list.
Perhaps, I need to take another look at the analytic jacobian. Thank you so much, again.