ubMixtureMap.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "ubMixtureMap.H"
27 #include "uMixture.H"
28 #include "bMixture.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 (
43  const uRhoMulticomponentThermo& uThermo,
44  const bRhoMulticomponentThermo& bThermo
45 )
46 :
47  uThermo_(uThermo),
48  bThermo_(bThermo)
49 {}
50 
51 
52 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
53 
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
59 
61 (
62  const uRhoMulticomponentThermo& uThermo,
63  const bRhoMulticomponentThermo& bThermo
64 )
65 {
66  const word mapType
67  (
69  (
70  "ubMixtureMap",
71  dynamicCast<const uMixture&>(uThermo).mixtureType()
72  + dynamicCast<const bMixture&>(bThermo).mixtureType()
73  )
74  );
75 
76  thermoConstructorTable::iterator cstrIter =
77  thermoConstructorTablePtr_->find(mapType);
78 
79  if (cstrIter == thermoConstructorTablePtr_->end())
80  {
82  << "Unknown ubMixtureMap " << mapType << nl << nl
83  << "Valid ubMixtureMaps are : " << endl
84  << thermoConstructorTablePtr_->sortedToc()
85  << exit(FatalError);
86  }
87 
88  return autoPtr<ubMixtureMap>(cstrIter()(uThermo, bThermo));
89 }
90 
91 
92 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
93 
94 
95 // ************************************************************************* //
Base-class for combustion fluid thermodynamic properties based on compressibility.
virtual const IOdictionary & properties() const =0
Properties dictionary.
T lookupOrDefault(const word &, const T &) const
Find and return a T, if not found return the given default.
Base-class for combustion fluid thermodynamic properties based on compressibility.
Base class for unburnt/burnt gas composition mapping.
Definition: ubMixtureMap.H:51
ubMixtureMap(const uRhoMulticomponentThermo &uThermo, const bRhoMulticomponentThermo &bThermo)
Construct from components.
Definition: ubMixtureMap.C:42
virtual ~ubMixtureMap()
Destructor.
Definition: ubMixtureMap.C:54
static autoPtr< ubMixtureMap > New(const uRhoMulticomponentThermo &uThermo, const bRhoMulticomponentThermo &bThermo)
Return a reference to the selected XiEq model.
Definition: ubMixtureMap.C:61
A class for handling words, derived from string.
Definition: word.H:63
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:288
defineRunTimeSelectionTable(fvConstraint, dictionary)
error FatalError
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
static const char nl
Definition: Ostream.H:297
fluidMulticomponentThermo & thermo
Definition: createFields.H:15