PurePhaseModel.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) 2015-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "PurePhaseModel.H"
29 #include "phaseSystem.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class BasePhaseModel>
35 (
36  const phaseSystem& fluid,
37  const word& phaseName,
38  const label index
39 )
40 :
41  BasePhaseModel(fluid, phaseName, index)
42 {}
43 
44 
45 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
46 
47 template<class BasePhaseModel>
49 {}
50 
51 
52 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53 
54 template<class BasePhaseModel>
56 {
57  return true;
58 }
59 
60 
61 template<class BasePhaseModel>
64 {
66  << "Cannot construct a species fraction equation for a pure phase"
67  << exit(FatalError);
68 
69  return nullptr;
70 }
71 
72 
73 template<class BasePhaseModel>
76 {
77  // Y_ has never been set, so we are returning an empty list
78 
79  return Y_;
80 }
81 
82 
83 template<class BasePhaseModel>
86 {
88  << "Cannot get a species fraction by name from a pure phase"
89  << exit(FatalError);
90 
91  return NullObjectRef<volScalarField>();
92 }
93 
94 
95 template<class BasePhaseModel>
98 {
100  << "Cannot access the species fractions of for a pure phase"
101  << exit(FatalError);
103  return Y_;
104 }
105 
106 
107 template<class BasePhaseModel>
110 {
111  // Y_ has never been set, so we are returning an empty list
113  return Y_;
114 }
115 
116 
117 template<class BasePhaseModel>
120 {
122  << "Cannot access the species fractions of for a pure phase"
123  << exit(FatalError);
124 
125  return Y_;
126 }
127 
128 
129 // ************************************************************************* //
twoPhaseSystem & fluid
virtual PtrList< volScalarField > & YRef()
Access the species mass fractions.
PurePhaseModel(const multiphaseInterSystem &fluid, const word &phaseName)
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
virtual const UPtrList< volScalarField > & YActive() const
Return the active species mass fractions.
virtual const PtrList< volScalarField > & Y() const
Return the species mass fractions.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:69
A class for handling words, derived from Foam::string.
Definition: word.H:63
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: HashTable.H:106
virtual ~PurePhaseModel()=default
Destructor.
virtual bool pure() const
Return whether the phase is pure (i.e., not multi-component)
virtual tmp< fvScalarMatrix > YiEqn(volScalarField &Yi)
Return the species fraction equation.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual UPtrList< volScalarField > & YActiveRef()
Access the active species mass fractions.