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-2020 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_(dict.lookup<scalar>("efficiency"))
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
59 
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
65 
67 {
68  return true;
69 }
70 
71 
74 {
75  const phaseModel* dropletPtr = nullptr;
76  scalar sign = 1;
77  if (dropletName_ == pair_.first())
78  {
79  dropletPtr = &pair_.phase1();
80  sign = -1;
81  }
82  else if (dropletName_ == pair_.second())
83  {
84  dropletPtr = &pair_.phase2();
85  sign = 1;
86  }
87  else
88  {
90  << "The specified droplet phase, " << dropletName_ << ", is not in "
91  << "the " << pair_ << " pair"
92  << exit(FatalError);
93  }
94 
95  const phaseModel& droplet = *dropletPtr;
96  const phaseModel& surface = droplet.fluid().phases()[surfaceName_];
97 
98  return
99  1.5*sign*efficiency_
100  *droplet.rho()*droplet*surface/surface.d()
101  *mag(droplet.U() - surface.U());
102 }
103 
104 
105 // ************************************************************************* //
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
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:323
const phaseModel & phase1() const
Return phase 1.
Definition: phasePairI.H:28
const phasePair & pair_
Phase pair.
Definition: liftModel.H:59
virtual bool mixture() const
Whether or not there is a mass transfer rate for the mixture.
Macros for easy insertion into run-time selection tables.
deposition(const dictionary &dict, const phasePair &pair)
Construct from components.
stressControl lookup("compactNormalStress") >> compactNormalStress
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const Type & second() const
Return second.
Definition: Pair.H:110
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual tmp< volScalarField > dmdtf() const
The mass transfer rate for the mixture.
A class for managing temporary objects.
Definition: PtrList.H:53
const Type & first() const
Return first.
Definition: Pair.H:98
Namespace for OpenFOAM.