icoUncoupledKinematicCloud.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) 2016 OpenFOAM Foundation
9  Copyright (C) 2018-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 
31 #include "gravityMeshObject.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 namespace functionObjects
39 {
40  defineTypeNameAndDebug(icoUncoupledKinematicCloud, 0);
42  (
43  functionObject,
44  icoUncoupledKinematicCloud,
45  dictionary
46  );
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
53 Foam::functionObjects::icoUncoupledKinematicCloud::icoUncoupledKinematicCloud
54 (
55  const word& name,
56  const Time& runTime,
57  const dictionary& dict
58 )
59 :
60  fvMeshFunctionObject(name, runTime, dict),
61  g_(meshObjects::gravity::New(time_)),
62  laminarTransport_
63  (
64  mesh_.lookupObject<singlePhaseTransportModel>("transportProperties")
65  ),
66  rhoValue_
67  (
68  "rho",
69  dimDensity,
70  laminarTransport_
71  ),
72  rho_
73  (
74  IOobject
75  (
76  "rho",
77  time_.timeName(),
78  mesh_
79  ),
80  mesh_,
81  rhoValue_
82  ),
83  mu_("mu", rhoValue_*laminarTransport_.nu()),
84  U_
85  (
86  mesh_.lookupObject<volVectorField>(dict.getOrDefault<word>("U", "U"))
87  ),
88  kinematicCloudName_
89  (
90  dict.getOrDefault<word>("kinematicCloud", "kinematicCloud")
91  ),
92  kinematicCloud_
93  (
94  kinematicCloudName_,
95  rho_,
96  U_,
97  mu_,
98  g_
99  )
100 {}
101 
102 
103 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
104 
106 {}
107 
108 
109 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 
112 (
114 )
115 {
117 }
118 
119 
121 {
122  mu_ = rhoValue_*laminarTransport_.nu();
123  kinematicCloud_.evolve();
124 
125  return true;
126 }
127 
128 
130 {
131  return true;
132 }
133 
134 
135 // ************************************************************************* //
dictionary dict
defineTypeNameAndDebug(ObukhovLength, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
engineTime & runTime
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
Macros for easy insertion into run-time selection tables.
word timeName
Definition: getTimeIndex.H:3
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
const dimensionSet dimDensity
virtual bool read(const dictionary &)
Read the controls.
virtual bool read(const dictionary &dict)
Read optional controls.
A simple single-phase transport model based on viscosityModel.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
volScalarField & nu
Namespace for OpenFOAM.