SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

[WIP] Updating SA-Diffusion term Discretisation

Open Bot-Enigma-0 opened this issue 8 months ago • 13 comments

Proposed Changes

Give a brief overview of your contribution here in a few sentences. The current discretisation of the diffusion terms in the SA model are not consistent with the recommendation of S-A from their original paper [1]. The current implementation treats the non-linear term ($c_{b2}(\tilde{\nu})^2$) as a cross-production source term. By applying the product rule and simplifying, the diffusion term can be written as: image

Then discretising gives: image

Note that S-A assume that $\nabla\nu=0$, which does not hold in compressible cases.

The current changes are only for the Base model, I am extending it to the others. Would appreciate any feedback!

[1]: Spalart, Philippe, and Steven Allmaras. "A one-equation turbulence model for aerodynamic flows." 30th aerospace sciences meeting and exhibit. 1992.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • [x] I am submitting my contribution to the develop branch.
  • [ ] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • [ ] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • [ ] I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • [ ] I have added a test case that demonstrates my contribution, if necessary.
  • [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

Bot-Enigma-0 avatar May 16 '25 18:05 Bot-Enigma-0

Hi,

Thank you for addressing this issue. The source diffusion (please note that this term is known as source diffusion rather than cross production source term) term in the SU2 code is currently treated explicitly (which may limit the CFL numbers of the SA model). One simple way is to adopt the original proposal by Spalart & Allmaras, as you pointed out. One should verify that the total sum of the coefficients is positive, resulting in a diffusive flux. Fortunately, using simple arithmetic averaging will result in a diffusive flux (as opposed to an anti-diffusive flux). Please bear in mind that for the negative version, some care should be taken: please follow the recent paper by Boris Diskin et al:

Revised USM3D-ME Implementation of Negative Version of Spalart–Allmaras Turbulence Model

AIAA Journal in press.

YairMO avatar May 20 '25 09:05 YairMO

Thank you for the paper. When extending this to the negative model I applied a very similar approach to the standard version. But after reading the positivity and boundedness discussion, I don't think the implementation I had would not be very stable. Rather the formulation the authors provide increases the stability, particularly due to the treatment of the $f_n$ term

Bot-Enigma-0 avatar May 20 '25 14:05 Bot-Enigma-0

To make sure that the formulation is stable, it should be verified that the sum of the coefficients is always positive. Diskin addressed this issue in great detail.

YairMO avatar May 20 '25 16:05 YairMO

Sorry, but I didn't follow through with all your work. Did you also modify the Jacobian due to the new additional diffusion flux (actually diffusion and anti-diffusion fluxes)?

YairMO avatar May 29 '25 16:05 YairMO

Sorry, but I didn't follow through with all your work. Did you also modify the Jacobian due to the new additional diffusion flux (actually diffusion and anti-diffusion fluxes)?

yes, i derived the exact Jacobians for the new discretisation

Bot-Enigma-0 avatar May 29 '25 16:05 Bot-Enigma-0

Do you have a written draft?

YairMO avatar May 29 '25 16:05 YairMO

for the jacobians? i'll type them up and post them in a moment

@YairMO heres the derivation. I've written it in the way it appears in the code.

jacobain_derivation_of_neg_model.pdf

Bot-Enigma-0 avatar May 29 '25 16:05 Bot-Enigma-0

Yes, thank you.

YairMO avatar May 29 '25 16:05 YairMO

Thank you for sharing. I'll look at it tomorrow.

On Thu, May 29, 2025 at 8:40 PM Rutvik Khedkar @.***> wrote:

Bot-Enigma-0 left a comment (su2code/SU2#2508) https://github.com/su2code/SU2/pull/2508#issuecomment-2919937513

for the jacobians? i'll type them up and post them in a moment

@YairMO https://github.com/YairMO heres the derivation. I've written it in the way it appears in the code.

jacobain_derivation_of_neg_model.pdf https://github.com/user-attachments/files/20509067/jacobain_derivation_of_neg_model.pdf

— Reply to this email directly, view it on GitHub https://github.com/su2code/SU2/pull/2508#issuecomment-2919937513, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4NZTIXQLLDPMWUGJOPVHD3A5BBJAVCNFSM6AAAAAB5JMX7VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMJZHEZTONJRGM . You are receiving this because you were mentioned.Message ID: @.***>

YairMO avatar May 29 '25 18:05 YairMO

Thank you again for sharing. Please find below my comments:

  1. The function f_n in Eq. 3 multiplies all terms in the square brackets. However, comparing Eq. 2 (seems correct) with Eq. 3 suggests that f_n should multiply only the two most right terms inside the square brackets.

  2. Referring to Zeta in Eq. 4, I think it simply should be Zeta = [(Nu_tilde)_ij / Nu_ij] = 0.5 * (Nu_tilde_j + Nu_tilde_i) / Nu_ij.

If I'm not wrong (based on my comments #2), then Eqs. 10 and 11 are probably incorrect. Nevertheless, I strongly recommend keeping the simple idea of the frozen diffusion coefficient also in the neg model. The exact derivation may destroy the dominant diagonal matrix characteristic of using frozen coefficients. In other words, in the general case, freezing the diffusion coefficient results in an unconditionally stable scheme. On the other hand, deriving an exact Jacobian may destroy this feature.

YairMO avatar May 30 '25 04:05 YairMO

  1. Thanks for the catch, it will be a small fix in the code since I use the chain rule for each expression.
  2. The zeta function in eq.4 was proposed by Diskin to maintain positivity. When applying a diffusion treatment to the cb2 term, the cell centred value $\tilde{\nu}i$ can destroy positivity. Hence Diskin proposes a modified $f_n(\zeta)$ cell centred function, which ensures positivity is maintained. When face averaged it reverts to the original fn function (i.e., $f_n(\zeta){ij} = f_n(\chi)$) you mentioned. For now I'm following Diskin's method, but also have provisions in the code to use the face averaged $f_n(\chi)$. From the small cases I have run (which so far diverge) the diffusion coefficient is positive when using either fn. When I fix the bug and run larger cases (more turbulent cases) it should become clear which is better.
  3. I am experimenting with frozen diffusion coefficients and exact linearisations to see their influence on the stability and accuracy.

Bot-Enigma-0 avatar May 30 '25 08:05 Bot-Enigma-0

Thanks for your explanation.

On Fri, May 30, 2025 at 11:48 AM Rutvik Khedkar @.***> wrote:

Bot-Enigma-0 left a comment (su2code/SU2#2508) https://github.com/su2code/SU2/pull/2508#issuecomment-2921649448

  1. Thanks for the catch, it will be a small fix in the code since I use the chain rule for each expression.
  2. The zeta function in eq.4 was proposed by Diskin to maintain positivity. When applying a diffusion treatment to the cb2 term, the cell centred value $\tilde{\nu}i$ can destroy positivity. Hence Diskin proposes a modified $f_n(\zeta)$ cell centred function, which ensures positivity is maintained. When face averaged it reverts to the original fn function (i.e., $f_n(\zeta){ij} = f_n(\chi)$) you mentioned. For now I'm following Diskin's method, but also have provisions in the code to use the face averaged $f_n(\chi)$. From the small cases I have run (which so far diverge) the diffusion coefficient is positive when using either fn. When I fix the bug and run larger cases (more turbulent cases) it should become clear which is better.
  3. I am experimenting with frozen diffusion coefficients and exact linearisations to see their influence on the stability and accuracy.

— Reply to this email directly, view it on GitHub https://github.com/su2code/SU2/pull/2508#issuecomment-2921649448, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4NZTINYXJVGJJN3DEHAHD3BALOFAVCNFSM6AAAAAB5JMX7VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRRGY2DSNBUHA . You are receiving this because you were mentioned.Message ID: @.***>

YairMO avatar May 30 '25 09:05 YairMO

I'm looking forward to your findings

On Fri, May 30, 2025 at 12:03 PM Yair Mor-Yossef @.***> wrote:

Thanks for your explanation.

On Fri, May 30, 2025 at 11:48 AM Rutvik Khedkar @.***> wrote:

Bot-Enigma-0 left a comment (su2code/SU2#2508) https://github.com/su2code/SU2/pull/2508#issuecomment-2921649448

  1. Thanks for the catch, it will be a small fix in the code since I use the chain rule for each expression.
  2. The zeta function in eq.4 was proposed by Diskin to maintain positivity. When applying a diffusion treatment to the cb2 term, the cell centred value $\tilde{\nu}i$ can destroy positivity. Hence Diskin proposes a modified $f_n(\zeta)$ cell centred function, which ensures positivity is maintained. When face averaged it reverts to the original fn function (i.e., $f_n(\zeta){ij} = f_n(\chi)$) you mentioned. For now I'm following Diskin's method, but also have provisions in the code to use the face averaged $f_n(\chi)$. From the small cases I have run (which so far diverge) the diffusion coefficient is positive when using either fn. When I fix the bug and run larger cases (more turbulent cases) it should become clear which is better.
  3. I am experimenting with frozen diffusion coefficients and exact linearisations to see their influence on the stability and accuracy.

— Reply to this email directly, view it on GitHub https://github.com/su2code/SU2/pull/2508#issuecomment-2921649448, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJ4NZTINYXJVGJJN3DEHAHD3BALOFAVCNFSM6AAAAAB5JMX7VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRRGY2DSNBUHA . You are receiving this because you were mentioned.Message ID: @.***>

YairMO avatar May 30 '25 09:05 YairMO