mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'merge-foundation' of develop.openfoam.com:Development/OpenFOAM-plus into merge-foundation
This commit is contained in:
@ -110,6 +110,7 @@ Foam::functionObjects::DESModelRegions::~DESModelRegions()
|
||||
|
||||
bool Foam::functionObjects::DESModelRegions::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
|
||||
dict.readIfPresent("resultName", resultName_);
|
||||
|
||||
@ -144,6 +144,7 @@ Foam::functionObjects::PecletNo::PecletNo
|
||||
rhoName_("rho")
|
||||
{
|
||||
setResultName("Pe", "phi");
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -63,6 +63,12 @@ Foam::functionObjects::XiReactionRate::~XiReactionRate()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::XiReactionRate::read(const dictionary& dict)
|
||||
{
|
||||
return fvMeshFunctionObject::read(dict);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::XiReactionRate::execute()
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -107,10 +107,13 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read the reaction rate data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Do nothing
|
||||
virtual bool execute();
|
||||
|
||||
//- Write the cell-centre fields
|
||||
//- Write the reaction rate fields
|
||||
virtual bool write();
|
||||
};
|
||||
|
||||
|
||||
@ -63,9 +63,7 @@ Foam::functionObjects::components::components
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -27,7 +27,6 @@ License
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "FieldFunctions.H"
|
||||
#include "steadyStateDdtScheme.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
@ -121,7 +120,78 @@ int Foam::functionObjects::ddt2::process(const word& fieldName)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::ddt2::process()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::ddt2
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
results_(),
|
||||
mag_(dict.lookupOrDefault<Switch>("mag", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::~ddt2()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
if (word(mesh_.ddtScheme("default")) == "steadyState")
|
||||
{
|
||||
WarningInFunction
|
||||
<< typeName << " function object not appropriate for steady-state"
|
||||
<< endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
(
|
||||
"result",
|
||||
( mag_ ? "mag(ddt(@@))" : "magSqr(ddt(@@))" )
|
||||
);
|
||||
|
||||
if (checkFormatName(resultName_))
|
||||
{
|
||||
blacklist_.set
|
||||
(
|
||||
string::quotemeta<regExp>
|
||||
(
|
||||
resultName_
|
||||
).replace("@@", "(.+)")
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
blacklist_.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::execute()
|
||||
{
|
||||
results_.clear();
|
||||
|
||||
@ -163,80 +233,6 @@ void Foam::functionObjects::ddt2::process()
|
||||
WarningInFunction
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::ddt2
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
results_(),
|
||||
mag_(dict.lookupOrDefault<Switch>("mag", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::~ddt2()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
{
|
||||
if (word(mesh_.ddtScheme("default")) == "steadyState")
|
||||
{
|
||||
WarningInFunction
|
||||
<< typeName << " function object not appropriate for steady-state"
|
||||
<< endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
(
|
||||
"result",
|
||||
( mag_ ? "mag(ddt(@@))" : "magSqr(ddt(@@))" )
|
||||
);
|
||||
|
||||
if (checkFormatName(resultName_))
|
||||
{
|
||||
blacklist_.set
|
||||
(
|
||||
string::quotemeta<regExp>
|
||||
(
|
||||
resultName_
|
||||
).replace("@@", "(.+)")
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
blacklist_.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::execute()
|
||||
{
|
||||
results_.clear();
|
||||
process();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -244,9 +240,13 @@ bool Foam::functionObjects::ddt2::execute()
|
||||
|
||||
bool Foam::functionObjects::ddt2::write()
|
||||
{
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
}
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
|
||||
forAll(outputList, i)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
@ -255,8 +255,7 @@ bool Foam::functionObjects::ddt2::write()
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
Log << type() << " " << name()
|
||||
<< " write: writing field " << fieldName << endl;
|
||||
Log << " " << fieldName << endl;
|
||||
|
||||
io.write();
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
ddt2.C
|
||||
IOddt2.H
|
||||
ddt2Templates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -137,9 +137,6 @@ class ddt2
|
||||
//- Process by trying to apply for various volume field types.
|
||||
int process(const word& inputName);
|
||||
|
||||
//- Calculate the ddt2 fields
|
||||
void process();
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
ddt2(const ddt2&) = delete;
|
||||
@ -171,7 +168,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return name of the ddt2 function object
|
||||
//- Read the ddt2 specification
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Calculate the ddt2 fields
|
||||
|
||||
@ -27,6 +27,8 @@ License
|
||||
#include "dimensionedType.H"
|
||||
#include "fvcDdt.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class FieldType>
|
||||
int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
{
|
||||
@ -76,10 +78,8 @@ int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
store(outputName, tddt2);
|
||||
}
|
||||
|
||||
volScalarField& output = const_cast<volScalarField&>
|
||||
(
|
||||
lookupObject<volScalarField>(outputName)
|
||||
);
|
||||
volScalarField& output =
|
||||
const_cast<volScalarField&>(lookupObject<volScalarField>(outputName));
|
||||
|
||||
if (mag_)
|
||||
{
|
||||
@ -91,7 +91,7 @@ int Foam::functionObjects::ddt2::apply(const word& inputName, int& state)
|
||||
}
|
||||
|
||||
// Could add additional statistics here
|
||||
Log << type() << " " << name()
|
||||
Log << type() << ' ' << name()
|
||||
<< " field " << outputName
|
||||
<< " average: " << gAverage(output) << endl;
|
||||
|
||||
|
||||
@ -854,6 +854,8 @@ bool Foam::functionObjects::externalCoupled::end()
|
||||
|
||||
bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
dict.readIfPresent("enabled", enabled_);
|
||||
|
||||
if (!enabled_)
|
||||
|
||||
@ -107,11 +107,11 @@ public:
|
||||
//- Operation type enumeration
|
||||
enum operationType
|
||||
{
|
||||
opAdd, //< Add
|
||||
opSubtract, //< Subtract
|
||||
opMin, //< Minimum
|
||||
opMax, //< Maximum
|
||||
opAverage //< Average
|
||||
opAdd, //!< Add
|
||||
opSubtract, //!< Subtract
|
||||
opMin, //!< Minimum
|
||||
opMax, //!< Maximum
|
||||
opAverage //!< Average
|
||||
};
|
||||
|
||||
//- Operation type names
|
||||
|
||||
@ -199,21 +199,21 @@ public:
|
||||
//- Operation type enumeration
|
||||
enum operationType
|
||||
{
|
||||
opNone, //< None
|
||||
opSum, //< Sum
|
||||
opSumMag, //< Magnitude of sum
|
||||
opSumDirection, //< Sum in a given direction
|
||||
opSumDirectionBalance, //< Sum in a given direction for multiple
|
||||
opAverage, //< Average
|
||||
opWeightedAverage, //< Weighted average
|
||||
opAreaAverage, //< Area average
|
||||
opWeightedAreaAverage, //< Weighted area average
|
||||
opAreaIntegrate, //< Area integral
|
||||
opMin, //< Minimum
|
||||
opMax, //< Maximum
|
||||
opCoV, //< Coefficient of variation
|
||||
opAreaNormalAverage, //< Area average in normal direction
|
||||
opAreaNormalIntegrate //< Area integral in normal direction
|
||||
opNone, //!< None
|
||||
opSum, //!< Sum
|
||||
opSumMag, //!< Magnitude of sum
|
||||
opSumDirection, //!< Sum in a given direction
|
||||
opSumDirectionBalance, //!< Sum in a given direction for multiple
|
||||
opAverage, //!< Average
|
||||
opWeightedAverage, //!< Weighted average
|
||||
opAreaAverage, //!< Area average
|
||||
opWeightedAreaAverage, //!< Weighted area average
|
||||
opAreaIntegrate, //!< Area integral
|
||||
opMin, //!< Minimum
|
||||
opMax, //!< Maximum
|
||||
opCoV, //!< Coefficient of variation
|
||||
opAreaNormalAverage, //!< Area average in normal direction
|
||||
opAreaNormalIntegrate //!< Area integral in normal direction
|
||||
};
|
||||
|
||||
//- Operation type names
|
||||
|
||||
@ -619,6 +619,7 @@ Foam::functionObjects::fluxSummary::~fluxSummary()
|
||||
|
||||
bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
|
||||
mode_ = modeTypeNames_.read(dict.lookup("mode"));
|
||||
|
||||
@ -110,9 +110,9 @@ public:
|
||||
//- Face mode type
|
||||
enum modeType
|
||||
{
|
||||
mdFaceZone, //< face zone
|
||||
mdFaceZoneAndDirection, //< face zone with prescribed direction
|
||||
mdCellZoneAndDirection //< cell zone with prescribed direction
|
||||
mdFaceZone, //!< face zone
|
||||
mdFaceZoneAndDirection, //!< face zone with prescribed direction
|
||||
mdCellZoneAndDirection //!< cell zone with prescribed direction
|
||||
};
|
||||
|
||||
//- Mode type names
|
||||
|
||||
@ -61,9 +61,7 @@ Foam::functionObjects::grad::grad
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -92,6 +92,8 @@ Foam::functionObjects::histogram::~histogram()
|
||||
|
||||
bool Foam::functionObjects::histogram::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("field") >> fieldName_;
|
||||
dict.lookup("max") >> max_;
|
||||
min_ = dict.lookupOrDefault<scalar>("min", 0);
|
||||
|
||||
@ -64,9 +64,7 @@ Foam::functionObjects::mag::mag
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -64,9 +64,7 @@ Foam::functionObjects::magSqr::magSqr
|
||||
)
|
||||
:
|
||||
fieldExpression(name, runTime, dict)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -166,6 +166,8 @@ Foam::functionObjects::mapFields::~mapFields()
|
||||
|
||||
bool Foam::functionObjects::mapFields::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> fieldNames_;
|
||||
createInterpolation(dict);
|
||||
return true;
|
||||
|
||||
@ -60,7 +60,12 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
|
||||
DebugInFunction << "nPatchFaces: " << globalWalls.size() << endl;
|
||||
|
||||
// Construct cloud
|
||||
Cloud<findCellParticle> cloud(mesh_, IDLList<findCellParticle>());
|
||||
Cloud<findCellParticle> cloud
|
||||
(
|
||||
mesh_,
|
||||
cloud::defaultName,
|
||||
IDLList<findCellParticle>()
|
||||
);
|
||||
|
||||
// Add particles to track to sample locations
|
||||
nPatchFaces = 0;
|
||||
|
||||
@ -230,6 +230,8 @@ Foam::functionObjects::pressure::~pressure()
|
||||
|
||||
bool Foam::functionObjects::pressure::read(const dictionary& dict)
|
||||
{
|
||||
fieldExpression::read(dict);
|
||||
|
||||
dict.readIfPresent("U", UName_);
|
||||
dict.readIfPresent("rho", rhoName_);
|
||||
|
||||
|
||||
@ -267,6 +267,7 @@ bool Foam::functionObjects::reactionsSensitivityAnalysis<chemistryType>::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -32,19 +32,30 @@ License
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
// Psi-based chemistry
|
||||
typedef functionObjects::reactionsSensitivityAnalysis<psiChemistryModel>
|
||||
psiReactionsSensitivityAnalysisFunctionObject;
|
||||
|
||||
defineTemplateTypeNameAndDebugWithName
|
||||
(
|
||||
psiReactionsSensitivityAnalysisFunctionObject,
|
||||
"psiReactionsSensitivityAnalysis",
|
||||
0
|
||||
);
|
||||
|
||||
// Rho-based chemistry
|
||||
typedef functionObjects::reactionsSensitivityAnalysis<rhoChemistryModel>
|
||||
rhoReactionsSensitivityAnalysisFunctionObject;
|
||||
|
||||
defineTemplateTypeNameAndDebugWithName
|
||||
(
|
||||
rhoReactionsSensitivityAnalysisFunctionObject,
|
||||
"rhoReactionsSensitivityAnalysis",
|
||||
0
|
||||
);
|
||||
|
||||
namespace functionObjects
|
||||
{
|
||||
// Psi-based chemistry
|
||||
typedef reactionsSensitivityAnalysis<psiChemistryModel>
|
||||
psiReactionsSensitivityAnalysisFunctionObject;
|
||||
|
||||
defineTemplateTypeNameAndDebugWithName
|
||||
(
|
||||
psiReactionsSensitivityAnalysisFunctionObject,
|
||||
"psiReactionsSensitivityAnalysis",
|
||||
0
|
||||
);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
functionObject,
|
||||
@ -52,18 +63,6 @@ namespace functionObjects
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// Rho-based chemistry
|
||||
typedef reactionsSensitivityAnalysis<rhoChemistryModel>
|
||||
rhoReactionsSensitivityAnalysisFunctionObject;
|
||||
|
||||
defineTemplateTypeNameAndDebugWithName
|
||||
(
|
||||
rhoReactionsSensitivityAnalysisFunctionObject,
|
||||
"rhoReactionsSensitivityAnalysis",
|
||||
0
|
||||
);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
functionObject,
|
||||
|
||||
@ -353,6 +353,8 @@ Foam::functionObjects::regionSizeDistribution::~regionSizeDistribution()
|
||||
|
||||
bool Foam::functionObjects::regionSizeDistribution::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("field") >> alphaName_;
|
||||
dict.lookup("patches") >> patchNames_;
|
||||
dict.lookup("threshold") >> threshold_;
|
||||
|
||||
@ -507,6 +507,8 @@ Foam::functionObjects::streamLineBase::~streamLineBase()
|
||||
|
||||
bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
Info<< type() << " " << name() << ":" << nl;
|
||||
|
||||
dict.lookup("fields") >> fields_;
|
||||
|
||||
@ -74,6 +74,8 @@ bool Foam::functionObjects::surfaceInterpolate::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> fieldSet_;
|
||||
|
||||
return true;
|
||||
|
||||
@ -146,6 +146,8 @@ Foam::functionObjects::turbulenceFields::~turbulenceFields()
|
||||
|
||||
bool Foam::functionObjects::turbulenceFields::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
if (dict.found("field"))
|
||||
{
|
||||
fieldSet_.insert(word(dict.lookup("field")));
|
||||
|
||||
@ -106,6 +106,7 @@ Foam::functionObjects::valueAverage::~valueAverage()
|
||||
|
||||
bool Foam::functionObjects::valueAverage::read(const dictionary& dict)
|
||||
{
|
||||
regionFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
|
||||
dict.lookup("functionObjectName") >> functionObjectName_;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,6 +62,12 @@ Foam::functionObjects::writeCellCentres::~writeCellCentres()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::writeCellCentres::read(const dictionary& dict)
|
||||
{
|
||||
return fvMeshFunctionObject::read(dict);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::writeCellCentres::execute()
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -107,6 +107,9 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read the cell-centre rate data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Do nothing
|
||||
virtual bool execute();
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -62,6 +62,12 @@ Foam::functionObjects::writeCellVolumes::~writeCellVolumes()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::writeCellVolumes::read(const dictionary& dict)
|
||||
{
|
||||
return fvMeshFunctionObject::read(dict);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::writeCellVolumes::execute()
|
||||
{
|
||||
return true;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -106,10 +106,13 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read the cell-volume data
|
||||
virtual bool read(const dictionary&);
|
||||
|
||||
//- Do nothing
|
||||
virtual bool execute();
|
||||
|
||||
//- Write the cell-centre fields
|
||||
//- Write the cell-volume fields
|
||||
virtual bool write();
|
||||
};
|
||||
|
||||
|
||||
@ -108,7 +108,45 @@ int Foam::functionObjects::zeroGradient::process(const word& fieldName)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::zeroGradient::process()
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::zeroGradient
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(string::null),
|
||||
results_()
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::~zeroGradient()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)");
|
||||
return checkFormatName(resultName_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::execute()
|
||||
{
|
||||
results_.clear();
|
||||
|
||||
@ -150,57 +188,20 @@ void Foam::functionObjects::zeroGradient::process()
|
||||
WarningInFunction
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::zeroGradient
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
selectFields_(),
|
||||
resultName_(string::null),
|
||||
results_()
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::~zeroGradient()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)");
|
||||
return checkFormatName(resultName_);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::execute()
|
||||
{
|
||||
results_.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::write()
|
||||
{
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
}
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
|
||||
forAll(outputList, i)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
@ -209,8 +210,7 @@ bool Foam::functionObjects::zeroGradient::write()
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
Log << type() << " " << name()
|
||||
<< " write: writing field " << fieldName << endl;
|
||||
Log << " " << fieldName << endl;
|
||||
|
||||
io.write();
|
||||
}
|
||||
|
||||
@ -65,8 +65,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
zeroGradient.C
|
||||
zeroGradientFunctionObject.C
|
||||
IOzeroGradient.H
|
||||
zeroGradientTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -114,7 +113,10 @@ class zeroGradient
|
||||
static void uniqWords(wordReList&);
|
||||
|
||||
|
||||
//- Accept unless field only has empty/zero-gradient/processor patches
|
||||
//- Accept unless field only has constraint patches
|
||||
// (ie, empty/zero-gradient/processor).
|
||||
// This should also avoid fields that were already processed by
|
||||
// zeroGradient.
|
||||
template<class Type>
|
||||
static bool accept(const GeometricField<Type, fvPatchField, volMesh>&);
|
||||
|
||||
@ -125,9 +127,6 @@ class zeroGradient
|
||||
//- Process by trying to apply for various volume field types.
|
||||
int process(const word& inputName);
|
||||
|
||||
//- Calculate the zeroGradient fields
|
||||
void process();
|
||||
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
zeroGradient(const zeroGradient&) = delete;
|
||||
|
||||
@ -27,6 +27,8 @@ License
|
||||
#include "Time.H"
|
||||
#include "zeroGradientFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
bool Foam::functionObjects::zeroGradient::accept
|
||||
(
|
||||
@ -38,10 +40,10 @@ bool Foam::functionObjects::zeroGradient::accept
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const fvPatchField<Type>& p = patches[patchi];
|
||||
const polyPatch& pp = p.patch().patch();
|
||||
|
||||
return !polyPatch::constraintType(pp.type());
|
||||
if (!polyPatch::constraintType(patches[patchi].patch().patch().type()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -104,6 +106,7 @@ int Foam::functionObjects::zeroGradient::apply
|
||||
|
||||
VolFieldType& output =
|
||||
const_cast<VolFieldType&>(lookupObject<VolFieldType>(outputName));
|
||||
|
||||
output = input;
|
||||
output.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -156,25 +156,27 @@ void Foam::functionObjects::forceCoeffs::writeIntegratedData
|
||||
const List<Field<scalar>>& coeff
|
||||
) const
|
||||
{
|
||||
if (!log)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scalar pressure = sum(coeff[0]);
|
||||
scalar viscous = sum(coeff[1]);
|
||||
scalar porous = sum(coeff[2]);
|
||||
scalar total = pressure + viscous + porous;
|
||||
|
||||
if (log)
|
||||
Info<< " " << title << " : " << total << token::TAB
|
||||
<< "("
|
||||
<< "pressure: " << pressure << token::TAB
|
||||
<< "viscous: " << viscous;
|
||||
|
||||
if (porosity_)
|
||||
{
|
||||
Info<< " " << title << " : " << total << token::TAB
|
||||
<< "("
|
||||
<< "pressure: " << pressure << token::TAB
|
||||
<< "viscous: " << viscous;
|
||||
|
||||
if (porosity_)
|
||||
{
|
||||
Info<< token::TAB << "porous: " << porous;
|
||||
}
|
||||
|
||||
Info<< ")" << endl;
|
||||
Info<< token::TAB << "porous: " << porous;
|
||||
}
|
||||
|
||||
Info<< ")" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -388,21 +390,21 @@ bool Foam::functionObjects::forceCoeffs::execute()
|
||||
if (writeFields_)
|
||||
{
|
||||
const volVectorField& force =
|
||||
obr_.lookupObject<volVectorField>(fieldName("force"));
|
||||
lookupObject<volVectorField>(fieldName("force"));
|
||||
|
||||
const volVectorField& moment =
|
||||
obr_.lookupObject<volVectorField>(fieldName("moment"));
|
||||
lookupObject<volVectorField>(fieldName("moment"));
|
||||
|
||||
volVectorField& forceCoeff =
|
||||
const_cast<volVectorField&>
|
||||
(
|
||||
obr_.lookupObject<volVectorField>(fieldName("forceCoeff"))
|
||||
lookupObject<volVectorField>(fieldName("forceCoeff"))
|
||||
);
|
||||
|
||||
volVectorField& momentCoeff =
|
||||
const_cast<volVectorField&>
|
||||
(
|
||||
obr_.lookupObject<volVectorField>(fieldName("momentCoeff"))
|
||||
lookupObject<volVectorField>(fieldName("momentCoeff"))
|
||||
);
|
||||
|
||||
dimensionedScalar f0("f0", dimForce, Aref_*pDyn);
|
||||
@ -421,10 +423,10 @@ bool Foam::functionObjects::forceCoeffs::write()
|
||||
if (writeFields_)
|
||||
{
|
||||
const volVectorField& forceCoeff =
|
||||
obr_.lookupObject<volVectorField>(fieldName("forceCoeff"));
|
||||
lookupObject<volVectorField>(fieldName("forceCoeff"));
|
||||
|
||||
const volVectorField& momentCoeff =
|
||||
obr_.lookupObject<volVectorField>(fieldName("momentCoeff"));
|
||||
lookupObject<volVectorField>(fieldName("momentCoeff"));
|
||||
|
||||
forceCoeff.write();
|
||||
momentCoeff.write();
|
||||
|
||||
@ -69,9 +69,9 @@ public:
|
||||
|
||||
enum renderModeType
|
||||
{
|
||||
rmFlat, //< Flat shading
|
||||
rmGouraud, //< Gouraud shading
|
||||
rmPhong //< Phong shading
|
||||
rmFlat, //!< Flat shading
|
||||
rmGouraud, //!< Gouraud shading
|
||||
rmPhong //!< Phong shading
|
||||
};
|
||||
|
||||
static const NamedEnum<renderModeType, 3> renderModeTypeNames;
|
||||
|
||||
@ -65,8 +65,8 @@ public:
|
||||
|
||||
enum representationType
|
||||
{
|
||||
rtSphere, //< Sphere
|
||||
rtVector //< Vector
|
||||
rtSphere, //!< Sphere
|
||||
rtVector //!< Vector
|
||||
};
|
||||
|
||||
static const NamedEnum<representationType, 2> representationTypeNames;
|
||||
|
||||
@ -90,6 +90,8 @@ Foam::functionObjects::runTimePostProcessing::~runTimePostProcessing()
|
||||
|
||||
bool Foam::functionObjects::runTimePostProcessing::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
Info<< type() << " " << name() << ": reading post-processing data" << endl;
|
||||
|
||||
scene_.read(dict);
|
||||
|
||||
@ -75,6 +75,7 @@ Foam::functionObjects::dsmcFields::~dsmcFields()
|
||||
|
||||
bool Foam::functionObjects::dsmcFields::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -103,9 +103,6 @@ class scalarTransport
|
||||
//- Name of field to process
|
||||
word fieldName_;
|
||||
|
||||
//- On/off switch
|
||||
bool active_;
|
||||
|
||||
//- Name of flux field (optional)
|
||||
word phiName_;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -114,6 +114,8 @@ Foam::functionObjects::abort::~abort()
|
||||
|
||||
bool Foam::functionObjects::abort::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
if (dict.found("action"))
|
||||
{
|
||||
action_ = actionTypeNames_.read(dict.lookup("action"));
|
||||
|
||||
@ -184,6 +184,8 @@ bool Foam::codedFunctionObject::end()
|
||||
|
||||
bool Foam::codedFunctionObject::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
// Backward compatibility
|
||||
if (dict.found("redirectType"))
|
||||
{
|
||||
|
||||
@ -72,6 +72,8 @@ Foam::functionObjects::removeRegisteredObject::~removeRegisteredObject()
|
||||
|
||||
bool Foam::functionObjects::removeRegisteredObject::read(const dictionary& dict)
|
||||
{
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("objects") >> objectNames_;
|
||||
|
||||
return true;
|
||||
|
||||
@ -87,7 +87,13 @@ void Foam::functionObjects::residuals::writeResidual(const word& fieldName)
|
||||
{
|
||||
if (component(validComponents, cmpt) != -1)
|
||||
{
|
||||
file() << token::TAB << component(residual, cmpt);
|
||||
const scalar r = component(residual, cmpt);
|
||||
|
||||
file() << token::TAB << r;
|
||||
|
||||
const word resultName =
|
||||
fieldName + word(pTraits<Type>::componentNames[cmpt]);
|
||||
setResult(resultName, r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ public:
|
||||
|
||||
enum operatingMode
|
||||
{
|
||||
omMin, //< Minimum
|
||||
omMax //< Maximum
|
||||
omMin, //!< Minimum
|
||||
omMax //!< Maximum
|
||||
};
|
||||
|
||||
static const NamedEnum<operatingMode, 2> operatingModeNames;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,16 +53,21 @@ namespace runTimeControls
|
||||
defineTypeNameAndDebug(minMaxCondition, 0);
|
||||
addToRunTimeSelectionTable(runTimeCondition, minMaxCondition, dictionary);
|
||||
|
||||
template<>
|
||||
const char* NamedEnum<minMaxCondition::modeType, 2>::names[] =
|
||||
{
|
||||
"minimum",
|
||||
"maximum"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::runTimeControls::minMaxCondition::modeType,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"minimum",
|
||||
"maximum"
|
||||
};
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam
|
||||
@ -86,7 +91,7 @@ Foam::functionObjects::runTimeControls::minMaxCondition::minMaxCondition
|
||||
)
|
||||
:
|
||||
runTimeCondition(name, obr, dict, state),
|
||||
functionObjectName_(dict.lookup("functionObjectName")),
|
||||
functionObjectName_(dict.lookup("functionObject")),
|
||||
mode_(modeTypeNames_.read(dict.lookup("mode"))),
|
||||
fieldNames_(dict.lookup("fields")),
|
||||
value_(readScalar(dict.lookup("value")))
|
||||
|
||||
@ -64,8 +64,8 @@ public:
|
||||
// Mode type
|
||||
enum modeType
|
||||
{
|
||||
mdMin, //< Minimum
|
||||
mdMax //< Maximum
|
||||
mdMin, //!< Minimum
|
||||
mdMax //!< Maximum
|
||||
};
|
||||
|
||||
static const NamedEnum<modeType, 2> modeTypeNames_;
|
||||
|
||||
@ -77,6 +77,8 @@ bool Foam::functionObjects::runTimeControls::runTimeControl::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
const dictionary& conditionsDict = dict.subDict("conditions");
|
||||
const wordList conditionNames(conditionsDict.toc());
|
||||
conditions_.setSize(conditionNames.size());
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -92,6 +92,8 @@ bool Foam::functionObjects::setTimeStepFunctionObject::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
timeStepPtr_ = Function1<scalar>::New("deltaT", dict);
|
||||
|
||||
// Check that adjustTimeStep is active
|
||||
|
||||
@ -74,6 +74,8 @@ Foam::functionObjects::systemCall::~systemCall()
|
||||
|
||||
bool Foam::functionObjects::systemCall::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
dict.readIfPresent("executeCalls", executeCalls_);
|
||||
dict.readIfPresent("endCalls", endCalls_);
|
||||
dict.readIfPresent("writeCalls", writeCalls_);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -103,6 +103,8 @@ bool Foam::functionObjects::timeActivatedFileUpdate::read
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
dict.lookup("fileToUpdate") >> fileToUpdate_;
|
||||
dict.lookup("timeVsFile") >> timeVsFile_;
|
||||
|
||||
|
||||
@ -122,6 +122,8 @@ Foam::functionObjects::writeDictionary::~writeDictionary()
|
||||
|
||||
bool Foam::functionObjects::writeDictionary::read(const dictionary& dict)
|
||||
{
|
||||
regionFunctionObject::read(dict);
|
||||
|
||||
wordList dictNames(dict.lookup("dictNames"));
|
||||
HashSet<word> uniqueNames(dictNames);
|
||||
dictNames_ = uniqueNames.toc();
|
||||
|
||||
@ -98,6 +98,8 @@ Foam::functionObjects::writeObjects::~writeObjects()
|
||||
|
||||
bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
if (dict.found("field"))
|
||||
{
|
||||
objectNames_.setSize(1);
|
||||
|
||||
Reference in New Issue
Block a user