YZ250F Matlab Documentation

January 22, 2019 | Author: vivekpattni | Category: Internal Combustion Engine, Engines, Rotating Machines, Mechanical Engineering, Propulsion
Share Embed Donate


Short Description

Matlab documentation details...

Description

Matlab Code NOTE: This model treats TDC as 180[degrees] and BDC as 0[degrees]. Highlighted Highlig hted n!"ts are those that #ill need to be $hanged. 1.% %Engine Inputs RPM = 10000; %Revolutions Per Minute [1/min] L = .053; %!tro"e o# Engine [m] $ = .0; %$ore o# Engine [m] l = .0&35; %Lengt' o# Engine (onne)ting Ro* [m] +,)-l = 1; %+umer o# (-lin*ers [unitless] (,r = 1.5; %(ompression Rtio [unitless] +,r = ; %+umer o# Revolutions Per Poer !tro"e t'et, = 55; %(omustion $urn 2urtion [*egrees] t'et,0 = 150; %(rn" ngle t !trt o# (omustion [*egrees] t'et,# = t'et,04t'et,; %inl (om. ngle [*egrees] I67 = 38; %7ime [*egrees] 'en Int"e 6lve (loses E67 = 310; %7ime [*egrees] 'en E9'ust 6lve :pens

These are the known engine inputs. The bore, stroke, and connecng rod lengths are used to calculate calculate the engine displacement and other parameters. parameters. The “theta” values will be altered to determine the ideal spark advance. &.% %uel Inputs ,rtio = 18.; lm* = 1; L6 = 88.e; et,)om = .&5;

%)tul ir uel Rtio :# (R 2uring 7esting [unitless] %E9)ess ir (oe##i)ient [unitless] %Loer eting 6lue :# uel Mi9ture [ = Deros; %Prello)te Amm rrgmm1> = 1.8; %!ets Initil Amm 6lues ollos (urve it> 7, =800; %ssume* ll 7emperture !uggeste* 6lue>

The atmospheric inputs should be changed based on the elevaon, temperature, etc. at the point of tesng. The wall temperature is assumed in this code, but there are several methods for predicng the wall temperature based on the equivalence rao if interested, look these up online!. (.%

This secon of code uses test values to predict the speci"c heats rao as a funcon of temperature. These coecients have been obtained e#perimentally.

).%

This block of code sets inial array values at $ero. This speeds up the code and sets inial condions. *.%

%ecause the inial condions are already set, the loop runs between & and '() the "rst loop is speci"ed in the inial condions!. The "rst poron of this block of code speci"es the di*erent crank angles, the volume, and the heat transfer surface area. +.%

“+fthen” statements specify condions in which the piece of code should operate. +n this case, the burn fracon and fuel mass equaons won-t calculate unless the crank angle falls within a certain criteria between burn iniaon and the "nal degree of burning!. 8.%

This piece of code says that the temperature and pressure only change when the intake and e#haust valves are closed. ,.%

 large poron of last part of the loop is used to calculate the speci"c heats rao. This adds comple#ity to the code, but also makes the code much more accurate. ll that needs to be known here is that the speci"c heats rao decreases with increased temperature this can change peak temperature/pressure predicons by several hundred units!. +ndicated torque, indicated power, indicated mean e*ecve pressures, etc. are all based on the equaons found in the 0eywood book. 1trange mulplicaon factors in the plot statements are simply conversion factors between 2nglish and metric systems. 10.% E-am!le O"t!"ts

Power Vs. Crank Angle (English) 30

20

