mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
Conflicts: tutorials/combustion/fireFoam/LES/compartmentFire/Allclean
This commit is contained in:
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
|
||||
const Switch inflate(args.args()[1]);
|
||||
const Switch inflate(args[1]);
|
||||
|
||||
if (inflate)
|
||||
{
|
||||
|
||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
|
||||
|
||||
const Switch inflate(args.args()[1]);
|
||||
const Switch inflate(args[1]);
|
||||
|
||||
if (inflate)
|
||||
{
|
||||
|
||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
||||
#include "createNamedMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
word cellSetName(args.args()[1]);
|
||||
word cellSetName(args[1]);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
const bool minSet = args.optionFound("minSet");
|
||||
|
||||
@ -58,7 +58,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
std::ifstream plot3dFile(args.args()[1].c_str());
|
||||
std::ifstream plot3dFile(args[1].c_str());
|
||||
|
||||
string line;
|
||||
std::getline(plot3dFile, line);
|
||||
|
||||
@ -811,7 +811,7 @@ int main(int argc, char *argv[])
|
||||
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
|
||||
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
||||
|
||||
cubitFile = args.options().found("cubit");
|
||||
cubitFile = args.optionFound("cubit");
|
||||
|
||||
if (cubitFile)
|
||||
{
|
||||
|
||||
@ -128,16 +128,12 @@ int main(int argc, char *argv[])
|
||||
fileName dictPath;
|
||||
|
||||
// Check if the dictionary is specified on the command-line
|
||||
if (args.optionFound("dict"))
|
||||
if (args.optionReadIfPresent("dict", dictPath))
|
||||
{
|
||||
dictPath = args["dict"];
|
||||
|
||||
dictPath =
|
||||
(
|
||||
isDir(dictPath)
|
||||
? dictPath/dictName
|
||||
: dictPath
|
||||
);
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
}
|
||||
// Check if dictionary is present in the constant directory
|
||||
else if
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,14 +67,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Allow override of decomposeParDict location
|
||||
fileName decompDictFile;
|
||||
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
|
||||
{
|
||||
if (isDir(decompDictFile))
|
||||
{
|
||||
decompDictFile = decompDictFile / "decomposeParDict";
|
||||
}
|
||||
}
|
||||
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
IOdictionary foamyHexMeshDict
|
||||
(
|
||||
|
||||
@ -524,13 +524,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Allow override of decomposeParDict location
|
||||
fileName decompDictFile;
|
||||
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
|
||||
{
|
||||
if (isDir(decompDictFile))
|
||||
{
|
||||
decompDictFile = decompDictFile / "decomposeParDict";
|
||||
}
|
||||
}
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
labelList decomp = decompositionModel::New
|
||||
(
|
||||
|
||||
@ -374,7 +374,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const fileName exportName = args.args()[1];
|
||||
const fileName exportName = args[1];
|
||||
|
||||
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
||||
<< " writing a re-sampled surface to " << exportName
|
||||
|
||||
@ -36,6 +36,7 @@ Description
|
||||
#include "searchableSurfaces.H"
|
||||
#include "conformationSurfaces.H"
|
||||
#include "triSurfaceMesh.H"
|
||||
#include "labelVector.H"
|
||||
|
||||
#include "MarchingCubes.h"
|
||||
|
||||
@ -52,7 +53,6 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
"Re-sample surfaces used in foamyHexMesh operation"
|
||||
);
|
||||
//argList::validArgs.append("inputFile");
|
||||
argList::validArgs.append("(nx ny nz)");
|
||||
argList::validArgs.append("outputName");
|
||||
|
||||
@ -60,8 +60,8 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const Vector<label> n(IStringStream(args.args()[1])());
|
||||
const fileName exportName = args.args()[2];
|
||||
const labelVector n(args.argRead<labelVector>(1));
|
||||
const fileName exportName = args[2];
|
||||
|
||||
Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
|
||||
<< " writing re-sampled " << n << " to " << exportName
|
||||
|
||||
@ -93,10 +93,9 @@ int main(int argc, char *argv[])
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||
CV2D mesh(runTime, controlDict);
|
||||
|
||||
if (args.options().found("pointsFile"))
|
||||
if (args.optionFound("pointsFile"))
|
||||
{
|
||||
fileName pointFileName(IStringStream(args.options()["pointsFile"])());
|
||||
mesh.insertPoints(pointFileName);
|
||||
mesh.insertPoints(args["pointsFile"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright 2015-2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -905,13 +905,7 @@ int main(int argc, char *argv[])
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
fileName decompDictFile;
|
||||
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
|
||||
{
|
||||
if (isDir(decompDictFile))
|
||||
{
|
||||
decompDictFile = decompDictFile/"decomposeParDict";
|
||||
}
|
||||
}
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
decomposeDict = IOdictionary
|
||||
(
|
||||
|
||||
@ -297,13 +297,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
// set up the tolerances for the sliding mesh
|
||||
dictionary slidingTolerances;
|
||||
if (args.options().found("toleranceDict"))
|
||||
if (args.optionFound("toleranceDict"))
|
||||
{
|
||||
IOdictionary toleranceFile
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
args.options()["toleranceDict"],
|
||||
args["toleranceDict"],
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
|
||||
@ -270,14 +270,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Allow override of decomposeParDict location
|
||||
fileName decompDictFile;
|
||||
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
|
||||
{
|
||||
if (isDir(decompDictFile))
|
||||
{
|
||||
decompDictFile = decompDictFile/"decomposeParDict";
|
||||
}
|
||||
}
|
||||
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
wordList regionNames;
|
||||
wordList regionDirs;
|
||||
@ -360,7 +353,6 @@ int main(int argc, char *argv[])
|
||||
),
|
||||
decompDictFile
|
||||
)
|
||||
|
||||
).lookup("numberOfSubdomains")
|
||||
);
|
||||
|
||||
|
||||
@ -64,6 +64,7 @@ Usage
|
||||
#include "fvMeshTools.H"
|
||||
#include "fvMeshDistribute.H"
|
||||
#include "decompositionMethod.H"
|
||||
#include "decompositionModel.H"
|
||||
#include "timeSelector.H"
|
||||
#include "PstreamReduceOps.H"
|
||||
#include "volFields.H"
|
||||
@ -74,7 +75,6 @@ Usage
|
||||
#include "loadOrCreateMesh.H"
|
||||
#include "processorFvPatchField.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "decompositionModel.H"
|
||||
|
||||
#include "parFvFieldReconstructor.H"
|
||||
#include "parLagrangianRedistributor.H"
|
||||
@ -2152,7 +2152,6 @@ int main(int argc, char *argv[])
|
||||
bool newTimes = args.optionFound("newTimes");
|
||||
|
||||
|
||||
|
||||
if (env("FOAM_SIGFPE"))
|
||||
{
|
||||
WarningInFunction
|
||||
@ -2245,8 +2244,6 @@ int main(int argc, char *argv[])
|
||||
Pstream::scatter(decompose);
|
||||
|
||||
|
||||
|
||||
|
||||
// If running distributed we have problem of new processors not finding
|
||||
// a system/controlDict. However if we switch on the master-only reading
|
||||
// the problem becomes that the time directories are differing sizes and
|
||||
@ -2330,7 +2327,6 @@ int main(int argc, char *argv[])
|
||||
// Determine any region
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
fileName meshSubDir;
|
||||
|
||||
if (args.optionReadIfPresent("region", regionName))
|
||||
{
|
||||
meshSubDir = regionName/polyMesh::meshSubDir;
|
||||
@ -2774,13 +2770,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Allow override of decomposeParDict location
|
||||
fileName decompDictFile;
|
||||
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
|
||||
{
|
||||
if (isDir(decompDictFile))
|
||||
{
|
||||
decompDictFile = decompDictFile / "decomposeParDict";
|
||||
}
|
||||
}
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
|
||||
// Determine decomposition
|
||||
|
||||
@ -18,8 +18,10 @@ if (!fieldsToUse.found(fieldName))
|
||||
fieldName,
|
||||
timeDirs[n1].name(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
).typeHeaderOk<volScalarField>(false)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // no register
|
||||
).typeHeaderOk<volScalarField>(false, false)
|
||||
);
|
||||
|
||||
if (variableGood)
|
||||
|
||||
@ -7,8 +7,6 @@ if (timeDirs.size() > 1 && Pstream::master())
|
||||
// We already loaded a mesh (usually from constant).
|
||||
// See if any other "polyMesh/points" files exist too.
|
||||
|
||||
const fileName& baseDir = mesh.time().path();
|
||||
|
||||
Info<< "Search for moving mesh ... " << flush;
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
@ -17,7 +15,6 @@ if (timeDirs.size() > 1 && Pstream::master())
|
||||
meshMoving =
|
||||
(
|
||||
timeName != mesh.pointsInstance()
|
||||
&& isDir(baseDir/timeName/polyMesh::meshSubDir)
|
||||
&& IOobject
|
||||
(
|
||||
"points",
|
||||
@ -27,7 +24,7 @@ if (timeDirs.size() > 1 && Pstream::master())
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // no register
|
||||
).typeHeaderOk<pointIOField>(true)
|
||||
).typeHeaderOk<pointIOField>(true, false)
|
||||
);
|
||||
|
||||
if (meshMoving)
|
||||
|
||||
@ -8,15 +8,12 @@ if (timeDirs.size() > 1 && Pstream::master())
|
||||
// We already loaded a mesh (usually from constant).
|
||||
// See if any other "polyMesh/points" files exist too.
|
||||
|
||||
const fileName& baseDir = mesh.time().path();
|
||||
|
||||
Info<< "Search for moving mesh ... " << flush;
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
meshMoving =
|
||||
(
|
||||
isDir(baseDir/timeDirs[timeI].name()/polyMesh::meshSubDir)
|
||||
&& IOobject
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
timeDirs[timeI].name(),
|
||||
@ -25,7 +22,7 @@ if (timeDirs.size() > 1 && Pstream::master())
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // no register
|
||||
).typeHeaderOk<pointIOField>(true)
|
||||
).typeHeaderOk<pointIOField>(true, false)
|
||||
);
|
||||
|
||||
if (meshMoving)
|
||||
|
||||
@ -21,10 +21,10 @@
|
||||
runTime,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
false // no register
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<IOdictionary>(true))
|
||||
if (io.typeHeaderOk<IOdictionary>(true, false))
|
||||
{
|
||||
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
IOdictionary timeObject(io);
|
||||
|
||||
@ -4,10 +4,13 @@
|
||||
"points",
|
||||
runTime.timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // no register
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<pointIOField>(true))
|
||||
if (io.typeHeaderOk<pointIOField>(true, false))
|
||||
{
|
||||
// Read new points
|
||||
io.readOpt() = IOobject::MUST_READ;
|
||||
|
||||
@ -1,27 +1,20 @@
|
||||
IOobject ioPoints
|
||||
(
|
||||
"points",
|
||||
runTime.timeName(),
|
||||
mesh.name(),
|
||||
mesh
|
||||
);
|
||||
|
||||
if (ioPoints.typeHeaderOk<pointIOField>(true))
|
||||
{
|
||||
Info<< "new points available" << endl;
|
||||
// Reading new points
|
||||
pointIOField newPoints
|
||||
IOobject io
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
runTime.timeName(),
|
||||
mesh.name(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
"points",
|
||||
runTime.timeName(),
|
||||
mesh.name(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false // no register
|
||||
);
|
||||
|
||||
mesh.movePoints(newPoints);
|
||||
if (io.typeHeaderOk<pointIOField>(true, false))
|
||||
{
|
||||
Info<< "new points available" << endl;
|
||||
// Read new points
|
||||
io.readOpt() = IOobject::MUST_READ;
|
||||
mesh.movePoints(pointIOField(io));
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,13 +51,11 @@ int readNumProcs
|
||||
const Time& runTime
|
||||
)
|
||||
{
|
||||
const word dictName = "decomposeParDict";
|
||||
fileName dictFile;
|
||||
if (args.optionReadIfPresent(optionName, dictFile))
|
||||
if (args.optionReadIfPresent(optionName, dictFile) && isDir(dictFile))
|
||||
{
|
||||
if (isDir(dictFile))
|
||||
{
|
||||
dictFile = dictFile/"decomposeParDict";
|
||||
}
|
||||
dictFile = dictFile / dictName;
|
||||
}
|
||||
|
||||
return readInt
|
||||
@ -68,7 +66,7 @@ int readNumProcs
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"decomposeParDict",
|
||||
dictName,
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
@ -376,7 +374,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (parallelSource && !parallelTarget)
|
||||
{
|
||||
int nProcs = readNumProcs
|
||||
const int nProcs = readNumProcs
|
||||
(
|
||||
args,
|
||||
"sourceDecomposeParDict",
|
||||
@ -448,7 +446,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (!parallelSource && parallelTarget)
|
||||
{
|
||||
int nProcs = readNumProcs
|
||||
const int nProcs = readNumProcs
|
||||
(
|
||||
args,
|
||||
"targetDecomposeParDict",
|
||||
@ -521,13 +519,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (parallelSource && parallelTarget)
|
||||
{
|
||||
int nProcsSource = readNumProcs
|
||||
const int nProcsSource = readNumProcs
|
||||
(
|
||||
args,
|
||||
"sourceDecomposeParDict",
|
||||
runTimeSource
|
||||
);
|
||||
int nProcsTarget = readNumProcs
|
||||
const int nProcsTarget = readNumProcs
|
||||
(
|
||||
args,
|
||||
"targetDecomposeParDict",
|
||||
|
||||
@ -1558,12 +1558,14 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
word action(args.args()[1]);
|
||||
const word action(args[1]);
|
||||
|
||||
HashTable<booleanSurface::booleanOpType> validActions;
|
||||
validActions.insert("intersection", booleanSurface::INTERSECTION);
|
||||
validActions.insert("union", booleanSurface::UNION);
|
||||
validActions.insert("difference", booleanSurface::DIFFERENCE);
|
||||
const HashTable<booleanSurface::booleanOpType> validActions
|
||||
{
|
||||
{"intersection", booleanSurface::INTERSECTION},
|
||||
{"union", booleanSurface::UNION},
|
||||
{"difference", booleanSurface::DIFFERENCE}
|
||||
};
|
||||
|
||||
if (!validActions.found(action))
|
||||
{
|
||||
@ -1580,7 +1582,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
const word surf1Name(args.args()[2]);
|
||||
const word surf1Name(args[2]);
|
||||
Info<< "Reading surface " << surf1Name << endl;
|
||||
triSurfaceMesh surf1
|
||||
(
|
||||
|
||||
@ -605,7 +605,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const word inputName(args.args()[1]);
|
||||
const word inputName(args[1]);
|
||||
const scalar distance(args.argRead<scalar>(2));
|
||||
const scalar extendFactor(args.argRead<scalar>(3));
|
||||
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
|
||||
|
||||
@ -157,14 +157,10 @@ int main(int argc, char *argv[])
|
||||
// Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary
|
||||
// is in constant
|
||||
|
||||
fileName dictPath = "";
|
||||
if (args.optionFound("dict"))
|
||||
fileName dictPath;
|
||||
if (args.optionReadIfPresent("dict", dictPath) && isDir(dictPath))
|
||||
{
|
||||
dictPath = args["dict"];
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
|
||||
if (dictPath.size())
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/distributed/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldistributed \
|
||||
-lmeshTools \
|
||||
-ltriSurface
|
||||
-ltriSurface \
|
||||
-ldecompose
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,6 +46,7 @@ Note
|
||||
#include "distributedTriSurfaceMesh.H"
|
||||
#include "mapDistribute.H"
|
||||
#include "localIOdictionary.H"
|
||||
#include "decompositionModel.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -103,7 +104,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addNote
|
||||
(
|
||||
"redistribute a triSurface"
|
||||
"Redistribute a triSurface. "
|
||||
"The specified surface must be located in the constant/triSurface directory"
|
||||
);
|
||||
|
||||
argList::validArgs.append("triSurfaceMesh");
|
||||
@ -127,7 +129,7 @@ int main(int argc, char *argv[])
|
||||
<< "Using distribution method "
|
||||
<< distTypeName << nl << endl;
|
||||
|
||||
const bool keepNonMapped = args.options().found("keepNonMapped");
|
||||
const bool keepNonMapped = args.optionFound("keepNonMapped");
|
||||
|
||||
if (keepNonMapped)
|
||||
{
|
||||
@ -151,6 +153,37 @@ int main(int argc, char *argv[])
|
||||
|
||||
Random rndGen(653213);
|
||||
|
||||
// For independent decomposition, ensure that distributedTriSurfaceMesh
|
||||
// can find the alternative decomposeParDict specified via the
|
||||
// -decomposeParDict option.
|
||||
if (distType == distributedTriSurfaceMesh::INDEPENDENT)
|
||||
{
|
||||
fileName decompDictFile;
|
||||
args.optionReadIfPresent("decomposeParDict", decompDictFile);
|
||||
|
||||
IOdictionary* dict = new IOdictionary
|
||||
(
|
||||
decompositionModel::selectIO
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"decomposeParDict",
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
decompDictFile
|
||||
)
|
||||
);
|
||||
|
||||
// The object must have the expected "decomposeParDict" name.
|
||||
// This also implies that it cannot be changed during the run.
|
||||
dict->rename("decomposeParDict");
|
||||
|
||||
runTime.store(dict);
|
||||
}
|
||||
|
||||
// Determine mesh bounding boxes:
|
||||
List<List<treeBoundBox>> meshBb(Pstream::nProcs());
|
||||
if (distType == distributedTriSurfaceMesh::FOLLOW)
|
||||
|
||||
@ -86,7 +86,7 @@ export WM_COMPILE_OPTION=Opt
|
||||
#- MPI implementation:
|
||||
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
|
||||
# | MPI | QSMPI | SGIMPI
|
||||
export WM_MPLIB=OPENMPI
|
||||
export WM_MPLIB=SYSTEMOPENMPI
|
||||
|
||||
#- Operating System:
|
||||
# WM_OSTYPE = POSIX | ???
|
||||
|
||||
@ -95,6 +95,7 @@ $(strings)/fileName/fileNameIO.C
|
||||
$(strings)/keyType/keyType.C
|
||||
$(strings)/wordRe/wordRe.C
|
||||
$(strings)/lists/hashedWordList.C
|
||||
$(strings)/lists/wordReListMatcher.C
|
||||
$(strings)/stringOps/stringOps.C
|
||||
|
||||
ops = primitives/ops
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -417,7 +417,7 @@ Foam::fileName Foam::IOobject::path
|
||||
}
|
||||
|
||||
|
||||
Foam::fileName Foam::IOobject::localFilePath() const
|
||||
Foam::fileName Foam::IOobject::localFilePath(const bool search) const
|
||||
{
|
||||
if (instance().isAbsolute())
|
||||
{
|
||||
@ -443,7 +443,7 @@ Foam::fileName Foam::IOobject::localFilePath() const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isDir(path))
|
||||
if (!isDir(path) && search)
|
||||
{
|
||||
word newInstancePath = time().findInstancePath
|
||||
(
|
||||
@ -471,7 +471,7 @@ Foam::fileName Foam::IOobject::localFilePath() const
|
||||
}
|
||||
|
||||
|
||||
Foam::fileName Foam::IOobject::globalFilePath() const
|
||||
Foam::fileName Foam::IOobject::globalFilePath(const bool search) const
|
||||
{
|
||||
if (instance().isAbsolute())
|
||||
{
|
||||
@ -536,8 +536,8 @@ Foam::fileName Foam::IOobject::globalFilePath() const
|
||||
}
|
||||
}
|
||||
|
||||
// Check for approximately same time
|
||||
if (!isDir(path))
|
||||
// Check for approximately same (local) time
|
||||
if (!isDir(path) && search)
|
||||
{
|
||||
word newInstancePath = time().findInstancePath
|
||||
(
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -400,7 +400,7 @@ public:
|
||||
fileName path
|
||||
(
|
||||
const word& instance,
|
||||
const fileName& local = ""
|
||||
const fileName& local = fileName::null
|
||||
) const;
|
||||
|
||||
//- Return complete path + object name
|
||||
@ -409,11 +409,15 @@ public:
|
||||
return path()/name();
|
||||
}
|
||||
|
||||
//- Helper for filePath that searches locally
|
||||
fileName localFilePath() const;
|
||||
//- Helper for filePath that searches locally.
|
||||
// When search is false, simply use the current instance,
|
||||
// otherwise search previous instances.
|
||||
fileName localFilePath(const bool search=true) const;
|
||||
|
||||
//- Helper for filePath that searches up if in parallel
|
||||
fileName globalFilePath() const;
|
||||
// When search is false, simply use the current instance,
|
||||
// otherwise search previous instances.
|
||||
fileName globalFilePath(const bool search=true) const;
|
||||
|
||||
|
||||
// Reading
|
||||
@ -421,10 +425,16 @@ public:
|
||||
//- Read header
|
||||
bool readHeader(Istream&);
|
||||
|
||||
//- Read header (uses typeFilePath to find file) and check header
|
||||
// info. Optionally checks headerClassName against type
|
||||
//- Read header (uses typeFilePath to find file) and check its info.
|
||||
// Optionally checks headerClassName against the type-name.
|
||||
// When search is false, simply use the current instance,
|
||||
// otherwise search previous instances.
|
||||
template<class Type>
|
||||
bool typeHeaderOk(const bool checkType = true);
|
||||
bool typeHeaderOk
|
||||
(
|
||||
const bool checkType = true,
|
||||
const bool search = true
|
||||
);
|
||||
|
||||
//- Helper: warn that type does not support re-reading
|
||||
template<class Type>
|
||||
@ -485,18 +495,23 @@ template<>
|
||||
Ostream& operator<<(Ostream& os, const InfoProxy<IOobject>& ip);
|
||||
|
||||
|
||||
//- Template function for obtaining global status
|
||||
//- Template function for obtaining global vs. local status
|
||||
template<class T>
|
||||
inline bool typeGlobal()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Template function for obtaining filePath
|
||||
//- Template function for obtaining local or global filePath
|
||||
template<class T>
|
||||
inline fileName typeFilePath(const IOobject& io)
|
||||
inline fileName typeFilePath(const IOobject& io, const bool search=true)
|
||||
{
|
||||
return (typeGlobal<T>() ? io.globalFilePath() : io.localFilePath());
|
||||
return
|
||||
(
|
||||
typeGlobal<T>()
|
||||
? io.globalFilePath(search)
|
||||
: io.localFilePath(search)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,11 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
bool Foam::IOobject::typeHeaderOk(const bool checkType)
|
||||
bool Foam::IOobject::typeHeaderOk
|
||||
(
|
||||
const bool checkType,
|
||||
const bool search
|
||||
)
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
@ -48,7 +52,7 @@ bool Foam::IOobject::typeHeaderOk(const bool checkType)
|
||||
// Determine local status
|
||||
if (!masterOnly || Pstream::master())
|
||||
{
|
||||
Istream* isPtr = objectStream(typeFilePath<Type>(*this));
|
||||
Istream* isPtr = objectStream(typeFilePath<Type>(*this, search));
|
||||
|
||||
// If the stream has failed return
|
||||
if (!isPtr)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -30,11 +30,11 @@ namespace Foam
|
||||
{
|
||||
defineTemplateTypeNameAndDebug(IOMap<dictionary>, 0);
|
||||
|
||||
//- Template specialisation for obtaining filePath
|
||||
//- Template specialization for global status
|
||||
template<>
|
||||
fileName typeFilePath<IOMap<dictionary>>(const IOobject& io)
|
||||
bool typeGlobal<IOMap<dictionary>>()
|
||||
{
|
||||
return io.globalFilePath();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -27,8 +27,8 @@ Class
|
||||
Description
|
||||
IOdictionary is derived from dictionary and IOobject to give the dictionary
|
||||
automatic IO functionality via the objectRegistry. To facilitate IO,
|
||||
IOdictioanry is provided with a constructor from IOobject and writeData and
|
||||
write functions.
|
||||
IOdictionary is provided with a constructor from IOobject and with
|
||||
readData/writeData functions.
|
||||
|
||||
SourceFiles
|
||||
IOdictionary.C
|
||||
@ -47,7 +47,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class IOdictionary Declaration
|
||||
Class IOdictionary Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class IOdictionary
|
||||
|
||||
@ -28,8 +28,8 @@ Description
|
||||
baseIOdictionary is derived from dictionary and IOobject to give the
|
||||
dictionary automatic IO functionality via the objectRegistry.
|
||||
To facilitate IO,
|
||||
IOdictioanry is provided with a constructor from IOobject and writeData and
|
||||
write functions.
|
||||
baseIOdictionary is provided with a constructor from IOobject and with
|
||||
readData/writeData functions.
|
||||
|
||||
SourceFiles
|
||||
baseIOdictionary.C
|
||||
@ -49,7 +49,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class baseIOdictionary Declaration
|
||||
Class baseIOdictionary Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class baseIOdictionary
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -614,10 +614,29 @@ void Foam::argList::parse
|
||||
// Establish rootPath_/globalCase_/case_ for master
|
||||
getRootCase();
|
||||
|
||||
// See if running distributed (different roots for different procs)
|
||||
label dictNProcs = -1;
|
||||
fileName source;
|
||||
// Establish location of decomposeParDict, allow override with
|
||||
// the -decomposeParDict option.
|
||||
fileName source = rootPath_/globalCase_/"system"/"decomposeParDict";
|
||||
if (options_.found("decomposeParDict"))
|
||||
{
|
||||
bool adjustOpt = false;
|
||||
|
||||
source = options_["decomposeParDict"];
|
||||
if (isDir(source))
|
||||
{
|
||||
adjustOpt = true;
|
||||
source = source/"decomposeParDict";
|
||||
}
|
||||
// Could also check for absolute path, but shouldn't be needed
|
||||
if (adjustOpt)
|
||||
{
|
||||
source.clean();
|
||||
options_.set("decomposeParDict", source);
|
||||
}
|
||||
}
|
||||
|
||||
// If running distributed (different roots for different procs)
|
||||
label dictNProcs = -1;
|
||||
if (options_.found("roots"))
|
||||
{
|
||||
source = "-roots";
|
||||
@ -631,16 +650,8 @@ void Foam::argList::parse
|
||||
}
|
||||
else
|
||||
{
|
||||
source = rootPath_/globalCase_/"system"/"decomposeParDict";
|
||||
// Override with -decomposeParDict
|
||||
if (options_.found("decomposeParDict"))
|
||||
{
|
||||
source = options_["decomposeParDict"];
|
||||
if (isDir(source))
|
||||
{
|
||||
source = source/"decomposeParDict";
|
||||
}
|
||||
}
|
||||
// Use values from decomposeParDict, the location was already
|
||||
// established above.
|
||||
|
||||
IFstream decompDictStream(source);
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
fileName dictPath = "";
|
||||
if (args.optionFound("dict"))
|
||||
fileName dictPath;
|
||||
if (args.optionReadIfPresent("dict", dictPath))
|
||||
{
|
||||
dictPath = args["dict"];
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
fileName dictPath = "";
|
||||
if (args.optionFound("dict"))
|
||||
fileName dictPath;
|
||||
if (args.optionReadIfPresent("dict", dictPath))
|
||||
{
|
||||
dictPath = args["dict"];
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
fileName dictPath = "";
|
||||
if (args.optionFound("dict"))
|
||||
fileName dictPath;
|
||||
if (args.optionReadIfPresent("dict", dictPath))
|
||||
{
|
||||
dictPath = args["dict"];
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
|
||||
56
src/OpenFOAM/primitives/strings/lists/wordReListMatcher.C
Normal file
56
src/OpenFOAM/primitives/strings/lists/wordReListMatcher.C
Normal file
@ -0,0 +1,56 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "wordReListMatcher.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::wordReList Foam::wordReListMatcher::uniq(const UList<wordRe>& input)
|
||||
{
|
||||
wordReList retain(input.size());
|
||||
wordHashSet uniqWord;
|
||||
|
||||
label nUniq = 0;
|
||||
forAll(input, i)
|
||||
{
|
||||
const wordRe& select = input[i];
|
||||
|
||||
if
|
||||
(
|
||||
select.isPattern()
|
||||
|| uniqWord.insert(static_cast<const word&>(select))
|
||||
)
|
||||
{
|
||||
retain[nUniq++] = select;
|
||||
}
|
||||
}
|
||||
|
||||
retain.setSize(nUniq);
|
||||
return retain;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,13 +77,20 @@ public:
|
||||
inline const UList<wordRe>& operator()() const;
|
||||
|
||||
|
||||
// Searching
|
||||
// Searching
|
||||
|
||||
//- Return true if string matches any of the regular expressions
|
||||
// Smart match as regular expression or as a string.
|
||||
// Optionally specify a literal match only.
|
||||
inline bool match(const string&, bool literalMatch=false) const;
|
||||
|
||||
|
||||
// Helpers
|
||||
|
||||
//- Return a wordReList with duplicate words filtered out.
|
||||
// No filtering is done on regular expressions.
|
||||
static wordReList uniq(const UList<wordRe>& input);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -36,9 +36,9 @@ Description
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
kappa | thermal conductivity option | yes |
|
||||
Cp | Heat capacity [J/Kg K]] | yes |
|
||||
mass | Total mass [Kg] | yes |
|
||||
kappaMethod | thermal conductivity option | yes |
|
||||
Cp | Heat capacity [J/kg.K] | yes |
|
||||
mass | Total mass [kg] | yes |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -47,7 +47,7 @@ Usage
|
||||
{
|
||||
type lumpedMassWallTemperature;
|
||||
kappaMethod fluidThermo;
|
||||
kappaName none;
|
||||
kappa none;
|
||||
mass 1000;
|
||||
Cp 4100;
|
||||
value uniform 300.0;
|
||||
@ -86,7 +86,7 @@ private:
|
||||
//- Specifc heat capacity [J/kg/K]
|
||||
scalar Cp_;
|
||||
|
||||
//- Mass / [kg]
|
||||
//- Mass [kg]
|
||||
scalar mass_;
|
||||
|
||||
//- Current time index (used for updating)
|
||||
|
||||
@ -204,10 +204,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
||||
<< "Did not find field " << kappaName_
|
||||
<< " on mesh " << mesh.name() << " patch " << patch_.name()
|
||||
<< nl
|
||||
<< "Please set 'kappa' to one of "
|
||||
<< "Please set 'kappaMethod' to one of "
|
||||
<< KMethodTypeNames_.toc()
|
||||
<< " and 'kappaName' to the name of the volScalar"
|
||||
<< " or volSymmTensor field (if kappa=lookup)"
|
||||
<< " and 'kappa' to the name of the volScalar"
|
||||
<< " or volSymmTensor field (if kappaMethod=lookup)"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -218,9 +218,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unimplemented method " << KMethodTypeNames_[method_] << nl
|
||||
<< "Please set 'kappa' to one of " << KMethodTypeNames_.toc()
|
||||
<< " and 'kappaName' to the name of the volScalar"
|
||||
<< " or volSymmTensor field (if kappa=lookup)"
|
||||
<< "Please set 'kappaMethod' to one of "
|
||||
<< KMethodTypeNames_.toc()
|
||||
<< " and 'kappa' to the name of the volScalar"
|
||||
<< " or volSymmTensor field (if kappaMethod=lookup)"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -26,8 +26,8 @@ Class
|
||||
|
||||
Description
|
||||
IDDESDelta used by the IDDES (improved low Re Spalart-Allmaras DES model)
|
||||
The min and max delta are calculated using the double distance of the min or
|
||||
max from the face centre to the cell centre.
|
||||
The min and max delta are calculated using the face to face distance of
|
||||
the cell.
|
||||
|
||||
SourceFiles
|
||||
IDDESDelta.C
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -122,6 +122,37 @@ Foam::porosityModel::porosityModel
|
||||
<< "cannot find porous cellZone " << zoneName_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
Info<< incrIndent << indent << coordSys_ << decrIndent << endl;
|
||||
|
||||
const pointField& points = mesh_.points();
|
||||
const cellList& cells = mesh_.cells();
|
||||
const faceList& faces = mesh_.faces();
|
||||
DynamicList<point> localPoints;
|
||||
forAll(cellZoneIDs_, zoneI)
|
||||
{
|
||||
const cellZone& cZone = mesh_.cellZones()[cellZoneIDs_[zoneI]];
|
||||
localPoints.setCapacity(10*cells.size());
|
||||
|
||||
forAll(cZone, i)
|
||||
{
|
||||
const label cellI = cZone[i];
|
||||
const cell& c = mesh_.cells()[cellI];
|
||||
const pointField cellPoints(c.points(faces, points));
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
{
|
||||
const point& pt = cellPoints[pointI];
|
||||
localPoints.append(coordSys_.localPosition(pt));
|
||||
}
|
||||
}
|
||||
|
||||
boundBox bb(localPoints, true);
|
||||
|
||||
Info<< " local bounds: " << bb << endl;
|
||||
|
||||
localPoints.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
{
|
||||
volumetric_ = false;
|
||||
flowRate_ = Function1<scalar>::New("massFlowRate", dict);
|
||||
rhoName_ = word(dict.lookupOrDefault<word>("rho", "rho"));
|
||||
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "wordReListMatcher.H"
|
||||
#include "steadyStateDdtScheme.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
@ -77,25 +78,6 @@ bool Foam::functionObjects::ddt2::checkFormatName(const word& str)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::ddt2::uniqWords(wordReList& lst)
|
||||
{
|
||||
boolList retain(lst.size());
|
||||
wordHashSet uniq;
|
||||
forAll(lst, i)
|
||||
{
|
||||
const wordRe& select = lst[i];
|
||||
|
||||
retain[i] =
|
||||
(
|
||||
select.isPattern()
|
||||
|| uniq.insert(static_cast<const word&>(select))
|
||||
);
|
||||
}
|
||||
|
||||
inplaceSubset(retain, lst);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::accept(const word& fieldName) const
|
||||
{
|
||||
// check input vs possible result names
|
||||
@ -130,6 +112,7 @@ Foam::functionObjects::ddt2::ddt2
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
prevTimeIndex_(-1),
|
||||
selectFields_(),
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
@ -160,10 +143,11 @@ bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
return false;
|
||||
}
|
||||
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
selectFields_ = wordReListMatcher::uniq
|
||||
(
|
||||
wordReList(dict.lookup("fields"))
|
||||
);
|
||||
Info<< type() << " fields: " << selectFields_ << nl;
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
(
|
||||
@ -234,12 +218,20 @@ bool Foam::functionObjects::ddt2::execute()
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
|
||||
// Update time index
|
||||
prevTimeIndex_ = obr_.time().timeIndex();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::ddt2::write()
|
||||
{
|
||||
if (prevTimeIndex_ < obr_.time().timeIndex())
|
||||
{
|
||||
// Ensure written results reflect the current state
|
||||
execute();
|
||||
}
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
|
||||
@ -101,6 +101,9 @@ class ddt2
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Time at last execute, ensures write uses up-to-date values
|
||||
label prevTimeIndex_;
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
|
||||
@ -124,9 +127,6 @@ class ddt2
|
||||
//- Check that the word contains the appropriate substitution token(s).
|
||||
static bool checkFormatName(const word&);
|
||||
|
||||
//- Eliminate duplicate 'word' entries
|
||||
static void uniqWords(wordReList&);
|
||||
|
||||
|
||||
//- Accept unless field name appears to have already been processed
|
||||
bool accept(const word& fieldName) const;
|
||||
|
||||
@ -52,7 +52,55 @@ namespace functionObjects
|
||||
|
||||
Foam::word Foam::functionObjects::externalCoupled::lockName = "OpenFOAM";
|
||||
|
||||
Foam::string Foam::functionObjects::externalCoupled::patchKey = "# Patch: ";
|
||||
Foam::string Foam::functionObjects::externalCoupled::patchKey = "// Patch:";
|
||||
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::externalCoupled::stateEnd,
|
||||
2
|
||||
>::names[] =
|
||||
{
|
||||
"remove",
|
||||
"done"
|
||||
// The 'IGNORE' enumeration is internal use only and thus has no name
|
||||
};
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::functionObjects::externalCoupled::stateEnd,
|
||||
2
|
||||
> Foam::functionObjects::externalCoupled::stateEndNames_;
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
//! \cond fileScope
|
||||
//- Write list content with size, bracket, content, bracket one-per-line.
|
||||
// This makes for consistent for parsing, regardless of the list length.
|
||||
template <class T>
|
||||
static void writeList(Ostream& os, const string& header, const UList<T>& L)
|
||||
{
|
||||
// Header string
|
||||
os << header.c_str() << nl;
|
||||
|
||||
// Write size and start delimiter
|
||||
os << L.size() << nl
|
||||
<< token::BEGIN_LIST;
|
||||
|
||||
// Write contents
|
||||
forAll(L, i)
|
||||
{
|
||||
os << nl << L[i];
|
||||
}
|
||||
|
||||
// Write end delimiter
|
||||
os << nl << token::END_LIST << nl << endl;
|
||||
}
|
||||
//! \endcond
|
||||
|
||||
}
|
||||
// namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -91,7 +139,7 @@ Foam::fileName Foam::functionObjects::externalCoupled::lockFile() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::externalCoupled::createLockFile() const
|
||||
void Foam::functionObjects::externalCoupled::useMaster() const
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -107,13 +155,13 @@ void Foam::functionObjects::externalCoupled::createLockFile() const
|
||||
Log << type() << ": creating lock file" << endl;
|
||||
|
||||
OFstream os(fName);
|
||||
os << "lock file";
|
||||
os << "status=openfoam\n";
|
||||
os.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::externalCoupled::removeLockFile() const
|
||||
void Foam::functionObjects::externalCoupled::useSlave() const
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
@ -122,7 +170,37 @@ void Foam::functionObjects::externalCoupled::removeLockFile() const
|
||||
|
||||
Log << type() << ": removing lock file" << endl;
|
||||
|
||||
rm(lockFile());
|
||||
Foam::rm(lockFile());
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::externalCoupled::cleanup() const
|
||||
{
|
||||
if (!Pstream::master())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const fileName lck(lockFile());
|
||||
switch (stateEnd_)
|
||||
{
|
||||
case REMOVE:
|
||||
{
|
||||
Log << type() << ": removing lock file" << endl;
|
||||
Foam::rm(lck);
|
||||
}
|
||||
break;
|
||||
case DONE:
|
||||
{
|
||||
Log << type() << ": lock file status=done" << endl;
|
||||
OFstream os(lck);
|
||||
os << "status=done\n";
|
||||
os.flush();
|
||||
}
|
||||
break;
|
||||
case IGNORE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -192,30 +270,29 @@ void Foam::functionObjects::externalCoupled::removeWriteFiles() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::externalCoupled::wait() const
|
||||
void Foam::functionObjects::externalCoupled::waitForSlave() const
|
||||
{
|
||||
const fileName fName(lockFile());
|
||||
label found = 0;
|
||||
label totalTime = 0;
|
||||
bool found = false;
|
||||
|
||||
Log << type() << ": beginning wait for lock file " << fName << nl;
|
||||
|
||||
while (found == 0)
|
||||
while (!found)
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
if (totalTime > timeOut_)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Wait time exceeded time out time of " << timeOut_
|
||||
<< "Wait time exceeded timeout of " << timeOut_
|
||||
<< " s" << abort(FatalError);
|
||||
}
|
||||
|
||||
IFstream is(fName);
|
||||
|
||||
if (is.good())
|
||||
{
|
||||
found++;
|
||||
found = true;
|
||||
|
||||
Log << type() << ": found lock file " << fName << endl;
|
||||
}
|
||||
@ -229,7 +306,7 @@ void Foam::functionObjects::externalCoupled::wait() const
|
||||
}
|
||||
|
||||
// Prevent other procs from racing ahead
|
||||
reduce(found, sumOp<label>());
|
||||
reduce(found, orOp<bool>());
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,8 +461,6 @@ void Foam::functionObjects::externalCoupled::writeGeometry
|
||||
|
||||
fileName dir(groupDir(commsDir, compositeName(regionNames), groupName));
|
||||
|
||||
Info<< typeName << ": writing geometry to " << dir << endl;
|
||||
|
||||
autoPtr<OFstream> osPointsPtr;
|
||||
autoPtr<OFstream> osFacesPtr;
|
||||
if (Pstream::master())
|
||||
@ -393,124 +468,87 @@ void Foam::functionObjects::externalCoupled::writeGeometry
|
||||
mkDir(dir);
|
||||
osPointsPtr.reset(new OFstream(dir/"patchPoints"));
|
||||
osFacesPtr.reset(new OFstream(dir/"patchFaces"));
|
||||
|
||||
osPointsPtr() << "// Group: " << groupName << endl;
|
||||
osFacesPtr() << "// Group: " << groupName << endl;
|
||||
|
||||
Info<< typeName << ": writing geometry to " << dir << endl;
|
||||
}
|
||||
|
||||
// Individual region/patch entries
|
||||
|
||||
DynamicList<face> allMeshesFaces;
|
||||
DynamicField<point> allMeshesPoints;
|
||||
DynamicList<face> allFaces;
|
||||
DynamicField<point> allPoints;
|
||||
|
||||
labelList pointToGlobal;
|
||||
labelList uniquePointIDs;
|
||||
forAll(meshes, meshi)
|
||||
{
|
||||
const fvMesh& mesh = meshes[meshi];
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
|
||||
const labelList patchIDs
|
||||
(
|
||||
pbm.patchSet(List<wordRe>(1, groupName)).sortedToc()
|
||||
mesh.boundaryMesh().patchSet
|
||||
(
|
||||
List<wordRe>(1, groupName)
|
||||
).sortedToc()
|
||||
);
|
||||
|
||||
// Count faces
|
||||
label nFaces = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
nFaces += pbm[patchIDs[i]].size();
|
||||
}
|
||||
const polyPatch& p = mesh.boundaryMesh()[patchIDs[i]];
|
||||
|
||||
// Collect faces
|
||||
DynamicList<label> allFaceIDs(nFaces);
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
const polyPatch& p = pbm[patchIDs[i]];
|
||||
mesh.globalData().mergePoints
|
||||
(
|
||||
p.meshPoints(),
|
||||
p.meshPointMap(),
|
||||
pointToGlobal,
|
||||
uniquePointIDs
|
||||
);
|
||||
|
||||
forAll(p, pi)
|
||||
label proci = Pstream::myProcNo();
|
||||
|
||||
List<pointField> collectedPoints(Pstream::nProcs());
|
||||
collectedPoints[proci] = pointField(mesh.points(), uniquePointIDs);
|
||||
Pstream::gatherList(collectedPoints);
|
||||
|
||||
List<faceList> collectedFaces(Pstream::nProcs());
|
||||
faceList& patchFaces = collectedFaces[proci];
|
||||
patchFaces = p.localFaces();
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
allFaceIDs.append(p.start()+pi);
|
||||
inplaceRenumber(pointToGlobal, patchFaces[facei]);
|
||||
}
|
||||
}
|
||||
Pstream::gatherList(collectedFaces);
|
||||
|
||||
// Construct overall patch
|
||||
indirectPrimitivePatch allPatch
|
||||
(
|
||||
IndirectList<face>(mesh.faces(), allFaceIDs),
|
||||
mesh.points()
|
||||
);
|
||||
|
||||
labelList pointToGlobal;
|
||||
labelList uniquePointIDs;
|
||||
mesh.globalData().mergePoints
|
||||
(
|
||||
allPatch.meshPoints(),
|
||||
allPatch.meshPointMap(),
|
||||
pointToGlobal,
|
||||
uniquePointIDs
|
||||
);
|
||||
|
||||
label proci = Pstream::myProcNo();
|
||||
|
||||
List<pointField> collectedPoints(Pstream::nProcs());
|
||||
collectedPoints[proci] = pointField(mesh.points(), uniquePointIDs);
|
||||
Pstream::gatherList(collectedPoints);
|
||||
|
||||
List<faceList> collectedFaces(Pstream::nProcs());
|
||||
faceList& patchFaces = collectedFaces[proci];
|
||||
patchFaces = allPatch.localFaces();
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
inplaceRenumber(pointToGlobal, patchFaces[facei]);
|
||||
}
|
||||
Pstream::gatherList(collectedFaces);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
// Append and renumber
|
||||
label nPoints = allMeshesPoints.size();
|
||||
|
||||
forAll(collectedPoints, proci)
|
||||
if (Pstream::master())
|
||||
{
|
||||
allMeshesPoints.append(collectedPoints[proci]);
|
||||
allPoints.clear();
|
||||
allFaces.clear();
|
||||
|
||||
}
|
||||
face newFace;
|
||||
forAll(collectedFaces, proci)
|
||||
{
|
||||
const faceList& procFaces = collectedFaces[proci];
|
||||
|
||||
forAll(procFaces, facei)
|
||||
for (label proci=0; proci < Pstream::nProcs(); ++proci)
|
||||
{
|
||||
const face& f = procFaces[facei];
|
||||
|
||||
newFace.setSize(f.size());
|
||||
forAll(f, fp)
|
||||
{
|
||||
newFace[fp] = f[fp]+nPoints;
|
||||
}
|
||||
allMeshesFaces.append(newFace);
|
||||
allPoints.append(collectedPoints[proci]);
|
||||
allFaces.append(collectedFaces[proci]);
|
||||
}
|
||||
|
||||
nPoints += collectedPoints[proci].size();
|
||||
Info<< typeName << ": mesh " << mesh.name()
|
||||
<< ", patch " << p.name()
|
||||
<< ": writing " << allPoints.size() << " points to "
|
||||
<< osPointsPtr().name() << nl
|
||||
<< typeName << ": mesh " << mesh.name()
|
||||
<< ", patch " << p.name()
|
||||
<< ": writing " << allFaces.size() << " faces to "
|
||||
<< osFacesPtr().name() << endl;
|
||||
|
||||
// The entry name (region / patch)
|
||||
const string entryHeader =
|
||||
patchKey + ' ' + mesh.name() + ' ' + p.name();
|
||||
|
||||
writeList(osPointsPtr(), entryHeader, allPoints);
|
||||
writeList(osFacesPtr(), entryHeader, allFaces);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Info<< typeName << ": for mesh " << mesh.name()
|
||||
<< " writing " << allMeshesPoints.size() << " points to "
|
||||
<< osPointsPtr().name() << endl;
|
||||
Info<< typeName << ": for mesh " << mesh.name()
|
||||
<< " writing " << allMeshesFaces.size() << " faces to "
|
||||
<< osFacesPtr().name() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Write points
|
||||
if (osPointsPtr.valid())
|
||||
{
|
||||
osPointsPtr() << allMeshesPoints << endl;
|
||||
}
|
||||
|
||||
// Write faces
|
||||
if (osFacesPtr.valid())
|
||||
{
|
||||
osFacesPtr() << allMeshesFaces << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,7 +570,7 @@ Foam::word Foam::functionObjects::externalCoupled::compositeName
|
||||
{
|
||||
// For compatibility with single region cases suppress single
|
||||
// region name
|
||||
return word("");
|
||||
return word::null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -759,7 +797,7 @@ void Foam::functionObjects::externalCoupled::initialise()
|
||||
if (initByExternal_)
|
||||
{
|
||||
// Wait for initial data to be made available
|
||||
wait();
|
||||
waitForSlave();
|
||||
|
||||
// Read data passed back from external source
|
||||
readData();
|
||||
@ -780,7 +818,7 @@ Foam::functionObjects::externalCoupled::externalCoupled
|
||||
:
|
||||
functionObject(name),
|
||||
time_(runTime),
|
||||
enabled_(true),
|
||||
stateEnd_(REMOVE),
|
||||
initialised_(false)
|
||||
{
|
||||
read(dict);
|
||||
@ -792,7 +830,7 @@ Foam::functionObjects::externalCoupled::externalCoupled
|
||||
|
||||
if (!initByExternal_)
|
||||
{
|
||||
createLockFile();
|
||||
useMaster();
|
||||
}
|
||||
}
|
||||
|
||||
@ -800,7 +838,9 @@ Foam::functionObjects::externalCoupled::externalCoupled
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::externalCoupled::~externalCoupled()
|
||||
{}
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
@ -815,11 +855,12 @@ bool Foam::functionObjects::externalCoupled::execute()
|
||||
// Write data for external source
|
||||
writeData();
|
||||
|
||||
// remove lock file, signalling external source to execute
|
||||
removeLockFile();
|
||||
// Signal external source to execute (by removing lock file)
|
||||
// - Wait for slave to provide data
|
||||
useSlave();
|
||||
|
||||
// Wait for response
|
||||
wait();
|
||||
waitForSlave();
|
||||
|
||||
// Remove old data files from OpenFOAM
|
||||
removeWriteFiles();
|
||||
@ -827,8 +868,8 @@ bool Foam::functionObjects::externalCoupled::execute()
|
||||
// Read data passed back from external source
|
||||
readData();
|
||||
|
||||
// create lock file for external source
|
||||
createLockFile();
|
||||
// Signal external source to wait (by creating the lock file)
|
||||
useMaster();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -846,7 +887,9 @@ bool Foam::functionObjects::externalCoupled::end()
|
||||
// Remove old data files
|
||||
removeReadFiles();
|
||||
removeWriteFiles();
|
||||
removeLockFile();
|
||||
cleanup();
|
||||
|
||||
stateEnd_ = IGNORE; // Avoid running cleanup() again in destructor
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -856,28 +899,24 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
|
||||
{
|
||||
functionObject::read(dict);
|
||||
|
||||
dict.readIfPresent("enabled", enabled_);
|
||||
|
||||
if (!enabled_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
calcFrequency_ = dict.lookupOrDefault("calcFrequency", 1);
|
||||
|
||||
dict.lookup("commsDir") >> commsDir_;
|
||||
commsDir_.expand();
|
||||
commsDir_.clean();
|
||||
|
||||
waitInterval_ = dict.lookupOrDefault("waitInterval", 1);
|
||||
timeOut_ = dict.lookupOrDefault("timeOut", 100*waitInterval_);
|
||||
calcFrequency_ = dict.lookupOrDefault("calcFrequency", 1);
|
||||
waitInterval_ = dict.lookupOrDefault("waitInterval", 1);
|
||||
timeOut_ = dict.lookupOrDefault("timeOut", 100*waitInterval_);
|
||||
initByExternal_ = readBool(dict.lookup("initByExternal"));
|
||||
// initByExternal_ = dict.lookupOrDefault<Switch>("initByExternal", false);
|
||||
stateEnd_ =
|
||||
stateEndNames_[dict.lookupOrDefault<word>("stateEnd", "remove")];
|
||||
|
||||
|
||||
// Get names of all fvMeshes (and derived types)
|
||||
wordList allRegionNames(time_.lookupClass<fvMesh>().sortedToc());
|
||||
|
||||
|
||||
const dictionary& allRegionsDict = dict.subDict("regions");
|
||||
|
||||
forAllConstIter(dictionary, allRegionsDict, iter)
|
||||
{
|
||||
if (!iter().isDict())
|
||||
|
||||
@ -82,6 +82,7 @@ Usage
|
||||
log yes;
|
||||
commsDir "${FOAM_CASE}/comms";
|
||||
initByExternal yes;
|
||||
stateEnd remove; // (remove | done)
|
||||
|
||||
regions
|
||||
{
|
||||
@ -113,6 +114,7 @@ Usage
|
||||
application.
|
||||
|
||||
SourceFiles
|
||||
externalCoupled.C
|
||||
externalCoupledTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -124,6 +126,7 @@ SourceFiles
|
||||
#include "DynamicList.H"
|
||||
#include "wordReList.H"
|
||||
#include "scalarField.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "Switch.H"
|
||||
#include "UPtrList.H"
|
||||
|
||||
@ -147,14 +150,29 @@ class externalCoupled
|
||||
:
|
||||
public functionObject
|
||||
{
|
||||
public:
|
||||
|
||||
// Public data types
|
||||
|
||||
//- Lockfile state on termination
|
||||
enum stateEnd
|
||||
{
|
||||
REMOVE, //!< Remove lock file on end
|
||||
DONE, //!< Lock file contains status=done on end
|
||||
IGNORE //!< Internal use only (for handling cleanup).
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
//- State end names
|
||||
static const NamedEnum<stateEnd, 2> stateEndNames_;
|
||||
|
||||
|
||||
// Private data
|
||||
|
||||
//- Reference to the time database
|
||||
const Time& time_;
|
||||
|
||||
//- Switch for the execution - defaults to 'yes/on'
|
||||
Switch enabled_;
|
||||
|
||||
//- Path to communications directory
|
||||
fileName commsDir_;
|
||||
|
||||
@ -170,6 +188,9 @@ class externalCoupled
|
||||
//- Flag to indicate values are initialised by external application
|
||||
bool initByExternal_;
|
||||
|
||||
//- Lockfile state on termination
|
||||
stateEnd stateEnd_;
|
||||
|
||||
//- Names of (composite) regions
|
||||
DynamicList<word> regionGroupNames_;
|
||||
|
||||
@ -208,11 +229,15 @@ class externalCoupled
|
||||
//- Return the file path to the lock file
|
||||
fileName lockFile() const;
|
||||
|
||||
//- Create lock file
|
||||
void createLockFile() const;
|
||||
|
||||
//- Remove lock file
|
||||
void removeLockFile() const;
|
||||
//- Create lock file to indicate that OpenFOAM is in charge
|
||||
void useMaster() const;
|
||||
|
||||
//- Remove lock file to indicate that the external program is in charge
|
||||
void useSlave() const;
|
||||
|
||||
//- Remove lock file or status=done in lock.
|
||||
void cleanup() const;
|
||||
|
||||
//- Remove files written by OpenFOAM
|
||||
void removeWriteFiles() const;
|
||||
@ -220,8 +245,9 @@ class externalCoupled
|
||||
//- Remove files written by external code
|
||||
void removeReadFiles() const;
|
||||
|
||||
//- Wait for response from external source
|
||||
void wait() const;
|
||||
//- Wait for indication that the external program has supplied input
|
||||
// (ie, for the lock file to reappear).
|
||||
void waitForSlave() const;
|
||||
|
||||
|
||||
//- Read data for a single region, single field
|
||||
@ -290,10 +316,10 @@ public:
|
||||
//- Runtime type information
|
||||
TypeName("externalCoupled");
|
||||
|
||||
//- Name of lock file
|
||||
//- Name of lock file (normally 'OpenFOAM.lock')
|
||||
static word lockName;
|
||||
|
||||
//- Name of patch key, e.g. '# Patch:' when looking for start of patch data
|
||||
//- Name of patch key, e.g. '// Patch:' when looking for start of patch data
|
||||
static string patchKey;
|
||||
|
||||
|
||||
@ -335,7 +361,7 @@ public:
|
||||
// separated by '_'
|
||||
static word compositeName(const wordList&);
|
||||
|
||||
//- Write geometry for the group/patch
|
||||
//- Write geometry for the group as region/patch
|
||||
static void writeGeometry
|
||||
(
|
||||
const UPtrList<const fvMesh>& meshes,
|
||||
|
||||
@ -81,8 +81,6 @@ bool Foam::functionObjects::externalCoupled::readData
|
||||
|
||||
|
||||
label nFound = 0;
|
||||
|
||||
|
||||
forAll(meshes, i)
|
||||
{
|
||||
const fvMesh& mesh = meshes[i];
|
||||
|
||||
@ -79,8 +79,8 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::rhoScale
|
||||
FatalErrorInFunction
|
||||
<< type() << " " << name() << ": "
|
||||
<< "pressure identified as incompressible, but reference "
|
||||
<< "density is not set. Please set rhoName to rhoInf, and "
|
||||
<< "set an appropriate value for rhoInf"
|
||||
<< "density is not set. Please set 'rho' to 'rhoInf', and "
|
||||
<< "set an appropriate value for 'rhoInf'"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ License
|
||||
|
||||
#include "volFields.H"
|
||||
#include "dictionary.H"
|
||||
#include "wordReListMatcher.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -76,25 +77,6 @@ bool Foam::functionObjects::zeroGradient::checkFormatName(const word& str)
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjects::zeroGradient::uniqWords(wordReList& lst)
|
||||
{
|
||||
boolList retain(lst.size());
|
||||
wordHashSet uniq;
|
||||
forAll(lst, i)
|
||||
{
|
||||
const wordRe& select = lst[i];
|
||||
|
||||
retain[i] =
|
||||
(
|
||||
select.isPattern()
|
||||
|| uniq.insert(static_cast<const word&>(select))
|
||||
);
|
||||
}
|
||||
|
||||
inplaceSubset(retain, lst);
|
||||
}
|
||||
|
||||
|
||||
int Foam::functionObjects::zeroGradient::process(const word& fieldName)
|
||||
{
|
||||
int state = 0;
|
||||
@ -118,6 +100,7 @@ Foam::functionObjects::zeroGradient::zeroGradient
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
prevTimeIndex_(-1),
|
||||
selectFields_(),
|
||||
resultName_(string::null),
|
||||
results_()
|
||||
@ -138,8 +121,11 @@ bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
uniqWords(selectFields_);
|
||||
selectFields_ = wordReListMatcher::uniq
|
||||
(
|
||||
wordReList(dict.lookup("fields"))
|
||||
);
|
||||
Info<< type() << " fields: " << selectFields_ << nl;
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)");
|
||||
return checkFormatName(resultName_);
|
||||
@ -189,12 +175,20 @@ bool Foam::functionObjects::zeroGradient::execute()
|
||||
<< "Unprocessed field " << ignored << endl;
|
||||
}
|
||||
|
||||
// Update time index
|
||||
prevTimeIndex_ = obr_.time().timeIndex();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::write()
|
||||
{
|
||||
if (prevTimeIndex_ < obr_.time().timeIndex())
|
||||
{
|
||||
// Ensure written results reflect the current state
|
||||
execute();
|
||||
}
|
||||
if (results_.size())
|
||||
{
|
||||
Log << type() << ' ' << name() << " write:" << endl;
|
||||
|
||||
@ -95,6 +95,9 @@ class zeroGradient
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Time at last execute, ensures write uses up-to-date values
|
||||
label prevTimeIndex_;
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
|
||||
@ -110,9 +113,6 @@ class zeroGradient
|
||||
//- Check that the word contains the appropriate substitution token(s).
|
||||
static bool checkFormatName(const word&);
|
||||
|
||||
//- Eliminate duplicate 'word' entries
|
||||
static void uniqWords(wordReList&);
|
||||
|
||||
|
||||
//- Accept unless field only has constraint patches
|
||||
// (ie, empty/zero-gradient/processor).
|
||||
|
||||
@ -34,9 +34,9 @@ Description
|
||||
{
|
||||
type filmPyrolysisRadiativeCoupledMixed;
|
||||
Tnbr T;
|
||||
kappa fluidThermo;
|
||||
kappaMethod fluidThermo;
|
||||
kappa none;
|
||||
Qr Qr;
|
||||
kappaName none;
|
||||
filmDeltaDry 0.0;
|
||||
filmDeltaWet 3e-4;
|
||||
value $internalField;
|
||||
@ -66,7 +66,7 @@ Description
|
||||
|
||||
Notes:
|
||||
|
||||
- kappa and \c kappaName are inherited from temperatureCoupledBase.
|
||||
- \c kappaMethod and \c kappa are inherited from temperatureCoupledBase.
|
||||
- Qr is the radiative flux defined in the radiation model.
|
||||
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@ Usage
|
||||
|
||||
// Underlaying coupled boundary condition
|
||||
Tnbr T;
|
||||
kappa fluidThermo; // or solidThermo
|
||||
KappaName none;
|
||||
kappaMethod fluidThermo; // or solidThermo
|
||||
kappa none;
|
||||
QrNbr Qr;//or none.Name of Qr field on neighbourregion
|
||||
Qr none;// or none.Name of Qr field on localregion
|
||||
value uniform 300;
|
||||
@ -122,8 +122,8 @@ Usage
|
||||
<slavePatchName>
|
||||
{
|
||||
type compressible::thermalBaffle;
|
||||
kappa fluidThermo;
|
||||
kappaName none;
|
||||
kappaMethod fluidThermo;
|
||||
kappa none;
|
||||
value uniform 300;
|
||||
\endverbatim
|
||||
|
||||
@ -132,16 +132,16 @@ Usage
|
||||
bottom
|
||||
{
|
||||
type compressible::thermalBaffle;
|
||||
kappa solidThermo;
|
||||
kappaName none;
|
||||
kappaMethod solidThermo;
|
||||
kappa none;
|
||||
value uniform 300;
|
||||
}
|
||||
|
||||
top
|
||||
{
|
||||
type compressible::thermalBaffle;
|
||||
kappa solidThermo;
|
||||
kappaName none;
|
||||
kappaMethod solidThermo;
|
||||
kappa none;
|
||||
value uniform 300;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -170,7 +170,8 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
|
||||
momentOfInertia_(sDoFRBM.momentOfInertia_),
|
||||
aRelax_(sDoFRBM.aRelax_),
|
||||
aDamp_(sDoFRBM.aDamp_),
|
||||
report_(sDoFRBM.report_)
|
||||
report_(sDoFRBM.report_),
|
||||
solver_(sDoFRBM.solver_, false)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ SourceFiles
|
||||
#include "sixDoFRigidBodyMotionConstraint.H"
|
||||
#include "Tuple2.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
|
||||
@ -25,6 +25,7 @@ License
|
||||
|
||||
#include "sixDoFRigidBodyMotion.H"
|
||||
#include "IOstreams.H"
|
||||
#include "sixDoFSolver.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
@ -112,6 +113,12 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
|
||||
|
||||
os << decrIndent << indent << token::END_BLOCK << nl;
|
||||
}
|
||||
|
||||
if (!solver_.empty())
|
||||
{
|
||||
os << indent << "solver";
|
||||
solver_->write(os);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ Foam::sixDoFSolvers::CrankNicolson::CrankNicolson
|
||||
sixDoFRigidBodyMotion& body
|
||||
)
|
||||
:
|
||||
sixDoFSolver(body),
|
||||
sixDoFSolver(dict, body),
|
||||
aoc_(dict.lookupOrDefault<scalar>("aoc", 0.5)),
|
||||
voc_(dict.lookupOrDefault<scalar>("voc", 0.5))
|
||||
{}
|
||||
@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::CrankNicolson::solve
|
||||
Q() = Qpi.first();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -98,6 +98,15 @@ public:
|
||||
sixDoFRigidBodyMotion& body
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<sixDoFSolver> clone() const
|
||||
{
|
||||
return autoPtr<sixDoFSolver>
|
||||
(
|
||||
new CrankNicolson(dict_, body_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~CrankNicolson();
|
||||
|
||||
@ -46,7 +46,7 @@ Foam::sixDoFSolvers::Newmark::Newmark
|
||||
sixDoFRigidBodyMotion& body
|
||||
)
|
||||
:
|
||||
sixDoFSolver(body),
|
||||
sixDoFSolver(dict, body),
|
||||
gamma_(dict.lookupOrDefault<scalar>("gamma", 0.5)),
|
||||
beta_
|
||||
(
|
||||
@ -111,5 +111,4 @@ void Foam::sixDoFSolvers::Newmark::solve
|
||||
Q() = Qpi.first();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -96,6 +96,15 @@ public:
|
||||
sixDoFRigidBodyMotion& body
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<sixDoFSolver> clone() const
|
||||
{
|
||||
return autoPtr<sixDoFSolver>
|
||||
(
|
||||
new Newmark(dict_, body_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Newmark();
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "sixDoFSolver.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -36,12 +37,22 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDoFSolver::sixDoFSolver(sixDoFRigidBodyMotion& body)
|
||||
Foam::sixDoFSolver::sixDoFSolver
|
||||
(
|
||||
const dictionary& dict,
|
||||
sixDoFRigidBodyMotion& body
|
||||
)
|
||||
:
|
||||
body_(body)
|
||||
body_(body),
|
||||
dict_(dict)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::sixDoFSolver::write(Ostream& os) const
|
||||
{
|
||||
os << dict_;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDoFSolver::~sixDoFSolver()
|
||||
|
||||
@ -59,6 +59,9 @@ protected:
|
||||
//- The rigid body
|
||||
sixDoFRigidBodyMotion& body_;
|
||||
|
||||
//- Model dictionary
|
||||
dictionary dict_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
|
||||
@ -148,7 +151,10 @@ public:
|
||||
// Constructors
|
||||
|
||||
// Construct for given body
|
||||
sixDoFSolver(sixDoFRigidBodyMotion& body);
|
||||
sixDoFSolver(const dictionary& dict, sixDoFRigidBodyMotion& body);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<sixDoFSolver> clone() const = 0;
|
||||
|
||||
|
||||
//- Destructor
|
||||
@ -175,6 +181,10 @@ public:
|
||||
scalar deltaT,
|
||||
scalar deltaT0
|
||||
) = 0;
|
||||
|
||||
|
||||
//- Write
|
||||
void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ Foam::sixDoFSolvers::symplectic::symplectic
|
||||
sixDoFRigidBodyMotion& body
|
||||
)
|
||||
:
|
||||
sixDoFSolver(body)
|
||||
sixDoFSolver(dict, body)
|
||||
{}
|
||||
|
||||
|
||||
@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::symplectic::solve
|
||||
pi() += rConstraints() & aDamp()*0.5*deltaT*tau();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -95,6 +95,15 @@ public:
|
||||
sixDoFRigidBodyMotion& body
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<sixDoFSolver> clone() const
|
||||
{
|
||||
return autoPtr<sixDoFSolver>
|
||||
(
|
||||
new symplectic(dict_, body_)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~symplectic();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,7 +22,6 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
|
||||
Foam::
|
||||
compressible::
|
||||
humidityTemperatureCoupledMixedFvPatchScalarField
|
||||
@ -94,8 +93,8 @@ Description
|
||||
myInterfacePatchName
|
||||
{
|
||||
type thermalHumidityCoupledMixed;
|
||||
kappa fluidThermo;
|
||||
kappaName none;
|
||||
kappaMethod fluidThermo;
|
||||
kappa none;
|
||||
|
||||
// Modes of operation: inert, condensation, vaporization, condEvap
|
||||
mode condEvap;
|
||||
@ -137,8 +136,8 @@ Description
|
||||
myInterfacePatchName
|
||||
{
|
||||
type thermalInertiaMassTransferCoupledMixed;
|
||||
kappa solidThermo;
|
||||
kappaName none;
|
||||
kappaMethod solidThermo;
|
||||
kappa none;
|
||||
value uniform 260;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -4,12 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication boxTurb
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
runApplication -s enstrophy postProcess -func enstrophy
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf EnSight Ensight Fieldview > /dev/null 2>&1
|
||||
rm -f constant/polyMesh/boundary > /dev/null 2>&1
|
||||
rm -rf Fieldview > /dev/null 2>&1
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name
|
||||
application=$(getApplication)
|
||||
|
||||
runAnsysToFoam()
|
||||
{
|
||||
if [ -f log.ansysToFoam ]
|
||||
@ -19,7 +16,7 @@ runAnsysToFoam()
|
||||
}
|
||||
|
||||
runAnsysToFoam flange.ans 0.001
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
runApplication foamToEnsight -noZero
|
||||
runApplication foamToEnsightParts -noZero
|
||||
runApplication foamToVTK
|
||||
|
||||
@ -4,8 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
\rm -rf 0 > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=$(getApplication)
|
||||
|
||||
restore0Dir
|
||||
runApplication blockMesh
|
||||
runApplication $application -withFunctionObjects -writePhi -writep
|
||||
runApplication $(getApplication) -withFunctionObjects -writePhi -writep
|
||||
runApplication streamFunction
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,8 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
application=$(getApplication)
|
||||
|
||||
restore0Dir
|
||||
runApplication blockMesh
|
||||
runApplication $application -writePhi -writep
|
||||
runApplication $(getApplication) -writePhi -writep
|
||||
runApplication streamFunction
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -3,14 +3,10 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf VTK
|
||||
rm -rf 0
|
||||
rm -rf constant/polyMesh/sets constant/polyMesh/faces
|
||||
rm -rf constant/polyMesh/faces
|
||||
rm -rf constant/polyMesh/points
|
||||
rm -rf constant/polyMesh/owner
|
||||
rm -rf constant/polyMesh/neighbour
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
@ -12,7 +11,6 @@ runApplication topoSet
|
||||
|
||||
runApplication PDRMesh -overwrite
|
||||
|
||||
# Run
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
10
tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean
Executable file
10
tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allclean
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
cd ${0%/*} || exit 1
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
./Allrun.mesh
|
||||
@ -15,3 +15,5 @@ runParallel potentialFoam -pName pPotential -initialiseUBCs
|
||||
\rm -f processor*/0/phi
|
||||
|
||||
runParallel XiDyMFoam
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
cd ${0%/*} || exit 1
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
rm -f log.* constant/polyMesh/*Level
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication -s cyclic \
|
||||
@ -21,3 +19,5 @@ runApplication -s ami \
|
||||
runApplication transformPoints -scale '(0.01 0.01 0.01)'
|
||||
|
||||
runApplication mergeOrSplitBaffles -split -overwrite
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf 0 chemFoam.out constant/reactions constant/thermo \
|
||||
rm -rf chemFoam.out constant/reactions constant/thermo \
|
||||
validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,14 +4,12 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication chemkinToFoam \
|
||||
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
|
||||
constant/reactions constant/thermo
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
(cd validation && ./Allrun $*)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Extract Chemkin II data into a friendlier format
|
||||
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
|
||||
./createGraph
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf 0 chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
rm -rf chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
(cd validation && ./Allrun $*)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Extract Chemkin II data into a friendlier format
|
||||
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
|
||||
./createGraph
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf 0 chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
rm -rf chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
(cd validation && ./Allrun $*)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Extract Chemkin II data into a friendlier format
|
||||
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
|
||||
./createGraph
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf 0 chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
rm -rf chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application=`getApplication`
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
(cd validation && ./Allrun $*)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Extract Chemkin II data into a friendlier format
|
||||
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
|
||||
./createGraph
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -21,5 +21,4 @@ gnuplot<<EOF
|
||||
"chemkinII" with lines title "Chemkin II" lt -1
|
||||
EOF
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
rm -rf 0 chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
rm -rf chemFoam.out validation/OF_vs_CHEMKINII.eps validation/chemkinII
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
(cd validation && ./Allrun $*)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Extract Chemkin II data into a friendlier format
|
||||
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
|
||||
./createGraph
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@ -5,11 +5,10 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
mv ./-180 temp180
|
||||
cleanCase
|
||||
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
rm -f constant/polyMesh/boundary > /dev/null 2>&1
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
mv temp180 ./-180
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -4,11 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name
|
||||
application=$(getApplication)
|
||||
|
||||
runApplication kivaToFoam -file otape17
|
||||
|
||||
runApplication $application
|
||||
runApplication $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user