Public API
Grid
FastHydrology.AbstractHydroGrid — Type
Abstract type for the grid of a simulation.
FastHydrology.OGRectHydroGrid — Type
A struct for the Oceananigans Rectilinear grid.
Model
FastHydrology.AbstractHydroModel — Type
An abstract type for the hydrology model to be simulated. The model can hold revelant constants and model-specific fields.
FastHydrology.KazmierczakHydroModel — Type
The hydrology model described in Kazmierczak et al 2024 (https://doi.org/10.5194/tc-18-5887-2024). In our implementation here for the calculations of water flux, we make the assumption that on the grid we have Δx = Δy.
State
FastHydrology.AbstractHydroState — Type
Abstract type for a hydrology state to hold fields common to all hydrology models.
FastHydrology.HydroState — Type
The struct for the HydroState which includes physical fields important to hydrology.
Simulation
FastHydrology.AbstractSimulation — Type
Abstract type for a simulation struct. The simulation should hold important information such as model fields and constants, the grid, and a state with physically relevant fields. The method that will perform the computation for the simulation should be implemented for each subtype of AbstractSimulation.
FastHydrology.TimeSimulation — Type
A struct for time evolution simulations. For further details see the corresponding constructor.
FastHydrology.SteadyStateSimulation — Type
A struct for steady-state simulations. For further details see the corresponding constructor.
Running Simulations
FastHydrology.run! — Function
run!(sim::SteadyStateSimulation)
A function to the run a steady-state simulation.
FastHydrology.update_steady_state! — Function
update_steady_state!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the model and state variables for the Kazmierczak et al 2024 model steady-state calculation. We specifically update first the distributed water flux q, then the water layer thickness W, and then the effective pressure N.
update_steady_state!(
model::HABHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the state variable of effective pressure according to Eq. (3) of the paper Kazmierczak et al 2022 (https://doi.org/10.5194/tc-16-4537-2022). The model essentially assumes that ocean water inflitrates the ice sheet from the grounding line upwards to grounded ice regions where the bedrock is below sea level.
Water Flux
FastHydrology.update_q! — Function
update_q!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
For the Kazmierczak et al 2024 model, update the distributed water flux q [m² s⁻¹] via a recursive algorithm following Le Brocq's code for Le Brocq et al 2006 (https://doi.org/10.1016/j.cageo.2006.05.003). First we update the geometric potential that depends on the icethickness h and bedrock elevation b. Then we fill up the local minima of this potential to avoid the issue of water getting stuck. We then update the gradients of the potential in x, y. Further, we smooth these gradients with a convolution in order to incorporate the effects of the stress-gradient coupling. For the latter concept, see for example Eq. (8.98) from Cuffey & Patterson 2010 book, Eq. (15) from Kamb et al 1986, Gudmundsson 2002, and references therein. Finally, we calculate the scalar water flux out of each grid cell ψout following the aforementioned recursive algorithm from Le Brocq. To go from ψout to q, we use a correction factor, here called corfac, that can be derived using the definition of ψ_out given by Eq. (R4) of the referee reports of Kazmierczak et al 2024 (https://egusphere.copernicus.org/preprints/2024/egusphere-2024-466/egusphere-2024-466-AC1-supplement.pdf). Finally, the 0 ≤ q ≤ 1e5 is calculated, with limits set by Frank Pattyn in KORI-ULB for numerical stability.
FastHydrology.fill_halo! — Function
fill_halo!(field, grid::AbstractHydroGrid) -> Any
A function to fill the ghost points with the appropriate values for any grid. If this function is not defined for the specified grid, we inform the user with the error printed below.
fill_halo!(field, _::OGRectHydroGrid) -> Any
A function to fill the ghost points of the field input with the appropriate values, specifically for an Oceananigans RectilinearGrid.
FastHydrology.update_ϕ₀! — Function
update_ϕ₀!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the geometric potential ϕ₀ and set the values for the halo points (ghost points that handle boundary conditions automatically with Oceananigans).
FastHydrology.potential_filling! — Function
potential_filling!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState;
iterations
)
Updates ϕ₀ and consequently also updates h to reflect changes in ϕ₀. It fills the local minima of ϕ₀ to avoid water getting stuck in there.
FastHydrology.update_potential_gradients! — Function
update_potential_gradients!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid
)
Compute (the negative of) the gradients of the geometric potential ϕ₀ and its absolute value.
FastHydrology.update_smoothed_potential_gradients! — Function
update_smoothed_potential_gradients!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the smoothed geometric potentials to incorporate the effects of the stress-gradient coupling. See also the description of the update_q! function.
The water flux at a given point is influenced by variations in ice thickness some distance away. To account for this we perform a convolution of the gradient of the potential such that the influence of nearby points is now incorporated into the value of the gradient of the potential at that point.
FastHydrology.accumulate_ψ_out! — Function
accumulate_ψ_out!(
model::KazmierczakHydroModel,
i,
j,
grid::OGRectHydroGrid,
state::HydroState
) -> Any
Helper function to the recursive function to calculate the ψ_out for every grid cell that has grounded ice.
FastHydrology.update_ψ_out! — Function
update_ψ_out!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Recursive function to calculate the ψout for every grid cell that has grounded ice. We initialize ψout to -1 since it is by definition positive semi-definite and hence we know that if a grid point has negative ψ_out, it is still unvisited.
FastHydrology.update_W! — Function
update_W!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the water layer thickness W that is part of the HydroState. See Eq. (8) from Kazmierczak et al 2022.
Effective Pressure
FastHydrology.update_N! — Function
update_N!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the effective pressure N across the grid using a complementary error function transition between geometric potential and far-field effective pressure.
update_N!(
model::HABHydroModel,
grid::OGRectHydroGrid,
state::HydroState
)
Update the effective pressure N across the grid using a complementary error function transition between geometric potential and far-field effective pressure.
FastHydrology.update_Po! — Function
update_Po!(
model::Union{HABHydroModel, KazmierczakHydroModel},
grid::OGRectHydroGrid,
state::HydroState
)
Update the hydrostatic ice overburden pressure Po based on ice thickness h.
FastHydrology.update_H! — Function
update_H!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid
)
Update the conduit thickness H by calculating separate values for hard and soft beds, then interpolating based on the bed heterogeneity indicator κ.
FastHydrology.update_S_inf! — Function
update_S_inf!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid
)
Update the far-field conduit cross-sectional area S_inf using the Manning or Gauckler-Manning-Strickler flow law.
FastHydrology.update_N_inf! — Function
update_N_inf!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid
)
Update the far-field effective pressure N_inf based on conduit geometry and basal velocity, constrained by ice overburden pressure limits.
FastHydrology.update_Q! — Function
update_Q!(
model::KazmierczakHydroModel,
grid::OGRectHydroGrid
)
Update the volumetric water flux per conduit Q by scaling the distributed flux q by the characteristic channel spacing l_c.
Data Loading
FastHydrology.load_Kazmierczak — Function
load_Kazmierczak(
path::String
) -> Tuple{Any, Any, Tuple{Any, Any}, Tuple{Any, Any}, Vararg{Any, 7}}
Load a .mat file from the Kazmierczak et al. (2024) Thwaites hydrology output and return the processed fields needed for the simulation.
Arguments
path::String: path to the.matfile.
Returns
Nx, Ny: grid dimensions.xlims, ylims: grid extent in meters (cell-centered, with half-cell padding to extend to grid edge faces).mask: grounded ice mask.h: ice thickness (m).b: bed elevation (m).abs_v_b: basal velocity magnitude (m/s).A: viscocity parameter in Glen's flow law.ṁ_over_ρ_w: basal melt rate divided by water density (Kg m⁻² s⁻¹).
Utilities
FastHydrology.compute_lims — Function
compute_lims(
xc::AbstractArray,
yc::AbstractArray
) -> Tuple{Tuple{Any, Any}, Tuple{Any, Any}}
Compute the cell-centered grid limits with half-cell padding from coordinate vectors.
Arguments
xc::AbstractArray: the x values of the grid cell centers.yc::AbstractArray:
FastHydrology.perYear2perSecond — Function
perYear2perSecond(f::AbstractFloat) -> Any
Convert input float f from per year to per second.
FastHydrology.perSecond2perYear — Function
perSecond2perYear(f::AbstractFloat) -> Any
Convert input float f from per second to per year.
FastHydrology.Km2m — Function
Km2m(f::AbstractFloat) -> Any
Convert input float f from kilometers to meters.
Plotting
FastHydrology.visualize_grid — Function
visualize_grid(grid::OGRectHydroGrid) -> Figure
Visualize the Oceananigans Rectilinear grid.
FastHydrology.visualize_field — Function
visualize_field(x, y, data, mask; plot_title) -> Figure
Visualize a field.
visualize_field(
field::Oceananigans.Fields.Field,
mask;
kwargs...
) -> Figure
Visualize an Oceananigans field.