applyBoundaryLayer: Improved the calculation of omega

This commit is contained in:
Henry Weller
2021-03-17 14:20:56 +00:00
parent 96f07b0137
commit 76cfa3d136
2 changed files with 14 additions and 14 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,6 +39,7 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "kinematicMomentumTransportModel.H" #include "kinematicMomentumTransportModel.H"
#include "wallDist.H" #include "wallDist.H"
#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -154,10 +155,7 @@ int main(int argc, char *argv[])
volScalarField& k = const_cast<volScalarField&>(tk()); volScalarField& k = const_cast<volScalarField&>(tk());
scalar ck0 = pow025(Cmu)*kappa; scalar ck0 = pow025(Cmu)*kappa;
k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl))); k = (1 - mask)*k + mask*sqr(nut/(ck0*min(y, ybl)));
k.correctBoundaryConditions();
// Do not correct BC - operation may use inconsistent fields wrt these
// local manipulations
// k.correctBoundaryConditions();
Info<< "Writing k\n" << endl; Info<< "Writing k\n" << endl;
k.write(); k.write();
@ -169,8 +167,7 @@ int main(int argc, char *argv[])
scalar ce0 = ::pow(Cmu, 0.75)/kappa; scalar ce0 = ::pow(Cmu, 0.75)/kappa;
epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl); epsilon = (1 - mask)*epsilon + mask*ce0*k*sqrt(k)/min(y, ybl);
// Do not correct BC - wall functions will use non-updated k from // Do not correct BC - G set by the wall-functions is not available
// turbulence model
// epsilon.correctBoundaryConditions(); // epsilon.correctBoundaryConditions();
Info<< "Writing epsilon\n" << endl; Info<< "Writing epsilon\n" << endl;
@ -190,11 +187,14 @@ int main(int argc, char *argv[])
if (omegaHeader.typeHeaderOk<volScalarField>(true)) if (omegaHeader.typeHeaderOk<volScalarField>(true))
{ {
volScalarField omega(omegaHeader, mesh); volScalarField omega(omegaHeader, mesh);
dimensionedScalar k0("vSmall", k.dimensions(), vSmall);
omega = (1 - mask)*omega + mask*epsilon/(Cmu*k + k0);
// Do not correct BC - wall functions will use non-updated k from const incompressible::RASModel& rasModel =
// turbulence model refCast<const incompressible::RASModel>(turbulence());
omega = (1 - mask)*omega + mask*ce0*sqrt(k)/(Cmu*min(y, ybl));
bound(omega, rasModel.omegaMin());
// Do not correct BC - G set by the wall-functions is not available
// omega.correctBoundaryConditions(); // omega.correctBoundaryConditions();
Info<< "Writing omega\n" << endl; Info<< "Writing omega\n" << endl;
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
volScalarField nuTilda(nuTildaHeader, mesh); volScalarField nuTilda(nuTildaHeader, mesh);
nuTilda = nut; nuTilda = nut;
// Do not correct BC // Do not correct BC - G set by the wall-functions is not available
// nuTilda.correctBoundaryConditions(); // nuTilda.correctBoundaryConditions();
Info<< "Writing nuTilda\n" << endl; Info<< "Writing nuTilda\n" << endl;

View File

@ -73,8 +73,8 @@ relaxationFactors
equations equations
{ {
U 0.9; U 0.9;
k 0.7; k 0.5;
omega 0.7; omega 0.5;
} }
} }