From f8282b7ee328a1c540ca5e8cfbb5a9b1f13e7145 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Chi-Tu=C3=A2n=20Pham?= <chi-tuan.pham@edf.fr>
Date: Thu, 9 Jan 2025 11:15:25 +0100
Subject: [PATCH] [VnV][telemac3d] Update NonLinearWave example with 1 better
 choice of solver - SOLVER FOR PROPAGATION = 7 (GMRES = default) as quite more
 efficient than old choice 2 (conjugate residual) or 1 (conjugate gradient)
 This choice enables to set ACCURACY FOR PROPAGATION to its default value
 1.E-8 rather than 1.E-6 with quite the same CPU times

---
 .../telemac3d/NonLinearWave/doc/NonLinearWave.tex   |  7 +++++++
 .../telemac3d/NonLinearWave/f3d_nonlinearwave.slf   |  2 +-
 .../telemac3d/NonLinearWave/t3d_nonlinearwave.cas   | 13 ++++---------
 .../telemac3d/NonLinearWave/vnv_non_linear_wave.py  |  6 +++---
 4 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/examples/telemac3d/NonLinearWave/doc/NonLinearWave.tex b/examples/telemac3d/NonLinearWave/doc/NonLinearWave.tex
index 22c7ea1476..9a32629c62 100644
--- a/examples/telemac3d/NonLinearWave/doc/NonLinearWave.tex
+++ b/examples/telemac3d/NonLinearWave/doc/NonLinearWave.tex
@@ -60,6 +60,13 @@ accurate.
 
 The time step is 0.0025~s for a simulated period of 33~s.
 
+Default solver for propagation GMRES (= 7) is used (rather than old choice
+conjugate residual = 2 or conjugate gradient = 1) as quite more efficient.
+It enables to set the accuracy for propagation to its default value (10$^{-8}$).
+Residual conjugate (= 2) is chosen to solve PPE which is more efficient here
+compared to GMRES (= 7) or conjugate gradient (= 1), but accuracy for PPE is to
+be set to 10$^{-6}$.
+
 \subsection{Physical parameters}
 
 No diffusion is considered.
diff --git a/examples/telemac3d/NonLinearWave/f3d_nonlinearwave.slf b/examples/telemac3d/NonLinearWave/f3d_nonlinearwave.slf
index 53001250e9..aec2b10eb2 100644
--- a/examples/telemac3d/NonLinearWave/f3d_nonlinearwave.slf
+++ b/examples/telemac3d/NonLinearWave/f3d_nonlinearwave.slf
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:f5b1c88cf94660502e0003d913d89d3815adb49864b723c6d812f02fd5ce8ba8
+oid sha256:e45b24ec753d448c511b74cb57c05f3ce5e96642c3f8e76940a2685da29cf4ff
 size 3299052
diff --git a/examples/telemac3d/NonLinearWave/t3d_nonlinearwave.cas b/examples/telemac3d/NonLinearWave/t3d_nonlinearwave.cas
index a8f0df766e..6f643b8130 100644
--- a/examples/telemac3d/NonLinearWave/t3d_nonlinearwave.cas
+++ b/examples/telemac3d/NonLinearWave/t3d_nonlinearwave.cas
@@ -67,10 +67,11 @@ NUMBER OF SUB ITERATIONS FOR NON LINEARITIES : 2
 /
 FREE SURFACE GRADIENT COMPATIBILITY : 1.
 /
-SOLVER FOR PROPAGATION          : 2
+SOLVER FOR PROPAGATION          : 7 / QUITE MORE EFFICIENT THAN 2
 NUMBER OF HORIZONTAL LEVELS = 10
 /
 SCHEME FOR ADVECTION OF VELOCITIES = 4
+SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1
 /
 IMPLICITATION FOR DEPTH      = 0.50
 IMPLICITATION FOR VELOCITIES = 0.50
@@ -78,21 +79,15 @@ IMPLICITATION FOR VELOCITIES = 0.50
 VARIABLES FOR 2D GRAPHIC PRINTOUTS = 'U,V,B,S'
 VARIABLES FOR 3D GRAPHIC PRINTOUTS = 'Z,U,V,W,DP'
 /
+VERTICAL TURBULENCE MODEL : 1
 COEFFICIENT FOR HORIZONTAL DIFFUSION OF VELOCITIES : 0.
 COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES   : 0.
 /
 SOLVER FOR PPE = 2
 ACCURACY FOR PPE = 1.E-6
-MAXIMUM NUMBER OF ITERATIONS FOR PPE = 1000
 /
 NON-HYDROSTATIC VERSION : YES
 /
 LAW OF BOTTOM FRICTION= 0
 /
-/ DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION
-SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1
-ACCURACY FOR PROPAGATION = 1.E-6
-/
-/ DEFAULT VALUES UNTIL V8P5 KEPT FOR NON REGRESSION
-/
-VERTICAL TURBULENCE MODEL = 1
+MASS-BALANCE = YES
diff --git a/examples/telemac3d/NonLinearWave/vnv_non_linear_wave.py b/examples/telemac3d/NonLinearWave/vnv_non_linear_wave.py
index 95c5bfd603..c67b858542 100644
--- a/examples/telemac3d/NonLinearWave/vnv_non_linear_wave.py
+++ b/examples/telemac3d/NonLinearWave/vnv_non_linear_wave.py
@@ -56,17 +56,17 @@ class VnvStudy(AbstractVnvStudy):
         # Comparison with the last time frame of the reference file.
         self.check_epsilons('vnv_1:T3DRES',
                             'f3d_nonlinearwave.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_nonlinearwave.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