INT: Integration of Upstream CFD's grey-area sigma into kOmegaSST models

- Initial code supplied by Marian Fuchs, Upstream CFD GmbH
- Code cleaned/refactored/integrated by OpenCFD
This commit is contained in:
Andrew Heather 2022-08-10 14:16:05 +01:00
parent 541b6eb28a
commit 2cc96ad7f4
5 changed files with 156 additions and 19 deletions

View File

@ -6,7 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -164,6 +165,22 @@ tmp<volScalarField::Internal> kOmegaSSTBase<BasicEddyViscosityModel>::epsilonByk
}
template<class BasicEddyViscosityModel>
tmp<volScalarField::Internal> kOmegaSSTBase<BasicEddyViscosityModel>::GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const
{
return tmp<volScalarField::Internal>::New
(
IOobject::scopedName(this->type(), "GbyNu"),
gradU() && dev(twoSymm(gradU()))
);
}
template<class BasicEddyViscosityModel>
tmp<volScalarField::Internal> kOmegaSSTBase<BasicEddyViscosityModel>::GbyNu
(
@ -510,13 +527,8 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
tmp<volTensorField> tgradU = fvc::grad(U);
volScalarField S2(this->S2(F1, tgradU()));
volScalarField::Internal GbyNu0
(
this->type() + ":GbyNu",
(tgradU() && dev(twoSymm(tgradU())))
);
volScalarField::Internal GbyNu0(this->GbyNu0(tgradU(), F1, S2));
volScalarField::Internal G(this->GName(), nut*GbyNu0);
tgradU.clear();
// Update omega and G at the wall
omega_.boundaryFieldRef().updateCoeffs();

View File

@ -6,7 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd.
Copyright (C) 2017-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -273,6 +274,14 @@ protected:
const volTensorField& gradU
) const;
//- Return (G/nu)_0
virtual tmp<volScalarField::Internal> GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const;
//- Return G/nu
virtual tmp<volScalarField::Internal> GbyNu
(

View File

@ -6,7 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,6 +50,35 @@ tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::fd
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::S2
(
const volScalarField& F1,
const volTensorField& gradU
) const
{
tmp<volScalarField> tS2 =
this->kOmegaSSTDES<BasicTurbulenceModel>::S2(F1, gradU);
if (useSigma_)
{
volScalarField& S2 = tS2.ref();
const volScalarField CDES(this->CDES(F1));
const volScalarField& k = this->k_;
const volScalarField& omega = this->omega_;
const volScalarField Ssigma(this->Ssigma(gradU));
S2 -=
(
fd(mag(gradU))
*pos(sqrt(k)/(this->betaStar_*omega) - CDES*this->delta())
*(S2 - sqr(Ssigma))
);
}
return tS2;
}
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::dTilda
(
@ -75,6 +105,45 @@ tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::dTilda
);
}
template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDDES<BasicTurbulenceModel>::GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const
{
tmp<volScalarField::Internal> tGbyNu0 =
this->kOmegaSSTDES<BasicTurbulenceModel>::GbyNu0(gradU, F1, S2);
if (useSigma_)
{
volScalarField::Internal& GbyNu0 = tGbyNu0.ref();
const volScalarField::Internal CDES(this->CDES(F1)()());
const volScalarField::Internal& k = this->k_();
const volScalarField::Internal& omega = this->omega_();
GbyNu0 -=
fd(mag(gradU))()()
*pos(sqrt(k)/(this->betaStar_*omega) - CDES*this->delta()())
*(GbyNu0 - S2);
}
return tGbyNu0;
}
template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDDES<BasicTurbulenceModel>::GbyNu
(
const volScalarField::Internal& GbyNu0,
const volScalarField::Internal& F2,
const volScalarField::Internal& S2
) const
{
return GbyNu0; // Unlimited
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -103,14 +172,30 @@ kOmegaSSTDDES<BasicTurbulenceModel>::kOmegaSSTDDES
type
),
useSigma_
(
Switch::getOrAddToDict
(
"useSigma",
this->coeffDict_,
false
)
),
Cd1_
(
dimensioned<scalar>::getOrAddToDict
(
"Cd1",
this->coeffDict_,
20
)
useSigma_ ?
dimensioned<scalar>::getOrAddToDict
(
"Cd1Sigma",
this->coeffDict_,
22
)
: dimensioned<scalar>::getOrAddToDict
(
"Cd1",
this->coeffDict_,
20
)
),
Cd2_
(

View File

@ -6,7 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019, 2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -46,8 +47,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef kOmegaSSTDDES_H
#define kOmegaSSTDDES_H
#ifndef Foam_kOmegaSSTDDES_H
#define Foam_kOmegaSSTDDES_H
#include "kOmegaSSTDES.H"
@ -82,6 +83,9 @@ protected:
// Protected data
//- Switch to activate grey-area enhanced sigma-DDES
Switch useSigma_;
// Model coefficients
dimensionedScalar Cd1_;
@ -90,6 +94,13 @@ protected:
// Protected Member Functions
//- Return square of strain rate
virtual tmp<volScalarField> S2
(
const volScalarField& F1,
const volTensorField& gradU
) const;
//- Length scale
virtual tmp<volScalarField> dTilda
(
@ -97,6 +108,21 @@ protected:
const volScalarField& CDES
) const;
//- Return (G/nu)_0
virtual tmp<volScalarField::Internal> GbyNu0
(
const volTensorField& gradU,
const volScalarField& F1,
const volScalarField& S2
) const;
//- Return G/nu
virtual tmp<volScalarField::Internal> GbyNu
(
const volScalarField::Internal& GbyNu0,
const volScalarField::Internal& F2,
const volScalarField::Internal& S2
) const;
public:

View File

@ -6,7 +6,8 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2022 Upstream CFD GmbH
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -167,6 +168,10 @@ kOmegaSSTDES<BasicTurbulenceModel>::kOmegaSSTDES
)
)
{
// Note: Ctrans coeff is model specific; for k-w = 60
this->Ctrans_ =
dimensioned<scalar>::getOrAddToDict("Ctrans", this->coeffDict_, 60.0);
if (type == typeName)
{
this->printCoeffs(type);