From df11f08c3dbebb9693c62356cd3b1518972170b9 Mon Sep 17 00:00:00 2001 From: Randy LeVeque Date: Fri, 15 Mar 2024 12:42:44 -0700 Subject: [PATCH] working on dev/bouss* --- dev/bouss1d.html | 18 ++---- dev/bouss2d.html | 162 +++++++++++++++++++++++++++-------------------- 2 files changed, 99 insertions(+), 81 deletions(-) diff --git a/dev/bouss1d.html b/dev/bouss1d.html index 1af4fa668..0a5e578b8 100644 --- a/dev/bouss1d.html +++ b/dev/bouss1d.html @@ -93,7 +93,7 @@

Navigation

As of Version 5.10.0 (?), the geoclaw repository contains some code for solving problems in one space dimension, as described more generally in -GeoClaw in One Space Dimension. This code also supports two different sets of +GeoClaw in One Space Dimension. This 1d code also supports two different sets of dispersive Boussinesq equations that have been used in the literature to better model wave propagation in situations where the wavelength is not sufficiently long relative to the fluid depth for the shallow water @@ -108,7 +108,10 @@

Navigation

In one space dimension, solving this equation requires solving a tridiagonal linear system of equations in each time step.

See Boussinesq solvers in Two Space Dimensions and [BergerLeVeque2023] for more discussion -of the Boussinesq-type equations SGN and MS that are implemented in GeoClaw.

+of the Boussinesq-type equations SGN and MS that are implemented in GeoClaw. +We recommend using the Serre-Green-Naghdi (SGN) equations rather than +Madsen-Sorensen (MS), which has similar dispersive properties but +been found to be less stable.

Using the 1d Boussinesq code

As in the 1d shallow water implementation, general mapped grids can be used, @@ -250,17 +253,6 @@

Quick search

-

Latest Version

- -

Older Versions

- -
diff --git a/dev/bouss2d.html b/dev/bouss2d.html index 01a97756a..1f8f7ac23 100644 --- a/dev/bouss2d.html +++ b/dev/bouss2d.html @@ -91,33 +91,41 @@

Navigation

Warning

Not yet incorporated in clawpack master branch or releases.

-

As of Version 5.10.0 (?), GeoClaw supports two different sets of -dispersive Boussinesq-type equations that have been used in the literature +

As of Version 5.10.0 (?), GeoClaw includes the option to solve a +dispersive Boussinesq-type equation known as Serre-Green-Naghdi (SGN) +instead of the usual shallow water equations (SWE). +This equation and related depth-averaged equations have been used +extensively in the literature to better model wave propagation in situations where the wavelength is not -sufficiently long relative to the fluid depth for the shallow water -equation approximation to be accurate. The one-dimensional version of these -capabilities are described in Boussinesq solvers in One Space Dimension.

-

These Boussinesq equations are still depth-averaged equations, with the same +sufficiently long relative to the fluid depth for the SWE +approximation to be accurate. Applications include the study +of tsunamis generated by landslides, asteroid impacts, or other localized +phenomena. Including dispersive terms has also been found to give more +realistic results for earthquake-generated tsunamis in some situations. +See [BergerLeVeque2023] for references to some of this literature along +with more discussion of the GeoClaw implementation and test problems.

+

The one-dimensional version of these capabilities are +described in Boussinesq solvers in One Space Dimension.

+

The SGN equations are still depth-averaged equations, with the same conserved quantities (fluid depth h and momenta hu and hv in 2D) as the shallow water equations (SWE), but the equations contain higher order derivative terms and so they are no longer hyperbolic and require implicit methods for efficient solution with a physically reasonable time step. This adds considerable complexity to the -code since adaptive mesh refinement (AMR) is still supported.

-

The equations implemented include third-order derivatives -with respect to txx, tyy, and txy. -However, the implementations proceed by alternating -steps with the shallow water equations (SWE) and the solution of elliptic -equations that involve second order derivatives in x and y but no -time derivatives.

+code since adaptive mesh refinement (AMR) is still supported. +The implementation proceeds by alternating time +steps on the shallow water equations (SWE) with the solution of elliptic +equations where the operator involves second order derivatives in x and y +of a new set of variables used to modify the momenta each time step. +The right hand side also involves third order derivatives of the topography.

In two space dimensions, solving this -elliptic equation requires solving a sparse +elliptic equation requires setting up and solving a sparse linear system of equations in each time step, at each refinement level when -AMR is being used. The structure of this system is complicated by the need -to include all grid cells from all patches at the same refinement level -in the linear system that is solved. Boundary conditions at the edge of +AMR is being used. All grid cells from all patches at +the same refinement level +are included in the linear system. Boundary conditions at the edge of patches must be interpolated from coarser level solutions, in much the same -way that the boundaary conditions for h, hu, and hv are interpolated +way that the boundary conditions for h, hu, and hv are interpolated when solving the SWE with AMR. Because the solution of the elliptic system yields correction terms to the momenta (denoted here by huc and hvc), when solving the Boussinesq equations the array q of state variables @@ -129,42 +137,52 @@

Navigation

sparse elliptic systems is PETSc, which can use MPI to solve these these systems. Using the Boussinesq solvers requires these prerequesites, as discussed further in Prerequisites for the 2d Boussinesq code.

-

See [BergerLeVeque2023] for more discussion of the equations solved and the -AMR strategy used.

+

See [BergerLeVeque2023] for more discussion of the equations solved and the +AMR algorithms developed for these equations.

Boussinesq-type dispersive equations

The equations we solve are not the original depth-averaged dispersive equations derived by Boussinesq, but for simplicity -in this documentation and the code, we refer to the +in this documentation and the code, we often refer to the equations simply as “Boussinesq equations”, following common practice. Many variants of these equations have been derived and fine-tuned to better match the dispersion relation of the linearized Airy wave theory and to incorporate variable bottom topography.

-

Two variants are currently implement in GeoClaw, described below.

+

Two variants are currently implement in GeoClaw, described below. +In practice we recommend using only the SGN equations, which we have found +to be more stable.

The SGN equations

-

The recommended set of equations to use are a modification of the -Serre-Green-Naghdi (SGN) equations with the addition of a parameter alpha +

The Serre-Green-Naghdi (SGN) equations implemented in GeoClaw +are generalized to include a parameter alpha suggested by Bonneton et al. Both the 1D and 2D versions of these equations -and their GeoClaw implementation are discussed in [BergerLeVeque2023]. +and their GeoClaw implementation are discussed in [BergerLeVeque2023]. Setting alpha = 1 gives the original SGN equations, but alpha = 1.153 is recommended since it gives a better approximation to the linear dispersion -relation of the Airy solution to the full 3d problem.

+relation of the Airy solution to the full 3d problem. This value is +hardwired into $CLAW/geoclaw/src/2d/bouss/bouss_module.f90. To change +this value, you must modify this module. (See Library routines in Makefiles +for tips on modifying a library routine.)

The Madsen-Sorensen (MS) equations

-

These equations also give a good approximation to the linear dispersion -relation of the Airy solution when the parameter beta = 1/15 is used. -These equations were used in an earlier GeoClaw implementation known as -BoussClaw. [Todo: add citations] -These have been reimplemented in GeoClaw more recently, -including a 2d implementation that allows the use of AMR. However, -extensive tests with these equations have revealed some stability issues, -particularly in the case of AMR, which have also been reported by others. -The 1D MS implementation is included in GeoClaw but it is generally not -recommended except for those interested in comparing different formulations +

Primarily for historical reasons, GeoClaw also includes an implementation of +another Boussinesq-type dispersive system, the Madsen-Sorensen (MS) equations. +These equations also give a good approximation to the linear dispersion +relation of the Airy solution when the parameter beta = 1/15 is used, +which is hardwired into $CLAW/geoclaw/src/2d/bouss/bouss_module.f90. +These equations were used in an earlier GeoClaw implementation +by Jihwan Kim, known as BoussClaw [KimEtAl2017]. +This implementation was successfully used in a number of studies +(see [BergerLeVeque2023] for some citations). +However, extensive tests with these equations have revealed stability issues, +particularly with the use of AMR, which have also been reported by others. +Implementations of MS in both 1D and 2D are included in GeoClaw, +but are generally not +recommended except for those interested in comparing different +formulations for small numbers of time steps, and perhaps further investigating the stability issues.

@@ -195,23 +213,19 @@

Navigation

rundata.bouss_data.bouss_min_level = 1 # coarsest level to apply bouss rundata.bouss_data.bouss_max_level = 10 # finest level to apply bouss rundata.bouss_data.bouss_min_depth = 10. # depth (meters) to switch to SWE -rundata.bouss_data.bouss_solver = 3 # 1=GMRES, 2=Pardiso, 3=PETSc +rundata.bouss_data.bouss_solver = 3 # 3=PETSc rundata.bouss_data.bouss_tstart = 0. # time to switch from SWE -

These parameters control:

