Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
4471c04
try it out
simone-silvestri Feb 25, 2025
dcf8162
almost done
simone-silvestri Feb 25, 2025
0e428a7
better
simone-silvestri Feb 25, 2025
acbfb10
complete Bgrid rheology
simone-silvestri Feb 25, 2025
f855c8b
kind of works?
simone-silvestri Feb 25, 2025
3cd0dc6
adapt
simone-silvestri Feb 25, 2025
05147ad
add
simone-silvestri Feb 26, 2025
30cd58b
will this work?
simone-silvestri Mar 3, 2025
31751e4
remove the show
simone-silvestri Mar 3, 2025
94c3aa2
bump to 0.2.1
simone-silvestri Mar 3, 2025
f840534
add this
simone-silvestri Mar 3, 2025
5bbb1ac
Merge branch 'ss/new-thermodynamic-timestep' of github.com:CliMA/Clim…
simone-silvestri Mar 3, 2025
f8739e5
make sure we do not mask point 1 but the top
simone-silvestri Mar 4, 2025
b27d6b8
bugfix
simone-silvestri Mar 4, 2025
b0843b0
update
simone-silvestri Mar 4, 2025
5643b95
start separating the two
simone-silvestri Mar 4, 2025
35af721
will this work?
simone-silvestri Mar 4, 2025
57fd25d
comment
simone-silvestri Mar 4, 2025
e3031d4
completely melt the ice
simone-silvestri Mar 4, 2025
74b07c0
adjust the thermodynamic step
simone-silvestri Mar 4, 2025
4cc60e6
will this work?
simone-silvestri Mar 4, 2025
2cd8cc2
some bugfixes
simone-silvestri Mar 4, 2025
70746a1
add freezing bucket
simone-silvestri Mar 4, 2025
5807494
remove the show
simone-silvestri Mar 4, 2025
5317586
adapt freezing bucket
simone-silvestri Mar 4, 2025
a9040d1
comment
simone-silvestri Mar 4, 2025
23c1576
add a comment for tomorrow
simone-silvestri Mar 4, 2025
4f3b3c9
this should work
simone-silvestri Mar 5, 2025
e928864
this works!
simone-silvestri Mar 5, 2025
b9b8836
Merge branch 'main' into ss/new-thermodynamic-timestep
simone-silvestri Mar 5, 2025
c9859ba
remove the show methods
simone-silvestri Mar 5, 2025
a518b5d
Merge branch 'ss/new-thermodynamic-timestep' of github.com:CliMA/Clim…
simone-silvestri Mar 5, 2025
af21933
fix examples
simone-silvestri Mar 5, 2025
0db4a5f
add freezing in winter
simone-silvestri Mar 5, 2025
f4ab9e7
new example
simone-silvestri Mar 5, 2025
632bd81
better
simone-silvestri Mar 5, 2025
e70f38a
only 10 days
simone-silvestri Mar 5, 2025
d6113ba
make
simone-silvestri Mar 5, 2025
d633392
keep a "thermodynamic_tendency"
simone-silvestri Mar 5, 2025
522656f
maybe a bit smaller font
simone-silvestri Mar 5, 2025
81c672b
fix examples
simone-silvestri Mar 5, 2025
331f198
correct examples
simone-silvestri Mar 5, 2025
8fc86f5
Merge remote-tracking branch 'origin/main' into ss/b-grid-dynamics
simone-silvestri Mar 6, 2025
37816a7
Merge remote-tracking branch 'origin/ss/new-thermodynamic-timestep' i…
simone-silvestri Mar 6, 2025
2869815
add this
simone-silvestri Mar 6, 2025
796459e
add it
simone-silvestri Mar 6, 2025
f02692c
add it
simone-silvestri Mar 6, 2025
274b8d9
improve
simone-silvestri Mar 6, 2025
82e3a7c
add this
simone-silvestri Mar 7, 2025
e2d7bea
Update freezing_of_a_lake.jl
simone-silvestri Mar 7, 2025
b935dff
formatting
simone-silvestri Mar 8, 2025
a2477ce
some fixes
simone-silvestri Mar 10, 2025
d543278
hmm, not sure heat capacity is consistent here
simone-silvestri Mar 10, 2025
6aa378c
add to examples?
simone-silvestri Mar 13, 2025
e169eca
the seasonal cycle is not that well predicted I guess
simone-silvestri Mar 13, 2025
bf42993
Merge branch 'main' into ss/fix-examples
simone-silvestri Mar 13, 2025
499e4ff
add this
simone-silvestri Mar 13, 2025
75a3f25
Merge branch 'ss/fix-examples' of github.com:CliMA/ClimaSeaIce.jl int…
simone-silvestri Mar 13, 2025
fd8e294
the fluxes have wrong signs
simone-silvestri Mar 13, 2025
876c2f4
missing a minus and a conversion factor
simone-silvestri Mar 13, 2025
b56dca3
some error in the table
simone-silvestri Mar 13, 2025
c033058
muuuch better
simone-silvestri Mar 13, 2025
b857445
much better
simone-silvestri Mar 13, 2025
1b05402
fix examples
simone-silvestri Mar 13, 2025
fdeab12
add ice salinity
simone-silvestri Mar 13, 2025
a209c01
ok this works
simone-silvestri Mar 13, 2025
bc16771
small fix
simone-silvestri Mar 13, 2025
6cb53a5
cairomakie
simone-silvestri Mar 20, 2025
6414056
fix examples
simone-silvestri Mar 20, 2025
07656ab
energy budget
simone-silvestri Mar 20, 2025
e95488b
add an energy budgets
simone-silvestri Mar 20, 2025
cf5a04b
Update src/SeaIceThermodynamics/slab_thermodynamics_tendencies.jl
simone-silvestri Mar 24, 2025
bde6e04
this should work
simone-silvestri Mar 25, 2025
e522985
Merge branch 'ss/fix-examples' of github.com:CliMA/ClimaSeaIce.jl int…
simone-silvestri Mar 25, 2025
2d3b1c7
add a change to conc
simone-silvestri Mar 25, 2025
9357d19
Merge remote-tracking branch 'origin/main' into ss/b-grid-dynamics
simone-silvestri Mar 26, 2025
946fca4
remove ice salinity from there
simone-silvestri Mar 26, 2025
13a69d0
fix the examples
simone-silvestri Mar 26, 2025
b41e338
improve
simone-silvestri Mar 26, 2025
bff5717
Merge remote-tracking branch 'origin/ss/fix-examples' into ss/b-grid-…
simone-silvestri Mar 26, 2025
a0bc65f
change name
simone-silvestri Mar 26, 2025
855b721
try it out
simone-silvestri Mar 26, 2025
aeab0f4
fixes
simone-silvestri Mar 26, 2025
fac6c5e
step tracers
simone-silvestri Mar 26, 2025
589bdef
adding ice_salinity
simone-silvestri Mar 26, 2025
7ae099f
take off the salinity from here
simone-silvestri Mar 26, 2025
7ada6a4
this should work
simone-silvestri Mar 26, 2025
7bd550f
merge here
simone-silvestri Mar 26, 2025
b4a4933
remove IS
simone-silvestri Mar 26, 2025
1908e9a
just remove it for now
simone-silvestri Mar 26, 2025
99279ba
full tau
simone-silvestri Mar 26, 2025
981d0f0
change name
simone-silvestri Mar 26, 2025
11a963a
bugfix
simone-silvestri Mar 27, 2025
9b49ed6
Merge remote-tracking branch 'origin/main' into ss/b-grid-dynamics
simone-silvestri May 1, 2025
87382c3
Merge remote-tracking branch 'origin/main' into ss/b-grid-dynamics
simone-silvestri May 1, 2025
c56616a
space
simone-silvestri May 1, 2025
73e0f46
more changes
simone-silvestri May 1, 2025
4b9d9ca
we can remove all this
simone-silvestri May 1, 2025
6f8237d
no more immersed stresses
simone-silvestri May 1, 2025
77712d6
better
simone-silvestri May 1, 2025
d524160
add ice salinity
simone-silvestri May 1, 2025
a9731ab
bugfix
simone-silvestri May 1, 2025
a3c8db5
adding
simone-silvestri May 5, 2025
90a0499
ice_thermodynamics
simone-silvestri May 5, 2025
64e37f5
do not use max(d, dm)
simone-silvestri May 5, 2025
d4aec31
remove BBM for the moment
simone-silvestri May 5, 2025
7c2c06f
actually need this regularization
simone-silvestri May 5, 2025
f558138
som fixes
simone-silvestri May 6, 2025
1fce552
not here for the moment
simone-silvestri May 6, 2025
8796748
fix tests
simone-silvestri May 6, 2025
fe39196
no need for these
simone-silvestri May 6, 2025
17837a5
some more fixes
simone-silvestri May 6, 2025
28e91a7
fixes for viscous rheology
simone-silvestri May 6, 2025
e97332d
bugfix
simone-silvestri May 6, 2025
0ba55eb
some corrections
simone-silvestri May 6, 2025
dddf06d
fix the symmetric advection
simone-silvestri May 6, 2025
89f7297
fix docs
simone-silvestri May 6, 2025
459be18
fix the momentum tendencies
simone-silvestri May 6, 2025
eb8a3f9
remove bbm for now
simone-silvestri May 6, 2025
92639cf
correct the tendencies
simone-silvestri May 14, 2025
86fff9a
add this
simone-silvestri May 14, 2025
d9e56ac
do this
simone-silvestri May 14, 2025
e499919
heal the damage
simone-silvestri May 14, 2025
7cd7a68
remove useless stuff
simone-silvestri May 14, 2025
f71e52d
change stepping
simone-silvestri May 14, 2025
7375d3d
forgot the units
simone-silvestri May 14, 2025
6ac3f41
no need for an additional parameter, FT is enough
simone-silvestri May 14, 2025
0e0e867
do not heal damage if we do not change T
simone-silvestri May 14, 2025
d96afef
just fill the halo regions
simone-silvestri May 14, 2025
efe7264
fill the halo regions of the principal stresses
simone-silvestri May 14, 2025
796bcfc
remove useless code
simone-silvestri May 15, 2025
9fa0887
advance tracer tendencies
simone-silvestri May 15, 2025
c5cc4c3
another bugfix
simone-silvestri May 15, 2025
8de928a
probably better?
simone-silvestri May 15, 2025
b12822d
Merge branch 'main' into ss/bbm-rheology
simone-silvestri May 15, 2025
9c6c6a0
Merge branch 'main' into ss/b-grid-dynamics
simone-silvestri May 21, 2025
cf69950
Merge branch 'main' into ss/b-grid-dynamics
simone-silvestri May 28, 2025
a4bba27
Merge branch 'main' into ss/bbm-rheology
simone-silvestri May 28, 2025
26d5785
Merge remote-tracking branch 'origin/main' into ss/b-grid-dynamics
simone-silvestri Jun 3, 2025
f71b8c7
adapting
simone-silvestri Jun 3, 2025
53c0d8f
Merge branch 'ss/b-grid-dynamics' into ss/bbm-rheology
simone-silvestri Jun 3, 2025
0ceef9a
improve examples
simone-silvestri Jun 3, 2025
497c153
Merge branch 'main' into ss/bbm-rheology
simone-silvestri Jun 18, 2025
1580b56
Merge branch 'main' into ss/bbm-rheology
simone-silvestri Jul 14, 2025
3c1be8b
Update ice_advected_on_coastline.jl
simone-silvestri Jul 14, 2025
9e63aef
Update ice_advected_by_anticyclone.jl
simone-silvestri Jul 14, 2025
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
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ example_scripts = [
"melting_in_spring.jl",
"freezing_of_a_lake.jl",
"ice_advected_by_anticyclone.jl",
# "ice_advected_on_coastline.jl",
"ice_advected_on_coastline.jl",
"arctic_basin_seasonal_cycle.jl"
]

