OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "laminar.H"
00028 #include "Time.H"
00029 #include "volFields.H"
00030 #include "fvcGrad.H"
00031 #include "fvcDiv.H"
00032 #include "fvmLaplacian.H"
00033 #include "addToRunTimeSelectionTable.H"
00034 
00035 
00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00037 
00038 namespace Foam
00039 {
00040 namespace incompressible
00041 {
00042 
00043 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00044 
00045 defineTypeNameAndDebug(laminar, 0);
00046 addToRunTimeSelectionTable(turbulenceModel, laminar, turbulenceModel);
00047 
00048 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00049 
00050 laminar::laminar
00051 (
00052     const volVectorField& U,
00053     const surfaceScalarField& phi,
00054     transportModel& lamTransportModel
00055 )
00056 :
00057     turbulenceModel(U, phi, lamTransportModel)
00058 {}
00059 
00060 
00061 // * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
00062 
00063 autoPtr<laminar> laminar::New
00064 (
00065     const volVectorField& U,
00066     const surfaceScalarField& phi,
00067     transportModel& lamTransportModel
00068 )
00069 {
00070     return autoPtr<laminar>(new laminar(U, phi, lamTransportModel));
00071 }
00072 
00073 
00074 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00075 
00076 tmp<volScalarField> laminar::nut() const
00077 {
00078     return tmp<volScalarField>
00079     (
00080         new volScalarField
00081         (
00082             IOobject
00083             (
00084                 "nut",
00085                 runTime_.timeName(),
00086                 mesh_,
00087                 IOobject::NO_READ,
00088                 IOobject::NO_WRITE
00089             ),
00090             mesh_,
00091             dimensionedScalar("nut", nu().dimensions(), 0.0)
00092         )
00093     );
00094 }
00095 
00096 
00097 tmp<volScalarField> laminar::nuEff() const
00098 {
00099     return tmp<volScalarField>(new volScalarField("nuEff", nu()));
00100 }
00101 
00102 
00103 tmp<volScalarField> laminar::k() const
00104 {
00105     return tmp<volScalarField>
00106     (
00107         new volScalarField
00108         (
00109             IOobject
00110             (
00111                 "k",
00112                 runTime_.timeName(),
00113                 mesh_,
00114                 IOobject::NO_READ,
00115                 IOobject::NO_WRITE
00116             ),
00117             mesh_,
00118             dimensionedScalar("k", sqr(U_.dimensions()), 0.0)
00119         )
00120     );
00121 }
00122 
00123 
00124 tmp<volScalarField> laminar::epsilon() const
00125 {
00126     return tmp<volScalarField>
00127     (
00128         new volScalarField
00129         (
00130             IOobject
00131             (
00132                 "epsilon",
00133                 runTime_.timeName(),
00134                 mesh_,
00135                 IOobject::NO_READ,
00136                 IOobject::NO_WRITE
00137             ),
00138             mesh_,
00139             dimensionedScalar
00140             (
00141                 "epsilon", sqr(U_.dimensions())/dimTime, 0.0
00142             )
00143         )
00144     );
00145 }
00146 
00147 
00148 tmp<volSymmTensorField> laminar::R() const
00149 {
00150     return tmp<volSymmTensorField>
00151     (
00152         new volSymmTensorField
00153         (
00154             IOobject
00155             (
00156                 "R",
00157                 runTime_.timeName(),
00158                 mesh_,
00159                 IOobject::NO_READ,
00160                 IOobject::NO_WRITE
00161             ),
00162             mesh_,
00163             dimensionedSymmTensor
00164             (
00165                 "R", sqr(U_.dimensions()), symmTensor::zero
00166             )
00167         )
00168     );
00169 }
00170 
00171 
00172 tmp<volSymmTensorField> laminar::devReff() const
00173 {
00174     return tmp<volSymmTensorField>
00175     (
00176         new volSymmTensorField
00177         (
00178             IOobject
00179             (
00180                 "devRhoReff",
00181                 runTime_.timeName(),
00182                 mesh_,
00183                 IOobject::NO_READ,
00184                 IOobject::NO_WRITE
00185             ),
00186            -nu()*dev(twoSymm(fvc::grad(U_)))
00187         )
00188     );
00189 }
00190 
00191 
00192 tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
00193 {
00194     return
00195     (
00196       - fvm::laplacian(nuEff(), U)
00197       - fvc::div(nuEff()*dev(fvc::grad(U)().T()))
00198     );
00199 }
00200 
00201 
00202 bool laminar::read()
00203 {
00204     return true;
00205 }
00206 
00207 
00208 void laminar::correct()
00209 {
00210     turbulenceModel::correct();
00211 }
00212 
00213 
00214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00215 
00216 } // End namespace incompressible
00217 } // End namespace Foam
00218 
00219 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd