Skip to content

Commit 78fdaae

Browse files
committed
rename h to eta_prime
1 parent 83343d3 commit 78fdaae

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

docs/src/dispersion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ function initial_condition_traveling_wave(x, t, equations, mesh)
8888
omega = frequency(k)
8989
h0 = reference_height()
9090
A = 0.02
91-
h = A * cos(k * x - omega * t)
92-
v = sqrt(equations.gravity / k * tanh(k * h0)) * h / h0
93-
eta = h + equations.eta0
91+
eta_prime = A * cos(k * x - omega * t)
92+
v = sqrt(equations.gravity / k * tanh(k * h0)) * eta_prime / h0
93+
eta = eta_prime + equations.eta0
9494
D = h0
9595
return SVector(eta, v, D)
9696
end

src/equations/bbm_bbm_1d.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ function initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)
253253
k = 0.8406220896381442 # precomputed result of find_zero(k -> omega^2 - g * k * tanh(k * h0), 1.0) using Roots.jl
254254
offset = dingemans_calibration(equations)
255255
if x - offset < -34.5 * pi / k || x - offset > -4.5 * pi / k
256-
h = 0.0
256+
eta_prime = 0.0
257257
else
258-
h = A * cos(k * (x - offset))
258+
eta_prime = A * cos(k * (x - offset))
259259
end
260-
v = sqrt(g / k * tanh(k * h0)) * h / h0
260+
v = sqrt(g / k * tanh(k * h0)) * eta_prime / h0
261261
if 11.01 <= x && x < 23.04
262262
b = 0.6 * (x - 11.01) / (23.04 - 11.01)
263263
elseif 23.04 <= x && x < 27.04
@@ -267,9 +267,9 @@ function initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)
267267
else
268268
b = 0.0
269269
end
270-
# Here, we compute eta - h0!! To obtain the original eta, h0 = 0.8 needs to be added again!
270+
# Here, we compute eta - eta0!! To obtain the original eta, eta0 = 0.8 needs to be added again!
271271
# This is because the BBM-BBM equations are only implemented for eta0 = 0
272-
eta = h
272+
eta = eta_prime
273273
D = h0 - b
274274
return SVector(eta, v, D)
275275
end

src/equations/equations.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,11 @@ function initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquati
641641
k = 0.8406220896381442 # precomputed result of find_zero(k -> omega^2 - g * k * tanh(k * h0), 1.0) using Roots.jl
642642
offset = dingemans_calibration(equations)
643643
if x - offset < -34.5 * pi / k || x - offset > -4.5 * pi / k
644-
h = 0.0
644+
eta_prime = 0.0
645645
else
646-
h = A * cos(k * (x - offset))
646+
eta_prime = A * cos(k * (x - offset))
647647
end
648-
v = sqrt(g / k * tanh(k * h0)) * h / h0
648+
v = sqrt(g / k * tanh(k * h0)) * eta_prime / h0
649649
if 11.01 <= x && x < 23.04
650650
b = 0.6 * (x - 11.01) / (23.04 - 11.01)
651651
elseif 23.04 <= x && x < 27.04
@@ -656,7 +656,7 @@ function initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquati
656656
b = 0.0
657657
end
658658
eta0 = equations.eta0
659-
eta = h + h0
659+
eta = eta_prime + eta0
660660
D = eta0 - b
661661
return SVector(eta, v, D)
662662
end

0 commit comments

Comments
 (0)