diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index 416d297f77..378e088c34 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -104,6 +104,8 @@ taking film into account + Parallel aware *** *New* ptscotch decomposition method +*** *Updated* decomposePar maps polyPatches instead of recreating them so + polyPatches holding data can map the data. *** *Updated* particle tracking algorithm + uses non-blocking parallel transfers + does 'minimum-tet' decomposition of face to work with warped faces (snappyHexMesh!) @@ -150,7 +152,12 @@ OpenFOAM. + *New* wall functions: + kappatJayatillekeWallFunction: incompressible RAS thermal wall function - + + directMappedFixedValue: + + takes interpolationScheme so can interpolate instead of always getting + cell value + + takes optional fieldName to sample + + directMapped patch added 'normal' method to calculate sample points + to e.g. sample fields just above wall (e.g. for streaklines) * Utilities There have been some utilities added and updated in this release. *** *New* utilities @@ -172,7 +179,7 @@ *** Updated utilities + =setFields=: optionally use faceSets to set patch values (see e.g. hotRoom tutorial). + =blockMesh=: specify patches via dictionary instead of type only. This - makes rereading the boundary superfluous. see + makes rereading the boundary file superfluous. see e.g. pitzDailyDirectMapped tutorial. * Post-processing + =foamToEnsight=: parallel continuous data. new =-nodeValues= option to generate and output nodal @@ -190,6 +197,12 @@ specified time has been reached, e.g. to automagically change fvSchemes and fvSolution during a calculation + =streamLine=: generate streamlines; ouputs both trajectory and field data + + =surfaceInterpolateFields=: constructs face interpolate of registered + volFields for any future functionObjects that need surfaceFields. + + =readFields=: reads field if not yet registered. Makes functionObjects + useable through standalone execFlowFunctionObjects. + + =faceSource=: can now calculate on a sampledSurface (e.g. flow through a + triSurfaceMesh) * New tutorials There is a large number of new tutorials for existing and new solvers in the diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C index 069ef6de93..318262d9d7 100644 --- a/src/OSspecific/POSIX/fileMonitor.C +++ b/src/OSspecific/POSIX/fileMonitor.C @@ -319,7 +319,7 @@ void Foam::fileMonitor::checkFiles() const if (ready < 0) { - FatalErrorIn("fileMonitor::updateStates()") + FatalErrorIn("fileMonitor::checkFiles()") << "Problem in issuing select." << abort(FatalError); } @@ -335,7 +335,7 @@ void Foam::fileMonitor::checkFiles() const if (nBytes < 0) { - FatalErrorIn("fileMonitor::updateStates(const fileName&)") + FatalErrorIn("fileMonitor::checkFiles()") << "read of " << watcher_->inotifyFd_ << " failed with " << label(nBytes) << abort(FatalError); @@ -374,7 +374,7 @@ void Foam::fileMonitor::checkFiles() const ) { // Correct directory and name - state_[i] = MODIFIED; + localState_[i] = MODIFIED; } } } @@ -403,18 +403,17 @@ void Foam::fileMonitor::checkFiles() const if (newTime == 0) { - state_[watchFd] = DELETED; + localState_[watchFd] = DELETED; } else { if (newTime > (oldTime + regIOobject::fileModificationSkew)) { - watcher_->lastMod_[watchFd] = newTime; - state_[watchFd] = MODIFIED; + localState_[watchFd] = MODIFIED; } else { - state_[watchFd] = UNMODIFIED; + localState_[watchFd] = UNMODIFIED; } } } @@ -422,12 +421,14 @@ void Foam::fileMonitor::checkFiles() const } } + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fileMonitor::fileMonitor(const bool useInotify) : useInotify_(useInotify), + localState_(20), state_(20), watchFile_(20), freeWatchFds_(2), @@ -476,6 +477,7 @@ Foam::label Foam::fileMonitor::addWatch(const fileName& fName) } else { + localState_(watchFd) = UNMODIFIED; state_(watchFd) = UNMODIFIED; watchFile_(watchFd) = fName; } @@ -517,30 +519,26 @@ void Foam::fileMonitor::updateStates { if (Pstream::master() || !masterOnly) { + // Update the localState_ checkFiles(); } if (syncPar) { - // Pack current state (might be on master only) + // Pack local state (might be on master only) PackedList<2> stats(state_.size(), MODIFIED); if (Pstream::master() || !masterOnly) { forAll(state_, watchFd) { - stats[watchFd] = static_cast(state_[watchFd]); + stats[watchFd] = static_cast + ( + localState_[watchFd] + ); } } - // Save local state for warning message below - PackedList<2> thisProcStats; - if (!masterOnly) - { - thisProcStats = stats; - } - - // Scatter or reduce to synchronise state if (masterOnly) { @@ -573,33 +571,34 @@ void Foam::fileMonitor::updateStates } - // Update local state + // Update synchronised state forAll(state_, watchFd) { - if (masterOnly) + // Assign synchronised state + unsigned int stat = stats[watchFd]; + state_[watchFd] = fileState(stat); + + if (!masterOnly) { - // No need to check for inconsistent state. Just assign. - unsigned int stat = stats[watchFd]; - state_[watchFd] = fileState(stat); - } - else - { - // Check for inconsistent state before assigning. - if (thisProcStats[watchFd] != UNMODIFIED) + // Give warning for inconsistent state + if (state_[watchFd] != localState_[watchFd]) { - if (stats[watchFd] == UNMODIFIED) + if (debug) { - WarningIn("fileMonitor::updateStates(const bool) const") - << "Delaying reading " << watchFile_[watchFd] + Pout<< "fileMonitor : Delaying reading " + << watchFile_[watchFd] << " due to inconsistent " "file time-stamps between processors" << endl; } - else - { - unsigned int stat = stats[watchFd]; - state_[watchFd] = fileState(stat); - } + + WarningIn + ( + "fileMonitor::updateStates" + "(const bool, const bool) const" + ) << "Delaying reading " << watchFile_[watchFd] + << " due to inconsistent " + "file time-stamps between processors" << endl; } } } @@ -610,6 +609,7 @@ void Foam::fileMonitor::updateStates void Foam::fileMonitor::setUnmodified(const label watchFd) { state_[watchFd] = UNMODIFIED; + localState_[watchFd] = UNMODIFIED; if (!useInotify_) { diff --git a/src/OSspecific/POSIX/fileMonitor.H b/src/OSspecific/POSIX/fileMonitor.H index d19c3b0e90..bdb0dd2bb2 100644 --- a/src/OSspecific/POSIX/fileMonitor.H +++ b/src/OSspecific/POSIX/fileMonitor.H @@ -71,7 +71,7 @@ public: { UNMODIFIED = 0, MODIFIED = 1, - DELETED = 2, + DELETED = 2 }; static const NamedEnum fileStateNames_; @@ -82,7 +82,10 @@ private: //- Whether to use inotify (requires -DFOAM_USE_INOTIFY, see above) const bool useInotify_; - //- State for all watchFds + //- State for all watchFds based on local files + mutable DynamicList localState_; + + //- State for all watchFds - synchronised mutable DynamicList state_; //- Filename for all watchFds @@ -97,7 +100,7 @@ private: // Private Member Functions - //- Update state_ from any events. + //- Update localState_ from any events. void checkFiles() const; //- Disallow default bitwise copy construct diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 2367d79c60..f43cb4f44e 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -60,7 +60,6 @@ Foam::regIOobject::fileCheckTypes Foam::regIOobject::fileModificationChecking debug::optimisationSwitches().lookup ( "fileModificationChecking" - //Foam::regIOobject::timeStamp ) ) ); diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index d1ee0a63f7..ee623a30bb 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -31,6 +31,7 @@ License #include "IOobject.H" #include "JobInfo.H" #include "labelList.H" +#include "regIOobject.H" #include @@ -767,6 +768,16 @@ Foam::argList::argList sigQuit_.set(bannerEnabled); sigSegv_.set(bannerEnabled); + if (bannerEnabled) + { + Info<< "Monitoring run-time modified files using " + << regIOobject::fileCheckTypesNames + [ + regIOobject::fileModificationChecking + ] + << endl; + } + if (Pstream::master() && bannerEnabled) { Info<< endl; diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 1fb312298e..b0bc7a8d0c 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -62,37 +62,29 @@ void Foam::Particle::correctAfterParallelTransfer if (!ppp.parallel()) { - if (ppp.forwardT().size() == 1) - { - const tensor& T = ppp.forwardT()[0]; - transformPosition(T); - static_cast(*this).transformProperties(T); - } - else - { - const tensor& T = ppp.forwardT()[faceI_]; - transformPosition(T); - static_cast(*this).transformProperties(T); - } + const tensor& T = + ( + ppp.forwardT().size() == 1 + ? ppp.forwardT()[0] + : ppp.forwardT()[faceI_] + ); + + transformPosition(T); + static_cast(*this).transformProperties(T); } else if (ppp.separated()) { - if (ppp.separation().size() == 1) - { - position_ -= ppp.separation()[0]; - static_cast(*this).transformProperties - ( - -ppp.separation()[0] - ); - } - else - { - position_ -= ppp.separation()[faceI_]; - static_cast(*this).transformProperties - ( - -ppp.separation()[faceI_] - ); - } + const vector& s = + ( + (ppp.separation().size() == 1) + ? ppp.separation()[0] + : ppp.separation()[faceI_] + ); + position_ -= s; + static_cast(*this).transformProperties + ( + -s + ); } tetFaceI_ = faceI_ + ppp.start(); @@ -815,21 +807,34 @@ void Foam::Particle::hitCyclicPatch // See note in correctAfterParallelTransfer for tetPtI_ addressing. tetPtI_ = cloud_.polyMesh_.faces()[tetFaceI_].size() - 1 - tetPtI_; + const cyclicPolyPatch& receiveCpp = cpp.neighbPatch(); + // Now the particle is on the receiving side - if (!cpp.parallel()) + if (!receiveCpp.parallel()) { - const tensor& T = cpp.reverseT()[0]; + const tensor& T = + ( + receiveCpp.forwardT().size() == 1 + ? receiveCpp.forwardT()[0] + : receiveCpp.forwardT()[receiveCpp.whichFace(faceI_)] + ); transformPosition(T); static_cast(*this).transformProperties(T); } - else if (cpp.separated()) + else if (receiveCpp.separated()) { - position_ += cpp.separation()[0]; + const vector& s = + ( + (receiveCpp.separation().size() == 1) + ? receiveCpp.separation()[0] + : receiveCpp.separation()[receiveCpp.whichFace(faceI_)] + ); + position_ -= s; static_cast(*this).transformProperties ( - cpp.separation()[0] + -s ); } } diff --git a/applications/utilities/miscellaneous/foamFormatConvert/fieldDictionary.H b/src/meshTools/sets/cellSources/fieldToCell/fieldDictionary.H similarity index 100% rename from applications/utilities/miscellaneous/foamFormatConvert/fieldDictionary.H rename to src/meshTools/sets/cellSources/fieldToCell/fieldDictionary.H diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C index dd5a540f69..e88c08db31 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C @@ -28,6 +28,7 @@ License #include "cellSet.H" #include "Time.H" #include "IFstream.H" +#include "fieldDictionary.H" #include "addToRunTimeSelectionTable.H" @@ -207,7 +208,7 @@ void Foam::fieldToCell::applyToSet IFstream str(fieldObject.filePath()); // Read dictionary - dictionary fieldDict(str); + fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName()); scalarField internalVals("internalField", fieldDict, mesh().nCells()); @@ -218,7 +219,7 @@ void Foam::fieldToCell::applyToSet IFstream str(fieldObject.filePath()); // Read dictionary - dictionary fieldDict(str); + fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName()); vectorField internalVals("internalField", fieldDict, mesh().nCells());