mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +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:
@ -1,3 +0,0 @@
|
|||||||
wdot.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/wdot
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lgenericPatchFields \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools
|
|
||||||
@ -1,123 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-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/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
wdot
|
|
||||||
|
|
||||||
Description
|
|
||||||
Calculates and writes wdot for each time.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
timeSelector::addOptions();
|
|
||||||
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
|
||||||
|
|
||||||
#include "createMesh.H"
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
|
||||||
{
|
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
|
||||||
|
|
||||||
mesh.readUpdate();
|
|
||||||
|
|
||||||
volScalarField mgb
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"mgb",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField Su
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Su",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField Xi
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"Xi",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
volScalarField St
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"St",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
Xi*Su
|
|
||||||
);
|
|
||||||
|
|
||||||
St.write();
|
|
||||||
|
|
||||||
volScalarField wdot
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"wdot",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ
|
|
||||||
),
|
|
||||||
St*mgb
|
|
||||||
);
|
|
||||||
|
|
||||||
wdot.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
22
etc/caseDicts/postProcessing/fields/XiReactionRate
Normal file
22
etc/caseDicts/postProcessing/fields/XiReactionRate
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Web: www.OpenFOAM.org
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Description
|
||||||
|
Writes the turbulent flame-speed and reaction-rate volScalarFields for the
|
||||||
|
Xi-based combustion models.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
type XiReactionRate;
|
||||||
|
libs ("libfieldFunctionObjects.so");
|
||||||
|
|
||||||
|
fields (b Xi Su);
|
||||||
|
|
||||||
|
executeControl writeTime;
|
||||||
|
writeControl writeTime;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -57,4 +57,6 @@ wallShearStress/wallShearStress.C
|
|||||||
writeCellCentres/writeCellCentres.C
|
writeCellCentres/writeCellCentres.C
|
||||||
writeCellVolumes/writeCellVolumes.C
|
writeCellVolumes/writeCellVolumes.C
|
||||||
|
|
||||||
|
XiReactionRate/XiReactionRate.C
|
||||||
|
|
||||||
LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects
|
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