Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/dev 10 18 2020 #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion GABLS/AmrWindKsgs_3p125/abl.1.inp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ time.checkpoint_interval = 10000 # Steps between checkpoint files
incflo.gravity = 0.0 0.0 -9.81 # Gravitational force (3D)
incflo.density = 1.3223 # Reference density
incflo.use_godunov = 1
incflo.use_limiter = 0
transport.viscosity = 0.0
transport.laminar_prandtl = 0.7
transport.turbulent_prandtl = 0.3333
Expand All @@ -34,7 +35,7 @@ BoussinesqBuoyancy.reference_temperature = 263.5
CoriolisForcing.east_vector = 1.0 0.0 0.0
CoriolisForcing.north_vector = 0.0 1.0 0.0
CoriolisForcing.latitude = 90.0
CoriolisForcing.rotational_time_period = 45202.77199409775
CoriolisForcing.rotational_time_period = 90405.5439881955
GeostrophicForcing.geostrophic_wind = 8.0 0.0 0.0
incflo.velocity = 8.0 0.0 0.0
ABL.reference_temperature = 263.5
Expand Down
3 changes: 2 additions & 1 deletion GABLS/AmrWindKsgs_3p125/abl.2.inp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ time.checkpoint_interval = 10000 # Steps between checkpoint files
incflo.gravity = 0.0 0.0 -9.81 # Gravitational force (3D)
incflo.density = 1.3223 # Reference density
incflo.use_godunov = 1
incflo.use_limiter = 0
transport.viscosity = 0.0
transport.laminar_prandtl = 0.7
transport.turbulent_prandtl = 0.3333
Expand All @@ -35,7 +36,7 @@ BoussinesqBuoyancy.reference_temperature = 263.5
CoriolisForcing.east_vector = 1.0 0.0 0.0
CoriolisForcing.north_vector = 0.0 1.0 0.0
CoriolisForcing.latitude = 90.0
CoriolisForcing.rotational_time_period = 45202.77199409775
CoriolisForcing.rotational_time_period = 90405.5439881955
GeostrophicForcing.geostrophic_wind = 8.0 0.0 0.0
incflo.velocity = 8.0 0.0 0.0
ABL.reference_temperature = 263.5
Expand Down
8 changes: 4 additions & 4 deletions GABLS/AmrWindKsgs_3p125/istats.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
L: 95.26891118517807
Q: -0.01221219842063447
L: 96.2029088201524
Q: -0.012129365622722894
Tsurf: 262.8750260416667
ustar: 0.2588033570460519
ustar: 0.25908353656466326
wstar: 0.0
zi: 15.450064343494661
zi: 16.00549460611608
256 changes: 128 additions & 128 deletions GABLS/AmrWindKsgs_3p125/line_average_data.csv

Large diffs are not rendered by default.

296 changes: 147 additions & 149 deletions GABLS/compareRuns_gabls.ipynb

Large diffs are not rendered by default.

46 changes: 44 additions & 2 deletions GABLS/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ def __init__(self,dir_name):
temp_file = glob.glob(dir_name+'/*temperature.dat')[0]
a = pd.read_csv(temp_file, sep='\s+', skiprows=1, names=['z','T'] )
self.T = a['T'].values

restress_file = glob.glob(dir_name+'/*reynoldsstresses.dat')[0]
a = pd.read_csv(restress_file, sep='\s+', skiprows=1, names=['z','uu', 'uv', 'uw','vv','vw','ww','tke'] )
self.vel_var = {
"z": a["z"],
"<u'u'>" : a["uu"],
"<u'v'>" : a["uv"],
"<u'w'>" : a["uw"],
"<v'v'>" : a["vv"],
"<v'w'>" : a["vw"],
"<w'w'>" : a["ww"],
}

