Skip to content

Commit

Permalink
Simplify floating condition
Browse files Browse the repository at this point in the history
  • Loading branch information
danshapero committed Aug 25, 2023
1 parent 1ccc6d5 commit 411d0d0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions demos/dualform/src/dualform/ice_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def friction_power(**kwargs):

def constraint(**kwargs):
field_names = (
"velocity", "membrane_stress", "basal_stress", "thickness", "surface"
"velocity",
"membrane_stress",
"basal_stress",
"thickness",
"surface",
"sliding_law_exponent",
)
u, M, τ, h, s = map(kwargs.get, field_names)
u, M, τ, h, s, m = map(kwargs.get, field_names)

p_I = ρ_I * g * h
p_W = -ρ_W * g * min_value(0, s - h)
h_min = Constant(10.0)
f = (p_I - p_W) / max_value(p_I, ρ_I * g * h_min)
# Turn off friction when near flotation
f = (1 + min_value(0, s - h) / h) ** m

ε = sym(grad(u))
return (-h * inner(M, ε) + inner(f * τ - ρ_I * g * h * grad(s), u)) * dx

0 comments on commit 411d0d0

Please sign in to comment.