phaseForces.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::functionObjects::phaseForces
28 
29 Description
30  This function object calculates and outputs the blended interfacial forces
31  acting on a given phase, i.e. drag, virtual mass, lift, wall-lubrication and
32  turbulent dispersion. Note that it works only in run-time processing mode
33  and in combination with the reactingEulerFoam solvers.
34 
35  For a simulation involving more than two phases, the accumulated force is
36  calculated by looping over all phasePairs involving that phase. The fields
37  are stored in the database so that they can be processed further, e.g. with
38  the fieldAveraging functionObject.
39 
40  Example of function object specification:
41  \verbatim
42  phaseForces.water
43  {
44  type phaseForces;
45  libs (reactingEulerFoamFunctionObjects);
46  writeControl writeTime;
47  writeInterval 1;
48 
49  ...
50 
51  phaseName water;
52  }
53  \endverbatim
54 
55 Usage
56  \table
57  Property | Description | Required | Default value
58  type | type name: phaseForces | yes |
59  phaseName | Name of evaluated phase | yes |
60  \endtable
61 
62 See also
63  Foam::BlendedInterfacialModel
64  Foam::functionObjects::fvMeshFunctionObject
65  Foam::functionObject
66 
67 SourceFiles
68  phaseForces.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef functionObjects_phaseForces_H
73 #define functionObjects_phaseForces_H
74 
75 #include "fvMeshFunctionObject.H"
76 #include "phaseSystem.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 namespace functionObjects
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class phaseForces Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class phaseForces
90 :
91  public fvMeshFunctionObject
92 {
93  // Private Member Functions
94 
95  //- Disallow default bitwise copy construct
96  phaseForces(const phaseForces&);
97 
98  //- Disallow default bitwise assignment
99  void operator=(const phaseForces&);
100 
101 
102 protected:
103 
104  // Protected data
105 
107 
108  //- Phase for which forces are evaluated
109  const phaseModel& phase_;
110 
111  //- Constant access to phaseSystem
112  const phaseSystem& fluid_;
113 
114 
115  // Protected Member Functions
116 
117  //- Evaluate and return non-drag force
118  template<class modelType>
120 
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("phaseForces");
126 
127 
128  // Constructors
129 
130  //- Construct from Time and dictionary
132  (
133  const word& name,
134  const Time& runTime,
135  const dictionary&
136  );
137 
138 
139  //- Destructor
140  virtual ~phaseForces();
141 
142 
143  // Member Functions
144 
145  //- Read the input data
146  virtual bool read(const dictionary& dict);
147 
148  //- Calculate the force fields
149  virtual bool execute();
150 
151  //- Write the force fields
152  virtual bool write();
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace functionObjects
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::functionObjects::phaseForces::~phaseForces
virtual ~phaseForces()
Destructor.
Definition: phaseForces.C:214
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:53
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fvMeshFunctionObject.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::functionObjects::phaseForces::read
virtual bool read(const dictionary &dict)
Read the input data.
Definition: phaseForces.C:220
Foam::functionObjects::phaseForces::TypeName
TypeName("phaseForces")
Runtime type information.
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::phaseForces
This function object calculates and outputs the blended interfacial forces acting on a given phase,...
Definition: phaseForces.H:103
Foam::functionObjects::phaseForces::nonDragForce
tmp< volVectorField > nonDragForce(const phasePair &key) const
Evaluate and return non-drag force.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::functionObjects::phaseForces::phase_
const phaseModel & phase_
Phase for which forces are evaluated.
Definition: phaseForces.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::HashPtrTable
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:54
Foam::functionObjects::phaseForces::fluid_
const phaseSystem & fluid_
Constant access to phaseSystem.
Definition: phaseForces.H:126
Foam::functionObjects::phaseForces::write
virtual bool write()
Write the force fields.
Definition: phaseForces.C:292
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:66
Foam::functionObjects::phaseForces::forceFields_
HashPtrTable< volVectorField > forceFields_
Definition: phaseForces.H:120
Foam::functionObjects::phaseForces::execute
virtual bool execute()
Calculate the force fields.
Definition: phaseForces.C:228