spectra_files = glob.glob(dir_name+'/*spectra*dat')
if (len(spectra_files)>0):
self.ps_data = {
Expand Down Expand Up @@ -102,7 +113,36 @@ def __init__(self,dir_name):
# 'svv': d.variables['svv'][:,:],
# 'sww': d.variables['sww'][:,:]
# }


class AMRWind2Stats(ABLStats):
"""ABLStats class specific to AMRWind output using netcdf"""
def __init__(self,dir_name):
a = pd.read_csv(dir_name+'/line_average_data.csv')
self.z = a['z'].values
self.u = a['u'].values
self.v = a['v'].values
self.w = a['w'].values
self.hvelmag = a['hvelmag'].values
self.T = a['theta'].values
self.vel_var = {
"z": a["z"],
"<u'u'>" : a["u'u'_r"],
"<u'v'>" : a["u'v'_r"],
"<u'w'>" : a["u'w'_r"],
"<v'v'>" : a["v'v'_r"],
"<v'w'>" : a["v'w'_r"],
"<w'w'>" : a["w'w'_r"],
"<w'w'w'>": a["w'w'w'_r"]
}
self.istats = yaml.load(open(dir_name+'/istats.yaml'),Loader=yaml.BaseLoader)
with Dataset(dir_name+'/avg_spectra.nc') as d:
self.ps_data = {
'z': d.variables['z'][:],
'f': d.variables['f'][:],
'suu': d.variables['suu'][:,:],
'svv': d.variables['svv'][:,:],
'sww': d.variables['sww'][:,:]
}

class PedersonData(ABLStats):
"""ABLStats class specific to Pederson2014 data"""
Expand All @@ -126,7 +166,9 @@ def __init__(self, dir_name):
print("Reading ", glob.glob(dir_name+'/*B9*dat')[0] )
a = gabls.readdata( glob.glob(dir_name+'/*B9*dat')[0])
b = gabls.readdata( glob.glob(dir_name+'/*C9*dat')[0])
print(np.size(a[:,0]), np.size(b[:,1]))
self.vel_var = {
"z": a[:,0],
"<u'u'>" : a[:,1],
"<u'v'>" : a[:,2],
"<u'w'>" : b[:,1],
Expand Down
167 changes: 167 additions & 0 deletions Pedersen_N02/AmrWind_KSGS_NoLim_24hr/abl.1.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# SIMULATION STOP #
#.......................................#
time.stop_time = 82800.0 # Max (simulated) time to evolve
time.max_step = -1 # Max number of time steps
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# TIME STEP COMPUTATION #
#.......................................#
time.fixed_dt = 0.5 # Use this constant dt if > 0
time.cfl = 0.95 # CFL factor
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INPUT AND OUTPUT #
#.......................................#
io.KE_int = -1
io.line_plot_int = 1
time.plot_interval = 1000 # Steps between plot files
time.checkpoint_interval = 10000 # Steps between checkpoint files
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# PHYSICS #
#.......................................#
incflo.gravity = 0.0 0.0 -9.81 # Gravitational force (3D)
incflo.density = 1.0 # Reference density
incflo.use_godunov = 1
incflo.use_limiter = 0
transport.viscosity = 0.0
transport.laminar_prandtl = 0.7
transport.turbulent_prandtl = 0.3333
turbulence.model = OneEqKsgsM84
#turbulence.model = Smagorinsky
Smagorinsky_coeffs.Cs = 0.135
incflo.physics = ABL
ICNS.source_terms = BoussinesqBuoyancy CoriolisForcing GeostrophicForcing
TKE.source_terms = KsgsM84Src
BoussinesqBuoyancy.reference_temperature = 290.0
CoriolisForcing.east_vector = 1.0 0.0 0.0
CoriolisForcing.north_vector = 0.0 1.0 0.0
CoriolisForcing.latitude = 90.0
CoriolisForcing.rotational_time_period = 125663.706143592
GeostrophicForcing.geostrophic_wind = 10.0 0.0 0.0
incflo.velocity = 10.0 0.0 0.0
ABL.reference_temperature = 290.0
ABL.temperature_heights = 0.0 2000.0
ABL.temperature_values = 290.0 296.0
ABL.perturb_temperature = true
ABL.cutoff_height = 50.0
ABL.perturb_velocity = true
ABL.perturb_ref_height = 50.0
ABL.Uperiods = 4.0
ABL.Vperiods = 4.0
ABL.deltaU = 1.0
ABL.deltaV = 1.0
ABL.kappa = .41
ABL.surface_roughness_z0 = 0.01
ABL.normal_direction = 2
ABL.log_law_height = 5.29
ABL.stats_output_frequency = 100
ABL.stats_output_format = netcdf

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
amr.n_cell = 288 288 192 # Grid cells at coarsest AMRlevel
amr.max_level = 0 # Max AMR level in hierarchy
tagging.static_refinement = false
tagging.static_refinement_def = static_box.txt
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# GEOMETRY #
#.......................................#
geometry.prob_lo = 0. 0. 0. # Lo corner coordinates
geometry.prob_hi = 3000. 3000. 2000. # Hi corner coordinates
geometry.is_periodic = 1 1 0 # Periodicity x y z (0/1)
# Boundary conditions
zlo.type = "wall_model"
zlo.temperature_type = "fixed_gradient"
zlo.temperature = 0.0
zhi.type = "slip_wall"
zhi.temperature_type = "fixed_gradient"
zhi.temperature = 0.003
zlo.tke_type = "zero_gradient"
#zhi.tke_type = "zero_gradient"
incflo.verbose = 0
# MLMG settings
nodal_proj.mg_rtol = 1.0e-6
nodal_proj.mg_atol = 1.0e-12
mac_proj.mg_rtol = 1.0e-6
mac_proj.mg_atol = 1.0e-12
diffusion.mg_rtol = 1.0e-6
diffusion.mg_atol = 1.0e-12
temperature_diffusion.mg_rtol = 1.0e-10
temperature_diffusion.mg_atol = 1.0e-13

# Activate data probe sampling
incflo.post_processing = sampling

# Frequency of output for the data
sampling.output_frequency = 10
# Type of probes to output
sampling.labels = l_v11 l_v12 l_v13 l_v21 l_v22 l_v23 l_v31 l_v32 l_v33 p_h p_v1 p_v2

# Fields to output
sampling.fields = velocity temperature

# Definitions for each probe
sampling/l_v11.type = LineSampler
sampling/l_v11.num_points = 192
sampling/l_v11.start = 500.0 500.0 5.208333333333333
sampling/l_v11.end = 500.0 500.0 1994.7916666666667

sampling/l_v12.type = LineSampler
sampling/l_v12.num_points = 192
sampling/l_v12.start = 500.0 1500.0 5.208333333333333
sampling/l_v12.end = 500.0 1500.0 1994.7916666666667

sampling/l_v13.type = LineSampler
sampling/l_v13.num_points = 192
sampling/l_v13.start = 500.0 2500.0 5.208333333333333
sampling/l_v13.end = 500.0 2500.0 1994.7916666666667

sampling/l_v21.type = LineSampler
sampling/l_v21.num_points = 192
sampling/l_v21.start = 1500.0 500.0 5.208333333333333
sampling/l_v21.end = 1500.0 500.0 1994.7916666666667

sampling/l_v22.type = LineSampler
sampling/l_v22.num_points = 192
sampling/l_v22.start = 1500.0 1500.0 5.208333333333333
sampling/l_v22.end = 1500.0 1500.0 1994.7916666666667

sampling/l_v23.type = LineSampler
sampling/l_v23.num_points = 192
sampling/l_v23.start = 1500.0 2500.0 5.208333333333333
sampling/l_v23.end = 1500.0 2500.0 1994.7916666666667

sampling/l_v31.type = LineSampler
sampling/l_v31.num_points = 192
sampling/l_v31.start = 2500.0 500.0 5.208333333333333
sampling/l_v31.end = 2500.0 500.0 1994.7916666666667

sampling/l_v32.type = LineSampler
sampling/l_v32.num_points = 192
sampling/l_v32.start = 2500.0 1500.0 5.208333333333333
sampling/l_v32.end = 2500.0 1500.0 1994.7916666666667

sampling/l_v33.type = LineSampler
sampling/l_v33.num_points = 192
sampling/l_v33.start = 2500.0 2500.0 5.208333333333333
sampling/l_v33.end = 2500.0 2500.0 1994.7916666666667

sampling/p_h.type = PlaneSampler
sampling/p_h.axis1 = 1.0 0.0 0.0
sampling/p_h.axis2 = 0.0 1.0 0.0
sampling/p_h.origin = 0.0 0.0 50.0
sampling/p_h.num_points = 288 288
sampling/p_h.normal = 0.0 0.0 1.0
sampling/p_h.offsets = 0.0 50.0 150.0

sampling/p_v1.type = PlaneSampler
sampling/p_v1.axis1 = 0.0 0.0 1.0
sampling/p_v1.axis2 = 1.0 0.0 0.0
sampling/p_v1.origin = 0.0 1500.0 0.0
sampling/p_v1.num_points = 192 288

sampling/p_v2.type = PlaneSampler
sampling/p_v2.axis1 = 0.0 0.0 1.0
sampling/p_v2.axis2 = 0.0 -1.0 0.0
sampling/p_v2.origin = 1500.0 3000.0 0.0
sampling/p_v2.num_points = 192 288
Loading