10    ]       h    [   r   e   w   o 0    P

-10

-20

0

50

100

150 200 theta[deg]

250

300

350

!or"#e Vs. Crank Angle (English) 15

10

   ]    t 5    %    &    %    $    l    [   e   #   " 0   r   o    ! -5

-10

0

50

100

150 200 theta[deg]

250

300

350

The indicated power is the value that occurs at '()3degrees4. This plot was found through integraon integral of 5d6!. The e#act value can be found by viewing element '() in the “78dot” array in the 9T:% workspace!. The indicated torque can be found the same way.

ny variable can be found ne#t to the 9T:% command window. The indicated torque torque!, indicated power 78dot!, and indicated mean e*ecve pressure imep! can be found in this menu.

"ll M/T/B $ode %Fniversit- :# I*'o Engine !imultion %Fses G!ingle HoneG (omustion nl-sis it' 6rile !pe)i#i) ets Rtios %:nl- Mo*els 7'e (ompression n* E9pnsion !tro"es %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )ler ll; )lose ll; )l); %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Engine Inputs RPM = 10000; L = .053; $ = .0; l = .0&35; +,)-l = 1; (,r = 1.5;

%Revolutions Per Minute [1/min] %!tro"e o# Engine [m] %$ore o# Engine [m] %Lengt' o# Engine (onne)ting Ro* [m] %+umer o# (-lin*ers [unitless] %(ompression Rtio [unitless]

+,r = ; %+umer o# Revolutions Per Poer !tro"e t'et, = 55; %(omustion $urn 2urtion [*egrees] t'et,0 = 150; %(rn" ngle t !trt o# (omustion [*egrees] t'et,# = t'et,04t'et,; %inl (om. ngle [*egrees] I67 = 38; %7ime [*egrees] 'en Int"e 6lve (loses E67 = 310; %7ime [*egrees] 'en E9'ust 6lve :pens %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Engine (l)ultions $se* :n Previous Inputs %ssumes verge !ur#)e re In 'i)' et 7rns#er :))urs ,p = pi/8>$J; ,)' = ,p; 6,* = +,)-l,pL; + = RPM/0; !,r,p = L+;  = L/; 6,72( = 6,*/(,rB1>>/+,)-l; 6,$2( = 6,*/+,)-l>46,72(;

%(ross !e)tionl Piston re [mJ] %(-lin*er e* !ur#)e re in )'mer> %2ispl)e* 6olume :# Engine [mJ3] %(onverts RPM to RP! [1/s] %(l)ultes Men Piston !pee* [m/s] %(l)ultes (rn" R*ius 1/ stro"e>[m] %(l)ultes (lern)e 6olume [mJ3] %(-l. 6olume t $2( [mJ3]

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %uel Inputs ,rtio = 18.; lm* = 1; L6 = 88.e; et,)om = .&5;

%)tul ir uel Rtio :# (R 2uring 7esting [unitless] %E9)ess ir (oe##i)ient [unitless] %Loer eting 6lue :# uel Mi9ture [ = Deros; %Prello)te Amm rrgmm1> = 1.8; %!ets Initil Amm 6lues ollos (urve it> 7, =800; %ssume* ll 7emperture !uggeste* 6lue> %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %7'ese re Pol-nomils Fse* 7o (l)ulte Amm s  un)tion :# (rn" ngle %Pol-nomil (onstnts ,1 = .&; , = 3&.1eB0; ,3 = 5.&eB0&; ,8 = B@.eB13; ,5 = .5@eB1; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,0 = 308&.33; ,1 = B5.eB0; , = B&.5eB05; ,3 = 1.53eB0&; ,8 = B00.eB18; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ),u = .35@8; ),r = 8.1@eB03; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, *,0 = 10.810; *,1 = .@515; *,3 = B3.15; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

