Skip to content

miniPBL v3.0.0

Choose a tag to compare

@samfrederick samfrederick released this 09 Feb 03:24
· 7 commits to main since this release

Extension of miniPBL from 2D x-z to full 3D x-y-z Boussinesq solver with a prognostic v velocity, Coriolis coupling on both u and v, and 3D pressure projection. The 1D and 2D modes are fully backward-compatible.

New Features

3D x-y-z Boussinesq Solver

  • Prognostic v velocity on Arakawa C-grid y-faces, alongside existing theta, u, and w
  • All arrays stored internally as (nx, ny, nz) with NetCDF output transposed to (time, z, y, x) for VisIT
  • Automatic 3D mode activation when both nx > 1 and ny > 1 in the configuration

3D Pressure Solver

  • PoissonSolver3D: 2D FFT in x and y (both periodic) + tridiagonal solve in z per wavenumber pair
  • Combined eigenvalues lambda_xy[m,n] = lambda_x[m] + lambda_y[n] for each (kx, ky) mode
  • kx=0, ky=0 mode: pressure pinned to zero (null-space treatment)
  • project_velocity_3d: 3D divergence, pressure correction for u, v, and w

3D Advection

  • Flux-form centered advection for theta, u, v, and w with y-flux terms
  • Periodic y boundary conditions via np.roll on axis=1

3D Diffusion

  • Horizontal Laplacian in x and y for cell-center and z-face fields
  • Vertical + horizontal diffusion for theta, u, v, and w
  • No-slip surface stress for both u and v

Coriolis Forcing

  • Full Coriolis coupling: du/dt += f*(v - v_geo), dv/dt += -f*(u - u_geo)
  • v interpolated to x-faces for u tendency; u interpolated to y-faces for v tendency

3D Turbulence

  • Column-by-column K-profile closure over (nx, ny) columns
  • Boundary layer height diagnosed per column: bl_height(nx, ny)

3D Boundary Conditions

  • Rigid-lid: w[:,:,0] = 0, w[:,:,-1] = 0
  • Fixed lapse rate enforcement at domain top for 3D theta fields

3D Output and Diagnostics

  • NetCDF dimensions: (time, z_center, y_center, x_center) and (time, z_face, y_center, x_center)
  • Variables: theta, u, v, w, p, heat_flux, K_h, bl_height
  • Diagnostic plots (x-z cross-sections, x-y horizontal slices, xy-averaged profiles, BL height time series)

Configuration

  • New grid parameters: ny, Ly
  • New config file: config/cbl_3d.yaml (64x64x64, dt=0.5s, 1 hour simulation)

Backward Compatibility

  • ny=1 (or omitting ny): dimensionality stays 1D or 2D; all existing code paths unchanged
  • nx > 1, ny > 1: activates 3D code paths

Dependencies

  • numpy, scipy, matplotlib, pyyaml