deposition.C
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) 2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "deposition.H"
27 #include "phasePair.H"
28 #include "phaseSystem.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace phaseTransferModels
36 {
37  defineTypeNameAndDebug(deposition, 0);
38  addToRunTimeSelectionTable(phaseTransferModel, deposition, dictionary);
39 }
40 }
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
46 (
47  const dictionary& dict,
48  const phasePair& pair
49 )
50 :
51  phaseTransferModel(dict, pair),
52  dropletName_(dict.lookup("droplet")),
53  surfaceName_(dict.lookup("surface")),
54  efficiency_(readScalar(dict.lookup("efficiency")))
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
59 
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
65 
68 {
69  const phaseModel* dropletPtr = nullptr;
70  scalar sign = 1;
71  if (dropletName_ == pair_.first())
72  {
73  dropletPtr = &pair_.phase1();
74  sign = -1;
75  }
76  else if (dropletName_ == pair_.second())
77  {
78  dropletPtr = &pair_.phase2();
79  sign = 1;
80  }
81  else
82  {
84  << "The specified droplet phase, " << dropletName_ << ", is not in "
85  << "the " << pair_ << " pair"
86  << exit(FatalError);
87  }
88 
89  const phaseModel& droplet = *dropletPtr;
90  const phaseModel& surface = droplet.fluid().phases()[surfaceName_];
91 
92  return
93  1.5*sign*efficiency_
94  *droplet.rho()*droplet*surface/surface.d()
95  *mag(droplet.U() - surface.U());
96 }
97 
98 
99 // ************************************************************************* //
dictionary dict
const phaseModel & phase2() const
Return phase 2.
Definition: phasePairI.H:34
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
error FatalError
const phasePair & pair_
Phase pair.
Definition: liftModel.H:59
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
const phaseModel & phase1() const
Return phase 1.
Definition: phasePairI.H:28
Macros for easy insertion into run-time selection tables.
deposition(const dictionary &dict, const phasePair &pair)
Construct from components.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual tmp< volScalarField > dmdt() const
The mass transfer rate.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
Definition: doubleScalar.H:68
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const Type & second() const
Return second.
Definition: Pair.H:99
dimensioned< scalar > mag(const dimensioned< Type > &)
A class for managing temporary objects.
Definition: PtrList.H:53
const Type & first() const
Return first.
Definition: Pair.H:87
Namespace for OpenFOAM.