kinematicSingleLayerI.H
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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "filmThermoModel.H"
30 #include "surfaceInterpolate.H"
31 #include "fvcSurfaceIntegrate.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace regionModels
38 {
39 namespace surfaceFilmModels
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
45 {
46  return momentumPredictor_;
47 }
48 
49 
50 inline label kinematicSingleLayer::nOuterCorr() const
51 {
52  return nOuterCorr_;
53 }
54 
55 
56 inline label kinematicSingleLayer::nCorr() const
57 {
58  return nCorr_;
59 }
60 
61 
62 inline label kinematicSingleLayer::nNonOrthCorr() const
63 {
64  return nNonOrthCorr_;
65 }
66 
67 
69 {
70  return deltaSmall_;
71 }
72 
73 
74 inline const volScalarField& kinematicSingleLayer::mu() const
75 {
76  return mu_;
77 }
78 
79 
80 inline const volScalarField& kinematicSingleLayer::sigma() const
81 {
82  return sigma_;
83 }
84 
85 
86 inline const volScalarField& kinematicSingleLayer::delta() const
87 {
88  return delta_;
89 }
90 
91 
92 inline const volScalarField& kinematicSingleLayer::alpha() const
93 {
94  return alpha_;
95 }
96 
97 
99 {
100  return USpPrimary_;
101 }
102 
105 {
106  return pSpPrimary_;
107 }
108 
111 {
112  return rhoSpPrimary_;
113 }
114 
117 {
118  return USp_;
119 }
120 
123 {
124  return pSp_;
125 }
126 
129 {
130  return rhoSp_;
131 }
132 
134 inline const volVectorField& kinematicSingleLayer::USp() const
135 {
136  return USp_;
137 }
138 
140 inline const volScalarField& kinematicSingleLayer::pSp() const
141 {
142  return pSp_;
143 }
144 
146 inline const volScalarField& kinematicSingleLayer::rhoSp() const
147 {
148  return rhoSp_;
149 }
150 
153 {
154  return UPrimary_;
155 }
156 
159 {
160  return pPrimary_;
161 }
162 
165 {
166  return rhoPrimary_;
167 }
168 
171 {
172  return muPrimary_;
173 }
174 
177 {
178  return *filmThermo_;
179 }
180 
183 {
184  return injection_;
185 }
186 
189 {
190  return transfer_;
191 }
192 
195 {
196  return *turbulence_;
197 }
198 
201 {
202  return deltaRho_*magSf();
203 }
204 
207 {
208  return rhoSp_*magSf()*time().deltaT();
209 }
210 
211 
213 {
214  tmp<volScalarField> tgNorm
215  (
216  new volScalarField
217  (
218  IOobject
219  (
220  "gNorm",
221  time().timeName(),
222  regionMesh(),
225  ),
226  g_ & nHat()
227  )
228  );
229 
230  return tgNorm;
231 }
232 
233 
235 {
236  tmp<volScalarField> tgNormClipped
237  (
238  new volScalarField
239  (
240  IOobject
241  (
242  "gNormClipped",
243  time().timeName(),
244  regionMesh(),
247  ),
248  g_ & nHat()
249  )
250  );
251 
252  volScalarField& gNormClipped = tgNormClipped.ref();
253  gNormClipped.clamp_max(0);
254 
255  return tgNormClipped;
256 }
257 
258 
260 {
261  tmp<volVectorField> tgTan
262  (
263  new volVectorField
264  (
265  IOobject
266  (
267  "gTan",
268  time().timeName(),
269  regionMesh(),
272  ),
273  g_ - nHat()*gNorm()
274  )
275  );
276 
277  return tgTan;
278 }
279 
281 (
282  const label patchI
283 ) const
284 {
285  const vectorField& nH = nHat().boundaryField()[patchI];
286  const vector& g = g_.value();
287  tmp<vectorField> tgTan(new vectorField(g - nH*(g & nH)));
288 
289  return tgTan;
290 }
291 
292 
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
294 
295 } // End namespace surfaceFilmModels
296 } // End namespace regionModels
297 } // End namespace Foam
298 
299 // ************************************************************************* //
autoPtr< filmThermoModel > filmThermo_
Film thermo model.
List container for film injection models.
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField...
const Type & value() const noexcept
Return const reference to value.
autoPtr< filmTurbulenceModel > turbulence_
Turbulence model.
label nOuterCorr() const
Return the number of outer correctors.
label nCorr() const
Return the number of PISO correctors.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Definition: Switch.H:77
tmp< volScalarField > gNorm() const
Return the gravity normal-to-patch component contribution.
Ignore writing from objectRegistry::writeObject()
const volScalarField & rhoPrimary() const
Density [kg/m3].
tmp< volScalarField > deltaMass() const
Return the change in film mass due to sources/sinks.
volScalarField deltaRho_
Film thickness*density (helper field) [kg/m2].
const volScalarField & muPrimary() const
Viscosity [Pa.s].
const filmThermoModel & filmThermo() const
Film thermo.
word timeName
Definition: getTimeIndex.H:3
const volVectorField & UPrimary() const
Velocity [m/s].
const volScalarField & mu() const
Return const access to the dynamic viscosity [Pa.s].
tmp< volVectorField > gTan() const
Return the gravity tangential component contributions.
tmp< volScalarField > mass() const
Return the current film mass.
tmp< volScalarField > gNormClipped() const
Return the gravity normal-to-patch component contribution.
const dimensionedScalar & deltaSmall() const
Return small delta.
virtual const volVectorField & nHat() const
Return the patch normal vectors.
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:26
label nNonOrthCorr_
Number of non-orthogonal correctors.
const volScalarField & pPrimary() const
Pressure [Pa].
const dimensionedVector & g() const
Return the acceleration due to gravity.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const volScalarField & delta() const
Return const access to the film thickness [m].
transferModelList transfer_
Transfer with the continuous phase.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
Switch momentumPredictor() const
Return the momentum predictor.
const volScalarField & sigma() const
Return const access to the surface tension [kg/s2].
label nNonOrthCorr() const
Return the number of non-orthogonal correctors.
volScalarField alpha_
Film coverage indicator, 1 = covered, 0 = uncovered [].
Nothing to be read.
Field< vector > vectorField
Specialisation of Field<T> for vector.
const dimensionedVector & g_
Acceleration due to gravity [m/s2].
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
const filmTurbulenceModel & turbulence() const
Turbulence.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:61
const Time & time() const noexcept
Return the reference to the time database.
Definition: regionModel.H:244
const volScalarField & alpha() const
Return the film coverage, 1 = covered, 0 = uncovered [].
Namespace for OpenFOAM.