constantSurfaceTension.C
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 \*---------------------------------------------------------------------------*/
27 
28 #include "constantSurfaceTension.H"
29 #include "volFields.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace surfaceTensionModels
37 {
39  addToRunTimeSelectionTable(surfaceTensionModel, constant, dictionary);
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const dictionary& dict,
49  const fvMesh& mesh
50 )
51 :
53  sigma_("sigma", dimMass/sqr(dimTime), dict)
54 {}
55 
56 
57 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
58 
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
67 {
69  (
70  IOobject
71  (
72  "sigma",
73  mesh_.time().timeName(),
74  mesh_,
77  false
78  ),
79  mesh_,
80  sigma_
81  );
82 }
83 
84 
86 {
87  // Handle sub-dictionary format as a special case
88  if (dict.isDict("sigma"))
89  {
90  dict.subDict("sigma").readEntry("sigma", sigma_);
91  }
92  else
93  {
94  dict.readEntry("sigma", sigma_);
95  }
96 
97  return true;
98 }
99 
100 
102 {
104  {
105  os << sigma_ << token::END_STATEMENT << nl;
106  return os.good();
107  }
108 
109  return false;
110 }
111 
112 
113 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
volFields.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::surfaceTensionModels::constant::~constant
virtual ~constant()
Destructor.
Definition: constantSurfaceTension.C:59
Foam::surfaceTensionModels::constant::constant
constant(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: constantSurfaceTension.C:47
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::surfaceTensionModels::constant::writeData
virtual bool writeData(Ostream &os) const
Write in dictionary format.
Definition: constantSurfaceTension.C:101
Foam::surfaceTensionModel::writeData
bool writeData(Ostream &os) const
Dummy write for regIOobject.
Definition: surfaceTensionModel.C:101
Foam::dimTime
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:53
constantSurfaceTension.H
Foam::token::END_STATEMENT
End entry [isseparator].
Definition: token.H:154
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::surfaceTensionModels::constant::readDict
virtual bool readDict(const dictionary &dict)
Update surface tension coefficient from given dictionary.
Definition: constantSurfaceTension.C:85
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::surfaceTensionModels::defineTypeNameAndDebug
defineTypeNameAndDebug(constantSurfaceTensionCoefficient, 0)
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::dimMass
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:51
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
Foam::surfaceTensionModels::constant::sigma
virtual tmp< volScalarField > sigma() const
Surface tension coefficient.
Definition: constantSurfaceTension.C:66
Foam::surfaceTensionModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceTensionModel, constantSurfaceTensionCoefficient, dictionary)
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::IOobject::NO_READ
Definition: IOobject.H:188
constant
constant condensation/saturation model.