contactAngleModel.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) 2023 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::contactAngleModel
26 
27 Description
28  Abstract base-class for contact-angle models
29  which return the cosine contact angle field.
30 
31 Usage
32  Example of the surface tension specification:
33  \verbatim
34  contactAngle
35  {
36  type <contact angle model type>;
37  <coefficient name> <coefficient value>;
38  .
39  .
40  .
41  }
42  \endverbatim
43 
44 SourceFiles
45  contactAngleModel.C
46  contactAngleModelNew.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef contactAngleModel_H
51 #define contactAngleModel_H
52 
53 #include "fvPatchFields.H"
54 #include "runTimeSelectionTables.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class contactAngleModel Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 {
67 protected:
68 
69  // Protected member functions
70 
71  static const dictionary& contactAngleDict(const dictionary& dict)
72  {
73  return dict.subDict("contactAngle");
74  }
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("contactAngleModel");
81 
82 
83  // Declare runtime construction
84 
86  (
87  autoPtr,
89  dictionary,
90  (
91  const dictionary& dict
92  ),
93  (dict)
94  );
95 
96 
97  // Constructors
98 
99  // Construct
101 
102  //- Construct and return a clone
103  virtual autoPtr<contactAngleModel> clone() const = 0;
104 
105 
106  //- Destructor
107  virtual ~contactAngleModel();
108 
109 
110  // Selectors
111 
113  (
114  const dictionary& dict
115  );
116 
117 
118  // Member Functions
119 
120  //- Cosine of the contact angle
121  virtual tmp<scalarField> cosTheta
122  (
123  const fvPatchVectorField& Up,
124  const vectorField& nHat
125  ) const = 0;
126 
127  //- Write data in dictionary format
128  virtual void write(Ostream& os) const = 0;
129 };
130 
131 
132 void writeEntry(Ostream& os, const contactAngleModel& ca);
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Abstract base-class for contact-angle models which return the cosine contact angle field.
virtual autoPtr< contactAngleModel > clone() const =0
Construct and return a clone.
static const dictionary & contactAngleDict(const dictionary &dict)
virtual ~contactAngleModel()
Destructor.
TypeName("contactAngleModel")
Runtime type information.
static autoPtr< contactAngleModel > New(const dictionary &dict)
virtual tmp< scalarField > cosTheta(const fvPatchVectorField &Up, const vectorField &nHat) const =0
Cosine of the contact angle.
declareRunTimeSelectionTable(autoPtr, contactAngleModel, dictionary,(const dictionary &dict),(dict))
virtual void write(Ostream &os) const =0
Write data in dictionary format.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Macros to ease declaration of run-time selection tables.
dictionary dict