From 1f3b1d444db6fffe373a583c6858ebd0db6b3e9b 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 20:31:44 +0100 Subject: [PATCH] [VnV][telemac3d] Update stratification example with better choices of keywords - TREATMENT OF NEGATIVE DEPTHS = 2 (new default value since release 9.0) to improve mass conservation of water + tracer - use of gradient conjugate + preconditioning 34 = 2*17 to solve PPE, quite more efficient than GMRES for this example - switch to non-hydrostatic version (default) but no significant differences --- .../stratification/doc/stratification.tex | 21 +++++++--- .../stratification/f3d_stratification.slf | 2 +- .../f3d_stratification_gotm.slf | 2 +- .../f3d_stratification_gotm_Jackett.slf | 2 +- .../stratification/t3d_stratification.cas | 22 +++------- .../t3d_stratification_gotm.cas | 40 +++---------------- .../t3d_stratification_gotm_Jackett.cas | 40 +++---------------- .../stratification/vnv_stratification.py | 6 +-- .../stratification/vnv_stratification_gotm.py | 6 +-- 9 files changed, 40 insertions(+), 101 deletions(-) diff --git a/examples/telemac3d/stratification/doc/stratification.tex b/examples/telemac3d/stratification/doc/stratification.tex index bb83c23058..fbe5c7ad89 100644 --- a/examples/telemac3d/stratification/doc/stratification.tex +++ b/examples/telemac3d/stratification/doc/stratification.tex @@ -91,9 +91,9 @@ regularly spaced on the vertical, to form prism elements.\\ The time step is 2~s for a simulated period of 2,000~s. \bigskip -This case is computed with the hydrostatic pressure hypothesis. To solve advection, the N-type MURD scheme (scheme 4) +This case is computed with the non-hydrostatic version. +To solve advection, the N-type MURD scheme (scheme 4) is used for the velocities, $k$-$\epsilon$ model and the tracer (or salinity). -The implicitation coefficients for depth and velocities are equal to 1.\\ \section{Results} @@ -115,6 +115,7 @@ vertical column of water. However, the turbulence is clearly blocked by the saline stratification (see Figure \ref{t3d:stratification:fig:visco}). +\\ \begin{figure}[!htbp] \centering @@ -123,10 +124,20 @@ However, the turbulence is clearly blocked by the saline stratification \label{t3d:stratification:fig:evolTurb} \end{figure} -%\section{Conclusion} +Until release 9.0, \telkey{TREATMENT OF NEGATIVE DEPTHS} was set to 1 for this +example (old default value until release 8.5). +Changing to 2 (new default value since release 9.0, i.e. flux control) improves +the mass conservation of water for this example (up to machine precision) +and also improves the mass conservation of tracer (2 orders of magnitude). +\\ -\bigskip -To conclude, \telemac{3D} is able to represent correctly stratified flows. +There are no significant differences in the results if using the non-hydrostatic +version or not. + +\section{Conclusion} + +%\bigskip +\telemac{3D} is able to represent correctly stratified flows. In addition, the $k$-$\epsilon$ model is able to simulate turbulence generated by bottom friction. diff --git a/examples/telemac3d/stratification/f3d_stratification.slf b/examples/telemac3d/stratification/f3d_stratification.slf index f569473b04..666a585e2b 100644 --- a/examples/telemac3d/stratification/f3d_stratification.slf +++ b/examples/telemac3d/stratification/f3d_stratification.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5249d816edebd2a18444d66e0214c0f43bfdb33b3f5980ae98b86dc07716bbd +oid sha256:459bf492c43027c1f27abb71595dd4fba219c101b0695535a784133a31c7562f size 2056428 diff --git a/examples/telemac3d/stratification/f3d_stratification_gotm.slf b/examples/telemac3d/stratification/f3d_stratification_gotm.slf index 51803cb408..d277773c75 100644 --- a/examples/telemac3d/stratification/f3d_stratification_gotm.slf +++ b/examples/telemac3d/stratification/f3d_stratification_gotm.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8ab74617c85907ad7da9715b84f6ab824b75b8369d4dcddcffe5f7b23ed79c08 +oid sha256:3d47c56916272133d09c91e4bca3f6fdeabaed1cd5e6cf130c68a23acb88136b size 2256108 diff --git a/examples/telemac3d/stratification/f3d_stratification_gotm_Jackett.slf b/examples/telemac3d/stratification/f3d_stratification_gotm_Jackett.slf index 29337c3428..e998dbd816 100644 --- a/examples/telemac3d/stratification/f3d_stratification_gotm_Jackett.slf +++ b/examples/telemac3d/stratification/f3d_stratification_gotm_Jackett.slf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c316c143c0879ce427c395168f4b74baa9671c89c1c499a5efbe6c2103fba8d +oid sha256:a5159590e96c87eaa7e8732aa9288522b968adffa0da202248f7563d5f066e02 size 2455788 diff --git a/examples/telemac3d/stratification/t3d_stratification.cas b/examples/telemac3d/stratification/t3d_stratification.cas index 4cd1493b13..2b16e5b408 100644 --- a/examples/telemac3d/stratification/t3d_stratification.cas +++ b/examples/telemac3d/stratification/t3d_stratification.cas @@ -55,22 +55,16 @@ VERTICAL TURBULENCE MODEL = 3 COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES = 1.D-6 / PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 +/ +SOLVER FOR PPE = 1 +PRECONDITIONING FOR PPE = 34 +/ /---------------------------- / TERMES SOURCES /---------------------------- FRICTION COEFFICIENT FOR THE BOTTOM = 70. LAW OF BOTTOM FRICTION = 3 /---------------------------- -/ PROPAGATION -/---------------------------- -/MAXIMUM NUMBER OF ITERATIONS FOR PROPAGATION = 500 -/ACCURACY FOR DIFFUSION OF TRACERS : 1.E-10 -/ -/IMPLICITATION FOR DEPTH = 0.6 -IMPLICITATION FOR DEPTH = 1. -/IMPLICITATION FOR VELOCITIES = 0.6 -/IMPLICITATION FOR VELOCITIES = 1. -/---------------------------- / TRACER /---------------------------- NUMBER OF TRACERS : 1 @@ -83,19 +77,13 @@ DENSITY LAW : 2 /STANDARD VALUES FOR TRACERS : 0. / COEFFICIENT FOR VERTICAL DIFFUSION OF TRACERS = 1.E-6 +ACCURACY FOR DIFFUSION OF TRACERS : 1.E-15 PRECONDITIONING FOR DIFFUSION OF TRACERS : 34 PRECONDITIONING FOR DIFFUSION OF K-EPSILON : 34 / IMPLICITATION FOR DIFFUSION : 2. / -/ DEFAULT VALUE UNTIL V7P3 KEPT FOR NON REGRESSION -NON-HYDROSTATIC VERSION = NO -/ / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. SCHEME OPTION FOR ADVECTION OF TRACERS = 1 SCHEME OPTION FOR ADVECTION OF K-EPSILON = 1 -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/stratification/t3d_stratification_gotm.cas b/examples/telemac3d/stratification/t3d_stratification_gotm.cas index df2337af03..bad92fa125 100644 --- a/examples/telemac3d/stratification/t3d_stratification_gotm.cas +++ b/examples/telemac3d/stratification/t3d_stratification_gotm.cas @@ -1,21 +1,3 @@ -/VERSION NON-HYDROSTATIQUE = YES -/ELEMENT : TETRAEDRE -/TRAITEMENT DES FLUX AUX FRONTIERES : 2;2 -/ -/ Stratification dans un canal, modele k-epsilon -/ Pas de comparaison avec l'experience, mais la stratification -/ se maintient a cause du terme d'amortissement du -/ au nombre de Richardson. -/ Pas de turbulence a l'entree. On voit s'etablir la turbulence -/ a partir du fond. -/ -/ 1254 s sur HP 785/C3700 5.8 16/01/2008 (Nag:3013 s,Dell:792 s) -/ 1191 s sur HP 785/C3700 5.9 17/10/2008 (Nag:???? s,Dell:647 s) -/ 1189 s sur HP 785/C3700 6.0 04/12/2009 (Nag:2865 s, Dell:502 s) -/ 1241 s sur HP 785/C3700 6.1 06/12/2010 -/ 57 s sur HP Linux 8 procs 6.1 24/01/2011 -/ 35 s sur HP Linux 8 procs 6.2 30/05/2012 -/ TITLE = 'TELEMAC 3D : CANAL' / FORTRAN FILE : 'user_fortran' @@ -56,22 +38,16 @@ VERTICAL TURBULENCE MODEL = 6 COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES = 1.D-6 / PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 +/ +SOLVER FOR PPE = 1 +PRECONDITIONING FOR PPE = 34 +/ /---------------------------- / TERMES SOURCES /---------------------------- FRICTION COEFFICIENT FOR THE BOTTOM = 9.3E-4 LAW OF BOTTOM FRICTION = 5 /---------------------------- -/ PROPAGATION -/---------------------------- -/MAXIMUM NUMBER OF ITERATIONS FOR PROPAGATION = 500 -/ACCURACY FOR DIFFUSION OF TRACERS : 1.E-10 -/ -/IMPLICITATION FOR DEPTH = 0.6 -IMPLICITATION FOR DEPTH = 1. -/IMPLICITATION FOR VELOCITIES = 0.6 -/IMPLICITATION FOR VELOCITIES = 1. -/---------------------------- / TRACER /---------------------------- NUMBER OF TRACERS : 1 @@ -84,19 +60,13 @@ DENSITY LAW : 2 /STANDARD VALUES FOR TRACERS : 0. / COEFFICIENT FOR VERTICAL DIFFUSION OF TRACERS = 1.E-6 +ACCURACY FOR DIFFUSION OF TRACERS : 1.E-15 PRECONDITIONING FOR DIFFUSION OF TRACERS : 34 PRECONDITIONING FOR DIFFUSION OF K-EPSILON : 34 / IMPLICITATION FOR DIFFUSION : 2. / -/ DEFAULT VALUE UNTIL V7P3 KEPT FOR NON REGRESSION -NON-HYDROSTATIC VERSION = NO -/ / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. SCHEME OPTION FOR ADVECTION OF TRACERS = 1 SCHEME OPTION FOR ADVECTION OF K-EPSILON = 1 -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/stratification/t3d_stratification_gotm_Jackett.cas b/examples/telemac3d/stratification/t3d_stratification_gotm_Jackett.cas index 22cba8ee33..9037df18d3 100644 --- a/examples/telemac3d/stratification/t3d_stratification_gotm_Jackett.cas +++ b/examples/telemac3d/stratification/t3d_stratification_gotm_Jackett.cas @@ -1,21 +1,3 @@ -/VERSION NON-HYDROSTATIQUE = YES -/ELEMENT : TETRAEDRE -/TRAITEMENT DES FLUX AUX FRONTIERES : 2;2 -/ -/ Stratification dans un canal, modele k-epsilon -/ Pas de comparaison avec l'experience, mais la stratification -/ se maintient a cause du terme d'amortissement du -/ au nombre de Richardson. -/ Pas de turbulence a l'entree. On voit s'etablir la turbulence -/ a partir du fond. -/ -/ 1254 s sur HP 785/C3700 5.8 16/01/2008 (Nag:3013 s,Dell:792 s) -/ 1191 s sur HP 785/C3700 5.9 17/10/2008 (Nag:???? s,Dell:647 s) -/ 1189 s sur HP 785/C3700 6.0 04/12/2009 (Nag:2865 s, Dell:502 s) -/ 1241 s sur HP 785/C3700 6.1 06/12/2010 -/ 57 s sur HP Linux 8 procs 6.1 24/01/2011 -/ 35 s sur HP Linux 8 procs 6.2 30/05/2012 -/ TITLE = 'TELEMAC 3D : CANAL' / FORTRAN FILE : 'user_fortran' @@ -57,22 +39,16 @@ VERTICAL TURBULENCE MODEL = 6 COEFFICIENT FOR VERTICAL DIFFUSION OF VELOCITIES = 1.D-6 / PRECONDITIONING FOR DIFFUSION OF VELOCITIES = 34 +/ +SOLVER FOR PPE = 1 +PRECONDITIONING FOR PPE = 34 +/ /---------------------------- / TERMES SOURCES /---------------------------- FRICTION COEFFICIENT FOR THE BOTTOM = 9.3E-4 LAW OF BOTTOM FRICTION = 5 /---------------------------- -/ PROPAGATION -/---------------------------- -/MAXIMUM NUMBER OF ITERATIONS FOR PROPAGATION = 500 -/ACCURACY FOR DIFFUSION OF TRACERS : 1.E-10 -/ -/IMPLICITATION FOR DEPTH = 0.6 -IMPLICITATION FOR DEPTH = 1. -/IMPLICITATION FOR VELOCITIES = 0.6 -/IMPLICITATION FOR VELOCITIES = 1. -/---------------------------- / TRACER /---------------------------- / FOR DENSITY LAW = 6 (JACKETT ET AL. LAW) @@ -94,19 +70,13 @@ DENSITY LAW : 6 /STANDARD VALUES FOR TRACERS : 0. / COEFFICIENT FOR VERTICAL DIFFUSION OF TRACERS = 1.E-6 +ACCURACY FOR DIFFUSION OF TRACERS : 1.E-15 PRECONDITIONING FOR DIFFUSION OF TRACERS : 34 PRECONDITIONING FOR DIFFUSION OF K-EPSILON : 34 / IMPLICITATION FOR DIFFUSION : 2. / -/ DEFAULT VALUE UNTIL V7P3 KEPT FOR NON REGRESSION -NON-HYDROSTATIC VERSION = NO -/ / DEFAULT VALUES UNTIL V8P0 KEPT FOR NON REGRESSION SCHEME OPTION FOR ADVECTION OF VELOCITIES = 1 -IMPLICITATION FOR VELOCITIES = 1. SCHEME OPTION FOR ADVECTION OF TRACERS = 1 SCHEME OPTION FOR ADVECTION OF K-EPSILON = 1 -/ -/ DEFAULT VALUE UNTIL V8P5 KEPT FOR NON REGRESSION -TREATMENT OF NEGATIVE DEPTHS = 1 diff --git a/examples/telemac3d/stratification/vnv_stratification.py b/examples/telemac3d/stratification/vnv_stratification.py index a770319128..010001be34 100644 --- a/examples/telemac3d/stratification/vnv_stratification.py +++ b/examples/telemac3d/stratification/vnv_stratification.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_stratification.slf', - eps=[1.E-10]) + eps=[2.E-6]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_2:T3DRES', 'f3d_stratification.slf', - eps=[1.E-10]) + eps=[2.E-6]) # Comparison between sequential and parallel run. self.check_epsilons('vnv_1:T3DRES', 'vnv_2:T3DRES', - eps=[1.E-10]) + eps=[2.E-6]) def _post(self): diff --git a/examples/telemac3d/stratification/vnv_stratification_gotm.py b/examples/telemac3d/stratification/vnv_stratification_gotm.py index 0819fcde75..5e29a890c2 100644 --- a/examples/telemac3d/stratification/vnv_stratification_gotm.py +++ b/examples/telemac3d/stratification/vnv_stratification_gotm.py @@ -67,17 +67,17 @@ class VnvStudy(AbstractVnvStudy): # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_1:T3DRES', 'f3d_stratification_gotm.slf', - eps=[1.E-8]) + eps=[1.E-10]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_2:T3DRES', 'f3d_stratification_gotm.slf', - eps=[1.E-8]) + eps=[1.E-10]) # Comparison between sequential and parallel run. self.check_epsilons('vnv_1:T3DRES', 'vnv_2:T3DRES', - eps=[1.E-8]) + eps=[1.E-10]) # Comparison with the last time frame of the reference file. self.check_epsilons('vnv_3:T3DRES', -- GitLab