From d06005f8c75c30094d96a1fa18668e8ccdc4bf91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Chi-Tu=C3=A2n=20Pham?= <chi-tuan.pham@edf.fr>
Date: Wed, 8 Jan 2025 15:39:06 +0100
Subject: [PATCH] [VnV][telemac3d] Update stratif_wind example with better
 choices for keywords - TIDAL FLATS = YES (default value) to improve mass
 conservation (water depth + tracer, water depth up to machine accuracy) -
 SOLVER FOR PROPAGATION = 7 (GMRES = default) as the most efficient - with
 theses choices of solvers, accuracies for propagation and PPE can be set to
 default = 1.E-8 - ==> less differences between sequential and parallel runs

---
 examples/telemac3d/stratif_wind/doc/stratif_wind.tex |  5 ++++-
 examples/telemac3d/stratif_wind/f3d_stratif_wind.slf |  2 +-
 examples/telemac3d/stratif_wind/t3d_stratif_wind.cas | 12 ++++--------
 examples/telemac3d/stratif_wind/vnv_stratif_wind.py  |  6 +++---
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/examples/telemac3d/stratif_wind/doc/stratif_wind.tex b/examples/telemac3d/stratif_wind/doc/stratif_wind.tex
index 692cb7fee0..c9cc0bf00d 100644
--- a/examples/telemac3d/stratif_wind/doc/stratif_wind.tex
+++ b/examples/telemac3d/stratif_wind/doc/stratif_wind.tex
@@ -132,7 +132,7 @@ and \telkey{ACCURACY FOR PPE} was set to 10$^{-4}$ (default value until release
 
 \subsubsection{Improved numerical parameters since 2015}
 To greatly improve the results (less diffusion for temperature field),
-the \telkey{ACCURACY FOR PPE} has to be decreased (from 10$^{-4}$ to 10$^{-7}$
+the \telkey{ACCURACY FOR PPE} has to be decreased (from 10$^{-4}$ to 10$^{-8}$
 e.g.).
 It also enables to decrease the differences between sequential and parallel
 runs, in particular for temperature.
@@ -148,6 +148,9 @@ temperature field:
 The extra cost for CPU time is very moderate for this test-case compared to the
 PSI-type MURD scheme.
 
+Using \telkey{TIDAL FLATS} = YES (default choice) improves mass conservation
+(water depth up to machine accuracy, but only a little bit for temperature).
+
 Setting the 3 keywords \telkey{IMPLICITATION FOR DEPTH} and
 \telkey{IMPLICITATION FOR VELOCITIES}, \telkey{MASS-LUMPING FOR DEPTH} to their
 default values (0.55 ; 0.55 ; 0.) does not significantly change the results and
diff --git a/examples/telemac3d/stratif_wind/f3d_stratif_wind.slf b/examples/telemac3d/stratif_wind/f3d_stratif_wind.slf
index 72e944ccc0..329071f574 100644
--- a/examples/telemac3d/stratif_wind/f3d_stratif_wind.slf
+++ b/examples/telemac3d/stratif_wind/f3d_stratif_wind.slf
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:1012400168ee988d2694d4c60eb2fdbcc4c29880e0ec2482e67c8366c11f2dc5
+oid sha256:52db0bbf74c7d7ac577d703af061958b9818da3ec6c8a05eecaae69d83840b9f
 size 7340940
diff --git a/examples/telemac3d/stratif_wind/t3d_stratif_wind.cas b/examples/telemac3d/stratif_wind/t3d_stratif_wind.cas
index 877ab7246b..0c474b2a82 100644
--- a/examples/telemac3d/stratif_wind/t3d_stratif_wind.cas
+++ b/examples/telemac3d/stratif_wind/t3d_stratif_wind.cas
@@ -24,8 +24,6 @@ NUMBER OF HORIZONTAL LEVELS        : 40
 /----------------------------------------------------------------------
 /                        NUMERICAL OPTIONS
 /----------------------------------------------------------------------
-TIDAL FLATS : NO
-
 MASS-BALANCE : YES
 /CONSTANT VISCOSITY
 VERTICAL TURBULENCE MODEL : 1
@@ -35,9 +33,12 @@ COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES   : 0.01
 SCHEME FOR ADVECTION OF VELOCITIES                 : 1
 
 ACCURACY FOR DIFFUSION OF VELOCITIES : 1.E-8
-ACCURACY FOR PPE = 1.E-7
 PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34
+/
+SOLVER FOR PPE = 1
 PRECONDITIONING FOR PPE = 34
+/
+MASS-LUMPING FOR DEPTH      = 1.
 /----------------------------------------------------------------------
 /                        PHYSICAL OPTIONS
 /----------------------------------------------------------------------
@@ -65,10 +66,5 @@ WIND VELOCITY ALONG X         : 10.
 WIND VELOCITY ALONG Y         :  0.
 /----------------------------------------------------------------------
 /
-/ DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION
-SOLVER FOR PROPAGATION = 1
-ACCURACY FOR PROPAGATION = 1.E-6
-SOLVER FOR PPE = 1
-/
 / DEFAULT VALUE UNTIL V8P1 KEPT FOR NON REGRESSION
 COEFFICIENT OF WIND INFLUENCE VARYING WITH WIND SPEED = NO
diff --git a/examples/telemac3d/stratif_wind/vnv_stratif_wind.py b/examples/telemac3d/stratif_wind/vnv_stratif_wind.py
index 54dd0abc61..b2ea508fbf 100644
--- a/examples/telemac3d/stratif_wind/vnv_stratif_wind.py
+++ b/examples/telemac3d/stratif_wind/vnv_stratif_wind.py
@@ -50,17 +50,17 @@ class VnvStudy(AbstractVnvStudy):
         # Comparison with the last time frame of the reference file.
         self.check_epsilons('vnv_1:T3DRES',
                             'f3d_stratif_wind.slf',
-                            eps=[1.E-5, 1.E-5, 1.E-5, 1.E-5, 0.04])
+                            eps=[1.E-6, 1.E-5, 1.E-5, 1.E-5, 2.E-3])
 
         # Comparison with the last time frame of the reference file.
         self.check_epsilons('vnv_2:T3DRES',
                             'f3d_stratif_wind.slf',
-                            eps=[1.E-5, 2.E-5, 1.E-5, 1.E-5, 0.05])
+                            eps=[1.E-6, 1.E-5, 1.E-5, 1.E-5, 6.E-3])
 
         # Comparison between sequential and parallel run.
         self.check_epsilons('vnv_1:T3DRES',
                             'vnv_2:T3DRES',
-                            eps=[1.E-5, 2.E-5, 1.E-5, 1.E-5, 0.05])
+                            eps=[1.E-6, 1.E-5, 1.E-5, 1.E-5, 6.E-3])
 
 
     def _post(self):
-- 
GitLab