phaseForces.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) 2018-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::functionObjects::phaseForces
26 
27 Description
28  This functionObject calculates and outputs the blended interfacial forces
29  acting on a given phase, i.e. drag, virtual mass, lift, wall-lubrication and
30  turbulent dispersion. Note that it works only in run-time processing mode
31  and in combination with the multiphaseEuler solver module.
32 
33  For a simulation involving more than two phases, the accumulated force is
34  calculated by looping over all interfaces involving that phase. The fields
35  are stored in the database so that they can be processed further, e.g. with
36  the fieldAveraging functionObject.
37 
38  Example of function object specification:
39  \verbatim
40  phaseForces.water
41  {
42  type phaseForces;
43 
44  libs ("libmultiphaseEulerFunctionObjects.so");
45 
46  phase water;
47  }
48  \endverbatim
49 
50 Usage
51  \table
52  Property | Description | Required | Default value
53  type | type name: phaseForces | yes |
54  phase | Name of evaluated phase | yes |
55  \endtable
56 
57 See also
58  Foam::BlendedInterfacialModel
59  Foam::functionObjects::fvMeshFunctionObject
60  Foam::functionObject
61 
62 SourceFiles
63  phaseForces.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef phaseForces_functionObject_H
68 #define phaseForces_functionObject_H
69 
70 #include "fvMeshFunctionObject.H"
71 #include "HashPtrTable.H"
72 #include "volFieldsFwd.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 namespace functionObjects
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class phaseForces Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class phaseForces
86 :
87  public fvMeshFunctionObject
88 {
89 protected:
90 
91  // Protected data
92 
93  //- Name of the phase for which forces are evaluated
94  const word phaseName_;
95 
96  //- Force fields
97  autoPtr<HashPtrTable<volVectorField>> forceFields_;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("phaseForces");
104 
105 
106  // Constructors
107 
108  //- Construct from Time and dictionary
110  (
111  const word& name,
112  const Time& runTime,
113  const dictionary&
114  );
115 
116  //- Disallow default bitwise copy construction
117  phaseForces(const phaseForces&) = delete;
118 
119 
120  //- Destructor
121  virtual ~phaseForces();
122 
123 
124  // Member Functions
125 
126  //- Read the input data
127  virtual bool read(const dictionary& dict);
128 
129  //- Return the list of fields required
130  virtual wordList fields() const
131  {
132  return wordList::null();
133  }
134 
135  //- Calculate the force fields
136  virtual bool execute();
137 
138  //- Write the force fields
139  virtual bool write();
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const phaseForces&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace functionObjects
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
This functionObject calculates and outputs the blended interfacial forces acting on a given phase,...
Definition: phaseForces.H:102
autoPtr< HashPtrTable< volVectorField > > forceFields_
Force fields.
Definition: phaseForces.H:111
virtual wordList fields() const
Return the list of fields required.
Definition: phaseForces.H:144
const word phaseName_
Name of the phase for which forces are evaluated.
Definition: phaseForces.H:108
TypeName("phaseForces")
Runtime type information.
virtual bool read(const dictionary &dict)
Read the input data.
Definition: phaseForces.C:72
phaseForces(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: phaseForces.C:50
void operator=(const phaseForces &)=delete
Disallow default bitwise assignment.
virtual ~phaseForces()
Destructor.
Definition: phaseForces.C:66
virtual bool execute()
Calculate the force fields.
Definition: phaseForces.C:80
virtual bool write()
Write the force fields.
Definition: phaseForces.C:306
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
dictionary dict