Академический Документы
Профессиональный Документы
Культура Документы
m
%
% Script file to determine the performance of a fuel inducted engine
% based on a (user-specified) arbitrary heat release profile as a
% function of crank angle.
% Method closely follows that of:
% Ferguson, C.R., 1986, "Internal Combustion Engines", Wiley.
% ********************************************************************
% input:
% enginedata.m - this is another script file that defines all of the
% relevant engine parameters and operating conditions.
% output:
% ahrind.mat - this file contains all of the variables. For plotting
% the results, see the example script file plotresults.m
% ********************************************************************
timestart=cputime;
global b stroke eps r Cblowby f fueltype airscheme phi ...
thetas thetab omega ...
heattransferlaw hcu hcb ...
Tw theta1 Vtdc Vbdc mass1 ...
p1 T1 V1
% load the engine parameters and initial conditions
enginedata
switch heattransferlaw
case 'Woschni'
if (abs(hcu) > 10)|(abs(hcb) > 10),
warning('Woschni model with weighting factor > 10')
end
end
% integration parameters
dtheta=1*pi/180;
options=odeset('RelTol',1e-3);
% integration during compression phase
disp(['integrating over the compression phase']);
[thetacomp,pTuWQlHl]=ode45('RatesComp', ...
[-pi:dtheta:thetas],[p1 T1 0 0 0],options);
% specification of initial conditions at start of combustion phase
% b - beginning of combustion
pb=interp1(thetacomp,pTuWQlHl(:,1),thetas);
Tub=interp1(thetacomp,pTuWQlHl(:,2),thetas);
Tbb=Tadiabatic(pb,Tub,phi,f,fueltype,airscheme);
Wb=interp1(thetacomp,pTuWQlHl(:,3),thetas);
Qlb=interp1(thetacomp,pTuWQlHl(:,4),thetas);
Hlb=interp1(thetacomp,pTuWQlHl(:,5),thetas);
% integration during combustion phase
disp(['integrating over the combustion phase']);
[thetacomb,pTbTuWQlHl]=ode45('RatesComb', ...
[thetas:dtheta:thetas+thetab],[pb Tbb Tub Wb Qlb Hlb],options);