diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H index 5abc7e5808..a9495fe836 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H @@ -242,6 +242,9 @@ public: //- Return const access to the source active flag inline bool active() const; + //- Return const access to the applied flag + inline bool applied() const; + //- Return const access to the time start inline scalar timeStart() const; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H index 127db8a60f..47c348e105 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H @@ -51,6 +51,12 @@ inline bool Foam::basicSource::active() const } +inline bool Foam::basicSource::applied() const +{ + return applied_; +} + + inline Foam::scalar Foam::basicSource::timeStart() const { return timeStart_; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C index 4fb8a8a0d8..8b471084e3 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C @@ -33,6 +33,24 @@ namespace Foam defineTypeNameAndDebug(basicSourceList, 0); } + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::basicSourceList::checkApplied() const +{ + forAll(*this, i) + { + const basicSource& bs = this->operator[](i); + + if (!bs.applied()) + { + WarningIn("void Foam::basicSourceList::checkApplied() const") + << "Source " << bs.name() << " defined, but not used" << endl; + } + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::basicSourceList::basicSourceList diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H index 956c5fe4c8..010083b936 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H @@ -62,6 +62,9 @@ private: // Private Member Functions + //- Check that all sources have been applied + void checkApplied() const; + //- Disallow default bitwise copy construct basicSourceList(const basicSourceList&); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C index 51ac28bd97..7a9a7098b7 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C @@ -23,11 +23,19 @@ License \*---------------------------------------------------------------------------*/ +#include "fvMesh.H" +#include "Time.H" + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template void Foam::basicSourceList::apply(fvMatrix& eqn) { + if (mesh_.time().timeIndex() == mesh_.time().startTimeIndex() + 1) + { + checkApplied(); + } + const word& fieldName = eqn.psi().name(); forAll(*this, i)