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-2019 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 function object 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 reactingEulerFoam solvers.
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  libs ("libreactingEulerFoamFunctionObjects.so");
44  writeControl writeTime;
45  writeInterval 1;
46 
47  ...
48 
49  phaseName water;
50  }
51  \endverbatim
52 
53 Usage
54  \table
55  Property | Description | Required | Default value
56  type | type name: phaseForces | yes |
57  phaseName | Name of evaluated phase | yes |
58  \endtable
59 
60 See also
61  Foam::BlendedInterfacialModel
62  Foam::functionObjects::fvMeshFunctionObject
63  Foam::functionObject
64 
65 SourceFiles
66  phaseForces.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef functionObjects_phaseForces_H
71 #define functionObjects_phaseForces_H
72 
73 #include "fvMeshFunctionObject.H"
74 #include "phaseSystem.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 namespace functionObjects
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class phaseForces Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class phaseForces
88 :
89  public fvMeshFunctionObject
90 {
91 protected:
92 
93  // Protected data
94 
95  HashPtrTable<volVectorField> forceFields_;
96 
97  //- Phase for which forces are evaluated
98  const phaseModel& phase_;
99 
100  //- Constant access to phaseSystem
102 
103 
104  // Protected Member Functions
105 
106  //- Evaluate and return non-drag force
107  template<class modelType>
108  tmp<volVectorField> nonDragForce(const phasePair& key) const;
110 
111 public:
113  //- Runtime type information
114  TypeName("phaseForces");
116 
117  // Constructors
118 
119  //- Construct from Time and dictionary
121  (
122  const word& name,
123  const Time& runTime,
124  const dictionary&
125  );
126 
127  //- Disallow default bitwise copy construction
128  phaseForces(const phaseForces&) = delete;
129 
130 
131  //- Destructor
132  virtual ~phaseForces();
133 
134 
135  // Member Functions
136 
137  //- Read the input data
138  virtual bool read(const dictionary& dict);
139 
140  //- Calculate the force fields
141  virtual bool execute();
142 
143  //- Write the force fields
144  virtual bool write();
145 
146 
147  // Member Operators
148 
149  //- Disallow default bitwise assignment
150  void operator=(const phaseForces&) = delete;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace functionObjects
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
HashPtrTable< volVectorField > forceFields_
Definition: phaseForces.H:109
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:158
const phaseSystem & fluid_
Constant access to phaseSystem.
Definition: phaseForces.H:115
TypeName("phaseForces")
Runtime type information.
engineTime & runTime
const phaseModel & phase_
Phase for which forces are evaluated.
Definition: phaseForces.H:112
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:67
A class for handling words, derived from string.
Definition: word.H:59
virtual bool execute()
Calculate the force fields.
This function object calculates and outputs the blended interfacial forces acting on a given phase...
Definition: phaseForces.H:101
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.