diff --git a/applications/test/Matrix/Test-Matrix.C b/applications/test/Matrix/Test-Matrix.C index 9663ae8217..380576d695 100644 --- a/applications/test/Matrix/Test-Matrix.C +++ b/applications/test/Matrix/Test-Matrix.C @@ -116,17 +116,19 @@ int main(int argc, char *argv[]) squareMatrix[2][1] = -43; squareMatrix[2][2] = 98; + const scalarSquareMatrix squareMatrixCopy = squareMatrix; Info<< nl << "Square Matrix = " << squareMatrix << endl; - scalarDiagonalMatrix rhs(3, 0); - rhs[0] = 1; - rhs[1] = 2; - rhs[2] = 3; + Info<< "det = " << det(squareMatrixCopy) << endl; - LUsolve(squareMatrix, rhs); + labelList rhs(3, 0); + label sign; + LUDecompose(squareMatrix, rhs, sign); Info<< "Decomposition = " << squareMatrix << endl; - Info<< "Solution = " << rhs << endl; + Info<< "Pivots = " << rhs << endl; + Info<< "Sign = " << sign << endl; + Info<< "det = " << detDecomposed(squareMatrix, sign) << endl; } Info<< "\nEnd\n" << endl; diff --git a/src/OpenFOAM/db/Time/Time.C b/src/OpenFOAM/db/Time/Time.C index 14eb3f3616..5c589c8f28 100644 --- a/src/OpenFOAM/db/Time/Time.C +++ b/src/OpenFOAM/db/Time/Time.C @@ -1220,6 +1220,7 @@ Foam::Time& Foam::Time::operator++() writeOnce_ = false; } + functionObjects_.timeSet(); } return *this; diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index bd4d0b3d61..7c6b95ec98 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -202,6 +202,18 @@ bool Foam::OutputFilterFunctionObject::end() } +template +bool Foam::OutputFilterFunctionObject::timeSet() +{ + if (active()) + { + ptr_->timeSet(); + } + + return true; +} + + template bool Foam::OutputFilterFunctionObject::read ( diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 87ade4b282..78d1c47be7 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -201,6 +201,8 @@ public: //- Called when Time::run() determines that the time-loop exits virtual bool end(); + //- Called when time was set at the end of the Time::operator++ + virtual bool timeSet(); //- Read and set the function object if its data have changed virtual bool read(const dictionary&); diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 2e67818359..31e1d92062 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,6 +120,12 @@ bool Foam::functionObject::end() } +bool Foam::functionObject::timeSet() +{ + return false; +} + + Foam::autoPtr Foam::functionObject::iNew::operator() ( const word& name, diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index a7c027b5b3..47438c3215 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,6 +157,9 @@ public: // By default it simply calls execute(). virtual bool end(); + //- Called when time was set at the end of the Time::operator++ + virtual bool timeSet(); + //- Read and set the function object if its data have changed virtual bool read(const dictionary&) = 0; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 799e4b626e..1e7553a760 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -190,6 +190,27 @@ bool Foam::functionObjectList::end() } +bool Foam::functionObjectList::timeSet() +{ + bool ok = true; + + if (execution_) + { + if (!updated_) + { + read(); + } + + forAll(*this, objectI) + { + ok = operator[](objectI).timeSet() && ok; + } + } + + return ok; +} + + bool Foam::functionObjectList::read() { bool ok = true; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 923e8501a4..4df2c4d263 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,6 +163,9 @@ public: //- Called when Time::run() determines that the time-loop exits virtual bool end(); + //- Called when time was set at the end of the Time::operator++ + virtual bool timeSet(); + //- Read and set the function objects if their data have changed virtual bool read(); diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.C b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.C new file mode 100644 index 0000000000..439257fcb6 --- /dev/null +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "SquareMatrix.H" +#include "labelList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::scalar Foam::detDecomposed +( + const SquareMatrix& matrix, + const label sign +) +{ + scalar diagProduct = 1.0; + + for (label i = 0; i < matrix.n(); ++i) + { + diagProduct *= matrix[i][i]; + } + + return sign*diagProduct; +} + + +template +Foam::scalar Foam::det(const SquareMatrix& matrix) +{ + SquareMatrix matrixTmp = matrix; + + labelList pivotIndices(matrix.n()); + label sign; + LUDecompose(matrixTmp, pivotIndices, sign); + + return detDecomposed(matrixTmp, sign); +} + + +template +Foam::scalar Foam::det(SquareMatrix& matrix) +{ + labelList pivotIndices(matrix.n()); + label sign; + LUDecompose(matrix, pivotIndices, sign); + + return detDecomposed(matrix, sign); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H index 660f39321e..531b649588 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrix.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,6 +81,21 @@ public: }; +// Global functions + +//- Return the LU decomposed SquareMatrix det +template +scalar detDecomposed(const SquareMatrix&, const label sign); + +//- Return the SquareMatrix det +template +scalar det(const SquareMatrix&); + +//- Return the SquareMatrix det and the LU decomposition in the original matrix +template +scalar det(SquareMatrix&); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam @@ -91,6 +106,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "SquareMatrix.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C index 68a6955d71..87a9d02347 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C @@ -33,9 +33,22 @@ void Foam::LUDecompose scalarSquareMatrix& matrix, labelList& pivotIndices ) +{ + label sign; + LUDecompose(matrix, pivotIndices, sign); +} + + +void Foam::LUDecompose +( + scalarSquareMatrix& matrix, + labelList& pivotIndices, + label& sign +) { label n = matrix.n(); scalar vv[n]; + sign = 1; for (register label i=0; i= 1." << exit(FatalIOError); } + + // Clear out any previously loaded fields + vsf_.clear(); + vvf_.clear(); + vSpheretf_.clear(); + vSymmtf_.clear(); + vtf_.clear(); + + ssf_.clear(); + svf_.clear(); + sSpheretf_.clear(); + sSymmtf_.clear(); + stf_.clear(); + + forAllConstIter(HashSet, objectNames_, iter) + { + loadField(iter.key(), vsf_, ssf_); + loadField(iter.key(), vvf_, svf_); + loadField(iter.key(), vSpheretf_, sSpheretf_); + loadField(iter.key(), vSymmtf_, sSymmtf_); + loadField(iter.key(), vtf_, stf_); + } } void Foam::partialWrite::execute() { - //Pout<< "execute at time " << obr_.time().timeName() - // << " index:" << obr_.time().timeIndex() << endl; } @@ -104,99 +124,61 @@ void Foam::partialWrite::end() } -void Foam::partialWrite::write() +void Foam::partialWrite::timeSet() { - //Pout<< "write at time " << obr_.time().timeName() << endl; if (obr_.time().outputTime()) { - // Above check so it can be used both with - // outputControl timeStep; - // outputInterval 1; - // or with - // outputControl outputTime; - writeInstance_++; if (writeInstance_ == writeInterval_) { - // Normal dump + // Next overall dump corresponf to partial write. Change + // write options to AUTO_WRITE writeInstance_ = 0; + + changeWriteOptions(vsf_, ssf_, IOobject::AUTO_WRITE); + changeWriteOptions(vvf_, svf_, IOobject::AUTO_WRITE); + changeWriteOptions + ( + vSpheretf_, + sSpheretf_, + IOobject::AUTO_WRITE + ); + changeWriteOptions + ( + vSymmtf_, + sSymmtf_, + IOobject::AUTO_WRITE + ); + changeWriteOptions(vtf_, stf_, IOobject::AUTO_WRITE); } else { - // Delete all but marked objects - fileName dbDir; - if (isA(obr_)) - { - dbDir = dynamic_cast(obr_).dbDir(); - } - - IOobjectList objects(obr_, obr_.time().timeName()); - - if (debug) - { - Pout<< "For region:" << obr_.name() << endl; - } - - forAllConstIter(IOobjectList, objects, iter) - { - if (!objectNames_.found(iter()->name())) - { - const fileName f = - obr_.time().timePath() - /dbDir - /iter()->name(); - if (debug) - { - Pout<< " rm " << f << endl; - } - rm(f); - } - } - - // Do the lagrangian files as well. - fileNameList cloudDirs + changeWriteOptions(vsf_, ssf_, IOobject::NO_WRITE); + changeWriteOptions(vvf_, svf_, IOobject::NO_WRITE); + changeWriteOptions ( - readDir - ( - obr_.time().timePath()/dbDir/cloud::prefix, - fileName::DIRECTORY - ) + vSpheretf_, + sSpheretf_, + IOobject::NO_WRITE ); - forAll(cloudDirs, i) - { - if (debug) - { - Pout<< "For cloud:" << cloudDirs[i] << endl; - } - - IOobjectList sprayObjs - ( - obr_, - obr_.time().timeName(), - cloud::prefix/cloudDirs[i] - ); - forAllConstIter(IOobjectList, sprayObjs, iter) - { - if (!objectNames_.found(iter()->name())) - { - const fileName f = - obr_.time().timePath() - /dbDir - /cloud::prefix - /cloudDirs[i] - /iter()->name(); - if (debug) - { - Pout<< " rm " << f << endl; - } - rm(f); - } - } - } + changeWriteOptions + ( + vSymmtf_, + sSymmtf_, + IOobject::NO_WRITE + ); + changeWriteOptions(vtf_, stf_, IOobject::NO_WRITE); } } } +void Foam::partialWrite::write() +{ + // Do nothing. The fields get written through the + // standard dump +} + + // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H index 62a53f5194..09197a671d 100644 --- a/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,8 +29,8 @@ Group Description This function object allows user-selected fields/registered objects to be - written at a custom write interval. It operates by deleting all entries - except those selected after writing. + written at a custom write interval. The interval is given in terms of + number of overall dumps Example of function object specification: \verbatim @@ -66,8 +66,9 @@ SourceFiles #define partialWrite_H #include "HashSet.H" -#include "DynamicList.H" #include "runTimeSelectionTables.H" +#include "volFields.H" +#include "surfaceFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -95,6 +96,18 @@ protected: const objectRegistry& obr_; + //- Loaded fields + UPtrList vsf_; + UPtrList vvf_; + UPtrList vSpheretf_; + UPtrList vSymmtf_; + UPtrList vtf_; + + UPtrList ssf_; + UPtrList svf_; + UPtrList sSpheretf_; + UPtrList sSymmtf_; + UPtrList stf_; // Read from dictionary @@ -105,6 +118,7 @@ protected: label writeInterval_; + //- Current dump instance. If reaches writeInterval do a full write. label writeInstance_; @@ -118,6 +132,24 @@ protected: void operator=(const partialWrite&); + //- Load objects in the objectNames + template + void loadField + ( + const word&, + UPtrList >&, + UPtrList >& + ) const; + + template + void changeWriteOptions + ( + UPtrList >&, + UPtrList >&, + const IOobject::writeOption + ) const; + + public: //- Runtime type information @@ -152,12 +184,15 @@ public: //- Read the partialWrite data virtual void read(const dictionary&); - //- Execute, currently does nothing + //- Execute virtual void execute(); //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the partialWrite virtual void write(); @@ -177,6 +212,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository +# include "partialWriteTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWriteTemplates.C b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteTemplates.C new file mode 100644 index 0000000000..56e0089313 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteTemplates.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "partialWrite.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +void Foam::partialWrite::loadField +( + const word& fieldName, + UPtrList >& vflds, + UPtrList >& sflds +) const +{ + typedef GeometricField vfType; + typedef GeometricField sfType; + + if (obr_.foundObject(fieldName)) + { + if (debug) + { + Info<< "partialWrite : Field " + << fieldName << " found in database" << endl; + } + + vfType& vField = + const_cast + ( + obr_.lookupObject(fieldName) + ); + + + const unsigned int sz = vflds.size(); + vflds.setSize(sz + 1); + vflds.set(sz, &vField); + } + else if (obr_.foundObject(fieldName)) + { + if (debug) + { + Info<< "partialWrite : Field " << fieldName + << " found in database" << endl; + } + + sfType& sField = + const_cast + ( + obr_.lookupObject(fieldName) + ); + + + const unsigned int sz = sflds.size(); + sflds.setSize(sz + 1); + sflds.set(sz, &sField); + } +} + + +template +void Foam::partialWrite::changeWriteOptions +( + UPtrList >& vflds, + UPtrList >& sflds, + const IOobject::writeOption wOption +) const +{ + forAll(vflds , i) + { + vflds[i].writeOpt() = wOption; + } + + forAll(sflds , i) + { + sflds[i].writeOpt() = wOption; + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C index 802f63f308..4ed2bb524a 100644 --- a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,6 +92,12 @@ void Foam::removeRegisteredObject::end() } +void Foam::removeRegisteredObject::timeSet() +{ + // Do nothing - only valid on execute +} + + void Foam::removeRegisteredObject::write() { // Do nothing - only valid on execute diff --git a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H index 957c1a9a2d..fc02432ad8 100644 --- a/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H +++ b/src/postProcessing/functionObjects/IO/removeRegisteredObject/removeRegisteredObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,6 +146,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the removeRegisteredObject virtual void write(); diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C index 694fba31b6..56cd35a407 100644 --- a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -199,6 +199,12 @@ void Foam::writeDictionary::end() } +void Foam::writeDictionary::timeSet() +{ + // do nothing +} + + void Foam::writeDictionary::write() { // do nothing diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H index 1f12efd096..a4ac474e40 100644 --- a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,6 +134,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the writeDictionary virtual void write(); diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C index cc3f0c628e..3700727407 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,6 +79,12 @@ void Foam::writeRegisteredObject::end() } +void Foam::writeRegisteredObject::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::writeRegisteredObject::write() { forAll(objectNames_, i) diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H index 014d4ce90c..7159fad3fc 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H @@ -147,6 +147,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the writeRegisteredObject virtual void write(); diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C index 2a3d212afd..6bea8e6478 100644 --- a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,6 +106,12 @@ void Foam::cloudInfo::end() } +void Foam::cloudInfo::timeSet() +{ + // Do nothing +} + + void Foam::cloudInfo::write() { if (active_) diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H index 85558d2e3f..e659807cd4 100644 --- a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -162,6 +162,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C index 5a73765f93..e8f58c370e 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C @@ -393,6 +393,10 @@ void Foam::fieldAverage::end() {} +void Foam::fieldAverage::timeSet() +{} + + void Foam::fieldAverage::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H index 4a6d75e06b..12cea88cd7 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H +++ b/src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.H @@ -318,6 +318,9 @@ public: //- Execute the averaging at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the field average data and write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C index ac0fc6da0a..57c26aa472 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.C @@ -104,6 +104,12 @@ void Foam::fieldCoordinateSystemTransform::end() } +void Foam::fieldCoordinateSystemTransform::timeSet() +{ + // Do nothing +} + + void Foam::fieldCoordinateSystemTransform::write() { forAll(fieldSet_, fieldI) diff --git a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H index 0671327ad8..edd1f13b50 100644 --- a/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H +++ b/src/postProcessing/functionObjects/field/fieldCoordinateSystemTransform/fieldCoordinateSystemTransform.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -173,6 +173,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index e7a611febc..7c3c328389 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,6 +139,12 @@ void Foam::fieldMinMax::end() } +void Foam::fieldMinMax::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::fieldMinMax::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 50e3017f89..25ccd00f41 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -189,6 +189,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the field min/max template void calcMinMaxFields diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C index 50d47d8198..9f651c8ee9 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -131,6 +131,12 @@ void Foam::fieldValue::end() } +void Foam::fieldValue::timeSet() +{ + // Do nothing +} + + void Foam::fieldValue::updateMesh(const mapPolyMesh&) { // Do nothing diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H index b7994383d5..9d852cdfb7 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -191,6 +191,9 @@ public: //- Execute the at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Update mesh virtual void updateMesh(const mapPolyMesh&); diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index 0e0c93ed1b..30027a864a 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -202,6 +202,12 @@ void Foam::fieldValues::fieldValueDelta::end() } +void Foam::fieldValues::fieldValueDelta::timeSet() +{ + // Do nothing +} + + void Foam::fieldValues::fieldValueDelta::updateMesh(const mapPolyMesh&) { // Do nothing diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H index 24d72f1f6b..d408227bbc 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.H @@ -192,6 +192,9 @@ public: //- Execute the at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Update mesh virtual void updateMesh(const mapPolyMesh&); diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C index 715bcfa7f8..4b82fbd331 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,6 +163,11 @@ void Foam::nearWallFields::end() } +void Foam::nearWallFields::timeSet() +{ +} + + void Foam::nearWallFields::write() { if (debug) diff --git a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H index df6c8f8063..cea4e42139 100644 --- a/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H +++ b/src/postProcessing/functionObjects/field/nearWallFields/nearWallFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -191,6 +191,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.C b/src/postProcessing/functionObjects/field/processorField/processorField.C index bd72316b23..611ebced0f 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.C +++ b/src/postProcessing/functionObjects/field/processorField/processorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -96,6 +96,12 @@ void Foam::processorField::end() } +void Foam::processorField::timeSet() +{ + // Do nothing +} + + void Foam::processorField::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/processorField/processorField.H b/src/postProcessing/functionObjects/field/processorField/processorField.H index cee878adc1..6d45e32acb 100644 --- a/src/postProcessing/functionObjects/field/processorField/processorField.H +++ b/src/postProcessing/functionObjects/field/processorField/processorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,6 +145,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.C b/src/postProcessing/functionObjects/field/readFields/readFields.C index 2d8a0fd0e0..b92998684d 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.C +++ b/src/postProcessing/functionObjects/field/readFields/readFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,6 +122,12 @@ void Foam::readFields::end() } +void Foam::readFields::timeSet() +{ + // Do nothing +} + + void Foam::readFields::write() { // Do nothing diff --git a/src/postProcessing/functionObjects/field/readFields/readFields.H b/src/postProcessing/functionObjects/field/readFields/readFields.H index 81f11922b7..0c39404a93 100644 --- a/src/postProcessing/functionObjects/field/readFields/readFields.H +++ b/src/postProcessing/functionObjects/field/readFields/readFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -173,6 +173,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C index 3e5e2fc98a..22512c0317 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -384,6 +384,12 @@ void Foam::regionSizeDistribution::end() } +void Foam::regionSizeDistribution::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::regionSizeDistribution::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H index 1fd236f024..0c46639846 100644 --- a/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H +++ b/src/postProcessing/functionObjects/field/regionSizeDistribution/regionSizeDistribution.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -266,6 +266,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the regionSizeDistribution and write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index 037ddc5ae1..6116950a44 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -517,6 +517,10 @@ void Foam::streamLine::end() {} +void Foam::streamLine::timeSet() +{} + + void Foam::streamLine::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.H b/src/postProcessing/functionObjects/field/streamLine/streamLine.H index bce1808d90..59d9d9026e 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.H +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -266,6 +266,9 @@ public: //- Execute the averaging at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the field average data and write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C index d89a6b3648..69b45c12ca 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,12 @@ void Foam::surfaceInterpolateFields::end() } +void Foam::surfaceInterpolateFields::timeSet() +{ + // Do nothing +} + + void Foam::surfaceInterpolateFields::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H index 07110c8d88..1a5d38a075 100644 --- a/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H +++ b/src/postProcessing/functionObjects/field/surfaceInterpolateFields/surfaceInterpolateFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -169,6 +169,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C index 855b3ce800..72585b8148 100644 --- a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -259,6 +259,12 @@ void Foam::turbulenceFields::end() } +void Foam::turbulenceFields::timeSet() +{ + // Do nothing +} + + void Foam::turbulenceFields::write() { // Do nothing diff --git a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.H index b885759223..09ecd93e68 100644 --- a/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.H +++ b/src/postProcessing/functionObjects/field/turbulenceFields/turbulenceFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -206,6 +206,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write virtual void write(); diff --git a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C index e2487e3cd6..95238cbd30 100644 --- a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C +++ b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -644,6 +644,10 @@ void Foam::wallBoundedStreamLine::end() {} +void Foam::wallBoundedStreamLine::timeSet() +{} + + void Foam::wallBoundedStreamLine::write() { if (active_) diff --git a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H index c6b8a178a3..98956ba9ca 100644 --- a/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H +++ b/src/postProcessing/functionObjects/field/wallBoundedStreamLine/wallBoundedStreamLine.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -272,6 +272,9 @@ public: //- Execute the averaging at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the field average data and write virtual void write(); diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index 9537f6a28a..5a29b54bc0 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -108,6 +108,12 @@ void Foam::forceCoeffs::end() } +void Foam::forceCoeffs::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::forceCoeffs::write() { if (active_) diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H index b8112939b3..048c0dd331 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -177,6 +177,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the forces virtual void write(); }; diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index e38208963b..7df79a2e1f 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -625,6 +625,12 @@ void Foam::forces::end() } +void Foam::forces::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::forces::write() { if (!active_) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index dd87184c2f..793cf78cbf 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -205,7 +205,7 @@ protected: //- Minimum bin bounds scalar binMin_; - + //- Bin positions along binDir List binPoints_; @@ -309,6 +309,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write the forces virtual void write(); diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C index b5fd621b71..185e83b0a4 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,6 +141,12 @@ void Foam::calcFvcDiv::end() } +void Foam::calcFvcDiv::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::calcFvcDiv::write() { if (active_) diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H index e15f680e64..447b00c92c 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H @@ -148,6 +148,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the calcFvcDiv and write virtual void write(); diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C index edcddb2eae..6b8efee0c8 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,6 +103,12 @@ void Foam::calcFvcGrad::end() } +void Foam::calcFvcGrad::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::calcFvcGrad::write() { if (active_) diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H index 6822a7bb08..bdaf5383ed 100644 --- a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H @@ -151,6 +151,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the calcFvcGrad and write virtual void write(); diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C index f997cc8b78..93229e7f5d 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,6 +103,12 @@ void Foam::calcMag::end() } +void Foam::calcMag::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::calcMag::write() { if (active_) diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H index d8a91cc802..76f1072111 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H @@ -145,6 +145,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the calcMag and write virtual void write(); diff --git a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C index 41b8f697c1..d0551c84ce 100644 --- a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C +++ b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,6 +179,11 @@ void Foam::abortCalculation::end() } +void Foam::abortCalculation::timeSet() +{ +} + + void Foam::abortCalculation::write() { // Do nothing - only valid on execute diff --git a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.H b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.H index 4040709fdb..95e1994fd4 100644 --- a/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.H +++ b/src/postProcessing/functionObjects/jobControl/abortCalculation/abortCalculation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,6 +146,9 @@ public: //- Execute at the final time-loop, used for cleanup virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Execute, check existence of abort file and take action virtual void write(); diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.C b/src/postProcessing/functionObjects/systemCall/systemCall.C index 00cb7b850c..0fb6d1cfca 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.C +++ b/src/postProcessing/functionObjects/systemCall/systemCall.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,6 +111,11 @@ void Foam::systemCall::end() } +void Foam::systemCall::timeSet() +{ +} + + void Foam::systemCall::write() { forAll(writeCalls_, callI) diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.H b/src/postProcessing/functionObjects/systemCall/systemCall.H index 5de53fa26c..b4d43a2bf7 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.H +++ b/src/postProcessing/functionObjects/systemCall/systemCall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -172,6 +172,9 @@ public: //- Execute the "endCalls" at the final time-loop virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Write, execute the "writeCalls" virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index e72e693338..9309ba42bb 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,6 +165,12 @@ void Foam::CourantNo::end() } +void Foam::CourantNo::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::CourantNo::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index e74d6c9e2c..16724bee94 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,6 +134,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the CourantNo and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C index b9a4843600..9f861596f7 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,6 +114,12 @@ void Foam::DESModelRegions::end() } +void Foam::DESModelRegions::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::DESModelRegions::write() { typedef incompressible::turbulenceModel icoModel; @@ -175,7 +181,7 @@ void Foam::DESModelRegions::write() file() << obr_.time().timeName() << token::TAB << prc << token::TAB << 100.0 - prc << endl; } - + if (log_) { Info<< " LES = " << prc << " % (volume)" << nl diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.H b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.H index 858fab4e05..d0bf101ae0 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.H +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,6 +136,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the DESModelRegions and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index 5b1b3f0cf9..0f1dd72a92 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,6 +126,12 @@ void Foam::Lambda2::end() } +void Foam::Lambda2::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::Lambda2::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H index 77659532e2..f4360f4640 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,6 +127,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the Lambda2 and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 874977faed..885e611fa0 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,6 +130,12 @@ void Foam::Peclet::end() } +void Foam::Peclet::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::Peclet::write() { typedef compressible::turbulenceModel cmpTurbModel; diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H index 4c4ec390b7..5becbe93e9 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,6 +129,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the Peclet and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index 5dec2d3aa7..81a68a152a 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,6 +125,12 @@ void Foam::Q::end() } +void Foam::Q::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::Q::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.H b/src/postProcessing/functionObjects/utilities/Q/Q.H index 892808ef95..aed626228c 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.H +++ b/src/postProcessing/functionObjects/utilities/Q/Q.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,6 +130,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the Q and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C b/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C index 98b57ec487..5c1ed4a967 100644 --- a/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C +++ b/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -185,6 +185,12 @@ bool Foam::codedFunctionObject::end() } +bool Foam::codedFunctionObject::timeSet() +{ + return false; +} + + bool Foam::codedFunctionObject::read(const dictionary& dict) { dict.lookup("redirectType") >> redirectType_; diff --git a/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H b/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H index 84b48a91e6..f597407e1c 100644 --- a/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H +++ b/src/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -148,6 +148,9 @@ public: // By default it simply calls execute(). virtual bool end(); + //- Called when time was set at the end of the Time::operator++ + virtual bool timeSet(); + //- Read and set the function object if its data have changed virtual bool read(const dictionary&); diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C index fb60ce2527..fa26841aef 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,6 +104,12 @@ void Foam::dsmcFields::end() } +void Foam::dsmcFields::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::dsmcFields::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H index a88d3c2070..b6f7ae68d6 100644 --- a/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H +++ b/src/postProcessing/functionObjects/utilities/dsmcFields/dsmcFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,6 +123,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the dsmcFields and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index 014aefd8a0..5ea5b9034a 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -273,7 +273,7 @@ void Foam::pressureTools::read(const dictionary& dict) if (p.dimensions() != dimPressure) { dict.lookup("rhoRef") >> rhoInf_; - } + } dict.lookup("calcTotal") >> calcTotal_; if (calcTotal_) @@ -304,6 +304,12 @@ void Foam::pressureTools::end() } +void Foam::pressureTools::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::pressureTools::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H index 82a44921ed..6d80b388d1 100644 --- a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H @@ -241,6 +241,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the pressureTools and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C index ad392c506b..b63fe4acd8 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -66,7 +66,7 @@ Foam::wordList Foam::scalarTransport::boundaryTypes() const } } - return bTypes; + return bTypes; } @@ -228,7 +228,7 @@ void Foam::scalarTransport::execute() { schemeVar = UName_; } - + word divScheme("div(phi," + schemeVar + ")"); word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")"); @@ -303,6 +303,12 @@ void Foam::scalarTransport::end() } +void Foam::scalarTransport::timeSet() +{ + // Do nothing +} + + void Foam::scalarTransport::write() { // Do nothing diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index a58ed22680..ae3db7635c 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -170,6 +170,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the scalarTransport and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C index aa88880eee..9329ad6e3f 100644 --- a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C +++ b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -136,6 +136,12 @@ void Foam::timeActivatedFileUpdate::end() } +void Foam::timeActivatedFileUpdate::timeSet() +{ + // Do nothing +} + + void Foam::timeActivatedFileUpdate::write() { // Do nothing diff --git a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H index dc43ee39a3..e2f168eaf2 100644 --- a/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H +++ b/src/postProcessing/functionObjects/utilities/timeActivatedFileUpdate/timeActivatedFileUpdate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -152,6 +152,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the timeActivatedFileUpdate and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index 55a4011d6a..22942fa266 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -202,6 +202,12 @@ void Foam::wallShearStress::end() } +void Foam::wallShearStress::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::wallShearStress::write() { typedef compressible::turbulenceModel cmpModel; @@ -254,7 +260,7 @@ void Foam::wallShearStress::write() << "database" << exit(FatalError); } - + calcShearStress(mesh, Reff(), wallShearStress); if (log_) diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H index f8ecbbcfde..c2927eaad5 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -177,6 +177,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the wallShearStress and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index 789c06ddc7..1b4bc680af 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -248,6 +248,12 @@ void Foam::yPlusLES::end() } +void Foam::yPlusLES::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::yPlusLES::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.H b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.H index 78e7d38db7..94a2bb349a 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.H +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -153,6 +153,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the yPlusLES and write virtual void write(); diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index 663c6dda74..13412a300e 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -235,6 +235,12 @@ void Foam::yPlusRAS::end() } +void Foam::yPlusRAS::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::yPlusRAS::write() { if (active_) diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.H b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.H index 241c4b6a74..747f100ab4 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.H +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -140,6 +140,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Calculate the yPlusRAS and write virtual void write(); diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index 42d459ce01..03d1654fda 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -294,10 +294,20 @@ tmp thermoSingleLayer::q(volScalarField& hs) const { dimensionedScalar Tstd("Tstd", dimTemperature, 298.15); + volScalarField htcst = htcs_->h()(); + volScalarField htcwt = htcw_->h()(); + forAll(alpha_, i) + { + htcst[i] *= max(alpha_[i], ROOTVSMALL); + htcwt[i] *= max(alpha_[i], ROOTVSMALL); + } + htcst.correctBoundaryConditions(); + htcwt.correctBoundaryConditions(); + return ( - - fvm::Sp(htcs_->h()/Cp_, hs) - htcs_->h()*(Tstd - TPrimary_) - - fvm::Sp(htcw_->h()/Cp_, hs) - htcw_->h()*(Tstd - Tw_) + - fvm::Sp(htcst/Cp_, hs) - htcst*(Tstd - TPrimary_) + - fvm::Sp(htcwt/Cp_, hs) -htcwt*(Tstd - Tw_) ); } diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index 8652fa9a25..608049c7f7 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -293,6 +293,12 @@ void Foam::probes::end() } +void Foam::probes::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::probes::write() { if (size() && prepare()) diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 80a4037571..f72581dbd7 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -243,6 +243,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Sample and write virtual void write(); diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.C b/src/sampling/sampledSet/sampledSets/sampledSets.C index 44ea1691af..0286e54877 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.C +++ b/src/sampling/sampledSet/sampledSets/sampledSets.C @@ -188,6 +188,12 @@ void Foam::sampledSets::end() } +void Foam::sampledSets::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::sampledSets::write() { if (size()) diff --git a/src/sampling/sampledSet/sampledSets/sampledSets.H b/src/sampling/sampledSet/sampledSets/sampledSets.H index a2ad2f1418..54744bbbf8 100644 --- a/src/sampling/sampledSet/sampledSets/sampledSets.H +++ b/src/sampling/sampledSet/sampledSets/sampledSets.H @@ -288,6 +288,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Sample and write virtual void write(); diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C index 34d5bd5b96..b33d6b30b7 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C @@ -143,6 +143,12 @@ void Foam::sampledSurfaces::end() } +void Foam::sampledSurfaces::timeSet() +{ + // Do nothing - only valid on write +} + + void Foam::sampledSurfaces::write() { if (size()) diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H index 050b2b6e38..3390c00348 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H @@ -221,6 +221,9 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + //- Sample and write virtual void write(); diff --git a/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H b/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H index c1269e8000..7ecbb075eb 100644 --- a/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H +++ b/src/thermophysicalModels/solidSpecie/include/solidThermoPhysicsTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,13 +35,17 @@ Description #include "specie.H" #include "rhoConst.H" #include "hConstThermo.H" +#include "hPolynomialThermo.H" #include "hExponentialThermo.H" #include "constIsoSolidTransport.H" #include "constAnIsoSolidTransport.H" #include "exponentialSolidTransport.H" +#include "polynomialSolidTransport.H" + #include "sensibleEnthalpy.H" #include "thermo.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -57,8 +61,7 @@ namespace Foam >, sensibleEnthalpy > - > - hConstSolidThermoPhysics; + > hConstSolidThermoPhysics; typedef exponentialSolidTransport @@ -71,8 +74,23 @@ namespace Foam >, sensibleEnthalpy > - > - hExponentialSolidThermoPhysics; + > hExponentialSolidThermoPhysics; + + + typedef + polynomialSolidTransport + < + species::thermo + < + hPolynomialThermo + < + rhoConst, + 8 + >, + sensibleEnthalpy + >, + 8 + > hTransportThermoPoly8SolidThermoPhysics; } diff --git a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.C b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.C new file mode 100644 index 0000000000..7bddd6d822 --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.C @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "polynomialSolidTransport.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::polynomialSolidTransport::polynomialSolidTransport +( + Istream& is +) +: + Thermo(is), + kappaCoeffs_("kappaCoeffs<" + Foam::name(PolySize) + '>', is) +{ +} + + +template +Foam::polynomialSolidTransport::polynomialSolidTransport +( + const dictionary& dict +) +: + Thermo(dict), + kappaCoeffs_ + ( + dict.subDict("transport").lookup + ( + "kappaCoeffs<" + Foam::name(PolySize) + '>' + ) + ) +{ +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::polynomialSolidTransport::write(Ostream& os) const +{ + os << this->name() << endl; + os << token::BEGIN_BLOCK << incrIndent << nl; + + Thermo::write(os); + + dictionary dict("transport"); + + dict.add + ( + word("kappaCoeffs<" + Foam::name(PolySize) + '>'), + kappaCoeffs_ + ); + os << indent << dict.dictName() << dict; + + os << decrIndent << token::END_BLOCK << nl; +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const polynomialSolidTransport& pt +) +{ + os << static_cast(pt) << tab + << "kappaCoeffs<" << Foam::name(PolySize) << '>' << tab + << pt.kappaCoeffs_; + + os.check + ( + "Ostream& operator<<" + "(" + "Ostream&, " + "const polynomialSolidTransport&" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H new file mode 100644 index 0000000000..90a9e52f6a --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransport.H @@ -0,0 +1,237 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +Class + Foam::polynomialSolidTransport + +Description + Transport package using polynomial functions for solid kappa + +SourceFiles + polynomialSolidTransportI.H + polynomialSolidTransport.C + +\*---------------------------------------------------------------------------*/ + +#ifndef polynomialSolidTransport_H +#define polynomialSolidTransport_H + +#include "Polynomial.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template class polynomialSolidTransport; + +template +inline polynomialSolidTransport operator+ +( + const polynomialSolidTransport&, + const polynomialSolidTransport& +); + +template +inline polynomialSolidTransport operator- +( + const polynomialSolidTransport&, + const polynomialSolidTransport& +); + +template +inline polynomialSolidTransport operator* +( + const scalar, + const polynomialSolidTransport& +); + +template +inline polynomialSolidTransport operator== +( + const polynomialSolidTransport&, + const polynomialSolidTransport& +); + +template +Ostream& operator<< +( + Ostream&, + const polynomialSolidTransport& +); + + +/*---------------------------------------------------------------------------*\ + Class polynomialSolidTransport Declaration +\*---------------------------------------------------------------------------*/ + +template +class polynomialSolidTransport +: + public Thermo +{ + // Private data + + //- Thermal conductivity polynomial coefficients + // Note: input in [W/m/K] + Polynomial kappaCoeffs_; + + + // Private Member Functions + + //- Construct from components + inline polynomialSolidTransport + ( + const Thermo& t, + const Polynomial& kappaPoly + ); + + +public: + + // Constructors + + //- Construct copy + inline polynomialSolidTransport(const polynomialSolidTransport&); + + //- Construct as named copy + inline polynomialSolidTransport + ( + const word&, + const polynomialSolidTransport& + ); + + //- Construct from Istream + polynomialSolidTransport(Istream& is); + + //- Construct from dictionary + polynomialSolidTransport(const dictionary& dict); + + //- Construct and return a clone + inline autoPtr clone() const; + + // Selector from Istream + inline static autoPtr New(Istream& is); + + // Selector from dictionary + inline static autoPtr New + ( + const dictionary&dict + ); + + + // Member functions + + //- Return the instantiated type name + static word typeName() + { + return "polynomial<" + Thermo::typeName() + '>'; + } + + //- Is the thermal conductivity isotropic + static const bool isotropic = true; + + //- Dynamic viscosity [kg/ms] + inline scalar mu(const scalar p, const scalar T) const; + + //- Thermal conductivity [W/mK] + inline scalar kappa(const scalar p, const scalar T) const; + + //- Thermal conductivity [W/mK] + inline vector Kappa(const scalar p, const scalar T) const; + + //- Thermal diffusivity of enthalpy [kg/ms] + inline scalar alphah(const scalar p, const scalar T) const; + + + //- Write to Ostream + void write(Ostream& os) const; + + + // Member operators + + inline polynomialSolidTransport& operator= + ( + const polynomialSolidTransport& + ); + inline void operator+=(const polynomialSolidTransport&); + inline void operator-=(const polynomialSolidTransport&); + inline void operator*=(const scalar); + + + // Friend operators + + friend polynomialSolidTransport operator+ + ( + const polynomialSolidTransport&, + const polynomialSolidTransport& + ); + + friend polynomialSolidTransport operator- + ( + const polynomialSolidTransport&, + const polynomialSolidTransport& + ); + + friend polynomialSolidTransport operator* + ( + const scalar, + const polynomialSolidTransport& + ); + + friend polynomialSolidTransport operator== + ( + const polynomialSolidTransport&, + const polynomialSolidTransport& + ); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const polynomialSolidTransport& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "polynomialSolidTransportI.H" + +#ifdef NoRepository +# include "polynomialSolidTransport.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H new file mode 100644 index 0000000000..51dda6ba57 --- /dev/null +++ b/src/thermophysicalModels/solidSpecie/transport/polynomial/polynomialSolidTransportI.H @@ -0,0 +1,289 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#include "specie.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::polynomialSolidTransport:: +polynomialSolidTransport +( + const polynomialSolidTransport& pt +) +: + Thermo(pt), + kappaCoeffs_(pt.kappaCoeffs_) +{} + + +template +inline Foam::polynomialSolidTransport:: +polynomialSolidTransport +( + const Thermo& t, + const Polynomial& kappaCoeffs +) +: + Thermo(t), + kappaCoeffs_(kappaCoeffs) +{} + + +template +inline Foam::polynomialSolidTransport:: +polynomialSolidTransport +( + const word& name, + const polynomialSolidTransport& pt +) +: + Thermo(name, pt), + kappaCoeffs_(pt.kappaCoeffs_) +{} + + +template +inline Foam::autoPtr > +Foam::polynomialSolidTransport::clone() const +{ + return autoPtr > + ( + new polynomialSolidTransport(*this) + ); +} + + +template +inline Foam::autoPtr > +Foam::polynomialSolidTransport::New(Istream& is) +{ + return autoPtr > + ( + new polynomialSolidTransport(is) + ); +} + + +template +inline Foam::autoPtr > +Foam::polynomialSolidTransport::New(const dictionary& dict) +{ + return autoPtr > + ( + new polynomialSolidTransport(dict) + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline Foam::scalar Foam::polynomialSolidTransport::mu +( + const scalar p, + const scalar T +) const +{ + notImplemented + ( + "Foam::scalar Foam::polynomialSolidTransportmu::" + "(" + " const scalar p, const scalar T" + ") const" + ); + return scalar(0); +} + + +template +inline Foam::scalar Foam::polynomialSolidTransport::kappa +( + const scalar p, + const scalar T +) const +{ + return kappaCoeffs_.value(T); +} + + +template +inline Foam::vector Foam::polynomialSolidTransport::Kappa +( + const scalar p, + const scalar T +) const +{ + const scalar kappa(kappaCoeffs_.value(T)); + return vector(kappa, kappa, kappa); +} + + +template +inline Foam::scalar Foam::polynomialSolidTransport::alphah +( + const scalar p, const scalar T +) const +{ + return kappa(p, T)/this->Cpv(p, T); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template +inline Foam::polynomialSolidTransport& +Foam::polynomialSolidTransport::operator= +( + const polynomialSolidTransport& pt +) +{ + Thermo::operator=(pt); + + kappaCoeffs_ = pt.kappaCoeffs_; + + return *this; +} + + +template +inline void Foam::polynomialSolidTransport::operator+= +( + const polynomialSolidTransport& pt +) +{ + scalar molr1 = this->nMoles(); + + Thermo::operator+=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + kappaCoeffs_ = molr1*kappaCoeffs_ + molr2*pt.kappaCoeffs_; +} + + +template +inline void Foam::polynomialSolidTransport::operator-= +( + const polynomialSolidTransport& pt +) +{ + scalar molr1 = this->nMoles(); + + Thermo::operator-=(pt); + + molr1 /= this->nMoles(); + scalar molr2 = pt.nMoles()/this->nMoles(); + + kappaCoeffs_ = molr1*kappaCoeffs_ - molr2*pt.kappaCoeffs_; +} + + +template +inline void Foam::polynomialSolidTransport::operator*= +( + const scalar s +) +{ + Thermo::operator*=(s); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +template +inline Foam::polynomialSolidTransport Foam::operator+ +( + const polynomialSolidTransport& pt1, + const polynomialSolidTransport& pt2 +) +{ + Thermo t + ( + static_cast(pt1) + static_cast(pt2) + ); + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialSolidTransport + ( + t, + molr1*pt1.kappaCoeffs_ + molr2*pt2.kappaCoeffs_ + ); +} + + +template +inline Foam::polynomialSolidTransport Foam::operator- +( + const polynomialSolidTransport& pt1, + const polynomialSolidTransport& pt2 +) +{ + Thermo t + ( + static_cast(pt1) - static_cast(pt2) + ); + + scalar molr1 = pt1.nMoles()/t.nMoles(); + scalar molr2 = pt2.nMoles()/t.nMoles(); + + return polynomialSolidTransport + ( + t, + molr1*pt1.kappaCoeffs_ - molr2*pt2.kappaCoeffs_ + ); +} + + +template +inline Foam::polynomialSolidTransport Foam::operator* +( + const scalar s, + const polynomialSolidTransport& pt +) +{ + return polynomialSolidTransport + ( + s*static_cast(pt), + pt.kappaCoeffs_ + ); +} + + +template +inline Foam::polynomialSolidTransport Foam::operator== +( + const polynomialSolidTransport& pt1, + const polynomialSolidTransport& pt2 +) +{ + return pt2 - pt1; +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H index 85000a3c10..5193a4b9de 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/makeSolidThermo.H @@ -103,6 +103,58 @@ addToRunTimeSelectionTable \ ); + +#define makeSolidThermoPhysicsType(BaseThermo,Cthermo,Mixture,SolidPhysicsType)\ + \ + \ + \ +typedef \ + heThermo \ + < \ + BaseThermo, \ + Mixture \ + > heThermo##Mixture##SolidPhysicsType; \ + \ +typedef \ + Cthermo \ + < \ + BaseThermo, \ + Mixture \ + > Cthermo##Mixture##SolidPhysicsType; \ + \ + \ +defineTemplateTypeNameAndDebugWithName \ +( \ + Cthermo##Mixture##SolidPhysicsType, \ + ( \ + #Cthermo"<"#Mixture"<" \ + + SolidPhysicsType::typeName() \ + + ">>" \ + ).c_str(), \ + 0 \ +); \ + \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + Cthermo##Mixture##SolidPhysicsType, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + BaseThermo, \ + Cthermo##Mixture##SolidPhysicsType, \ + fvMesh \ +); \ + \ +addToRunTimeSelectionTable \ +( \ + BaseThermo, \ + Cthermo##Mixture##SolidPhysicsType, \ + dictionary \ +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C b/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C index 6814431fec..020dbfda92 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,14 +31,17 @@ License #include "rhoConst.H" #include "hConstThermo.H" #include "hExponentialThermo.H" +#include "hPolynomialThermo.H" #include "constIsoSolidTransport.H" #include "constAnIsoSolidTransport.H" #include "exponentialSolidTransport.H" +#include "polynomialSolidTransport.H" #include "pureMixture.H" #include "sensibleEnthalpy.H" #include "sensibleInternalEnergy.H" #include "thermo.H" +#include "solidThermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,6 +86,14 @@ makeSolidThermo specie ); +makeSolidThermoPhysicsType +( + solidThermo, + heSolidThermo, + pureMixture, + hTransportThermoPoly8SolidThermoPhysics +); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/specie/transport/const/constTransportI.H b/src/thermophysicalModels/specie/transport/const/constTransportI.H index 98ce21d97e..9949fddae4 100644 --- a/src/thermophysicalModels/specie/transport/const/constTransportI.H +++ b/src/thermophysicalModels/specie/transport/const/constTransportI.H @@ -111,7 +111,7 @@ inline Foam::scalar Foam::constTransport::kappa const scalar T ) const { - return this->Cp(p, T)*mu(p, T)*rPr_; + return this->Cpv(p, T)*mu(p, T)*rPr_; } diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H index a2ff3f4d22..9a5ad80d5e 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransportI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -129,7 +129,7 @@ inline Foam::scalar Foam::polynomialTransport::alphah const scalar p, const scalar T ) const { - return kappa(p, T)/this->Cp(p, T); + return kappa(p, T)/this->Cpv(p, T); } diff --git a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H index 7a0845cfb5..01668dda17 100644 --- a/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H +++ b/src/thermophysicalModels/specie/transport/sutherland/sutherlandTransportI.H @@ -158,7 +158,7 @@ inline Foam::scalar Foam::sutherlandTransport::alphah ) const { - return kappa(p, T)/this->Cp(p, T); + return kappa(p, T)/this->Cpv(p, T); }