1 function plot_fuel(f,units,scale)
4 % plot_fuel(f,units,logscale)
6 % f fuel structure, as created by fuels.m
7 % units 'metric' (default)
8 % 'Scott-Burgan' (same as 'sb') ch/h and mi/h
9 % scale 'direct' (default)
10 % 'log' for loglog plots
11 % plot rate of spread against wind speed and slope
12 % from fuels.m produced by wrf-fire
13 % example: fuels; plot_fuel(fuel(3))
15 name=['Fuel model ',f.fuel_name];
18 fprintf('%s fgi = %g\n',f.fgi_descr,f.fgi)
19 fprintf('%s fuelmc_g = %g\n',f.fuelmc_g_descr,f.fuelmc_g)
20 fprintf('%s cmbcnst = %g\n',f.cmbcnst_descr,f.cmbcnst)
21 fprintf('%s weight = %g\n',f.weight_descr,f.weight)
23 fprintf('\n*** without for evaporation heat of moisture ***\n')
24 h = f.cmbcnst/(1+f.fuelmc_g);
25 fprintf('specific heat contents of fuel (J/kg) %g\n',h)
27 fprintf('heat density (J/m^2) %g\n',hd)
28 Tf=f.weight/0.8514; % fuel burns as exp(-t/Tf)
29 fprintf('initial slope of mass-loss curve (1/s) %g\n',1/Tf)
30 fprintf('maximal heat flux density (J/m^2/s) %g\n',hd/Tf)
31 fprintf('\n*** with correction for evaporation of moisture ***\n')
33 fprintf('latent heat of moisure (J/kg) %g\n',Lw)
34 hw = (f.cmbcnst - Lw*f.fuelmc_g) /(1+f.fuelmc_g);
35 fprintf('specific heat contents of fuel (J/kg) %g\n',hw)
36 fprintf('relative correction due to evaporation %g%%\n',100*(hw/h-1))
38 fprintf('heat density (J/m^2) %g\n',hd)
39 Tf=f.weight/0.8514; % fuel burns as exp(-t/Tf)
40 fprintf('initial slope of mass-loss curve (1/s) %g\n',1/Tf)
41 fprintf('maximal heat flux density (J/m^2/s) %g\n',hd/Tf)
44 Tf=f.weight/0.8514; % fuel burns as exp(-t/Tf)
56 case {'log','LOG','loglog'}
64 case {'SB','sb','Scott-Burgan'}
65 wind_unit='20ft (mi/h)';
67 wind_conv=3600/1609.344;
68 ros_conv=3600/20.1168;
70 wind_unit='6.1m (m/s)';
78 figure(1) % wind dependence
79 for i=1:length(f.wind),
80 ros_wind(i) = fire_ros(f,f.wind(i),0);
82 err_wind=big(ros_wind-f.ros_wind)
84 loglog(f.wind*wind_conv,ros_wind*ros_conv,'r',f.wind*wind_conv,f.ros_wind*ros_conv,'b')
86 plot(f.wind*wind_conv,ros_wind*ros_conv,'r',f.wind*wind_conv,f.ros_wind*ros_conv,'b')
88 xlabel(['wind speed at ',wind_unit,')'])
89 ylabel(['rate of spread (',ros_unit,')'])
93 figure(2) % slope dependence
94 for i=1:length(f.slope),
95 ros_slope(i) = fire_ros(f,0,f.slope(i));
97 err_slope=big(ros_slope-f.ros_slope)
99 loglog(f.slope,ros_slope*ros_conv,'r',f.slope,f.ros_slope*ros_conv,'b')
101 plot(f.slope,ros_slope*ros_conv,'r',f.slope,f.ros_slope*ros_conv,'b')
104 ylabel(['rate of spread (',ros_unit,')'])
105 name=['Fuel model ',f.fuel_name];
110 if(isfield(f,'fmc_g')),
114 fmc_g=f.fuelmce*[0:nsteps-1]/nsteps-2;
116 for i=1:length(fmc_g),
117 ros_fmc_g(i) = fire_ros(f,0,0,fmc_g(i));
119 if(isfield(f,'fmc_g')),
120 err_fmc_g=big(ros_fmc_g-f.ros_fmc_g)
121 plot(fmc_g,ros_fmc_g*ros_conv,'r',f.fmc_g,f.ros_fmc_g*ros_conv,'b',...
122 f.fuelmc_g,interp1(fmc_g,ros_fmc_g*ros_conv,f.fuelmc_g),'+k')
124 plot(fmc_g,ros_fmc_g*ros_conv,'b')
126 xlabel('ground fuel moisture content (1)')
127 ylabel(['rate of spread (',ros_unit,')'])
128 name=['Fuel model ',f.fuel_name];
132 fprintf('\nzero wind rate of spread %g %s\n',fire_ros(f,0,0)*ros_conv,ros_unit')
135 fprintf('\nzero wind rate of spread %g %s\n',fire_ros(f,0,0)*ros_conv,ros_unit')
139 err=big(check_ros(f));
140 fprintf('\nmax rel err in rate of spread between WRF-Fire and fire_ros.m %g\n',err)