Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Initial Concentrations Cause Simulation Crash #364

Open
AntoniaBerger opened this issue Feb 20, 2025 · 0 comments
Open

Inconsistent Initial Concentrations Cause Simulation Crash #364

AntoniaBerger opened this issue Feb 20, 2025 · 0 comments
Assignees
Labels

Comments

@AntoniaBerger
Copy link
Collaborator

Expected Behavior

If inconsistent initial values for the concentration in the bulk and solid phase are provided, while binding follows rapid equilibrium, CADET should compute corrected initial concentrations that satisfy the algebraic and differential equations (see Explanation). The simulation should then proceed using these newly calculated initial concentrations.

Actual Behavior

When the flow rate is nonzero at $t=0$, the simulation crashes for the CSTR and LRM.

Examining the debug information suggests that not all entries in the state vector $y$ are updated after computing the consistent initial values.

If $flowout=0$, the affected entries remain zero, so this issue does not impact the simulation. However, when the flow rate is nonzero, the incorrect values cause a crash.

Debug information from simulation with concentration c_init = 1 q_init = 3 and $f_{in} = f_{out} = 0.1$ (not consistent)
[Debug: integrate::1138] ==========> Consistency error post Full: 0.333333 [Debug: integrate::1153] y = [0.5,0.5,1.33333,2.66667,1,1,0.5,1]; [Debug: integrate::1154] yDot = [0,0,-1.66667e-05,-3.33333e-05,0,-1.66667e-05,0,-1.66667e-05];

Debug information from simulation with concentration c_init = 4/3 q_init = 8/3 $f_{in} = f_{out} = 0.1$ (consistent)
[Debug: integrate::1138] ==========> Consistency error post Full: 2.22045e-16 [Debug: integrate::1153] y = [0.5,0.5,1.33333,2.66667,1,1.33333,0.5,1.33333]; [Debug: integrate::1154] yDot = [0,0,-1.66667e-05,-3.33333e-05,0,-1.66667e-05,0,-1.66667e-05];

Debug information from simulation with concentration c_init = 1 q_init = 3 $f_{in} = f_{out} = 0.0$ (not consistent)
[Debug: integrate::1138] ==========> Consistency error post Full: 0 [Debug: integrate::1153] y = [0.5,0,1.33333,2.66667,1,0,0,0]; [Debug: integrate::1154] yDot = [0,0,-0,0,-0,0,0,0];

Steps to Reproduce the Problem

Run the provided calculation script:
Reproduction Script

Specifications

  • Version: 5.0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant