예제 #1
0
# wStar_bar = wStar / zCLend
# Ua_bar = Ua / r

wStar_bar = wStar / Ua
Ua_bar = zCLend / r

# regR = np.polyfit(Ua_bar,wStar_bar,1,full=True)
# print('Sum of residuals: %0.2d' %regR[1][0])

fig = plt.figure(figsize=(12, 6))
plt.suptitle('DIMENSIONLESS ANALYSIS')
plt.subplot(1, 2, 1)
plt.scatter(Ua_bar,
            wStar_bar,
            c=plume.read_tag('F', RunList),
            cmap=plt.cm.tab20)
# plt.xlabel(r'$\frac{H}{\Gamma * z_i * w_*}$')
# plt.ylabel(r'$\frac{z_{CL}}{z_i}$ ')
plt.colorbar()

plt.subplot(1, 2, 2)
plt.scatter(Ua_bar,
            wStar_bar,
            c=plume.read_tag('R', RunList),
            cmap=plt.cm.nipy_spectral)
# plt.xlabel(r'$\frac{H}{\Gamma * z_i * w_*}$')
# plt.ylabel(r'$\frac{z_{CL}}{z_i}$ ')
plt.colorbar()

plt.subplots_adjust(top=0.85)
예제 #2
0
    # ---heat flux
    axh3 = ax3.twinx()
    ln = axh3.plot(np.arange(dimX)*plume.dx, avedict['ghfx'], 'r-')
    axh3.set_ylabel('ground heat flux $[kW m^{-2}]$', color='r')
    axh3.set_ylim([0,150])
    axh3.tick_params(axis='y', colors='red')
    axh3.set_xlim([0,dimX*plume.dx])

    plt.subplots_adjust(top=0.85)
    plt.tight_layout(rect=[0, 0, 1, 0.95])
    plt.savefig(plume.figdir + 'averages/ave%s' %Case)
    print('.....-->saved in: %s' %(plume.figdir + 'averages/ave%s' %Case))
    plt.close()

#---------------------calculations over all plumes--------------
Rtag = np.array([i for i in plume.read_tag('R',RunList)])  #list of initialization rounds (different soundings)
#WHAT LEVEL TO PICK FOR defining characteristic U
# print('Variability of normalized intensity for given U level:')
# print('%d.2' %np.std(parcelHeat))

#-------------subplots of tilt predictors-----------
#create scatter plots of tilts vs other variables
plt.figure(figsize=(18,6))
plt.subplot(1,3,1)
plt.title('FIRELINE INTENSITY vs TILT')
ax1 = plt.scatter(parcelHeat,plumeTilt,c=BLdict['Ua'],cmap=plt.cm.viridis)
plt.xlabel('fireline intensity [kW/m]')
plt.ylabel('plume tilt')
plt.colorbar(ax1,label='windspeed [m/s]')

