adding topo.m
[wrf-fire-matlab.git] / vis3d / fire_ros.m
blob6060526b748f51c8cd355199366c08ee88f83c47
1 function ros=fire_ros(fuel,speed,tanphi,fmc_g)
2 % ros=fire_ros(fuel,speed,tanphi)
3 % ros=fire_ros(fuel,speed,tanphi,fmc_g)
4 % in
5 %       fuel    fuel description structure
6 %       speed   wind speed
7 %       tanphi  slope
8 %       fmc_g   optional, overrides fuelmc_g from the fuel description
9 % out
10 %       ros     rate of spread
12 % given fuel params
14 windrf=fuel.windrf;               % WIND REDUCTION FACTOR
15 fgi=fuel.fgi;                     % INITIAL TOTAL MASS OF SURFACE FUEL (KG/M**2)
16 fueldepthm=fuel.fueldepthm;       % FUEL DEPTH (M)
17 savr=fuel.savr;                   % FUEL PARTICLE SURFACE-AREA-TO-VOLUME RATIO, 1/FT
18 fuelmce=fuel.fuelmce;             % MOISTURE CONTENT OF EXTINCTION
19 fueldens=fuel.fueldens;           % OVENDRY PARTICLE DENSITY, LB/FT^3
20 st=fuel.st;                       % FUEL PARTICLE TOTAL MINERAL CONTENT
21 se=fuel.se;                       % FUEL PARTICLE EFFECTIVE MINERAL CONTENT
22 weight=fuel.weight;               % WEIGHTING PARAMETER THAT DETERMINES THE SLOPE OF THE MASS LOSS CURVE
23 fci_d=fuel.fci_d;                 % INITIAL DRY MASS OF CANOPY FUEL
24 fct=fuel.fct;                     % BURN OUT TIME FOR CANOPY FUEL, AFTER DRY (S)
25 ichap=fuel.ichap;                 % 1 if chaparral, 0 if not
26 fci=fuel.fci;                     % INITIAL TOTAL MASS OF CANOPY FUEL
27 fcbr=fuel.fcbr;                   % FUEL CANOPY BURN RATE (KG/M**2/S)
28 hfgl=fuel.hfgl;                   % SURFACE FIRE HEAT FLUX THRESHOLD TO IGNITE CANOPY (W/m^2)
29 cmbcnst=fuel.cmbcnst;             % JOULES PER KG OF DRY FUEL
30 fuelheat=fuel.fuelheat;           % FUEL PARTICLE LOW HEAT CONTENT, BTU/LB
31 fuelmc_g=fuel.fuelmc_g;           % FUEL PARTICLE (SURFACE) MOISTURE CONTENT, jm: 1 by weight?
32 fuelmc_c=fuel.fuelmc_c;           % FUEL PARTICLE (CANOPY) MOISTURE CONTENT, 1
34 if exist('fmc_g','var') % override moisture content by given
35     fuelmc_g = fmc_g;
36 end
38 % computations from CAWFE code: wf2_janice/fire_startup.m4 
40 bmst     = fuelmc_g/(1+fuelmc_g);          % jm: 1 
41 fuelheat = cmbcnst * 4.30e-04;             % convert J/kg to BTU/lb
42 fci      = (1.+fuelmc_c)*fci_d;
43 fuelloadm= (1.-bmst) * fgi;                % fuelload without moisture
44                                            % jm: 1.-bmst = 1/(1+fuelmc_g) so fgi includes moisture? 
45 fuelload = fuelloadm * (.3048)^2 * 2.205;  % to lb/ft^2
46 fueldepth= fueldepthm/0.3048;              % to ft
47 betafl   = fuelload/(fueldepth * fueldens);% packing ratio  jm: lb/ft^2/(ft * lb*ft^3) = 1
48 betaop   = 3.348 * savr^(-0.8189);         % optimum packing ratio jm: units??  
49 qig      = 250. + 1116.*fuelmc_g;          % heat of preignition, btu/lb
50 epsilon  = exp(-138./savr );               % effective heating number
51 rhob     = fuelload/fueldepth;             % ovendry bulk density, lb/ft^3
52 c        = 7.47 * exp(-0.133 * savr^0.55); % const in wind coef
53 bbb      = 0.02526 * savr^0.54;            % const in wind coef
54 c        = c * windrf^bbb;                 % jm: wind reduction from 20ft per Baughman&Albini(1980)
55 e        = 0.715 * exp( -3.59e-4 * savr);  % const in wind coef
56 phiwc    = c * (betafl/betaop)^(-e); 
57 rtemp2   = savr^1.5;
58 gammax   = rtemp2/(495. + 0.0594*rtemp2);  % maximum rxn vel, 1/min
59 a        = 1./(4.774 * savr^0.1 - 7.27);   % coef for optimum rxn vel
60 ratio    = betafl/betaop;   
61 gamma    = gammax*(ratio^a)*exp(a*(1.-ratio)); % optimum rxn vel, 1/min
62 wn       = fuelload/(1 + st);              % net fuel loading, lb/ft^2
63 rtemp1   = fuelmc_g/fuelmce;
64 etam     = 1.-2.59*rtemp1 +5.11*rtemp1^2 -3.52*rtemp1^3;  % moist damp coef
65 etas     = 0.174* se^(-0.19);              % mineral damping coef
66 ir       = gamma * wn * fuelheat * etam * etas; % rxn intensity,btu/ft^2 min
67 irm      = ir * 1055./( 0.3048^2 * 60.) * 1.e-6;% for mw/m^2 (set but not used)
68 xifr     = exp( (0.792 + 0.681*savr^0.5)...
69             * (betafl+0.1)) /(192. + 0.2595*savr); % propagating flux ratio
70 %        ... r_0 is the spread rate for a fire on flat ground with no wind.
71 r_0      = ir*xifr/(rhob * epsilon *qig);  % default spread rate in ft/min
73 % computations from CAWFE code: wf2_janice/fire_ros.m4 
75 if ~ichap,
76     %       ... if wind is 0 or into fireline, phiw = 0, &this reduces to backing ros.
77     spdms = max(speed,0.);
78     umidm = min(spdms,30.);                    % max input wind spd is 30 m/s   !param!
79     umid = umidm * 196.850;                    % m/s to ft/min
80     %  eqn.: phiw = c * umid**bbb * (betafl/betaop)**(-e) ! wind coef
81     phiw = umid^bbb * phiwc;                   % wind coef
82     phis = 5.275 * betafl^(-0.3) *max(0,tanphi)^2;   % slope factor
83     ros = r_0*(1. + phiw + phis)  * .00508; % spread rate, m/s
84 else  % chapparal
85     %        .... spread rate has no dependency on fuel character, only windspeed.
86     spdms = max(speed,0.);
87     ros = max(.03333,1.2974 * spdms^1.41);       % spread rate, m/s
88 end
89 ros=min(ros,6);
90 end