Example 18.5-3 Pressure Diffusion

> restart;

> jz:=array(1...2); MW:=array(1...2); Vbar:=array(1...2);x:=array(1...2); We will try this using arrays to hole the values of jz, MW, Vbar and x for the two compounds.

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> for i from 1 to 2 do jz[i]:=-(c^2/rho)*MW[1]*MW[2]*D12*(diff(x[i](z),z)+MW[i]*x[i](z)/(Rgas*T)*(Vbar[i]/MW[i]-1/rho)*D(p)(z));od;

Eq. 18.4-15 with only the concentration and pressure diffusion terms for flow in the z direction.

Note that we used diff instead of the D operator since the latter will not integrate later!

[Maple Math]

[Maple Math]

> p:=z->p0-rho*gOmega*z; The pressure gradient suggested on page 576.

[Maple Math]

> eqs:=array(1...2); Making an array of equations

[Maple Math]

> for i from 1 to 2 do eqs[i]:=simplify(jz[i]*rho/(c^2*MW[1]*MW[2]*D12*x[i](z)));od; Each of these fluxes should be zero at steady state.

[Maple Math]

[Maple Math]

> eq:=Vbar[2]*eqs[1]-Vbar[1]*eqs[2]; Following a suggestion in problem 18.I.

[Maple Math]
[Maple Math]

> eq:=simplify(eq);

[Maple Math]
[Maple Math]

> int(eq,z); Maple should be able to integrate this, but gives up rather easily. We need to break it into pieces.

[Maple Math]
[Maple Math]
[Maple Math]

> Cg:=simplify(coeff(eq,gOmega));

[Maple Math]

> C0:=simplify(eq-Cg*gOmega);

[Maple Math]

> C2:=simplify(coeff(C0,Vbar[2]));

[Maple Math]

> C1:=simplify(coeff(C0,Vbar[1]));

[Maple Math]

> eq2:=Cg*gOmega+C2*Vbar[2]+C1*Vbar[1];simplify(eq2-eq); eq2 is the same as eq, but Maple can integrate it as long as the differentials were set with diff.

[Maple Math]

[Maple Math]

> eqint:=int(eq2,z); This works, but we need to combine the log terms to get Maple to agree with eq. 18.5-18.

[Maple Math]

> combine(eqint,log);

Error, (in combine) unable to combine with respect to, log

> assume(x[1](z)>0,Vbar[1]>0);

Error, (in assume) indexed names cannot be assumed

Our use of arrays seems to have been unwise! We can verify that eqint does agree with 18.5-18, but we need to use paper to do so.