From 037d5453a5645d270e2e1703813db54431cc241e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chi-Tu=C3=A2n=20Pham?= <chi-tuan.pham@edf.fr> Date: Thu, 26 Dec 2024 13:25:44 +0100 Subject: [PATCH] [VnV][telemac3d] Update Cooper example with better choices for a few keywords - TREATMENT OF NEGATIVE DEPTHS = 2 (new default value since release 9.0) to improve mass conservation of water+tracer - preconditionings = 34 when possible (diffusion of velocities/tracers + PPE as using conjugate gradients) for great efficiency to converge to the chosen accuracy (down to 1.E-15 for the diffusion of tracers as easily reached for this example) --- examples/telemac3d/Cooper/doc/Cooper.tex | 40 +++++++++++++++++------- examples/telemac3d/Cooper/f3d_cooper.slf | 2 +- examples/telemac3d/Cooper/t3d_cooper.cas | 30 +++--------------- examples/telemac3d/Cooper/vnv_Cooper.py | 6 ++-- 4 files changed, 37 insertions(+), 41 deletions(-) diff --git a/examples/telemac3d/Cooper/doc/Cooper.tex b/examples/telemac3d/Cooper/doc/Cooper.tex index 8d0503102c..845c8dff9c 100644 --- a/examples/telemac3d/Cooper/doc/Cooper.tex +++ b/examples/telemac3d/Cooper/doc/Cooper.tex @@ -67,6 +67,18 @@ velocities and tracer. The time step is 5~s for a simulated period of 30~min (= 1,800~s). +To accelerate the solving of diffusion of velocities, tracers and Poisson +Pressure Equations (as using conjugate gradient), preconditing 34 +(= 2 $\times$ 17) is chosen for these 3 operations, which enables to only +need 1 or very few iterations to converge to the chosen accuracy +(mainly default value 10$^{-8}$ or 10$^{-15}$ for tracers as easily reached +for this example). +\\ + +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). + \subsection{Physical parameters} Constant diffusion of velocity: @@ -104,21 +116,27 @@ This is not due to the injected flow rate. Mass balance of the log file after 1,800~s: \begin{lstlisting}[language=TelFortran] + FINAL MASS BALANCE +T = 1800.0000 + --- WATER --- -INITIAL MASS : 0.1598743E+09 -FINAL MASS : 0.1599103E+09 -MASS LEAVING THE DOMAIN (OR SOURCE) : -36000.00 -MASS LOSS : 0.4833937E-04 ---- TRACER 1 --- -INITIAL MASS : 0.000000 -FINAL MASS : 0.1199988E+08 -MASS EXITING (BOUNDARIES OR SOURCE) : -0.1199988E+08 -MASS LOSS : -0.5826335E-03 +INITIAL VOLUME : 0.1598743E+09 +FINAL VOLUME : 0.1599103E+09 +VOLUME EXITING (BOUNDARY OR SOURCE) : -36000.00 +TOTAL VOLUME LOST : 0.2086163E-06 + +--- TRACER 1: TRACER 1 , UNIT : ?? * M3) +INITIAL QUANTITY OF TRACER : 0.000000 +FINAL QUANTITY OF TRACER : 0.1199988E+08 +QUANTITY EXITING (BOUNDARY/SOURCE) : -0.1199988E+08 +TOTAL QUANTITY OF TRACER LOST : 0.1434237E-06 \end{lstlisting} -The amount of water injected by the source is correct: 20~m$^3$/s $\times$ 1,800~s~=~36,000~m$^3$ +The amount of water injected by the source is correct: +20~m$^3$/s $\times$ 1,800~s~=~36,000~m$^3$. The amount of tracer injected is correct: -333.33~kg/m$^3 \times $20~m$^3$/s $\times$ 1,800~s~=~1.19999 10$^7$~kg +333.33~kg/m$^3 \times $20~m$^3$/s $\times$ 1,800~s~=~1.19999 10$^7$~kg. +Moreover, one can see that mass is well conserved (water and tracer). \section{Comments} diff --git a/examples/telemac3d/Cooper/f3d_cooper.slf b/examples/telemac3d/Cooper/f3d_cooper.slf index 8cfd10289a..820e6f06ed 100644 --- a/examples/telemac3d/Cooper/f3d_cooper.slf +++ b/examples/telemac3d/Cooper/f3d_cooper.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72b9f3ab37b36e3ff8346f6403872a3fb5c8a25efaa6f8338ebf766beaf67dc9 +oid sha256:513e42ffe304a9cf8a7cc159e9cd21d61b566258e1130cd7000f3e5290aa64a1 size 1361868 diff --git a/examples/telemac3d/Cooper/t3d_cooper.cas b/examples/telemac3d/Cooper/t3d_cooper.cas index 10e282ab83..c744c5b9af 100644 --- a/examples/telemac3d/Cooper/t3d_cooper.cas +++ b/examples/telemac3d/Cooper/t3d_cooper.cas @@ -1,17 +1,3 @@ -/ HP C3700 : 951 s 5.5 JMH 17/12/2004 -/ HP C3700 : 620 s 5.5 JMH 04/03/2005 (nouvelle diffusion) -/ HP C3700 : 411 s 5.6 JMH 29/09/2005 (segment) -/ DELL 2.8 MHz Linux : 285 s 5.6 JMH 10/11/2005 -/ -/ CAS NON-HYDROSTATIQUE A FOND PLAT -/ -/ 5.7 HP:373 s, Nag:871 s, Dell:239 s 14/02/2007 -/ 5.8 HP:390 s, Nag:941 s, Dell:244 s 03/01/2008 (schema N) -/ 5.9 HP:374 s, Nag:??? s, Dell:233 s 20/10/2008 -/ 6.0 HP:308 s, Nag:751 s, Intel:147 s 07/12/2009 -/ 6.1 HP:333 s, Nag:??? s, Intel:??? s 06/12/2010 -/ 6.2 HP:318 s, Nag:??? s, Intel:??? s 29/05/2012 -/ FORTRAN FILE : 'user_fortran' BOUNDARY CONDITIONS FILE : geo_cooper.cli GEOMETRY FILE : geo_cooper.slf @@ -33,10 +19,12 @@ SCHEME FOR ADVECTION OF VELOCITIES : 4 SCHEME FOR ADVECTION OF TRACERS : 4 COEFFICIENT FOR HORIZONTAL DIFFUSION OF TRACERS : 0. COEFFICIENT FOR VERTICAL DIFFUSION OF TRACERS : 0.1 -ACCURACY FOR DIFFUSION OF TRACERS : 1.E-12 +ACCURACY FOR DIFFUSION OF TRACERS : 1.E-15 +PRECONDITIONING FOR DIFFUSION OF TRACERS : 34 / TO ACCELERATE THE CONVERGENCE /---------------------------------------------------------------------- COEFFICIENT FOR HORIZONTAL DIFFUSION OF VELOCITIES = 1.E-4 COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES = 0. +PRECONDITIONING FOR DIFFUSION OF VELOCITIES : 34 / TO ACCELERATE THE CONVERGENCE /---------------------------------------------------------------------- HORIZONTAL TURBULENCE MODEL : 1 VERTICAL TURBULENCE MODEL : 2 @@ -44,14 +32,10 @@ MIXING LENGTH MODEL : 1 / OLD DEFAULT VALUE UNTIL V8P5 LAW OF BOTTOM FRICTION : 5 FRICTION COEFFICIENT FOR THE BOTTOM = 0.01 /---------------------------------------------------------------------- -/SOLVER FOR PROPAGATION : 7 / 7 for hydro and supg versions -SOLVER FOR PROPAGATION : 2 ACCURACY FOR PROPAGATION = 1.E-8 /---------------------------------------------------------------------- MASS-BALANCE : YES /----------------------------------------------------------------------/ -IMPLICITATION FOR DEPTH = 1. -/----------------------------------------------------------------------/ INITIAL CONDITIONS : 'CONSTANT ELEVATION' INITIAL ELEVATION : 0.0 INITIAL VALUES OF TRACERS : 0. @@ -70,16 +54,10 @@ STANDARD VALUES FOR TRACERS : 0. /---------------------------------------------------------------------- / NON-HYDROSTATIC PART /---------------------------------------------------------------------- -/MAXIMUM NUMBER OF ITERATIONS FOR PPE = 200 -ACCURACY FOR PPE = 1.E-6 +PRECONDITIONING FOR PPE : 34 / TO ACCELERATE THE CONVERGENCE NON-HYDROSTATIC VERSION : YES / / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. -ACCURACY FOR DIFFUSION OF VELOCITIES = 1.E-5 SOLVER FOR PPE = 1 SCHEME OPTION FOR ADVECTION OF TRACERS = 1 -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/Cooper/vnv_Cooper.py b/examples/telemac3d/Cooper/vnv_Cooper.py index fd24c52ecd..2920c672f3 100644 --- a/examples/telemac3d/Cooper/vnv_Cooper.py +++ b/examples/telemac3d/Cooper/vnv_Cooper.py @@ -55,17 +55,17 @@ class VnvStudy(AbstractVnvStudy): # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_1:T3DRES', 'f3d_cooper.slf', - eps=[1.E-9]) + eps=[1.E-10]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_2:T3DRES', 'f3d_cooper.slf', - eps=[1.E-9]) + eps=[1.E-10]) # Comparison between sequential and parallel run. self.check_epsilons('vnv_1:T3DRES', 'vnv_2:T3DRES', - eps=[1.E-9]) + eps=[1.E-10]) def _post(self): -- GitLab