Skip to content

Commit 83343d3

Browse files
committed
add dingemans_calibration
1 parent a8617f0 commit 83343d3

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

src/equations/bbm_bbm_1d.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ function source_terms_manufactured_reflecting(q, x, t,
223223
return SVector(s1, s2, zero(s1))
224224
end
225225

226+
dingemans_calibration(equations::BBMBBMEquations1D) = 2.7
227+
226228
"""
227229
initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)
228230
@@ -249,10 +251,11 @@ function initial_condition_dingemans(x, t, equations::BBMBBMEquations1D, mesh)
249251
A = 0.02
250252
# omega = 2*pi/(2.02*sqrt(2))
251253
k = 0.8406220896381442 # precomputed result of find_zero(k -> omega^2 - g * k * tanh(k * h0), 1.0) using Roots.jl
252-
if x < -30.5 * pi / k || x > -8.5 * pi / k
254+
offset = dingemans_calibration(equations)
255+
if x - offset < -34.5 * pi / k || x - offset > -4.5 * pi / k
253256
h = 0.0
254257
else
255-
h = A * cos(k * x)
258+
h = A * cos(k * (x - offset))
256259
end
257260
v = sqrt(g / k * tanh(k * h0)) * h / h0
258261
if 11.01 <= x && x < 23.04

src/equations/equations.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,10 @@ function solve_system_matrix!(dv, system_matrix, ::Union{BBMEquation1D, BBMBBMEq
614614
ldiv!(system_matrix, dv)
615615
end
616616

617+
# To match the experimental data from Dingemans, the initial condition needs to be shifted
618+
# to account for the phase shift to the experimental data.
619+
dingemans_calibration(equations) = 0
620+
617621
"""
618622
initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquations, mesh)
619623
@@ -635,10 +639,11 @@ function initial_condition_dingemans(x, t, equations::AbstractShallowWaterEquati
635639
A = 0.02
636640
# omega = 2*pi/(2.02*sqrt(2))
637641
k = 0.8406220896381442 # precomputed result of find_zero(k -> omega^2 - g * k * tanh(k * h0), 1.0) using Roots.jl
638-
if x < -30.5 * pi / k || x > -8.5 * pi / k
642+
offset = dingemans_calibration(equations)
643+
if x - offset < -34.5 * pi / k || x - offset > -4.5 * pi / k
639644
h = 0.0
640645
else
641-
h = A * cos(k * x)
646+
h = A * cos(k * (x - offset))
642647
end
643648
v = sqrt(g / k * tanh(k * h0)) * h / h0
644649
if 11.01 <= x && x < 23.04

src/equations/hyperbolic_serre_green_naghdi_1d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ function source_terms_manufactured_reflecting(q, x, t,
321321
return SVector(s1, s2, s3, s4, s5)
322322
end
323323

324+
dingemans_calibration(equations::HyperbolicSerreGreenNaghdiEquations1D) = 2.4
325+
324326
function create_cache(mesh, equations::HyperbolicSerreGreenNaghdiEquations1D,
325327
solver, initial_condition,
326328
boundary_conditions::Union{BoundaryConditionPeriodic,

src/equations/serre_green_naghdi_1d.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ function source_terms_manufactured_reflecting(q, x, t,
414414
cos3_pix = cospi(x)^3
415415
cos4_pix = cospi(x)^4
416416

417-
# Compute s1
417+
# Compute s1
418418
s1 = 2(2 + cospix + x) + (-1 - 2(2 + cospix + x) * t) * sinpix * t -
419419
2(1 - pi * sinpix) * sinpix * t2 * x +
420420
cospix * (-1 - 2(2 + cospix + x) * t) * pi * t * x
@@ -496,6 +496,8 @@ function source_terms_manufactured_reflecting(q, x, t,
496496
return SVector(s1, s2, zero(s1))
497497
end
498498

499+
dingemans_calibration(equations::SerreGreenNaghdiEquations1D) = 2.4
500+
499501
# flat bathymetry with periodic or reflecting boundary conditions
500502
function create_cache(mesh,
501503
equations::SerreGreenNaghdiEquations1D{BathymetryFlat},

src/equations/svaerd_kalisch_1d.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ function source_terms_manufactured_reflecting(q, x, t, equations::SvaerdKalischE
197197
return SVector(s1, s2, zero(s1))
198198
end
199199

200+
dingemans_calibration(equations::SvaerdKalischEquations1D) = 2.2
201+
200202
# For periodic boundary conditions
201203
function assemble_system_matrix!(cache, h,
202204
::SvaerdKalischEquations1D,

0 commit comments

Comments
 (0)