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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "laminar.H"
30 #include "fvMesh.H"
31 #include "fvMatrices.H"
32 #include "Time.H"
33 #include "volFields.H"
34 #include "fvmSup.H"
35 #include "kinematicSingleLayer.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 namespace regionModels
43 {
44 namespace surfaceFilmModels
45 {
46 
47 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
48 
49 defineTypeNameAndDebug(laminar, 0);
50 addToRunTimeSelectionTable(filmTurbulenceModel, laminar, dictionary);
51 
52 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53 
54 laminar::laminar
55 (
57  const dictionary& dict
58 )
59 :
60  filmTurbulenceModel(type(), film, dict),
61  Cf_(coeffDict_.get<scalar>("Cf"))
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
68 {}
69 
70 
71 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
72 
74 {
76  (
77  new volVectorField
78  (
79  IOobject
80  (
81  typeName + ":Us",
86  ),
89  extrapolatedCalculatedFvPatchVectorField::typeName
90  )
91  );
92 
93  // apply quadratic profile
94  tUs.ref() = Foam::sqrt(2.0)*filmModel_.U();
95  tUs.ref().correctBoundaryConditions();
96 
97  return tUs;
98 }
99 
100 
102 {
104  (
105  IOobject
106  (
107  typeName + ":mut",
112  ),
115  );
116 }
117 
118 
120 {}
121 
122 
124 {
125  // local reference to film model
126  const kinematicSingleLayer& film =
127  static_cast<const kinematicSingleLayer&>(filmModel_);
128 
129  // local references to film fields
130  const volScalarField& mu = film.mu();
131  const volVectorField& Uw = film.Uw();
132  const volScalarField& delta = film.delta();
133  const volVectorField& Up = film.UPrimary();
134  const volScalarField& rhop = film.rhoPrimary();
135 
136  // employ simple coeff-based model
137  volScalarField Cs("Cs", Cf_*rhop*mag(Up - U));
138  volScalarField Cw("Cw", mu/((1.0/3.0)*(delta + film.deltaSmall())));
139  Cw.min(5000.0);
140 
141  return
142  (
143  - fvm::Sp(Cs, U) + Cs*Up // surface contribution
144  - fvm::Sp(Cw, U) + Cw*Uw // wall contribution
145  );
146 }
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace surfaceFilmModels
152 } // End namespace regionModels
153 } // End namespace Foam
154 
155 // ************************************************************************* //
Foam::regionModels::surfaceFilmModels::laminar::Su
virtual tmp< fvVectorMatrix > Su(volVectorField &U) const
Return the source for the film momentum equation.
Definition: laminar.C:123
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
volFields.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
Foam::dimLength
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
Foam::regionModels::surfaceFilmModels::laminar::Us
virtual tmp< volVectorField > Us() const
Return the film surface velocity.
Definition: laminar.C:73
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::dimVelocity
const dimensionSet dimVelocity
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel::delta
virtual const volScalarField & delta() const =0
Return the film thickness [m].
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel::U
virtual const volVectorField & U() const =0
Return the film velocity [m/s].
Foam::regionModels::surfaceFilmModels::filmTurbulenceModel
Base class for film turbulence models.
Definition: filmTurbulenceModel.H:58
Foam::regionModels::surfaceFilmModels::laminar::mut
virtual tmp< volScalarField > mut() const
Return the film turbulence viscosity.
Definition: laminar.C:101
Foam::regionModels::surfaceFilmModels::filmSubModelBase::film
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
Definition: filmSubModelBaseI.H:39
Foam::regionModels::surfaceFilmModels::kinematicSingleLayer
Kinematic form of single-cell layer surface film model.
Definition: kinematicSingleLayer.H:67
Foam::regionModels::surfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Foam::GeometricField::min
void min(const dimensioned< Type > &dt)
Use the minimum of the field and specified value.
Definition: GeometricField.C:1132
Foam::regionModels::surfaceFilmModels::laminar::~laminar
virtual ~laminar()
Destructor.
Definition: laminar.C:67
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
Foam::regionModels::surfaceFilmModels::laminar::correct
virtual void correct()
Correct/update the model.
Definition: laminar.C:119
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::fvm::Sp
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel
Base class for surface film models.
Definition: surfaceFilmRegionModel.H:55
Foam::regionModels::surfaceFilmModels::surfaceFilmRegionModel::Uw
virtual const volVectorField & Uw() const =0
Return the film wall velocity [m/s].
Foam::regionModels::regionModel::regionMesh
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:64
delta
scalar delta
Definition: LISASMDCalcMethod2.H:8
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
kinematicSingleLayer.H
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
fvmSup.H
Calculate the matrix for implicit and explicit sources.
Time.H
Foam::regionModels::surfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicSingleLayer, 0)
U
U
Definition: pEqn.H:72
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Cs
const scalarField & Cs
Definition: solveBulkSurfactant.H:10
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
Foam::regionModels::surfaceFilmModels::filmSubModelBase::filmModel_
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
Definition: filmSubModelBase.H:65
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
laminar.H
extrapolatedCalculatedFvPatchFields.H