Expand All @@ -31,7 +31,7 @@ example_pages = [
"Melting in Spring" => "literated/melting_in_spring.md",
"Freezing of a Lake" => "literated/freezing_of_a_lake.md",
"Ice advected by anticyclone" => "literated/ice_advected_by_anticyclone.md",
# "Ice advected on coastline" => "literated/ice_advected_on_coastline.md",
"Ice advected on coastline" => "literated/ice_advected_on_coastline.md",
"Arctic basin seasonal cycle" => "literated/arctic_basin_seasonal_cycle.md"
]

Expand Down
6 changes: 3 additions & 3 deletions examples/freezing_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ top_heat_boundary_condition = PrescribedTemperature(-10)
# slab sea ice representation of ice_thermodynamics

ice_thermodynamics = SlabSeaIceThermodynamics(grid;
internal_heat_flux,
phase_transitions,
top_heat_boundary_condition)
internal_heat_flux,
phase_transitions,
top_heat_boundary_condition)

# We also prescribe a frazil ice heat flux that stops when the ice has reached a concentration of 1.
# This heat flux represents the initial ice formation from a liquid bucket.
Expand Down
39 changes: 25 additions & 14 deletions examples/ice_advected_by_anticyclone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ L = 512kilometers

# 2 km domain
grid = RectilinearGrid(arch;
size = (128, 128),
size = (256, 256),
x = (0, L),
y = (0, L),
halo = (7, 7),
Expand All @@ -35,19 +35,23 @@ grid = RectilinearGrid(arch;
##### Value boundary conditions for velocities
#####

u_bcs = FieldBoundaryConditions(north=ValueBoundaryCondition(0),
south=ValueBoundaryCondition(0))
u_bcs = FieldBoundaryConditions(north=OpenBoundaryCondition(0),
south=OpenBoundaryCondition(0),
west=OpenBoundaryCondition(0),
east=OpenBoundaryCondition(0))

v_bcs = FieldBoundaryConditions(west=ValueBoundaryCondition(0),
east=ValueBoundaryCondition(0))
v_bcs = FieldBoundaryConditions(north=OpenBoundaryCondition(0),
south=OpenBoundaryCondition(0),
west=OpenBoundaryCondition(0),
east=OpenBoundaryCondition(0))

#####
##### Ocean sea-ice stress
#####

# Constant ocean velocities corresponding to a cyclonic eddy
Uₒ = XFaceField(grid)
Vₒ = YFaceField(grid)
Uₒ = Field{Face, Face, Nothing}(grid)
Vₒ = Field{Face, Face, Nothing}(grid)

set!(Uₒ, (x, y) -> 𝓋ₒ * (2y - L) / L)
set!(Vₒ, (x, y) -> 𝓋ₒ * (L - 2x) / L)
Expand All @@ -59,8 +63,8 @@ fill_halo_regions!((Uₒ, Vₒ))
#### Atmosphere - sea ice stress
####

Uₐ = XFaceField(grid)
Vₐ = YFaceField(grid)
Uₐ = Field{Face, Face, Nothing}(grid)
Vₐ = Field{Face, Face, Nothing}(grid)

# Atmospheric velocities corresponding to an anticyclonic eddy moving north-east
@inline center(t) = 256kilometers + 51.2kilometers * t / 86400
Expand Down Expand Up @@ -89,13 +93,18 @@ fill_halo_regions!((Uₐ, Vₐ))
dynamics = SeaIceMomentumEquation(grid;
top_momentum_stress = (u=τₐu, v=τₐv),
bottom_momentum_stress = τₒ,
coriolis = FPlane(f=1e-4))
coriolis = FPlane(f=1e-4),
free_drift = StressBalanceFreeDrift((u=τₐu, v=τₐv), τₒ),
rheology = BrittleBinghamMaxwellRheology(),
solver = SplitExplicitSolver(substeps=150))

# Define the model!
model = SeaIceModel(grid;
dynamics,
ice_thermodynamics = nothing, # No ice_thermodynamics here
advection = WENO(order=7),
boundary_conditions = (u=u_bcs, v=v_bcs))
boundary_conditions = (u=u_bcs, v=v_bcs),
tracers = :d)

