mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/hunt2/OpenFOAM/OpenFOAM-dev
This commit is contained in:
50
src/postProcessing/minMaxFields/IOminMaxFields.H
Normal file
50
src/postProcessing/minMaxFields/IOminMaxFields.H
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Typedef
|
||||||
|
Foam::IOminMaxFields
|
||||||
|
|
||||||
|
Description
|
||||||
|
Instance of the generic IOOutputFilter for minMaxFields.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef IOminMaxFields_H
|
||||||
|
#define IOminMaxFields_H
|
||||||
|
|
||||||
|
#include "minMaxFields.H"
|
||||||
|
#include "IOOutputFilter.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
typedef IOOutputFilter<minMaxFields> IOminMaxFields;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
4
src/postProcessing/minMaxFields/Make/files
Normal file
4
src/postProcessing/minMaxFields/Make/files
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
minMaxFields.C
|
||||||
|
minMaxFieldsFunctionObject.C
|
||||||
|
|
||||||
|
LIB = $(FOAM_LIBBIN)/libminMaxFields
|
||||||
8
src/postProcessing/minMaxFields/Make/options
Normal file
8
src/postProcessing/minMaxFields/Make/options
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude
|
||||||
|
|
||||||
|
LIB_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools
|
||||||
203
src/postProcessing/minMaxFields/minMaxFields.C
Normal file
203
src/postProcessing/minMaxFields/minMaxFields.C
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "minMaxFields.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(minMaxFields, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::minMaxFields::minMaxFields
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const objectRegistry& obr,
|
||||||
|
const dictionary& dict,
|
||||||
|
const bool loadFromFiles
|
||||||
|
)
|
||||||
|
:
|
||||||
|
name_(name),
|
||||||
|
obr_(obr),
|
||||||
|
active_(true),
|
||||||
|
log_(false),
|
||||||
|
fieldSet_(),
|
||||||
|
minMaxFieldsFilePtr_(NULL)
|
||||||
|
{
|
||||||
|
// Check if the available mesh is an fvMesh otherise deactivate
|
||||||
|
if (!isA<fvMesh>(obr_))
|
||||||
|
{
|
||||||
|
active_ = false;
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"minMaxFields::minMaxFields"
|
||||||
|
"(const objectRegistry& obr, const dictionary& dict)"
|
||||||
|
) << "No fvMesh available, deactivating."
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
read(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::minMaxFields::~minMaxFields()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::minMaxFields::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||||
|
|
||||||
|
dict.lookup("fields") >> fieldSet_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::minMaxFields::makeFile()
|
||||||
|
{
|
||||||
|
// Create the minMaxFields file if not already created
|
||||||
|
if (!minMaxFieldsFilePtr_.valid())
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "Creating minMaxFields file." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// File update
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
fileName minMaxFieldsDir;
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
// Put in undecomposed case (Note: gives problems for
|
||||||
|
// distributed data running)
|
||||||
|
minMaxFieldsDir =
|
||||||
|
obr_.time().path()/".."/name_/obr_.time().timeName();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
minMaxFieldsDir =
|
||||||
|
obr_.time().path()/name_/obr_.time().timeName();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create directory if does not exist.
|
||||||
|
mkDir(minMaxFieldsDir);
|
||||||
|
|
||||||
|
// Open new file at start up
|
||||||
|
minMaxFieldsFilePtr_.reset
|
||||||
|
(
|
||||||
|
new OFstream(minMaxFieldsDir/(type() + ".dat"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add headers to output data
|
||||||
|
writeFileHeader();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::minMaxFields::writeFileHeader()
|
||||||
|
{
|
||||||
|
if (minMaxFieldsFilePtr_.valid())
|
||||||
|
{
|
||||||
|
minMaxFieldsFilePtr_()
|
||||||
|
<< "# Time" << tab << "field" << tab << "min" << tab << "max"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::minMaxFields::execute()
|
||||||
|
{
|
||||||
|
// Do nothing - only valid on write
|
||||||
|
}
|
||||||
|
|
||||||
|
void Foam::minMaxFields::write()
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
// Create the minMaxFields file if not already created
|
||||||
|
makeFile();
|
||||||
|
|
||||||
|
forAll(fieldSet_, fieldI)
|
||||||
|
{
|
||||||
|
calcMinMaxFields<scalar>(fieldSet_[fieldI]);
|
||||||
|
calcMinMaxFields<vector>(fieldSet_[fieldI]);
|
||||||
|
calcMinMaxFields<sphericalTensor>(fieldSet_[fieldI]);
|
||||||
|
calcMinMaxFields<symmTensor>(fieldSet_[fieldI]);
|
||||||
|
calcMinMaxFields<tensor>(fieldSet_[fieldI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void Foam::minMaxFields::calcMinMaxFields<Foam::scalar>
|
||||||
|
(
|
||||||
|
const word& fieldName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (obr_.foundObject<volScalarField>(fieldName))
|
||||||
|
{
|
||||||
|
const scalarField& field = obr_.lookupObject<scalarField>(fieldName);
|
||||||
|
scalar minValue = min(field);
|
||||||
|
scalar maxValue = max(field);
|
||||||
|
|
||||||
|
reduce(minValue, minOp<scalar>());
|
||||||
|
reduce(maxValue, maxOp<scalar>());
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
minMaxFieldsFilePtr_() << obr_.time().value() << tab
|
||||||
|
<< fieldName << tab << minValue << tab << maxValue << endl;
|
||||||
|
|
||||||
|
if (log_)
|
||||||
|
{
|
||||||
|
Info<< "minMaxFields output:" << nl
|
||||||
|
<< " min(" << fieldName << ") = " << minValue << nl
|
||||||
|
<< " max(" << fieldName << ") = " << maxValue << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
182
src/postProcessing/minMaxFields/minMaxFields.H
Normal file
182
src/postProcessing/minMaxFields/minMaxFields.H
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::minMaxFields
|
||||||
|
|
||||||
|
Description
|
||||||
|
Calculates scalar minimim and maximum field values.
|
||||||
|
|
||||||
|
For variables with rank > 0, computes the magnitude of the min/max
|
||||||
|
values.
|
||||||
|
|
||||||
|
Data written to the file \<timeDir\>/minMaxFields.dat
|
||||||
|
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
minMaxFields.C
|
||||||
|
IOminMaxFields.H
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef minMaxFields_H
|
||||||
|
#define minMaxFields_H
|
||||||
|
|
||||||
|
#include "primitiveFieldsFwd.H"
|
||||||
|
#include "volFieldsFwd.H"
|
||||||
|
#include "labelHashSet.H"
|
||||||
|
#include "OFstream.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
#include "pointFieldFwd.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// Forward declaration of classes
|
||||||
|
class objectRegistry;
|
||||||
|
class dictionary;
|
||||||
|
class mapPolyMesh;
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class minMaxFields Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class minMaxFields
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Name of this set of forces,
|
||||||
|
// Also used as the name of the probes directory.
|
||||||
|
word name_;
|
||||||
|
|
||||||
|
const objectRegistry& obr_;
|
||||||
|
|
||||||
|
//- on/off switch
|
||||||
|
bool active_;
|
||||||
|
|
||||||
|
//- Switch to send output to Info as well as to file
|
||||||
|
Switch log_;
|
||||||
|
|
||||||
|
//- Patches to integrate forces over
|
||||||
|
wordList fieldSet_;
|
||||||
|
|
||||||
|
|
||||||
|
//- Forces/moment file ptr
|
||||||
|
autoPtr<OFstream> minMaxFieldsFilePtr_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- If the forces file has not been created create it
|
||||||
|
void makeFile();
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
minMaxFields(const minMaxFields&);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const minMaxFields&);
|
||||||
|
|
||||||
|
//- Output file header information
|
||||||
|
virtual void writeFileHeader();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("minMaxFields");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct for given objectRegistry and dictionary.
|
||||||
|
// Allow the possibility to load fields from files
|
||||||
|
minMaxFields
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const objectRegistry&,
|
||||||
|
const dictionary&,
|
||||||
|
const bool loadFromFiles = false
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
|
||||||
|
virtual ~minMaxFields();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Return name of the set of forces
|
||||||
|
virtual const word& name() const
|
||||||
|
{
|
||||||
|
return name_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Read the forces data
|
||||||
|
virtual void read(const dictionary&);
|
||||||
|
|
||||||
|
//- Execute
|
||||||
|
virtual void execute();
|
||||||
|
|
||||||
|
//- Calculate the field min/max
|
||||||
|
template<class Type>
|
||||||
|
void calcMinMaxFields(const word& fieldName);
|
||||||
|
|
||||||
|
//- Write the minMaxFields
|
||||||
|
virtual void write();
|
||||||
|
|
||||||
|
//- Update for changes of mesh
|
||||||
|
virtual void updateMesh(const mapPolyMesh&)
|
||||||
|
{}
|
||||||
|
|
||||||
|
//- Update for changes of mesh
|
||||||
|
virtual void movePoints(const pointField&)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Template specialisation for scalar fields
|
||||||
|
template<>
|
||||||
|
void minMaxFields::calcMinMaxFields<scalar>(const word& fieldName);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "minMaxFieldsTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
43
src/postProcessing/minMaxFields/minMaxFieldsFunctionObject.C
Normal file
43
src/postProcessing/minMaxFields/minMaxFieldsFunctionObject.C
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "minMaxFieldsFunctionObject.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineNamedTemplateTypeNameAndDebug(minMaxFieldsFunctionObject, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
functionObject,
|
||||||
|
minMaxFieldsFunctionObject,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
55
src/postProcessing/minMaxFields/minMaxFieldsFunctionObject.H
Normal file
55
src/postProcessing/minMaxFields/minMaxFieldsFunctionObject.H
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Typedef
|
||||||
|
Foam::minMaxFieldsFunctionObject
|
||||||
|
|
||||||
|
Description
|
||||||
|
FunctionObject wrapper around minMaxFields to allow them to be created via
|
||||||
|
the functions list within controlDict.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
minMaxFieldsFunctionObject.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef minMaxFieldsFunctionObject_H
|
||||||
|
#define minMaxFieldsFunctionObject_H
|
||||||
|
|
||||||
|
#include "minMaxFields.H"
|
||||||
|
#include "OutputFilterFunctionObject.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
typedef OutputFilterFunctionObject<minMaxFields>
|
||||||
|
minMaxFieldsFunctionObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
65
src/postProcessing/minMaxFields/minMaxFieldsTemplates.C
Normal file
65
src/postProcessing/minMaxFields/minMaxFieldsTemplates.C
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "minMaxFields.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::minMaxFields::calcMinMaxFields(const word& fieldName)
|
||||||
|
{
|
||||||
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
|
|
||||||
|
if (obr_.foundObject<fieldType>(fieldName))
|
||||||
|
{
|
||||||
|
const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
|
||||||
|
scalar minValue = min(mag(field)).value();
|
||||||
|
scalar maxValue = max(mag(field)).value();
|
||||||
|
|
||||||
|
reduce(minValue, minOp<scalar>());
|
||||||
|
reduce(maxValue, maxOp<scalar>());
|
||||||
|
|
||||||
|
if (Pstream::master())
|
||||||
|
{
|
||||||
|
minMaxFieldsFilePtr_() << obr_.time().value() << tab
|
||||||
|
<< fieldName << tab << minValue << tab << maxValue << endl;
|
||||||
|
|
||||||
|
if (log_)
|
||||||
|
{
|
||||||
|
Info<< "minMaxFields output:" << nl
|
||||||
|
<< " min(mag(" << fieldName << ")) = " << minValue << nl
|
||||||
|
<< " max(mag(" << fieldName << ")) = " << maxValue << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -157,10 +157,54 @@ LRR::LRR
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
R_(autoCreateR("R", mesh_)),
|
R_
|
||||||
k_(autoCreateK("k", mesh_)),
|
(
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
IOobject
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
(
|
||||||
|
"R",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateR("R", mesh_)
|
||||||
|
),
|
||||||
|
k_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
mut_.correctBoundaryConditions();
|
mut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -189,12 +189,44 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
|
|||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_
|
autoCreateR("R", mesh_)
|
||||||
),
|
),
|
||||||
|
k_
|
||||||
k_(autoCreateK("k", mesh_)),
|
(
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
IOobject
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
mut_.correctBoundaryConditions();
|
mut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -139,9 +139,42 @@ RNGkEpsilon::RNGkEpsilon
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
mut_.correctBoundaryConditions();
|
mut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -80,7 +80,8 @@ tmp<volScalarField> autoCreateMut
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mutHeader.headerOk())
|
if (mutHeader.headerOk())
|
||||||
@ -117,7 +118,8 @@ tmp<volScalarField> autoCreateMut
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("zero", dimDensity*dimArea/dimTime, 0.0),
|
dimensionedScalar("zero", dimDensity*dimArea/dimTime, 0.0),
|
||||||
|
|||||||
@ -50,8 +50,7 @@ autoCreateWallFunctionField
|
|||||||
"mut",
|
"mut",
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
@ -68,7 +67,8 @@ autoCreateWallFunctionField
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh
|
mesh
|
||||||
)
|
)
|
||||||
@ -118,7 +118,8 @@ autoCreateWallFunctionField
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensioned<Type>
|
dimensioned<Type>
|
||||||
|
|||||||
@ -119,9 +119,43 @@ kEpsilon::kEpsilon
|
|||||||
1.0
|
1.0
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
k_(autoCreateK("k", mesh_)),
|
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
k_
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
mut_.correctBoundaryConditions();
|
mut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -223,9 +223,42 @@ kOmegaSST::kOmegaSST
|
|||||||
|
|
||||||
y_(mesh_),
|
y_(mesh_),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
omega_(autoCreateOmega("omega", mesh_)),
|
(
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
omega_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"omega",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateOmega("omega", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
mut_ = a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_)))));
|
mut_ = a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(magSqr(symm(fvc::grad(U_)))));
|
||||||
mut_.correctBoundaryConditions();
|
mut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -152,9 +152,42 @@ realizableKE::realizableKE
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
mut_(autoCreateMut("mut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
mut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"mut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateMut("mut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
bound(k_, k0_);
|
bound(k_, k0_);
|
||||||
bound(epsilon_, epsilon0_);
|
bound(epsilon_, epsilon0_);
|
||||||
|
|||||||
@ -138,10 +138,54 @@ LRR::LRR
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
R_(autoCreateR("R", mesh_)),
|
R_
|
||||||
k_(autoCreateK("k", mesh_)),
|
(
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
IOobject
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
(
|
||||||
|
"R",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateR("R", mesh_)
|
||||||
|
),
|
||||||
|
k_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
nut_.correctBoundaryConditions();
|
nut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -167,10 +167,54 @@ LaunderGibsonRSTM::LaunderGibsonRSTM
|
|||||||
|
|
||||||
yr_(mesh_),
|
yr_(mesh_),
|
||||||
|
|
||||||
R_(autoCreateR("R", mesh_)),
|
R_
|
||||||
k_(autoCreateK("k", mesh_)),
|
(
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
IOobject
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
(
|
||||||
|
"R",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateR("R", mesh_)
|
||||||
|
),
|
||||||
|
k_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
nut_.correctBoundaryConditions();
|
nut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -147,8 +147,30 @@ LienCubicKE::LienCubicKE
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
|
||||||
gradU_(fvc::grad(U)),
|
gradU_(fvc::grad(U)),
|
||||||
eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))),
|
eta_(k_/epsilon_*sqrt(2.0*magSqr(0.5*(gradU_ + gradU_.T())))),
|
||||||
@ -165,7 +187,18 @@ LienCubicKE::LienCubicKE
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
nut_(autoCreateNut("nut", mesh_)),
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
),
|
||||||
|
|
||||||
nonlinearStress_
|
nonlinearStress_
|
||||||
(
|
(
|
||||||
|
|||||||
@ -119,9 +119,42 @@ RNGkEpsilon::RNGkEpsilon
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
nut_.correctBoundaryConditions();
|
nut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -80,7 +80,8 @@ tmp<volScalarField> autoCreateNut
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (nutHeader.headerOk())
|
if (nutHeader.headerOk())
|
||||||
@ -117,7 +118,8 @@ tmp<volScalarField> autoCreateNut
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("zero", dimArea/dimTime, 0.0),
|
dimensionedScalar("zero", dimArea/dimTime, 0.0),
|
||||||
|
|||||||
@ -50,8 +50,7 @@ autoCreateWallFunctionField
|
|||||||
"nut",
|
"nut",
|
||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ
|
||||||
IOobject::AUTO_WRITE
|
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||||
@ -68,7 +67,8 @@ autoCreateWallFunctionField
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh
|
mesh
|
||||||
)
|
)
|
||||||
@ -118,7 +118,8 @@ autoCreateWallFunctionField
|
|||||||
mesh.time().timeName(),
|
mesh.time().timeName(),
|
||||||
mesh,
|
mesh,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
),
|
),
|
||||||
mesh,
|
mesh,
|
||||||
dimensioned<Type>
|
dimensioned<Type>
|
||||||
|
|||||||
@ -93,9 +93,42 @@ kEpsilon::kEpsilon
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
nut_ = Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
|
||||||
nut_.correctBoundaryConditions();
|
nut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -104,9 +104,42 @@ kOmega::kOmega
|
|||||||
omega0_("omega0", dimless/dimTime, SMALL),
|
omega0_("omega0", dimless/dimTime, SMALL),
|
||||||
omegaSmall_("omegaSmall", dimless/dimTime, SMALL),
|
omegaSmall_("omegaSmall", dimless/dimTime, SMALL),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
omega_(autoCreateOmega("omega", mesh_)),
|
(
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
omega_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"omega",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateOmega("omega", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ = k_/(omega_ + omegaSmall_);
|
nut_ = k_/(omega_ + omegaSmall_);
|
||||||
nut_.correctBoundaryConditions();
|
nut_.correctBoundaryConditions();
|
||||||
|
|||||||
@ -213,9 +213,42 @@ kOmegaSST::kOmegaSST
|
|||||||
|
|
||||||
y_(mesh_),
|
y_(mesh_),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
omega_(autoCreateOmega("omega", mesh_)),
|
(
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
omega_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"omega",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateOmega("omega", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
nut_ =
|
nut_ =
|
||||||
a1_*k_
|
a1_*k_
|
||||||
|
|||||||
@ -142,9 +142,42 @@ realizableKE::realizableKE
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
k_(autoCreateK("k", mesh_)),
|
k_
|
||||||
epsilon_(autoCreateEpsilon("epsilon", mesh_)),
|
(
|
||||||
nut_(autoCreateNut("nut", mesh_))
|
IOobject
|
||||||
|
(
|
||||||
|
"k",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateK("k", mesh_)
|
||||||
|
),
|
||||||
|
epsilon_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"epsilon",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateEpsilon("epsilon", mesh_)
|
||||||
|
),
|
||||||
|
nut_
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"nut",
|
||||||
|
runTime_.timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
autoCreateNut("nut", mesh_)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
bound(k_, k0_);
|
bound(k_, k0_);
|
||||||
bound(epsilon_, epsilon0_);
|
bound(epsilon_, epsilon0_);
|
||||||
|
|||||||
Reference in New Issue
Block a user