-
Notifications
You must be signed in to change notification settings - Fork 5
Added reflecting BC for HyperbolicSGN #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added reflecting BC for HyperbolicSGN #228
Conversation
…tor" from imports
Co-authored-by: Joshua Lampert <51029046+JoshuaLampert@users.noreply.github.com>
…wWater.jl into sgn_reflecting
… AbstractPeriodicDerivativeOperator)
update hyperbolic ref branch
|
Here are come convergence test results: test_results = convergence_test(joinpath(examples_dir(), "hyperbolic_serre_green_naghdi_1d", "hyperbolic_serre_green_naghdi_manufactured_reflecting.jl"), [32, 64, 128, 256, 512]);
# using bathymetry_mild_slope:
# for accuracy_order = 2
####################################################################################################
l2
η v D w H
N error EOC N error EOC N error EOC N error EOC N error EOC
32 1.96e-02 - 32 6.18e-03 - 32 0.00e+00 - 32 1.11e+00 - 32 1.97e-02 -
64 6.60e-03 1.57 64 1.47e-03 2.07 64 0.00e+00 NaN 64 1.12e+00 -0.01 64 6.66e-03 1.57
128 2.27e-03 1.54 128 3.59e-04 2.03 128 0.00e+00 NaN 128 1.13e+00 -0.00 128 2.30e-03 1.53
256 7.93e-04 1.52 256 8.89e-05 2.02 256 0.00e+00 NaN 256 1.13e+00 -0.00 256 8.04e-04 1.52
512 2.79e-04 1.51 512 2.21e-05 2.01 512 0.00e+00 NaN 512 1.13e+00 -0.00 512 2.83e-04 1.51
mean 1.53 mean 2.03 mean NaN mean -0.00 mean 1.53
----------------------------------------------------------------------------------------------------
linf
η v D w H
N error EOC N error EOC N error EOC N error EOC N error EOC
32 1.28e-01 - 32 9.91e-03 - 32 0.00e+00 - 32 1.72e+00 - 32 1.30e-01 -
64 6.46e-02 0.98 64 2.35e-03 2.08 64 0.00e+00 NaN 64 1.73e+00 -0.01 64 6.57e-02 0.99
128 3.25e-02 0.99 128 5.72e-04 2.04 128 0.00e+00 NaN 128 1.74e+00 -0.00 128 3.30e-02 0.99
256 1.63e-02 1.00 256 1.41e-04 2.02 256 0.00e+00 NaN 256 1.74e+00 -0.00 256 1.65e-02 1.00
512 8.15e-03 1.00 512 4.08e-05 1.79 512 0.00e+00 NaN 512 1.74e+00 -0.00 512 8.28e-03 1.00
mean 0.99 mean 1.98 mean NaN mean -0.00 mean 0.99
----------------------------------------------------------------------------------------------------
# for accuracy_order = 4
####################################################################################################
l2
η v D w H
N error EOC N error EOC N error EOC N error EOC N error EOC
32 1.22e-02 - 32 5.39e-03 - 32 0.00e+00 - 32 1.14e+00 - 32 1.23e-02 -
64 2.53e-03 2.26 64 7.51e-04 2.84 64 0.00e+00 NaN 64 1.13e+00 0.01 64 2.57e-03 2.26
128 4.80e-04 2.40 128 9.78e-05 2.94 128 0.00e+00 NaN 128 1.13e+00 0.00 128 4.87e-04 2.40
256 8.77e-05 2.45 256 1.25e-05 2.97 256 0.00e+00 NaN 256 1.13e+00 0.00 256 8.89e-05 2.45
512 1.58e-05 2.47 512 2.09e-06 2.58 512 0.00e+00 NaN 512 1.13e+00 0.00 512 1.60e-05 2.47
mean 2.40 mean 2.83 mean NaN mean 0.00 mean 2.40
----------------------------------------------------------------------------------------------------
linf
η v D w H
N error EOC N error EOC N error EOC N error EOC N error EOC
32 9.73e-02 - 32 8.40e-03 - 32 0.00e+00 - 32 1.74e+00 - 32 9.91e-02 -
64 2.93e-02 1.73 64 1.21e-03 2.80 64 0.00e+00 NaN 64 1.74e+00 0.00 64 2.98e-02 1.73
128 7.94e-03 1.88 128 1.60e-04 2.91 128 0.00e+00 NaN 128 1.74e+00 0.00 128 8.06e-03 1.89
256 2.06e-03 1.95 256 2.77e-05 2.54 256 0.00e+00 NaN 256 1.74e+00 -0.00 256 2.09e-03 1.95
512 5.28e-04 1.96 512 3.78e-05 -0.45 512 0.00e+00 NaN 512 1.74e+00 0.00 512 5.32e-04 1.97
mean 1.88 mean 1.95 mean NaN mean 0.00 mean 1.89
----------------------------------------------------------------------------------------------------
|
|
This is how I calculated the manufactured solution: # 1d manufactured solution for hyperbolic Serre-Green-Naghdi equations
using Symbolics
@variables x t
Dt = Differential(t)
Dx = Differential(x)
@variables g pi λ
h = 1 + (2 * t) * (cos(pi*(x)) + x + 2)
vx = (-t * x) * sin(pi*(x))
b = (2 * x) # or b = 0
eta = h
w = -h * Dx(vx) + 3//2 * vx * Dx(b)
PI = λ // 3 * (eta / h) * (1 - eta / h)
# taken from https://arxiv.org/pdf/2408.02665 eq. (89)
eq1 = Dt(h) + Dx(h * vx)
eq2 = Dt(vx) + (g * h * Dx(h) + h * vx * Dx(vx) + Dx(h * PI) + (g * h + 3 // 2 * h / eta * PI) * Dx(b)) / h
eq3 = Dt(w) + vx * Dx(w) - λ * (1 - eta / h) / h
eq4 = Dt(eta) + Dx(eta) * vx + 3//2 * Dx(b) * vx - w
s1 = simplify(expand_derivatives(eq1))
s2 = simplify(expand_derivatives(eq2))
s3 = 0
s4 = simplify(expand_derivatives(eq3))
s5 = simplify(expand_derivatives(eq4))
println("s1 = $s1\n")
println("s2 = $s2\n")
println("s3 = zero(s1)\n")
println("s4 = $s4\n")
println("s5 = $s5\n") |
Benchmark Results (Julia v1.10)Time benchmarks
Memory benchmarks
|
Pull Request Test Coverage Report for Build 16544586009Details
💛 - Coveralls |
JoshuaLampert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good to me. Just for clarification: Do you have a formal proof of entropy conservation for this semidiscretization? It only uses a SAT for
Yes. I dont have a TeXed version of the proof yet, but I did calculate it and energy is conserved for both flat and variable bottom topography.
In the conservative form you also have additional terms for |
Ah, that's interesting. Thanks for the explanation! |
No description provided.