surfactantProperties.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) 2019 Zeljko Tukovic, FSB Zagreb.
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  surfactantProperties
28 
29 Description
30 
31 SourceFiles
32  surfactantProperties.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef surfactantProperties_H
37 #define surfactantProperties_H
38 
39 #include "fvCFD.H"
40 #include "faCFD.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class surfactantProperties Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 {
53  // Private data
54 
55  //- Surfactant concentration in the bulk of fluid
56  dimensionedScalar bulkConc_;
57 
58  //- Saturated surfactant concentration on the free-surface
59  dimensionedScalar saturatedConc_;
60 
61  //- Adsorption coefficient of surfactant
62  dimensionedScalar adsorptionCoeff_;
63 
64  //- Desorption coefficient of surfactant
65  dimensionedScalar desorptionCoeff_;
66 
67  //- Diffusion coefficient of surfactant in the bulk of fluid
68  dimensionedScalar bulkDiffusion_;
69 
70  //- Diffusion coefficient of surfactant at the free-surface
71  dimensionedScalar diffusion_;
72 
73  //- Temperature of surfactant at the free-surface
75 
76  //- Universal gas constant
78 
79  //- Equilibrium surfactant concentration at the free-surface
80  dimensionedScalar equilibriumConc_;
81 
82  //- Is the surfactant soluble?
83  Switch soluble_;
84 
85 
86 public:
87 
88  // Constructors
89 
90  explicit surfactantProperties(const dictionary& dict)
91  :
92  bulkConc_("bulkConc", dict),
93  saturatedConc_("saturatedConc", dict),
94  adsorptionCoeff_("adsorptionCoeff", dict),
95  desorptionCoeff_("desorptionCoeff", dict),
96  bulkDiffusion_("bulkDiffusion", dict),
97  diffusion_("diffusion", dict),
98  T_("temperature", dict),
99  R_("R", dimGasConstant*dimMass/dimMoles, 8.3144),
100  equilibriumConc_
101  (
102  saturatedConc_
103  /(
104  1.0
105  + desorptionCoeff_
106  /bulkConc_
107  )
108  ),
109  soluble_(dict.get<bool>("soluble"))
110  {}
111 
112 
113  // Member Functions
114 
115  //- Return surfactant concentration in the bulk of fluid
116  const dimensionedScalar& bulkConc() const
117  {
118  return bulkConc_;
119  }
120 
121  //- Return saturated surfactant concentration at the free-surface
122  const dimensionedScalar& saturatedConc() const
123  {
124  return saturatedConc_;
125  }
126 
127  //- Return surfactant adsorption coefficient
128  const dimensionedScalar& adsorptionCoeff() const
129  {
130  return adsorptionCoeff_;
131  }
132 
133  //- Return surfactant desorption coefficient
134  const dimensionedScalar& desorptionCoeff() const
135  {
136  return desorptionCoeff_;
137  }
138 
139  //- Return diffusion coefficient of the surfactant in the bulk of fluid
140  const dimensionedScalar& bulkDiffusion() const
141  {
142  return bulkDiffusion_;
143  }
144 
145  //- Return diffusion coefficient of the surfactant at the free-surface
146  const dimensionedScalar& diffusion() const
147  {
148  return diffusion_;
149  }
150 
151  //- Return surfactant temeprature
152  const dimensionedScalar& T() const
153  {
154  return T_;
155  }
156 
157  //- Return universal gas constant
158  const dimensionedScalar& R() const
159  {
160  return R_;
161  }
162 
163  //- Return equilibrium surfactant concentration at the free-surface
164  const dimensionedScalar& equilibriumConc() const
165  {
166  return equilibriumConc_;
167  }
168 
169  //- Is the surfactant soluble
170  Switch soluble() const
171  {
172  return soluble_;
173  }
174 
175  //- Surface tension change due to presence of surfactants
177  (
178  const areaScalarField& surfactConc
179  ) const
180  {
182  (
183  IOobject
184  (
185  "dSigma",
186  surfactConc.mesh().time().timeName(),
187  surfactConc.mesh().thisDb(),
190  ),
191  (
192  R()*T()*saturatedConc()
193  * log(1.0 - surfactConc/saturatedConc())
194  )
195  );
196  }
197 };
198 
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 } // End namespace Foam
203 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 #endif
207 
208 // ************************************************************************* //
dictionary dict
dimensionedScalar log(const dimensionedScalar &ds)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const dimensionedScalar & desorptionCoeff() const
Return surfactant desorption coefficient.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Definition: Switch.H:77
Switch soluble() const
Is the surfactant soluble.
Ignore writing from objectRegistry::writeObject()
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
tmp< areaScalarField > dSigma(const areaScalarField &surfactConc) const
Surface tension change due to presence of surfactants.
const dimensionedScalar & saturatedConc() const
Return saturated surfactant concentration at the free-surface.
const dimensionedScalar & bulkConc() const
Return surfactant concentration in the bulk of fluid.
const dimensionedScalar & adsorptionCoeff() const
Return surfactant adsorption coefficient.
const dimensionedScalar & T() const
Return surfactant temeprature.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
const Mesh & mesh() const noexcept
Return mesh.
surfactantProperties(const dictionary &dict)
const dimensionSet dimMoles(0, 0, 0, 0, 1, 0, 0)
Definition: dimensionSets.H:53
const dimensionedScalar & equilibriumConc() const
Return equilibrium surfactant concentration at the free-surface.
const dimensionedScalar & R() const
Return universal gas constant.
const dimensionedScalar & diffusion() const
Return diffusion coefficient of the surfactant at the free-surface.
Nothing to be read.
const dimensionSet dimGasConstant
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const dimensionedScalar & bulkDiffusion() const
Return diffusion coefficient of the surfactant in the bulk of fluid.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Namespace for OpenFOAM.