cloudSolution: Check consistency between the transient option

and the continuous-phase simulation type

For LTS and steady-state simulations the transient option does not need to be
provided as only steady-state tracking is appropriate.  For transient running
the Lagrangian tracking may be steady or transient.
This commit is contained in:
Henry Weller
2017-08-22 13:58:25 +01:00
committed by Andrew Heather
parent 3f5103235e
commit 076cf421f3
3 changed files with 27 additions and 4 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "cloudSolution.H" #include "cloudSolution.H"
#include "Time.H" #include "Time.H"
#include "localEulerDdtScheme.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -119,7 +120,31 @@ Foam::cloudSolution::~cloudSolution()
void Foam::cloudSolution::read() void Foam::cloudSolution::read()
{ {
dict_.lookup("transient") >> transient_; // For transient runs the Lagrangian tracking may be transient or steady
transient_ = dict_.lookupOrDefault("transient", false);
// For LTS and steady-state runs the Lagrangian tracking cannot be transient
if (transient_)
{
if (fv::localEulerDdt::enabled(mesh_))
{
IOWarningInFunction(dict_)
<< "Transient tracking is not supported for LTS"
" simulations, switching to steady state tracking."
<< endl;
transient_ = false;
}
if (mesh_.steady())
{
IOWarningInFunction(dict_)
<< "Transient tracking is not supported for steady-state"
" simulations, switching to steady state tracking."
<< endl;
transient_ = false;
}
}
dict_.lookup("coupled") >> coupled_; dict_.lookup("coupled") >> coupled_;
dict_.lookup("cellValueSourceCorrection") >> cellValueSourceCorrection_; dict_.lookup("cellValueSourceCorrection") >> cellValueSourceCorrection_;
dict_.readIfPresent("maxCo", maxCo_); dict_.readIfPresent("maxCo", maxCo_);

View File

@ -19,7 +19,6 @@ solution
{ {
active yes; active yes;
transient no; // yes;
calcFrequency 10; calcFrequency 10;
maxTrackTime 5.0; maxTrackTime 5.0;
maxCo 0.3; maxCo 0.3;

View File

@ -19,7 +19,6 @@ solution
{ {
active yes; active yes;
transient no; // yes;
calcFrequency 10; calcFrequency 10;
maxTrackTime 5.0; maxTrackTime 5.0;
maxCo 0.3; maxCo 0.3;