Skip to content

Commit f14bdc1

Browse files
committed
FDS Verification: update level_set_ellipse script to reflect fixes to level set algorithm
1 parent 82d6dcc commit f14bdc1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Utilities/Matlab/scripts/level_set_ellipse.m

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,9 @@
218218
function [phi_s_x,phi_s_y] = slope_adj(dzdx,dzdy)
219219
beta=0.01; % packing ratio (-), FDS default
220220
% Rothermel optimum packing ratio
221-
phi_s_x = sign(dzdx)*5.275*beta^-0.3*dzdx^2;
222-
phi_s_y = sign(dzdy)*5.275*beta^-0.3*dzdy^2;
221+
dzds = sqrt(dzdx^2+dzdy^2);
222+
phi_s_x = 5.275*beta^-0.3*dzdx*dzds;
223+
phi_s_y = 5.275*beta^-0.3*dzdy*dzds;
223224
end
224225

225226
% calculate virtual wind vector for slope
@@ -233,7 +234,13 @@
233234
C = 7.47*exp(-0.8711*sigma.^0.55);
234235
B = 0.15988*sigma.^0.54;
235236
E = 0.715*exp(-0.01094*sigma);
237+
phi_s=sqrt(phi_s_x^2+phi_s_y^2);
238+
if (phi_s>0)
239+
uv_tmp = 0.3048/phi_s*(phi_s/C*beta_ratio^E)^(1/B);
240+
else
241+
uv_tmp = 0;
242+
end
236243
% divide by 60 to maintain units of m/s elsewhere
237-
u_virtual = 0.3048*(phi_s_x/C*beta_ratio^E)^(1/B)/60;
238-
v_virtual = 0.3048*(phi_s_y/C*beta_ratio^E)^(1/B)/60;
244+
u_virtual = uv_tmp*phi_s_x/60;
245+
v_virtual = uv_tmp*phi_s_y/60;
239246
end

0 commit comments

Comments
 (0)