e,0 = B15.001e03; e,1 = B15.@3@e03; e,3 = &.13e03; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, #,0 = B.103&; #,1 = B.3@5; #,3 = .158; #,8 = B18.3; #,5 = 11@.; #, = 18.503; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, r,0 = B.&; r,1 = 11.&@; r, = B588; r,3 = B.8358; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#-ing Initil (on*itions or Loops %26K2Ket). re Reltive 7o ('nge In 7'et i.e. 26/2t'et> t'et1C30>=Deros; %!trting (rn" ngle [*eg] 61C30>=Deros; %Prello)te 6olume rr61>=6,$2(; %!trting (omustion ('mer 6olume [mJ3] 261C30> = Deros; %Prello)te ('nge In 6olume rr261> = 0; %!pe)i#-ing Initil ('nge In 6olume [mJ3 P1C30>=Deros; %Prello)te Pressure rrP1> = P,$2(; %Inlet Pressure ["P] 2P1C30> = Deros; %!pe)i#-ing Initil ('nge In Pressure 71C30>=Deros; %Prello)te 7emperture rr71> = 7,$2(; %Inlet 7emperture [?] 271C30> = Deros; %!pe)i#-ing Initil ('nge In 7emperture 1C30> = 0; %Prello)te Mss $urn rr21C30> = Deros; %Prello)te ('nge In Mss $urn r)tion [unitless] 2N1C30> = 0; %Prello)te et Relese rrN1C30>=Deros; %Prello)te et rrM,1C30> = 0; %Prello)te Mss In (omustion ('mer rrP,overR71C30> = Deros; %Prello)tes I*el As L rrP,overR71> = P1>/R,ir71>>; %Initil 6lue I*el As rrs1C30>=Deros; %Prello)tes 2istn)e (rn"/Piston 9es rrs1> = B)os*t'et1>>4sOrtlJ B Jsin*t'et1>>J>; %Initil 6l.  = ,)' 4 ,p 4 pi$l4Bs1>>; %Initil et 7rns#er re 1C30> = Deros; %Prello)te or" rr,*ot1C30> = Deros; %Prello)te Poer rr7orOue1C30> = Deros; %Prello)te 7orOue rrN,*ot1C30> = Deros; %Prello)te et 7rns#er rru1C30> = Deros; %Prello)te Internl Energ- rr*u1C30> = Deros; %Prello)tes ('nge In Internl Energ- rr)v1C30> = Deros; %Prello)tes et (p)it- rrF1C30>=Deros; %Prello)te (onstnt GFG rrF1> = .@!,r,p4.00387,$2(6,*/6,$2(>2P1>/P,$2(>; ',g1C30>=Deros; %Prello)te et 7rns#er (oe##i)ient rr',g1> = 3.P1>/1000>J.@F1>J.@$JB.>71>JB.55>; 2N,1C30>=Deros; %Prello)te (onve)tive et Loss rr%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, #or i = C30 %!pe)i#ies 7'et [*eg] (rn" ngle t'eti> = t'etiB1>41; %!pe)i#ies 2istn)e $eteen (rn"/Piston 9es s  un)tion :# t'et s = B)os*t'eti>>4sOrtlJ B Jsin*t'eti>>J>; %!pe)i#ies 6olume s  un)tion :# (rn" ngle

6i> = 6,72( 4pi/8>$J>l 4  B s>; %!pe)i#ies ('nge In 6olume s  un)tion :# (rn" ngle 26i> = 6i>B6iB1>; %!pe)i#ies I*el As Portion :# EOutions P,overR7i> = PiB1>/R,ir7iB1>>; %Instntneous !u#)e re or et 7rns#er>  = ,)' 4 ,p 4 pi$l4Bs>; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies Mss r)tion $urn s  un)tion :# (rn" ngle eie )n.> %lso !pe)i#ies Mss :# uel In (omustion ('mer s  un)tion :# %7'et

 

i# t'ett'et,0 i>=0; else i> = 1Be9pB5t'eti>Bt'et,0>/t'et,>J3>; en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!olves or InQe)te* Mss :# uel 2uring (omustion i# t'et,0 t'eti> i# t'eti>  t'et,# M,i> = 6t'et,0B1>P,overR7t'et,0B1>/lm*,rtio>; en* en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies ('nge In Mss r)tion $urn s  un)tion :# (rn" ngle 2i> = i> B iB1>; %(l)ultes et 7rns#er (oe##i)ient s  un)tion :# (rn" ngle Fi> = .@!,r,p4.00387,$2(6,*/6,$2(>2PiB1>/P,$2(>; ',gi> = 3.PiB1>/1000>J.@Fi>J.5$JB.>7iB1>JB.55>; %(l)ultes (onve)tive Losses Into ll s  un)tion :# (rn" ngle 2N,i> = ',gi>7iB1>B7,>0/piRPM>>; %(l)ultes ('nge In et 7rns#er totl> s  Fn)tion :# (rn" %ngle 2Ni> = et,)omL6M,i>2i>B2N,i>; %(l)ultes 7otl et 7rns#er Per (-)le> Ni> = NiB1>42Ni>; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

     

%!pe)i#ies Pressure n* 7emperture In)reses $eteen Int"e 6lve %(losing n* E9'ust 6lve :pening i# I67 t'eti>E67 27i>=7iB1>gmmiB1>B1>1/PiB1>6iB1>>>2Ni> ... B1/6iB1>>26i>>; 2Pi>=BPiB1>/6iB1>>26i>4PiB1>/7iB1>>27i>; Pi> = PiB1>42Pi>; en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Returns 7emperture 6lues 7o $eginning :# Loop

