bXiQdot.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 "bXiQdot.H"
27 #include "ubRhoThermo.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace functionObjects
37 {
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 (
48  const word& name,
49  const Time& runTime,
50  const dictionary& dict
51 )
52 :
53  fvMeshFunctionObject(name, runTime, dict),
54  writeLocalObjects(obr_)
55 {
56  read(dict);
58 
59  // Request caching of the b-equation source
60  obr_.cacheTemporary("bSource");
61 }
62 
63 
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65 
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
73 {
76 
77  return true;
78 }
79 
80 
82 {
83  const word uThermoName
84  (
86  (
89  )
90  );
91 
92  const word bThermoName
93  (
95  (
98  )
99  );
100 
101  if
102  (
103  mesh_.foundObject<uRhoMulticomponentThermo>(uThermoName)
104  && mesh_.foundObject<bRhoMulticomponentThermo>(bThermoName)
105  )
106  {
107  const uRhoMulticomponentThermo& uThermo =
108  mesh_.lookupObject<uRhoMulticomponentThermo>(uThermoName);
109 
110  const bRhoMulticomponentThermo& bThermo =
111  mesh_.lookupObject<bRhoMulticomponentThermo>(bThermoName);
112 
113  const volScalarField::Internal& bSource
114  (
115  mesh_.lookupObject<volScalarField::Internal>("bSource")
116  );
117 
118  store
119  (
120  typeName,
121  bSource*(bThermo.hf()()() - uThermo.hf()()())
122  );
123 
124  return true;
125  }
126  else
127  {
129  << "Unable to find "
130  "uRhoMulticomponentThermo or bRhoMulticomponentThermo "
131  "in the database"
132  << exit(FatalError);
133 
134  return false;
135  }
136 }
137 
138 
140 {
141  return writeLocalObjects::write();
142 }
143 
144 
145 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static word groupName(Name name, const word &group)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Base-class for combustion fluid thermodynamic properties based on compressibility.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base-class for Time/database functionObjects.
virtual bool read(const dictionary &)
Read and set the functionObject if its data have changed.
Calculates and caches the heat release rate bXiQdot of the Weller b-Xi combustion model.
Definition: bXiQdot.H:88
bXiQdot(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: bXiQdot.C:47
virtual ~bXiQdot()
Destructor.
Definition: bXiQdot.C:66
virtual bool execute()
Do nothing.
Definition: bXiQdot.C:81
virtual bool write()
Write the cell-centre fields.
Definition: bXiQdot.C:139
virtual bool read(const dictionary &)
Read the controls.
Definition: bXiQdot.C:72
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const objectRegistry & obr_
Reference to the objectRegistry.
FunctionObject base class for managing a list of objects on behalf of the inheriting function object,...
void resetLocalObjectName(const word &name)
Reset the list of local object names from a single word.
virtual bool read(const dictionary &)
Read the list of objects to be written.
virtual bool write()
Write function.
void cacheTemporary(const word &name) const
Add the given name to the cacheTemporaryObjects set.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Base-class for combustion fluid thermodynamic properties based on compressibility.
virtual tmp< volScalarField > hf() const =0
Standard enthalpy of formation [J/kg].
static const word burntPhaseName
Definition: ubRhoThermo.H:79
static const word unburntPhaseName
Definition: ubRhoThermo.H:78
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
defineTypeNameAndDebug(fvMeshFunctionObject, 0)
addToRunTimeSelectionTable(functionObject, fvModel, dictionary)
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
error FatalError
dictionary dict