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-2020 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 phasePairs 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  HashPtrTable<volVectorField> forceFields_;
93 
94  //- Phase for which forces are evaluated
95  const phaseModel& phase_;
96 
97  //- Constant access to phaseSystem
99 
100 
101  // Protected Member Functions
102 
103  //- Evaluate and return non-drag force
104  template<class modelType>
105  tmp<volVectorField> nonDragForce(const phasePair& key) const;
107 
108 public:
110  //- Runtime type information
111  TypeName("phaseForces");
113 
114  // Constructors
115 
116  //- Construct from Time and dictionary
118  (
119  const word& name,
120  const Time& runTime,
121  const dictionary&
122  );
123 
124  //- Disallow default bitwise copy construction
125  phaseForces(const phaseForces&) = delete;
126 
127 
128  //- Destructor
129  virtual ~phaseForces();
130 
131 
132  // Member Functions
133 
134  //- Read the input data
135  virtual bool read(const dictionary& dict);
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_
Definition: phaseForces.H:106
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:112
TypeName("phaseForces")
Runtime type information.
engineTime & runTime
const phaseModel & phase_
Phase for which forces are evaluated.
Definition: phaseForces.H:109
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual ~phaseForces()
Destructor.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:70
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.
tmp< volVectorField > nonDragForce(const phasePair &key) const
Evaluate and return non-drag force.
A class for managing temporary objects.
Definition: PtrList.H:53
phaseForces(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool write()
Write the force fields.
Namespace for OpenFOAM.