Coverage for src/flexfrac1d/lib/disprel.py: 100%

1 import numpy as np

2

3 from ..model.model import Ice, Ocean

4

5

6 def free_surface(wavenumber, depth):

7 return wavenumber * np.tanh(wavenumber * depth)

8

9

10 def elas_mass_surface(

11 wavenumbers: np.ndarray, ice: Ice, ocean: Ocean, gravity: float

12) -> np.ndarray:

13 l4 = ice.flex_rigidity / (ocean.density * gravity)

14 draft = ice.density / ocean.density * ice.thickness

15 dud = ocean.depth - draft

16 k_tanh_kdud = wavenumbers * np.tanh(wavenumbers * dud)

17

18 return (l4 * wavenumbers**4 + 1) / (1 + draft * k_tanh_kdud) * k_tanh_kdud