plt.subplot(1,3,2)
예제 #3
0
    #locate centerline
    ctrZidx = pm.argmax(0)  #locate maxima along height
    ctrXidx = pm.argmax(1)  #locate maxima downwind
    pmCtr = np.array([pm[ctrZidx[nX], nX] for nX in range(dimX)
                      ])  #get concentration along the centerline

    xmax, ymax = np.nanargmax(ctrZidx), np.nanmax(
        ctrZidx)  #get location of maximum centerline height
    centerline = ma.masked_where(
        pmlvl[ctrZidx] == 0, pmlvl[ctrZidx]
    )  #make sure centerline is only calculated inside the plume
    centerline.mask[:int(1000 / plume.dx)] = True
    # smoothCenterline = savgol_filter(centerline, 51, 3)             # smooth centerline height (window size 31, polynomial order 3)

    filter_window = max(int(plume.read_tag('W', [Case]) * 10 + 1), 51)
    smoothCenterline = savgol_filter(
        centerline, filter_window,
        3)  # smooth centerline height (window size 31, polynomial order 3)

    #calculate concentration changes along the centerline
    dPMdX = pmCtr[1:] - pmCtr[0:-1]
    # smoothPM = savgol_filter(dPMdX, 101, 3) # window size 101, polynomial order 3
    smoothPM = savgol_filter(dPMdX, filter_window,
                             3)  # window size 101, polynomial order 3

    # stablePMmask = [True if abs(smoothPM[nX])< np.nanmax(smoothPM)*0.05 and nX > np.nanargmax(smoothPM) else False for nX in range(dimX-1) ]
    stablePMmask = [True if abs(smoothPM[nX])< np.nanmax(smoothPM)*0.1 and \
                            abs(smoothCenterline[nX+1]-smoothCenterline[nX]) < 5 and \
                            nX > np.nanargmax(centerline[~centerline.mask][:-50]) and\
                            nX > np.nanargmax(smoothPM) and\
예제 #4
0
# plt.show()
# # plt.savefig(plume.figdir + 'DimAnalysis.pdf' )
# plt.close()

tilt = Phi / (zi * Ti * Ua)
#now plot zCl as a function of w*
wStar = (g * Phi * zi / (Omega))**(1 / 3.)
slope, intercept, r_value, p_value, std_err = linregress(
    wStar[np.isfinite(wStar)], zCL[np.isfinite(wStar)])
print('Sum of residuals: %0.2f' % r_value)

fig = plt.figure(figsize=(12, 6))
plt.suptitle('zCL=FCN($w_{f*}$): R = %.2f' % r_value)
plt.subplot(1, 2, 1)
ax1 = plt.gca()
plt.scatter(wStar, zCL, c=plume.read_tag('W', RunList), cmap=plt.cm.jet)
plt.plot(wStar, intercept + slope * wStar, c='grey')
plt.colorbar(label='Ua wind speed [m/s]')
ax1.set(xlabel='$w_{f*}$ [m/s]', ylabel='zCL [m]')
plt.subplot(1, 2, 2)
ax2 = plt.gca()
plt.scatter(wStar, zCL, c=FI, cmap=plt.cm.RdYlGn_r)
# plt.scatter(wStar[FlaggedCases],zCL[FlaggedCases],c='purple')
plt.colorbar(label='total 2D burn intensity')
for i, txt in enumerate(RunList):
    if i in FlaggedCases:
        ax2.annotate(txt, (wStar[i], zCL[i]), fontsize=6, color='red')
    else:
        ax2.annotate(txt, (wStar[i], zCL[i]), fontsize=6)
ax2.set(xlabel='$w_{f*}$ [m/s]', ylabel='zCL [m]')
plt.subplots_adjust(top=0.85)
예제 #5
0
                       linewidths=0.8)
    axh3 = ax3.twinx()
    axh3.set_ylabel('ground heat flux $[kW m^{-2}]$', color='r')
    axh3.tick_params(axis='y', colors='red')
    axh3.set(ylim=[0, 150], xlim=[0, haxis[-1]])
    ln = axh3.plot(haxis, avedict['ghfx'], 'r-')
    plt.tight_layout(rect=[0, 0, 1, 0.95])

    plt.savefig(plume.figdir + 'fixedAspectAverages/ave%s.pdf' % Case)
    print('.....-->saved in: %s' %
          (plume.figdir + 'fixedAspectAverages/ave%s.pdf' % Case))
    # plt.show()
    plt.close()

#---------------------calculations over all plumes--------------
Rtag = np.array([i for i in plume.read_tag('R', RunList)
                 ])  #list of initialization rounds (different soundings)
Ftag = np.array([i for i in plume.read_tag('F', RunList)])
#WHAT LEVEL TO PICK FOR defining characteristic U
# print('Variability of normalized intensity for given U level:')
# print('%d.2' %np.std(parcelHeat))

