Skip to content
Snippets Groups Projects
Commit 850013e7 authored by Henry Weller's avatar Henry Weller
Browse files

functionObjects::XiReactionRate: Writes the turbulent flame-speed and...

functionObjects::XiReactionRate: Writes the turbulent flame-speed and reaction-rate volScalarFields for the Xi-based combustion models

Replaces the obsolete and 'wdot' utility.
parent 28f049e9
Branches
Tags
No related merge requests found
wdot.C
EXE = $(FOAM_APPBIN)/wdot
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lgenericPatchFields \
-lfiniteVolume \
-lmeshTools
/*--------------------------------*- 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
writeCellVolumes/writeCellVolumes.C
XiReactionRate/XiReactionRate.C
LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -21,102 +21,98 @@ License
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 "XiReactionRate.H"
#include "volFields.H"
#include "fvcGrad.H"
#include "addToRunTimeSelectionTable.H"
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
#include "fvCFD.H"
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(XiReactionRate, 0);
addToRunTimeSelectionTable(functionObject, XiReactionRate, dictionary);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
Foam::functionObjects::XiReactionRate::XiReactionRate
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fvMeshFunctionObject(name, runTime, dict)
{
timeSelector::addOptions();
read(dict);
}
#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
#include "createMesh.H"
Foam::functionObjects::XiReactionRate::~XiReactionRate()
{}
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
mesh.readUpdate();
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
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
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
(
IOobject
(
"St",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
Xi*Su
);
St.write();
volScalarField wdot
"St",
time_.timeName(),
mesh_
),
Xi*Su
);
Log << " Writing turbulent flame-speed field " << St.name()
<< " to " << time_.timeName() << endl;
St.write();
volScalarField wdot
(
IOobject
(
IOobject
(
"wdot",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
St*mgb
);
wdot.write();
}
return 0;
"wdot",
time_.timeName(),
mesh_
),
St*mag(fvc::grad(b))
);
Log << " Writing reaction-rate field " << wdot.name()
<< " to " << time_.timeName() << endl;
wdot.write();
return true;
}
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment