mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
functionObjects::XiReactionRate: Writes the turbulent flame-speed and reaction-rate volScalarFields for the Xi-based combustion models
Replaces the obsolete and 'wdot' utility.
This commit is contained in:
@ -57,4 +57,6 @@ wallShearStress/wallShearStress.C
|
||||
writeCellCentres/writeCellCentres.C
|
||||
writeCellVolumes/writeCellVolumes.C
|
||||
|
||||
XiReactionRate/XiReactionRate.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects
|
||||
|
||||
119
src/functionObjects/field/XiReactionRate/XiReactionRate.C
Normal file
119
src/functionObjects/field/XiReactionRate/XiReactionRate.C
Normal file
@ -0,0 +1,119 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 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 "XiReactionRate.H"
|
||||
#include "volFields.H"
|
||||
#include "fvcGrad.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
defineTypeNameAndDebug(XiReactionRate, 0);
|
||||
addToRunTimeSelectionTable(functionObject, XiReactionRate, dictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::XiReactionRate::XiReactionRate
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::XiReactionRate::~XiReactionRate()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::XiReactionRate::execute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::XiReactionRate::write()
|
||||
{
|
||||
const volScalarField& b =
|
||||
mesh_.lookupObject<volScalarField>("b");
|
||||
|
||||
const volScalarField& Su =
|
||||
mesh_.lookupObject<volScalarField>("Su");
|
||||
|
||||
const volScalarField& Xi =
|
||||
mesh_.lookupObject<volScalarField>("Xi");
|
||||
|
||||
volScalarField St
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"St",
|
||||
time_.timeName(),
|
||||
mesh_
|
||||
),
|
||||
Xi*Su
|
||||
);
|
||||
|
||||
Log << " Writing turbulent flame-speed field " << St.name()
|
||||
<< " to " << time_.timeName() << endl;
|
||||
|
||||
St.write();
|
||||
|
||||
volScalarField wdot
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"wdot",
|
||||
time_.timeName(),
|
||||
mesh_
|
||||
),
|
||||
St*mag(fvc::grad(b))
|
||||
);
|
||||
|
||||
Log << " Writing reaction-rate field " << wdot.name()
|
||||
<< " to " << time_.timeName() << endl;
|
||||
|
||||
wdot.write();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
127
src/functionObjects/field/XiReactionRate/XiReactionRate.H
Normal file
127
src/functionObjects/field/XiReactionRate/XiReactionRate.H
Normal file
@ -0,0 +1,127 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 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::XiReactionRate
|
||||
|
||||
Group
|
||||
grpFieldFunctionObjects
|
||||
|
||||
Description
|
||||
This function object writes the turbulent flame-speed and reaction-rate
|
||||
volScalarFields for the Xi-based combustion models.
|
||||
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
XiReactionRate
|
||||
{
|
||||
type XiReactionRate;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type name: XiReactionRate | yes |
|
||||
\endtable
|
||||
|
||||
See also
|
||||
Foam::functionObjects::fvMeshFunctionObject
|
||||
|
||||
SourceFiles
|
||||
XiReactionRate.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjects_XiReactionRate_H
|
||||
#define functionObjects_XiReactionRate_H
|
||||
|
||||
#include "fvMeshFunctionObject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class XiReactionRate Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class XiReactionRate
|
||||
:
|
||||
public fvMeshFunctionObject
|
||||
{
|
||||
// Private member functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
XiReactionRate(const XiReactionRate&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const XiReactionRate&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("XiReactionRate");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from Time and dictionary
|
||||
XiReactionRate
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~XiReactionRate();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Do nothing
|
||||
virtual bool execute();
|
||||
|
||||
//- Write the cell-centre fields
|
||||
virtual bool write();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace functionObjects
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user