Update multiSolver libraries
This commit is contained in:
parent
d143ebc16b
commit
9630e8099e
57 changed files with 2487 additions and 474 deletions
|
@ -1,7 +1,6 @@
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/multiSolver/lnInclude \
|
-I../../../../src/multiSolver/lnInclude
|
||||||
-I$(LIB_SRC)/multiSolver/multiSolver
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|
|
@ -26,7 +26,8 @@ Application
|
||||||
multiSolverDemo
|
multiSolverDemo
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Demonstration multiSolver-enabled application.
|
Combination of icoFoam and scalarTransportFoam for testing of new multiTime
|
||||||
|
framework.
|
||||||
|
|
||||||
Author
|
Author
|
||||||
David L. F. Gaden
|
David L. F. Gaden
|
||||||
|
@ -61,8 +62,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
# include "solverScalarTransportFoam.H"
|
# include "solverScalarTransportFoam.H"
|
||||||
|
|
||||||
|
// Only necessary if we revisit the same solver domain twice in the same
|
||||||
|
// superLoop (scalarTransportFoam, in this case)
|
||||||
multiRun++;
|
multiRun++;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * icoFoam2 * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * icoFoam2 * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info << "*** Switching to icoFoam2 ***\n" << endl;
|
Info << "*** Switching to icoFoam2 ***\n" << endl;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
volScalarField rUA = 1.0/UEqn.A();
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
U = rUA*UEqn.H();
|
U = rUA*UEqn.H();
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
+ fvc::ddtPhiCorr(rUA, U, phi);
|
||||||
|
|
||||||
adjustPhi(phi, U, p);
|
adjustPhi(phi, U, p);
|
||||||
|
|
|
@ -12,7 +12,13 @@
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
# include "readSIMPLEControls.H"
|
dictionary simple = mesh.solutionDict().subDict("SIMPLE");
|
||||||
|
|
||||||
|
int nNonOrthCorr =
|
||||||
|
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||||
|
|
||||||
|
bool momentumPredictor =
|
||||||
|
simple.lookupOrDefault<Switch>("momentumPredictor", true);
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/multiSolver/lnInclude \
|
-I../../../../src/multiSolver/lnInclude
|
||||||
-I$(LIB_SRC)/multiSolver/multiSolver
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|
|
@ -49,11 +49,18 @@ void parseOptions
|
||||||
IStringStream optionsStream(options);
|
IStringStream optionsStream(options);
|
||||||
label nSolverDomains(0);
|
label nSolverDomains(0);
|
||||||
label nSuperLoops(0);
|
label nSuperLoops(0);
|
||||||
|
|
||||||
// Get solverDomainNames, if any
|
// Get solverDomainNames, if any
|
||||||
while (not optionsStream.eof())
|
while (not optionsStream.eof())
|
||||||
{
|
{
|
||||||
token nextOption(optionsStream);
|
token nextOption(optionsStream);
|
||||||
|
|
||||||
|
// Bug workaround
|
||||||
|
if (nextOption.type() == token::ERROR)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (nextOption.isLabel())
|
if (nextOption.isLabel())
|
||||||
{
|
{
|
||||||
ptrSuperLoops->setSize(++nSuperLoops);
|
ptrSuperLoops->setSize(++nSuperLoops);
|
||||||
|
@ -76,18 +83,25 @@ void parseOptions
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get superLoopList
|
// Get superLoopList
|
||||||
while (not optionsStream.eof())
|
while (not optionsStream.eof())
|
||||||
{
|
{
|
||||||
token nextOption(optionsStream);
|
token nextOption(optionsStream);
|
||||||
|
|
||||||
|
// Bug workaround
|
||||||
|
if (nextOption.type() == token::ERROR)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (nextOption.isLabel())
|
if (nextOption.isLabel())
|
||||||
{
|
{
|
||||||
ptrSuperLoops->setSize(++nSuperLoops);
|
ptrSuperLoops->setSize(++nSuperLoops);
|
||||||
ptrSuperLoops->operator[](nSuperLoops - 1)
|
ptrSuperLoops->operator[](nSuperLoops - 1)
|
||||||
= nextOption.labelToken();
|
= nextOption.labelToken();
|
||||||
}
|
}
|
||||||
else if (nSuperLoops > 0)
|
else if (nSuperLoops > 0)
|
||||||
{
|
{
|
||||||
// might be a range -> label : label
|
// might be a range -> label : label
|
||||||
|
|
||||||
|
@ -104,7 +118,7 @@ void parseOptions
|
||||||
(
|
(
|
||||||
ptrSuperLoops->operator[](nSuperLoops - 1)
|
ptrSuperLoops->operator[](nSuperLoops - 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (toValue > fromValue)
|
if (toValue > fromValue)
|
||||||
{
|
{
|
||||||
// correct range format
|
// correct range format
|
||||||
|
@ -182,20 +196,20 @@ int main(int argc, char *argv[])
|
||||||
argList::validOptions.insert("postDecompose", "");
|
argList::validOptions.insert("postDecompose", "");
|
||||||
argList::validOptions.insert("preReconstruct", "");
|
argList::validOptions.insert("preReconstruct", "");
|
||||||
argList::validOptions.insert("postReconstruct", "");
|
argList::validOptions.insert("postReconstruct", "");
|
||||||
|
|
||||||
argList::validOptions.insert("global","");
|
argList::validOptions.insert("global","");
|
||||||
argList::validOptions.insert("local","");
|
argList::validOptions.insert("local","");
|
||||||
|
|
||||||
// default behaviour is purge the case/[time] directory before '-load'
|
// default behaviour is purge the case/[time] directory before '-load'
|
||||||
// command. '-noPurge' prevents this. Allows for more complicated
|
// command. '-noPurge' prevents this. Allows for more complicated
|
||||||
// load data selections by executing multiSolver several times
|
// load data selections by executing multiSolver several times
|
||||||
argList::validOptions.insert("noPurge","");
|
argList::validOptions.insert("noPurge","");
|
||||||
|
|
||||||
// default behaviour is: if there is only one solverDomain specified, use
|
// default behaviour is: if there is only one solverDomain specified, use
|
||||||
// setSolverDomain() on it. Same as multiSolver -set solverDomain.
|
// setSolverDomain() on it. Same as multiSolver -set solverDomain.
|
||||||
// '-noSet' prevents this.
|
// '-noSet' prevents this.
|
||||||
argList::validOptions.insert("noSet","");
|
argList::validOptions.insert("noSet","");
|
||||||
|
|
||||||
// default behaviour is: if there are storeFields defined, when loading, it
|
// default behaviour is: if there are storeFields defined, when loading, it
|
||||||
// will copy the store fields into every time instance where they are
|
// will copy the store fields into every time instance where they are
|
||||||
// absent. '-noStore' will prevent this.
|
// absent. '-noStore' will prevent this.
|
||||||
|
@ -224,7 +238,7 @@ int main(int argc, char *argv[])
|
||||||
bool noSet = false;
|
bool noSet = false;
|
||||||
bool noStore = false;
|
bool noStore = false;
|
||||||
label nCommands(0);
|
label nCommands(0);
|
||||||
|
|
||||||
// Read arguments
|
// Read arguments
|
||||||
if (args.optionFound("list"))
|
if (args.optionFound("list"))
|
||||||
{
|
{
|
||||||
|
@ -331,7 +345,7 @@ int main(int argc, char *argv[])
|
||||||
args.rootPath(),
|
args.rootPath(),
|
||||||
args.caseName()
|
args.caseName()
|
||||||
);
|
);
|
||||||
|
|
||||||
const IOdictionary& mcd(multiRun.multiControlDict());
|
const IOdictionary& mcd(multiRun.multiControlDict());
|
||||||
wordList solverDomains(0);
|
wordList solverDomains(0);
|
||||||
labelList superLoops(0);
|
labelList superLoops(0);
|
||||||
|
@ -420,7 +434,7 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
// Incorrect solver domain name
|
// Incorrect solver domain name
|
||||||
FatalErrorIn("multiSolver::main")
|
FatalErrorIn("multiSolver::main")
|
||||||
<< "solverDomainName " << solverDomains[i] << " is not "
|
<< "solverDomainName " << solverDomains[i] << "is not "
|
||||||
<< "found."
|
<< "found."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -504,7 +518,7 @@ int main(int argc, char *argv[])
|
||||||
<< "No data found with specified parameters."
|
<< "No data found with specified parameters."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
|
@ -517,7 +531,7 @@ int main(int argc, char *argv[])
|
||||||
(
|
(
|
||||||
multiRun.multiDictRegistry().path()/"multiSolver"
|
multiRun.multiDictRegistry().path()/"multiSolver"
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll(solverDomains, i)
|
forAll(solverDomains, i)
|
||||||
{
|
{
|
||||||
if (solverDomains[i] == "default") continue;
|
if (solverDomains[i] == "default") continue;
|
||||||
|
@ -561,7 +575,7 @@ int main(int argc, char *argv[])
|
||||||
<< endl;
|
<< endl;
|
||||||
multiRun.purgeTimeDirs(multiRun.multiDictRegistry().path());
|
multiRun.purgeTimeDirs(multiRun.multiDictRegistry().path());
|
||||||
}
|
}
|
||||||
|
|
||||||
Info << "Loading data from multiSolver directories to case root"
|
Info << "Loading data from multiSolver directories to case root"
|
||||||
<< endl;
|
<< endl;
|
||||||
if
|
if
|
||||||
|
@ -634,7 +648,7 @@ int main(int argc, char *argv[])
|
||||||
(
|
(
|
||||||
dirEntries[de]
|
dirEntries[de]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Copy system to processorN
|
// Copy system to processorN
|
||||||
cp
|
cp
|
||||||
(
|
(
|
||||||
|
@ -642,7 +656,7 @@ int main(int argc, char *argv[])
|
||||||
/multiRun.multiDictRegistry().system(),
|
/multiRun.multiDictRegistry().system(),
|
||||||
multiRun.multiDictRegistry().path()/dirEntries[de]
|
multiRun.multiDictRegistry().path()/dirEntries[de]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Copy constant/files to processorN/constant
|
// Copy constant/files to processorN/constant
|
||||||
fileNameList constantContents
|
fileNameList constantContents
|
||||||
(
|
(
|
||||||
|
@ -664,7 +678,7 @@ int main(int argc, char *argv[])
|
||||||
/multiRun.multiDictRegistry().constant()
|
/multiRun.multiDictRegistry().constant()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy constant/directories to processorN/constant
|
// Copy constant/directories to processorN/constant
|
||||||
constantContents = readDir
|
constantContents = readDir
|
||||||
(
|
(
|
||||||
|
@ -731,7 +745,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info << "Purging preconditioned time directories"
|
Info << "Purging preconditioned time directories"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
// Clean up extra time directories
|
// Clean up extra time directories
|
||||||
fileNameList dirEntries
|
fileNameList dirEntries
|
||||||
(
|
(
|
||||||
|
@ -758,7 +772,7 @@ int main(int argc, char *argv[])
|
||||||
// Execute set command - either from an explicit '-set' or from a '-load'
|
// Execute set command - either from an explicit '-set' or from a '-load'
|
||||||
// with only one solverDomain as an option
|
// with only one solverDomain as an option
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(command == set)
|
(command == set)
|
||||||
|| (
|
|| (
|
||||||
|
|
|
@ -67,5 +67,4 @@ fvAgglomerationMethods/Allwmake
|
||||||
wmake libso engine
|
wmake libso engine
|
||||||
|
|
||||||
wmake libso multiSolver
|
wmake libso multiSolver
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
dummyControlDict/dummyControlDict.C
|
dummyControlDict/dummyControlDict.C
|
||||||
|
multiTime/multiTime.C
|
||||||
multiSolver/multiSolver.C
|
multiSolver/multiSolver.C
|
||||||
timeCluster/timeCluster.C
|
timeCluster/timeCluster.C
|
||||||
timeCluster/timeClusterList.C
|
timeCluster/timeClusterList.C
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
EXE_INC = \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-Ituple2Lists
|
|
||||||
|
|
||||||
LIB_LIBS = \
|
|
||||||
-lfiniteVolume
|
|
|
@ -108,4 +108,3 @@ Foam::dummyControlDict::~dummyControlDict()
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
|
|
||||||
//- Construct, reading the multiControlDict data from a file
|
//- Construct, reading the multiControlDict data from a file
|
||||||
explicit dummyControlDict(const fileName&);
|
explicit dummyControlDict(const fileName&);
|
||||||
|
|
||||||
//- Construct given the multiControlDict dictionary
|
//- Construct given the multiControlDict dictionary
|
||||||
explicit dummyControlDict(const dictionary&);
|
explicit dummyControlDict(const dictionary&);
|
||||||
|
|
||||||
|
@ -90,3 +90,5 @@ public:
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
} // previous solver domain goes out of scope
|
} // previous solver domain goes out of scope
|
||||||
multiRun++;
|
multiRun++;
|
||||||
} // end While loop
|
} // end While loop
|
||||||
|
|
6
src/multiSolver/include/multiSolverVersion.H
Normal file
6
src/multiSolver/include/multiSolverVersion.H
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef multiSolverVersion_H
|
||||||
|
# define multiSolverVersion_H
|
||||||
|
# define multiSolverVersionMajor 0
|
||||||
|
# define multiSolverVersionMinor 6
|
||||||
|
# define multiSolverVersionBuild 0
|
||||||
|
#endif
|
|
@ -1,7 +1,7 @@
|
||||||
} // previous solver domain goes out of scope
|
} // previous solver domain goes out of scope
|
||||||
multiRun.setSolverDomain(solverDomain);
|
multiRun.setSolverDomain(solverDomain);
|
||||||
|
|
||||||
// Clear defines that may interfere with other solver domains
|
// Clear defines that may interfere with other solver domains
|
||||||
#undef createPhi_H
|
#undef createPhi_H
|
||||||
#undef createPhiV_H
|
#undef createPhiV_H
|
||||||
#undef initContinuityErrs_H
|
#undef initContinuityErrs_H
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -45,7 +45,8 @@ Author
|
||||||
#ifndef multiSolver_H
|
#ifndef multiSolver_H
|
||||||
#define multiSolver_H
|
#define multiSolver_H
|
||||||
|
|
||||||
#include "Time.H"
|
#include "multiSolverVersion.H"
|
||||||
|
#include "multiTime.H"
|
||||||
#include "dummyControlDict.H"
|
#include "dummyControlDict.H"
|
||||||
#include "timeClusterList.H"
|
#include "timeClusterList.H"
|
||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
|
@ -63,53 +64,56 @@ class multiSolver
|
||||||
{
|
{
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
// A dummy controlDict, required to initialize multiDictRegistry
|
// A dummy controlDict, required to initialize multiDictRegistry
|
||||||
dummyControlDict dcd_;
|
dummyControlDict dcd_;
|
||||||
|
|
||||||
// A mini-objectRegistry for the dictionaries - done this way to allow
|
// A mini-objectRegistry for the dictionaries - done this way to allow
|
||||||
// run-time modification of dictionaries
|
// run-time modification of dictionaries
|
||||||
Time multiDictRegistry_;
|
multiTime multiDictRegistry_;
|
||||||
|
|
||||||
// Main control dictionary for multiSolver
|
// Main control dictionary for multiSolver
|
||||||
IOdictionary multiControlDict_;
|
IOdictionary multiControlDict_;
|
||||||
|
|
||||||
// All multiDicts contained in the case directory
|
// All multiDicts contained in the case directory
|
||||||
PtrList<IOdictionary> multiDicts_;
|
PtrList<IOdictionary> multiDicts_;
|
||||||
|
|
||||||
// Reference to multiSolverControl subdictionary in multiControlDict
|
// Reference to multiSolverControl subdictionary in multiControlDict
|
||||||
dictionary& multiSolverControl_;
|
dictionary& multiSolverControl_;
|
||||||
|
|
||||||
// Reference to solverDomains subdictionary in multiControlDict
|
// Reference to solverDomains subdictionary in multiControlDict
|
||||||
dictionary& solverDomains_;
|
dictionary& solverDomains_;
|
||||||
|
|
||||||
// Current solverDomain dictionary
|
// Current solverDomain dictionary
|
||||||
dictionary currentSolverDomainDict_;
|
dictionary currentSolverDomainDict_;
|
||||||
|
|
||||||
// List of all the solver domain prefixes
|
// List of all the solver domain prefixes
|
||||||
wordList prefixes_;
|
wordList prefixes_;
|
||||||
|
|
||||||
// True when the end condition has been met
|
// True when setInitialSolverDomain has been run
|
||||||
bool finished_;
|
bool initialized_;
|
||||||
|
|
||||||
|
// Set by the solver to force a global end
|
||||||
|
bool forcedEnd_;
|
||||||
|
|
||||||
// True when superLoop++ just happened, but the previous solverDomain
|
// True when superLoop++ just happened, but the previous solverDomain
|
||||||
// has not yet been saved (to prevent the first solverDomain from
|
// has not yet been saved (to prevent the first solverDomain from
|
||||||
// saving to the *next* superLoop.
|
// saving to the *next* superLoop.
|
||||||
bool noSaveSinceSuperLoopIncrement_;
|
bool noSaveSinceSuperLoopIncrement_;
|
||||||
|
|
||||||
// True if this is the lowest number on a local shared drive - parallel
|
// True if this is the lowest number on a local shared drive - parallel
|
||||||
// only.
|
// only.
|
||||||
bool manageLocalRoot_;
|
bool manageLocalRoot_;
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|
||||||
// Set manageLocalRoot_ flags on all processors (parallel only)
|
// Set manageLocalRoot_ flags on all processors (parallel only)
|
||||||
void setUpParallel();
|
void setUpParallel();
|
||||||
|
|
||||||
// Ensure all processors are synchronized (parallel only)
|
// Ensure all processors are synchronized (parallel only)
|
||||||
void synchronizeParallel() const;
|
void synchronizeParallel() const;
|
||||||
|
|
||||||
// Load initial data and controls
|
// Load initial data and controls
|
||||||
// *** Located in multiSolverSetInitialSolverDomain.C ***
|
// *** Located in multiSolverSetInitialSolverDomain.C ***
|
||||||
void setInitialSolverDomain(const word& solverDomainName);
|
void setInitialSolverDomain(const word& solverDomainName);
|
||||||
|
@ -122,7 +126,7 @@ class multiSolver
|
||||||
// multiControlDict
|
// multiControlDict
|
||||||
// *** Located in multiSolverSetControls.C ***
|
// *** Located in multiSolverSetControls.C ***
|
||||||
void setMultiSolverControls();
|
void setMultiSolverControls();
|
||||||
|
|
||||||
// Sets controls from the solverDomains subdictionary in the
|
// Sets controls from the solverDomains subdictionary in the
|
||||||
// multiControlDict
|
// multiControlDict
|
||||||
// *** Located in multiSolverSetControls.C ***
|
// *** Located in multiSolverSetControls.C ***
|
||||||
|
@ -130,16 +134,31 @@ class multiSolver
|
||||||
|
|
||||||
// Use stopAt and finalStopAt settings to determine the endTime for
|
// Use stopAt and finalStopAt settings to determine the endTime for
|
||||||
// the current solverDomain. Returns the controlDict's stopAt word,
|
// the current solverDomain. Returns the controlDict's stopAt word,
|
||||||
// which may differ from that in multiControlDict. Sets finished_ to
|
// which may differ from that in multiControlDict.
|
||||||
// true if the end condition will be met.
|
|
||||||
word setLocalEndTime();
|
word setLocalEndTime();
|
||||||
|
|
||||||
|
// If the current solver domain should not start, returns true.
|
||||||
|
bool checkGlobalEnd() const;
|
||||||
|
|
||||||
// Looks for case/multiSolver/solverDomain/initial/0. Fail if missing.
|
// Looks for case/multiSolver/solverDomain/initial/0. Fail if missing.
|
||||||
void checkTimeDirectories() const;
|
void checkTimeDirectories() const;
|
||||||
|
|
||||||
|
// Creates a solverDomain's dictionary from a multiDict format:
|
||||||
|
// -Merges "default" if available
|
||||||
|
// -Merge "sameAs" or "multiLoad" dicts, recursively
|
||||||
|
// -Merges inputDict.subDict("solverDomainName") last
|
||||||
|
// outputDict - overwrites any existing entries
|
||||||
|
// inputDict - the "multiSolver" subdict
|
||||||
|
void buildDictionary
|
||||||
|
(
|
||||||
|
dictionary& outputDict,
|
||||||
|
const dictionary& inputDict,
|
||||||
|
const word& solverDomainName
|
||||||
|
);
|
||||||
|
|
||||||
// Change all catalogued multiDicts to another solverDomain
|
// Change all catalogued multiDicts to another solverDomain
|
||||||
void swapDictionaries(const word& solverDomainName);
|
void swapDictionaries(const word& solverDomainName);
|
||||||
|
|
||||||
// When setting up for a different solverDomain, the boundary
|
// When setting up for a different solverDomain, the boundary
|
||||||
// conditions are allowed to change. This function copies all valid
|
// conditions are allowed to change. This function copies all valid
|
||||||
// case/intoSolverDomain/inital/0 files, and overwrites the
|
// case/intoSolverDomain/inital/0 files, and overwrites the
|
||||||
|
@ -167,9 +186,9 @@ class multiSolver
|
||||||
|
|
||||||
// Rereads modified dictionaries and sets the controls
|
// Rereads modified dictionaries and sets the controls
|
||||||
void readIfModified();
|
void readIfModified();
|
||||||
|
|
||||||
// Converts a fileName with the naming convention:
|
// Converts a fileName with the naming convention:
|
||||||
// solverDomain@superLoop@globalOffset@fileName
|
// solverDomain@superLoop@globalOffset@globalIndex@fileName
|
||||||
// to a timeCluster
|
// to a timeCluster
|
||||||
timeCluster parseConditionedFile
|
timeCluster parseConditionedFile
|
||||||
(
|
(
|
||||||
|
@ -196,7 +215,7 @@ public:
|
||||||
misLatestTimeInStartDomainInStartSuperLoop
|
misLatestTimeInStartDomainInStartSuperLoop
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Final stop at control options
|
//- Final stop at control options
|
||||||
enum finalStopAtControls
|
enum finalStopAtControls
|
||||||
{
|
{
|
||||||
mfsEndTime,
|
mfsEndTime,
|
||||||
|
@ -209,7 +228,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// solverDomains enumerations
|
// solverDomains enumerations
|
||||||
|
|
||||||
//- Time value start from control options
|
//- Time value start from control options
|
||||||
enum startFromControls
|
enum startFromControls
|
||||||
{
|
{
|
||||||
|
@ -218,7 +237,7 @@ public:
|
||||||
mtsLatestTimeThisDomain,
|
mtsLatestTimeThisDomain,
|
||||||
mtsLatestTimeAllDomains
|
mtsLatestTimeAllDomains
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Stop at control options
|
//- Stop at control options
|
||||||
enum stopAtControls
|
enum stopAtControls
|
||||||
{
|
{
|
||||||
|
@ -234,67 +253,71 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// multiSolverControl data
|
// multiSolverControl data
|
||||||
|
|
||||||
label superLoop_;
|
label superLoop_;
|
||||||
|
|
||||||
word currentSolverDomain_;
|
word currentSolverDomain_;
|
||||||
|
|
||||||
static const NamedEnum<initialStartFromControls, 9>
|
static const NamedEnum<initialStartFromControls, 9>
|
||||||
initialStartFromControlsNames_;
|
initialStartFromControlsNames_;
|
||||||
initialStartFromControls initialStartFrom_;
|
initialStartFromControls initialStartFrom_;
|
||||||
|
|
||||||
scalar initialStartTime_;
|
scalar initialStartTime_;
|
||||||
|
|
||||||
word startDomain_;
|
word startDomain_;
|
||||||
|
|
||||||
label startSuperLoop_;
|
label startSuperLoop_;
|
||||||
|
|
||||||
static const NamedEnum<finalStopAtControls, 7>
|
static const NamedEnum<finalStopAtControls, 7>
|
||||||
finalStopAtControlsNames_;
|
finalStopAtControlsNames_;
|
||||||
finalStopAtControls finalStopAt_;
|
finalStopAtControls finalStopAt_;
|
||||||
|
|
||||||
word endDomain_;
|
word endDomain_;
|
||||||
|
|
||||||
scalar finalEndTime_;
|
scalar finalEndTime_;
|
||||||
|
|
||||||
label endSuperLoop_;
|
label endSuperLoop_;
|
||||||
|
|
||||||
bool multiDictsRunTimeModifiable_;
|
bool multiDictsRunTimeModifiable_;
|
||||||
|
|
||||||
scalar globalTimeOffset_;
|
scalar globalTimeOffset_;
|
||||||
|
|
||||||
|
//- Each solverDomain / superLoop combination is assigned a unique
|
||||||
|
// index that increments chronologically
|
||||||
|
label globalIndex_;
|
||||||
|
|
||||||
|
|
||||||
// solverDomains data
|
// solverDomains data
|
||||||
// This data is transient, changing between solver domains
|
// This data is transient, changing between solver domains
|
||||||
|
|
||||||
static const NamedEnum<startFromControls, 4>
|
static const NamedEnum<startFromControls, 4>
|
||||||
startFromControlsNames_;
|
startFromControlsNames_;
|
||||||
startFromControls startFrom_;
|
startFromControls startFrom_;
|
||||||
|
|
||||||
scalar startTime_;
|
scalar startTime_;
|
||||||
|
|
||||||
static const NamedEnum<stopAtControls, 7> stopAtControlsNames_;
|
static const NamedEnum<stopAtControls, 7> stopAtControlsNames_;
|
||||||
stopAtControls stopAt_;
|
stopAtControls stopAt_;
|
||||||
|
|
||||||
scalar endTime_;
|
scalar endTime_;
|
||||||
|
|
||||||
label purgeWriteSuperLoops_;
|
label purgeWriteSuperLoops_;
|
||||||
|
|
||||||
scalar deltaT_;
|
scalar deltaT_;
|
||||||
|
|
||||||
label iterations_;
|
label iterations_;
|
||||||
|
|
||||||
scalar elapsedTime_;
|
scalar elapsedTime_;
|
||||||
|
|
||||||
wordList storeFields_;
|
wordList storeFields_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("multiSolver");
|
TypeName("multiSolver");
|
||||||
|
|
||||||
//- The default multiSolver dictionary name
|
//- The default multiSolver dictionary name
|
||||||
static word multiControlDictName;
|
static word multiControlDictName;
|
||||||
|
|
||||||
/* Not implemented yet
|
/* Not implemented yet
|
||||||
//- Indicates whether the 'solverSignal' option for the finalStopAt setting
|
//- Indicates whether the 'solverSignal' option for the finalStopAt setting
|
||||||
// in the multiControlDict is permitted. Default false. Set this to true
|
// in the multiControlDict is permitted. Default false. Set this to true
|
||||||
|
@ -311,7 +334,8 @@ public:
|
||||||
const fileName& rootPath,
|
const fileName& rootPath,
|
||||||
const fileName& caseName,
|
const fileName& caseName,
|
||||||
const word& systemName = "system",
|
const word& systemName = "system",
|
||||||
const word& constantName = "constant"
|
const word& constantName = "constant",
|
||||||
|
bool showSplash = true
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct reading the multiControlDict from file
|
//- Construct reading the multiControlDict from file
|
||||||
|
@ -321,7 +345,8 @@ public:
|
||||||
const fileName& rootPath,
|
const fileName& rootPath,
|
||||||
const fileName& caseName,
|
const fileName& caseName,
|
||||||
const word& systemName = "system",
|
const word& systemName = "system",
|
||||||
const word& constantName = "constant"
|
const word& constantName = "constant",
|
||||||
|
bool showSplash = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -330,16 +355,20 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
// Database
|
//- Version number
|
||||||
|
word version() const;
|
||||||
|
|
||||||
|
// Database
|
||||||
|
|
||||||
inline const Time& multiDictRegistry() const;
|
inline const Time& multiDictRegistry() const;
|
||||||
|
|
||||||
inline const IOdictionary multiControlDict() const;
|
inline const IOdictionary& multiControlDict() const;
|
||||||
|
|
||||||
|
inline const wordList& prefixes() const;
|
||||||
|
|
||||||
// multiSolverControl data
|
// multiSolverControl data
|
||||||
|
|
||||||
inline const label& superLoop() const;
|
inline const label& superLoop() const;
|
||||||
|
@ -347,7 +376,7 @@ public:
|
||||||
inline const word& currentSolverDomain() const;
|
inline const word& currentSolverDomain() const;
|
||||||
|
|
||||||
inline const initialStartFromControls& initialStartFrom() const;
|
inline const initialStartFromControls& initialStartFrom() const;
|
||||||
|
|
||||||
inline const word& startDomain() const;
|
inline const word& startDomain() const;
|
||||||
|
|
||||||
inline const scalar& initialStartTime() const;
|
inline const scalar& initialStartTime() const;
|
||||||
|
@ -355,39 +384,43 @@ public:
|
||||||
inline const finalStopAtControls& finalStopAt() const;
|
inline const finalStopAtControls& finalStopAt() const;
|
||||||
|
|
||||||
inline const word& endDomain() const;
|
inline const word& endDomain() const;
|
||||||
|
|
||||||
inline const scalar& finalEndTime() const;
|
inline const scalar& finalEndTime() const;
|
||||||
|
|
||||||
inline const label& startSuperLoop() const;
|
inline const label& startSuperLoop() const;
|
||||||
|
|
||||||
inline const label& endSuperLoop() const;
|
inline const label& endSuperLoop() const;
|
||||||
|
|
||||||
inline const bool& multiDictsRunTimeModifiable() const;
|
inline const bool& multiDictsRunTimeModifiable() const;
|
||||||
|
|
||||||
inline const scalar& globalTimeOffset() const;
|
inline const scalar& globalTimeOffset() const;
|
||||||
|
|
||||||
// Write permission
|
// Write permission
|
||||||
inline scalar& globalTimeOffset();
|
inline scalar& globalTimeOffset();
|
||||||
|
|
||||||
|
inline const label& globalIndex() const;
|
||||||
|
|
||||||
// solverDomains data
|
// solverDomains data
|
||||||
inline const startFromControls& startFrom() const;
|
inline const startFromControls& startFrom() const;
|
||||||
|
|
||||||
inline const stopAtControls& stopAt() const;
|
inline const stopAtControls& stopAt() const;
|
||||||
|
|
||||||
inline const scalar& startTime() const;
|
inline const scalar& startTime() const;
|
||||||
|
|
||||||
inline const scalar& endTime() const;
|
inline const scalar& endTime() const;
|
||||||
|
inline scalar& endTime();
|
||||||
|
|
||||||
inline const label& iterations() const;
|
inline const label& iterations() const;
|
||||||
|
|
||||||
inline const scalar& elapsedTime() const;
|
inline const scalar& elapsedTime() const;
|
||||||
|
|
||||||
inline const wordList& storeFields() const;
|
inline const wordList& storeFields() const;
|
||||||
|
|
||||||
inline const label& purgeWriteSuperLoops() const;
|
inline const label& purgeWriteSuperLoops() const;
|
||||||
|
|
||||||
inline const scalar& deltaT() const;
|
inline const scalar& deltaT() const;
|
||||||
|
inline scalar& deltaT();
|
||||||
|
|
||||||
|
|
||||||
// Solver (and pre/post-processor) interface functions
|
// Solver (and pre/post-processor) interface functions
|
||||||
|
|
||||||
|
@ -398,6 +431,11 @@ public:
|
||||||
// reconstructPar
|
// reconstructPar
|
||||||
void postCondition(const word& processor = word::null);
|
void postCondition(const word& processor = word::null);
|
||||||
|
|
||||||
|
// Return the source data that multiControlDict currently points to
|
||||||
|
// Returns "default" solverDomain if initial conditions are to be
|
||||||
|
// used and no solverDomain is set yet.
|
||||||
|
timeCluster initialDataSource() const;
|
||||||
|
|
||||||
// Switch to another solver domain
|
// Switch to another solver domain
|
||||||
void setSolverDomain(const word& solverDomainName);
|
void setSolverDomain(const word& solverDomainName);
|
||||||
|
|
||||||
|
@ -407,6 +445,9 @@ public:
|
||||||
// Stop the run at the next setSolverDomain
|
// Stop the run at the next setSolverDomain
|
||||||
inline void setFinished();
|
inline void setFinished();
|
||||||
|
|
||||||
|
// Archive the last set of data into case/multiSolver
|
||||||
|
void finalize();
|
||||||
|
|
||||||
// Increment the superLoop (prefix)
|
// Increment the superLoop (prefix)
|
||||||
multiSolver& operator++();
|
multiSolver& operator++();
|
||||||
|
|
||||||
|
@ -421,7 +462,7 @@ public:
|
||||||
|
|
||||||
//- Return true if end of run
|
//- Return true if end of run
|
||||||
bool end() const;
|
bool end() const;
|
||||||
|
|
||||||
|
|
||||||
// Time functions
|
// Time functions
|
||||||
// The multiSolver time directory structure should have the form:
|
// The multiSolver time directory structure should have the form:
|
||||||
|
@ -431,22 +472,22 @@ public:
|
||||||
// | |-initial {initial directory, superLoop -1}
|
// | |-initial {initial directory, superLoop -1}
|
||||||
// | |-0 {superLoop}
|
// | |-0 {superLoop}
|
||||||
// | |-1 {superLoop}
|
// | |-1 {superLoop}
|
||||||
// | | '-multiSolverTime {auto-generated dictionary}
|
// | | |-multiSolverTime {auto-generated file}
|
||||||
|
// | | '-0.01, etc.. {time directories}
|
||||||
// | '-2, etc..
|
// | '-2, etc..
|
||||||
// |-prefix2, etc..
|
// |-prefix2, etc..
|
||||||
//
|
|
||||||
// *** All time functions are located in ***
|
|
||||||
// *** multiSolverTimeFunctions.C ***
|
|
||||||
|
|
||||||
// Create a list of all superLoops in a directory, (usually in
|
// Create a list of all superLoops in a directory, (usually in
|
||||||
// case/prefix). Only looks for integer directory names, does not
|
// case/prefix). Only looks for integer directory names, does not
|
||||||
// check for valid time subdirectories.
|
// check for valid time subdirectories.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static labelList findSuperLoops(const fileName& path);
|
static labelList findSuperLoops(const fileName& path);
|
||||||
|
|
||||||
// Find the closest global time to a given value in a
|
// Find the closest global time to a given value in a
|
||||||
// timeClusterList. Assumes timeClusters do not overlap global time
|
// timeClusterList. Assumes timeClusters do not overlap global time
|
||||||
// values (as they shouldn't). If exact is true, this function
|
// values (as they shouldn't). If exact is true, this function
|
||||||
// throws a FatalError when no exact match is found.
|
// throws a FatalError when no exact match is found.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static timeCluster findClosestGlobalTime
|
static timeCluster findClosestGlobalTime
|
||||||
(
|
(
|
||||||
const scalar value,
|
const scalar value,
|
||||||
|
@ -459,6 +500,7 @@ public:
|
||||||
// If overlaps exist, it uses only the latest superloop. If exact
|
// If overlaps exist, it uses only the latest superloop. If exact
|
||||||
// is true, this function throws a FatalError when no exact match
|
// is true, this function throws a FatalError when no exact match
|
||||||
// is found.
|
// is found.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static timeCluster findClosestLocalTime
|
static timeCluster findClosestLocalTime
|
||||||
(
|
(
|
||||||
const scalar value,
|
const scalar value,
|
||||||
|
@ -467,18 +509,37 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
// Find the latest global time
|
// Find the latest global time
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static timeCluster findLatestGlobalTime
|
static timeCluster findLatestGlobalTime
|
||||||
(
|
(
|
||||||
const timeClusterList& tcl
|
const timeClusterList& tcl
|
||||||
);
|
);
|
||||||
|
|
||||||
// Find the latest global time
|
// Find the latest global time
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static timeCluster findLatestLocalTime
|
static timeCluster findLatestLocalTime
|
||||||
(
|
(
|
||||||
const timeClusterList& tcl
|
const timeClusterList& tcl
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Find the timeCluster with the given globalIndex. Returns an
|
||||||
|
// empty timeCluster if not found.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
|
static timeCluster findGlobalIndex
|
||||||
|
(
|
||||||
|
const label& index,
|
||||||
|
const timeClusterList& tcl
|
||||||
|
);
|
||||||
|
|
||||||
|
// Adds all earlier times in the same superLoop directory to the
|
||||||
|
// time cluster
|
||||||
|
void includePreviousTimes
|
||||||
|
(
|
||||||
|
timeCluster& tc
|
||||||
|
) const;
|
||||||
|
|
||||||
// Find the path to a specific entry in a time cluster
|
// Find the path to a specific entry in a time cluster
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
fileName findInstancePath
|
fileName findInstancePath
|
||||||
(
|
(
|
||||||
const timeCluster& tc,
|
const timeCluster& tc,
|
||||||
|
@ -486,15 +547,21 @@ public:
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
// Find the largest superLoop
|
// Find the largest superLoop
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static label findMaxSuperLoopValue(const timeClusterList& tcl);
|
static label findMaxSuperLoopValue(const timeClusterList& tcl);
|
||||||
|
|
||||||
// Find the timeClusterList index for the timeClusterList that has
|
// Find the timeClusterList index for the timeClusterList that has
|
||||||
// the largest superLoop
|
// the largest superLoop
|
||||||
static labelList findMaxSuperLoopIndices(const timeClusterList& tcl);
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
|
static labelList findMaxSuperLoopIndices
|
||||||
|
(
|
||||||
|
const timeClusterList& tcl
|
||||||
|
);
|
||||||
|
|
||||||
// Checks if any of the time ranges overlap one another in a
|
// Checks if any of the time ranges overlap one another in a
|
||||||
// timeClusterList. (If startTime = previous end, this is okay.)
|
// timeClusterList. (If startTime = previous end, this is okay.)
|
||||||
// True means they do not overlap.
|
// True means they do not overlap.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static bool nonOverlapping
|
static bool nonOverlapping
|
||||||
(
|
(
|
||||||
const timeClusterList& tcl,
|
const timeClusterList& tcl,
|
||||||
|
@ -503,15 +570,17 @@ public:
|
||||||
|
|
||||||
// Maps the time directories in a single superLoop directory
|
// Maps the time directories in a single superLoop directory
|
||||||
// Include a processor name, and it uses the processorN directory
|
// Include a processor name, and it uses the processorN directory
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
timeCluster readSuperLoopTimes
|
timeCluster readSuperLoopTimes
|
||||||
(
|
(
|
||||||
const word& solverDomain,
|
const word& solverDomain,
|
||||||
const label superLoop,
|
const label superLoop,
|
||||||
const word& processor = word::null
|
const word& processor = word::null
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
// Maps the time directories in a single solverDomain
|
// Maps the time directories in a single solverDomain
|
||||||
// Include a processor name, and it uses the processorN directory
|
// Include a processor name, and it uses the processorN directory
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
timeClusterList readSolverDomainTimes
|
timeClusterList readSolverDomainTimes
|
||||||
(
|
(
|
||||||
const word& solverDomain,
|
const word& solverDomain,
|
||||||
|
@ -521,6 +590,7 @@ public:
|
||||||
// Create a snapshot of all the multiSolver time directories
|
// Create a snapshot of all the multiSolver time directories
|
||||||
// Give it a processor name, and it searches instead in the
|
// Give it a processor name, and it searches instead in the
|
||||||
// processor directory
|
// processor directory
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
timeClusterList readAllTimes
|
timeClusterList readAllTimes
|
||||||
(
|
(
|
||||||
const word processor = word::null
|
const word processor = word::null
|
||||||
|
@ -531,14 +601,16 @@ public:
|
||||||
// time values overlap when forced to useGlobalTime.
|
// time values overlap when forced to useGlobalTime.
|
||||||
// loadStoreFields will copy storeFields into every time folder
|
// loadStoreFields will copy storeFields into every time folder
|
||||||
// even though they do not change.
|
// even though they do not change.
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
bool loadTimeClusterList
|
bool loadTimeClusterList
|
||||||
(
|
(
|
||||||
const timeClusterList& tcl,
|
const timeClusterList& tcl,
|
||||||
const bool useGlobalTime = true,
|
const bool useGlobalTime = true,
|
||||||
const bool loadStoreFields = true
|
const bool loadStoreFields = true
|
||||||
) const;
|
);
|
||||||
|
|
||||||
// Move all the time directories from sourcePath to archivePath
|
// Move all the time directories from sourcePath to archivePath
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static void archiveTimeDirs
|
static void archiveTimeDirs
|
||||||
(
|
(
|
||||||
const fileName& sourcePath,
|
const fileName& sourcePath,
|
||||||
|
@ -547,6 +619,7 @@ public:
|
||||||
);
|
);
|
||||||
|
|
||||||
// Delete all time directories in path, do not delete "constant"
|
// Delete all time directories in path, do not delete "constant"
|
||||||
|
// *** Located in multiSolverTimeFunctions.C ***
|
||||||
static void purgeTimeDirs(const fileName& path);
|
static void purgeTimeDirs(const fileName& path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -559,4 +632,8 @@ public:
|
||||||
|
|
||||||
#include "multiSolverI.H"
|
#include "multiSolverI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -36,12 +36,18 @@ inline const Time& multiSolver::multiDictRegistry() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const IOdictionary multiSolver::multiControlDict() const
|
inline const IOdictionary& multiSolver::multiControlDict() const
|
||||||
{
|
{
|
||||||
return multiControlDict_;
|
return multiControlDict_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const wordList& multiSolver::prefixes() const
|
||||||
|
{
|
||||||
|
return prefixes_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const label& multiSolver::superLoop() const
|
inline const label& multiSolver::superLoop() const
|
||||||
{
|
{
|
||||||
return superLoop_;
|
return superLoop_;
|
||||||
|
@ -54,7 +60,8 @@ inline const word& multiSolver::currentSolverDomain() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const multiSolver::initialStartFromControls& multiSolver::initialStartFrom() const
|
inline const multiSolver::initialStartFromControls&
|
||||||
|
multiSolver::initialStartFrom() const
|
||||||
{
|
{
|
||||||
return initialStartFrom_;
|
return initialStartFrom_;
|
||||||
}
|
}
|
||||||
|
@ -120,6 +127,12 @@ inline scalar& multiSolver::globalTimeOffset()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const label& multiSolver::globalIndex() const
|
||||||
|
{
|
||||||
|
return globalIndex_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const multiSolver::startFromControls& multiSolver::startFrom() const
|
inline const multiSolver::startFromControls& multiSolver::startFrom() const
|
||||||
{
|
{
|
||||||
return startFrom_;
|
return startFrom_;
|
||||||
|
@ -135,13 +148,19 @@ inline const scalar& multiSolver::startTime() const
|
||||||
{
|
{
|
||||||
return startTime_;
|
return startTime_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const scalar& multiSolver::endTime() const
|
inline const scalar& multiSolver::endTime() const
|
||||||
{
|
{
|
||||||
return endTime_;
|
return endTime_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline scalar& multiSolver::endTime()
|
||||||
|
{
|
||||||
|
return endTime_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const label& multiSolver::iterations() const
|
inline const label& multiSolver::iterations() const
|
||||||
{
|
{
|
||||||
return iterations_;
|
return iterations_;
|
||||||
|
@ -172,9 +191,15 @@ inline const scalar& multiSolver::deltaT() const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline scalar& multiSolver::deltaT()
|
||||||
|
{
|
||||||
|
return deltaT_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::multiSolver::setFinished()
|
void Foam::multiSolver::setFinished()
|
||||||
{
|
{
|
||||||
finished_ = true;
|
forcedEnd_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
// Common elements in the constructor initialization list for multiSolver
|
// Common elements in the constructor initialization list for multiSolver
|
||||||
|
|
||||||
// Quenching compiler warning
|
|
||||||
// HR, 18/Jul/2013
|
|
||||||
multiDicts_(0),
|
multiDicts_(0),
|
||||||
|
|
||||||
multiSolverControl_(multiControlDict_.subDict("multiSolverControl")),
|
multiSolverControl_(multiControlDict_.subDict("multiSolverControl")),
|
||||||
solverDomains_(multiControlDict_.subDict("solverDomains")),
|
solverDomains_(multiControlDict_.subDict("solverDomains")),
|
||||||
currentSolverDomainDict_(),
|
currentSolverDomainDict_(),
|
||||||
prefixes_(solverDomains_.toc()),
|
prefixes_(solverDomains_.toc()),
|
||||||
finished_(false),
|
initialized_(false),
|
||||||
|
forcedEnd_(false),
|
||||||
noSaveSinceSuperLoopIncrement_(false),
|
noSaveSinceSuperLoopIncrement_(false),
|
||||||
manageLocalRoot_(false),
|
manageLocalRoot_(false),
|
||||||
|
|
||||||
superLoop_(0),
|
superLoop_(0),
|
||||||
currentSolverDomain_("default"),
|
currentSolverDomain_("default"),
|
||||||
|
|
||||||
initialStartFrom_(misLatestTime),
|
initialStartFrom_(misLatestTime),
|
||||||
// startDomain_,
|
|
||||||
initialStartTime_(0),
|
initialStartTime_(0),
|
||||||
|
startDomain_("default"),
|
||||||
startSuperLoop_(0),
|
startSuperLoop_(0),
|
||||||
finalStopAt_(mfsEndTime),
|
finalStopAt_(mfsEndTime),
|
||||||
// endDomain_,
|
// endDomain_,
|
||||||
finalEndTime_(0),
|
finalEndTime_(0),
|
||||||
|
|
||||||
endSuperLoop_(0),
|
endSuperLoop_(0),
|
||||||
|
|
||||||
multiDictsRunTimeModifiable_(true),
|
multiDictsRunTimeModifiable_(true),
|
||||||
|
|
||||||
globalTimeOffset_(0),
|
globalTimeOffset_(0),
|
||||||
|
globalIndex_(0),
|
||||||
|
|
||||||
purgeWriteSuperLoops_(prefixes_.size()),
|
purgeWriteSuperLoops_(prefixes_.size()),
|
||||||
|
|
||||||
// timeValueStartFrom_,
|
// timeValueStartFrom_,
|
||||||
|
|
|
@ -38,7 +38,7 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
multiSolverControl_.lookup("initialStartFrom")
|
multiSolverControl_.lookup("initialStartFrom")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiSolverControl_.found("startTime"))
|
if (multiSolverControl_.found("startTime"))
|
||||||
{
|
{
|
||||||
initialStartTime_ = readScalar(multiSolverControl_.lookup("startTime"));
|
initialStartTime_ = readScalar(multiSolverControl_.lookup("startTime"));
|
||||||
|
@ -72,7 +72,7 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
{
|
{
|
||||||
startDomain_ = word(multiSolverControl_.lookup("startDomain"));
|
startDomain_ = word(multiSolverControl_.lookup("startDomain"));
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
(initialStartFrom_ == misFirstTimeInStartDomain)
|
(initialStartFrom_ == misFirstTimeInStartDomain)
|
||||||
|| (initialStartFrom_ == misFirstTimeInStartDomainInStartSuperLoop)
|
|| (initialStartFrom_ == misFirstTimeInStartDomainInStartSuperLoop)
|
||||||
|
@ -93,7 +93,7 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
<< "'latestTimeInStartDomainInStartSuperLoop'."
|
<< "'latestTimeInStartDomainInStartSuperLoop'."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
finalStopAt_ = mfsEndTime;
|
finalStopAt_ = mfsEndTime;
|
||||||
if (multiSolverControl_.found("finalStopAt"))
|
if (multiSolverControl_.found("finalStopAt"))
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
multiSolverControl_.lookup("finalStopAt")
|
multiSolverControl_.lookup("finalStopAt")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiSolverControl_.found("endDomain"))
|
if (multiSolverControl_.found("endDomain"))
|
||||||
{
|
{
|
||||||
endDomain_ = word(multiSolverControl_.lookup("endDomain"));
|
endDomain_ = word(multiSolverControl_.lookup("endDomain"));
|
||||||
|
@ -160,10 +160,10 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
<< "'latestTimeInStartDomainInStartSuperLoop'."
|
<< "'latestTimeInStartDomainInStartSuperLoop'."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multiSolverControl_.found("endSuperLoop"))
|
if (multiSolverControl_.found("endSuperLoop"))
|
||||||
{
|
{
|
||||||
endSuperLoop_ =
|
endSuperLoop_ =
|
||||||
readLabel(multiSolverControl_.lookup("endSuperLoop"));
|
readLabel(multiSolverControl_.lookup("endSuperLoop"));
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
|
@ -200,7 +200,7 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
<< "other than 'default'."
|
<< "other than 'default'."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
dictionary solverDomainsDefault
|
dictionary solverDomainsDefault
|
||||||
(
|
(
|
||||||
solverDomains_.found("default")
|
solverDomains_.found("default")
|
||||||
|
@ -213,11 +213,12 @@ void Foam::multiSolver::setMultiSolverControls()
|
||||||
void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
{
|
{
|
||||||
currentSolverDomainDict_.clear();
|
currentSolverDomainDict_.clear();
|
||||||
if (solverDomains_.found("default"))
|
buildDictionary
|
||||||
{
|
(
|
||||||
currentSolverDomainDict_.merge(solverDomains_.subDict("default"));
|
currentSolverDomainDict_,
|
||||||
}
|
solverDomains_,
|
||||||
currentSolverDomainDict_.merge(solverDomains_.subDict(solverDomainName));
|
solverDomainName
|
||||||
|
);
|
||||||
|
|
||||||
startFrom_ = mtsLatestTimeAllDomains;
|
startFrom_ = mtsLatestTimeAllDomains;
|
||||||
if (currentSolverDomainDict_.found("startFrom"))
|
if (currentSolverDomainDict_.found("startFrom"))
|
||||||
|
@ -234,7 +235,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
if (startTime_ < 0)
|
if (startTime_ < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn("multiSolver::setSolverDomainControls")
|
FatalErrorIn("multiSolver::setSolverDomainControls")
|
||||||
<< "'startTime' in multiControlDict/solverDomains/"
|
<< "'startTime' in multiControlDict/solverDomains/"
|
||||||
<< solverDomainName << " cannot be negative."
|
<< solverDomainName << " cannot be negative."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
@ -247,7 +248,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
<< "is set to 'startTime'."
|
<< "is set to 'startTime'."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
stopAt_ = msaEndTime;
|
stopAt_ = msaEndTime;
|
||||||
if (currentSolverDomainDict_.found("stopAt"))
|
if (currentSolverDomainDict_.found("stopAt"))
|
||||||
{
|
{
|
||||||
|
@ -271,7 +272,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
endTime_ = 0;
|
endTime_ = 0;
|
||||||
if (currentSolverDomainDict_.found("endTime"))
|
if (currentSolverDomainDict_.found("endTime"))
|
||||||
{
|
{
|
||||||
|
@ -293,7 +294,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
<< "when stopAt is set to iterations."
|
<< "when stopAt is set to iterations."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentSolverDomainDict_.found("elapsedTime"))
|
if (currentSolverDomainDict_.found("elapsedTime"))
|
||||||
{
|
{
|
||||||
elapsedTime_ = readScalar(currentSolverDomainDict_.lookup("elapsedTime"));
|
elapsedTime_ = readScalar(currentSolverDomainDict_.lookup("elapsedTime"));
|
||||||
|
@ -314,7 +315,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
currentSolverDomainDict_.lookup("storeFields")
|
currentSolverDomainDict_.lookup("storeFields")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
purgeWriteSuperLoops_ = 0;
|
purgeWriteSuperLoops_ = 0;
|
||||||
if (currentSolverDomainDict_.found("purgeWriteSuperLoops"))
|
if (currentSolverDomainDict_.found("purgeWriteSuperLoops"))
|
||||||
{
|
{
|
||||||
|
@ -323,7 +324,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
currentSolverDomainDict_.lookup("purgeWriteSuperLoops")
|
currentSolverDomainDict_.lookup("purgeWriteSuperLoops")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentSolverDomainDict_.found("deltaT"))
|
if (currentSolverDomainDict_.found("deltaT"))
|
||||||
{
|
{
|
||||||
deltaT_ = readScalar
|
deltaT_ = readScalar
|
||||||
|
@ -338,7 +339,7 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
<< solverDomainName << "' or 'default'. deltaT is required."
|
<< solverDomainName << "' or 'default'. deltaT is required."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
currentSolverDomainDict_.found("timeFormat")
|
currentSolverDomainDict_.found("timeFormat")
|
||||||
|
@ -354,6 +355,4 @@ void Foam::multiSolver::setSolverDomainControls(const word& solverDomainName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,17 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
|
|
||||||
// Purge all time directories from case directory root
|
// Purge all time directories from case directory root
|
||||||
purgeTimeDirs(multiDictRegistry_.path());
|
purgeTimeDirs(multiDictRegistry_.path());
|
||||||
|
|
||||||
|
// Purge any constant/superLoopData/
|
||||||
|
fileName superLoopDataPath
|
||||||
|
(
|
||||||
|
multiDictRegistry_.path()/multiDictRegistry_.constant()
|
||||||
|
/"superLoopData"
|
||||||
|
);
|
||||||
|
if (exists(superLoopDataPath))
|
||||||
|
{
|
||||||
|
rmDir(superLoopDataPath);
|
||||||
|
}
|
||||||
|
|
||||||
// Read initial settings and determine data source (from which path the
|
// Read initial settings and determine data source (from which path the
|
||||||
// initial data is copied, the starting superLoop_, and the current
|
// initial data is copied, the starting superLoop_, and the current
|
||||||
|
@ -59,100 +70,26 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
// subdictionary.
|
// subdictionary.
|
||||||
// 4. endTime is determined by the solverDomains subdictionary
|
// 4. endTime is determined by the solverDomains subdictionary
|
||||||
// a. unless the finalStopAt trumps it
|
// a. unless the finalStopAt trumps it
|
||||||
timeCluster tcSource;
|
|
||||||
switch (initialStartFrom_)
|
|
||||||
{
|
|
||||||
case misFirstTime:
|
|
||||||
tcSource = findClosestGlobalTime
|
|
||||||
(
|
|
||||||
0, readSuperLoopTimes(currentSolverDomain_, -1)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case misFirstTimeInStartDomain:
|
|
||||||
tcSource = findClosestGlobalTime
|
|
||||||
(
|
|
||||||
0, readSuperLoopTimes(startDomain_, -1)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case misFirstTimeInStartDomainInStartSuperLoop:
|
|
||||||
tcSource = findClosestGlobalTime
|
|
||||||
(
|
|
||||||
0, readSuperLoopTimes(startDomain_, startSuperLoop_)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case misStartTime:
|
|
||||||
if (initialStartTime_ == 0)
|
|
||||||
{
|
|
||||||
tcSource = findClosestGlobalTime
|
|
||||||
(
|
|
||||||
initialStartTime_,
|
|
||||||
readSuperLoopTimes(currentSolverDomain_, -1)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tcSource = findClosestGlobalTime
|
|
||||||
(
|
|
||||||
initialStartTime_, readAllTimes()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case misStartTimeInStartDomain:
|
|
||||||
tcSource = findClosestLocalTime
|
|
||||||
(
|
|
||||||
initialStartTime_, readSolverDomainTimes(startDomain_)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case misStartTimeInStartDomainInStartSuperLoop:
|
|
||||||
tcSource = findClosestLocalTime
|
|
||||||
(
|
|
||||||
initialStartTime_,
|
|
||||||
readSuperLoopTimes(startDomain_, startSuperLoop_)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case misLatestTime:
|
|
||||||
tcSource = findLatestGlobalTime(readAllTimes());
|
|
||||||
break;
|
|
||||||
case misLatestTimeInStartDomain:
|
|
||||||
tcSource = findLatestLocalTime(readSolverDomainTimes(startDomain_));
|
|
||||||
break;
|
|
||||||
case misLatestTimeInStartDomainInStartSuperLoop:
|
|
||||||
tcSource = findLatestLocalTime
|
|
||||||
(
|
|
||||||
readSuperLoopTimes(startDomain_, startSuperLoop_)
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tcSource.times().size())
|
// Find initial data source
|
||||||
{
|
timeCluster tcSource(initialDataSource());
|
||||||
// No relevant data found, set to initial conditions
|
|
||||||
tcSource = timeCluster
|
|
||||||
(
|
|
||||||
Time::findTimes
|
|
||||||
(
|
|
||||||
multiDictRegistry_.path()/"multiSolver"/currentSolverDomain_
|
|
||||||
/"initial"
|
|
||||||
),
|
|
||||||
0,
|
|
||||||
-1, // superLoop of -1 signifies "initial" directory
|
|
||||||
currentSolverDomain_
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
fileName sourcePath(findInstancePath(tcSource, 0));
|
fileName sourcePath(findInstancePath(tcSource, tcSource.size() - 1));
|
||||||
superLoop_ = tcSource.superLoop();
|
superLoop_ = tcSource.superLoop();
|
||||||
|
globalIndex_ = tcSource.globalIndex();
|
||||||
|
|
||||||
// If starting from initial conditions, superLoop_ = -1
|
// If starting from initial conditions, superLoop_ = -1
|
||||||
if (superLoop_ < 0) superLoop_ = 0;
|
if (superLoop_ < 0) superLoop_ = 0;
|
||||||
scalar globalTime(tcSource.globalValue(0));
|
scalar globalTime(tcSource.globalValue(tcSource.size() - 1));
|
||||||
scalar localStartTime(tcSource.localValue(0));
|
scalar localStartTime(tcSource.localValue(tcSource.size() -1));
|
||||||
|
|
||||||
// Now to apply the exceptions if currentSolverDomain_ != data source
|
// Now to apply the exceptions if currentSolverDomain_ != data source
|
||||||
// solverDomain (see long comment above).
|
// solverDomain (see long comment above).
|
||||||
if (sourcePath.path().path().name() != currentSolverDomain_)
|
if (sourcePath.path().path().name() != currentSolverDomain_)
|
||||||
{
|
{
|
||||||
superLoop_++;
|
superLoop_++;
|
||||||
|
globalIndex_++;
|
||||||
|
|
||||||
switch (startFrom_)
|
switch (startFrom_)
|
||||||
{
|
{
|
||||||
case mtsFirstTime:
|
case mtsFirstTime:
|
||||||
|
@ -182,13 +119,18 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
startTime_ = localStartTime;
|
startTime_ = localStartTime;
|
||||||
|
|
||||||
globalTimeOffset_ = globalTime - startTime_;
|
globalTimeOffset_ = globalTime - startTime_;
|
||||||
|
|
||||||
// Give multiDictRegistry a time value (required for regIOobject::write()
|
// Give multiDictRegistry a time value (required for regIOobject::write()
|
||||||
// to case/[timeValue]
|
// to case/[timeValue]
|
||||||
multiDictRegistry_.setTime(startTime_, 0);
|
multiDictRegistry_.setTime(startTime_, 0);
|
||||||
|
|
||||||
// Copy the source data to case/[localTime]
|
// Copy the source data and any previous time directories to
|
||||||
cp(sourcePath, multiDictRegistry_.path());
|
// case/[localTime]
|
||||||
|
forAll(tcSource, i)
|
||||||
|
{
|
||||||
|
fileName copyMe(findInstancePath(tcSource, i));
|
||||||
|
cp(copyMe, multiDictRegistry_.path());
|
||||||
|
}
|
||||||
mv
|
mv
|
||||||
(
|
(
|
||||||
multiDictRegistry_.path()/sourcePath.name(),
|
multiDictRegistry_.path()/sourcePath.name(),
|
||||||
|
@ -222,7 +164,7 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
),
|
),
|
||||||
currentSolverDomainDict_
|
currentSolverDomainDict_
|
||||||
);
|
);
|
||||||
|
|
||||||
// Remove multiSolver-specific values from dictionary
|
// Remove multiSolver-specific values from dictionary
|
||||||
newControlDict.remove("startFrom");
|
newControlDict.remove("startFrom");
|
||||||
newControlDict.remove("startTime");
|
newControlDict.remove("startTime");
|
||||||
|
@ -234,8 +176,31 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
newControlDict.remove("timePrecision");
|
newControlDict.remove("timePrecision");
|
||||||
newControlDict.remove("storeFields");
|
newControlDict.remove("storeFields");
|
||||||
newControlDict.remove("elapsedTime");
|
newControlDict.remove("elapsedTime");
|
||||||
|
|
||||||
// Add values to obtain the desired behaviour
|
// Add values to obtain the desired behaviour
|
||||||
|
// Start with timePrecision, it may affect writePrecision, which affects
|
||||||
|
// all other settings
|
||||||
|
if (multiSolverControl_.found("timePrecision"))
|
||||||
|
{
|
||||||
|
unsigned int newPrecision
|
||||||
|
(
|
||||||
|
readUint(multiSolverControl_.lookup("timePrecision"))
|
||||||
|
);
|
||||||
|
|
||||||
|
// Increase writePrecision if less than timePrecision, otherwise
|
||||||
|
// resuming a run will fail
|
||||||
|
if (IOstream::defaultPrecision() < (newPrecision + 1))
|
||||||
|
{
|
||||||
|
IOstream::defaultPrecision(newPrecision + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
newControlDict.set
|
||||||
|
(
|
||||||
|
"timePrecision",
|
||||||
|
newPrecision
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
newControlDict.set("startFrom", "startTime");
|
newControlDict.set("startFrom", "startTime");
|
||||||
newControlDict.set("startTime", startTime_);
|
newControlDict.set("startTime", startTime_);
|
||||||
newControlDict.set("stopAt", stopAtSetting);
|
newControlDict.set("stopAt", stopAtSetting);
|
||||||
|
@ -248,18 +213,20 @@ void Foam::multiSolver::setInitialSolverDomain(const word& solverDomainName)
|
||||||
word(multiSolverControl_.lookup("timeFormat"))
|
word(multiSolverControl_.lookup("timeFormat"))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (multiSolverControl_.found("timePrecision"))
|
|
||||||
{
|
|
||||||
newControlDict.set
|
|
||||||
(
|
|
||||||
"timePrecision",
|
|
||||||
readScalar(multiSolverControl_.lookup("timePrecision"))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write the dictionary to the case directory
|
// Write the dictionary to the case directory
|
||||||
newControlDict.regIOobject::write();
|
newControlDict.regIOobject::write();
|
||||||
|
|
||||||
|
// Copy files in the superLoop/superLoopData directory of tcSource to
|
||||||
|
// constant/superLoopData
|
||||||
|
cp
|
||||||
|
(
|
||||||
|
sourcePath.path()/"superLoopData",
|
||||||
|
multiDictRegistry_.path()/multiDictRegistry_.constant()
|
||||||
|
);
|
||||||
|
|
||||||
swapDictionaries(currentSolverDomain_);
|
swapDictionaries(currentSolverDomain_);
|
||||||
|
initialized_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -77,13 +77,16 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
multiSolverTime.set("globalOffset", globalTimeOffset_);
|
multiSolverTime.set("globalOffset", globalTimeOffset_);
|
||||||
|
multiSolverTime.set("globalIndex", globalIndex_);
|
||||||
|
|
||||||
|
globalIndex_++;
|
||||||
|
|
||||||
// Write multiSolverTime to the case/constant directory, then move to
|
// Write multiSolverTime to the case/constant directory, then move to
|
||||||
// archivePath
|
// archivePath
|
||||||
multiSolverTime.regIOobject::write();
|
multiSolverTime.regIOobject::write();
|
||||||
mv(multiDictRegistry_.constantPath()/"multiSolverTime", archivePath);
|
mv(multiDictRegistry_.constantPath()/"multiSolverTime", archivePath);
|
||||||
|
|
||||||
// tcSource is where the latest data has been moved to
|
// tcSource is to where the latest data has been moved
|
||||||
timeCluster tcSource
|
timeCluster tcSource
|
||||||
(
|
(
|
||||||
findLatestLocalTime
|
findLatestLocalTime
|
||||||
|
@ -128,7 +131,7 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
localStartTime = globalTime;
|
localStartTime = globalTime;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
startTime_ = localStartTime;
|
startTime_ = localStartTime;
|
||||||
globalTimeOffset_ = globalTime - startTime_;
|
globalTimeOffset_ = globalTime - startTime_;
|
||||||
|
|
||||||
|
@ -138,7 +141,7 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
|
|
||||||
word stopAtSetting("endTime");
|
word stopAtSetting("endTime");
|
||||||
|
|
||||||
if (!finished_)
|
if (!checkGlobalEnd())
|
||||||
{
|
{
|
||||||
// Copy the source data to case/[localTime]
|
// Copy the source data to case/[localTime]
|
||||||
cp(sourcePath, multiDictRegistry_.path());
|
cp(sourcePath, multiDictRegistry_.path());
|
||||||
|
@ -168,14 +171,14 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAll (previousStoreFields, i)
|
forAll (previousStoreFields, i)
|
||||||
{
|
{
|
||||||
// Copy the stored fields to case/[localTime].
|
// Copy the stored fields to case/[localTime].
|
||||||
if (exists(storedSourcePath/previousStoreFields[i]))
|
if (exists(storedSourcePath/previousStoreFields[i]))
|
||||||
{
|
{
|
||||||
fileName storedSource(storedSourcePath/previousStoreFields[i]);
|
fileName storedSource(storedSourcePath/previousStoreFields[i]);
|
||||||
|
|
||||||
cp
|
cp
|
||||||
(
|
(
|
||||||
storedSource,
|
storedSource,
|
||||||
|
@ -190,15 +193,15 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
<< previousStoreFields[i] << " from "
|
<< previousStoreFields[i] << " from "
|
||||||
<< previousSolverDomain << " to "
|
<< previousSolverDomain << " to "
|
||||||
<< currentSolverDomain_ << " in superLoop "
|
<< currentSolverDomain_ << " in superLoop "
|
||||||
<< saveToSuperLoop << ". File not found. This may occur "
|
<< saveToSuperLoop << ". File not found. This may "
|
||||||
<< "if " << previousSolverDomain << " is the first "
|
<< "occur if " << previousSolverDomain << " is the "
|
||||||
<< "solverDomain to be initialized, and you did not put "
|
<< "first solverDomain to be initialized, and you did "
|
||||||
<< "the stored fields into its 0/0 directory."
|
<< "not put the stored fields into its 0/0 directory."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
swapBoundaryConditions
|
swapBoundaryConditions
|
||||||
(
|
(
|
||||||
multiDictRegistry_.path()/Time::timeName(startTime_),
|
multiDictRegistry_.path()/Time::timeName(startTime_),
|
||||||
|
@ -207,8 +210,26 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
|
|
||||||
// Determine localEndTime and stopAtSetting
|
// Determine localEndTime and stopAtSetting
|
||||||
stopAtSetting = setLocalEndTime();
|
stopAtSetting = setLocalEndTime();
|
||||||
|
|
||||||
|
// This is the new solverDomain's archive path
|
||||||
|
fileName nextArchivePath
|
||||||
|
(
|
||||||
|
multiDictRegistry_.path()/"multiSolver"/solverDomainName/name
|
||||||
|
(
|
||||||
|
superLoop_
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Copy constant/superLoopData to multiSolver/solverDomainName/superLoop/
|
||||||
|
// of the new solver domain.
|
||||||
|
cp
|
||||||
|
(
|
||||||
|
multiDictRegistry_.path()/multiDictRegistry_.constant()
|
||||||
|
/"superLoopData",
|
||||||
|
nextArchivePath
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else //finished_
|
else // global end
|
||||||
{
|
{
|
||||||
stopAtSetting = "noWriteNow";
|
stopAtSetting = "noWriteNow";
|
||||||
}
|
}
|
||||||
|
@ -227,7 +248,7 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
),
|
),
|
||||||
currentSolverDomainDict_
|
currentSolverDomainDict_
|
||||||
);
|
);
|
||||||
|
|
||||||
// Remove multiSolver-specific values from dictionary
|
// Remove multiSolver-specific values from dictionary
|
||||||
newControlDict.remove("startFrom");
|
newControlDict.remove("startFrom");
|
||||||
newControlDict.remove("startTime");
|
newControlDict.remove("startTime");
|
||||||
|
@ -239,28 +260,27 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
newControlDict.remove("timePrecision");
|
newControlDict.remove("timePrecision");
|
||||||
newControlDict.remove("storeFields");
|
newControlDict.remove("storeFields");
|
||||||
newControlDict.remove("elapsedTime");
|
newControlDict.remove("elapsedTime");
|
||||||
|
|
||||||
// Add values to obtain the desired behaviour
|
// Add values to obtain the desired behaviour
|
||||||
newControlDict.set("startFrom", "startTime");
|
newControlDict.set("startFrom", "startTime");
|
||||||
newControlDict.set("startTime", startTime_);
|
newControlDict.set("startTime", startTime_);
|
||||||
newControlDict.set("stopAt", stopAtSetting);
|
newControlDict.set("stopAt", stopAtSetting);
|
||||||
newControlDict.set("endTime", endTime_);
|
newControlDict.set("endTime", endTime_);
|
||||||
if (multiSolverControl_.found("timeFormat"))
|
switch (multiDictRegistry_.format())
|
||||||
{
|
{
|
||||||
newControlDict.set
|
case Time::general:
|
||||||
(
|
newControlDict.set("timeFormat", "general");
|
||||||
"timeFormat",
|
break;
|
||||||
word(multiSolverControl_.lookup("timeFormat"))
|
case Time::fixed:
|
||||||
);
|
newControlDict.set("timeFormat", "fixed");
|
||||||
}
|
break;
|
||||||
if (multiSolverControl_.found("timePrecision"))
|
case Time::scientific:
|
||||||
{
|
newControlDict.set("timeFormat", "scientific");
|
||||||
newControlDict.set
|
break;
|
||||||
(
|
default:
|
||||||
"timePrecision",
|
break;
|
||||||
readScalar(multiSolverControl_.lookup("timePrecision"))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
newControlDict.set("timePrecision", multiDictRegistry_.precision());
|
||||||
|
|
||||||
// Write the dictionary to the case directory
|
// Write the dictionary to the case directory
|
||||||
newControlDict.regIOobject::write();
|
newControlDict.regIOobject::write();
|
||||||
|
@ -275,3 +295,4 @@ void Foam::multiSolver::setNextSolverDomain(const word& solverDomainName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
|
@ -34,7 +34,7 @@ Foam::labelList Foam::multiSolver::findSuperLoops(const fileName& path)
|
||||||
|
|
||||||
labelList superLoopList(dirEntries.size());
|
labelList superLoopList(dirEntries.size());
|
||||||
label nSuperLoops(0);
|
label nSuperLoops(0);
|
||||||
|
|
||||||
// Loop through dirEntries, checking for valid integers, sort entries
|
// Loop through dirEntries, checking for valid integers, sort entries
|
||||||
forAll(dirEntries, de)
|
forAll(dirEntries, de)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ Foam::labelList Foam::multiSolver::findSuperLoops(const fileName& path)
|
||||||
|
|
||||||
IStringStream superLoopStream(dirEntries[de]);
|
IStringStream superLoopStream(dirEntries[de]);
|
||||||
token superLoopToken(superLoopStream);
|
token superLoopToken(superLoopStream);
|
||||||
|
|
||||||
// Check if directory is an integer
|
// Check if directory is an integer
|
||||||
if (superLoopToken.isLabel() && superLoopStream.eof())
|
if (superLoopToken.isLabel() && superLoopStream.eof())
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,7 @@ Foam::timeCluster Foam::multiSolver::findClosestGlobalTime
|
||||||
label underShoot(-1);
|
label underShoot(-1);
|
||||||
label best(-1);
|
label best(-1);
|
||||||
label initial(-1);
|
label initial(-1);
|
||||||
|
|
||||||
// Find closest global minimum that does not exceed value
|
// Find closest global minimum that does not exceed value
|
||||||
forAll(tcl, i)
|
forAll(tcl, i)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +117,7 @@ Foam::timeCluster Foam::multiSolver::findClosestGlobalTime
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
FatalErrorIn("multiSolver::findClosestGlobalTime")
|
FatalErrorIn("multiSolver::findClosestGlobalTime")
|
||||||
<< "The timeClusterList passed to this function has no non-"
|
<< "The timeClusterList passed to this function has no non-"
|
||||||
<< "empty instantLists. Use timeClusterList::purgeEmpties "
|
<< "empty instantLists. Use timeClusterList::purgeEmpties "
|
||||||
|
@ -125,7 +125,7 @@ Foam::timeCluster Foam::multiSolver::findClosestGlobalTime
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label timeIndex
|
label timeIndex
|
||||||
(
|
(
|
||||||
Time::findClosestTimeIndex
|
Time::findClosestTimeIndex
|
||||||
|
@ -133,7 +133,7 @@ Foam::timeCluster Foam::multiSolver::findClosestGlobalTime
|
||||||
tcl[best].times(), value - tcl[best].globalOffset()
|
tcl[best].times(), value - tcl[best].globalOffset()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (exact && (maxDiff < -VSMALL))
|
if (exact && (maxDiff < -VSMALL))
|
||||||
{
|
{
|
||||||
FatalErrorIn("multiSolver::findClosestGlobalTime")
|
FatalErrorIn("multiSolver::findClosestGlobalTime")
|
||||||
|
@ -169,7 +169,7 @@ Foam::timeCluster Foam::multiSolver::findClosestLocalTime
|
||||||
tclDummy = tcl.selectiveSubList(findMaxSuperLoopIndices(tcl));
|
tclDummy = tcl.selectiveSubList(findMaxSuperLoopIndices(tcl));
|
||||||
tclPtr = & tclDummy;
|
tclPtr = & tclDummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i = 0; i < tclPtr->size(); i++)
|
for (label i = 0; i < tclPtr->size(); i++)
|
||||||
{
|
{
|
||||||
if (!tclPtr->operator[](i).times().size()) continue;
|
if (!tclPtr->operator[](i).times().size()) continue;
|
||||||
|
@ -205,7 +205,7 @@ Foam::timeCluster Foam::multiSolver::findClosestLocalTime
|
||||||
// "initial" directory is the only match
|
// "initial" directory is the only match
|
||||||
best = initial;
|
best = initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best == -1)
|
if (best == -1)
|
||||||
{
|
{
|
||||||
if (minDiff != -1)
|
if (minDiff != -1)
|
||||||
|
@ -215,7 +215,7 @@ Foam::timeCluster Foam::multiSolver::findClosestLocalTime
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
FatalErrorIn("multiSolver::findClosestLocalTime")
|
FatalErrorIn("multiSolver::findClosestLocalTime")
|
||||||
<< "The timeClusterList passed to this function has no non-"
|
<< "The timeClusterList passed to this function has no non-"
|
||||||
<< "empty instantLists. Use timeClusterList::purgeEmpties "
|
<< "empty instantLists. Use timeClusterList::purgeEmpties "
|
||||||
|
@ -223,7 +223,7 @@ Foam::timeCluster Foam::multiSolver::findClosestLocalTime
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
label timeIndex
|
label timeIndex
|
||||||
(
|
(
|
||||||
Time::findClosestTimeIndex
|
Time::findClosestTimeIndex
|
||||||
|
@ -251,13 +251,13 @@ Foam::timeCluster Foam::multiSolver::findLatestGlobalTime
|
||||||
timeCluster bestMax(0);
|
timeCluster bestMax(0);
|
||||||
|
|
||||||
timeCluster currentMax;
|
timeCluster currentMax;
|
||||||
|
|
||||||
forAll(tcl, i)
|
forAll(tcl, i)
|
||||||
{
|
{
|
||||||
if (tcl[i].times().size() == 0) continue;
|
if (tcl[i].times().size() == 0) continue;
|
||||||
|
|
||||||
currentMax = tcl[i](tcl[i].globalMaxIndex());
|
currentMax = tcl[i](tcl[i].globalMaxIndex());
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(currentMax.globalValue(0) > bestMax.globalValue(0))
|
(currentMax.globalValue(0) > bestMax.globalValue(0))
|
||||||
|| (
|
|| (
|
||||||
|
@ -306,7 +306,7 @@ Foam::timeCluster Foam::multiSolver::findLatestLocalTime
|
||||||
{
|
{
|
||||||
if (tclPtr->operator[](i).times().size() == 0) continue;
|
if (tclPtr->operator[](i).times().size() == 0) continue;
|
||||||
|
|
||||||
currentMax =
|
currentMax =
|
||||||
tclPtr->operator[](i)(tclPtr->operator[](i).localMaxIndex());
|
tclPtr->operator[](i)(tclPtr->operator[](i).localMaxIndex());
|
||||||
|
|
||||||
if
|
if
|
||||||
|
@ -330,11 +330,59 @@ Foam::timeCluster Foam::multiSolver::findLatestLocalTime
|
||||||
<< " return value to prevent this."
|
<< " return value to prevent this."
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return bestMax;
|
return bestMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::timeCluster Foam::multiSolver::findGlobalIndex
|
||||||
|
(
|
||||||
|
const label& index,
|
||||||
|
const timeClusterList& tcl
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(tcl, i)
|
||||||
|
{
|
||||||
|
if (tcl[i].globalIndex() == index)
|
||||||
|
{
|
||||||
|
return tcl[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return timeCluster();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::multiSolver::includePreviousTimes
|
||||||
|
(
|
||||||
|
timeCluster& tc
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar minTime(VGREAT);
|
||||||
|
forAll(tc, i)
|
||||||
|
{
|
||||||
|
minTime = min(tc[i].value(), minTime);
|
||||||
|
}
|
||||||
|
if (minTime != VGREAT)
|
||||||
|
{
|
||||||
|
fileName thePath(findInstancePath(tc, 0).path());
|
||||||
|
instantList il(Time::findTimes(thePath));
|
||||||
|
forAll(il, i)
|
||||||
|
{
|
||||||
|
if (il[i].value() < minTime)
|
||||||
|
{
|
||||||
|
label newIndex(tc.size());
|
||||||
|
tc.setSize(newIndex + 1);
|
||||||
|
tc[newIndex] = il[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tc.size() > 1)
|
||||||
|
{
|
||||||
|
std::sort(&tc[0], tc.end(), instant::less());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::fileName Foam::multiSolver::findInstancePath
|
Foam::fileName Foam::multiSolver::findInstancePath
|
||||||
(
|
(
|
||||||
const timeCluster& tc,
|
const timeCluster& tc,
|
||||||
|
@ -369,7 +417,8 @@ Foam::fileName Foam::multiSolver::findInstancePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::multiSolver::findMaxSuperLoopValue(const timeClusterList& tcl)
|
Foam::label
|
||||||
|
Foam::multiSolver::findMaxSuperLoopValue(const timeClusterList& tcl)
|
||||||
{
|
{
|
||||||
if (!tcl.size())
|
if (!tcl.size())
|
||||||
{
|
{
|
||||||
|
@ -383,7 +432,8 @@ Foam::label Foam::multiSolver::findMaxSuperLoopValue(const timeClusterList& tcl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::labelList Foam::multiSolver::findMaxSuperLoopIndices(const timeClusterList& tcl)
|
Foam::labelList
|
||||||
|
Foam::multiSolver::findMaxSuperLoopIndices(const timeClusterList& tcl)
|
||||||
{
|
{
|
||||||
label currentMax(-2);
|
label currentMax(-2);
|
||||||
labelList bestIndices(0);
|
labelList bestIndices(0);
|
||||||
|
@ -507,9 +557,10 @@ Foam::timeCluster Foam::multiSolver::readSuperLoopTimes
|
||||||
currentPath/"multiSolverTime"
|
currentPath/"multiSolverTime"
|
||||||
);
|
);
|
||||||
IFstream mstFile(mstFileName);
|
IFstream mstFile(mstFileName);
|
||||||
|
|
||||||
bool mstFileGood(false);
|
bool mstFileGood(false);
|
||||||
scalar globalOffset(0);
|
scalar globalOffset(0);
|
||||||
|
label globalIndex(0);
|
||||||
|
|
||||||
if (mstFile.good())
|
if (mstFile.good())
|
||||||
{
|
{
|
||||||
|
@ -518,6 +569,8 @@ Foam::timeCluster Foam::multiSolver::readSuperLoopTimes
|
||||||
{
|
{
|
||||||
globalOffset =
|
globalOffset =
|
||||||
readScalar(mstDict.lookup("globalOffset"));
|
readScalar(mstDict.lookup("globalOffset"));
|
||||||
|
globalIndex =
|
||||||
|
readLabel(mstDict.lookup("globalIndex"));
|
||||||
mstFileGood = true;
|
mstFileGood = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -534,6 +587,7 @@ Foam::timeCluster Foam::multiSolver::readSuperLoopTimes
|
||||||
(
|
(
|
||||||
Time::findTimes(currentPath),
|
Time::findTimes(currentPath),
|
||||||
globalOffset,
|
globalOffset,
|
||||||
|
globalIndex,
|
||||||
superLoop,
|
superLoop,
|
||||||
solverDomain
|
solverDomain
|
||||||
);
|
);
|
||||||
|
@ -549,7 +603,7 @@ Foam::timeClusterList Foam::multiSolver::readSolverDomainTimes
|
||||||
{
|
{
|
||||||
timeClusterList tcl(0);
|
timeClusterList tcl(0);
|
||||||
label nTimeClusters(0);
|
label nTimeClusters(0);
|
||||||
|
|
||||||
fileName locale;
|
fileName locale;
|
||||||
if (processor.size())
|
if (processor.size())
|
||||||
{
|
{
|
||||||
|
@ -563,9 +617,9 @@ Foam::timeClusterList Foam::multiSolver::readSolverDomainTimes
|
||||||
(
|
(
|
||||||
multiDictRegistry_.path()/locale/solverDomain
|
multiDictRegistry_.path()/locale/solverDomain
|
||||||
);
|
);
|
||||||
|
|
||||||
labelList superLoopList(multiSolver::findSuperLoops(currentPath));
|
labelList superLoopList(multiSolver::findSuperLoops(currentPath));
|
||||||
|
|
||||||
// Loop through superLoopList, check for valid data, store in tcl
|
// Loop through superLoopList, check for valid data, store in tcl
|
||||||
forAll(superLoopList, sl)
|
forAll(superLoopList, sl)
|
||||||
{
|
{
|
||||||
|
@ -576,7 +630,7 @@ Foam::timeClusterList Foam::multiSolver::readSolverDomainTimes
|
||||||
|
|
||||||
// If there are no time directories, ignore this superLoop
|
// If there are no time directories, ignore this superLoop
|
||||||
if (tc.times().size() == 0) continue;
|
if (tc.times().size() == 0) continue;
|
||||||
|
|
||||||
// Store timeCluster
|
// Store timeCluster
|
||||||
tcl.setSize(++nTimeClusters);
|
tcl.setSize(++nTimeClusters);
|
||||||
tcl[nTimeClusters - 1] = tc;
|
tcl[nTimeClusters - 1] = tc;
|
||||||
|
@ -609,7 +663,7 @@ bool Foam::multiSolver::loadTimeClusterList
|
||||||
const Foam::timeClusterList& tcl,
|
const Foam::timeClusterList& tcl,
|
||||||
const bool useGlobalTime,
|
const bool useGlobalTime,
|
||||||
const bool loadStoreFields
|
const bool loadStoreFields
|
||||||
) const
|
)
|
||||||
{
|
{
|
||||||
if (!nonOverlapping(tcl, useGlobalTime)) return false;
|
if (!nonOverlapping(tcl, useGlobalTime)) return false;
|
||||||
|
|
||||||
|
@ -628,30 +682,28 @@ bool Foam::multiSolver::loadTimeClusterList
|
||||||
currentPath/il[Time::findClosestTimeIndex(il, -1.0)].name()
|
currentPath/il[Time::findClosestTimeIndex(il, -1.0)].name()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
setSolverDomainPostProcessing(tcl[i].solverDomainName());
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
loadStoreFields
|
loadStoreFields
|
||||||
&& solverDomains_
|
&& currentSolverDomainDict_.found("storeFields")
|
||||||
.subDict(tcl[i].solverDomainName())
|
|
||||||
.found("storeFields")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
storeFields = wordList(solverDomains_
|
storeFields = wordList(currentSolverDomainDict_.lookup("storeFields"));
|
||||||
.subDict(tcl[i].solverDomainName())
|
|
||||||
.lookup("storeFields"));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
storeFields.clear();
|
storeFields.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(tcl[i].times(), j)
|
forAll(tcl[i].times(), j)
|
||||||
{
|
{
|
||||||
fileName storeFieldsDestination
|
fileName storeFieldsDestination
|
||||||
(
|
(
|
||||||
multiDictRegistry_.path()/tcl[i].times()[j].name()
|
multiDictRegistry_.path()/tcl[i].times()[j].name()
|
||||||
);
|
);
|
||||||
|
|
||||||
cp
|
cp
|
||||||
(
|
(
|
||||||
currentPath/tcl[i].times()[j].name(),
|
currentPath/tcl[i].times()[j].name(),
|
||||||
|
@ -664,7 +716,7 @@ bool Foam::multiSolver::loadTimeClusterList
|
||||||
(
|
(
|
||||||
tcl[i].globalValue(j)
|
tcl[i].globalValue(j)
|
||||||
);
|
);
|
||||||
|
|
||||||
mv
|
mv
|
||||||
(
|
(
|
||||||
multiDictRegistry_.path()/tcl[i].times()[j].name(),
|
multiDictRegistry_.path()/tcl[i].times()[j].name(),
|
||||||
|
@ -719,14 +771,14 @@ void Foam::multiSolver::archiveTimeDirs
|
||||||
{
|
{
|
||||||
labelList allSL(findSuperLoops(archivePath.path()));
|
labelList allSL(findSuperLoops(archivePath.path()));
|
||||||
label currentSL(atoi(archivePath.name().c_str()));
|
label currentSL(atoi(archivePath.name().c_str()));
|
||||||
|
|
||||||
sort(allSL);
|
sort(allSL);
|
||||||
label i = 0;
|
label i = 0;
|
||||||
while (allSL[i] < currentSL)
|
while (allSL[i] < currentSL)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label j = 1; j <= (i - purgeWrite); j++)
|
for (label j = 1; j <= (i - purgeWrite); j++)
|
||||||
{
|
{
|
||||||
rmDir(archivePath.path()/name(allSL[j]));
|
rmDir(archivePath.path()/name(allSL[j]));
|
||||||
|
@ -753,6 +805,4 @@ void Foam::multiSolver::purgeTimeDirs(const Foam::fileName& path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
103
src/multiSolver/multiTime/multiTime.C
Normal file
103
src/multiSolver/multiTime/multiTime.C
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "multiTime.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(multiTime, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::multiTime::multiTime
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName,
|
||||||
|
const word& constantName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Time
|
||||||
|
(
|
||||||
|
name,
|
||||||
|
rootPath,
|
||||||
|
caseName,
|
||||||
|
systemName,
|
||||||
|
constantName
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::multiTime::multiTime
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName,
|
||||||
|
const word& constantName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Time
|
||||||
|
(
|
||||||
|
dict,
|
||||||
|
rootPath,
|
||||||
|
caseName,
|
||||||
|
systemName,
|
||||||
|
constantName
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::multiTime::multiTime
|
||||||
|
(
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName,
|
||||||
|
const word& constantName
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Time
|
||||||
|
(
|
||||||
|
rootPath,
|
||||||
|
caseName,
|
||||||
|
systemName,
|
||||||
|
constantName
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::multiTime::~multiTime()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
126
src/multiSolver/multiTime/multiTime.H
Normal file
126
src/multiSolver/multiTime/multiTime.H
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright held by original author
|
||||||
|
\\/ 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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::multiTime
|
||||||
|
|
||||||
|
Description
|
||||||
|
Gives read access to time directory format and precision.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
multiTime.C
|
||||||
|
|
||||||
|
Author
|
||||||
|
David L. F. Gaden
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef multiTime_H
|
||||||
|
#define multiTime_H
|
||||||
|
|
||||||
|
#include "Time.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class multiTime Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class multiTime
|
||||||
|
:
|
||||||
|
public Time
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
TypeName("multiTime");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct given name, rootPath and casePath
|
||||||
|
multiTime
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName = "system",
|
||||||
|
const word& constantName = "constant"
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct given dictionary, rootPath and casePath
|
||||||
|
multiTime
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName = "system",
|
||||||
|
const word& constantName = "constant"
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct given endTime, rootPath and casePath
|
||||||
|
multiTime
|
||||||
|
(
|
||||||
|
const fileName& rootPath,
|
||||||
|
const fileName& caseName,
|
||||||
|
const word& systemName = "system",
|
||||||
|
const word& constantName = "constant"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
virtual ~multiTime();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Time directory precision
|
||||||
|
inline const int& precision() const
|
||||||
|
{
|
||||||
|
return Time::precision_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Time directory format
|
||||||
|
inline const Time::fmtflags& format() const
|
||||||
|
{
|
||||||
|
return Time::format_;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
@ -41,6 +41,7 @@ Foam::timeCluster::timeCluster
|
||||||
(
|
(
|
||||||
const instantList& times,
|
const instantList& times,
|
||||||
const scalar globalOffset,
|
const scalar globalOffset,
|
||||||
|
const label globalIndex,
|
||||||
const label superLoop,
|
const label superLoop,
|
||||||
const word& solverDomainName,
|
const word& solverDomainName,
|
||||||
const word& preConName
|
const word& preConName
|
||||||
|
@ -48,6 +49,7 @@ Foam::timeCluster::timeCluster
|
||||||
:
|
:
|
||||||
instantList(times),
|
instantList(times),
|
||||||
globalOffset_(globalOffset),
|
globalOffset_(globalOffset),
|
||||||
|
globalIndex_(globalIndex),
|
||||||
superLoop_(superLoop),
|
superLoop_(superLoop),
|
||||||
solverDomainName_(solverDomainName),
|
solverDomainName_(solverDomainName),
|
||||||
preConName_(preConName)
|
preConName_(preConName)
|
||||||
|
@ -61,6 +63,7 @@ Foam::timeCluster::timeCluster
|
||||||
:
|
:
|
||||||
instantList(1, tc[index]),
|
instantList(1, tc[index]),
|
||||||
globalOffset_(tc.globalOffset_),
|
globalOffset_(tc.globalOffset_),
|
||||||
|
globalIndex_(tc.globalIndex_),
|
||||||
superLoop_(tc.superLoop_),
|
superLoop_(tc.superLoop_),
|
||||||
solverDomainName_(tc.solverDomainName_),
|
solverDomainName_(tc.solverDomainName_),
|
||||||
preConName_(tc.preConName_)
|
preConName_(tc.preConName_)
|
||||||
|
@ -71,6 +74,7 @@ Foam::timeCluster::timeCluster(const Foam::scalar t)
|
||||||
:
|
:
|
||||||
instantList(1, instant(0)),
|
instantList(1, instant(0)),
|
||||||
globalOffset_(0),
|
globalOffset_(0),
|
||||||
|
globalIndex_(0),
|
||||||
superLoop_(0),
|
superLoop_(0),
|
||||||
solverDomainName_(word::null),
|
solverDomainName_(word::null),
|
||||||
preConName_(word::null)
|
preConName_(word::null)
|
||||||
|
@ -223,6 +227,7 @@ Foam::timeCluster Foam::timeCluster::operator()(const Foam::label index) const
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, timeCluster& I)
|
Foam::Istream& Foam::operator>>(Istream& is, timeCluster& I)
|
||||||
{
|
{
|
||||||
return is >> I.globalOffset_
|
return is >> I.globalOffset_
|
||||||
|
>> I.globalIndex_
|
||||||
>> I.superLoop_
|
>> I.superLoop_
|
||||||
>> I.solverDomainName_
|
>> I.solverDomainName_
|
||||||
>> I.preConName_
|
>> I.preConName_
|
||||||
|
@ -233,11 +238,11 @@ Foam::Istream& Foam::operator>>(Istream& is, timeCluster& I)
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const timeCluster& I)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const timeCluster& I)
|
||||||
{
|
{
|
||||||
return os << "/* globalOffset: */\t" << I.globalOffset_ << nl
|
return os << "/* globalOffset: */\t" << I.globalOffset_ << nl
|
||||||
|
<< "/* globalIndex: */\t" << I.globalIndex_ << nl
|
||||||
<< "/* superLoop: */\t" << I.superLoop_ << nl
|
<< "/* superLoop: */\t" << I.superLoop_ << nl
|
||||||
<< "/* solverDomain: */\t" << I.solverDomainName_ << nl
|
<< "/* solverDomain: */\t" << I.solverDomainName_ << nl
|
||||||
<< "/* preConName: */\t" << I.preConName_ << nl
|
<< "/* preConName: */\t" << I.preConName_ << nl
|
||||||
<< "/* Instant list: */\t" << I.times();
|
<< "/* Instant list: */\t" << I.times();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -72,9 +72,10 @@ class timeCluster
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
scalar globalOffset_;
|
scalar globalOffset_;
|
||||||
|
label globalIndex_;
|
||||||
label superLoop_;
|
label superLoop_;
|
||||||
word solverDomainName_;
|
word solverDomainName_;
|
||||||
|
|
||||||
// PreConditioned file name - used only for pre and post conditioning
|
// PreConditioned file name - used only for pre and post conditioning
|
||||||
// a data set for parallel runs
|
// a data set for parallel runs
|
||||||
word preConName_;
|
word preConName_;
|
||||||
|
@ -110,6 +111,7 @@ public:
|
||||||
(
|
(
|
||||||
const instantList& times,
|
const instantList& times,
|
||||||
const scalar globalOffset,
|
const scalar globalOffset,
|
||||||
|
const label globalIndex,
|
||||||
const label superLoop,
|
const label superLoop,
|
||||||
const word& solverDomainName,
|
const word& solverDomainName,
|
||||||
const word& preConName = word::null
|
const word& preConName = word::null
|
||||||
|
@ -123,7 +125,7 @@ public:
|
||||||
const timeCluster& tc,
|
const timeCluster& tc,
|
||||||
const label index
|
const label index
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct a time cluster given a scalar value. This constructs
|
//- Construct a time cluster given a scalar value. This constructs
|
||||||
// a timeCluster with a single instant of time at value t, and whose
|
// a timeCluster with a single instant of time at value t, and whose
|
||||||
// other values are zero or empty.
|
// other values are zero or empty.
|
||||||
|
@ -143,6 +145,11 @@ public:
|
||||||
|
|
||||||
inline scalar& globalOffset();
|
inline scalar& globalOffset();
|
||||||
|
|
||||||
|
//- Global index
|
||||||
|
inline label globalIndex() const;
|
||||||
|
|
||||||
|
inline label& globalIndex();
|
||||||
|
|
||||||
//- SuperLoop
|
//- SuperLoop
|
||||||
inline label superLoop() const;
|
inline label superLoop() const;
|
||||||
|
|
||||||
|
@ -159,43 +166,43 @@ public:
|
||||||
inline word& preConName();
|
inline word& preConName();
|
||||||
|
|
||||||
// Derived values
|
// Derived values
|
||||||
|
|
||||||
//- Global value at index
|
//- Global value at index
|
||||||
scalar globalValue(const label& index) const;
|
scalar globalValue(const label& index) const;
|
||||||
|
|
||||||
//- Search for and return global min value. If empty,
|
//- Search for and return global min value. If empty,
|
||||||
// returns VGREAT.
|
// returns VGREAT.
|
||||||
scalar globalMinValue() const;
|
scalar globalMinValue() const;
|
||||||
|
|
||||||
//- Search for and return global max value. If empty,
|
//- Search for and return global max value. If empty,
|
||||||
// returns 0.
|
// returns 0.
|
||||||
scalar globalMaxValue() const;
|
scalar globalMaxValue() const;
|
||||||
|
|
||||||
//- Search for and return index of global min value
|
//- Search for and return index of global min value
|
||||||
label globalMinIndex() const;
|
label globalMinIndex() const;
|
||||||
|
|
||||||
//- Search for and return index of global max value
|
//- Search for and return index of global max value
|
||||||
label globalMaxIndex() const;
|
label globalMaxIndex() const;
|
||||||
|
|
||||||
//- Global closest time
|
//- Global closest time
|
||||||
scalar globalFindClosestTimeValue(const scalar) const;
|
scalar globalFindClosestTimeValue(const scalar) const;
|
||||||
|
|
||||||
//- Global closest time index
|
//- Global closest time index
|
||||||
label globalFindClosestTimeIndex(const scalar) const;
|
label globalFindClosestTimeIndex(const scalar) const;
|
||||||
|
|
||||||
//- Local value at index
|
//- Local value at index
|
||||||
scalar localValue(const label& index) const;
|
scalar localValue(const label& index) const;
|
||||||
|
|
||||||
//- Search for and return local min value
|
//- Search for and return local min value
|
||||||
scalar localMinValue() const;
|
scalar localMinValue() const;
|
||||||
|
|
||||||
//- Search for and return local max value
|
//- Search for and return local max value
|
||||||
scalar localMaxValue() const;
|
scalar localMaxValue() const;
|
||||||
|
|
||||||
//- Search for and return index of global min value. If empty,
|
//- Search for and return index of global min value. If empty,
|
||||||
// returns VGREAT
|
// returns VGREAT
|
||||||
label localMinIndex() const;
|
label localMinIndex() const;
|
||||||
|
|
||||||
//- Search for and return index of global max value. If empty,
|
//- Search for and return index of global max value. If empty,
|
||||||
// returns 0.
|
// returns 0.
|
||||||
label localMaxIndex() const;
|
label localMaxIndex() const;
|
||||||
|
@ -205,9 +212,9 @@ public:
|
||||||
|
|
||||||
//-Local closest time index
|
//-Local closest time index
|
||||||
label localFindClosestTimeIndex(const scalar) const;
|
label localFindClosestTimeIndex(const scalar) const;
|
||||||
|
|
||||||
// Operators
|
// Operators
|
||||||
|
|
||||||
//- Chip off a single instant given an index, return as timeCluster
|
//- Chip off a single instant given an index, return as timeCluster
|
||||||
// This retains superLoop, solverDomain, etc.. with a timevalue
|
// This retains superLoop, solverDomain, etc.. with a timevalue
|
||||||
timeCluster operator()(const label index) const;
|
timeCluster operator()(const label index) const;
|
||||||
|
@ -228,6 +235,8 @@ public:
|
||||||
|
|
||||||
#include "timeClusterI.H"
|
#include "timeClusterI.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -52,6 +52,16 @@ inline scalar& timeCluster::globalOffset()
|
||||||
return globalOffset_;
|
return globalOffset_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline label timeCluster::globalIndex() const
|
||||||
|
{
|
||||||
|
return globalIndex_;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline label& timeCluster::globalIndex()
|
||||||
|
{
|
||||||
|
return globalIndex_;
|
||||||
|
}
|
||||||
|
|
||||||
inline label timeCluster::superLoop() const
|
inline label timeCluster::superLoop() const
|
||||||
{
|
{
|
||||||
return superLoop_;
|
return superLoop_;
|
||||||
|
|
|
@ -85,7 +85,7 @@ void Foam::timeClusterList::append(const timeClusterList& tclIn)
|
||||||
{
|
{
|
||||||
label wasSize = this->size();
|
label wasSize = this->size();
|
||||||
this->setSize(tclIn.size() + this->size());
|
this->setSize(tclIn.size() + this->size());
|
||||||
|
|
||||||
for (label i = 0; i < tclIn.size(); i++)
|
for (label i = 0; i < tclIn.size(); i++)
|
||||||
{
|
{
|
||||||
this->operator[](i + wasSize) = tclIn[i];
|
this->operator[](i + wasSize) = tclIn[i];
|
||||||
|
@ -97,7 +97,7 @@ void Foam::timeClusterList::append(const timeCluster& tcIn)
|
||||||
{
|
{
|
||||||
label wasSize = this->size();
|
label wasSize = this->size();
|
||||||
this->setSize(this->size() + 1);
|
this->setSize(this->size() + 1);
|
||||||
|
|
||||||
this->operator[](wasSize) = tcIn;
|
this->operator[](wasSize) = tcIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ void Foam::timeClusterList::append(const timeCluster& tcIn)
|
||||||
bool Foam::timeClusterList::purgeEmpties()
|
bool Foam::timeClusterList::purgeEmpties()
|
||||||
{
|
{
|
||||||
if (!this->size()) return false;
|
if (!this->size()) return false;
|
||||||
|
|
||||||
label empties(0);
|
label empties(0);
|
||||||
for (label i = 0; i < this->size(); i++)
|
for (label i = 0; i < this->size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +133,7 @@ Foam::timeClusterList Foam::timeClusterList::selectiveSubList
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
timeClusterList tcl(indices.size());
|
timeClusterList tcl(indices.size());
|
||||||
|
|
||||||
forAll(indices, i)
|
forAll(indices, i)
|
||||||
{
|
{
|
||||||
if (indices[i] > this->size())
|
if (indices[i] > this->size())
|
||||||
|
@ -151,6 +151,4 @@ Foam::timeClusterList Foam::timeClusterList::selectiveSubList
|
||||||
return tcl;
|
return tcl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
static const char* const typeName;
|
static const char* const typeName;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Null constructor
|
//- Null constructor
|
||||||
timeClusterList();
|
timeClusterList();
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public:
|
||||||
|
|
||||||
//- Construct with given size and value for all elements.
|
//- Construct with given size and value for all elements.
|
||||||
timeClusterList(const label, const timeCluster&);
|
timeClusterList(const label, const timeCluster&);
|
||||||
|
|
||||||
//- Construct as a sublist of another timeClusterList. This is not
|
//- Construct as a sublist of another timeClusterList. This is not
|
||||||
// like the SubList in that this is not a new class, rather it is only
|
// like the SubList in that this is not a new class, rather it is only
|
||||||
// producing a new copy that contains the specified entries.
|
// producing a new copy that contains the specified entries.
|
||||||
|
@ -82,7 +82,7 @@ public:
|
||||||
timeClusterList(Istream&);
|
timeClusterList(Istream&);
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
//- Sort by global time
|
//- Sort by global time
|
||||||
void globalSort();
|
void globalSort();
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public:
|
||||||
|
|
||||||
//- Append a timeCluster on the end of this list
|
//- Append a timeCluster on the end of this list
|
||||||
void append(const timeCluster& tcIn);
|
void append(const timeCluster& tcIn);
|
||||||
|
|
||||||
//- Remove timeClusters with empty instantLists return false if all are
|
//- Remove timeClusters with empty instantLists return false if all are
|
||||||
// empty
|
// empty
|
||||||
bool purgeEmpties();
|
bool purgeEmpties();
|
||||||
|
|
73
tutorials/multiSolver/README
Normal file
73
tutorials/multiSolver/README
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
|---------------------.
|
||||||
|
| David L. F. Gaden's |
|
||||||
|
.----------------|---------------------'
|
||||||
|
| multiSolver | Version: 0.6.0
|
||||||
|
'----------------|
|
||||||
|
| If you use, please cite:
|
||||||
|
V
|
||||||
|
* D. L. F. Gaden, and E. L. Bibeau (2012), "A programmable logic controller
|
||||||
|
emulator with automatic algorithm-switching for computational fluid dynamics
|
||||||
|
using OpenFOAM," Proceedings of the 2012 CSME International Congress, Paper
|
||||||
|
number 156959763, June 4-6, Winnipeg, MB.
|
||||||
|
|
||||||
|
Description
|
||||||
|
===========
|
||||||
|
An extension to OpenFOAM that allows you to run multiple solvers in sequence on
|
||||||
|
the same dataset.
|
||||||
|
|
||||||
|
Original Author
|
||||||
|
===============
|
||||||
|
David L. F. Gaden (dlfgaden@gmail.com)
|
||||||
|
|
||||||
|
Current Maintainer
|
||||||
|
==================
|
||||||
|
David L. F. Gaden (dlfgaden@gmail.com)
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
============
|
||||||
|
David L. F. Gaden : base version
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
github.com/Marupio/multiSolver/wiki
|
||||||
|
|
||||||
|
Installation/Compilation
|
||||||
|
========================
|
||||||
|
|
||||||
|
See documentation.
|
||||||
|
|
||||||
|
Contents
|
||||||
|
========
|
||||||
|
|
||||||
|
- src - the library source files
|
||||||
|
- applications\solvers - a demo application that uses multiSolver
|
||||||
|
- applications\utilities - a data handling utility
|
||||||
|
- tutorials - a sample case that runs the demo application
|
||||||
|
|
||||||
|
Required OpenFOAM-Version (Known to work with)
|
||||||
|
==============================================
|
||||||
|
1.6-ext
|
||||||
|
2.0.x
|
||||||
|
2.1.x
|
||||||
|
2.2.x
|
||||||
|
|
||||||
|
History
|
||||||
|
=======
|
||||||
|
|
||||||
|
2010-07-23: Initial import
|
||||||
|
2011-03-29: Minor bug fix for 1.6-ext and 1.7.1
|
||||||
|
2011-04-05:
|
||||||
|
* Major upgrade
|
||||||
|
* Now works for parallel simulations
|
||||||
|
2011-06-03:
|
||||||
|
* Minor bug fix:
|
||||||
|
* Parallel decomposing no longer omits the initial directory
|
||||||
|
2011-07-01: Overhauled documentation; no change to code
|
||||||
|
2012-10-25: Version 0.5.0
|
||||||
|
* Moved to git
|
||||||
|
* Enabled boundary switching
|
||||||
|
* Introduced version numbers to keep track of changes
|
||||||
|
2013-08-29: Version 0.6.0
|
||||||
|
* Uploaded to github and OpenFOAM-extend
|
||||||
|
* Restructured applications and tutorials directories for consistency
|
||||||
|
* Made opening splash optional
|
|
@ -16,7 +16,7 @@ FoamFile
|
||||||
|
|
||||||
convertToMeters 0.1;
|
convertToMeters 0.1;
|
||||||
|
|
||||||
vertices
|
vertices
|
||||||
(
|
(
|
||||||
(0 0 0)
|
(0 0 0)
|
||||||
(1.5 0 0)
|
(1.5 0 0)
|
||||||
|
@ -42,7 +42,7 @@ vertices
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
blocks
|
blocks
|
||||||
(
|
(
|
||||||
hex (0 1 2 3 10 11 12 13) (20 20 1) simpleGrading (1 1 1)
|
hex (0 1 2 3 10 11 12 13) (20 20 1) simpleGrading (1 1 1)
|
||||||
hex (1 4 7 2 11 14 17 12) (20 20 1) simpleGrading (1 1 1)
|
hex (1 4 7 2 11 14 17 12) (20 20 1) simpleGrading (1 1 1)
|
||||||
|
@ -50,11 +50,11 @@ blocks
|
||||||
hex (2 7 9 8 12 17 19 18) (20 20 1) simpleGrading (1 1 1)
|
hex (2 7 9 8 12 17 19 18) (20 20 1) simpleGrading (1 1 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
edges
|
edges
|
||||||
(
|
(
|
||||||
);
|
);
|
||||||
|
|
||||||
patches
|
patches
|
||||||
(
|
(
|
||||||
wall steetWalls
|
wall steetWalls
|
||||||
(
|
(
|
||||||
|
@ -83,7 +83,7 @@ patches
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
mergePatchPairs
|
mergePatchPairs
|
||||||
(
|
(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
| \\ / O peration | Version: 1.5-dev |
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
| \\ / A nd | Revision: exported |
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
| \\/ M anipulation | Web: http://www.OpenFOAM.org |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
| \\ / O peration | Version: 1.7.1 |
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5-dev |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object multiTransportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
dictionaryName transportProperties;
|
||||||
|
|
||||||
|
multiSolver
|
||||||
|
{
|
||||||
|
scalarTransportFoam
|
||||||
|
{
|
||||||
|
DT DT [0 2 -1 0 0 0 0] 0.0;
|
||||||
|
}
|
||||||
|
icoFoam1
|
||||||
|
{
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||||
|
}
|
||||||
|
icoFoam2
|
||||||
|
{
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(0 0 0)
|
||||||
|
(1.5 0 0)
|
||||||
|
(1.5 1 0)
|
||||||
|
(0 1 0)
|
||||||
|
(2.5 0 0)
|
||||||
|
(4 0 0)
|
||||||
|
(4 1 0)
|
||||||
|
(2.5 1 0)
|
||||||
|
(1.5 2.5 0)
|
||||||
|
(2.5 2.5 0)
|
||||||
|
|
||||||
|
(0 0 0.1)
|
||||||
|
(1.5 0 0.1)
|
||||||
|
(1.5 1 0.1)
|
||||||
|
(0 1 0.1)
|
||||||
|
(2.5 0 0.1)
|
||||||
|
(4 0 0.1)
|
||||||
|
(4 1 0.1)
|
||||||
|
(2.5 1 0.1)
|
||||||
|
(1.5 2.5 0.1)
|
||||||
|
(2.5 2.5 0.1)
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 10 11 12 13) (20 20 1) simpleGrading (1 1 1)
|
||||||
|
hex (1 4 7 2 11 14 17 12) (20 20 1) simpleGrading (1 1 1)
|
||||||
|
hex (4 5 6 7 14 15 16 17) (20 20 1) simpleGrading (1 1 1)
|
||||||
|
hex (2 7 9 8 12 17 19 18) (20 20 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
patches
|
||||||
|
(
|
||||||
|
wall steetWalls
|
||||||
|
(
|
||||||
|
(1 0 10 11)
|
||||||
|
(4 1 11 14)
|
||||||
|
(5 4 14 15)
|
||||||
|
(2 3 13 12)
|
||||||
|
(6 7 17 16)
|
||||||
|
)
|
||||||
|
wall branchWalls
|
||||||
|
(
|
||||||
|
(8 2 12 18)
|
||||||
|
(7 9 19 17)
|
||||||
|
)
|
||||||
|
patch westStreet
|
||||||
|
(
|
||||||
|
(3 0 10 13)
|
||||||
|
)
|
||||||
|
patch eastStreet
|
||||||
|
(
|
||||||
|
(5 6 16 15)
|
||||||
|
)
|
||||||
|
patch northBranch
|
||||||
|
(
|
||||||
|
(9 8 18 19)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class polyBoundaryMesh;
|
||||||
|
location "constant/polyMesh";
|
||||||
|
object boundary;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
6
|
||||||
|
(
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 100;
|
||||||
|
startFace 3100;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
nFaces 40;
|
||||||
|
startFace 3200;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 20;
|
||||||
|
startFace 3240;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 20;
|
||||||
|
startFace 3260;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
nFaces 20;
|
||||||
|
startFace 3280;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
nFaces 3200;
|
||||||
|
startFace 3300;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,21 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
nu nu [ 0 2 -1 0 0 0 0 ] 0.01;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam1@-1@0@T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam1@-1@0@U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 -1 0);
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam1@-1@0@p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam2@-1@0@T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,54 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam2@-1@0@U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (-1 0 0);
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,53 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "-1";
|
||||||
|
object icoFoam2@-1@0@p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "-1";
|
||||||
|
object scalarTransportFoam@-1@0@T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,54 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "-1";
|
||||||
|
object scalarTransportFoam@-1@0@U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
steetWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
branchWalls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
westStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
eastStreet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
northBranch
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 -1 0);
|
||||||
|
}
|
||||||
|
defaultFaces
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression uncompressed;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
application icoFoam;
|
||||||
|
|
||||||
|
deltaT 0.01;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 1;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0.1;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 0.1;
|
||||||
|
|
||||||
|
timeFormat scientific;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 2;
|
||||||
|
|
||||||
|
method simple;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 1 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 1 1 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,60 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(nu,U) Gauss linear corrected;
|
||||||
|
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
interpolate(HbyA) linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pRefCell 0;
|
||||||
|
pRefValue 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,70 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5-dev |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object multiSolverDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
multiSolverControl
|
||||||
|
{
|
||||||
|
initialStartFrom startTime;
|
||||||
|
startTime 0;
|
||||||
|
finalStopAt endSuperLoop;
|
||||||
|
endSuperLoop 3;
|
||||||
|
timeFormat scientific;
|
||||||
|
timePrecision 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
solverDomains
|
||||||
|
{
|
||||||
|
icoFoam1
|
||||||
|
{
|
||||||
|
application icoFoam;
|
||||||
|
startFrom startTime;
|
||||||
|
startTime 0;
|
||||||
|
stopAt endTime;
|
||||||
|
endTime 0.1;
|
||||||
|
deltaT 0.01;
|
||||||
|
writeControl timeStep;
|
||||||
|
writeInterval 1;
|
||||||
|
storeFields ( T );
|
||||||
|
}
|
||||||
|
icoFoam2
|
||||||
|
{
|
||||||
|
application icoFoam;
|
||||||
|
startFrom startTime;
|
||||||
|
startTime 0;
|
||||||
|
stopAt endTime;
|
||||||
|
endTime 0.1;
|
||||||
|
deltaT 0.01;
|
||||||
|
writeControl timeStep;
|
||||||
|
writeInterval 1;
|
||||||
|
storeFields ( T );
|
||||||
|
}
|
||||||
|
scalarTransportFoam
|
||||||
|
{
|
||||||
|
application scalarTransportFoam;
|
||||||
|
startFrom latestTimeAllDomains;
|
||||||
|
stopAt elapsedTime;
|
||||||
|
elapsedTime 1;
|
||||||
|
deltaT 0.1;
|
||||||
|
writeControl timeStep;
|
||||||
|
writeInterval 1;
|
||||||
|
storeFields ( p );
|
||||||
|
}
|
||||||
|
default
|
||||||
|
{
|
||||||
|
writeFormat ascii;
|
||||||
|
writePrecision 6;
|
||||||
|
writeCompression uncompressed;
|
||||||
|
runTimeModifiable yes;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5-dev |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object multiFvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
dictionaryName fvSchemes;
|
||||||
|
|
||||||
|
multiSolver
|
||||||
|
{
|
||||||
|
icoFoam1
|
||||||
|
{
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(nu,U) Gauss linear corrected;
|
||||||
|
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
interpolate(HbyA) linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
icoFoam2
|
||||||
|
{
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(nu,U) Gauss linear corrected;
|
||||||
|
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
interpolate(HbyA) linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scalarTransportFoam
|
||||||
|
{
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
ddt(T) Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,T) Gauss upwind;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(DT,T) Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -0,0 +1,100 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.5-dev |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object multiFvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
dictionaryName fvSolution;
|
||||||
|
|
||||||
|
multiSolver
|
||||||
|
{
|
||||||
|
icoFoam1
|
||||||
|
{
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pRefCell 0;
|
||||||
|
pRefValue 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
icoFoam2
|
||||||
|
{
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
p
|
||||||
|
{
|
||||||
|
solver PCG;
|
||||||
|
preconditioner DIC;
|
||||||
|
tolerance 1e-06;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
U
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pRefCell 0;
|
||||||
|
pRefValue 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scalarTransportFoam
|
||||||
|
{
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
T
|
||||||
|
{
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-05;
|
||||||
|
relTol 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
@ -1,8 +1,8 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
| \\ / O peration | Version: 1.7.1 |
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 2;
|
||||||
|
|
||||||
|
method simple;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (2 1 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n ( 1 1 1 );
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
|
@ -1,8 +1,8 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
| \\ / O peration | Version: 1.7.1 |
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||||
| \\ / O peration | Version: 1.7.1 |
|
| \\ / O peration | Version: 1.6-ext |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
| \\ / A nd | Web: www.extend-project.de |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|
|
@ -76,7 +76,7 @@ multiSolver
|
||||||
pRefValue 0;
|
pRefValue 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarTransportFoam
|
scalarTransportFoam
|
||||||
{
|
{
|
||||||
solvers
|
solvers
|
||||||
|
|
Reference in a new issue