On 12/15/23 20:28, Smith Jack wrote:
> At the right boundary, the Dirichlet boundary condition is applied: c_1(x = L,
> t) = c_{10}, c_2(x = L, t) = c_{20}.
> At the left boundary, the flux of c_1, c_2 is set by:
> *\partial c_1 / \partial x (x = 0, t) = r_1(c_1, c_2)*
> *\partial c_2 / \partial x (x = 0, t) = r_2(c_1, c_2)*
> Here, r1 r2 are reactions rates solved by an ODE solver. Then how to use such
> a boundary condition ? There is no analytic expression for r1 and r2. I can
> only get them numerically
This is a nonlinear problem. Make it simpler for conceptual reasons by
assuming that you have only one species, c=c1 for the moment. Then if you
write down the weak formulation of the equation, you will see where
r(c)=r1(c1) appears in the weak form. This ends up being a situation not so
different from what step-15 does, and it is solved with the same methods as
step-15. (A better version of step-15 is step-77, but it is useful to start
with step-15 if you want to understand the concepts.)
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/