# We start with a concentration of ℵ = 1 and an
# initial height field with perturbations around 0.3 m
Expand Down Expand Up @@ -132,8 +141,9 @@ simulation.callbacks[:top_stress] = Callback(compute_wind_stress, IterationInter
h = model.ice_thickness
ℵ = model.ice_concentration
u, v = model.velocities
d = model.tracers.d

outputs = (; h, u, v, ℵ)
outputs = (; h, u, v, ℵ, d)

simulation.output_writers[:sea_ice] = JLD2Writer(model, outputs;
filename = "sea_ice_advected_by_anticyclone.jld2",
Expand Down Expand Up @@ -172,13 +182,14 @@ htimeseries = FieldTimeSeries("sea_ice_advected_by_anticyclone.jld2", "h")
utimeseries = FieldTimeSeries("sea_ice_advected_by_anticyclone.jld2", "u")
vtimeseries = FieldTimeSeries("sea_ice_advected_by_anticyclone.jld2", "v")
ℵtimeseries = FieldTimeSeries("sea_ice_advected_by_anticyclone.jld2", "ℵ")
dtimeseries = FieldTimeSeries("sea_ice_advected_by_anticyclone.jld2", "d")

# Visualize!
Nt = length(htimeseries)
iter = Observable(1)

hi = @lift(htimeseries[$iter])
ℵi = @lift(ℵtimeseries[$iter])
di = @lift(dtimeseries[$iter])
ui = @lift(utimeseries[$iter])
vi = @lift(vtimeseries[$iter])

Expand All @@ -187,7 +198,7 @@ ax = Axis(fig[1, 1], title = "sea ice thickness")
heatmap!(ax, hi, colormap = :magma, colorrange = (0.23, 0.37))

ax = Axis(fig[1, 2], title = "sea ice concentration")
heatmap!(ax, ℵi, colormap = Reverse(:deep), colorrange = (0.9, 1))
heatmap!(ax, di, colormap = Reverse(:deep), colorrange = (0.9, 1))

ax = Axis(fig[2, 1], title = "zonal velocity")
heatmap!(ax, ui, colorrange = (-0.1, 0.1))
Expand Down
12 changes: 4 additions & 8 deletions examples/ice_advected_on_coastline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,14 @@ Oceananigans.BoundaryConditions.fill_halo_regions!(τᵤ)
dynamics = SeaIceMomentumEquation(grid;
top_momentum_stress = (u=τᵤ, v=τᵥ),
bottom_momentum_stress = τₒ,
rheology = ElastoViscoPlasticRheology(),
free_drift = StressBalanceFreeDrift((u=τᵤ, v=τᵥ), τₒ),
rheology = BrittleBinghamMaxwellRheology(),
solver = SplitExplicitSolver(substeps=150))

u_bcs = FieldBoundaryConditions(top = nothing, bottom = nothing,
north = ValueBoundaryCondition(0),
south = ValueBoundaryCondition(0))

#Define the model!
model = SeaIceModel(grid;
advection = WENO(order=7),
dynamics = dynamics,
boundary_conditions = (; u=u_bcs),
ice_thermodynamics = nothing)

# We start with a concentration of ℵ = 1 everywhere
Expand All @@ -84,7 +80,7 @@ set!(model, ℵ = 1)
#####

# run the model for 10 day
simulation = Simulation(model, Δt = 2minutes, stop_time=2days)
simulation = Simulation(model, Δt=2minutes, stop_time=2days)

# Container to hold the data
htimeseries = []
Expand Down Expand Up @@ -159,4 +155,4 @@ CairoMakie.record(fig, "sea_ice_advected_on_coastline.mp4", 1:Nt, framerate = 8)
end
nothing #hide

# ![](sea_ice_advected_on_coastline.mp4)
# ![](sea_ice_advected_on_coastline.mp4)
17 changes: 11 additions & 6 deletions src/Rheologies/Rheologies.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
module Rheologies

export ViscousRheology, ElastoViscoPlasticRheology
export ∂ⱼ_σ₁ⱼ, ∂ⱼ_σ₂ⱼ, required_auxiliary_fields
export ViscousRheology, ElastoViscoPlasticRheology, BrittleBinghamMaxwellRheology
export ∂ⱼ_σ₁ⱼ, ∂ⱼ_σ₂ⱼ, rheology_auxiliary_fields

using Oceananigans
using Oceananigans.Operators
using ClimaSeaIce: ice_mass

# Nothing rheology
required_auxiliary_fields(rheology, grid) = NamedTuple()
initialize_rheology!(model, rheology) = nothing
compute_stresses!(model, dynamics, rheology, Δt) = nothing
compute_stresses!(model, dynamics, rheology, Δt, Ns) = nothing

# Nothing rheology or viscous rheology
@inline compute_substep_Δtᶠᶜᶜ(i, j, grid, Δt, rheology, substeps, fields) = Δt / substeps
@inline compute_substep_Δtᶜᶠᶜ(i, j, grid, Δt, rheology, substeps, fields) = Δt / substeps
@inline compute_substep_Δtᶠᶠᶜ(i, j, grid, Δt, rheology, substeps, fields) = Δt / substeps

# Fallback
@inline sum_of_forcing_u(i, j, k, grid, rheology, u_forcing, fields, Δt) = u_forcing(i, j, k, grid, fields)
@inline sum_of_forcing_v(i, j, k, grid, rheology, v_forcing, fields, Δt) = v_forcing(i, j, k, grid, fields)

# No needed extra tracers
rheology_prognostic_tracers(rheology) = ()

# No needed auxiliary fields
rheology_auxiliary_fields(rheology, grid) = NamedTuple()

@inline ice_stress_ux(i, j, k, grid, ::Nothing, args...) = zero(grid)
@inline ice_stress_uy(i, j, k, grid, ::Nothing, args...) = zero(grid)
@inline ice_stress_vx(i, j, k, grid, ::Nothing, args...) = zero(grid)
Expand All @@ -28,5 +32,6 @@ compute_stresses!(model, dynamics, rheology, Δt) = nothing
include("ice_stress_divergence.jl")
include("viscous_rheology.jl")
include("elasto_visco_plastic_rheology.jl")
include("brittle_bingham_maxwell_rheology.jl")

end
Loading
Loading