Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
28#include "PurePhaseModel.H"
29#include "phaseSystem.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<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
47template<class BasePhaseModel>
52// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53
54template<class BasePhaseModel>
57 return true;
58}
59
60
61template<class BasePhaseModel>
64{
66 << "Cannot construct a species fraction equation for a pure phase"
67 << exit(FatalError);
68
69 return nullptr;
70}
71
72
73template<class BasePhaseModel>
76{
77 // Y_ has never been set, so we are returning an empty list
79 return Y_;
80}
81
82
83template<class BasePhaseModel>
86{
88 << "Cannot get a species fraction by name from a pure phase"
89 << exit(FatalError);
91 return volScalarField::null();
92}
93
94
95template<class BasePhaseModel>
98{
100 << "Cannot access the species fractions of for a pure phase"
101 << exit(FatalError);
103 return Y_;
104}
105
106
107template<class BasePhaseModel>
110{
111 // Y_ has never been set, so we are returning an empty list
113 return Y_;
114}
115
116
117template<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
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
PurePhaseModel(const multiphaseInterSystem &fluid, const word &phaseName)
virtual ~PurePhaseModel()=default
Destructor.
virtual const UPtrList< volScalarField > & YActive() const
Return the active species mass fractions.
virtual PtrList< volScalarField > & YRef()
Access the species mass fractions.
virtual tmp< fvScalarMatrix > YiEqn(volScalarField &Yi)
Return the species fraction equation.
virtual bool pure() const
Return whether the phase is pure (i.e., not multi-component).
PtrList< volScalarField > Y_
Empty mass fraction field list.
virtual UPtrList< volScalarField > & YActiveRef()
Access the active species mass fractions.
virtual const PtrList< volScalarField > & Y() const
Return the species mass fractions.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Class to represent a system of phases and model interfacial transfers between them.
Definition phaseSystem.H:72
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
GeometricField< scalar, fvPatchField, volMesh > volScalarField
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125