surfaceTensionModel.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) 2017 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::surfaceTensionModel
28 
29 Description
30  Abstract base-class for surface tension models which return the surface
31  tension coefficient field.
32 
33 Usage
34  Example of the surface tension specification:
35  \verbatim
36  sigma
37  {
38  type <surface tension model type>;
39  <coefficient name> <coefficient value>;
40  .
41  .
42  .
43  }
44  \endverbatim
45  For simplicity and backward-compatibility the constant value format is
46  also supported, e.g.
47  \verbatim
48  sigma 0.07;
49  \endverbatim
50 
51 SourceFiles
52  surfaceTensionModel.C
53  newSurfaceTensionModel.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef surfaceTensionModel_H
58 #define surfaceTensionModel_H
59 
60 #include "regIOobject.H"
61 #include "dimensionedTypes.H"
62 #include "volFieldsFwd.H"
63 #include "runTimeSelectionTables.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 class fvMesh;
71 
72 /*---------------------------------------------------------------------------*\
73  Class surfaceTensionModel Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 class surfaceTensionModel
77 :
78  public regIOobject
79 {
80 protected:
81 
82  // Protected member data
83 
84  //- Reference to mesh
85  const fvMesh& mesh_;
86 
87 
88  // Protected member functions
89 
90  static const dictionary& sigmaDict(const dictionary& dict)
91  {
92  return dict.subDict("sigma");
93  }
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("surfaceTensionModel");
100 
101 
102  // Declare runtime construction
103 
105  (
106  autoPtr,
108  dictionary,
109  (
110  const dictionary& dict,
111  const fvMesh& mesh
112  ),
113  (dict, mesh)
114  );
115 
116 
117  // Static data members
118 
119  //- Surface tension coefficient dimensions
120  static const dimensionSet dimSigma;
121 
122 
123  // Constructors
124 
125  // Construct from mesh
127 
128 
129  //- Destructor
130  virtual ~surfaceTensionModel();
131 
132 
133  // Selectors
134 
136  (
137  const dictionary& dict,
138  const fvMesh& mesh
139  );
140 
141 
142  // Member Functions
143 
144  //- Surface tension coefficient
145  virtual tmp<volScalarField> sigma() const = 0;
146 
147  //- Update surface tension coefficient from given dictionary
148  virtual bool readDict(const dictionary& dict) = 0;
149 
150  //- Write in dictionary format
151  virtual bool writeData(Ostream& os) const = 0;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
regIOobject.H
Foam::surfaceTensionModel::surfaceTensionModel
surfaceTensionModel(const dictionary &dict, const phasePair &pair, const bool registerObject)
Construct from a dictionary and a phase pair.
Definition: surfaceTensionModel.C:46
volFieldsFwd.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::surfaceTensionModel
Abstract base-class for surface tension models which return the surface tension coefficient field.
Definition: surfaceTensionModel.H:55
Foam::surfaceTensionModel::dimSigma
static const dimensionSet dimSigma
Coefficient dimensions.
Definition: surfaceTensionModel.H:91
Foam::surfaceTensionModel::TypeName
TypeName("surfaceTensionModel")
Runtime type information.
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::surfaceTensionModel::writeData
bool writeData(Ostream &os) const
Dummy write for regIOobject.
Definition: surfaceTensionModel.C:101
Foam::surfaceTensionModel::sigmaDict
static const dictionary & sigmaDict(const dictionary &dict)
Definition: surfaceTensionModel.H:89
Foam::surfaceTensionModel::New
static autoPtr< surfaceTensionModel > New(const dictionary &dict, const phasePair &pair)
Definition: surfaceTensionModel.C:72
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::surfaceTensionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, surfaceTensionModel, dictionary,(const dictionary &dict, const phasePair &pair, const bool registerObject),(dict, pair, registerObject))
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::surfaceTensionModel::readDict
virtual bool readDict(const dictionary &dict)=0
Update surface tension coefficient from given dictionary.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::surfaceTensionModel::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: surfaceTensionModel.H:84
dimensionedTypes.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::surfaceTensionModel::~surfaceTensionModel
virtual ~surfaceTensionModel()=default
Destructor.
Definition: surfaceTensionModel.C:63
Foam::surfaceTensionModel::sigma
virtual tmp< volScalarField > sigma() const =0
Aspect ratio.