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-------------------------------------------------------------------------------
10License
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"
37
38// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39
40namespace Foam
41{
42namespace regionModels
43{
44namespace surfaceFilmModels
45{
46
47// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
48
51
52// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
53
55(
57 const dictionary& dict
58)
59:
61 Cf_(coeffDict_.get<scalar>("Cf"))
62{}
63
64
65// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66
68{}
69
70
71// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
72
74{
76 (
78 (
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 (
106 (
107 typeName + ":mut",
112 ),
115 );
116}
117
118
120{}
121
122
124{
125 // local reference to film model
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// ************************************************************************* //
scalar delta
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void min(const dimensioned< Type > &dt)
Use the minimum of the field and specified value.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Laminar combustion model.
Definition: laminar.H:59
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:290
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:64
const surfaceFilmRegionModel & film() const
Return const access to the film surface film model.
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
Kinematic form of single-cell layer surface film model.
Film laminar turbulence model.
Definition: laminar.H:57
virtual void correct()
Correct/update the model.
Definition: laminar.C:119
virtual tmp< volScalarField > mut() const
Return the film turbulence viscosity.
Definition: laminar.C:101
virtual tmp< volVectorField > Us() const
Return the film surface velocity.
Definition: laminar.C:73
virtual const volVectorField & U() const =0
Return the film velocity [m/s].
virtual const volScalarField & delta() const =0
Return the film thickness [m].
virtual const volVectorField & Uw() const =0
Return the film wall velocity [m/s].
A class for managing temporary objects.
Definition: tmp.H:65
T & ref() const
Definition: tmpI.H:227
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
U
Definition: pEqn.H:72
const volScalarField & mu
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Calculate the finiteVolume matrix for implicit and explicit sources.
zeroField Su
Definition: alphaSuSp.H:1
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Namespace for OpenFOAM.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:52
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
const dimensionSet dimVelocity
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
dictionary dict
const scalarField & Cs