liquidPropertiesSurfaceTension.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "liquidThermo.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 namespace surfaceTensionModels
38 {
39  defineTypeNameAndDebug(liquidProperties, 0);
41  (
42  surfaceTensionModel,
43  liquidProperties,
44  dictionary
45  );
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
53 (
54  const dictionary& dict,
55  const fvMesh& mesh
56 )
57 :
58  surfaceTensionModel(mesh),
59  phaseName_(dict.get<word>("phase"))
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 
67 {
70  (
72  );
73 
74  const Foam::liquidProperties& liquid = thermo.mixture().properties();
75 
76  tmp<volScalarField> tsigma
77  (
78  new volScalarField
79  (
80  IOobject
81  (
82  "sigma",
83  mesh_.time().timeName(),
84  mesh_,
87  false
88  ),
89  mesh_,
90  dimSigma
91  )
92  );
93  volScalarField& sigma = tsigma.ref();
94 
95  const volScalarField& T = thermo.T();
96  const volScalarField& p = thermo.p();
97 
99  const volScalarField::Internal& pi = p;
100  const volScalarField::Internal& Ti = T;
101 
102  forAll(sigmai, celli)
103  {
104  sigmai[celli] = liquid.sigma(pi[celli], Ti[celli]);
105  }
106 
107  volScalarField::Boundary& sigmaBf = sigma.boundaryFieldRef();
108  const volScalarField::Boundary& pBf = p.boundaryField();
109  const volScalarField::Boundary& TBf = T.boundaryField();
110 
111  forAll(sigmaBf, patchi)
112  {
113  scalarField& sigmaPf = sigmaBf[patchi];
114  const scalarField& pPf = pBf[patchi];
115  const scalarField& TPf = TBf[patchi];
116 
117  forAll(sigmaPf, facei)
118  {
119  sigmaPf[facei] = liquid.sigma(pPf[facei], TPf[facei]);
120  }
121  }
122 
123  return tsigma;
124 }
125 
126 
128 (
129  const dictionary& dict
130 )
131 {
132  return true;
133 }
134 
135 
137 (
138  Ostream& os
139 ) const
140 {
142  {
143  return os.good();
144  }
145 
146  return false;
147 }
148 
149 
150 // ************************************************************************* //
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:191
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:46
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:57
Foam::basicThermo::dictName
static const word dictName
Definition: basicThermo.H:252
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:773
Foam::surfaceTensionModel::dimSigma
static const dimensionSet dimSigma
Definition: surfaceTensionModel.H:87
Foam::surfaceTensionModels::liquidProperties::sigma
virtual tmp< volScalarField > sigma() const
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::IOobject::IOobject
IOobject(const IOobject &)=default
Foam::surfaceTensionModel::writeData
bool writeData(Ostream &os) const
Definition: surfaceTensionModel.C:94
forAll
#define forAll(list, i)
Definition: stdFoam.H:349
Foam::liquidProperties
The thermophysical properties of a liquid.
Definition: liquidProperties.H:47
Foam::surfaceTensionModels::liquidProperties::readDict
virtual bool readDict(const dictionary &dict)
Foam::GeometricField::Internal
DimensionedField< Type, GeoMesh > Internal
Definition: GeometricField.H:103
liquidThermo.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:51
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
Foam::objectRegistry::lookupObject
const Type & lookupObject(const word &name, const bool recursive=false) const
Definition: objectRegistryTemplates.C:427
dict
dictionary dict
Definition: searchingEngine.H:14
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
Definition: atmBoundaryLayer.C:26
liquidPropertiesSurfaceTension.H
Foam::heRhoThermopureMixtureliquidProperties
heRhoThermo< rhoThermo, pureMixture< species::thermo< thermophysicalPropertiesSelector< liquidProperties >, sensibleInternalEnergy > >> heRhoThermopureMixtureliquidProperties
Definition: liquidThermo.H:48
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::surfaceTensionModel::mesh_
const fvMesh & mesh_
Definition: surfaceTensionModel.H:80
Foam::PtrListOps::get
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Foam::fvMesh::time
const Time & time() const
Definition: fvMesh.H:276
Foam::surfaceTensionModels::liquidProperties::liquidProperties
liquidProperties(const dictionary &dict, const fvMesh &mesh)
Foam::surfaceTensionModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(surfaceTensionModel, constantSurfaceTensionCoefficient, dictionary)
Foam::IOobject::groupName
static word groupName(StringType base, const word &group)
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:184
Foam::surfaceTensionModels::liquidProperties::writeData
virtual bool writeData(Ostream &os) const