1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
28 #include "addToRunTimeSelectionTable.H"
30 #include "backwardsCompatibilityWallFunctions.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 namespace incompressible
41 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43 defineTypeNameAndDebug(kOmega, 0);
44 addToRunTimeSelectionTable(RASModel, kOmega, dictionary);
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
50 const volVectorField& U,
51 const surfaceScalarField& phi,
52 transportModel& lamTransportModel
55 RASModel(typeName, U, phi, lamTransportModel),
59 dimensioned<scalar>::lookupOrAddToDict
68 dimensioned<scalar>::lookupOrAddToDict
77 dimensioned<scalar>::lookupOrAddToDict
86 dimensioned<scalar>::lookupOrAddToDict
95 dimensioned<scalar>::lookupOrAddToDict
113 autoCreateK("k", mesh_)
125 autoCreateOmega("omega", mesh_)
137 autoCreateNut("nut", mesh_)
140 nut_ = k_/(omega_ + omegaSmall_);
141 nut_.correctBoundaryConditions();
147 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
149 tmp<volSymmTensorField> kOmega::R() const
151 return tmp<volSymmTensorField>
153 new volSymmTensorField
163 ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
164 k_.boundaryField().types()
170 tmp<volSymmTensorField> kOmega::devReff() const
172 return tmp<volSymmTensorField>
174 new volSymmTensorField
184 -nuEff()*dev(twoSymm(fvc::grad(U_)))
190 tmp<fvVectorMatrix> kOmega::divDevReff(volVectorField& U) const
194 - fvm::laplacian(nuEff(), U)
195 - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
202 if (RASModel::read())
204 Cmu_.readIfPresent(coeffDict());
205 beta_.readIfPresent(coeffDict());
206 alphaK_.readIfPresent(coeffDict());
207 alphaOmega_.readIfPresent(coeffDict());
218 void kOmega::correct()
227 volScalarField G("RASModel::G", nut_*2*magSqr(symm(fvc::grad(U_))));
229 // Update omega and G at the wall
230 omega_.boundaryField().updateCoeffs();
232 // Turbulence specific dissipation rate equation
233 tmp<fvScalarMatrix> omegaEqn
236 + fvm::div(phi_, omega_)
237 - fvm::Sp(fvc::div(phi_), omega_)
238 - fvm::laplacian(DomegaEff(), omega_)
241 - fvm::Sp(beta_*omega_, omega_)
246 omegaEqn().boundaryManipulate(omega_.boundaryField());
249 bound(omega_, omega0_);
252 // Turbulent kinetic energy equation
253 tmp<fvScalarMatrix> kEqn
257 - fvm::Sp(fvc::div(phi_), k_)
258 - fvm::laplacian(DkEff(), k_)
261 - fvm::Sp(Cmu_*omega_, k_)
269 // Re-calculate viscosity
270 nut_ = k_/(omega_ + omegaSmall_);
271 nut_.correctBoundaryConditions();
275 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
277 } // End namespace RASModels
278 } // End namespace incompressible
279 } // End namespace Foam
281 // ************************************************************************* //