1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
27 #include "addToRunTimeSelectionTable.H"
29 #include "backwardsCompatibilityWallFunctions.H"
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 namespace incompressible
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
42 defineTypeNameAndDebug(kOmega, 0);
43 addToRunTimeSelectionTable(RASModel, kOmega, dictionary);
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 const volVectorField& U,
50 const surfaceScalarField& phi,
51 transportModel& transport,
52 const word& turbulenceModelName,
56 RASModel(modelName, U, phi, transport, turbulenceModelName),
60 dimensioned<scalar>::lookupOrAddToDict
69 dimensioned<scalar>::lookupOrAddToDict
78 dimensioned<scalar>::lookupOrAddToDict
87 dimensioned<scalar>::lookupOrAddToDict
96 dimensioned<scalar>::lookupOrAddToDict
114 autoCreateK("k", mesh_)
126 autoCreateOmega("omega", mesh_)
138 autoCreateNut("nut", mesh_)
142 bound(omega_, omegaMin_);
145 nut_.correctBoundaryConditions();
151 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
153 tmp<volSymmTensorField> kOmega::R() const
155 return tmp<volSymmTensorField>
157 new volSymmTensorField
167 ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
168 k_.boundaryField().types()
174 tmp<volSymmTensorField> kOmega::devReff() const
176 return tmp<volSymmTensorField>
178 new volSymmTensorField
188 -nuEff()*dev(twoSymm(fvc::grad(U_)))
194 tmp<fvVectorMatrix> kOmega::divDevReff(volVectorField& U) const
198 - fvm::laplacian(nuEff(), U)
199 - fvc::div(nuEff()*dev(T(fvc::grad(U))))
206 if (RASModel::read())
208 Cmu_.readIfPresent(coeffDict());
209 beta_.readIfPresent(coeffDict());
210 alphaK_.readIfPresent(coeffDict());
211 alphaOmega_.readIfPresent(coeffDict());
222 void kOmega::correct()
231 volScalarField G("RASModel::G", nut_*2*magSqr(symm(fvc::grad(U_))));
233 // Update omega and G at the wall
234 omega_.boundaryField().updateCoeffs();
236 // Turbulence specific dissipation rate equation
237 tmp<fvScalarMatrix> omegaEqn
240 + fvm::div(phi_, omega_)
241 - fvm::Sp(fvc::div(phi_), omega_)
242 - fvm::laplacian(DomegaEff(), omega_)
245 - fvm::Sp(beta_*omega_, omega_)
250 omegaEqn().boundaryManipulate(omega_.boundaryField());
253 bound(omega_, omegaMin_);
256 // Turbulent kinetic energy equation
257 tmp<fvScalarMatrix> kEqn
261 - fvm::Sp(fvc::div(phi_), k_)
262 - fvm::laplacian(DkEff(), k_)
265 - fvm::Sp(Cmu_*omega_, k_)
273 // Re-calculate viscosity
275 nut_.correctBoundaryConditions();
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281 } // End namespace RASModels
282 } // End namespace incompressible
283 } // End namespace Foam
285 // ************************************************************************* //