<jupyter_start><jupyter_text>Setup The input file<jupyter_code># Print the input file
inputfile='ATLVINEYARD_test1.inp'
%cat ATLVINEYARD_test1.inp<jupyter_output>#---------------------------------------#
#            SIMULATION STOP            #
#---------------------------------------#
time.stop_time                 = 43200.0                        # Max (simulated) time to evolve
time.max_step                  = 172800                          # Max number of time steps
#---------------------------------------#
#         TIME STEP COMPUTATION         #
#---------------------------------------#
time.fixed_dt                  = 0.25                            # Use this constant dt if > 0
time.cfl                       = 0.95                           # CFL factor
#---------------------------------------#
#            INPUT AND OUTPUT           #
#---------------------------------------#
time.plot_interval             = 20000                           # Steps between plot files
time.checkpoint_interval       = 20000                           # Steps between checkpoint files
io.KE_int                      = 1                      [...]<jupyter_text>Plot the domainThis is what the case looks like -- it should be a 1.5km x 1.5km case with wind from 230 degrees southwest.<jupyter_code># Start the amrwind_frontend app 
tutorial2 = amrwind.MyApp.init_nogui()

# Load the input into the app
tutorial2.loadAMRWindInput(inputfile)

fig, ax = plt.subplots(figsize=(4,4), facecolor='w', dpi=150)

# Set any additional items to plot
tutorial2.popup_storteddata['plotdomain']['plot_sampleprobes']    = [] #['p_hub']
tutorial2.plotDomain(ax=ax)<jupyter_output><empty_output><jupyter_text>Postprocessing<jupyter_code># Set your run directory here
casedir = './'

# Average between 15,000 sec to 20,000 sec
#avgtimes = [950, 1050]<jupyter_output><empty_output><jupyter_text>Plot the sample planes<jupyter_code>tutorial2.Samplepostpro_loadnetcdffile(casedir+'/post_processing/sampling00000.nc')
levels =np.linspace(-10,0,41)
fig, (ax1, ax2) = plt.subplots(1,2, figsize=(6,5), gridspec_kw={'width_ratios': [1, 0.05]}, dpi=150)
im1 = tutorial2.plotSamplePlane('p_hub', 'velocityx', 300, 1, 'X','Y',ax=ax1, colorbar=False, levels=levels, cmap=cm.jet)
fig.colorbar(im1[0], cax=ax2)<jupyter_output><empty_output><jupyter_text>Plot the ABL statistics<jupyter_code>tutorial2.ABLpostpro_loadnetcdffile(casedir+'/post_processing/abl_statistics00000.nc')
timevec=[48, 72, 96, 108, 144]
# First, let's look at the hub-height averaged statistics
#tutorial2.ABLpostpro_printreport(avgt=avgtimes, avgz=plotheights)<jupyter_output><empty_output><jupyter_text>Plot scalar statistics<jupyter_code>fig, ax = plt.subplots(figsize=(4,4), facecolor='w', dpi=150)
ustar=tutorial2.ABLpostpro_plotscalars(ax=ax, plotvars=['ustar'])
ax.set_ylim([0, 0.5])<jupyter_output>ustar<jupyter_text>Plot profile statistics<jupyter_code># Plot velocity
fig, axs = plt.subplots(1,len(timevec),figsize=(2.5*len(timevec),5), facecolor='w', dpi=150, sharey=True)

for it, time in enumerate(timevec):
    ax=axs[it]
    print('Time = %0.1f'%sowfatime[time])
    SOWFA_Uhoriz = np.sqrt(sowfa_momu[time,:]**2 + sowfa_momv[time,:]**2)
    dat=tutorial2.ABLpostpro_plotprofiles(ax=ax, plotvars=['Uhoriz'], 
                                          avgt=[sowfatime[time]-5, sowfatime[time]+5], doplot=False)
    ax.plot(SOWFA_Uhoriz, zMom, label='SOWFA WRF')
    ax.plot(dat['Uhoriz']['data'], dat['Uhoriz']['z'], label='AMR-Wind')
    ax.set_xlim([0, 25])
    ax.set_xlabel('U [m/s]')
    ax.grid(linestyle=':', linewidth=0.5)
    ax.set_ylim([0,2000])
    ax.set_title('Time: %0.1f hr'%(sowfatime[time]/3600.0))
    
