telemac-3dmathocean.math.cnrs.fr/presentations/hervouet.pdf · general features of numerical...
TRANSCRIPT
TELEMAC-3D
Non hydrostatic 3D Navier-Stokes equations with a free surface The Telemac system
Why 3 dimensions?
Navier-Stokes equations
The 3 main difficulties
Building the mesh Survival in a moving mesh
Dynamic pressure
Other topics Dry zones Parallelism
The aspect ratio The 2-plane case Non linear waves
Applications
Jean-Michel Hervouet EDF Lab Laboratoire National d’Hydraulique et Environnement
I do not know what I may appear to the world, but to myself I seem to have been only like a boy playing on the seashore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me.
Isaac Newton
Laboratoire National d’Hydraulique et Environnement
2
http://www.opentelemac.org
2500 active users
14000 messages on the forum
110 countries
130 persons in 2011 user club in Paris
12000 downloads of User Club proceedings in 2013
Groundwater flows
Sediment
Hydrodynamics
Water Quality
Waves
TELEMAC-2D TELEMAC-3D
SISYPHE Included in TELEMAC-2D or 3D
Coupling with Delwaq
TELEMAC-3D
ESTEL-2D ESTEL-3D
ARTEMIS
TOMAWAC
2 dimensions 3 dimensions
MASCARET
COURLIS - MOBILI
TRACER
1 dimension Mesh generators : Blue Kenue, Janet Pre-processing FUDAA-MASCARET
Post-processing FUDAA-MASCARET
FUDAA-PREPRO Blue KENUE (© CNRC-CHC),
TECPLOT / PARAVIEW
The Telemac-Mascaret hydroinformatic system
4
A consortium to provide manpower and steer developments
• A first circle of industrial, engineering, institutional, academic partners willing to reinforce/enhance the development of the system, and ensuring the industrial quality and validation standards.
• The group decides the integration process and development plan, promotion and assistance, … and engage resources/responsibility for developments, integration of new features, documentation, validation, promotion …). Minimum resources: 2 persons/year
• A steering committee, advised by a scientific committee : – Decides the technical, strategic and further developments
orientations, as well as the valorisation strategy – Defines the priority in the common developments and way of doing
them (internal resources of the members, call to Open source community, ….)
– Checks if the developments fulfil the desired quality standards (validation and documentation)
• A specific internet site for the consortium:
– To deliver and download the new reference versions – To call Opensource community for new developments – To receive new developments from the community – To animate the community Forum of users
Where to get details?
Book: hydrodynamics of free surface flows Modelling with the finite element method (3D part mostly after Jean-Marc Janin) Telemac release notes: versions 5.7, 5.8, 5.9, 6.0, 6.1, 6.2, 6.3 On Telemac website www.opentelemac.org Astrid Decoene PhD: Hydrostatic model for 3D free surface flows and numerical schemes
Why 3 dimensions?
Because real life has 3 dimensions!
Courtesy Sébastien Bourban
Simplifying complexifies!
d
if d tends to infinity, the hydraulic radius tends to 0, the friction tends to infinity, the river stops flowing…
In 1D: a counter-example…
In 2D: a tracer depth-averaged concentration is not the conservative variable…
∫=s
f
Z
ZdzC
hc 1
Depth-averaged concentration conservative variable
∫=s
f
Z
ZdzCch
Differences in solutions…
H h
Saint-Venant theory, neglecting upstream velocity:
ghHlQ 2µ=
...3849.0332
==µ
After Bazin:
p
⎥⎦
⎤⎢⎣
⎡
++⎥⎦
⎤⎢⎣
⎡ += 2)(55.01003.0405.0pH
HH
µ
After Rehbock: µ between 0.4023 and 0.513
Discharge over a weir…
Simplifying complexifies!
Improvement of Saint-Venant equations by Boussinesq (1877)
Term added to left-hand side of Saint-Venant momentum equation:
⎥⎥⎦
⎤
⎢⎢⎣
⎡⎟⎟⎠
⎞⎜⎜⎝
⎛
∂
∂−⎥⎥⎦
⎤
⎢⎢⎣
⎡⎟⎟⎠
⎞⎜⎜⎝
⎛
∂
∂
tUHdivgradH
tUdivgradH
!!
00
20
26
H0 reference depth. Propagation on dry bed unchanged, steady flow unchanged…
3D modelling of free surface flows, SimHydro 2012 Sophia-Antipolis 12-14 September 2012
Solitary wave in a canal with constant depth depth = 10 m wave height = 2 m
Mesh size: 0.1 m time step: 0.1 s C.F.L.: 10,84
Saint-Venant and Boussinesq solutions
20 s 40 s 60 s
What Navier-Stokes equations?
Telemac-3D
Reynolds Averaged Free surface 3D incompressible Navier-Stokes Equations
With or without hydrostatic pressure assumption
Advection and diffusion of tracers and/or sediment
Results : water depth, 3 components of velocity,
concentrations of tracers or sediment
What we would like to solve:
0)( =+∂
∂ Udivt
!ρ
ρ
FgdivUUtU !!!!!
++=⊗∇+∂
∂ )()()(σρ
ρ
Mass conservation with variable density:
Momentum with stress tensor , gravity and source terms:
Energy with thermal conduction and radiation:
rqUUete
+∇−∇=∇+∂
∂ )().()()( !!σρ
ρ
Assumptions and simplifications…
0)( =Udiv!
Newtonian fluid:
Incompressible fluid (constant density)?
But what about heat, salt, and sediments? Boussinesq approximation!
Dp µδσ 2+−= ( )UUD t!!
∇+∇=21
No specific equation for energy
Reynolds averaged:
ρµ
νν =ofinsteadt
The Boussinesq approximation (1/2)
0)(0)( ==>= UdivUdiv!!
ρ
⎟⎟⎠
⎞⎜⎜⎝
⎛ Δ−∇−
00
111)(1ρρ
ρρρwrittenispin
Continuity equation:
Momentum equation:
...1 linearareandFEinsoρ
ρ
The Boussinesq approximation (2/2)
)(0
sZg ∇Δ
ρρ
∫Δ
+−+=sZ
zsatm dzgzZgpzp0
00 )()(ρρ
ρρHydrostatic pressure:
Compared to constant density, 2 extra terms in momentum: (second order terms neglected)
⎟⎟⎠
⎞⎜⎜⎝
⎛ Δ∇− ∫
sZ
zdzg
0ρρ
barotropic effect (depth independent)
baroclinic effect (depth dependent)
(This is hydrostatic pressure, only a part of the pressure…)
These terms apply to U and V, this is paradoxical…
The final equations: continuity and momentum
0)( =Udiv!
xt fUgraddivxpUgradU
tU
+ν+∂
∂
ρ−=+
∂
∂ ))((1)(.0
!
yt fVgraddivypVgradU
tV
+ν+∂
∂
ρ−=+
∂
∂ ))((1)(.0
!
zt fWgraddivzpWgradU
tW
+ν+∂
∂
ρ−=+
∂
∂ ))((1)(.0
!
Advection (non conservative form)
Turbulent diffusion
Source terms
(next slide…)
Pressure terms
Eulerian (fixed point…) derivative in time
General features of numerical schemes in Telemac-3D
Implicit schemes (linear systems solved with CG, GMRES, direct, etc.)
Matrices stored Element By Element (EBE) or Edge-Based
Depth, pressure, velocities colocalised
Advection schemes:
Method of characteristics: strong and weak form (ELLAM)
Streamline Upwind Petrov-Galerkin
N-Edge-based Residual Distributive (NERD, 2011)
Distributive schemes (N, PSI, prisms, enhanced predictor corrector)
The source terms in Telemac-3D (see subroutine trisou and wave_equation, version 7.0)
Buoyancy (heat, salt, sediment…) : in Fx, Fy (from Boussinesq approximation)
Coriolis force : in Fx, Fy , Fz not done…
Tide generating force : in Fx, Fy
Wave driven currents : in Fx, Fy , 3D term not done
Momentum from sources : in Fx, Fy , Fz not done…
Atmospheric pressure gradient : in Fx, Fy
Pressure gradients (other than buoyancy and non-hydrostatic pressure)
...1... +∂
∂−
∂
∂−=+
∂
∂
xZg
xp
tU s
atm
ρ
...1... +∂
∂−
∂
∂−=+
∂
∂
yZg
yp
tV s
atm
ρ
fs ZhZ +=
3D Navier-Stokes equations with a free surface
The 3 main numerical difficulties:
Computing the free surface and building the mesh
Writing equations in a moving mesh
Non hydrostatic pressure
Building the mesh
Computing the free surface and building the mesh
Goal: building a 3D mesh between the bottom and the free surface
Problem: how to get the free surface before the mesh?
Solution: a 2D mesh, prisms and the Saint-Venant continuity equation
Superimposing meshes of triangles
= 3D meshes of prisms
Every prism can be split into 3 tetrahedra…
But edges of 2 tetrahedra must not cross!
The Saint-Venant continuity equation
It is exact (no approximation in its derivation)
0)( =+∂∂ uhdivth !
01== ∫ dzU
hu s
f
Z
Z
!!with:
Idea: solving the Saint-Venant equations to get the depth
(the first versions of Telemac-3D called Telemac-2D)
Solving the Saint-Venant equations: a bad idea!
1) Hidden hydrostatic approximation
2) An unexpected problem:
The sum over the vertical of discretised 3D continuity
equations is not the discretised Saint-Venant continuity equation
(sum over the vertical and discretisation do not commute)
Effect of neglecting the dynamic pressure to compute the free surface…
2006
2005
Sum over the vertical and discretisation do not commute…
Solution: first discretising the 3D equations, then summing them over the vertical
Computing the free surface: Solving a pseudo Saint-Venant continuity equation which is a discrete
sum over the vertical of 3D continuity equations:
0)( =+∂
∂∫ dzUdiv
th s
f
Z
Z
!
The 3D velocity is a predictor value taken from 3D momentum equations and computed in the 3D mesh of the previous time step
dzUsf
Z
Z∫!
is in fact a discrete sum over the vertical
(Importance of superimposing 2D meshes to get vertical lines!)
This predictor velocity would be explicit, but we can do better!
The idea of the pseudo-wave equation (1/2)
.........)(... ++∇−=+∂
∂fZhg
tU
Due to the hydrostatic part of pressure, there is a gradient of depth in the momentum equations:
The gradient of depth can remain implicit in the continuity equation…
Discretised, it is:
.........)(1
++∇Δ−=+
f
nnZhtgUU
The idea of the pseudo-wave equation (2/2)
RHShgradcdivth
=−∂
∂ ))(( 2
In the continuum:
D is a matrix defined on every vertical of the mesh, function of diffusion, friction, … General idea: the momentum equation is left partly unsolved when plugged in the continuity equation, but summing over the vertical suppresses this unsolved problem…
In discretisation, a bit more complex…
ghc =2
∫ −s
f
Z
Zhu dzDgbyreplacedc 12 θθ
See book page 158-164 and release notes 5.7 chapter 1.
Impossible d'afficher l'image. Votre ordinateur manque peut-être de mémoire pour ouvrir l'image ou l'image est endommagé
Impossible d'afficher l'image. Votre ordinateur manque peut-être de mémoire pour ouvrir l'image ou l'image est endommagée. Redémarrez l'ordinateur, puis ouvrez à nouveau le fichier. Si le x rouge est toujours affiché, vous devrez peut-être supprimer l'image avant de la réinsérer.
Bottom
Free surface
-6 -5 -4
-2
0
Impossible d'afficher l'image. Votre ordinateur manque peut-être de mémoire pour ouvrir l'image ou l'image est endommagé
Impossible d'afficher l'image. Votre ordinateur manque peut-être de mémoire pour ouvrir l'image ou l'image est endommagée. Redémarrez l'ordinateur, puis ouvrez à nouveau le fichier. Si le x rouge est toujours affiché, vous devrez peut-être supprimer l'image avant de la réinsérer.
Bottom
Free surface
-6 -5 -4
-2
0
Classical sigma transformation:
linear interpolation between bottom and free surface
Generalised sigma transformation:
Any function increasing from bottom to free surface
Now we can build the mesh between bottom and free surface
Survival in a moving mesh
What remains to do?
W computed to ensure
3D continuity * W* used for this
see wstarw.f
Advection-diffusion of W
Non hydrostatic pressure computed
New velocity field
Hydrostatic Non-hydrostatic
We have the depth, « some » velocities U and V
We need to have a divergence free velocity field (U,V,W)
We need to treat the tracers
Advection-diffusion of tracers, k, epsilon, sediment…
* We will see in what follows that W will not be used for advection, with hydrostatic assumption it is just built for visualisation
Now the big problem: 1+nif
nif
zyx
ni
ni
tfnotis
tff
,,
1
⎟⎠
⎞⎜⎝
⎛∂
∂
Δ
−+
Moving grid: the « relocalization » problem
What kind of do we need in a moving grid? tf∂
∂
The values of functions are given at mesh nodes, so we really want:
where i is a moving target in the real
world…
tff ni
ni
Δ
−+1
We need a coordinate system where the grid nodes will not move!
If we find a geometrical transformation (x,y,z) ! (x*,y*,z*)
So that x = x*, y = y*, and z* is constant for a mesh node The transformed mesh will not move!
and:
**,*, zyxtf⎟⎠
⎞⎜⎝
⎛∂
∂will be:
tff ni
ni
Δ
−+1
**,*, zyxtf⎟⎠
⎞⎜⎝
⎛∂
∂is an Arbitrary Lagrangian Eulerian derivative, see Astrid Decoene PhD
Sigma transformation
Z* between 0 and 1 hZz
ZZZz
z f
fs
f −=
−
−=* h
zz=
∂
∂
*
Generalised sigma transformation
zzz
zzzz
z ip
ipip
ip
Δ
−=
−
−=
+1
* zzz
Δ=∂
∂
*
a different sigma transformation for every layer
Zip+1
Zip
Δz
with this option the metrics in fixed planes will not depend on h
Advection and diffusion should be done in the transformed mesh…
0*
*****,*,
=∂
∂+
∂
∂+
∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂=
zfW
yfV
xfU
tf
dtdf
zyx
It will thus do the relocalization
So far only advection is done in the transformed mesh
Diffusion is done in the fixed real mesh at time n+1 (see release notes 6.1 for investigating a diffusion matrix in the transformed mesh)
Problem: What is the vertical velocity in the transformed mesh?
0******,,
=∂
∂+
∂
∂+
∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂==
zzW
yzV
xzU
tz
dtdzW
zyx
Hum…. we need to play with the sigma transformation… W* will be in fact given by the 3D continuity equation
in the transformed mesh…
When you look at the dark side, careful you
must be…
Basic rules and deadly traps:
xf
xfbutxx
∂
∂≠
∂
∂=
**
tzytzy xf
xfbecause
,,*,*,*⎟⎠
⎞⎜⎝
⎛∂
∂≠⎟
⎠
⎞⎜⎝
⎛∂
∂
**∫∫ ΩΩ
ΩΔ=Ω dfzdf
*)(*.*)(.*∫∫ ΩΩ
ΩΔ=Ω dfgradUzdfgradU!!
and
but…
****∫∫ ΩΩΩ
∂
∂Δ+
∂
∂Δ≠Ω
∂
∂+
∂
∂ dyfzV
xfUzd
yfV
xfU
Because some horizontal gradients in one space are vertical gradients in the other
tzytyxtzytzy xz
zf
xf
xf
,,,,*,,,,
**
⎟⎠
⎞⎜⎝
⎛∂
∂⎟⎠
⎞⎜⎝
⎛∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂=⎟
⎠
⎞⎜⎝
⎛∂
∂Basic rule
3D continuity in the transformed mesh
0zW
yV
xU
=∂∂
+∂∂
+∂∂
Becomes (with generalised sigma transformation):
0**)()()(
,,*,,*,,*,,
=⎟⎠
⎞⎜⎝
⎛∂
∂+⎟⎟
⎠
⎞⎜⎜⎝
⎛
∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂
tyxtzxtzyzyx zhW
yhV
xhU
th
0**)()()(
,,*,,*,,*,,
=⎟⎠
⎞⎜⎝
⎛∂
Δ∂+⎟⎟
⎠
⎞⎜⎜⎝
⎛
∂
Δ∂+⎟
⎠
⎞⎜⎝
⎛∂
Δ∂+⎟
⎠
⎞⎜⎝
⎛∂
Δ∂
tyxtzxtzyzyx zzW
yzV
xzU
tz
The classical sigma transformation gives something close to Saint-Venant continuity:
∫∫ ∫ΓΩ Ω
+ ΓΨΔΔ−ΩΨΔΔ=ΩΨΔ−Δ*
*
* *
**1 *.**)(*(*)( dnUztdgradUztdzz iiinn !!!
is also in fact:
Splitting to get vertical and horizontal gradients:
∫∫ ∫∫ΓΩ Ω
+
Ω
ΓΨΔ+ΩΨΔ−ΩΨΔ−ΔΔ
=Ω∂
Ψ∂Δ
*
*
* *
*2
*1
*
*
*.**)(.(*)(1**
* dnUzdgradUzdzzt
dz
zW iiDinni !!!
0**)()()(
,,*,,*,,*,,
=⎟⎠
⎞⎜⎝
⎛∂
Δ∂+⎟⎟
⎠
⎞⎜⎜⎝
⎛
∂
Δ∂+⎟
⎠
⎞⎜⎝
⎛∂
Δ∂+⎟
⎠
⎞⎜⎝
⎛∂
Δ∂
tyxtzxtzyzyx zzW
yzV
xzU
tz
0*)(**,,
=Δ+⎟⎠
⎞⎜⎝
⎛∂
Δ∂ Uzdivtz
zyx
!
After variational formulation and integration by parts:
These equations will give W* but…
∫∫ ∫∫ΓΩ Ω
+
Ω
ΓΨΔ+ΩΨΔ−ΩΨΔ−ΔΔ
=Ω∂
Ψ∂Δ
*
*
* *
*2
*1
*
*
*.*)(.(*)(1**
* dnUzdgradUzdzzt
dz
zW iiDinni !!!
The sum over the vertical of 3D continuity equations in the transformed mesh gives the Saint-Venant continuity equation solved for finding the depth:
3D continuity equations in the transformed mesh:
∑ ∫∫ ∑ ∫ΓΩ Ω
+ ΓΨΔ+ΩΨΔ−ΩΨ−Δ
=verticaloni
iverticaloni
iDDD
inn dnUzdgradUzdhh
t D *
*
*
**2
221 *.)(.()(102
!!!
0)( =∫ dzUdiv s
f
Z
Z
!Variational formulation of integrated by parts
The problem is well posed if the W* are located between planes:
( ) [ ] **)(*1**
1**1
*2/1 dzzzWzz
zWipz
ipzipip
jip ∫ −
−− Δ
−=Δ
(ip plane, j 2D point)
W*
ip
ip-1 j
Δz W* is a velocity in m/s
Because the sum of 3D continuity equations in the transformed mesh is imposed, we loose one degree of freedom per vertical…
W*
3
2
Δz W* is a flux in m/s
W* is computed in subroutine TRIDW2, from bottom to top
A simpler way to understand W* (1/2)
ΩΨΔ ∫Ω dzW Di2* is a flux in m3/s
flux that ensures the continuity of the point below,
1
A simpler way to understand W* (2/2)
ΩΨΔ ∫Ω dzW Di2* is a flux in m3/s between 2 points on a vertical segment
This is a finite volume approach, and also exactly what distributive schemes do (finding fluxes along segments).
This will help for the tracer advection equation
Drawback: errors on the horizontal fluxes (Boussinesq approximation, finite element approximation, wrong forcing terms, etc.) are corrected by artificial vertical fluxes. Possible solution: see release notes 6.1, section 2.6, exact divergence-free fluxes given by the dynamic pressure computed in the transformed mesh (implemented in TRIDW3).
F.A.Q.: is ΔzW* equal to W-Wmesh ?
Answer: not exactly!
**,*, zyxmesh t
zW ⎟⎠
⎞⎜⎝
⎛∂
∂=
**
**)(
zfW
yfV
xfU
zfWW
yfV
xfU mesh ∂
∂+
∂
∂+
∂
∂=
∂
∂−+
∂
∂+
∂
∂(2.92 in book)
Take f = z:
*** **,**,
zWyzV
xzUWW
zxzymesh Δ+⎟⎟
⎠
⎞⎜⎜⎝
⎛
∂
∂+⎟
⎠
⎞⎜⎝
⎛∂
∂=−
However Equation 2.92 shows that advection terms could be computed in the real mesh with a relative velocity (if compatibility with continuity strictly ensured)
Advection equation in the transformed mesh case of explicit scheme
0*)(.*(*)(
* *
**1
1 =ΩΨΔ+ΩΨΔ
−Δ∫ ∫
Ω Ω
++ dfgradUzd
tffz i
ni
nnn
!
Using the same W* as the continuity equation, it is compatible with it and ensures a perfect mass conservation.
∫∫ ∫ΓΩ Ω
+ ΓΨΔΔ−ΩΨΔΔ=ΩΨΔ−Δ*
*
* *
**1 *.**)(*(*)( dnUztdgradUztdzz iiinn !!!
new mesh old tracer
Principle of mass-conservation proof (1/2) case of explicit scheme
0*)(.*(*)(* *
**11 =ΩΨΔΔ+ΩΨ−Δ∫ ∫Ω Ω
++ dfgradUztdffz in
innn
!
∫∫ ∫ΓΩ Ω
+ ΓΨΔΔ−ΩΨΔΔ=ΩΨΔ−Δ*
*
* *
**1 *.**)(*(*)( dnUztdgradUztdzz iiinn !!!
Advection equation (1)
3D continuity equation (2)
∑=
+n
i
nif
1
)2()1(Forming gives:
∫∫ΓΩ
++ ΓΔΔ−=ΩΔ−Δ**
11 *.**)( dfnUztdfzfz nnnnn !!
i.e. final mass – initial mass = boundary fluxes during Δt
(if the advecting velocity field and the mesh is the same as in continuity equation…)
Principle of mass-conservation proof (2/2) semi-implicit scheme
0*)(.*(*)(* *
**1 =ΩΨΔΔ+ΩΨ−Δ∫ ∫Ω Ω
+ dfgradUztdffz iinn
!Advection equation (1)
∑=
+n
iif
1
)2()1(Forming gives:
∫∫ΓΩ
++ ΓΔΔ−=ΩΔ−Δ**
11 *.**)( dfnUztdfzfz nnnnn !!
Only if:
nh
nh zzz Δ−+Δ=Δ + )1(1 θθ n
fn
f fff )1(1 θθ −+= +
1=+ fh θθ
The dynamic pressure
Non hydrostatic continuity step
0)( ≠Udiv!
We have continuity in the transformed mesh, but still:
Why another continuity equation?
in the real mesh, and unknown pressure…
Solution: the Chorin algorithm
This part is like classical Navier-Stokes (and very bad!)
The Chorin algorithm (1/3)
)(1
0
1
d
hydnpgrad
tUU
ρ−=
Δ
−+!!
)())((0
hydd Udivpgradtdiv
!=
ρ
Δ
0)( 1 =+nUdiv!
Combining both gives the Poisson equation:
Last fractional step for the momentum:
We want:
We have done so far: gradientpressuredynamicexceptmomentumoftermsall
tUU nhyd
=Δ
−!!
)())((0
hydd Udivpgradtdiv
!=
ρ
Δ
Variational formulation and integration by parts:
ΩΨ−ΩΔ
Ψ=ΩΨΔ
∫∫∫ ΩΓΩdUdivdnptgraddgradptgrad i
hyddiid )().()().(
00
!
ρρ
Diffusion matrix, symmetric but
not so well conditioned
Boundary term, assumed 0
but this is wrong
Right-hand side
Boundary conditions: free surface pd=0, open boundaries: ???
The Chorin algorithm (2/3)
The Chorin algorithm (3/3)
)(0
1d
hydn ptgradUUρΔ
−=+!!
so:
Eventually:
∫
∫
Ω
Ω
ΩΨ
ΩΨΔ
≈Δ
d
dptgradptgrad
i
id
d
)()( 0
0
ρρ
But then compatibility lost: 0)( 1 ≠+nUdiv
!
but: linear linear piece-wise constant
In finite elements divergence(gradient(f)) is not Laplacian(f) (if done with integration by parts)
The many problems of Chorin algorithm
Laplacian not compatible Prescribed dynamic pressure = 0 at free surface (spoils divergence)
What dynamic pressure on open boundaries? What pressure gradient on solid boundaries?
Consequence:
But this velocity is not used for advection
More brainstorming on this:
Release notes 5.7 Chapter 2 (dealing with non linear waves) Release notes 6.1 Chapter 2 (on divergence free velocity fields)
0)( 1 ≠+nUdiv!
Other topics
Dry zones Parallelism
The aspect ratio The 2-plane case Non linear waves
Applications
The treatment of tidal flats and dry zones in Telemac
(How awful is the river without water!)
The presence of dry zones or tidal flats in 2D or 3D computational domains is a major difficulty
In environmental flows, nearly all computational domains have dry zones
Many solvers fail on dry zones
9 juin 2010 63
Problem 1: propagation on dry zone (wetting)
Problem 2: receding waters (drying)
Saint-Venant
Hydrostatic Navier-Stokes
Non-hydrostatic Navier-Stokes
Water at rest all equations
Problem 3: a seemingly easy but very difficult problem: a lake at rest
Checking the C-property
free surface = bottom elevation + water depth
free surface
bottom elevationmesh nodes
Linear interpolation of free surface leads to movements in the lake
Standard discretisation fails!
Problem 4: negative depths in numerical solutions
Continuity equation: 0)( =+∂
∂ uhdivth !
In finite elements: becomes: th∂
∂
thhMnn
Δ
−+1
In finite volumes: becomes: th∂
∂
thhSni
ni
i Δ
−+1
But: treated as: )( uhdiv ! [ ]))1(( 1 nnn uuhdiv !!θθ −++
∫∫∫ ΩΓΩΩΨ−Γ=ΩΨ dgraduhdnuhduhdiv nnn )(..)( !!!!
Boundary flux
Internal flux
Problem 5: Numerical pump
A bad solution: a minimum depth
If h < hmin then h=hmin
Problems: mass conservation, water flowing on banks
But how to find and treat dry zones if there is no threshold hmin ???
Other (not too good) solution: removing dry elements from the mesh
But how to find the shoreline, with hmin ???
shoreline
water
dry
Elements removed
Can we keep all elements and avoid using a threshold depth ?
Main problem of dry zones: their wrong free surface gradient
Bottom of a point in an element
Higher than the free surface of point in the same element
Comparing bottoms and free surfaces in an element (triangle) shows situations where the shoreline probably crosses the element. There is no need of threshold ! In such situations the gradient of the free surface must be
discarded or modified
Counter-example in an extreme case
The final solution involves a piece-wise linear definition of free surface with discontinuity on points
Additional problem in 3D
Elements without volume
A flood in a river: computation against observations (red line)
scan25 IGN (contrat marché n° M902C22360)
EDF R&D – LNHE – décembre 2005
scan25 IGN (contrat marché n° M902C22360)
EDF R&D – LNHE – décembre 2005
Parallelism in Telemac Domain decomposition without overlapping Single program Multiple data: (every processor runs Telemac on a part of the geometry) Distributed memory: each processor has its own memory and communicates with others via message transmission (pvm, mpi)
An example of domain decomposition
1 processor: scalar mode
More than 1 processor:
parallel mode
There is a number of free domain decomposers on Internet, we use Metis
http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
Principle of parallel implementation in Telemac:
The final goal is to have parallel results strictly identical to scalar results (i.e. a difference is a bug)
All the numerical treatments must be the same
So far small differences may be observed, due to truncation errors
(remaining problems: assembly , dot products)
Typical differences are 1.D-6 on depth and velocity, if there are no bifurcations in the case
(von Karman eddies behind bridge piers are an example of bifurcations)
Adapting algorithms for parallelism is time consuming (but helps structuring and simplifying)
Debugging parallelism is painful
Is it possible to solve linear systems when points are scattered on several processors ?
Iterative solvers are series of matrix-vector products and dot products
Matrix-vector products need an assembly at interfaces: possible
(and easy with EBE or Edge-based matrices)
Dot-products require a sum over processors: possible
All processors will contribute to the same resolution:
They will treat their own points, will communicate for assembly of vectors at interfaces, they will communicate for computing the same dot
products
A single global resolution will thus be done collectively
The problem of characteristics and trajectories
In one time step a trajectory or a characteristic curve may cross an arbitrary number of
sub-domains. In 2008 Jacek Jankowski (Bundes Anstalt für Wasserbau, Germany) managed to write
an algorithm adapting the method of characteristics to domain-decomposition parallelism
In 2011: no difference between scalar and parallel!
Starting point Foot of the characteristic where the interpolation is done
The digit-to-digit equality between scalar and parallel runs
solved for trajectories
remaining problems: finite element assembly, dot products
finite element assembly: solved with integers
dot products: PhD at university of Perpignan (compensated
sums)
Parallelism: Malpasset test-case with Telemac version 6.2
Number of processors
Computer elapse time Speed-up
1 22 s 1 2 11 s 2 3 8 s 2.75 4 7 s 3.14 5 5 s 4.4 6 5 s 4.4 7 5 s 4.4 8 4 s 5.5
2D: small mesh
26000 elements, 1000 steps of 4 s
Number of processors
Computer elapse time Speed-up
1 545 s 1 2 264 s 2.06 3 181 s 3.01 4 140 s 3.89 5 122 s 4.46 6 102 s 5.34 7 96 s 5.67 8 85 s 6.4
2D: large mesh
104000 elements, 4000 steps of 1 s
8-core HP Z600 Linux Telemac-2D version 6.2
Number of processors
Computer elapse time Speed-up
1 112 s 1 2 61 s 1.83 3 44 s 2.54 4 33 s 3.39 5 28 s 4 6 24 s 4.66 7 22 s 5.09 8 20 s 5.6
3D: small mesh
26000 elements, 1000 steps of 4 s
Number of processors
Computer elapse time Speed-up
1 2285 s 1 2 1126 s 2.03 3 855 s 2.67 4 653 s 3.5 5 553 s 4.13 6 464 s 4.92 7 427 s 5.35 8 353 s 6.47
3D: large mesh
104000 elements, 4000 steps of 1 s
Parallelism: some results on IBM Blue Gene
Performances V5.9 (2008) : Calculs
BERRE sur Blue Gene P•Gros modèle 1 : test sur 57600 DT (16h de temps physique)
•12 083 160 prismes (31 plans horizontaux), DT=10s•256 à 8192 CPU
0
4
8
12
16
20
24
28
32
0 512 1024 1536 2048 2560 3072 3584 4096 4608 5120 5632 6144 6656 7168 7680 8192
Number of processors
Spee
d-up
(com
pare
d to
256
pro
cs)
TELEMAC3D speed-upIdeal speed-up
BERRE : 12 083160 mailles 3D
Large model: 12 083 160 prisms, with 31 horizontal planes, DT=10 s (2D mesh: 402772 triangles)
About 100 triangles per processor
Berre lagoon mesh seen from above
Side view of Berre lagoon mesh
The aspect ratio (open problem…)
A factor 1000 between horizontal and vertical scales!!!
Horizontal gradients are negligible compared to vertical gradients: solutions of diffusion-like equations tend to be 1-dimensional on the
vertical (this fact is even used as a preconditioning…). Turbulence models impacted
It is another problem for Chorin method: it will tend to correct the velocity field with artificial vertical velocities (like in the transformed mesh…)
)(0
1
dhydn
ptgradUUρΔ
−=+
Possible solution: an artificial factor on horizontal gradients (it works for Chorin but in this case what is pd ?)
The aspect ratio
The 2-plane case 2 planes suffice!
By the magic of finite element variational formulation, one layer of elements is
enough to solve the equations…
Essential boundary conditions (impermeability, friction, fluxes…) are plugged into equations, they do not replace them like Dirichlet conditions do.
Untrim code with 1 layer (1 velocity point per vertical) = Saint-Venant
Telemac-3D with 1 layer (2 velocity points per vertical) = something in between Saint-Venant and Navier-Stokes
The key point: including the dynamic pressure in the computation of the free surface…
Non linear waves
Solitary wave in a canal with constant depth depth = 10 m wave height = 2 m
Mesh size: 0.1 m time step: 0.1 s C.F.L.: 10,84
Navier-Stokes solution at 60 s with different numbers of
planes
Equations Computer time (HP Z600, 1 processor) Saint-Venant (with wave equation) 6 s
Saint-Venant (with primitive equations) 14 s Boussinesq (only works with primitive equations) 134 s Non hydrostatic Navier-Stokes 2 planes 28 s Non hydrostatic Navier-Stokes 3 planes 50 s Non hydrostatic Navier-Stokes 4 planes 78 s Non hydrostatic Navier-Stokes 5 planes 110 s Non hydrostatic Navier-Stokes 6 planes 157 s Non hydrostatic Navier-Stokes 7 planes 203 s Non hydrostatic Navier-Stokes 8 planes 242 s
Solitary wave in a canal with constant depth
Saint-Venant vs. Boussinesq vs. Navier-Stokes
Navier-Stokes are the right equations for non-linear waves!
10-plane mesh
Non linear waves
Navier-Stokes compared to Dingemans experiments
Applications
Thermal plumes Water quality
Sediment transport Tsunamis
Tides, storm surges Waves
Marine turbines Fish passes
3011703 elements 3240 steps of 5 s comparisons of Navier-Stokes, Saint-Venant and Boussinesq
cross sections after 8000 s
Lisbon tsunami (1st November 1755 09h40 am)
6023406 elements
93
3D simulation of tidal currents in Fundy Bay in Canada
(Canadian Hydraulic Center)
Evolution of salinity in the Berre lagoon
Influence of releases of Saint Chamas power plant salinity and discharges in the Caronte canal
Designing scenarii for releases
Salinity in Caronte canal between 17 November and 2 December 2005
EDF – R&D – Laboratoire National d’Hydraulique et Environnement
Salinity in the channel of Caronte in November 2005
Measured
Computed
Recent studies in the Berre lake (Nathalie Durand & Pierre Lang)
Sensitivity of mesh refinement (triangles split into 4)
1.2 million points, 96 processors on cluster Athos, 3.5 h CPU for 6 days
69 millions points, 1056 processors on Athos, 42 hours for 6 days
Telemac-3D: mixing of 2 fluids of different temperatures
With Kelvin-Helmholtz instabilities
Post-doc work of Lamia Abbas at LNHE
X 4 on the vertical
Telemac-3D: a boat in a lock
(study by HR-Wallingford for Panama locks)
What you have not seen…
Particles, oil spills, algae Advection schemes
Turbulence Thompson boundary conditions
Equations in Mercator projection Automatic boundary conditions for tides
Exchanges with atmosphere Sources, rain and evaporation
9 juin 2010
R&D Laboratoire National d'Hydraulique et Environnement
100
Thank you for your attention!
Manompana. Madagascar. 4 December 2007