Section 17.4 of BS&L: Diffusion with Homogeneous Chemical Reaction
> restart;
The area for transport is constant: call it S as BS&L do.
> WA:=z->NAz(z)*S; Mass flow at z
> eq:=WA(z)-WA(z+dz)+R(z)*S*dz; Mass balance where R is the rate of production of A by chemical reaction: mols/(time*volume)
> R:=z->-kppp*cA(z);
> deq:=-limit(eq/(S*dz),dz=0)=0; eq. 17.4-2
> NAz:=z->-DAB*D(cA)(z); eq. 17.4-3 for c constant and NBz=0.
> s:=dsolve({deq,cA(0)=cA0,D(cA)(L)=0},cA(z)):
> assign(s);
> cA:=unapply(cA(z),z);
> kppp:=b1^2*DAB/L^2; replacing kppp with b1
> C1:=z->cA(z)/cA0:
> simplify(convert(C1(z),trig));
> C2:=z->cosh(b1*(1-z/L))/cosh(b1); eq. 17.4-7
> assume(DAB>0,b1>0,L>0,z>0);
> dif:=C2(z)-C1(z):
> simplify(dif);
> simplify(convert(dif,trig)); Almost there
> simplify(convert(dif,exp)); Finally
> int(C1(z),z=0...L)/L;
> %-tanh(b1)/b1: Subtracting off 17.4-8
> simplify(convert(%,exp)); We've done this before
> NAz(0);
> simplify(%);
> simplify(%-DAB*cA0*b1*tanh(b1)/L);
> simplify(convert(%,exp)); One more time.
>