BUG: turbulenceFields: use omega funcs of turbulence models (fixes #2132)

This commit is contained in:
Kutalmis Bercin
2021-06-23 17:21:11 +01:00
committed by Andrew Heather
parent 084f89ee94
commit 99291a7ac5
3 changed files with 9 additions and 37 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -184,7 +184,7 @@ bool Foam::functionObjects::turbulenceFields::execute()
}
case cfOmega:
{
processField<scalar>(f, omega(model));
processField<scalar>(f, model.omega());
break;
}
case cfNuTilda:
@ -261,7 +261,7 @@ bool Foam::functionObjects::turbulenceFields::execute()
}
case ifOmega:
{
processField<scalar>(f, omega(model));
processField<scalar>(f, model.omega());
break;
}
case ifNuTilda:

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -187,6 +187,7 @@ public:
//- Turbulence closure model name
static const word modelName_;
protected:
// Protected Data
@ -208,10 +209,6 @@ protected:
const tmp<GeometricField<Type, fvPatchField, volMesh>>& tvalue
);
//- Return omega calculated from k and epsilon
template<class Model>
tmp<volScalarField> omega(const Model& model) const;
//- Return nuTilda calculated from k and omega
template<class Model>
tmp<volScalarField> nuTilda(const Model& model) const;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,33 +75,6 @@ void Foam::functionObjects::turbulenceFields::processField
}
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::omega
(
const Model& model
) const
{
const scalar Cmu = 0.09;
// Assume k and epsilon are available
const volScalarField k(model.k());
const volScalarField epsilon(model.epsilon());
return tmp<volScalarField>::New
(
IOobject
(
"omega.tmp",
k.mesh().time().timeName(),
k.mesh()
),
epsilon/(Cmu*k),
epsilon.boundaryField().types()
);
}
template<class Model>
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::turbulenceFields::nuTilda
@ -109,10 +82,12 @@ Foam::functionObjects::turbulenceFields::nuTilda
const Model& model
) const
{
const dimensionedScalar omega0(dimless/dimTime, SMALL);
return tmp<volScalarField>::New
(
"nuTilda.tmp",
model.k()/omega(model)
model.k()/(model.omega() + omega0)
);
}