Swashes PDF
Swashes PDF
Swashes PDF
of
SWASHES
v1.03.00 (2016-01-29)
Todo List
1
2 CHAPTER 1. TODO LIST
Chapter 2
Hierarchical Index
3
4 CHAPTER 2. HIERARCHICAL INDEX
Chapter 3
Class Index
5
6 CHAPTER 3. CLASS INDEX
Chapter 4
File Index
7
8 CHAPTER 4. FILE INDEX
Sources/bedload.cpp
Computes solutions with bedload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Sources/bump.cpp
Computes bumps solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Sources/choice_solution.cpp
Choice of the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Sources/dam_break.cpp
Computes dam break solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Sources/dressler_dam.cpp
Computes Dressler dam break solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Sources/inclined_plane.cpp
Computes the solution over an inclined plane . . . . . . . . . . . . . . . . . . . . . . . . . 67
Sources/macdonald_like.cpp
Computes Mac Donald solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Sources/macdonald_like_diffus.cpp
Computes Mac Donald solutions with diffusion . . . . . . . . . . . . . . . . . . . . . . . . . 68
Sources/macdonaldb1.cpp
Computes Mac Donald pseudo 2d solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Sources/macdonaldb2.cpp
Computes Mac Donald pseudo 2d solutions . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Sources/parameters.cpp
Gets parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Sources/sampson.cpp
Computes Sampson solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Sources/selfsimilar_dam_break.cpp
Computes self-similar dam break solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Sources/solution.cpp
Common file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Sources/swash.cpp
Computes the solutions of the swash over an inclined plane . . . . . . . . . . . . . . . . . . 71
Sources/swashes.cpp
Main file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Sources/thacker.cpp
Computes Thacker solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Sources/thacker2d.cpp
Computes Thacker solution in 2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Chapter 5
Class Documentation
Solution
Bedload
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
9
10 CHAPTER 5. CLASS DOCUMENTATION
Parameters
in par contains all the values from the parameters
Warning
Modifies
Note
If the vector z0 cannot be allocated, the code will exit with failure termination code.
Bedload::∼Bedload ( ) [virtual]
Destructor.
Definition at line 149 of file bedload.cpp.
Implements Solution.
Definition at line 154 of file bedload.cpp.
void Bedload::param ( SCALAR L, SCALAR dx_ex, SCALAR T, SCALAR uexl, SCALAR hexl,
SCALAR z0l, SCALAR zexl, SCALAR uexr, SCALAR hexr, SCALAR z0r, SCALAR zexr, SCALAR
alpha, SCALAR beta, SCALAR A, SCALAR q, SCALAR C, SCALAR p ) const
Warning
WARNING: to compare your numerical result to this solution, you must be able to remove friction from the
Shallow-Water part (see doc).
• Headers/bedload.hpp
• Sources/bedload.cpp
Solution
Bump
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Modifies
Bump::∼Bump ( ) [virtual]
Destructor.
Definition at line 166 of file bump.cpp.
Solution::hex.
Implements Solution.
Definition at line 169 of file bump.cpp.
Returns
4 3
Value of q2 + 27 p .
Definition at line 289 of file bump.cpp.
Warning
Returns
Parameters
in a coefficient of the 3rd order polynomia
in b coefficient of the 3rd order polynomia
in c coefficient of the 3rd order polynomia
Returns
b2 c
Value of − 2
+ .
3a a
Returns
2b2
b c
Value of −9 .
27a a2 a
Returns
1 1 g
Value of q2 hplus − hminus + 2 hplus2 − hminus2 .
• Headers/bump.hpp
• Sources/bump.cpp
5.3. CHOICE_SOLUTION CLASS REFERENCE 15
Constructor.
Parameters
in par contains all the values from the parameter
Warning
Note
If the solution does not exists, the code will exit with failure termination code.
Choice_solution::∼Choice_solution ( ) [virtual]
Destructor.
Definition at line 615 of file choice_solution.cpp.
• Headers/choice_solution.hpp
• Sources/choice_solution.cpp
16 CHAPTER 5. CLASS DOCUMENTATION
Solution
Dam_break
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Modifies
Solution::dx_ex, Solution::L, Solution::T, Solution::xex, Solution::zex to have the dam break configuration.
Dam_break::∼Dam_break ( ) [virtual]
Destructor.
Definition at line 106 of file dam_break.cpp.
5.5. DRESSLER_DAM CLASS REFERENCE 17
Modifies
Solution::hex.
Implements Solution.
Definition at line 111 of file dam_break.cpp.
Function x6 − 9v2right x4 + 16vle f t v2right x3 − v2right (v2right + 8v2le f t )x2 + v6right to get the roots by dichotomy.
Function to solve by dichotomy the equation cm6 −9v2right cm4 +16vle f t v2right cm3 −v2right (v2right +8v2le f t )cm2 +
v6right = 0.
Returns
• Headers/dam_break.hpp
• Sources/dam_break.cpp
Solution
Dressler_dam
18 CHAPTER 5. CLASS DOCUMENTATION
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Warning
Note
If the vector hexd cannot be allocated, the code will exit with failure termination code.
Dressler_dam::∼Dressler_dam ( ) [virtual]
Destructor.
Definition at line 102 of file dressler_dam.cpp.
Solution::hex, Solution::uex.
Implements Solution.
Definition at line 106 of file dressler_dam.cpp.
5.5. DRESSLER_DAM CLASS REFERENCE 19
Parameters
in L length of the domain
in xdam position of the dam
in C Chezy friction coefficient
in dx_ex space step
in T final time
Definition at line 207 of file dressler_dam.cpp.
The documentation for this class was generated from the following files:
• Headers/dressler_dam.hpp
• Sources/dressler_dam.cpp
Solution
Inclined_plane
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Modifies
Inclined_plane::∼Inclined_plane ( ) [virtual]
Destructor.
Definition at line 95 of file inclined_plane.cpp.
Solution::hex.
Implements Solution.
Definition at line 98 of file inclined_plane.cpp.
Parameters
in p computed by Inclined_plane::p
in q computed by Inclined_plane::q
Returns
4 3
Value of q2 + 27 p .
Warning
Returns
Returns
b2 c
Value of − 2
+ .
3a a
Definition at line 126 of file inclined_plane.cpp.
void Inclined_plane::param ( SCALAR L, SCALAR dx_ex, SCALAR alpha, SCALAR beta, SCALAR h0,
SCALAR q0 ) const
Parameters
in L length of the domain
in dx_ex space step
in alpha the slope of the plane
in beta the value of the topography for x=0
in h0 the left (imposed) water height
in q0 the left (imposed) water discharge
Definition at line 255 of file inclined_plane.cpp.
Returns
2b2
b c
Value of −9 .
27a a2 a
• Headers/inclined_plane.hpp
• Sources/inclined_plane.cpp
Solution
MacDonald_like
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Warning
Note
If the vector dhex cannot be allocated, the code will exit with failure termination code.
MacDonald_like::∼MacDonald_like ( ) [virtual]
Destructor.
Definition at line 434 of file macdonald_like.cpp.
Solution::zex.
Implements Solution.
Definition at line 439 of file macdonald_like.cpp.
Parameters
in q discharge
in h water height
in dh variation of the water height
in Rain rain quantity
in c friction coefficient
Returns
q2 q2
q
Value of 1 − 3 dh + 2Rain 2 + c .
gh gh 8gh3
Definition at line 496 of file macdonald_like.cpp.
Returns
q2 c2 q2
q
Value of 1 − 3 dh + 2Rain 2 + 10/3 .
gh gh h
Definition at line 481 of file macdonald_like.cpp.
• Headers/macdonald_like.hpp
• Sources/macdonald_like.cpp
Solution
MacDonald_like_diffus
26 CHAPTER 5. CLASS DOCUMENTATION
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Warning
Modifies
Note
If the vector dhex (or ddhex) cannot be allocated, the code will exit with failure termination code.
MacDonald_like_diffus::∼MacDonald_like_diffus ( ) [virtual]
Destructor.
Definition at line 154 of file macdonald_like_diffus.cpp.
5.9. MACDONALDB1 CLASS REFERENCE 27
Solution::zex.
Implements Solution.
Definition at line 160 of file macdonald_like_diffus.cpp.
Returns 2
q2 kt q2 q ddh − q dh
kl q h
Value of 1 − 3 dh + + + 4muh .
gh kl h
gh2 (1 + 3muv kl h 2
) gh2 (1 + 3muv ) gh2
Definition at line 195 of file macdonald_like_diffus.cpp.
Solution
MacDonaldB1
28 CHAPTER 5. CLASS DOCUMENTATION
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Modifies
MacDonaldB1::∼MacDonaldB1 ( ) [virtual]
Destructor.
Definition at line 227 of file macdonaldb1.cpp.
Modifies
Solution::zex.
Implements Solution.
Definition at line 162 of file macdonaldb1.cpp.
5.9. MACDONALDB1 CLASS REFERENCE 29
Parameters
in h water height
in hp derivative of the water height
in b boundary function
in bp derivative of the boundary function
in Q discharge
in n friction coefficient
in Z slope
in exp1 exponent, equal to 4/3
in exp2 exponent, equal to 10/3
Returns √
Q2 (b + 2Zh) 1 + Z 2 )exp1 Q2 bp
2 2 (b + 2h
Value of hp − 1 − Q n + .
g(h(b + Zh))3 (h(b + Zh))exp2 gh2 (b + Zh)3
• Headers/macdonaldb1.hpp
• Sources/macdonaldb1.cpp
Solution
MacDonaldB2
Constructor.
Defines the physical parameters and prints the header with the configuration.
The solution is saved at the steady state.
Parameters
in par contains all the values from the parameters
Modifies
MacDonaldB2::∼MacDonaldB2 ( ) [virtual]
Destructor.
Definition at line 197 of file macdonaldb2.cpp.
Solution::zex.
Implements Solution.
Definition at line 132 of file macdonaldb2.cpp.
in h water height
in hp derivative of the water height
in b boundary function
in bp derivative of the boundary function
in Q discharge
in n friction coefficient
in Z slope
in exp1 exponent, equal to 4/3
in exp2 exponent, equal to 10/3
Returns √
Q2 (b + 2Zh) 2 exp1 Q2 bp
2 2 (b + 2h 1 + Z )
Value of hp − 1 − Q n + .
g(h(b + Zh))3 (h(b + Zh))exp2 gh2 (b + Zh)3
• Headers/macdonaldb2.hpp
• Sources/macdonaldb2.cpp
Protected Attributes
• int nx_ex
• int ny_ex
• SCALAR choicedim
• int choicetype
• int choice
• int choicedomain
Gets parameters.
Class that reads the parameters, checks their values and contains all the common declarations to get the
values of the parameters.
Definition at line 69 of file parameters.hpp.
Constructor.
Checks the arguments
Parameters
in argc number of arguments
in argv value of the arguments
Warning
Modifies
Note
If the arguments are incompatible, the code will exit with failure termination code.
Parameters::∼Parameters ( ) [virtual]
Destructor.
Definition at line 109 of file parameters.cpp.
34 CHAPTER 5. CLASS DOCUMENTATION
Returns
Returns
Returns
Returns
Returns
Returns
Prints help.
Prints how to use the code.
Definition at line 112 of file parameters.cpp.
Number of cells in x.
Definition at line 73 of file parameters.hpp.
Number of cells in y.
Definition at line 75 of file parameters.hpp.
The documentation for this class was generated from the following files:
• Headers/parameters.hpp
• Sources/parameters.cpp
Solution
Sampson
36 CHAPTER 5. CLASS DOCUMENTATION
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Modifies
Sampson::∼Sampson ( ) [virtual]
Destructor.
Definition at line 90 of file sampson.cpp.
Solution::hex, Solution::uex.
Implements Solution.
Definition at line 94 of file sampson.cpp.
void Sampson::param ( SCALAR L, SCALAR h0, SCALAR a, SCALAR B, SCALAR tau, SCALAR
dx_ex, SCALAR T ) const
Parameters
in L length of the domain
in h0 value of the topography in the center of the domain
in a parameter of the topography
in B constant for the initial condition
in tau friction coefficient
in dx_ex space step
in T final time
Definition at line 121 of file sampson.cpp.
The documentation for this class was generated from the following files:
• Headers/sampson.hpp
• Sources/sampson.cpp
Solution
Selfsimilar_dam_break
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
38 CHAPTER 5. CLASS DOCUMENTATION
Parameters
in par contains all the values from the parameters
Modifies
Solution::dx_ex, Solution::L, Solution::T, Solution::xex, Solution::zex to have the self-similar dam break con-
figuration.
Selfsimilar_dam_break::∼Selfsimilar_dam_break ( ) [virtual]
Destructor.
Definition at line 138 of file selfsimilar_dam_break.cpp.
Modifies
Solution::hex.
Implements Solution.
Definition at line 143 of file selfsimilar_dam_break.cpp.
void Selfsimilar_dam_break::param ( SCALAR L, SCALAR xL, SCALAR xR, SCALAR hinit, SCALAR
k1, SCALAR dx_ex, SCALAR T ) const
• Headers/selfsimilar_dam_break.hpp
• Sources/selfsimilar_dam_break.cpp
Analytic solution.
#include <solution.hpp>
Inheritance diagram for Solution:
5.14. SOLUTION CLASS REFERENCE 39
Solution
Bedload
Bump
Dam_break
Dressler_dam
Inclined_plane
MacDonald_like
MacDonald_like_diffus
MacDonaldB1
MacDonaldB2
Sampson
Selfsimilar_dam_break
Swash
Thacker
Thacker2D
Protected Attributes
• const int NX_EX
• const int NY_EX
• SCALAR T
• SCALAR L
• SCALAR l
• SCALAR dx_ex
• SCALAR dy_ex
• SCALAR ∗ xex
• SCALAR ∗ yex
• SCALAR ∗ hex
• SCALAR ∗ uex
• SCALAR ∗ qex
• SCALAR ∗ zex
Constructor.
Parameters
in par contains all the values from the parameters file
Definition at line 58 of file solution.cpp.
Solution::∼Solution ( ) [virtual]
Destructor.
Definition at line 186 of file solution.cpp.
Note
If a vector cannot be allocated, the code will exit with failure termination code.
void Solution::deallocation ( )
void Solution::head ( Parameters & par, string solutiontype, string solutionchoice ) const
Writes the version of the software and the choice of the solution.
Parameters
in par parameter, contains all the values from the parameters file
in solutiontype name of the type of the solution
in solutionchoice name of the solution
Definition at line 166 of file solution.cpp.
void Solution::savefinal2D ( SCALAR ∗ xex, SCALAR ∗ yex, TAB hex2D, TAB uex2D, TAB vex2D,
TAB zex2D ) const
void Solution::savefinalcritical ( SCALAR ∗ xex, SCALAR ∗ hex, SCALAR ∗ uex, SCALAR ∗ zex )
const
Saves the analytic solution at the final time with the critical height.
Saves x (the position), h (the water height), u (the flow velocity), z (the topography), q (the flow discharge),
z+h (the free surface), Fr (the Froude number) and z+hc (the critical surface).
Parameters
in xex abscissae
in hex water height
in uex flow velocity
42 CHAPTER 5. CLASS DOCUMENTATION
in zex topography
void Solution::savefinalcriticalinit ( SCALAR ∗ xex, SCALAR ∗ hex, SCALAR ∗ uex, SCALAR ∗ zex,
SCALAR ∗ z0 ) const
Saves the analytic solution at the final time with the critical height and the initial topography.
Saves x (the position), h (the water height), u (the flow velocity), z (the topography), q (the flow discharge),
z+h (the free surface), Fr (the Froude number), z+hc (the critical surface), z0 (the initial topography) and z0+h
(the initial surface).
Parameters
in xex abscissae
in hex water height
in uex flow velocity
in zex topography
in z0 initial topography
Definition at line 93 of file solution.cpp.
Space step in x.
Definition at line 83 of file solution.hpp.
Space step in y.
Definition at line 85 of file solution.hpp.
Number of cells in x.
Definition at line 72 of file solution.hpp.
Number of cells in y.
Definition at line 74 of file solution.hpp.
Final time.
Definition at line 77 of file solution.hpp.
• Headers/solution.hpp
• Sources/solution.cpp
Solution
Swash
44 CHAPTER 5. CLASS DOCUMENTATION
Constructor.
Defines the physical parameters and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Modifies
Swash::∼Swash ( ) [virtual]
Destructor.
Definition at line 138 of file swash.cpp.
Parameters
in k the number of the Bessel function (k=0,1 or 2)
in x the point to evaluate the Bessel function
void Swash::ua_eta ( SCALAR x0, SCALAR e, SCALAR a, SCALAR ta, SCALAR xa, SCALAR ∗
result, int sol )
Computes the non-dimensional speed ua and the non-dimensional free surface eta.
Computes the velocity and free surface (using Newton algorithm) at one point and one time.
Parameters
in x0 abscissa changement
in e the initial curvature of the wave
in a the parameter a in the references
in ta non dimentional time
in xa non dimentional abscissa
in result non-dimensional velocity and free surface at (xa,ta)
in sol to choose the transient (sol=1) or periodic (sol=2) solution to compute
• Headers/swash.hpp
• Sources/swash.cpp
• Headers/swash.hpp
Solution
Thacker
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Modifies
Thacker::∼Thacker ( ) [virtual]
Destructor.
Definition at line 88 of file thacker.cpp.
Solution::hex, Solution::uex.
Implements Solution.
Definition at line 93 of file thacker.cpp.
void Thacker::param ( SCALAR L, SCALAR h0, SCALAR a, SCALAR dx_ex, SCALAR T ) const
Solution
Thacker2D
Constructor.
Defines the physical parameters, the final time and prints the header with the configuration.
Parameters
in par contains all the values from the parameters
Modifies
Thacker2D::∼Thacker2D ( ) [virtual]
Destructor.
Definition at line 131 of file thacker2d.cpp.
Implements Solution.
Definition at line 147 of file thacker2d.cpp.
void Thacker2D::param ( SCALAR L, SCALAR l, SCALAR h0, SCALAR a, SCALAR dx_ex, SCALAR
dy_ex, SCALAR T ) const
• Headers/thacker2d.hpp
• Sources/thacker2d.cpp
Chapter 6
File Documentation
Classes
• class Bedload
Computes solutions with bedload.
Macros
• #define BEDLOAD_HPP
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: the bed is moving with bedload, see Berthon et al. [2012].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
51
52 CHAPTER 6. FILE DOCUMENTATION
#define BEDLOAD_HPP
Classes
• class Bump
Computes bump solutions.
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: with a bump, see Delestre et al. [2013] and Goutal and Maurel [1997].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA - Universite Pierre et Marie Curie (France)
#include "solution.hpp"
#include "dam_break.hpp"
#include "selfsimilar_dam_break.hpp"
#include "dressler_dam.hpp"
#include "inclined_plane.hpp"
#include "bump.hpp"
#include "macdonald_like.hpp"
#include "macdonald_like_diffus.hpp"
#include "thacker.hpp"
#include "bedload.hpp"
#include "thacker2d.hpp"
#include "macdonaldb1.hpp"
#include "macdonaldb2.hpp"
#include "sampson.hpp"
#include "swash.hpp"
Classes
• class Choice_solution
Choice of the solution.
Macros
• #define CHOICE_SOLUTION_HPP
Version
1.03.00
Date
2016-01-25
From the value of the corresponding parameter, calls the chosen solution.
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Dam_break
Computes dam break solutions.
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: dam break without friction, see Ritter [1892] Stoker [1957].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Dressler_dam
Computes Dressler dam break solution.
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Inclined_plane
Computes the solutions over an inclined plane.
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA - Universite Pierre et Marie Curie (France)
56 CHAPTER 6. FILE DOCUMENTATION
Classes
• class MacDonald_like
Computes Mac Donald solutions.
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald solutions in 1d, see MacDonald [1996] MacDonald et al. [1997], Delestre et al.
[2013] and Vo T. N. [2008].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class MacDonald_like_diffus
Computes Mac Donald solutions with diffusion.
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald solutions in 1d with diffusion, see Delestre and Marche [2010].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class MacDonaldB1
Computes Mac Donald pseudo 2d solutions.
Author
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald pseudo 2d solutions with bottom B1, see MacDonald [1996].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class MacDonaldB2
Computes Mac Donald pseudo 2d solutions.
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald pseudo 2d solutions with bottom B2, see MacDonald [1996].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Macros
• #define MAX(a, b) (a>=b?a:b)
• #define GRAV 9.81
• #define GRAV_DEM 4.905
• #define PI 3.14159265
• #define EPSILON_H 1.e-12
• #define VERSION "SWASHES version 1.03.00, 2016-01-29"
Typedefs
• typedef double SCALAR
• typedef vector< vector< SCALAR > > TAB
6.11. HEADERS/MISC.HPP FILE REFERENCE 59
Definitions.
Author
Version
1.03.00
Date
2016-01-29
Defines the constants, the types used in the code and contains the ‘include'.
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
#define PI 3.14159265
Gets parameters.
#include "misc.hpp"
Classes
• class Parameters
Gets parameters.
Gets parameters.
Author
Version
1.03.00
Date
2015-10-28
Reads the parameters, checks their values, returns the use if needed.
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Sampson
Computes Sampson solution.
6.14. HEADERS/SELFSIMILAR_DAM_BREAK.HPP FILE REFERENCE 61
Version
1.03.00
Date
2015-10-28
Analytic solution: Sampson parabola with friction, see Sampson et al. [2006] Sampson et al. [2008].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Classes
• class Selfsimilar_dam_break
Computes self-similar dam break solutions.
Version
1.03.00
Date
2015-10-28
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
62 CHAPTER 6. FILE DOCUMENTATION
Classes
• class Solution
Analytic solution.
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Swash
Author
Version
1.03.00
Date
2016-01-25
Analytic solution: swash solutions, see Marche [2005], Carrier and Greenspan [1958]
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Thacker
Computes Thacker solution.
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Classes
• class Thacker2D
Computes Thacker solutions in 2D.
Version
1.03.00
Date
2015-10-28
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Version
1.03.00
Date
2015-10-28
Analytic solution: the bed is moving with bedload, see Berthon et al. [2012].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Version
1.03.00
Date
2015-10-28
Analytic solution: with a bump, see Delestre et al. [2013], Goutal and Maurel [1997].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA - Universite Pierre et Marie Curie (France)
Version
1.03.00
Date
2016-01-25
From the value of the corresponding parameter, calls the chosen solution.
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
66 CHAPTER 6. FILE DOCUMENTATION
Version
1.03.00
Date
2015-10-28
Analytic solution: dam break without friction, see Ritter [1892] Stoker [1957].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Version
1.03.00
Date
2015-10-28
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
6.24. SOURCES/INCLINED_PLANE.CPP FILE REFERENCE 67
Version
1.03.00
Date
2015-10-28
Analytic solution: Delestre et al. [2012].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA - Universite Pierre et Marie Curie (France)
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald solutions in 1d, see MacDonald [1996], MacDonald et al. [1997], Delestre et al.
[2013] and Vo T. N. [2008].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
68 CHAPTER 6. FILE DOCUMENTATION
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald solutions in 1d with diffusion, see Delestre and Marche [2010].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald pseudo 2d solutions with bottom B1, see MacDonald [1996].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
6.28. SOURCES/MACDONALDB2.CPP FILE REFERENCE 69
Version
1.03.00
Date
2015-10-28
Analytic solution: Mac Donald pseudo 2d solutions with bottom B2, see MacDonald [1996].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Version
1.03.00
Date
2016-01-21
Reads the parameters, checks their values, returns the use if needed.
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
70 CHAPTER 6. FILE DOCUMENTATION
Version
1.03.00
Date
2015-10-28
Analytic solution: Sampson parabola with friction, see Sampson et al. [2006] Sampson et al. [2008].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Version
1.03.00
Date
2015-10-28
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
6.32. SOURCES/SOLUTION.CPP FILE REFERENCE 71
Version
1.03.00
Date
2015-10-28
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
Version
1.03.00
Date
2016-01-27
Analytic solution: swash solutions, see Marche [2005], Carrier and Greenspan [1958].
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
(c) CNRS - Universite d'Orleans - INRA (France)
72 CHAPTER 6. FILE DOCUMENTATION
Main file.
#include "choice_solution.hpp"
Functions
Main file.
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
Author
Version
1.03.00
Date
2015-10-28
Copyright
License Cecill-V2
http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
C. Berthon, S. Cordier, O. Delestre, and M.-H. Le. An analytical solution of the Shallow Water system coupled to
the Exner equation. C. R. Acad. Sci. Paris, Ser. I, 350(3–4):183–186, 2012. doi:10.1016/j.crma.2012.01.007.
URL http://hal.archives-ouvertes.fr/hal-00648343. 9, 10, 51, 64
G. F. Carrier and H. P. Greenspan. Water waves of finite amplitude on a sloping beach. Journal of Fluid
Mechanics, 4:97–109, 1958. doi:10.1017/S0022112058000331. URL http://journals.cambridge.
org/article_S0022112058000331. 44, 47, 63, 71
O. Delestre and F. Marche. A numerical scheme for a viscous shallow water model with friction. Journal of
Scientific Computing, pages 1–11, 2010. ISSN 0885-7474. doi:10.1007/s10915-010-9393-y. 26, 27, 57, 68
O. Delestre, C. Lucas, P.-A. Ksinant, F. Darboux, C. Laguerre, T. N. T. Vo, F. James, and S. Cordier. SWASHES: a
compilation of shallow water analytic solutions for hydraulic and environmental studies. International Journal
of Numerical Methods in Fluids, 72(3):269–300, May 2013. doi:10.1002/fld.3741. URL http://hal.
archives-ouvertes.fr/hal-00628246. See Annex on the HAL page for complementary results
(with illustrations of each case). 12, 13, 24, 52, 56, 65, 67, 72
R. F. Dressler. Hydraulic resistance effect upon the dam-break functions. Journal of Research of the National
Bureau of Standards, 49(3):217–225, Sept. 1952. 18, 55, 66
N. Goutal and F. Maurel. Proceedings of the 2nd workshop on dam-break wave simulation. Technical Report
HE-43/97/016/B, Electricité de France, Direction des études et recherches, 1997. 12, 13, 52, 65
I. MacDonald. Analysis and computation of steady open channel flow. PhD thesis, University of Reading —
Department of Mathematics, Sept. 1996. 24, 28, 31, 56, 57, 58, 67, 68, 69
I. MacDonald, M. J. Baines, N. K. Nichols, and P. G. Samuels. Analytic benchmark solutions for open-channel
flows. Journal of Hydraulic Engineering, 123(11):1041–1045, Nov. 1997. 24, 56, 67
F. Marche. Theoretical and numerical study of shallow water models ; applications to nearshore hydrodynamics.
Phd, Université Bordeaux 1, 2005. 44, 47, 63, 71
A. Ritter. Die Fortpflanzung der Wasserwellen. Zeitschrift des Vereines Deuscher Ingenieure, 36(33):947–954,
1892. 16, 17, 54, 66
J. Sampson, A. Easton, and M. Singh. Moving boundary shallow water flow above parabolic bottom topography.
In A. Stacey, B. Blyth, J. Shepherd, and A. J. Roberts, editors, Proceedings of the 7th Biennial Engineering
Mathematics and Applications Conference, EMAC-2005, volume 47 of ANZIAM Journal, pages C373–C387.
Australian Mathematical Society, oct 2006. URL http://journal.austms.org.au/ojs/index.
php/ANZIAMJ/article/view/1050. 36, 61, 70
75
76 BIBLIOGRAPHY
J. Sampson, A. Easton, and M. Singh. Moving boundary shallow water flow in a region with quadratic bathymetry.
In G. N. Mercer and A. J. Roberts, editors, Proceedings of the 8th Biennial Engineering Mathematics and Ap-
plications Conference, EMAC-2007, volume 49 of ANZIAM Journal, pages C666–C680. Australian Math-
ematical Society, 2008. URL http://journal.austms.org.au/ojs/index.php/ANZIAMJ/
article/view/306. 36, 61, 70
J. J. Stoker. Water Waves: The Mathematical Theory with Applications. Pure and Applied Mathematics. Inter-
science Publishers, New York, USA, 1957. 16, 17, 54, 66
W. C. Thacker. Some exact solutions to the nonlinear shallow-water wave equations. Jour-
nal of Fluid Mechanics, 107:499–508, 1981. doi:10.1017/S0022112081001882. URL http:
//journals.cambridge.org/action/displayAbstract?fromPage=online&aid=
389055&fulltextType=RA&fileId=S0022112081001882. 47, 48, 49, 63, 64, 73
T. Vo T. N. One dimensional Saint-Venant system. Master’s thesis, Université d’Orléans, France, June 2008.
URL http://dumas.ccsd.cnrs.fr/dumas-00597434. 24, 56, 67
Index
∼Bedload compute, 10
Bedload, 10 param, 10
∼Bump paramwarning, 11
Bump, 12 bedload.hpp
∼Choice_solution BEDLOAD_HPP, 52
Choice_solution, 15 Bump, 11
∼Dam_break ∼Bump, 12
Dam_break, 16 abcd, 12
∼Dressler_dam Bump, 12
Dressler_dam, 18 compute, 13
∼Inclined_plane determinant, 13
Inclined_plane, 21 height, 13
∼MacDonaldB1 p, 13
MacDonaldB1, 28 param, 14
∼MacDonaldB2 q, 14
MacDonaldB2, 31 RHJump, 14
∼MacDonald_like
MacDonald_like, 24 CHOICE_SOLUTION_HPP
∼MacDonald_like_diffus choice_solution.hpp, 53
MacDonald_like_diffus, 26 choice
∼Parameters Parameters, 35
Parameters, 33 Choice_solution, 15
∼Sampson ∼Choice_solution, 15
Sampson, 36 Choice_solution, 15
∼Selfsimilar_dam_break compute, 15
Selfsimilar_dam_break, 38 choice_solution.hpp
∼Solution CHOICE_SOLUTION_HPP, 53
Solution, 40 choicedim
∼Swash Parameters, 35
Swash, 44 choicedomain
∼Thacker Parameters, 35
Thacker, 47 choicetype
∼Thacker2D Parameters, 35
Thacker2D, 49 compute
Bedload, 10
abcd Bump, 13
Bump, 12 Choice_solution, 15
Inclined_plane, 21 Dam_break, 17
allocation Dressler_dam, 18
Solution, 40 Inclined_plane, 21
MacDonald_like, 24
BEDLOAD_HPP MacDonald_like_diffus, 27
bedload.hpp, 52 MacDonaldB1, 28
Bedload, 9 MacDonaldB2, 31
∼Bedload, 10 Sampson, 36
Bedload, 9 Selfsimilar_dam_break, 38
77
78 INDEX
Solution, 40 get_nyex
Swash, 44 Parameters, 34
Thacker, 48
Thacker2D, 49 head
Solution, 41
Dam_break, 16 Headers/bedload.hpp, 51
∼Dam_break, 16 Headers/bump.hpp, 52
compute, 17 Headers/choice_solution.hpp, 52
Dam_break, 16 Headers/dam_break.hpp, 54
function, 17 Headers/dressler_dam.hpp, 54
param, 17 Headers/inclined_plane.hpp, 55
deallocation Headers/macdonald_like.hpp, 56
Solution, 41 Headers/macdonald_like_diffus.hpp, 56
Delta_topo Headers/macdonaldb1.hpp, 57
MacDonaldB1, 28 Headers/macdonaldb2.hpp, 57
MacDonaldB2, 31 Headers/misc.hpp, 58
Delta_topo_Darcy_Weisbach Headers/parameters.hpp, 60
MacDonald_like, 24 Headers/sampson.hpp, 60
Delta_topo_Manning Headers/selfsimilar_dam_break.hpp, 61
MacDonald_like, 25 Headers/solution.hpp, 62
Delta_topo_diffus Headers/swash.hpp, 62
MacDonald_like_diffus, 27 Headers/thacker.hpp, 63
determinant Headers/thacker2d.hpp, 63
Bump, 13 height
Inclined_plane, 21 Bump, 13
Dressler_dam, 17 Inclined_plane, 22
∼Dressler_dam, 18 help
compute, 18 Parameters, 34
Dressler_dam, 18 hex
param, 18 Solution, 42
dx_ex
Solution, 42 Inclined_plane, 20
dy_ex ∼Inclined_plane, 21
Solution, 42 abcd, 21
compute, 21
EPSILON_H determinant, 21
misc.hpp, 59 height, 22
Inclined_plane, 21
function
p, 22
Dam_break, 17
param, 22
GRAV q, 23
misc.hpp, 59
J
GRAV_DEM
Swash, 44
misc.hpp, 59
get_choice L
Parameters, 34 Solution, 42
get_choicedim l
Parameters, 34 Solution, 42
get_choicedomain leftcondition
Parameters, 34 Swash, 46
get_choicetype
Parameters, 34 MAX
get_nxex misc.hpp, 59
Parameters, 34 MacDonald_like, 23
INDEX 79
∼MacDonald_like, 24 Dressler_dam, 18
compute, 24 Inclined_plane, 22
Delta_topo_Darcy_Weisbach, 24 MacDonald_like, 25
Delta_topo_Manning, 25 MacDonald_like_diffus, 27
MacDonald_like, 24 MacDonaldB1, 30
param, 25 MacDonaldB2, 32
MacDonald_like_diffus, 25 Sampson, 36
∼MacDonald_like_diffus, 26 Selfsimilar_dam_break, 38
compute, 27 Swash, 46
Delta_topo_diffus, 27 Thacker, 48
MacDonald_like_diffus, 26 Thacker2D, 49
param, 27 Parameters, 32
MacDonaldB1, 27 ∼Parameters, 33
∼MacDonaldB1, 28 choice, 35
compute, 28 choicedim, 35
Delta_topo, 28 choicedomain, 35
MacDonaldB1, 28 choicetype, 35
param, 30 get_choice, 34
MacDonaldB2, 30 get_choicedim, 34
∼MacDonaldB2, 31 get_choicedomain, 34
compute, 31 get_choicetype, 34
Delta_topo, 31 get_nxex, 34
MacDonaldB2, 31 get_nyex, 34
param, 32 help, 34
main nx_ex, 35
swashes.cpp, 72 ny_ex, 35
misc.hpp Parameters, 33
EPSILON_H, 59 paramwarning
GRAV, 59 Bedload, 11
GRAV_DEM, 59
MAX, 59 q
PI, 59 Bump, 14
SCALAR, 59 Inclined_plane, 23
TAB, 59 qex
VERSION, 59 Solution, 43
NX_EX RHJump
Solution, 42 Bump, 14
NY_EX
Solution, 43 SCALAR
nx_ex misc.hpp, 59
Parameters, 35 Sampson, 35
ny_ex ∼Sampson, 36
Parameters, 35 compute, 36
param, 36
p Sampson, 36
Bump, 13 savefinal2D
Inclined_plane, 22 Solution, 41
PI savefinalcritical
misc.hpp, 59 Solution, 41
param savefinalcriticalinit
Bedload, 10 Solution, 42
Bump, 14 savefinalmu
Dam_break, 17 Solution, 42
80 INDEX
Selfsimilar_dam_break, 37 Swash, 44
∼Selfsimilar_dam_break, 38 ua_eta, 46
compute, 38 Swash_solution, 46
param, 38 swashes.cpp
Selfsimilar_dam_break, 37 main, 72
Solution, 38
T
∼Solution, 40
Solution, 43
allocation, 40
TAB
compute, 40
misc.hpp, 59
deallocation, 41
Thacker, 47
dx_ex, 42
∼Thacker, 47
dy_ex, 42
compute, 48
head, 41
param, 48
hex, 42
Thacker, 47
L, 42
Thacker2D, 48
l, 42
∼Thacker2D, 49
NX_EX, 42
compute, 49
NY_EX, 43
param, 49
qex, 43
Thacker2D, 49
savefinal2D, 41
savefinalcritical, 41 ua_eta
savefinalcriticalinit, 42 Swash, 46
savefinalmu, 42 uex
Solution, 40 Solution, 43
T, 43
uex, 43 VERSION
xex, 43 misc.hpp, 59
yex, 43
xex
zex, 43
Solution, 43
Sources/bedload.cpp, 64
Sources/bump.cpp, 65 yex
Sources/choice_solution.cpp, 65 Solution, 43
Sources/dam_break.cpp, 66
Sources/dressler_dam.cpp, 66 zex
Sources/inclined_plane.cpp, 67 Solution, 43
Sources/macdonald_like.cpp, 67
Sources/macdonald_like_diffus.cpp, 68
Sources/macdonaldb1.cpp, 68
Sources/macdonaldb2.cpp, 69
Sources/parameters.cpp, 69
Sources/sampson.cpp, 70
Sources/selfsimilar_dam_break.cpp, 70
Sources/solution.cpp, 71
Sources/swash.cpp, 71
Sources/swashes.cpp, 72
Sources/thacker.cpp, 72
Sources/thacker2d.cpp, 73
Swash, 43
∼Swash, 44
compute, 44
J, 44
leftcondition, 46
param, 46