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 // ************************************************************************* //
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:54
Foam::phasePair
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:53
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::orderedPhasePair::name
virtual word name() const
Pair name.
Definition: orderedPhasePair.C:56
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::orderedPhasePair::continuous
virtual const phaseModel & continuous() const
Continuous phase.
Definition: orderedPhasePair.C:62
Foam::orderedPhasePair::E
virtual tmp< volScalarField > E() const
Aspect ratio.
Definition: orderedPhasePair.C:86
phase2
phaseModel & phase2
Definition: setRegionFluidFields.H:6
Foam::FatalError
error FatalError
orderedPhasePair.H
Foam::dimensioned< vector >
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam::orderedPhasePair::~orderedPhasePair
virtual ~orderedPhasePair()=default
Destructor.
Definition: orderedPhasePair.C:50
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::HashTable< scalar, phasePairKey, phasePairKey::hash >
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::phaseModel::name
const word & name() const
Definition: phaseModel.H:140
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::orderedPhasePair::dispersed
virtual const phaseModel & dispersed() const
Dispersed phase.
Definition: orderedPhasePair.C:56
Foam::orderedPhasePair::orderedPhasePair
orderedPhasePair(const phaseModel &from, const phaseModel &to)
Construct from two phases and gravity.
Definition: orderedPhasePair.C:33
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
phase1
phaseModel & phase1
Definition: setRegionFluidFields.H:5
Foam::HashTable::found
bool found(const Key &key) const
Return true if hashed entry is found in table.
Definition: HashTableI.H:100