Problem with DifferentialEquations.jl

I’m working on a project, which is basically a simulation model for adsorption process of phosphate in waste water

(2 videos to understand the adsorption process, it’s 15 seconds in total)

So the first is to simulate the evolution of the concentration of phosphate into the column and the evolution of the amount of phosphate adsorbed into the column. To do that, I have to discretize two equations.

I’m using a code that I’ve previously used in class with slighty different equations, and it was working perfectly. However in my case, I keep getting weird plot with excessive time or maxiters error.

Hello, welcome to the Julia community. Show us what you have already tried – I am afraid it must be difficult for anyone to help you unless you show us the code you wrote to solve the problem.

So you are discretizing (a) PDE(s).

  • In your model, should the first term on the RHS (right hand side) of the equation for c_P [concentration of Phosphate, I guess] be divided by 2*Delta z? Since the numerator subtracts c_P[i+1] and c_P[i-1]? Not a big thing – that is not the reason for you problem.

  • I assume that the argument of time differentiation on the LHS (left hand side) of the first equation is c_P[i]?

  • It is not quite clear to me what q is. Should this, too, be q[i]?

  • Is it correct that you have - ka*(cP[i-1]-cGG[i]) in both equations? Or should one of them change sign? [This depends on the meaning of q, etc.]. Normally, with absorption, the material (c_P) goes out of one phase, and into another, so it it leaves the fluid phase where the concentration is c_P, it should probably enter the absorbent??

Anyways, since you are discretizing PDE(s), you need boundary conditions. What are these?

In summary, your system seems to be quite simple – it is stable as long as “v” (is that Greek “nu” – strange symbol for velocity) is positive.

1 Like

Is your case stiff? Are you using an implicit method for that, with sparsity handling?