turbulentDispersion.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::turbulentDispersion
26 
27 Description
28  ...
29 
30 Usage
31  Example specification:
32  \verbatim
33  <LagrangianModelName>
34  {
35  type turbulentDispersion;
36  }
37  \endverbatim
38 
39 SourceFiles
40  turbulentDispersion.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef turbulentDispersion_H
45 #define turbulentDispersion_H
46 
47 #include "cloudLagrangianModel.H"
48 #include "drag.H"
49 #include "momentumTransportModel.H"
51 #include "CarrierField.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace Lagrangian
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class turbulentDispersion Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 :
66  public LagrangianModel,
67  private cloudLagrangianModel
68 {
69 private:
70 
71  // Private Member Data
72 
73  //- Pointer to the drag model
74  const drag* dragPtr_;
75 
76  //- Reference to the momentum transport model
77  const momentumTransportModel& momentumTransportModel_;
78 
79  //- Carrier turbulent kinetic energy
80  const CarrierField<scalar>& kc_;
81 
82  //- Carrier turbulent kinetic energy dissipation rate
83  const CarrierField<scalar>& epsilonc_;
84 
85  //- Fraction completed of the current turbulent eddy
87 
88  //- Turbulent time-scale
90 
91  //- Turbulent velocity fluctuation
93 
94  //- Random generator
96 
97  //- Average turbulent velocity fluctuation over the current sub-step
99 
100 
101  // Private Member Functions
102 
103  //- Initialise and return a reference to one of the "turb" fields
104  template<class Type>
105  Tuple2<bool, CloudStateField<Type>&> initialiseTurbField
106  (
107  const word& name,
108  const dimensionSet& dims,
109  const Type& value
110  );
111 
112  //- Complete the "turb" field, adding any source conditions that are
113  // needed for injections. This has to happen after construction as it
114  // depends on the list of all models.
115  template<class InjectionFieldSourceType, class Type>
116  void completeTurbField(Tuple2<bool, CloudStateField<Type>&>&);
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("turbulentDispersion");
123 
124 
125  // Constructors
126 
127  //- Construct from components
129  (
130  const word& name,
131  const LagrangianMesh& mesh,
132  const dictionary& modelDict,
133  const dictionary& stateDict
134  );
135 
136 
137  // Member Functions
138 
139  //- Return the name of the velocity field
140  virtual wordList addSupFields() const;
141 
142  //- Do post construction steps which require access to other models
143  virtual void postConstruct();
144 
145  //- Solve equations and/or update continually changing properties
146  virtual void calculate
147  (
148  const LagrangianSubScalarField& deltaT,
149  const bool final
150  );
151 
152  //- Add a source term to the velocity equation
153  virtual void addSup
154  (
155  const LagrangianSubScalarField& deltaT,
158  ) const;
159 
160  //- Add a source term to the momentum equation
161  virtual void addSup
162  (
163  const LagrangianSubScalarField& deltaT,
164  const LagrangianSubScalarSubField& vOrM,
167  ) const;
168 
169  //- Write state
170  virtual void writeProcessorState(Ostream& os) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace Lagrangian
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
A field which is stored as part of the state of the cloud. This is a light wrapper around a dynamic L...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
const word & name() const
The source name.
virtual wordList addSupFields() const
Return the name of the velocity field.
virtual void postConstruct()
Do post construction steps which require access to other models.
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
TypeName("turbulentDispersion")
Runtime type information.
virtual void writeProcessorState(Ostream &os) const
Write state.
turbulentDispersion(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Solve equations and/or update continually changing properties.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base class for Lagrangian models that refer to a cloud. Not a Lagrangian model in itself....
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
Abstract base class for turbulence models (RAS, LES and laminar).
Random number generator with the additional ability to go back to an earlier stored state....
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
Namespace for OpenFOAM.