During SciCo 2024 at Chatou (March 25-26), a discussion was proposed to change some default values of keywords or not + some changes of use.
Attached file is my slides.
keywords_SciCo2024_240326.pdf
TREATMENT OF NEGATIVE DEPTHS = 2 (flux control to have no h < 0) rather than 1 (smoothing which can let h < 0) for TELEMAC-2D and TELEMAC-3D,
SCHEME FOR ADVECTION OF TRACERS or 3rd component of TYPE OF ADVECTION (TELEMAC-2D) not characteristics (not mass-conservative). Switch to a distributive scheme which works for tidal flats. NERD is suggested, rather than LIPS,
VERTICAL TURBULENCE MODEL (TELEMAC-3D) = 2 (mixing length rather than current constant viscosity = 1, in that case, agreement is done with Nezu & Nakagawa mixing length (for sure, not a transport equation model to spare CPU time),
homogenisation of default values between TELEMAC-2D and TELEMAC-3D for SPATIAL PROJECTION TYPE and LATITUDE OF ORIGIN POINT. SPATIAL PROJECTION TYPE = 1 (Cartesian not georeferenced rather than 2 = Mercator) and LATITUDE OF ORIGIN POINT = 0 (rather than 48 as currently in 2D) are chosen. SPATIAL PROJECTION TYPE = 1 with SPHERICAL COORDINATES = YES leads to a stop with error, so that the user is warned something is not good and should be checked).
if TREATMENT OF NEGATIVE DEPTHS = 2, it is mandatory to set a few variables to special ones (MASS-LUMPING ON H = 1., CONTINUITY CORRECTION = YES, SUPG OPTION for h = 0) which are not the default values. What can be done in lecdon_telemac2d is to change the associated variables to what is mandatory + a warning message in the listing rather than also changing these default values,
with mass-conservative advection scheme for tracers, ACCURACY FOR DIFFUSION OF TRACERS should be changed to 1.E-8 (rather than default current value = 1.E-6) as done in TELEMAC-3D,
MIXING LENGTH MODEL default value should be changed from 1 (Prandtl) to 3 (Nezu & Nakagawa) in addition to VERTICAL TURBULENCE MODEL = 2.
SCHEME FOR ADVECTION OF VELOCITIES + SCHEME FOR ADVECTION OF K-EPSILON (TELEMAC-3D). Currently LIPS since v8p1, no back to characteristics (some users prefer to keep the same advection scheme for every variable and others or the same do not like characteristics),
TREATMENT OF THE LINEAR SYSTEM (TELEMAC-2D). Currently wave equation since v8p2 (but not the expected Shallow Water Equations), faster and more robust (but does not solve the same equations). A little majority is to keep current choice,
SOLVER FOR DIFFUSION OF SUSPENSION (GAIA), currently = 1 (conjugate gradient) but the matrix may be not symmetric due to settling velocity. In TELEMAC-3D, SOLVER FOR DIFFUSION OF THE SEDIMENT has default value = 3 (conjugate gradient on normal equation) which can to invert non symmetric matrices. GMRES may be a new default choice. @alexander.breugem warns that he had trouble with LIPS and GMRES, to be investigated and demonstrated.
I will try to find whether I can make a test case that shows the issue, and if so, make an issue on Gitlab. However, I have found back the code that I though explained the issue. It is in tvf_imp_3d.slf, there is an IF statement, depending on the kind of solver (slspsi, which is copied in a previous routine from slvdif). In the ELSE part (so when you do not use either GMRES or a direct solver), there is aa statement to clip extrema, thus avoiding wiggles and negative concentrations.
See the code fragment below (particularly the red box).
Thanks for the explanation and the part of the subroutine.
I do not understand why the same choice of solver has to be used for LIPS and for the diffusion of the variable, certainly because it was useful for implementation and conjugate gradient is often used for diffusion of the variable.
Currently, I can see 3 possibilities to improve if you can make a test case:
trying to add the clipping for F/SF after calling SOLVE if using GMRES or direct solver (but properties should then be checked),
introduce a new option of solver for LIPS so that GMRES can be used for the diffusion of sediment, but not for the advection of sediment with LIPS,
force the use the Jacobi method whatever the value of SLVDIV is given.
Results for the test case (at least) would be interesting to investigate.
I have to investigate why these choices of implementation were done.
The issue happened in a real case a couple of years ago. I don't think I won't be able to find that one back. I will see whether I can make an example where the same issue happens.
As for the three suggestions, I have a slight preference for option 1 (but we need need to check mass conservation in that case carefully).
Hello Alexander,
It would be great if you can build an example with the same issue. It could give us an opportunity to try to provide a better solution.
Simplification of use of keywords/deletions of keywords.
When using a file dedicated to 1 specific feature, some users suggest not to use another keyword to say the dedicated file is to be used but only the mention of the name of the file should activate the features could be enough, e.g.:
PREVIOUS COMPUTATION FILE and boolean COMPUTATION CONTINUED as done in TOMAWAC,
BREACHES DATA FILE and boolean BREACH,
FLUXLINE INPUT FILE and boolean FLUXLINE,
REFERENCE FILE and boolean VALIDATION,
VELOCITY DELWAQ FILE and boolean VELOCITY FOR DELWAQ,
DIFFUSIVITY DELWAQ FILE and boolean DIFFUSIVITY FOR DELWAQ,
TEMPERATURE DELWAQ FILE and boolean TEMPERATURE FOR DELWAQ,
SALINITY DELWAQ FILE and boolean SALINITY FOR DELWAQ.
During the SciCo 2024 discussion, for TELEMAC-3D, it can be added:
FILE FOR 2D CONTINUATION and the boolean 2D CONTINUATION (for a 2D file, e.g. a TELEMAC-2D result file),
PREVIOUS COMPUTATION FILE and the boolean COMPUTATION CONTINUED (for a 3D file).
Simplification of use/change of names/deletion of keywords:
SUPG OPTION (TELEMAC-3D): switch from a 4 integer array to 1 single integer as only the 1st component was read and used,
DIFFUSION OF... / SCHEME FOR DIFFUSION OF... (TELEMAC-2D/TELEMAC-3D): choose the same name and the one currently used by TELEMAC-3D could be retained (SCHEME FOR DIFFUSION OF VELOCITIES and SCHEME FOR DIFFUSION OF TRACERS) with a number as @alexander.breugem is to resurrect option 2, diffusion only on the vertical). The main work is still to understand why DIFFUSION = NO is not equivalent to coefficient of diffusion = 0,
TIDAL FLATS (TELEMAC-2D) to be merged with OPTION FOR THE TREATMENT OF TIDAL FLATS? TIDAL FLATS = NO equivalent to OPTION FOR THE TREATMENT OF TIDAL FLATS = 0. One suggestion is to shorten the name of this last option, e.g. OPTION FOR TIDAL FLATS?
I think the difference between NO DIFFUSION and setting the diffusion coefficient equal to zero, because in the former case some routines are not executed, thus leading to faster calculations. However Sara told me during the GAIA hackathon, that the recommended way of switching of diffusion in TELEMAC-2D, is setting the diffusion coefficient to zero, because if you set NO DIFFUSION, there is a bug, leading to from values in the mass balance in the log file. Apparently some terms needed for the mass balance are only calculated after the routine cvdftr is in case of no diffusion wit the statement
IF(.NOT.DIFT) RETURN
I don't know whether the same also applied to TELEMAC-3D
OK thanks Alexander, I remember already having the same discussion with Sara.
For sure, depending on the choice of advection scheme, there should be things not implemented correctly.
In #428 (closed) Agnès decided to remove the same option for no diffusion as, in addition to diffusion, it could switch off the computation of source terms.
Perhaps the same should be done in 2D.
You are right that we need to be careful with respect to the computation of the source terms. When using the mass conservative advections schemes (MURD, ERIA, LIPS, NERD LEO POSTMA), the source terms are calculation in that advection routine. So we might be able to tackle this by a check in LECDON_TELEMAC, where we don not allow switching off diffusion when using the CHARACTERISTIC METHOD (which is not a very good idea idea for tracers anyway) or SUPG advection scheme (where I think you need the diffusion, because you solve a matrix for advection-diffusion together).
Note that in T3D, I implemented all those terms (explitic and implicit source terms as well as surface boundary conditions, in the set_dif routine, so that you can switch off the horizontal diffusion (I need to finish that branch)).
Utility of keywords LINEARIZED PROPAGATION + MEAN DEPTH FOR LINEARIZATION (TELEMAC-2D + TELEMAC-3D)?
Except Alexis once, nobody in the audience has ever used these 2 keywords which seem deprecated.
They may be deleted.