Loading...
Searching...
No Matches
filmSeparation.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2020-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
29#include "filmSeparation.H"
30#include "filmSeparationModel.H"
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35namespace Foam
36{
37namespace regionModels
40{
41
42// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
43
46(
50);
52}
53}
54
55
56// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
57
59(
60 liquidFilmBase& film,
61 const dictionary& dict
62)
63:
64 injectionModel(type(), film, dict),
65 filmSeparationModelPtr_(filmSeparationModel::New(film, coeffDict_))
66{}
67
68
69// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
72{} // filmSeparationModel was forward declared
73
74
75// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76
78(
79 scalarField& availableMass,
80 scalarField& massToInject,
81 scalarField& diameterToInject
82)
83{
84 const faMesh& mesh = film().regionMesh();
85
86 // Calculate the mass ratio of film separation
87 tmp<scalarField> tmassRatio = filmSeparationModelPtr_->separatedMassRatio();
88 const auto& massRatio = tmassRatio.cref();
89
90 // Update various film properties based on the mass ratio
91 massToInject = massRatio*availableMass;
92 diameterToInject = massRatio*film().h();
93 availableMass -= massRatio*availableMass;
94
95 addToInjectedMass(sum(massToInject));
96
98
99
100 if (debug && mesh.time().writeTime())
101 {
102 {
103 areaScalarField areaSeparated
104 (
105 mesh.newIOobject("separated"),
106 mesh,
108 );
109 areaSeparated.primitiveFieldRef() = massRatio;
110 areaSeparated.write();
111 }
112
113 {
114 areaScalarField areaMassToInject
115 (
116 mesh.newIOobject("massToInject"),
117 mesh,
119 );
120 areaMassToInject.primitiveFieldRef() = massToInject;
121 areaMassToInject.write();
122 }
123 }
124}
125
126
127// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
A base class for filmSeparation models.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
The filmSeparation is a collection of curvature thin-film separation models designed to predict the o...
filmSeparation(liquidFilmBase &film, const dictionary &dict)
Construct from base film model and dictionary.
const liquidFilmBase & film() const
Return const access to the film surface film model.
Base class for film injection models, handling mass transfer from the film.
void addToInjectedMass(const scalar dMass)
Add to injected mass.
static autoPtr< injectionModel > New(liquidFilmBase &film, const dictionary &dict, const word &mdoelType)
Return a reference to the selected injection model.
Base class for liquid-film models.
const dictionary coeffDict_
Coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
A class for managing temporary objects.
Definition tmp.H:75
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
Definition tmpI.H:221
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
Namespace for handling debugging switches.
Definition debug.C:45
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
dictionary dict