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  Cmu 0.09;
37  }
38  \endverbatim
39 
40 SourceFiles
41  turbulentDispersion.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef turbulentDispersion_H
46 #define turbulentDispersion_H
47 
48 #include "cloudLagrangianModel.H"
49 #include "drag.H"
50 #include "momentumTransportModel.H"
52 #include "CarrierField.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace Lagrangian
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class turbulentDispersion Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 :
67  public LagrangianModel,
68  private cloudLagrangianModel
69 {
70 private:
71 
72  // Private Member Data
73 
74  //- Pointer to the drag model
75  const drag* dragPtr_;
76 
77  //- Reference to the momentum transport model
78  const momentumTransportModel& momentumTransportModel_;
79 
80  //- Model coefficient, equal to 0.09^0.75 by default
81  const dimensionedScalar Cmu75_;
82 
83  //- Maximum number of individual eddies considered per step, equal to
84  // 32 by default. If there are more than this then the combined effect
85  // of the eddies is represented approximately.
86  const label maxDiscreteEddies_;
87 
88  //- Carrier turbulent kinetic energy
89  const CarrierField<scalar>& kc_;
90 
91  //- Carrier turbulent kinetic energy dissipation rate
92  const CarrierField<scalar>& epsilonc_;
93 
94  //- Fraction completed of the current turbulent eddy
96 
97  //- Turbulent time-scale
99 
100  //- Turbulent velocity fluctuation
102 
103  //- Random generator
105 
106  //- Average turbulent velocity fluctuation over the current sub-step
108 
109 
110  // Private Member Functions
111 
112  //- Initialise and return a reference to one of the "turb" fields
113  template<class Type>
114  Tuple2<bool, CloudStateField<Type>&> initialiseTurbField
115  (
116  const word& name,
117  const dimensionSet& dims,
118  const Type& value
119  );
120 
121  //- Complete the "turb" field, adding any source conditions that are
122  // needed for injections. This has to happen after construction as it
123  // depends on the list of all models.
124  template<class InjectionFieldSourceType, class Type>
125  void completeTurbField(Tuple2<bool, CloudStateField<Type>&>&);
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("turbulentDispersion");
132 
133 
134  // Constructors
135 
136  //- Construct from components
138  (
139  const word& name,
140  const LagrangianMesh& mesh,
141  const dictionary& modelDict,
142  const dictionary& stateDict
143  );
144 
145 
146  // Member Functions
147 
148  //- Return the name of the velocity field
149  virtual wordList addSupFields() const;
150 
151  //- Do post construction steps which require access to other models
152  virtual void postConstruct();
153 
154  //- Solve equations and/or update continually changing properties
155  virtual void calculate
156  (
157  const LagrangianSubScalarField& deltaT,
158  const bool final
159  );
160 
161  //- Add a source term to the velocity equation
162  virtual void addSup
163  (
164  const LagrangianSubScalarField& deltaT,
167  ) const;
168 
169  //- Add a source term to the momentum equation
170  virtual void addSup
171  (
172  const LagrangianSubScalarField& deltaT,
173  const LagrangianSubScalarSubField& vOrM,
176  ) const;
177 
178  //- Write state
179  virtual void writeProcessorState(Ostream& os) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Lagrangian
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
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.
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