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-------------------------------------------------------------------------------
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 "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// ************************************************************************* //
const uniformDimensionedVectorField & g
phaseModel & phase1
phaseModel & phase2
bool found(const Key &key) const
Return true if hashed entry is found in table.
Definition: HashTableI.H:100
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
virtual word name() const
Pair name.
virtual ~orderedPhasePair()=default
Destructor.
virtual const phaseModel & continuous() const
Continuous phase.
virtual const phaseModel & dispersed() const
Dispersed phase.
virtual tmp< volScalarField > E() const
Aspect ratio.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:61
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
Definition: phasePair.H:56
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
error FatalError
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130