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 tmp<fvScalarMatrix>();
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);
102 
103  return Y_;
104 }
105 
106 
107 template<class BasePhaseModel>
110 {
111  // Y_ has never been set, so we are returning an empty list
112 
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 // ************************************************************************* //
Foam::PurePhaseModel::PurePhaseModel
PurePhaseModel(const phaseSystem &fluid, const word &phaseName)
Definition: PurePhaseModel.C:36
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::PurePhaseModel::YRef
virtual PtrList< volScalarField > & YRef()
Access the species mass fractions.
Definition: PurePhaseModel.C:97
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
Foam::PurePhaseModel::Y
virtual const PtrList< volScalarField > & Y() const
Return the species mass fractions.
Definition: PurePhaseModel.C:71
Foam::PurePhaseModel::~PurePhaseModel
virtual ~PurePhaseModel()=default
Destructor.
Definition: PurePhaseModel.C:48
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::FatalError
error FatalError
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
PurePhaseModel.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::PurePhaseModel::pure
virtual bool pure() const
Return whether the phase is pure (i.e., not multi-component)
Definition: PurePhaseModel.C:55
Foam::PurePhaseModel::YiEqn
virtual tmp< fvScalarMatrix > YiEqn(volScalarField &Yi)
Return the species fraction equation.
Definition: PurePhaseModel.C:63
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:63
Foam::PurePhaseModel::YActiveRef
virtual UPtrList< volScalarField > & YActiveRef()
Access the active species mass fractions.
Definition: PurePhaseModel.C:119
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::PurePhaseModel::YActive
virtual const UPtrList< volScalarField > & YActive() const
Return the active species mass fractions.
Definition: PurePhaseModel.C:109