Example 15.4-2 in BS&L :
For a similar version of this example click here.
Parallel Flow :> restart;
> eqh:=w*Cph*D(Th)(z)=U0*2*Pi*r0*(Tc(z)-Th(z)); Balance on the hot side using eq. 15.4-10 and eq. 13.1-8.
> eqc:=w*Cpc*D(Tc)(z)=U0*2*Pi*r0*(Th(z)-Tc(z)); Balance on the cold side.
> s:=dsolve({eqh,eqc,Tc(0)=Tc1,Th(0)=Th1},{Tc(z),Th(z)}):
> assign(s); Th:=unapply(Th(z),z);Tc:=unapply(Tc(z),z);
Temperature changes for parallel flow:
> dT1:=simplify(Th(0)-Tc(0));
> dT2:=simplify(Th(L)-Tc(L));
> log(dT1/dT2);
> logdT12:=simplify(%,assume=positive); Agrees with eq. 15.4-14
> Cpc:=-Qh/(wc*(Tc2-Tc1)); Using eq. 15.4-9 and the fact that Qc=-Qh.
> Cph:=Qh/(wh*(Th2-Th1)); Using eq. 15.4-8.
> logdT12;
> Qc:=solve(-logdT12=logdT21,Qh); eq. 15.4-15
In this last expression, logdT21 is log(dT2/dT1) which is -log(dT1/dT2) or log((Th2-Tc2)/(Th1-Tc1)). Therefore, for parallel flow, Qc is:
> Qc:=(UA,Tc2,Tc1,Th2,Th1)->UA*((Th2-Tc2)-(Th1-Tc1))/log((Th2-Tc2)/(Th1-Tc1));
Counter Flow :
> restart;
> eqh:=w*Cph*D(Th)(z)=U0*2*Pi*r0*(Tc(z)-Th(z)); Balance on the hot side using eq. 15.4-10 and eq. 13.1-8.
> eqc:=w*Cpc*D(Tc)(z)=U0*2*Pi*r0*(Th(z)-Tc(z)); Balance on the cold side.
> s:=dsolve({eqh,eqc,Tc(0)=Tc1,Th(0)=Th1},{Tc(z),Th(z)}):
> assign(s); Th:=unapply(Th(z),z);Tc:=unapply(Tc(z),z);
Temperature changes for counter flow:
> dT1:=simplify(Th(0)-Tc(L));
> dT2:=simplify(Th(L)-Tc(0));
> log(dT1/dT2);
> logdT12:=simplify(%,assume=positive);
> Cpc:=-Qh/(wc*(Tc2-Tc1)); Using eq. 15.4-9 and the fact that Qc=-Qh.
> Cph:=Qh/(wh*(Th2-Th1)); Using eq. 15.4-8.
> logdT12;
> Qc:=solve(-logdT12=logdT21,Qh);
Therefore, for the different temperature changes for counter flow, Qc is:
> Qc:=(UA,Tc2,Tc1,Th2,Th1)->UA*((Th1-Tc2)-(Th2-Tc1))/log((Th1-Tc2)/(Th2-Tc1));