![]() |
function hdif=reacte(s,tmp,in,out,rs)
% Reacte: basic energy-balance reactor module (only one exit stream)
% function hdif=reacte(s,tmp,in,out,rs)
% Basic reactor module that includes an energy balance,
% only one exit stream is allowed.
% Argument List:
% Argument Gives
% s state of the exit stream: 'v', 'l', or 's'
% tmp temperature of exit stream in Tdeg.
% in the indices of the inlet streams!
% out the index of the exit stream.
% rs the reaction rates.
% reacte returns the enthalpy of the
% exit stream minus the sum of the enthalpies
% of the inlet streams.
% EX: reacte('v',920,[1 2],3,0.225);
% For addtional help and picture see PICREACTE
% JWD, SHD & OKB, TYLC
global ne stoic
sne=size(ne);
nc=sne(2)-3;
NS=sum([ne(in,4:(nc+3));zeros(1,nc)]);
nout=NS+(rs*stoic);
j=find(abs(nout)>eps);
setne(s,out,tmp,nout(j),j)
hdif=ne(out,3)-sum(ne(in,3));
Also see The Reactor Functions: reacte, reacten. Back to Chapter 5.