From 8f71af6946de1ac1ad7e81d7ef8232b6f8b3ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chi-Tu=C3=A2n=20Pham?= <chi-tuan.pham@edf.fr> Date: Fri, 27 Dec 2024 15:15:17 +0100 Subject: [PATCH] [VnV][telemac3d] Update bottom_bc example with better choices for a few keywords - TREATMENT OF NEGATIVE DEPTHS = 2 (new default value since release 9.0) and TIDAL FLATS = YES (default value) to improve mass conservation of water - use of gradient conjugate + preconditioning 34 = 2*17 to solve PPE, more efficient than GMRES for this example (very few iterations are needed) - ACCURACY FOR DIFFUSION OF VELOCITIES = 1.E-15 as easily solved + PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 to improve efficiency --- .../telemac3d/bottom_bc/doc/bottom_bc.tex | 58 +++++++++++++------ .../telemac3d/bottom_bc/f3d_bottom_inlet.slf | 2 +- .../telemac3d/bottom_bc/f3d_bottom_source.slf | 2 +- .../telemac3d/bottom_bc/t3d_bottom_inlet.cas | 14 ++--- .../telemac3d/bottom_bc/t3d_bottom_source.cas | 13 ++--- examples/telemac3d/bottom_bc/vnv_bottom_bc.py | 10 ++-- 6 files changed, 57 insertions(+), 42 deletions(-) diff --git a/examples/telemac3d/bottom_bc/doc/bottom_bc.tex b/examples/telemac3d/bottom_bc/doc/bottom_bc.tex index d05dd98059..fca5b0baf5 100644 --- a/examples/telemac3d/bottom_bc/doc/bottom_bc.tex +++ b/examples/telemac3d/bottom_bc/doc/bottom_bc.tex @@ -19,6 +19,14 @@ of 100~m placed at the centre of the bed.\\ All vertical boundaries are defined as walls, see Figure\ref{fig:GeomPlan}.\\ Nikuradse law with friction coefficient equal to 0.01~m is imposed on the bottom. +\begin{figure}[H] +\begin{center} + \includegraphics[width=0.4\textwidth]{GeomPlan.pdf} +\end{center} +\caption{Geometrical parameters of the test case.} +\label{fig:GeomPlan} +\end{figure} + The depth is constant, and initially set to 500~m. \subsection{Geometry and Mesh} @@ -27,14 +35,6 @@ The configuration of this test case is simple, it is a square box of sides 4,000~m. The geometry of the test case is shown in Figure \ref{fig:GeomPlan}. -\begin{figure}[t!] -\begin{center} - \includegraphics[]{GeomPlan.pdf} -\end{center} -\caption{Geometrical parameters of the test case.} -\label{fig:GeomPlan} -\end{figure} - Furthermore, two different meshes are used, a fine mesh made of 8,336 elements and 4,233 nodes (Figure \ref{fig:bottom_bc:MeshHinlet}) and a coarse mesh made of 2,580 elements and 1,355 nodes (Figure \ref{fig:bottom_bc:MeshHsource}). @@ -43,13 +43,13 @@ prescribed. \begin{figure}[H] \centering - \includegraphicsmaybe{[width=\textwidth]}{../img/Mesh_inlet.png} + \includegraphicsmaybe{[width=0.6\textwidth]}{../img/Mesh_inlet.png} \caption{Horizontal mesh (finer for inlet).}\label{fig:bottom_bc:MeshHinlet} \end{figure} \begin{figure}[H] \centering - \includegraphicsmaybe{[width=\textwidth]}{../img/Mesh_source.png} + \includegraphicsmaybe{[width=0.6\textwidth]}{../img/Mesh_source.png} \caption{Horizontal mesh (coarser for source).}\label{fig:bottom_bc:MeshHsource} \end{figure} @@ -100,10 +100,28 @@ The key numerical parameters for \telfile{t3d\_bottom\_source.cas} are: For both steering files, the N-type MURD scheme (scheme 4) is used to solve the advection of velocities. +\\ -The time step is 1~s for the ijnection on the bed and 5~s for the source +Using conjugate gradient (\telkey{SOLVER FOR PPE} = 1) and +\telkey{PRECONDITIONING FOR PPE} = 34 (= 2 $\times$ 17) accelerates the solving +of Poisson Pressure Equation, compared to default choice GMRES (= 7). +Only very few iterations are needed to converge to the chosen accuracy. + +Moreover as the diffusion of velocities is easily solved +\telkey{ACCURACY FOR DIFFUSION OF VELOCITIES} is set to 10$^{-15}$. +Using \telkey{PRECONDITIONING FOR DIFFUSION OF VELOCITIES} = 34 +improves the efficiency to solve this step. +\\ + +The time step is 1~s for the injection on the bed and 5~s for the source discharge, both for a simulated period of 1,800~s. +\\ + +Mass conservation is improved (up to machine precision) by using default value +for the keyword \telkey{TREATMENT OF NEGATIVE DEPTHS} (= 2), instead of the old +default value = 1 (smoothings) for this example (until release 9.0). +\newpage \section{Results} %At the moment, no post processing is done, however it would be good to have a @@ -133,6 +151,7 @@ more important than for the source case. \label{fig:bottom_bc:waterdepth} \end{figure} +\newpage Figure \ref{fig:bottom_bc:veloH} shows the horizontal velocity at the free surface for inlet (top) and source (bottom) cases. A circular symmetry can be seen for the inlet (top) case not @@ -140,12 +159,12 @@ as well reproduced for the source (bottom) case. \begin{figure}[H] \centering -\begin{minipage}[t]{.9\textwidth} +\begin{minipage}[t]{.8\textwidth} \centering \includegraphicsmaybe{[width=\textwidth]}{../img/veloH_inlet.png} \end{minipage} % -\begin{minipage}[t]{.9\textwidth} +\begin{minipage}[t]{.8\textwidth} \centering \includegraphicsmaybe{[width=\textwidth]}{../img/veloH_source.png} \end{minipage} @@ -154,13 +173,10 @@ as well reproduced for the source (bottom) case. \label{fig:bottom_bc:veloH} \end{figure} +\newpage Figure \ref{fig:bottom_bc:veloW_inlet} shows the vertical velocity component along plane $y$ = 2,000~m for inlet case at 4 different time steps (180~s, 540~s, mid-simulation = 900~s and final time = 1,800~s) whereas -Figure \ref{fig:bottom_bc:veloW_source} shows the vertical velocity component -along plane $y$ = 2,000~m for source case at the same time steps. -A constant jet with the same velocity can be better reproduced with inlet -case than source case. \begin{figure}[H] \centering @@ -188,6 +204,12 @@ case than source case. \label{fig:bottom_bc:veloW_inlet} \end{figure} +\newpage +Figure \ref{fig:bottom_bc:veloW_source} shows the vertical velocity component +along plane $y$ = 2,000~m for source case at the same time steps. +A constant jet with the same velocity can be better reproduced with inlet +case than source case. + \begin{figure}[H] \centering \begin{minipage}[t]{\textwidth} @@ -214,6 +236,7 @@ case than source case. \label{fig:bottom_bc:veloW_source} \end{figure} +\newpage Figure \ref{fig:bottom_bc:vectorial} shows the vertical velocity along $z$ and velocity vectors along plane $y$ = 2,000~m for inlet (top) and source (bottom) cases. @@ -234,6 +257,7 @@ for inlet (top) and source (bottom) cases. \label{fig:bottom_bc:vectorial} \end{figure} +\newpage Figure \ref{fig:bottom_bc:velocityW_profile} shows the vertical velocity profile along $z$ at location ($x$, $y$) = (2,000 ; 2,000) for inlet (left) and source (right) cases. diff --git a/examples/telemac3d/bottom_bc/f3d_bottom_inlet.slf b/examples/telemac3d/bottom_bc/f3d_bottom_inlet.slf index 5f036395e3..e7d7e8506b 100644 --- a/examples/telemac3d/bottom_bc/f3d_bottom_inlet.slf +++ b/examples/telemac3d/bottom_bc/f3d_bottom_inlet.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:71a94cf3bf8734c0a2dbb471a81a6bc270afdba06647b132206e4fb154f0ff06 +oid sha256:bde5f1eb6281052c32a32e6c55ea25f165464fbe1b2f4c81ce7558934c3aa105 size 6846348 diff --git a/examples/telemac3d/bottom_bc/f3d_bottom_source.slf b/examples/telemac3d/bottom_bc/f3d_bottom_source.slf index e4f59c71a6..52137d4e86 100644 --- a/examples/telemac3d/bottom_bc/f3d_bottom_source.slf +++ b/examples/telemac3d/bottom_bc/f3d_bottom_source.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d4a5324a2781ad66a3d243d9e12031f04bb05496263eff729cb3aec3dcf83ac +oid sha256:cb26ca6c9f6fcb06faa6c72f962e394fb5b1ae21fa6cd1cf302d93a95ad8b301 size 2149452 diff --git a/examples/telemac3d/bottom_bc/t3d_bottom_inlet.cas b/examples/telemac3d/bottom_bc/t3d_bottom_inlet.cas index c4d7ec2be5..a610238710 100644 --- a/examples/telemac3d/bottom_bc/t3d_bottom_inlet.cas +++ b/examples/telemac3d/bottom_bc/t3d_bottom_inlet.cas @@ -35,27 +35,23 @@ FRICTION COEFFICIENT FOR THE BOTTOM = 0.01 /----------------------------------------------------------------------/ MASS-BALANCE : YES /----------------------------------------------------------------------/ -IMPLICITATION FOR DEPTH = 1. -/----------------------------------------------------------------------/ -TIDAL FLATS : NO -/----------------------------------------------------------------------/ INITIAL CONDITIONS : 'CONSTANT ELEVATION' INITIAL ELEVATION : 0.0 /----------------------------------------------------------------------/ / NON-HYDROSTATIC PART /----------------------------------------------------------------------/ +SOLVER FOR PPE = 1 +PRECONDITIONING FOR PPE = 34 MAXIMUM NUMBER OF ITERATIONS FOR PPE = 200 ACCURACY FOR PPE = 1.E-5 / NOT 1.E-6 TO SAVE CPU TIME -OPTION OF SOLVER FOR PPE = 10 +/OPTION OF SOLVER FOR PPE = 10 / IF USING GMRES = 7 NON-HYDROSTATIC VERSION : YES /----------------------------------------------------------------------/ / WAVE EQUATION /----------------------------------------------------------------------/ ACCURACY FOR PROPAGATION = 1.E-8 +ACCURACY FOR DIFFUSION OF VELOCITIES = 1.E-15 +PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 / / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/bottom_bc/t3d_bottom_source.cas b/examples/telemac3d/bottom_bc/t3d_bottom_source.cas index 52af060a70..5bdced3466 100644 --- a/examples/telemac3d/bottom_bc/t3d_bottom_source.cas +++ b/examples/telemac3d/bottom_bc/t3d_bottom_source.cas @@ -37,25 +37,20 @@ FRICTION COEFFICIENT FOR THE BOTTOM = 0.01 /----------------------------------------------------------------------/ MASS-BALANCE : YES /----------------------------------------------------------------------/ -IMPLICITATION FOR DEPTH = 1. -/----------------------------------------------------------------------/ -TIDAL FLATS : NO -/----------------------------------------------------------------------/ INITIAL CONDITIONS : 'CONSTANT ELEVATION' INITIAL ELEVATION : 0.0 /----------------------------------------------------------------------/ / NON-HYDROSTATIC PART /----------------------------------------------------------------------/ -ACCURACY FOR PPE = 1.E-6 +SOLVER FOR PPE = 1 +PRECONDITIONING FOR PPE = 34 NON-HYDROSTATIC VERSION : YES /----------------------------------------------------------------------/ / WAVE EQUATION /----------------------------------------------------------------------/ ACCURACY FOR PROPAGATION = 1.E-8 +ACCURACY FOR DIFFUSION OF VELOCITIES = 1.E-15 +PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 / / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/bottom_bc/vnv_bottom_bc.py b/examples/telemac3d/bottom_bc/vnv_bottom_bc.py index 20d2e11886..3fec50ebfe 100644 --- a/examples/telemac3d/bottom_bc/vnv_bottom_bc.py +++ b/examples/telemac3d/bottom_bc/vnv_bottom_bc.py @@ -73,27 +73,27 @@ class VnvStudy(AbstractVnvStudy): # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_2:T3DRES', 'f3d_bottom_inlet.slf', - eps=[1.E-8]) + eps=[3.E-8]) # Comparison between sequential and parallel run. self.check_epsilons('vnv_1:T3DRES', 'vnv_2:T3DRES', - eps=[1.E-8]) + eps=[3.E-8]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_3:T3DRES', 'f3d_bottom_source.slf', - eps=[1.E-8]) + eps=[1.E-9]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_4:T3DRES', 'f3d_bottom_source.slf', - eps=[1.E-8]) + eps=[1.E-9]) # Comparison between sequential and parallel run. self.check_epsilons('vnv_3:T3DRES', 'vnv_4:T3DRES', - eps=[1.E-8]) + eps=[1.E-9]) def _post(self): -- GitLab