#-------------subplots of tilt predictors-----------
#create scatter plots of tilts vs other variables
plt.figure(figsize=(18, 6))
plt.subplot(1, 3, 1)
plt.title('FIRELINE INTENSITY vs TILT')
ax1 = plt.scatter(parcelHeat, plumeTilt, c=BLdict['Ua'], cmap=plt.cm.viridis)
plt.xlabel('parcel heat [K m]')
plt.ylabel('plume tilt')
plt.colorbar(ax1, label='windspeed [m/s]')
예제 #6
0
        plt.close()

        #get plume edges
        edge1 = np.nanargmin(abs(NcrosszCL[:int(dimY/2)] - 0.025)) * plume.dy
        edge2 = (np.nanargmin(abs(NcrosszCL[int(dimY/2):] - 0.025)) + int(dimY/2))* plume.dy
        dist1 = 4000 - edge1
        dist2 = edge2 - 6000
        dropoff[nCase] = np.mean([dist1,dist2])
        Phi[nCase] = plumes['Phi'][runNumber]
        # wf[nCase] = Phi[nCase]/(plumes['zi'][runNumber] * plumes['Omega'][runNumber])
        wf[nCase] = (9.81 * Phi[nCase] * (plumes['zCL'][runNumber] - 0.75 * plumes['zi'][runNumber] )/ (plumes['zi'][runNumber] * plumes['thetaS'][runNumber]))**(1/3.)

        span[nCase] = (edge2-edge1)/2.
xaxis = np.arange(0,np.nanmax(Phi))
plt.title('PLUME WIDENING')
plt.scatter(Phi,dropoff,c=plume.read_tag('F',RunList))
plt.plot(xaxis, 1000+xaxis*(2500)/(140000),c='C1',ls='--',label='linear fit')
plt.gca().set(xlabel=r'fireline intensity [K m$^2$s$^{-1}$]',ylabel='plume widening [m]')
plt.legend()
plt.savefig(plume.figdir + 'lateral/Widening.pdf')
plt.show()

plt.figure()
xaxis = np.arange(0,np.nanmax(Phi))
plt.title('PLUME WIDENING')
plt.scatter(wf,span,c=plume.read_tag('F',RunList))
plt.gca().set(xlabel=r'$w_f$',ylabel='plume span [m]')
plt.legend()
fitWf = linregress(wf[np.isfinite(wf)], span[np.isfinite(span)])

#======================compare conditions:Legth===================
예제 #7
0
    Ua[nCase] = np.mean(U0[si:10])  #ambient BL wind

    #analysis with w*
    # wStar[nCase] = (g*zi[nCase]*H[nCase]/Ti[nCase])**(1/3.)
    wStar[nCase] = (g * zi[nCase] * 0.2 / Ti[nCase])**(1 / 3.)

H_bar = H / (Gamma * wStar * zi)
zCL_bar = zCLend / zi
Ua_bar = (Ua * zi) / (r * wStar)

fig = plt.figure(figsize=(12, 4))
plt.suptitle('DIMENSIONLESS ANALYSIS')
plt.subplot(1, 3, 1)
plt.scatter(H_bar,
            zCL_bar,
            c=plume.read_tag('R', RunList),
            cmap=plt.cm.viridis)
plt.xlabel(r'$\frac{H}{\Gamma * z_i * w_*}$')
plt.ylabel(r'$\frac{z_{CL}}{z_i}$ ')
plt.colorbar()

plt.subplot(1, 3, 2)
plt.scatter(H_bar, Ua_bar, c=plume.read_tag('F', RunList), cmap=plt.cm.tab20)
plt.xlabel(r'$\frac{H}{\Gamma * z_i * w_*}$')
plt.ylabel(r'$\frac{U_a * z_i}{r * w_*}$')

