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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::surfaceTensionModel
28
29Description
30 Abstract base-class for surface tension models which return the surface
31 tension coefficient field.
32
33Usage
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
51SourceFiles
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"
64
65// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66
67namespace Foam
68{
69
70class fvMesh;
71
72/*---------------------------------------------------------------------------*\
73 Class surfaceTensionModel Declaration
74\*---------------------------------------------------------------------------*/
77:
78 public regIOobject
79{
80protected:
81
82 // Protected member data
83
84 //- Reference to mesh
85 const fvMesh& mesh_;
86
87
88 // Protected member functions
90 static const dictionary& sigmaDict(const dictionary& dict)
91 {
92 return dict.subDict("sigma");
93 }
94
95
96public:
97
98 //- Runtime type information
99 TypeName("surfaceTensionModel");
100
101
102 // Declare runtime construction
105 (
106 autoPtr,
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// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:109
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
bool writeData(Ostream &os) const
Dummy write for regIOobject.
virtual ~surfaceTensionModel()=default
Destructor.
virtual tmp< volScalarField > sigma() const =0
Surface tension.
static autoPtr< surfaceTensionModel > New(const dictionary &dict, const phasePair &pair)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
const fvMesh & mesh_
Reference to mesh.
virtual bool readDict(const dictionary &dict)=0
Update surface tension coefficient from given dictionary.
static const dictionary & sigmaDict(const dictionary &dict)
virtual ~surfaceTensionModel()
Destructor.
static const dimensionSet dimSigma
Surface tension coefficient dimensions.
declareRunTimeSelectionTable(autoPtr, surfaceTensionModel, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh))
virtual bool writeData(Ostream &os) const =0
Write in dictionary format.
virtual tmp< volScalarField > sigma() const =0
Surface tension coefficient.
TypeName("surfaceTensionModel")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:65
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73