laminar.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "laminar.H"
28 #include "fvMesh.H"
29 #include "fvMatrices.H"
30 #include "Time.H"
31 #include "volFields.H"
32 #include "fvmSup.H"
33 #include "kinematicSingleLayer.H"
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 namespace Foam
39 {
40 namespace regionModels
41 {
42 namespace surfaceFilmModels
43 {
44 
45 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
46 
47 defineTypeNameAndDebug(laminar, 0);
48 addToRunTimeSelectionTable(filmTurbulenceModel, laminar, dictionary);
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
53 (
54  surfaceFilmModel& owner,
55  const dictionary& dict
56 )
57 :
58  filmTurbulenceModel(type(), owner, dict),
59  Cf_(readScalar(coeffDict_.lookup("Cf")))
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
64 
66 {}
67 
68 
69 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
70 
72 {
74  (
75  new volVectorField
76  (
77  IOobject
78  (
79  typeName + ":Us",
84  ),
87  zeroGradientFvPatchVectorField::typeName
88  )
89  );
90 
91  // apply quadratic profile
92  tUs() = Foam::sqrt(2.0)*owner_.U();
93  tUs().correctBoundaryConditions();
94 
95  return tUs;
96 }
97 
98 
100 {
101  return tmp<volScalarField>
102  (
103  new volScalarField
104  (
105  IOobject
106  (
107  typeName + ":mut",
109  owner_.regionMesh(),
112  ),
113  owner_.regionMesh(),
115  )
116  );
117 }
118 
119 
121 {
122  // do nothing
123 }
124 
125 
127 {
128  // local reference to film model
129  const kinematicSingleLayer& film =
130  static_cast<const kinematicSingleLayer&>(owner_);
131 
132  // local references to film fields
133  const volScalarField& mu = film.mu();
134  const volVectorField& Uw = film.Uw();
135  const volScalarField& delta = film.delta();
136  const volVectorField& Up = film.UPrimary();
137  const volScalarField& rhop = film.rhoPrimary();
138 
139  // employ simple coeff-based model
140  volScalarField Cs("Cs", Cf_*rhop*mag(Up - U));
141  volScalarField Cw("Cw", mu/(0.3333*(delta + film.deltaSmall())));
142  Cw.min(5000.0);
143 
144  return
145  (
146  - fvm::Sp(Cs, U) + Cs*Up // surface contribution
147  - fvm::Sp(Cw, U) + Cw*Uw // wall contribution
148  );
149 }
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace surfaceFilmModels
155 } // End namespace regionModels
156 } // End namespace Foam
157 
158 // ************************************************************************* //
Foam::regionModels::surfaceFilmModels::laminar::Su
virtual tmp< fvVectorMatrix > Su(volVectorField &U) const
Return the source for the film momentum equation.
Definition: laminar.C:126
volFields.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::Vector< scalar >::zero
static const Vector zero
Definition: Vector.H:80
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFields.H:13
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
Foam::regionModels::surfaceFilmModels::laminar::Us
virtual tmp< volVectorField > Us() const
Return the film surface velocity.
Definition: laminar.C:71
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::dimVelocity
const dimensionSet dimVelocity
Foam::regionModels::surfaceFilmModels::filmTurbulenceModel
Base class for film turbulence models.
Definition: filmTurbulenceModel.H:56
Foam::regionModels::surfaceFilmModels::laminar::mut
virtual tmp< volScalarField > mut() const
Return the film turbulence viscosity.
Definition: laminar.C:99
Foam::regionModels::surfaceFilmModels::surfaceFilmModel::U
virtual const volVectorField & U() const =0
Return the film velocity [m/s].
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Definition: kinematicSingleLayer.H:63
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::mu
const volScalarField & mu() const
Return const access to the dynamic viscosity / [Pa.s].
Definition: kinematicSingleLayerI.H:71
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::UPrimary
const volVectorField & UPrimary() const
Velocity / [m/s].
Definition: kinematicSingleLayerI.H:149
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
Foam::regionModels::surfaceFilmModels::laminar::~laminar
virtual ~laminar()
Destructor.
Definition: laminar.C:65
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::deltaSmall
const dimensionedScalar & deltaSmall() const
Return small delta.
Definition: kinematicSingleLayerI.H:65
U
U
Definition: pEqn.H:46
Foam::fvm::Sp
tmp< fvMatrix< Type > > Sp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
Foam::regionModels::surfaceFilmModels::laminar::correct
virtual void correct()
Correct/update the model.
Definition: laminar.C:120
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::GeometricField::min
void min(const dimensioned< Type > &)
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::rhoPrimary
const volScalarField & rhoPrimary() const
Density / [kg/m3].
Definition: kinematicSingleLayerI.H:161
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::regionModels::surfaceFilmModels::laminar::laminar
laminar(const laminar &)
Disallow default bitwise copy construct.
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:111
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
kinematicSingleLayer.H
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
fvmSup.H
Calculate the matrix for implicit and explicit sources.
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Foam::readScalar
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Definition: doubleScalar.H:63
Foam::Time::timeName
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:741
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:142
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::Uw
virtual const volVectorField & Uw() const
Return the film wall velocity [m/s].
Definition: kinematicSingleLayer.C:982
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer::delta
const volScalarField & delta() const
Return const access to the film thickness / [m].
Definition: kinematicSingleLayerI.H:83
Foam::regionModels::surfaceFilmModels::filmSubModelBase::owner_
surfaceFilmModel & owner_
Reference to the owner surface film model.
Definition: filmSubModelBase.H:63
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmModel, kinematicSingleLayer, mesh)
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
Foam::regionModels::surfaceFilmModels::surfaceFilmModel
Base class for surface film models.
Definition: surfaceFilmModel.H:61
Foam::regionModels::surfaceFilmModels::laminar::Cf_
scalar Cf_
Surface roughness coefficient.
Definition: laminar.H:61
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
laminar.H
zeroGradientFvPatchFields.H
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:61