-
    +

    These parameters are described below:

    +
    • bouss_equations: The system of equations being solved. Setting this to 2 -gives the recommended SGN equations.

      -

      The value alpha = 1.153 recommended for SGN is -hardwired into $CLAW/geoclaw/src/2d/bouss/bouss_module.f90. To change -this value, you must modify this module. (See Library routines in Makefiles -for tips on modifying a library routine.) Similarly, if you set -bouss_equations = 1 for the Madsen-Sorensen equations, the recommended -parameter value B = 1/15 is set in bouss_module.f90.

      -

      Setting bouss_equations = 0 causes the code to revert to the shallow -water equations, useful for comparing dispersive and nondispersive results.

      -
    • +gives the recommended SGN equations, while 1 gives Madsen-Sorensen. +Setting bouss_equations = 0 causes the code to revert to the shallow +water equations, useful for comparing dispersive and nondispersive results. +(But if bouss_data is being set, it still requires clawdata.num_eqn = 5 +and the two new components in q are always 0 in this case, so this is +slightly less efficient than using the standard GeoClaw.)

    • bouss_min_level: The minimum AMR level on which Boussinesq correction terms should be applied. In some cases it may be desirable to use the SWE on the coarsest grids in the ocean while Boussinesq corrections are only @@ -225,7 +239,8 @@

      Navigation

      in some situations.

    • bouss_min_depth: The criterion used for switching from Boussinesq to SWE in shallow water and onshore. If the original water depth h at time t0 -is less than bouss_min_depth in a cell or any of its nearest neighbors, +is less than bouss_min_depth in a cell or any of its nearest +neighbors in a 3-by-3 neighborhood, then this cell is omitted from set of unknowns in the elliptic equation solve and no dispersive correction terms are calculated for this cell. This is discussed further below in Wave breaking and switching to SWE.

    • @@ -233,11 +248,11 @@

      Navigation

      3 for PETSc is recognized.

    • bouss_tstart: The time t at which to start applying Boussinesq terms. Normally you will want this to be less than or equal to t0, the starting -time of the calculation (which is usually but not always 0). However, +time of the calculation (which is not always 0). However, there are some cases in which the initial data results in extreme motion in the first few time steps and it is necessary to get things going with the SWE. For most applications this is not necessary and you need -only change this parameter if you have set t0 < 0.

    • +only change this parameter if you are solving a problem for which t0 < 0.

@@ -254,6 +269,9 @@

Navigation

Two Makefile variables PETSC_DIR and PETSC_ARCH must be set (perhaps as environment variables in the shell from which make is invoked). These are described further below in Prerequisites for the 2d Boussinesq code.

+

The FFLAGS specified in the Makefile should include -DHAVE_PETSC +to indicate that PETSc is being used, necessary when compiling some of the +source code.

The Makefile should also include a line of the form:

PETSC_OPTIONS=-options_file $(CLAW)/geoclaw/examples/bouss/petscMPIoptions
 
@@ -261,9 +279,18 @@

Navigation

with a pointer to the file that sets various PETSc options. The file $CLAW/geoclaw/examples/bouss/petscMPIoptions gives the options used in the examples, which may be adequate for other problems too. -[Todo: more description of options?]

+This file includes some comments briefly explaining the options set. +We use KSP (a Krylov space method) as the main solver +and GMRES as the preconditioner (pc). For more about the options for +these methods, see:

+
+

In addition to a line of the form

-
EXE = $(PWD)/xgeoclaw
+
EXE = xgeoclaw
 

that specifies the name and location of the executable to be generated, the @@ -291,8 +318,10 @@

Navigation

part of installing PETSc. If you already have some of the prerequisites installed, be sure to read Configuring PETSc before installing.

-

[Todo: How to set `$PETSC_DIR` And `$PETSC_ARCH`]

-

See also the PETSc documentation page +

The environment variables $PETSC_DIR And $PETSC_ARCH must be set +appropriately based on your PETSc installation, either as environment +variables or directly in the Makefile. +See the PETSc documentation page Environmental Variables $PETSC_DIR And $PETSC_ARCH

@@ -304,7 +333,14 @@

Navigation

literature. So far we have only implemented the simplest common approach, which is to revert to SWE in any grid cell where the initial water depth (at the initial time) is less than bouss_min_depth.

-

[Todo: Add more discussion.]

+
+
+

Examples

+

In addition to one example application included in GeoClaw, found in the +directory $CLAW/geoclaw/examples/bouss/radial_flat, several other examples +of usage can be found in the code repository +https://github.com/rjleveque/ImplicitAMR-paper, which was +developed to accompany the paper [BergerLeVeque2023].

@@ -334,6 +370,7 @@

Table of Contents

  • Prerequisites for the 2d Boussinesq code
  • Wave breaking and switching to SWE
  • +
  • Examples
  • @@ -377,17 +414,6 @@

    Quick search

    -

    Latest Version

    - -

    Older Versions

    - -