surfaceTensionModel.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) 2017-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::surfaceTensionModel
26 
27 Description
28  Abstract base-class for surface tension models which return the surface
29  tension coefficient field.
30 
31 Usage
32  Example of the surface tension specification:
33  \verbatim
34  sigma
35  {
36  type <surface tension model type>;
37  <coefficient name> <coefficient value>;
38  .
39  .
40  .
41  }
42  \endverbatim
43  For simplicity and backward-compatibility the constant value format is
44  also supported, e.g.
45  \verbatim
46  sigma 0.07;
47  \endverbatim
48 
49 SourceFiles
50  surfaceTensionModel.C
51  surfaceTensionModelNew.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef surfaceTensionModel_H
56 #define surfaceTensionModel_H
57 
58 #include "regIOobject.H"
59 #include "dimensionedTypes.H"
60 #include "volFieldsFwd.H"
61 #include "runTimeSelectionTables.H"
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 class fvMesh;
69 
70 /*---------------------------------------------------------------------------*\
71  Class surfaceTensionModel Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public regIOobject
77 {
78 protected:
79 
80  // Protected member data
81 
82  //- Reference to mesh
83  const fvMesh& mesh_;
84 
85 
86  // Protected member functions
87 
88  static const dictionary& sigmaDict(const dictionary& dict)
89  {
90  return dict.subDict("sigma");
91  }
92 
93 
94 public:
95 
96  //- Runtime type information
97  TypeName("surfaceTensionModel");
98 
99 
100  // Declare runtime construction
101 
103  (
104  autoPtr,
106  dictionary,
107  (
108  const dictionary& dict,
109  const fvMesh& mesh
110  ),
111  (dict, mesh)
112  );
113 
114 
115  // Static Data Members
116 
117  //- Surface tension coefficient dimensions
118  static const dimensionSet dimSigma;
119 
120 
121  // Constructors
122 
123  // Construct from mesh
124  surfaceTensionModel(const fvMesh& mesh);
125 
126 
127  //- Destructor
128  virtual ~surfaceTensionModel();
129 
130 
131  // Selectors
132 
134  (
135  const dictionary& dict,
136  const fvMesh& mesh
137  );
138 
139 
140  // Member Functions
141 
142  //- Surface tension coefficient
143  virtual tmp<volScalarField> sigma() const = 0;
144 
145  //- Update surface tension coefficient from given dictionary
146  virtual bool readDict(const dictionary& dict) = 0;
147 
148  //- Write in dictionary format
149  virtual bool writeData(Ostream& os) const = 0;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
static const dictionary & sigmaDict(const dictionary &dict)
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static autoPtr< surfaceTensionModel > New(const dictionary &dict, const fvMesh &mesh)
declareRunTimeSelectionTable(autoPtr, surfaceTensionModel, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh))
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:982
virtual ~surfaceTensionModel()
Destructor.
Dimension set for the base types.
Definition: dimensionSet.H:120
dynamicFvMesh & mesh
virtual bool writeData(Ostream &os) const =0
Write in dictionary format.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
TypeName("surfaceTensionModel")
Runtime type information.
const fvMesh & mesh_
Reference to mesh.
static const dimensionSet dimSigma
Surface tension coefficient dimensions.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool readDict(const dictionary &dict)=0
Update surface tension coefficient from given dictionary.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:52
virtual tmp< volScalarField > sigma() const =0
Surface tension coefficient.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
surfaceTensionModel(const fvMesh &mesh)
A class for managing temporary objects.
Definition: PtrList.H:53
Abstract base-class for surface tension models which return the surface tension coefficient field...
Namespace for OpenFOAM.