Implementing Menter SST Model with Vorticity Source Term in foam-extend-3.2

1. Overview

Vorticity source term helps in convergence and sometimes prevents calculations from blowing up. I implemented this correction to the kOmegaSST of foam-extend-3.2 according to NASA's documentation (https://turbmodels.larc.nasa.gov/sst.html).

2. Source Code

The source code is shown in the box below. The magenta part in line 24, 26, 49 are where I changed.

correct() of src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
void kOmegaSST::correct()
{
    // Bound in case of topological change
    // HJ, 22/Aug/2007
    if (mesh_.changing())
    {
        bound(k_, k0_);
        bound(omega_, omega0_);
    }

    RASModel::correct();

    if (!turbulence_)
    {
        return;
    }

    if (mesh_.changing())
    {
        y_.correct();
    }

    const volScalarField S2(2*magSqr(symm(fvc::grad(U_))));
    const volScalarField W2(2*magSqr(skew(fvc::grad(U_))));

    volScalarField G("RASModel::G", nut_*W2);

    // Update omega and G at the wall
    omega_.boundaryField().updateCoeffs();

    const volScalarField CDkOmega
    (
        (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_
    );

    const volScalarField F1(this->F1(CDkOmega));

    // Turbulent frequency equation
    fvScalarMatrix omegaEqn
    (
        fvm::ddt(omega_)
      + fvm::div(phi_, omega_)
      + fvm::SuSp(-fvc::div(phi_), omega_)
      - fvm::laplacian(DomegaEff(F1), omega_)
     ==
        gamma(F1)
       *min
        (
            W2,
            (c1_/a1_)*betaStar_*omega_*max(a1_*omega_, b1_*F23()*sqrt(S2))
        )
      - fvm::Sp(beta(F1)*omega_, omega_)
      - fvm::SuSp
        (
            (F1 - scalar(1))*CDkOmega/omega_,
            omega_
        )
    );

    omegaEqn.relax();

    // No longer needed: matrix completes at the point of solution
    // HJ, 17/Apr/2012
//     omegaEqn.completeAssembly();

    solve(omegaEqn);
    bound(omega_, omega0_);

    // Turbulent kinetic energy equation
    fvScalarMatrix kEqn
    (
        fvm::ddt(k_)
      + fvm::div(phi_, k_)
      + fvm::SuSp(-fvc::div(phi_), k_)
      - fvm::laplacian(DkEff(F1), k_)
     ==
        min(G, c1_*betaStar_*k_*omega_)
      - fvm::Sp(betaStar_*omega_, k_)
    );

    kEqn.relax();
    solve(kEqn);
    bound(k_, k0_);
    bound(omega_, omega0_);

    // Re-calculate viscosity
    // Fixed sqrt(2) error.  HJ, 10/Jun/2015
    nut_ = a1_*k_/max(a1_*omega_, b1_*F23()*sqrt(S2));
    nut_ = min(nut_, nuRatio()*nu());
    nut_.correctBoundaryConditions();
}

3. Something I'm curious about

In the original version of incompressible kOmegaSST of foam-extend-3.2, sqr(S) is used as source terms for kEqn and omegaEqn. But by definition, it should be tgradU() && twoSymm(tgradU()). And in SST-V model, which is explained in this article, uses sqr(W) as source terms. No model in NASA's documentation uses sqr(S). I'm curious about where this model came from.

Comments