Section 17.2 in BS&L: Diffusion through a Stagnant Gas Film ,
From a mass balance, we will find equation 17.2-3 and thus that NAz is constant; ie. NAz(z)=NAz(z1)
> restart;
> WAz:=z->S*NAz(z); Mass transport of A at position z
> eq:=WAz(z)-WAz(z+dz); Mass balance
> deq1:=limit(eq/(S*dz),dz=0)=0;
> s:=dsolve({deq1,NAz(z1)=NAz1},NAz(z));
> assign(s);
> deq:=NAz(z)=-c*DAB*D(xA)(z)+xA(z)*NAz(z); eq 17.0-1 with NAb=0
> s:=dsolve({deq,xA(z1)=xA1},xA(z)); Solving the DE and inserting the BC @ z1
> assign(s); Assign and unapply will make a function out of xA
> xA:=unapply(xA(z),z);
> eq:=xA(z2)=xA2; The BC @ z2
> NAz1:=solve(eq,NAz1); Now we can find NAz at z1 (and for all z)
> xA1:=1-xB1; That looks like eq. 17.2-14, but we can do a little more
> xA2:=1-xB2;
> NAz1; This looks just like eq. 17.2-14 except the numerator and denominator of the ln function are reversed and the sign is changed. We need to tell Maple that xb1 and xb2 are positive reals to switch the log term.
> assume(xB1>0,xB2>0); simplify(NAz1-c*DAB*log(xB2/xB1)/(z2-z1)); This completes our proof of eq. 17.2-14.
> xA(z); Here is the way xA(z) now looks
> xBav:=int(1-xA(z),z=z1...z2)/(z2-z1); Let's get the average value of xB in the diffusing region.
> xBav:=simplify(%);
This is called the log mean value of xB.
> xBln:=%;
> NAzmaybe:=c*DAB*(xA1-xA2)/((z2-z1)*xBln); eq. 17.2-15
> NAzmaybe-NAz1; Does this agree with what we got before?
> simplify(%); We can see it does, but does Maple?
>