Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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"
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
38namespace functionObjects
39{
42 (
46 );
47}
48}
49
50
51// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52
53Foam::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",
70 laminarTransport_
71 ),
72 rho_
73 (
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 * * * * * * * * * * * * * * * //
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// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
This functionObject tracks a uncoupled kinematic particle cloud in the specified velocity field of an...
virtual bool execute()
Execute the function-object operations.
virtual bool write()
Write the function-object results.
virtual bool read(const dictionary &)
Read the function-object dictionary.
const ObjectType & lookupObject(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
const Time & time_
Reference to the time database.
A simple single-phase transport model based on viscosityModel.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
engineTime & runTime
word timeName
Definition getTimeIndex.H:3
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
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.
GeometricField< vector, fvPatchField, volMesh > volVectorField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
const dimensionSet dimDensity
volScalarField & nu
dictionary dict