@@ -53,6 +53,13 @@ function KdVEquation1D(; gravity, D = 1.0, eta0 = 0.0)
5353 KdVEquation1D (gravity, D, eta0)
5454end
5555
56+ function check_solver (:: KdVEquation1D , solver, boundary_conditions)
57+ if ! (solver. D1 isa PeriodicUpwindOperators && isnothing (solver. D3)) &&
58+ isnothing (solver. D3)
59+ throw (ArgumentError (" The KdV equation requires a third-derivative operator. Either explicitly set `D3` or set `D1` as an upwind operator." ))
60+ end
61+ end
62+
5663"""
5764 initial_condition_soliton(x, t, equations::KdVEquation1D, mesh)
5865
@@ -133,14 +140,14 @@ where `D` is the still-water depth.
133140
134141!!! warning "Parameter constraints"
135142 This conversion is only valid for equations with specific parameter values:
136- - `gravity = 4/27`
137- - `D = 3.0`
138-
139- These values ensure the dimensional KdV equation matches the standard
143+ - `gravity = 4/27`
144+ - `D = 3.0`
145+
146+ These values ensure the dimensional KdV equation matches the standard
140147 non-dimensional form `u_t + u u_x + u_{xxx} = 0`.
141148
142- This function allows converting solutions from the standard non-dimensional
143- KdV form commonly found in literature to the dimensional form implemented
149+ This function allows converting solutions from the standard non-dimensional
150+ KdV form commonly found in literature to the dimensional form implemented
144151in DispersiveShallowWater.jl.
145152
146153See also [`prim2nondim`](@ref).
153160"""
154161 prim2nondim(eta, equations::KdVEquation1D)
155162
156- Convert the primitive/physical variable `eta` (total water height) to the
163+ Convert the primitive/physical variable `eta` (total water height) to the
157164non-dimensional variable `u` for the [`KdVEquation1D`](@ref).
158165
159166The transformation is given by:
@@ -164,15 +171,15 @@ where `D` is the still-water depth.
164171
165172!!! warning "Parameter constraints"
166173 This conversion is only valid for equations with specific parameter values:
167- - `gravity = 4/27`
174+ - `gravity = 4/27`
168175 - `D = 3.0`
169-
170- These values ensure the dimensional KdV equation matches the standard
176+
177+ These values ensure the dimensional KdV equation matches the standard
171178 non-dimensional form `u_t + u u_x + u_{xxx} = 0`.
172179
173- This function allows converting solutions from the dimensional form implemented
174- in DispersiveShallowWater.jl to the standard non-dimensional KdV form
175- commonly found in literature, enabling comparison with theoretical results
180+ This function allows converting solutions from the dimensional form implemented
181+ in DispersiveShallowWater.jl to the standard non-dimensional KdV form
182+ commonly found in literature, enabling comparison with theoretical results
176183and other implementations.
177184
178185See also [`nondim2prim`](@ref).
0 commit comments