Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
combustionModels: Added Qdot function object
This function object writes out the heat release rate field for a combustion model. This is useful for solvers where combustion is optional, and which do not therefore write out the heat release rate by default; e.g., chtMultiRegionFoam and reactingTwoPhaseEulerFoam.
- Loading branch information
Will Bainbridge
committed
Jan 24, 2019
1 parent
a085029
commit dc25f10
Showing
7 changed files
with
252 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation | ||
\\/ M anipulation | | ||
------------------------------------------------------------------------------- | ||
License | ||
This file is part of OpenFOAM. | ||
OpenFOAM is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#include "Qdot.H" | ||
#include "combustionModel.H" | ||
#include "volFields.H" | ||
#include "addToRunTimeSelectionTable.H" | ||
|
||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
namespace functionObjects | ||
{ | ||
defineTypeNameAndDebug(Qdot, 0); | ||
|
||
addToRunTimeSelectionTable | ||
( | ||
functionObject, | ||
Qdot, | ||
dictionary | ||
); | ||
} | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | ||
|
||
Foam::functionObjects::Qdot::Qdot | ||
( | ||
const word& name, | ||
const Time& runTime, | ||
const dictionary& dict | ||
) | ||
: | ||
fvMeshFunctionObject(name, runTime, dict), | ||
writeLocalObjects(obr_, false), | ||
phaseName_(word::null) | ||
{ | ||
read(dict); | ||
resetLocalObjectName(type()); | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // | ||
|
||
Foam::functionObjects::Qdot::~Qdot() | ||
{} | ||
|
||
|
||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | ||
|
||
bool Foam::functionObjects::Qdot::read | ||
( | ||
const dictionary& dict | ||
) | ||
{ | ||
fvMeshFunctionObject::read(dict); | ||
writeLocalObjects::read(dict); | ||
|
||
phaseName_ = dict.lookupOrDefault<word>("phase", word::null); | ||
|
||
return true; | ||
} | ||
|
||
|
||
bool Foam::functionObjects::Qdot::execute() | ||
{ | ||
word fieldName(IOobject::groupName(type(), phaseName_)); | ||
|
||
const word modelName | ||
( | ||
IOobject::groupName | ||
( | ||
combustionModel::combustionPropertiesName, | ||
phaseName_ | ||
) | ||
); | ||
|
||
return | ||
store | ||
( | ||
fieldName, | ||
mesh_.lookupObject<combustionModel>(modelName).Qdot() | ||
); | ||
} | ||
|
||
|
||
bool Foam::functionObjects::Qdot::write() | ||
{ | ||
return writeLocalObjects::write(); | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Copyright (C) 2019 OpenFOAM Foundation | ||
\\/ M anipulation | | ||
------------------------------------------------------------------------------- | ||
License | ||
This file is part of OpenFOAM. | ||
OpenFOAM is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | ||
Class | ||
Foam::functionObjects::Qdot | ||
Description | ||
Calculates and outputs the heat release rate for the current combustion | ||
model. | ||
SourceFiles | ||
Qdot.C | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#ifndef functionObjects_Qdot_H | ||
#define functionObjects_Qdot_H | ||
|
||
#include "fvMeshFunctionObject.H" | ||
#include "writeLocalObjects.H" | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
namespace functionObjects | ||
{ | ||
|
||
/*---------------------------------------------------------------------------*\ | ||
Class Qdot Declaration | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
class Qdot | ||
: | ||
public fvMeshFunctionObject, | ||
public writeLocalObjects | ||
{ | ||
private: | ||
|
||
// Private data | ||
|
||
//- The name of the phase | ||
word phaseName_; | ||
|
||
|
||
public: | ||
|
||
//- Runtime type information | ||
TypeName("Qdot"); | ||
|
||
|
||
// Constructors | ||
|
||
//- Construct from Time and dictionary | ||
Qdot | ||
( | ||
const word& name, | ||
const Time& runTime, | ||
const dictionary& dict | ||
); | ||
|
||
|
||
//- Destructor | ||
virtual ~Qdot(); | ||
|
||
|
||
// Member Functions | ||
|
||
//- Read the data | ||
virtual bool read(const dictionary&); | ||
|
||
//- Calculate the Qdot field | ||
virtual bool execute(); | ||
|
||
//- Do nothing | ||
virtual bool write(); | ||
}; | ||
|
||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
} // End namespace functionObjects | ||
} // End namespace Foam | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
#endif | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tutorials/heatTransfer/chtMultiRegionFoam/reverseBurner/system/Qdot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Version: dev | ||
\\/ M anipulation | | ||
------------------------------------------------------------------------------- | ||
Description | ||
Calculates the heat release rate Qdot, outputting the data as a Qdot field. | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#includeEtc "caseDicts/postProcessing/combustion/Qdot.cfg" | ||
|
||
region gas; | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters