orderedPhasePair.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) 2014-2015 OpenFOAM Foundation
9  Copyright (C) 2020 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 
29 #include "orderedPhasePair.H"
30 #include "aspectRatioModel.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
35 (
36  const phaseModel& dispersed,
37  const phaseModel& continuous,
38  const dimensionedVector& g,
39  const scalarTable& sigmaTable,
40  const dictTable& aspectRatioTable
41 )
42 :
43  phasePair(dispersed, continuous, g, sigmaTable, true)
44 {
45  if (aspectRatioTable.found(*this))
46  {
47  aspectRatio_.reset
48  (
50  (
51  aspectRatioTable[*this],
52  *this
53  ).ptr()
54  );
55  }
56 }
57 
58 
59 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
60 
62 {}
63 
64 
65 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
66 
68 {
69  return phase1();
70 }
71 
72 
74 {
75  return phase2();
76 }
77 
78 
80 {
81  word namec(continuous().name());
82  namec[0] = toupper(namec[0]);
83  return dispersed().name() + "In" + namec;
84 }
85 
86 
88 {
89  if (!aspectRatio_)
90  {
92  << "Aspect ratio model not specified for " << *this << "."
93  << exit(FatalError);
94  }
95 
96  return aspectRatio_->E();
97 }
98 
99 
100 // ************************************************************************* //
static autoPtr< aspectRatioModel > New(const dictionary &dict, const phasePair &pair)
virtual word name() const
Pair name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
bool found(const Key &key) const
Same as contains()
Definition: HashTable.H:1354
phaseModel & phase2
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual tmp< volScalarField > E() const
Aspect ratio.
const uniformDimensionedVectorField & g
phaseModel & phase1
virtual ~orderedPhasePair()=default
Destructor.
orderedPhasePair(const multiphaseInter::phaseModel &from, const multiphaseInter::phaseModel &to)
Construct from two phases and gravity.
const word & name() const
Definition: phaseModel.H:166
virtual const phaseModel & continuous() const
Continuous phase.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual const phaseModel & dispersed() const
Dispersed phase.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:49