Skip to content

Commit

Permalink
nonhydrostatic parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Jul 10, 2023
1 parent ca1b668 commit e9436c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 76 deletions.
67 changes: 0 additions & 67 deletions examples/vertical_slice/error.txt

This file was deleted.

19 changes: 10 additions & 9 deletions examples/vertical_slice/slice_mountain.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

# set up the mesh

nlayers = 30 # horizontal layers
base_columns = 30 # number of columns
nlayers = 35 # horizontal layers
base_columns = 90 # number of columns
L = 144e3
H = 35e3 # Height position of the model top

Expand All @@ -43,11 +43,11 @@
cv = fd.Constant(717.) # SHC of dry air at const. volume (J/kg/K)
T_0 = fd.Constant(273.15) # ref. temperature

dt = 100
dt = 1.
dT = fd.Constant(dt)

# making a mountain out of a molehill
a = 1000.
a = 10000.
xc = L/2.
x, z = fd.SpatialCoordinate(mesh)
hm = 1.
Expand Down Expand Up @@ -87,6 +87,9 @@

W = V1 * V2 * Vt # velocity, density, temperature

PETSc.Sys.Print(f"DoFs: {W.dim()}")
PETSc.Sys.Print(f"DoFs/core: {W.dim()/ensemble.comm.size}")

Un = fd.Function(W)

x, z = fd.SpatialCoordinate(mesh)
Expand All @@ -101,7 +104,7 @@
un = Un.subfunctions[0]
rhon = Un.subfunctions[1]
thetan = Un.subfunctions[2]
un.project(fd.as_vector([20.0, 0.0]))
un.project(fd.as_vector([10.0, 0.0]))
thetan.interpolate(thetab)
theta_back = fd.Function(Vt).assign(thetan)
rhon.assign(1.0e-5)
Expand Down Expand Up @@ -130,7 +133,7 @@
rho_back = fd.Function(V2).assign(rhon)

zc = H-10000.
mubar = 0.3
mubar = 0.15/dt
mu_top = fd.conditional(z <= zc, 0.0, mubar*fd.sin((pi/2.)*(z-zc)/(H-zc))**2)
mu = fd.Function(V2).interpolate(mu_top/dT)

Expand Down Expand Up @@ -186,8 +189,6 @@
for i in range(sum(time_partition)):
solver_parameters_diag["diagfft_block_"+str(i)+"_"] = lines_parameters

t = 0.

alpha = 1.0e-4
theta = 0.5

Expand Down Expand Up @@ -251,7 +252,7 @@ def window_postproc(pdg, wndw):


# solve for each window
pdg.solve(nwindows=1,
pdg.solve(nwindows=2,
preproc=window_preproc,
postproc=window_postproc)

Expand Down

0 comments on commit e9436c8

Please sign in to comment.