55 cellValueSourceCorrection_(false),
57 resetSourcesOnStartup_(true),
68 sourceTerms.readIfPresent(
"resetOnStartup", resetSourcesOnStartup_);
70 if (resetSourcesOnStartup_)
72 Info<<
"Cloud source terms will be reset" <<
endl;
76 Info<<
"Cloud source terms will be held constant" <<
endl;
91 transient_(cs.transient_),
92 calcFrequency_(cs.calcFrequency_),
93 logFrequency_(cs.logFrequency_),
96 trackTime_(cs.trackTime_),
97 deltaTMax_(cs.deltaTMax_),
98 coupled_(cs.coupled_),
99 cellValueSourceCorrection_(cs.cellValueSourceCorrection_),
100 maxTrackTime_(cs.maxTrackTime_),
101 resetSourcesOnStartup_(cs.resetSourcesOnStartup_),
102 schemes_(cs.schemes_)
119 cellValueSourceCorrection_(false),
121 resetSourcesOnStartup_(false),
131 transient_ = dict_.getOrDefault(
"transient",
false);
139 <<
"Transient tracking is not supported for LTS"
140 " simulations, switching to steady state tracking."
148 <<
"Transient tracking is not supported for steady-state"
149 " simulations, switching to steady state tracking."
155 dict_.readEntry(
"coupled", coupled_);
156 dict_.readEntry(
"cellValueSourceCorrection", cellValueSourceCorrection_);
157 dict_.readIfPresent(
"maxCo", maxCo_);
158 dict_.readIfPresent(
"deltaTMax", deltaTMax_);
160 dict_.readIfPresent(
"logFrequency", logFrequency_);
164 dict_.readEntry(
"calcFrequency", calcFrequency_);
165 dict_.readEntry(
"maxTrackTime", maxTrackTime_);
169 dict_.subDict(
"sourceTerms").lookup(
"resetOnStartup")
170 >> resetSourcesOnStartup_;
177 schemesDict(dict_.subDict(
"sourceTerms").subDict(
"schemes"));
180 schemes_.setSize(vars.size());
184 schemes_[i].first() = vars[i];
187 ITstream& is = schemesDict.lookup(vars[i]);
188 const word scheme(is);
189 if (scheme ==
"semiImplicit")
191 schemes_[i].second().first() =
true;
193 else if (scheme ==
"explicit")
195 schemes_[i].second().first() =
false;
200 <<
"Invalid scheme " << scheme <<
". Valid schemes are "
205 is >> schemes_[i].second().second();
213 for (
const auto& scheme : schemes_)
215 if (fieldName == scheme.first())
217 return scheme.second().second();
224 <<
"Field name " << fieldName <<
" not found in schemes. "
225 <<
"Setting relaxation factor to 1" <<
endl;
234 for (
const auto& scheme : schemes_)
236 if (fieldName == scheme.first())
238 return scheme.second().first();
245 <<
"Field name " << fieldName <<
" not found in schemes. "
246 <<
"Setting relaxation factor to 1" <<
endl;
258 mesh_.time().writeTime()
259 || (mesh_.time().timeIndex() % calcFrequency_ == 0)
268 trackTime_ = mesh_.time().deltaTValue();
272 trackTime_ = maxTrackTime_;
275 return solveThisStep();
283 && (logFrequency_ > 0)
284 && (mesh_.time().timeIndex() % logFrequency_ == 0);
290 return active_ && mesh_.time().writeTime();
298 return min(deltaTMax_, maxCo_*trackTime);
An input stream of tokens.
void size(const label n)
Older name for setAddressableSize.
Stores all relevant solution info for cloud.
const Switch steadyState() const
Return const access to the steady flag.
scalar trackTime() const
Return the particle track time.
bool canEvolve()
Returns true if possible to evolve the cloud and sets timestep parameters.
bool log() const
Returns true if possible to log this step.
bool semiImplicit(const word &fieldName) const
Return semi-implicit flag coefficient for field.
bool output() const
Returns true if writing this step.
void read()
Read properties from dictionary.
scalar deltaLMax(const scalar lRef) const
Return the maximum integration length.
const dictionary & dict() const
Return const access to the dictionary.
scalar relaxCoeff(const word &fieldName) const
Return relaxation coefficient for field.
static int debug
Debug switch.
const fvMesh & mesh() const
Return reference to the mesh.
scalar deltaTMax() const
Return the maximum integration time step.
cloudSolution(const fvMesh &mesh)
Construct null from mesh reference.
bool solveThisStep() const
Returns true if performing a cloud iteration this calc step.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
Find and return a sub-dictionary as a copy, otherwise return an empty dictionary.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
wordList toc() const
Return the table of contents.
Mesh data needed to do the Finite Volume discretisation.
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
Lookup type of boundary radiation properties.
A class for handling words, derived from Foam::string.
#define defineDebugSwitchWithName(Type, Name, Value)
Define the debug information, lookup as Name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
List< word > wordList
List of word.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.