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-2026 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::Lagrangian::turbulentDispersion
26 
27 Description
28  Model for turbulent dispersion. This model creates a random turbulent
29  velocity fluctuation based on the carrier's turbulent properties. It then
30  uses the drag model to construct a corresponding force which it applies for
31  a duration equal to the carrier's turbulent time scale.
32 
33 Usage
34  Example specification:
35  \verbatim
36  <LagrangianModelName>
37  {
38  type turbulentDispersion;
39  Cmu 0.09;
40  }
41  \endverbatim
42 
43 SourceFiles
44  turbulentDispersion.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef turbulentDispersion_H
49 #define turbulentDispersion_H
50 
51 #include "cloudLagrangianModel.H"
52 #include "drag.H"
53 #include "momentumTransportModel.H"
55 #include "CarrierField.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace Lagrangian
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class turbulentDispersion Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
70  public LagrangianModel,
71  private cloudLagrangianModel
72 {
73 private:
74 
75  // Private Data
76 
77  //- Pointer to the drag model
78  const drag* dragPtr_;
79 
80  //- Reference to the momentum transport model
81  const momentumTransportModel& momentumTransportModel_;
82 
83  //- Model coefficient, equal to 0.09^0.75 by default
84  const dimensionedScalar Cmu75_;
85 
86  //- Maximum number of individual eddies considered per step, equal to
87  // 32 by default. If there are more than this then the combined effect
88  // of the eddies is represented approximately.
89  const label maxDiscreteEddies_;
90 
91  //- Carrier turbulent kinetic energy
92  const CarrierField<scalar>& kc_;
93 
94  //- Carrier turbulent kinetic energy dissipation rate
95  const CarrierField<scalar>& epsilonc_;
96 
97  //- Fraction completed of the current turbulent eddy
98  CloudStateField<scalar> fractionTurb_;
99 
100  //- Turbulent time-scale
102 
103  //- Turbulent velocity fluctuation
105 
106  //- Random generator
108 
109  //- Average turbulent velocity fluctuation over the current sub-step
111 
112 
113  // Private Member Functions
114 
115  //- Initialise and return a reference to one of the "turb" fields
116  template<class Type>
117  tmp<LagrangianDynamicField<Type>> initialiseTurbField
118  (
119  const word& name,
120  const dimensionSet& dims,
121  const Type& value
122  );
123 
124  //- Complete the "turb" field, adding any source conditions that are
125  // needed for injections. This has to happen after construction as it
126  // depends on the list of all models.
127  template<class InjectionFieldSourceType, class Type>
128  void completeTurbField(LagrangianDynamicField<Type>&);
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("turbulentDispersion");
135 
136 
137  // Constructors
138 
139  //- Construct from components
141  (
142  const word& name,
143  const LagrangianMesh& mesh,
144  const dictionary& modelDict,
145  const dictionary& stateDict
146  );
147 
148 
149  // Member Functions
150 
151  //- Return the name of the velocity field
152  virtual wordList addSupFields() const;
153 
154  //- Return true for the velocity or carrier velocity field
155  virtual bool addsSupToField
156  (
157  const word& fieldName,
158  const word& eqnFieldName
159  ) const;
160 
161  //- Do post construction steps which require access to other models
162  virtual void postConstruct();
163 
164  //- Hook before source evaluation
165  virtual void preAddSup
166  (
167  const LagrangianSubScalarField& deltaT,
168  const bool final
169  );
170 
171  //- Add a source term to the velocity equation
172  virtual void addSup
173  (
174  const LagrangianSubScalarField& deltaT,
177  ) const;
178 
179  //- Add a source term to the momentum equation
180  virtual void addSup
181  (
182  const LagrangianSubScalarField& deltaT,
183  const LagrangianSubScalarSubField& vOrM,
186  ) const;
187 
188  //- Hook after source evaluation
189  virtual void postAddSup
190  (
191  const LagrangianSubScalarField& deltaT,
192  const bool final
193  );
194 
195  //- Write state
196  virtual void writeProcessorState(Ostream& os) const;
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Lagrangian
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
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.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
const word & name() const
The source name.
Base class for Lagrangian drag models.
Definition: drag.H:55
Model for turbulent dispersion. This model creates a random turbulent velocity fluctuation based on t...
virtual wordList addSupFields() const
Return the name of the velocity field.
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true for the velocity or carrier 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.
virtual void preAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook before source evaluation.
turbulentDispersion(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
virtual void postAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook after source evaluation.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mix-in for Lagrangian models that refer to a cloud.
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 momentum transport 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 managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59