> restart;
Starting with equation 18.3-10 (continuity) we can set d(NAz) to zero because it is not dependent on temperature.
> eq1:=D(NAz)(z)=0; Eq. 18.5-1
Now, we meed an equation for the mass flux of diffusion of A through the gas B . So, starting with Equation 17.0-1 , we can solve for NAz as a function of z.
> NAz:=z->-c*DAB*D(xA)(z)/(1-xA(z)); Eq. 18.5-3
This is where Maple becomes useful. We can insert Eq. 18.5-3 back into Eq. 18.5-1 and solve for the concentration files because we know that at z=0, xA=xAo and at z=delta (the far end of the boundary), xA=xAdel.
> s:=simplify(dsolve({eq1,xA(0)=xAo,xA(delta)=xAdel},xA(z)));
> assign(s); xA:=unapply(xA(z),z);
Now that Maple has solved for xA as a function of z (or so it would seem.. the result is hard to match up at this point to eq. 18.5-4!), we can solve for the mass flux as a function of z. If we have done the work right so far, NAz will be a constant and will not depend on z. Before we do that though, it may be convenient to try to match our concentration profile (xA(z)) with the book's concentration profile.
> check:=(1-xA(z))/(1-xAo)-((1-xAdel)/(1-xAo))^(z/delta): This is Eq. 18.5-4 from the book.
> expand(simplify(check));
This shows that our equation for xA as a function of z does correspond to the answer in the text (which would also imply that the book didn't mess up either)!
> simplify(NAz(z)); Turns out to be the same as Equation 18.5-4 despite the fact that the numerator and denominator in the log function both negative of what is written in the book. The result is the same however and NAz IS constant and does not depend on z.
The next part of this problem is to solve for the temperature profile of the system as a function of z. This will be done by starting with Eq. 18.3-10 the energy balance around the system.
> restart;
> eq:=D(eZ)(z)=0; Eq. 18.5-2.
Now we must define the energy flux using Equation 18.4-6 (we can do this because it was stated in the problem that A and B behave as ideal gases).
> eZ:=z->-k*D(T)(z)+Naz*molCpA*(T(z)-To); Eq. 18.5-7. This equation is valid because NAB in the original version cancels out and the heat can be rewritten as the molar heat capacity of gas A times the change in its original heat.
Now, as we did above, we can use Maple to insert Eq. 18.5-7 into Eq. 18.5-2 to solve for the temperature profile of the gas. We use the boundary conditions T(0)=To and T(delta)=Tdel.
> s:=dsolve({eq,T(0)=To,T(delta)=Tdel},T(z)):
Take the answer that Maple supplies for Temperature as a function of z and actually make a function T(z) that Maple will recognize and be able to put back into the equations above,
> assign(s); T:=unapply(T(z),z);
Now we want to use our function, T(z), to check Equation 18.5-8.
> check:=(T(z)-To)/(Tdel-To)-(1-exp(Naz*molCpA*z/k))/(1-exp(Naz*molCpA*delta/k)); Eq. 18.5-8 .
> expand(check):
> simplify(%,assume=positive);
Therefore, we have proven Eq. 18.5-8 since it goes to zero using our T(z) function! Our next step is to prove Equation 18.5-9 . This can be done given the fact that the heat transfer at the wall will be a function of the mass flux and heat flux is by definition : q=-k*(dT/dz). Therefore, we can define a function q at the wall as qz=-k*(dT/dz) where z=0. Then, we can divide it by the limit of itself as the mass flux goes to zero (which is what would happen at the wall).
> qz:=Naz->-k*D(T)(0);
> qz(Naz)/limit(qz(Naz),Naz=0);
This proves to be identical to Eq. 18-5.9 and so everything in this example has now been verified.
We are now going to go through Problem 18.A.
> restart;
The first thing we're going to do is go through and solve for xA as a function of z and NAz, which is what we already did above.
> eq1:=D(NAz)(z)=0; Eq. 18.5-1
> NAz:=z->-c(Tavg)*DAB*D(xA)(z)/(1-xA(z)); Eq. 18.5-3
> s:=dsolve({eq1,xA(0)=xAo,xA(delta)=xAdel},xA(z)); assign(s); xA:=unapply(xA(z),z); NAz:=simplify(NAz(z),assume=positive);
Now we will do the same thing with all the energy balances from the problem.
> eq2:=D(eZ)(z)=0; eZ:=z->-k*D(T)(z)+NAz*molCpa*(T(z)-T0); s:=dsolve({eq2,T(0)=T0,T(delta)=Tdel},T(z)): assign(s); T:=simplify(unapply(T(z),z));
> qz:=-k*D(T)(0);
> ratio:=qz/limit(qz,DAB=0);
We must now solve for all the constants used in the problem.
> c:=T->p/(Rgas*T); This is the concentration from the ideal gas law : PV=nRT and c=n/V.
> Rgas:=82.057*cm^3*atm/(mol*K); This is the gas constant.
> p:=1*atm; This is the given pressure in the problem.
> Tavg:=((65-32)/(1.8)+273.15)*K; Convert the temperature from Fahrenheit to Kelvin.
> Ohm_AB:=1.319; From data at the back of BS&L.
> DAB:=0.0018583*10^(-2)*(sqrt(291.48333333^3*(1/18+1/28.97))/(1*(3.28585)^2*Ohm_AB))*m^2/sec; Equation 16.4-13.
> c(Tavg);
> m:=100*cm; Define meters in cm units.
> xAdel:=0.018; The concentration of A at the wall.
> k:=0.0246*W/(m*K);
> molCpa:=29.09*Joule/(mol*K); This is the molar heat capacity of water.
> xAo:=0.0122; This is the saturation concentration of water in the gas at the given conditions.
> W:=Joule/sec; Define Watts as a Joules/second.
> ratio; This should (hopefully) give the answer to part 18.A, a.
This is very close to the answer given in the book. Any differences can be attributed to different constants. Also, as predicted by Example 18.5-1 , the answer is very close to unity.
The next part of the problem is to solve for qc and qd at z=0. We know that q=-k*dT/dz from earlier chapters.
> eZ(0);
> T0:=283.15*K; Tdel:=299.82*K; These are the temperatures supplied in the question.
> eZ(0); ez(0) = qc + qd . So from here, we will be able to solve for the two unknowns.
> -k*D(T)(0); This is qc because it is the heat transfer at the wall (z=0).
> eZ(0)-(-k*D(T)(0));
Therefore, we can say that qd = 0. Or almost zero.