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-2022 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 multiphaseEulerFoam solver.
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 ("libmultiphaseEulerFoamFunctionObjects.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 functionObjects_phaseForces_H
68 #define functionObjects_phaseForces_H
69 
70 #include "fvMeshFunctionObject.H"
71 #include "phaseSystem.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace functionObjects
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class phaseForces Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class phaseForces
85 :
86  public fvMeshFunctionObject
87 {
88 protected:
89 
90  // Protected data
91 
92  //- Force fields
93  HashPtrTable<volVectorField> forceFields_;
94 
95  //- Phase for which forces are evaluated
96  const phaseModel& phase_;
97 
98  //- Constant access to phaseSystem
99  const phaseSystem& fluid_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("phaseForces");
106 
108  // Constructors
109 
110  //- Construct from Time and dictionary
112  (
113  const word& name,
114  const Time& runTime,
115  const dictionary&
116  );
117 
118  //- Disallow default bitwise copy construction
119  phaseForces(const phaseForces&) = delete;
120 
121 
122  //- Destructor
123  virtual ~phaseForces();
124 
125 
126  // Member Functions
127 
128  //- Read the input data
129  virtual bool read(const dictionary& dict);
130 
131  //- Return the list of fields required
132  virtual wordList fields() const
133  {
134  return wordList::null();
135  }
136 
137  //- Calculate the force fields
138  virtual bool execute();
139 
140  //- Write the force fields
141  virtual bool write();
142 
143 
144  // Member Operators
145 
146  //- Disallow default bitwise assignment
147  void operator=(const phaseForces&) = delete;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace functionObjects
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
HashPtrTable< volVectorField > forceFields_
Force fields.
Definition: phaseForces.H:107
dictionary dict
virtual bool read(const dictionary &dict)
Read the input data.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const phaseSystem & fluid_
Constant access to phaseSystem.
Definition: phaseForces.H:113
TypeName("phaseForces")
Runtime type information.
const phaseModel & phase_
Phase for which forces are evaluated.
Definition: phaseForces.H:110
static const List< T > & 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:69
virtual wordList fields() const
Return the list of fields required.
Definition: phaseForces.H:146
virtual ~phaseForces()
Destructor.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:68
A class for handling words, derived from string.
Definition: word.H:59
virtual bool execute()
Calculate the force fields.
This functionObject calculates and outputs the blended interfacial forces acting on a given phase...
Definition: phaseForces.H:98
void operator=(const phaseForces &)=delete
Disallow default bitwise assignment.
phaseForces(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool write()
Write the force fields.
Namespace for OpenFOAM.