7i> = 7iB1>427i>; %(l)ultes (-lin*er or" [ = ,*oti>1000>/pi+>; %(l)ultes et Loss ["] s  un)tion :# (rn" ngle N,*oti> = +,)-lNi>+/1000; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, % 7'e olloing !e)tion :# (o*e (l)ultes n Fp*te* 6lue :# Amm % Fsing 7'e GPol-nomil Met'o*G 2evelope* $- ?riegerB$ormn % Fser :# 7'is (o*e Must $e (re#ul $e)use ))ur)- :# 7'is Met'o* % 2rops s 7'e uel Mi9ture $e)omes In)resingl- Ri)'

 

%(l)ultes K$ )tors or olloing $lo)" :# (o*e ,t = ,17i>4,7i>J4,37i>J34,87i>J84,57i>J5; $,t = ,04,17i>4,7i>J4,37i>J34,87i>J8; %(l)ultes )tor G2G s  un)tion :# lm* 2,lm* = *,0 4 *,1lm*JB1>4 *,3lm*JB3>; %(l)ultes )tor GG s  un)tion :# 7empertureKlm* E,7Lm* = e,0 4 e,1lm*JB1>4 e,3lm*JB3>>/7i>; ,7PLm* = #,0 4 #,1lm*JB1> 4 #,3lm*JB3> 4 ... #,8 4 #,5lm*JB1>>/7i>>>log#,Pi>>; %(l)ultes (orre)tion )tor or Internl Energu,)orr = ),ue9p2,lm* 4E,7Lm* 4 ,7PLm*>; %(l)ultes Internl Energ- s  un)tion :# (rn" ngle ui> = ,t B $,t/lm* 4 u,)orr; %(l)ultes ('nge In Internl Energ*ui> = ui> B uiB1>; %(l)ultes et (p)it- G(,vG s  un)tion :# (rn" ngle )vi> = *ui>/27i>; %(l)ultes (orre)tion )tor or GRG 6lue s  un)tion :# (rn" %ngle R,)orr = ),re9pr,0loglm*> 4 r,14r,/7i> 4 ... r,3log#,Pi>>>/lm*>; %(l)ultes )tul GRG 6lue R = .@ 4 .00/lm* 4 R,)orr; i# i=3 %(l)ultes )tul Amm 6lue n* Returns 7o $eginning :# (o*e gmmi> = 1 4 R/)vi>; en*

en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies (on*itions or Minimum n* M9imum Plot 6lues v,min = min6>; v,m9 = m96>; p,min = minP>; p,m9 = m9P>; P,min = min,*ot>; P,m9 = m9,*ot>; 7,min = min7>; 7,m9 = m97>; N,min = minN,*ot>; N,m9 = m9N,*ot>; 7min = min7orOue>; 7m9 = m97orOue>;

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Plot !ttements #igure1> plott'etK> titleSMss r)tion $urne* 6s. 7'etS > 9lelSt'et[*eg]S> -lelSMss r)tion $urne* %>S > 9is[0 30 B.1 1.1]> #igure> plott'etK6> titleS6olume 6s. (rn" ngleS > 9lelSt'et[*eg]S> -lelS6olume [mJ3]S> 9is[0 30 v,min v,m9]> #igure3> plott'etKP.000185033@> titleS(-lin*er Pressure 6s. (rn" ngle Englis'S > 9lelSt'et[*eg]S> -lelSPressure [psi]S> 9is[0 30 p,min0.000185033@ p,m90.000185033@]> #igure8> plott'etK7> titleS(-lin*er 7emperture 6s. (rn" ngleS > 9lelSt'et[*eg]S> -lelS7emperture [?]S> 9is[0 30 7,min 7,m9]> #igure5> plott'etK,*ot1.3800&> titleSPoer 6s. (rn" ngle Englis'>S > 9lelSt'et[*eg]S> -lelSPoer ['p]S> 9is[0 30 P,min1.3800& P,m91.3800&]> #igure> plott'etK7orOue0.3518&> titleS7orOue 6s. (rn" ngle Englis'>S > 9lelSt'et[*eg]S> -lelS7orOue [l##t]S> 9is[0 30 7min0.3518& 7m90.3518&]> #igure> plott'etKP.000185033@K SS> titleSPressureKPoerKn* et 7rns#erS > 'ol* on; plott'etK,*ot1.3800&K SgS> plott'etKN,*ot1.3800&K SrS> legen* Pressure Poer  9lelSt'et[*eg]S> -lelSRespe)tive Fnits psiK'p>S >

9is[0 30 P,min1.3800&B100 p,m90.000185033@]>

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF