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 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 (drag, virtual mass, lift, wall-lubrication and
30  turbulent dispersion). It works only in combination with the
31  reactingEulerFoam solvers. For a simulation involving more than two phases,
32  the accumulated force is calculated by looping over all phasePairs involving
33  that phase. The fields are stored in the database so that they can be
34  processed further, e.g. with the fieldAveraging functionObject.
35 
36  Example of function object specification:
37  \verbatim
38  phaseForces.water
39  {
40  type phaseForces;
41  libs ("libreactingEulerFoamFunctionObjects.so");
42  writeControl outputTime;
43  writeInterval 1;
44  log false;
45  ...
46  phaseName water;
47  }
48  \endverbatim
49 
50 Usage
51  \table
52  Property | Description | Required | Default value
53  type | type name: phaseForces | yes |
54  phaseName | 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  // Private data
89 
90  //- Phase for which forces are evaluated
91  const phaseModel& phase_;
92 
93  //- Constant access to phaseSystem
94  const phaseSystem& fluid_;
95 
96  //- Drag force
97  volVectorField dragForce_;
98 
99  //- Virtual mass force
100  volVectorField virtualMassForce_;
101 
102  //- Lift force
103  volVectorField liftForce_;
104 
105  //- Wall lubrication force
106  volVectorField wallLubricationForce_;
107 
108  //- Turbulent dispersion force
109  volVectorField turbulentDispersionForce_;
110 
111 
112  // Private Member Functions
113 
114  //- Disallow default bitwise copy construct
115  phaseForces(const phaseForces&);
116 
117  //- Disallow default bitwise assignment
118  void operator=(const phaseForces&);
119 
120  //- Evaluate and return the drag force
121  tmp<volVectorField> dragForce() const;
122 
123  //- Evaluate and return the virtual mass force
124  tmp<volVectorField> virtualMassForce() const;
125 
126  //- Evaluate and return the lift force
127  tmp<volVectorField> liftForce() const;
128 
129  //- Evaluate and return the wall lubrication force
130  tmp<volVectorField> wallLubricationForce() const;
131 
132  //- Evaluate and return the turbulent dispersion force
133  tmp<volVectorField> turbulentDispersionForce() const;
134 
135 
136 public:
137 
138  //- Runtime type information
139  TypeName("phaseForces");
140 
141 
142  // Constructors
143 
144  //- Construct from Time and dictionary
146  (
147  const word& name,
148  const Time& runTime,
149  const dictionary&
150  );
151 
152 
153  //- Destructor
154  virtual ~phaseForces();
155 
156 
157  // Member Functions
158 
159  //- Read the input data
160  virtual bool read(const dictionary& dict);
161 
162  //- Calculate the force fields
163  virtual bool execute();
164 
165  //- Write the force fields
166  virtual bool write();
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace functionObjects
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
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:137
TypeName("phaseForces")
Runtime type information.
engineTime & runTime
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual ~phaseForces()
Destructor.
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 (d...
Definition: phaseForces.H:98
A class for managing temporary objects.
Definition: PtrList.H:53
virtual bool write()
Write the force fields.
Namespace for OpenFOAM.