axs[0].legend()
axs[0].set_ylabel('z [m]')
plt.suptitle('Horizontal velocity')
# Plot temperature
#timevec=[6,12,15]
fig, axs = plt.subplots(1,len(timevec),figsize=(2.5*len(timevec),5), facecolor='w', dpi=150, sharey=True)

for it, time in enumerate(timevec):
    ax=axs[it]
    print('Time = %0.1f'%sowfatime[time])
    dat=tutorial2.ABLpostpro_plotprofiles(ax=ax, plotvars=['Temperature'], 
                                          avgt=[sowfatime[time]-5, sowfatime[time]+5], doplot=False)
    ax.plot(sowfatemp[time,:], zT, label='SOWFA WRF')
    ax.plot(dat['T']['data'], dat['T']['z'], label='AMR-Wind')
    #ax.set_xlim([0, 15])
    ax.set_xlabel('T [K]')
    ax.grid(linestyle=':', linewidth=0.5)
    ax.set_ylim([0,2000])
    ax.set_title('Time: %0.1f hr'%(sowfatime[time]/3600.0))
    
axs[0].legend()
axs[0].set_ylabel('z [m]')
plt.suptitle('Temperature')
# Plot TI
#timevec=[6,12,15]
fig, axs = plt.subplots(1,len(timevec),figsize=(2.5*len(timevec),5), facecolor='w', dpi=150, sharey=True)

for it, time in enumerate(timevec):
    ax=axs[it]
    print('Time = %0.1f'%sowfatime[time])
    dat=tutorial2.ABLpostpro_plotprofiles(ax=ax, plotvars=['TI_horiz'], 
                                          avgt=[sowfatime[time]-5, sowfatime[time]+5], doplot=False)
    ax.plot(dat['TI_horiz']['data'], dat['TI_horiz']['z'], label='AMR-Wind')
    ax.set_xlim([0, 0.11])
    ax.set_xlabel('TI [-]')
    ax.grid(linestyle=':', linewidth=0.5)
    ax.set_ylim([0,2000])
    ax.set_title('Time: %0.1f hr'%(sowfatime[time]/3600.0))
    
axs[0].legend()
axs[0].set_ylabel('z [m]')
plt.suptitle('Horizontal TI')
# Plot TKE
#timevec=[6,12,15]
fig, axs = plt.subplots(1,len(timevec),figsize=(2.5*len(timevec),5), facecolor='w', dpi=150, sharey=True)

for it, time in enumerate(timevec):
    ax=axs[it]
    print('Time = %0.1f'%sowfatime[time])
    dat=tutorial2.ABLpostpro_plotprofiles(ax=ax, plotvars=['TKE'], 
                                          avgt=[sowfatime[time]-5, sowfatime[time]+5], doplot=False)
    ax.plot(dat['TKE']['data'], dat['TKE']['z'], label='AMR-Wind')
    ax.set_xlim([0, 0.2])
    ax.set_xlabel('TKE [m^2/s^2]')
    ax.grid(linestyle=':', linewidth=0.5)
    ax.set_ylim([0,2000])
    ax.set_title('Time: %0.1f hr'%(sowfatime[time]/3600.0))
    
axs[0].legend()
axs[0].set_ylabel('z [m]')
plt.suptitle('Horizontal TI')
"""
# Plot Reynolds Stresses
fig, ax = plt.subplots(figsize=(6,6), facecolor='w', dpi=150)
REstress=tutorial2.ABLpostpro_plotprofiles(ax=ax, plotvars=['ReStresses'], avgt=avgtimes)

ax.plot(nalustressprof[:,1], nalustressprof[:,0], '--', label='Nalu-Wind uu')
ax.plot(nalustressprof[:,2], nalustressprof[:,0], '--', label='Nalu-Wind uv')

ax.legend()
#ax.set_xlim([0, 0.2])
ax.set_xlabel('Reynolds Stresses [m^2/s^2]')
ax.grid(linestyle=':', linewidth=0.5)
ax.set_ylim([0,400])
#ax.set_title('Horizontal wind speed')
"""<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20513209839052535, 'fraction_numerical': 0.044336471302763435, 'mean_word_length': 3.260672703751617, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '37579', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 2738, 'n_tokens_neox': 2522, 'n_words': 380, 'path': 'Atlantic-Vineyard/AMRWind_stable_test1/PostprocessABL.ipynb', 'repo_name': 'Exawind/wind-energy', 'size': '6586'}