Skip to content

How to change the simulation parameters ?

tgregov edited this page May 19, 2019 · 7 revisions

Structure

To run the code, two parameters have to be introduced:

  • a .msh path, that contains the address of the mesh;
  • a .dat path, that contains the address of the parameters of the simulation;
  • a .msh path, that will be the location of the results mesh file.

For example, ./main.exe myMesh.msh param.dat results.msh could be a correct usage.

Mesh file

The mesh file can be generated using Gmsh. One can then create a .geo file that will contain the geometry information. This can be done either through the graphic interface, or using Gmsh's scripting language (i.e. through code lines). Then, the .msh file can be generated. It is that file that should be put as the first parameter of the executable program.

Parameters

The .dat parameter file typically looks like that:

Gauss10
Lagrange
RK1
strong
0.1
0.0000001
0.001
shallow
1,0,0,0,0
LF
9.81
sourceShallowCstGradCstFrict
1000,0.0001,1,0,2
BC_Left
	openShallow
	10
BC_Right
	openShallow
	10
BC_Up
	openShallow
	10
BC_Down
	reflectShallow
	0
Init_Cond
	gaussian2DShallow
	0.3,0.5,0.005,0.5,0.005,10

which corresponds to the following options:

Gauss integration

Gauss10
Degree used for Gauss integration; in this case, this means that for a polynomial of degree 6 or lower, there will be enough Gauss points for the integration to be exact.

Shape functions

Lagrange
Family of the shape functions used.

Time-integration

RK1
Time-integration scheme used; four options are available:

  • Explicit Euler (RK1);
  • Runge-Kutta of order 2 (RK2);
  • Runge-Kutta of order 3 (RK3);
  • Runge-Kutta of order 4 (RK4).

DG Formulation

strong
Formulation of the DG method; it can either be:

  • the strong formulation (strong);
  • the weak formulation (weak).

Time steps

0.1: simulation time [s];
0.001: integration time step [s];
0.01: saving frequency [s]; in this case, this means that only the simulations at times 0, 0.01, 0.02, ... [s] will be saved.

Problem type

shallow
Problem type. Three options are available (this fixes the physical flux used):

  • constant velocity transport equation (transport);
  • (non-linear) shallow water equations (shallow);
  • linearized shallow water equations (shallowLin).

Writer

1,0,0,0,0
Those values describe what will be written in the results.msh file, by putting one at each data you want to write. The available writeable data for each problem type can be found in writer/writer.hpp

Numerical flux

LF
Numerical flux type. Possibilites:

  • mean ("centered") flux (mean);
  • Lax-Friedrichs ("upwind") flux (LF);
  • Roe flux (Roe): only for shallow water equations.

Physical parameters

9.81
Options for the physical parameters:

  • for transport equation, two components of the transport velocity a, e.g. 1.0,0.0 [m/s];
  • for (non-linear) shallow water equation, gravity constant g, e.g. 9.81 [m/s2];
  • for linearized shallow water equations, gravity constant g, e.g. 9.81 [m/s2], and mean height h, e.g. 10.0 [m].

Source terms

sourceShallowCstGradCstFrict
1000,0.0001,1,0,2
Type of source terms and associated parameters. Possibilities:

  • no: no source term, no associated parameters (do not put a new line after)
  • sourceShallowCstGradCstFrict (only for (non-linear) shallow waters): constant bathymetric gradient, and friction with constant coefficient, with the following parameters:
    • density ρ (e.g. 1000 [kg/m3]);
    • (constant) Coriolis frequency f (e.g. 0.0001 [s^-1]);
    • bathymetric gradient ∂h/∂x (e.g. 1.0 [-]);
    • bathymetric gradient ∂h/∂y (e.g. 0.0 [-]);
    • parameter γ of a friction law τv (e.g. 2 [kg/m2/s]).
  • sourceShallowCstGradQuadFrict (only for (non-linear) shallow waters): constant bathymetric gradient, and quadratic friction (proportional to the velocity norm squared), with the following parameters:
    • density ρ (e.g. 1000 [kg/m3]);
    • (constant) Coriolis frequency f (e.g. 0.0001 [-]);
    • bathymetric gradient ∂h/∂x (e.g. 1.0 [-]);
    • bathymetric gradient ∂h/∂y (e.g. 0.0 [-]);
    • parameter γ of a friction law τ=γ|v|v (e.g. 2 [kg/m2/s]).
  • sourceShallowLinCst (only for linearized shallow waters): no bathymetric gradient nor friction, with the following coefficients:
    • (constant) Coriolis frequency f (e.g. 0.0001 [s^-1]);

Boundary

BC_Left
(indent)openShallow
(indent)10
BC_Right
(indent)openShallow
(indent)10
BC_Up
(indent)openShallow
(indent)10
BC_Down
(indent)reflectShallow
(indent)0
Name of the physical entity to which a boundary condition is linked (it should be named when defining the .geo geometry), followed by the type of boundary condition, and the associated parameters. Possibilities:

  • see /params/ibvFunctions.hpp for the complete description

Initial condition

Init_Cond
(indent)gaussian2DShallow
(indent)0.3,0.5,0.005,0.5,0.005,10
Type of initial condition, and the associated parameters. Possibilities:

  • see /params/ibvFunctions.hpp for the complete description

Home

Clone this wiki locally