Skip to main content
1-Visitor
March 5, 2012
Solved

Film Model: Sbval with multiple ODEs

  • March 5, 2012
  • 1 reply
  • 5064 views

I am trying to solve a film model for diffusion and reaction of two species (liquid film of a gas/liquid reaction). The problem I would like to solve is described in sbval_Film_Model.xmcd (attached). At the interface (x=0) CA has a known value; CB is unknown, but dCB/dx=0. At the end of the film (x=dL), CA and CB are in a sense known, but depend on dCi/dX, i.e. the amount passing through the film.

I can't assume that CA(x=dL)=0.

I'd like to somehow solve this problem using sbval to estimate CB at x=0 and a standard ODE solver to obtain the concentration profiles in the film. Eventually I would like to solve the film profiles at different points along a reactor length, meaning I need something that can be implmented in programming and doesn't use a given block. Does any one know how to setup sbval when there are two variables (CA and CB) and not just one?

Best answer by Fred_Kohlhepp

Better scaling!

Need a boundary condition.

1 reply

23-Emerald I
March 8, 2012

You might try attacking this problem using finite differences rather than SBVAL and the ODE solvers.

The first file solves a boundary value problem using finite differences. Basically a vector of solution values is guessed at, the differential equation is expressed using finite difference expressions in vector positions and the boundary values and the finite difference function are used in a solve block to find the values of the solution.

The second file develops the expression for different derivative replacement functions (forward difference, central difference, etc.)

The advantage of this method is that you can constrain the boundary (or a derivative of the function at the boundary) rather than an initial condition set (all of the ODE solvers are initial condition solvers, you need SBVAL to "guess" at the correct initial condition to arrive at the opposite boundary correct values.

I've looked at your problem, I can't develiop the equations from what I can see.

Good luck.

KHecht1-VisitorAuthor
1-Visitor
March 8, 2012

A finite difference solution would be very welcome. I tried to implement such a solution in the attached file film_model.xmcd. It's not as elegant as your proposed solution; in the red box I have to set the lowest guess value of CB (on a scale from 0 to 1) that still gives CB=1 at x=dL. I still have several problems:

1 - Boundary Condition: dCB/dx=0 @ x=0

Unfortunately, I don't know how to implement the boundary condition dCB/dx @ x=0 using this strategy. I could do this at the very first point, but at the rest of the points I would use k*CA*CB*x^2, so it wouldn't make any difference.

In another question (film_model_simplified.xmcd) I posted a solution using a solve block and odesolve but simple numbers for CA and CB at dL. Using the discretized approach, my solution looks like the left graph shown in green. If I use odesolve (or Matlab), the solutions looks like the right graph shown in white.

2- Boundary Conditions of CA and CB @ x=dL

CA and CB at x=dL aren't actually known, but depend on initial values plus dCA/dx and dCB/dx at x=dL. I assume that both of these derivatives are actually 0 at x=dL, but my professor wants me to make a model that is generally applicable and doesn't contain any assumptions. If the first point was properly addressed, this point would be rather easy to address.

3- Elements

My solution depends on the number of elements I use. Drastically. It doesn't seem to level out with an increasing number of elements.

KHecht1-VisitorAuthor
1-Visitor
March 8, 2012

green.jpgwhite.jpg