Lecture_7_notes

Lecture_7_notes - Chemical Engineering 633 Combustion...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
1 1 Chemical Engineering 633 Combustion Processes Equilibrium 2 Initial Guess: PCC 2
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 CH4 Equilibrium EPM 3 CH4 Equilibrium EPM 4
Background image of page 6
Page 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% driver.m % David Lignell % Jan 7 2010 % Solve methane equilibrium products using the element potential method. % Solve all stoichiometries on the mixture fraction domain % Code solves the given T,P problem. % Get temperatures and mixture fractions from a Cantera solution (in a file). % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− clc ; clear ; global cL cH Rg M A P Po Nsp Nel Et T ; global iCO iCO2 iH2 iH iOH iH2O iN2 iN iNO iO2 iO iCH4 ; eqMixfT = load( 'eq_mixf_T_from_cantera.dat' ) ; thermo ; % call thermo.m to load thermo data streams ; % call streams.m to load y0, y1, x0, x1 Po = 1 ; % reference pressure P = 1 ; % system pressure np = size (eqMixfT) ; np=np( 1 , 1 ) ; % number of mixture fraction points to solve Xeq = zeros (np,Nsp) ; % initialize the mole frac solution Yeq = zeros (np,Nsp) ; % initialize the mass frac solution % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− for ip = 1 :np % loop over mixture fractions mixf = eqMixfT(ip, 1 ) ; T = eqMixfT(ip, 2 ) ; ip ; yP = getPCC(mixf, y0, y1) ; % initial guess is prod complte comb. xP = y2x(yP) ; % corresponding mole fraction Et = [ xP '* A ] ' ; % Moles of elements (C,H,O,N) (constraints) lambda0 = getLambda0(mixf, xP) ; % Initial guess for Lagrange multipliers var0 = [ lambda0 ; 1 ] ; % Initial vars: lambda's and total moles %options = optimset('TolFun', 1.0E 12); %var = fsolve(@elementPotentials, var0, options); % Solve for the solution var = fsolve(@elementPotentials, var0) ; % Solve for the solution lambda = var( 1 :Nel) ; % recover the lambda's gfi = gfiTilde() ; % recover the mole fractions X = exp ( gfi 1 / Rg / T * A * lambda) ; Y = x2y(X) ; % corresponding mass fractions Xeq(ip,:) = X ' ; % append to X list for all mix fracs Yeq(ip,:) = Y ' ; end tosave = [ eqMixfT(:, 1 ) Yeq ] ; % save the data to a data file save ascii Yepm.dat tosave ; % −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− nf = np ; % also output the initial guesses to file mixf = linspace( 0 , 1 ,nf) ; mixf = eqMixfT(:, 1 ) ; Y =
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/20/2012 for the course CHE 633 taught by Professor Davido.lignel during the Winter '12 term at BYU.

Page1 / 11

Lecture_7_notes - Chemical Engineering 633 Combustion...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online