plt.subplot(1, 3, 3)
plt.scatter(Ua_bar, zCL_bar, c=plume.read_tag('F', RunList), cmap=plt.cm.tab20)
plt.xlabel(r'$\frac{U_a * z_i}{r * w_*}$')
plt.ylabel(r'$\frac{z_{CL}}{z_i}$ ')
plt.colorbar(label='fuel category')
예제 #8
0
    T0interp = interpT(interpZ)

    #mask plume with cutoff value---------------------------------
    dimT, dimZ, dimX = np.shape(csdict['temp'])     #get shape of data
    zi[nCase] = plume.get_zi(T0)                    #calculate BL height

    pm = ma.masked_where(csdict['pm25'][-1,:,:] <= plume.PMcutoff, csdict['pm25'][-1,:,:] ) #mask all non-plume cells

    #locate centerline
    ctrZidx = pm.argmax(0)                          #locate maxima along height
    ctrXidx = pm.argmax(1)                          #locate maxima downwind
    pmCtr = np.array([pm[ctrZidx[nX],nX] for nX in range(dimX)])    #get concentration along the centerline

    xmax,ymax = np.nanargmax(ctrZidx), np.nanmax(ctrZidx)           #get location of maximum centerline height
    centerline = ma.masked_where(plume.lvltall[ctrZidx] == 0, plume.lvltall[ctrZidx])               #make sure centerline is only calculated inside the plume
    filter_window = max(int(plume.read_tag('W',[Case])*10+1),51)
    smoothCenterline = savgol_filter(centerline, filter_window, 3)             # smooth centerline height (window size 31, polynomial order 3)

    #calculate concentration changes along the centerline
    dPMdX = pmCtr[1:]-pmCtr[0:-1]
    smoothPM = savgol_filter(dPMdX, filter_window, 3) # window size 101, polynomial order 3

    stablePMmask = [True if abs(smoothPM[nX])< np.nanmax(smoothPM)*0.1 and \
                            abs(smoothCenterline[nX+1]-smoothCenterline[nX]) < 5 and \
                            nX > np.nanargmax(centerline[~centerline.mask][:-50]) and\
                            nX > np.nanargmax(smoothPM) and\
                            nX > np.nanargmax(centerline) +10 and
                            centerline[nX] < plume.lvltall[-1]-200 and \
                            nX > np.nanargmax(smoothCenterline)+10 else \
                            False for nX in range(dimX-1) ]
    if sum(stablePMmask) == 0:
    #mask plume with cutoff value---------------------------------
    dimT, dimZ, dimX = np.shape(csdict['temp'])     #get shape of data
    zi[nCase] = plume.get_zi(T0)                    #calculate BL height

    pm = ma.masked_where(csdict['pm25'][-1,:,:] <= plume.PMcutoff, csdict['pm25'][-1,:,:] ) #mask all non-plume cells


    #locate centerline
    ctrZidx = pm.argmax(0)                          #locate maxima along height
    ctrXidx = pm.argmax(1)                          #locate maxima downwind
    pmCtr = np.array([pm[ctrZidx[nX],nX] for nX in range(dimX)])    #get concentration along the centerline

    xmax,ymax = np.nanargmax(ctrZidx), np.nanmax(ctrZidx)           #get location of maximum centerline height
    centerline = ma.masked_where(plume.lvltall[ctrZidx] == 0, plume.lvltall[ctrZidx])               #make sure centerline is only calculated inside the plume
    # smoothCenterline = savgol_filter(centerline, 71, 3)             # smooth centerline height (window size 31, polynomial order 3)
    filter_window = max(int(plume.read_tag('W',[Case])*10+1),51)

    smoothCenterline = savgol_filter(centerline, filter_window, 3)             # smooth centerline height (window size 31, polynomial order 3)


    #calculate concentration changes along the centerline
    dPMdX = pmCtr[1:]-pmCtr[0:-1]
    # smoothPM = savgol_filter(dPMdX, 101, 3) # window size 101, polynomial order 3

    smoothPM = savgol_filter(dPMdX, filter_window, 3) # window size 101, polynomial order 3

    stablePMmask = [True if abs(smoothPM[nX])< np.nanmax(smoothPM)*0.1 and \
                            abs(smoothCenterline[nX+1]-smoothCenterline[nX]) < 5 and \
                            nX > np.nanargmax(centerline[~centerline.mask][:-50]) and\
                            nX > np.nanargmax(smoothPM) and\
                            nX > np.nanargmax(centerline) +10 and