FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

laminar.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "laminar.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033 namespace incompressible
00034 {
00035 namespace RASModels
00036 {
00037 
00038 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00039 
00040 defineTypeNameAndDebug(laminar, 0);
00041 addToRunTimeSelectionTable(RASModel, laminar, dictionary);
00042 
00043 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00044 
00045 laminar::laminar
00046 (
00047     const volVectorField& U,
00048     const surfaceScalarField& phi,
00049     transportModel& lamTransportModel
00050 )
00051 :
00052     RASModel(typeName, U, phi, lamTransportModel)
00053 {}
00054 
00055 
00056 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00057 
00058 tmp<volScalarField> laminar::nut() const
00059 {
00060     return tmp<volScalarField>
00061     (
00062         new volScalarField
00063         (
00064             IOobject
00065             (
00066                 "nut",
00067                 runTime_.timeName(),
00068                 mesh_,
00069                 IOobject::NO_READ,
00070                 IOobject::NO_WRITE
00071             ),
00072             mesh_,
00073             dimensionedScalar("nut", nu().dimensions(), 0.0)
00074         )
00075     );
00076 }
00077 
00078 
00079 tmp<volScalarField> laminar::k() const
00080 {
00081     return tmp<volScalarField>
00082     (
00083         new volScalarField
00084         (
00085             IOobject
00086             (
00087                 "k",
00088                 runTime_.timeName(),
00089                 mesh_,
00090                 IOobject::NO_READ,
00091                 IOobject::NO_WRITE
00092             ),
00093             mesh_,
00094             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
00095         )
00096     );
00097 }
00098 
00099 
00100 tmp<volScalarField> laminar::epsilon() const
00101 {
00102     return tmp<volScalarField>
00103     (
00104         new volScalarField
00105         (
00106             IOobject
00107             (
00108                 "epsilon",
00109                 runTime_.timeName(),
00110                 mesh_,
00111                 IOobject::NO_READ,
00112                 IOobject::NO_WRITE
00113             ),
00114             mesh_,
00115             dimensionedScalar
00116             (
00117                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
00118             )
00119         )
00120     );
00121 }
00122 
00123 
00124 tmp<volSymmTensorField> laminar::R() const
00125 {
00126     return tmp<volSymmTensorField>
00127     (
00128         new volSymmTensorField
00129         (
00130             IOobject
00131             (
00132                 "R",
00133                 runTime_.timeName(),
00134                 mesh_,
00135                 IOobject::NO_READ,
00136                 IOobject::NO_WRITE
00137             ),
00138             mesh_,
00139             dimensionedSymmTensor
00140             (
00141                 "R", sqr(U_.dimensions()), symmTensor::zero
00142             )
00143         )
00144     );
00145 }
00146 
00147 
00148 tmp<volSymmTensorField> laminar::devReff() const
00149 {
00150     return tmp<volSymmTensorField>
00151     (
00152         new volSymmTensorField
00153         (
00154             IOobject
00155             (
00156                 "devRhoReff",
00157                 runTime_.timeName(),
00158                 mesh_,
00159                 IOobject::NO_READ,
00160                 IOobject::NO_WRITE
00161             ),
00162            -nu()*dev(twoSymm(fvc::grad(U_)))
00163         )
00164     );
00165 }
00166 
00167 
00168 tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
00169 {
00170     return
00171     (
00172       - fvm::laplacian(nuEff(), U)
00173       - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
00174     );
00175 }
00176 
00177 
00178 bool laminar::read()
00179 {
00180     return RASModel::read();
00181 }
00182 
00183 
00184 void laminar::correct()
00185 {
00186     turbulenceModel::correct();
00187 }
00188 
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 } // End namespace RASModels
00193 } // End namespace incompressible
00194 } // End namespace Foam
00195 
00196 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines