Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

Conflicts:
	tutorials/combustion/fireFoam/LES/compartmentFire/Allclean
This commit is contained in:
sergio
2016-11-21 07:39:46 -08:00
364 changed files with 1570 additions and 1972 deletions

View File

@ -62,7 +62,7 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
const Switch inflate(args.args()[1]); const Switch inflate(args[1]);
if (inflate) if (inflate)
{ {

View File

@ -66,7 +66,7 @@ int main(int argc, char *argv[])
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh)); const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
const Switch inflate(args.args()[1]); const Switch inflate(args[1]);
if (inflate) if (inflate)
{ {

View File

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
word cellSetName(args.args()[1]); word cellSetName(args[1]);
const bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
const bool minSet = args.optionFound("minSet"); const bool minSet = args.optionFound("minSet");

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
std::ifstream plot3dFile(args.args()[1].c_str()); std::ifstream plot3dFile(args[1].c_str());
string line; string line;
std::getline(plot3dFile, line); std::getline(plot3dFile, line);

View File

@ -811,7 +811,7 @@ int main(int argc, char *argv[])
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups); args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups); args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
cubitFile = args.options().found("cubit"); cubitFile = args.optionFound("cubit");
if (cubitFile) if (cubitFile)
{ {

View File

@ -128,16 +128,12 @@ int main(int argc, char *argv[])
fileName dictPath; fileName dictPath;
// Check if the dictionary is specified on the command-line // Check if the dictionary is specified on the command-line
if (args.optionFound("dict")) if (args.optionReadIfPresent("dict", dictPath))
{ {
dictPath = args["dict"]; if (isDir(dictPath))
{
dictPath = dictPath = dictPath / dictName;
( }
isDir(dictPath)
? dictPath/dictName
: dictPath
);
} }
// Check if dictionary is present in the constant directory // Check if dictionary is present in the constant directory
else if else if

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,14 +67,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location // Allow override of decomposeParDict location
fileName decompDictFile; fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile)) args.optionReadIfPresent("decomposeParDict", decompDictFile);
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile / "decomposeParDict";
}
}
IOdictionary foamyHexMeshDict IOdictionary foamyHexMeshDict
( (

View File

@ -524,13 +524,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location // Allow override of decomposeParDict location
fileName decompDictFile; fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile)) args.optionReadIfPresent("decomposeParDict", decompDictFile);
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile / "decomposeParDict";
}
}
labelList decomp = decompositionModel::New labelList decomp = decompositionModel::New
( (

View File

@ -374,7 +374,7 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
const fileName exportName = args.args()[1]; const fileName exportName = args[1];
Info<< "Reading surfaces as specified in the foamyHexMeshDict and" Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
<< " writing a re-sampled surface to " << exportName << " writing a re-sampled surface to " << exportName

View File

@ -36,6 +36,7 @@ Description
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "conformationSurfaces.H" #include "conformationSurfaces.H"
#include "triSurfaceMesh.H" #include "triSurfaceMesh.H"
#include "labelVector.H"
#include "MarchingCubes.h" #include "MarchingCubes.h"
@ -52,7 +53,6 @@ int main(int argc, char *argv[])
( (
"Re-sample surfaces used in foamyHexMesh operation" "Re-sample surfaces used in foamyHexMesh operation"
); );
//argList::validArgs.append("inputFile");
argList::validArgs.append("(nx ny nz)"); argList::validArgs.append("(nx ny nz)");
argList::validArgs.append("outputName"); argList::validArgs.append("outputName");
@ -60,8 +60,8 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
const Vector<label> n(IStringStream(args.args()[1])()); const labelVector n(args.argRead<labelVector>(1));
const fileName exportName = args.args()[2]; const fileName exportName = args[2];
Info<< "Reading surfaces as specified in the foamyHexMeshDict and" Info<< "Reading surfaces as specified in the foamyHexMeshDict and"
<< " writing re-sampled " << n << " to " << exportName << " writing re-sampled " << n << " to " << exportName

View File

@ -93,10 +93,9 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~
CV2D mesh(runTime, controlDict); CV2D mesh(runTime, controlDict);
if (args.options().found("pointsFile")) if (args.optionFound("pointsFile"))
{ {
fileName pointFileName(IStringStream(args.options()["pointsFile"])()); mesh.insertPoints(args["pointsFile"]);
mesh.insertPoints(pointFileName);
} }
else else
{ {

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -905,13 +905,7 @@ int main(int argc, char *argv[])
if (Pstream::parRun()) if (Pstream::parRun())
{ {
fileName decompDictFile; fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile)) args.optionReadIfPresent("decomposeParDict", decompDictFile);
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile/"decomposeParDict";
}
}
decomposeDict = IOdictionary decomposeDict = IOdictionary
( (

View File

@ -297,13 +297,13 @@ int main(int argc, char *argv[])
// set up the tolerances for the sliding mesh // set up the tolerances for the sliding mesh
dictionary slidingTolerances; dictionary slidingTolerances;
if (args.options().found("toleranceDict")) if (args.optionFound("toleranceDict"))
{ {
IOdictionary toleranceFile IOdictionary toleranceFile
( (
IOobject IOobject
( (
args.options()["toleranceDict"], args["toleranceDict"],
runTime.constant(), runTime.constant(),
mesh, mesh,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,

View File

@ -270,14 +270,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location // Allow override of decomposeParDict location
fileName decompDictFile; fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile)) args.optionReadIfPresent("decomposeParDict", decompDictFile);
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile/"decomposeParDict";
}
}
wordList regionNames; wordList regionNames;
wordList regionDirs; wordList regionDirs;
@ -360,7 +353,6 @@ int main(int argc, char *argv[])
), ),
decompDictFile decompDictFile
) )
).lookup("numberOfSubdomains") ).lookup("numberOfSubdomains")
); );

View File

@ -64,6 +64,7 @@ Usage
#include "fvMeshTools.H" #include "fvMeshTools.H"
#include "fvMeshDistribute.H" #include "fvMeshDistribute.H"
#include "decompositionMethod.H" #include "decompositionMethod.H"
#include "decompositionModel.H"
#include "timeSelector.H" #include "timeSelector.H"
#include "PstreamReduceOps.H" #include "PstreamReduceOps.H"
#include "volFields.H" #include "volFields.H"
@ -74,7 +75,6 @@ Usage
#include "loadOrCreateMesh.H" #include "loadOrCreateMesh.H"
#include "processorFvPatchField.H" #include "processorFvPatchField.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "decompositionModel.H"
#include "parFvFieldReconstructor.H" #include "parFvFieldReconstructor.H"
#include "parLagrangianRedistributor.H" #include "parLagrangianRedistributor.H"
@ -2152,7 +2152,6 @@ int main(int argc, char *argv[])
bool newTimes = args.optionFound("newTimes"); bool newTimes = args.optionFound("newTimes");
if (env("FOAM_SIGFPE")) if (env("FOAM_SIGFPE"))
{ {
WarningInFunction WarningInFunction
@ -2245,8 +2244,6 @@ int main(int argc, char *argv[])
Pstream::scatter(decompose); Pstream::scatter(decompose);
// If running distributed we have problem of new processors not finding // If running distributed we have problem of new processors not finding
// a system/controlDict. However if we switch on the master-only reading // a system/controlDict. However if we switch on the master-only reading
// the problem becomes that the time directories are differing sizes and // the problem becomes that the time directories are differing sizes and
@ -2330,7 +2327,6 @@ int main(int argc, char *argv[])
// Determine any region // Determine any region
word regionName = polyMesh::defaultRegion; word regionName = polyMesh::defaultRegion;
fileName meshSubDir; fileName meshSubDir;
if (args.optionReadIfPresent("region", regionName)) if (args.optionReadIfPresent("region", regionName))
{ {
meshSubDir = regionName/polyMesh::meshSubDir; meshSubDir = regionName/polyMesh::meshSubDir;
@ -2774,13 +2770,7 @@ int main(int argc, char *argv[])
// Allow override of decomposeParDict location // Allow override of decomposeParDict location
fileName decompDictFile; fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile)) args.optionReadIfPresent("decomposeParDict", decompDictFile);
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile / "decomposeParDict";
}
}
// Determine decomposition // Determine decomposition

View File

@ -18,8 +18,10 @@ if (!fieldsToUse.found(fieldName))
fieldName, fieldName,
timeDirs[n1].name(), timeDirs[n1].name(),
mesh, mesh,
IOobject::NO_READ IOobject::NO_READ,
).typeHeaderOk<volScalarField>(false) IOobject::NO_WRITE,
false // no register
).typeHeaderOk<volScalarField>(false, false)
); );
if (variableGood) if (variableGood)

View File

@ -7,8 +7,6 @@ if (timeDirs.size() > 1 && Pstream::master())
// We already loaded a mesh (usually from constant). // We already loaded a mesh (usually from constant).
// See if any other "polyMesh/points" files exist too. // See if any other "polyMesh/points" files exist too.
const fileName& baseDir = mesh.time().path();
Info<< "Search for moving mesh ... " << flush; Info<< "Search for moving mesh ... " << flush;
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {
@ -17,7 +15,6 @@ if (timeDirs.size() > 1 && Pstream::master())
meshMoving = meshMoving =
( (
timeName != mesh.pointsInstance() timeName != mesh.pointsInstance()
&& isDir(baseDir/timeName/polyMesh::meshSubDir)
&& IOobject && IOobject
( (
"points", "points",
@ -27,7 +24,7 @@ if (timeDirs.size() > 1 && Pstream::master())
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register false // no register
).typeHeaderOk<pointIOField>(true) ).typeHeaderOk<pointIOField>(true, false)
); );
if (meshMoving) if (meshMoving)

View File

@ -8,15 +8,12 @@ if (timeDirs.size() > 1 && Pstream::master())
// We already loaded a mesh (usually from constant). // We already loaded a mesh (usually from constant).
// See if any other "polyMesh/points" files exist too. // See if any other "polyMesh/points" files exist too.
const fileName& baseDir = mesh.time().path();
Info<< "Search for moving mesh ... " << flush; Info<< "Search for moving mesh ... " << flush;
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {
meshMoving = meshMoving =
( (
isDir(baseDir/timeDirs[timeI].name()/polyMesh::meshSubDir) IOobject
&& IOobject
( (
"points", "points",
timeDirs[timeI].name(), timeDirs[timeI].name(),
@ -25,7 +22,7 @@ if (timeDirs.size() > 1 && Pstream::master())
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // no register false // no register
).typeHeaderOk<pointIOField>(true) ).typeHeaderOk<pointIOField>(true, false)
); );
if (meshMoving) if (meshMoving)

View File

@ -21,10 +21,10 @@
runTime, runTime,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE, 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; io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
IOdictionary timeObject(io); IOdictionary timeObject(io);

View File

@ -4,10 +4,13 @@
"points", "points",
runTime.timeName(), runTime.timeName(),
polyMesh::meshSubDir, 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 // Read new points
io.readOpt() = IOobject::MUST_READ; io.readOpt() = IOobject::MUST_READ;

View File

@ -1,27 +1,20 @@
IOobject ioPoints
(
"points",
runTime.timeName(),
mesh.name(),
mesh
);
if (ioPoints.typeHeaderOk<pointIOField>(true))
{ {
Info<< "new points available" << endl; IOobject io
// Reading new points
pointIOField newPoints
( (
IOobject "points",
( runTime.timeName(),
"points", mesh.name(),
runTime.timeName(), mesh,
mesh.name(), IOobject::NO_READ,
mesh, IOobject::NO_WRITE,
IOobject::MUST_READ, false // no register
IOobject::NO_WRITE
)
); );
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));
}
} }

View File

@ -51,13 +51,11 @@ int readNumProcs
const Time& runTime const Time& runTime
) )
{ {
const word dictName = "decomposeParDict";
fileName dictFile; fileName dictFile;
if (args.optionReadIfPresent(optionName, dictFile)) if (args.optionReadIfPresent(optionName, dictFile) && isDir(dictFile))
{ {
if (isDir(dictFile)) dictFile = dictFile / dictName;
{
dictFile = dictFile/"decomposeParDict";
}
} }
return readInt return readInt
@ -68,7 +66,7 @@ int readNumProcs
( (
IOobject IOobject
( (
"decomposeParDict", dictName,
runTime.system(), runTime.system(),
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ_IF_MODIFIED,
@ -376,7 +374,7 @@ int main(int argc, char *argv[])
if (parallelSource && !parallelTarget) if (parallelSource && !parallelTarget)
{ {
int nProcs = readNumProcs const int nProcs = readNumProcs
( (
args, args,
"sourceDecomposeParDict", "sourceDecomposeParDict",
@ -448,7 +446,7 @@ int main(int argc, char *argv[])
} }
else if (!parallelSource && parallelTarget) else if (!parallelSource && parallelTarget)
{ {
int nProcs = readNumProcs const int nProcs = readNumProcs
( (
args, args,
"targetDecomposeParDict", "targetDecomposeParDict",
@ -521,13 +519,13 @@ int main(int argc, char *argv[])
} }
else if (parallelSource && parallelTarget) else if (parallelSource && parallelTarget)
{ {
int nProcsSource = readNumProcs const int nProcsSource = readNumProcs
( (
args, args,
"sourceDecomposeParDict", "sourceDecomposeParDict",
runTimeSource runTimeSource
); );
int nProcsTarget = readNumProcs const int nProcsTarget = readNumProcs
( (
args, args,
"targetDecomposeParDict", "targetDecomposeParDict",

View File

@ -1558,12 +1558,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
word action(args.args()[1]); const word action(args[1]);
HashTable<booleanSurface::booleanOpType> validActions; const HashTable<booleanSurface::booleanOpType> validActions
validActions.insert("intersection", booleanSurface::INTERSECTION); {
validActions.insert("union", booleanSurface::UNION); {"intersection", booleanSurface::INTERSECTION},
validActions.insert("difference", booleanSurface::DIFFERENCE); {"union", booleanSurface::UNION},
{"difference", booleanSurface::DIFFERENCE}
};
if (!validActions.found(action)) 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; Info<< "Reading surface " << surf1Name << endl;
triSurfaceMesh surf1 triSurfaceMesh surf1
( (

View File

@ -605,7 +605,7 @@ int main(int argc, char *argv[])
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
const word inputName(args.args()[1]); const word inputName(args[1]);
const scalar distance(args.argRead<scalar>(2)); const scalar distance(args.argRead<scalar>(2));
const scalar extendFactor(args.argRead<scalar>(3)); const scalar extendFactor(args.argRead<scalar>(3));
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection"); const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");

View File

@ -157,14 +157,10 @@ int main(int argc, char *argv[])
// Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary // Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary
// is in constant // is in constant
fileName dictPath = ""; fileName dictPath;
if (args.optionFound("dict")) if (args.optionReadIfPresent("dict", dictPath) && isDir(dictPath))
{ {
dictPath = args["dict"]; dictPath = dictPath / dictName;
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
} }
if (dictPath.size()) if (dictPath.size())

View File

@ -1,9 +1,12 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/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 -I$(LIB_SRC)/parallel/distributed/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-ldistributed \ -ldistributed \
-lmeshTools \ -lmeshTools \
-ltriSurface -ltriSurface \
-ldecompose

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -46,6 +46,7 @@ Note
#include "distributedTriSurfaceMesh.H" #include "distributedTriSurfaceMesh.H"
#include "mapDistribute.H" #include "mapDistribute.H"
#include "localIOdictionary.H" #include "localIOdictionary.H"
#include "decompositionModel.H"
using namespace Foam; using namespace Foam;
@ -103,7 +104,8 @@ int main(int argc, char *argv[])
{ {
argList::addNote argList::addNote
( (
"redistribute a triSurface" "Redistribute a triSurface. "
"The specified surface must be located in the constant/triSurface directory"
); );
argList::validArgs.append("triSurfaceMesh"); argList::validArgs.append("triSurfaceMesh");
@ -127,7 +129,7 @@ int main(int argc, char *argv[])
<< "Using distribution method " << "Using distribution method "
<< distTypeName << nl << endl; << distTypeName << nl << endl;
const bool keepNonMapped = args.options().found("keepNonMapped"); const bool keepNonMapped = args.optionFound("keepNonMapped");
if (keepNonMapped) if (keepNonMapped)
{ {
@ -151,6 +153,37 @@ int main(int argc, char *argv[])
Random rndGen(653213); 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: // Determine mesh bounding boxes:
List<List<treeBoundBox>> meshBb(Pstream::nProcs()); List<List<treeBoundBox>> meshBb(Pstream::nProcs());
if (distType == distributedTriSurfaceMesh::FOLLOW) if (distType == distributedTriSurfaceMesh::FOLLOW)

View File

@ -86,7 +86,7 @@ export WM_COMPILE_OPTION=Opt
#- MPI implementation: #- MPI implementation:
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI # WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
# | MPI | QSMPI | SGIMPI # | MPI | QSMPI | SGIMPI
export WM_MPLIB=OPENMPI export WM_MPLIB=SYSTEMOPENMPI
#- Operating System: #- Operating System:
# WM_OSTYPE = POSIX | ??? # WM_OSTYPE = POSIX | ???

View File

@ -95,6 +95,7 @@ $(strings)/fileName/fileNameIO.C
$(strings)/keyType/keyType.C $(strings)/keyType/keyType.C
$(strings)/wordRe/wordRe.C $(strings)/wordRe/wordRe.C
$(strings)/lists/hashedWordList.C $(strings)/lists/hashedWordList.C
$(strings)/lists/wordReListMatcher.C
$(strings)/stringOps/stringOps.C $(strings)/stringOps/stringOps.C
ops = primitives/ops ops = primitives/ops

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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()) if (instance().isAbsolute())
{ {
@ -443,7 +443,7 @@ Foam::fileName Foam::IOobject::localFilePath() const
} }
else else
{ {
if (!isDir(path)) if (!isDir(path) && search)
{ {
word newInstancePath = time().findInstancePath 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()) if (instance().isAbsolute())
{ {
@ -536,8 +536,8 @@ Foam::fileName Foam::IOobject::globalFilePath() const
} }
} }
// Check for approximately same time // Check for approximately same (local) time
if (!isDir(path)) if (!isDir(path) && search)
{ {
word newInstancePath = time().findInstancePath word newInstancePath = time().findInstancePath
( (

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -400,7 +400,7 @@ public:
fileName path fileName path
( (
const word& instance, const word& instance,
const fileName& local = "" const fileName& local = fileName::null
) const; ) const;
//- Return complete path + object name //- Return complete path + object name
@ -409,11 +409,15 @@ public:
return path()/name(); return path()/name();
} }
//- Helper for filePath that searches locally //- Helper for filePath that searches locally.
fileName localFilePath() const; // 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 //- 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 // Reading
@ -421,10 +425,16 @@ public:
//- Read header //- Read header
bool readHeader(Istream&); bool readHeader(Istream&);
//- Read header (uses typeFilePath to find file) and check header //- Read header (uses typeFilePath to find file) and check its info.
// info. Optionally checks headerClassName against type // Optionally checks headerClassName against the type-name.
// When search is false, simply use the current instance,
// otherwise search previous instances.
template<class Type> 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 //- Helper: warn that type does not support re-reading
template<class Type> template<class Type>
@ -485,18 +495,23 @@ template<>
Ostream& operator<<(Ostream& os, const InfoProxy<IOobject>& ip); 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> template<class T>
inline bool typeGlobal() inline bool typeGlobal()
{ {
return false; return false;
} }
//- Template function for obtaining filePath //- Template function for obtaining local or global filePath
template<class T> 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)
);
} }

View File

@ -32,7 +32,11 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
bool Foam::IOobject::typeHeaderOk(const bool checkType) bool Foam::IOobject::typeHeaderOk
(
const bool checkType,
const bool search
)
{ {
bool ok = true; bool ok = true;
@ -48,7 +52,7 @@ bool Foam::IOobject::typeHeaderOk(const bool checkType)
// Determine local status // Determine local status
if (!masterOnly || Pstream::master()) if (!masterOnly || Pstream::master())
{ {
Istream* isPtr = objectStream(typeFilePath<Type>(*this)); Istream* isPtr = objectStream(typeFilePath<Type>(*this, search));
// If the stream has failed return // If the stream has failed return
if (!isPtr) if (!isPtr)

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -30,11 +30,11 @@ namespace Foam
{ {
defineTemplateTypeNameAndDebug(IOMap<dictionary>, 0); defineTemplateTypeNameAndDebug(IOMap<dictionary>, 0);
//- Template specialisation for obtaining filePath //- Template specialization for global status
template<> template<>
fileName typeFilePath<IOMap<dictionary>>(const IOobject& io) bool typeGlobal<IOMap<dictionary>>()
{ {
return io.globalFilePath(); return true;
} }
} }

View File

@ -27,8 +27,8 @@ Class
Description Description
IOdictionary is derived from dictionary and IOobject to give the dictionary IOdictionary is derived from dictionary and IOobject to give the dictionary
automatic IO functionality via the objectRegistry. To facilitate IO, automatic IO functionality via the objectRegistry. To facilitate IO,
IOdictioanry is provided with a constructor from IOobject and writeData and IOdictionary is provided with a constructor from IOobject and with
write functions. readData/writeData functions.
SourceFiles SourceFiles
IOdictionary.C IOdictionary.C
@ -47,7 +47,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class IOdictionary Declaration Class IOdictionary Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class IOdictionary class IOdictionary

View File

@ -28,8 +28,8 @@ Description
baseIOdictionary is derived from dictionary and IOobject to give the baseIOdictionary is derived from dictionary and IOobject to give the
dictionary automatic IO functionality via the objectRegistry. dictionary automatic IO functionality via the objectRegistry.
To facilitate IO, To facilitate IO,
IOdictioanry is provided with a constructor from IOobject and writeData and baseIOdictionary is provided with a constructor from IOobject and with
write functions. readData/writeData functions.
SourceFiles SourceFiles
baseIOdictionary.C baseIOdictionary.C
@ -49,7 +49,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class baseIOdictionary Declaration Class baseIOdictionary Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class baseIOdictionary class baseIOdictionary

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -614,10 +614,29 @@ void Foam::argList::parse
// Establish rootPath_/globalCase_/case_ for master // Establish rootPath_/globalCase_/case_ for master
getRootCase(); getRootCase();
// See if running distributed (different roots for different procs) // Establish location of decomposeParDict, allow override with
label dictNProcs = -1; // the -decomposeParDict option.
fileName source; 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")) if (options_.found("roots"))
{ {
source = "-roots"; source = "-roots";
@ -631,16 +650,8 @@ void Foam::argList::parse
} }
else else
{ {
source = rootPath_/globalCase_/"system"/"decomposeParDict"; // Use values from decomposeParDict, the location was already
// Override with -decomposeParDict // established above.
if (options_.found("decomposeParDict"))
{
source = options_["decomposeParDict"];
if (isDir(source))
{
source = source/"decomposeParDict";
}
}
IFstream decompDictStream(source); IFstream decompDictStream(source);

View File

@ -1,7 +1,6 @@
fileName dictPath = ""; fileName dictPath;
if (args.optionFound("dict")) if (args.optionReadIfPresent("dict", dictPath))
{ {
dictPath = args["dict"];
if (isDir(dictPath)) if (isDir(dictPath))
{ {
dictPath = dictPath / dictName; dictPath = dictPath / dictName;

View File

@ -1,7 +1,6 @@
fileName dictPath = ""; fileName dictPath;
if (args.optionFound("dict")) if (args.optionReadIfPresent("dict", dictPath))
{ {
dictPath = args["dict"];
if (isDir(dictPath)) if (isDir(dictPath))
{ {
dictPath = dictPath / dictName; dictPath = dictPath / dictName;

View File

@ -1,7 +1,6 @@
fileName dictPath = ""; fileName dictPath;
if (args.optionFound("dict")) if (args.optionReadIfPresent("dict", dictPath))
{ {
dictPath = args["dict"];
if (isDir(dictPath)) if (isDir(dictPath))
{ {
dictPath = dictPath / dictName; dictPath = dictPath / dictName;

View 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;
}
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -77,13 +77,20 @@ public:
inline const UList<wordRe>& operator()() const; inline const UList<wordRe>& operator()() const;
// Searching // Searching
//- Return true if string matches any of the regular expressions //- Return true if string matches any of the regular expressions
// Smart match as regular expression or as a string. // Smart match as regular expression or as a string.
// Optionally specify a literal match only. // Optionally specify a literal match only.
inline bool match(const string&, bool literalMatch=false) const; 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);
}; };

View File

@ -36,9 +36,9 @@ Description
Usage Usage
\table \table
Property | Description | Required | Default value Property | Description | Required | Default value
kappa | thermal conductivity option | yes | kappaMethod | thermal conductivity option | yes |
Cp | Heat capacity [J/Kg K]] | yes | Cp | Heat capacity [J/kg.K] | yes |
mass | Total mass [Kg] | yes | mass | Total mass [kg] | yes |
\endtable \endtable
Example of the boundary condition specification: Example of the boundary condition specification:
@ -47,7 +47,7 @@ Usage
{ {
type lumpedMassWallTemperature; type lumpedMassWallTemperature;
kappaMethod fluidThermo; kappaMethod fluidThermo;
kappaName none; kappa none;
mass 1000; mass 1000;
Cp 4100; Cp 4100;
value uniform 300.0; value uniform 300.0;
@ -86,7 +86,7 @@ private:
//- Specifc heat capacity [J/kg/K] //- Specifc heat capacity [J/kg/K]
scalar Cp_; scalar Cp_;
//- Mass / [kg] //- Mass [kg]
scalar mass_; scalar mass_;
//- Current time index (used for updating) //- Current time index (used for updating)

View File

@ -204,10 +204,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
<< "Did not find field " << kappaName_ << "Did not find field " << kappaName_
<< " on mesh " << mesh.name() << " patch " << patch_.name() << " on mesh " << mesh.name() << " patch " << patch_.name()
<< nl << nl
<< "Please set 'kappa' to one of " << "Please set 'kappaMethod' to one of "
<< KMethodTypeNames_.toc() << KMethodTypeNames_.toc()
<< " and 'kappaName' to the name of the volScalar" << " and 'kappa' to the name of the volScalar"
<< " or volSymmTensor field (if kappa=lookup)" << " or volSymmTensor field (if kappaMethod=lookup)"
<< exit(FatalError); << exit(FatalError);
} }
@ -218,9 +218,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unimplemented method " << KMethodTypeNames_[method_] << nl << "Unimplemented method " << KMethodTypeNames_[method_] << nl
<< "Please set 'kappa' to one of " << KMethodTypeNames_.toc() << "Please set 'kappaMethod' to one of "
<< " and 'kappaName' to the name of the volScalar" << KMethodTypeNames_.toc()
<< " or volSymmTensor field (if kappa=lookup)" << " and 'kappa' to the name of the volScalar"
<< " or volSymmTensor field (if kappaMethod=lookup)"
<< exit(FatalError); << exit(FatalError);
} }
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -26,8 +26,8 @@ Class
Description Description
IDDESDelta used by the IDDES (improved low Re Spalart-Allmaras DES model) 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 The min and max delta are calculated using the face to face distance of
max from the face centre to the cell centre. the cell.
SourceFiles SourceFiles
IDDESDelta.C IDDESDelta.C

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -122,6 +122,37 @@ Foam::porosityModel::porosityModel
<< "cannot find porous cellZone " << zoneName_ << "cannot find porous cellZone " << zoneName_
<< exit(FatalError); << 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();
}
} }

View File

@ -71,7 +71,7 @@ flowRateInletVelocityFvPatchVectorField
{ {
volumetric_ = false; volumetric_ = false;
flowRate_ = Function1<scalar>::New("massFlowRate", dict); flowRate_ = Function1<scalar>::New("massFlowRate", dict);
rhoName_ = word(dict.lookupOrDefault<word>("rho", "rho")); rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
} }
else else
{ {

View File

@ -27,6 +27,7 @@ License
#include "volFields.H" #include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "wordReListMatcher.H"
#include "steadyStateDdtScheme.H" #include "steadyStateDdtScheme.H"
#include "addToRunTimeSelectionTable.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 bool Foam::functionObjects::ddt2::accept(const word& fieldName) const
{ {
// check input vs possible result names // check input vs possible result names
@ -130,6 +112,7 @@ Foam::functionObjects::ddt2::ddt2
) )
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(), selectFields_(),
resultName_(word::null), resultName_(word::null),
blacklist_(), blacklist_(),
@ -160,10 +143,11 @@ bool Foam::functionObjects::ddt2::read(const dictionary& dict)
return false; return false;
} }
fvMeshFunctionObject::read(dict); selectFields_ = wordReListMatcher::uniq
(
dict.lookup("fields") >> selectFields_; wordReList(dict.lookup("fields"))
uniqWords(selectFields_); );
Info<< type() << " fields: " << selectFields_ << nl;
resultName_ = dict.lookupOrDefault<word> resultName_ = dict.lookupOrDefault<word>
( (
@ -234,12 +218,20 @@ bool Foam::functionObjects::ddt2::execute()
<< "Unprocessed field " << ignored << endl; << "Unprocessed field " << ignored << endl;
} }
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true; return true;
} }
bool Foam::functionObjects::ddt2::write() bool Foam::functionObjects::ddt2::write()
{ {
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size()) if (results_.size())
{ {
Log << type() << ' ' << name() << " write:" << endl; Log << type() << ' ' << name() << " write:" << endl;

View File

@ -101,6 +101,9 @@ class ddt2
{ {
// Private data // Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process //- Name of fields to process
wordReList selectFields_; wordReList selectFields_;
@ -124,9 +127,6 @@ class ddt2
//- Check that the word contains the appropriate substitution token(s). //- Check that the word contains the appropriate substitution token(s).
static bool checkFormatName(const word&); static bool checkFormatName(const word&);
//- Eliminate duplicate 'word' entries
static void uniqWords(wordReList&);
//- Accept unless field name appears to have already been processed //- Accept unless field name appears to have already been processed
bool accept(const word& fieldName) const; bool accept(const word& fieldName) const;

View File

@ -52,7 +52,55 @@ namespace functionObjects
Foam::word Foam::functionObjects::externalCoupled::lockName = "OpenFOAM"; 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 * * * * * * * * * * * // // * * * * * * * * * * * * * 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()) if (!Pstream::master())
{ {
@ -107,13 +155,13 @@ void Foam::functionObjects::externalCoupled::createLockFile() const
Log << type() << ": creating lock file" << endl; Log << type() << ": creating lock file" << endl;
OFstream os(fName); OFstream os(fName);
os << "lock file"; os << "status=openfoam\n";
os.flush(); os.flush();
} }
} }
void Foam::functionObjects::externalCoupled::removeLockFile() const void Foam::functionObjects::externalCoupled::useSlave() const
{ {
if (!Pstream::master()) if (!Pstream::master())
{ {
@ -122,7 +170,37 @@ void Foam::functionObjects::externalCoupled::removeLockFile() const
Log << type() << ": removing lock file" << endl; 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()); const fileName fName(lockFile());
label found = 0;
label totalTime = 0; label totalTime = 0;
bool found = false;
Log << type() << ": beginning wait for lock file " << fName << nl; Log << type() << ": beginning wait for lock file " << fName << nl;
while (found == 0) while (!found)
{ {
if (Pstream::master()) if (Pstream::master())
{ {
if (totalTime > timeOut_) if (totalTime > timeOut_)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Wait time exceeded time out time of " << timeOut_ << "Wait time exceeded timeout of " << timeOut_
<< " s" << abort(FatalError); << " s" << abort(FatalError);
} }
IFstream is(fName); IFstream is(fName);
if (is.good()) if (is.good())
{ {
found++; found = true;
Log << type() << ": found lock file " << fName << endl; Log << type() << ": found lock file " << fName << endl;
} }
@ -229,7 +306,7 @@ void Foam::functionObjects::externalCoupled::wait() const
} }
// Prevent other procs from racing ahead // 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)); fileName dir(groupDir(commsDir, compositeName(regionNames), groupName));
Info<< typeName << ": writing geometry to " << dir << endl;
autoPtr<OFstream> osPointsPtr; autoPtr<OFstream> osPointsPtr;
autoPtr<OFstream> osFacesPtr; autoPtr<OFstream> osFacesPtr;
if (Pstream::master()) if (Pstream::master())
@ -393,124 +468,87 @@ void Foam::functionObjects::externalCoupled::writeGeometry
mkDir(dir); mkDir(dir);
osPointsPtr.reset(new OFstream(dir/"patchPoints")); osPointsPtr.reset(new OFstream(dir/"patchPoints"));
osFacesPtr.reset(new OFstream(dir/"patchFaces")); 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; DynamicList<face> allFaces;
DynamicField<point> allMeshesPoints; DynamicField<point> allPoints;
labelList pointToGlobal;
labelList uniquePointIDs;
forAll(meshes, meshi) forAll(meshes, meshi)
{ {
const fvMesh& mesh = meshes[meshi]; const fvMesh& mesh = meshes[meshi];
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const labelList patchIDs 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) forAll(patchIDs, i)
{ {
nFaces += pbm[patchIDs[i]].size(); const polyPatch& p = mesh.boundaryMesh()[patchIDs[i]];
}
// Collect faces mesh.globalData().mergePoints
DynamicList<label> allFaceIDs(nFaces); (
forAll(patchIDs, i) p.meshPoints(),
{ p.meshPointMap(),
const polyPatch& p = pbm[patchIDs[i]]; 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 if (Pstream::master())
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)
{ {
allMeshesPoints.append(collectedPoints[proci]); allPoints.clear();
allFaces.clear();
} for (label proci=0; proci < Pstream::nProcs(); ++proci)
face newFace;
forAll(collectedFaces, proci)
{
const faceList& procFaces = collectedFaces[proci];
forAll(procFaces, facei)
{ {
const face& f = procFaces[facei]; allPoints.append(collectedPoints[proci]);
allFaces.append(collectedFaces[proci]);
newFace.setSize(f.size());
forAll(f, fp)
{
newFace[fp] = f[fp]+nPoints;
}
allMeshesFaces.append(newFace);
} }
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 // For compatibility with single region cases suppress single
// region name // region name
return word(""); return word::null;
} }
else else
{ {
@ -759,7 +797,7 @@ void Foam::functionObjects::externalCoupled::initialise()
if (initByExternal_) if (initByExternal_)
{ {
// Wait for initial data to be made available // Wait for initial data to be made available
wait(); waitForSlave();
// Read data passed back from external source // Read data passed back from external source
readData(); readData();
@ -780,7 +818,7 @@ Foam::functionObjects::externalCoupled::externalCoupled
: :
functionObject(name), functionObject(name),
time_(runTime), time_(runTime),
enabled_(true), stateEnd_(REMOVE),
initialised_(false) initialised_(false)
{ {
read(dict); read(dict);
@ -792,7 +830,7 @@ Foam::functionObjects::externalCoupled::externalCoupled
if (!initByExternal_) if (!initByExternal_)
{ {
createLockFile(); useMaster();
} }
} }
@ -800,7 +838,9 @@ Foam::functionObjects::externalCoupled::externalCoupled
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::externalCoupled::~externalCoupled() Foam::functionObjects::externalCoupled::~externalCoupled()
{} {
cleanup();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -815,11 +855,12 @@ bool Foam::functionObjects::externalCoupled::execute()
// Write data for external source // Write data for external source
writeData(); writeData();
// remove lock file, signalling external source to execute // Signal external source to execute (by removing lock file)
removeLockFile(); // - Wait for slave to provide data
useSlave();
// Wait for response // Wait for response
wait(); waitForSlave();
// Remove old data files from OpenFOAM // Remove old data files from OpenFOAM
removeWriteFiles(); removeWriteFiles();
@ -827,8 +868,8 @@ bool Foam::functionObjects::externalCoupled::execute()
// Read data passed back from external source // Read data passed back from external source
readData(); readData();
// create lock file for external source // Signal external source to wait (by creating the lock file)
createLockFile(); useMaster();
return true; return true;
} }
@ -846,7 +887,9 @@ bool Foam::functionObjects::externalCoupled::end()
// Remove old data files // Remove old data files
removeReadFiles(); removeReadFiles();
removeWriteFiles(); removeWriteFiles();
removeLockFile(); cleanup();
stateEnd_ = IGNORE; // Avoid running cleanup() again in destructor
return true; return true;
} }
@ -856,28 +899,24 @@ bool Foam::functionObjects::externalCoupled::read(const dictionary& dict)
{ {
functionObject::read(dict); functionObject::read(dict);
dict.readIfPresent("enabled", enabled_); calcFrequency_ = dict.lookupOrDefault("calcFrequency", 1);
if (!enabled_)
{
return true;
}
dict.lookup("commsDir") >> commsDir_; dict.lookup("commsDir") >> commsDir_;
commsDir_.expand(); commsDir_.expand();
commsDir_.clean();
waitInterval_ = dict.lookupOrDefault("waitInterval", 1); waitInterval_ = dict.lookupOrDefault("waitInterval", 1);
timeOut_ = dict.lookupOrDefault("timeOut", 100*waitInterval_); timeOut_ = dict.lookupOrDefault("timeOut", 100*waitInterval_);
calcFrequency_ = dict.lookupOrDefault("calcFrequency", 1);
initByExternal_ = readBool(dict.lookup("initByExternal")); 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) // Get names of all fvMeshes (and derived types)
wordList allRegionNames(time_.lookupClass<fvMesh>().sortedToc()); wordList allRegionNames(time_.lookupClass<fvMesh>().sortedToc());
const dictionary& allRegionsDict = dict.subDict("regions"); const dictionary& allRegionsDict = dict.subDict("regions");
forAllConstIter(dictionary, allRegionsDict, iter) forAllConstIter(dictionary, allRegionsDict, iter)
{ {
if (!iter().isDict()) if (!iter().isDict())

View File

@ -82,6 +82,7 @@ Usage
log yes; log yes;
commsDir "${FOAM_CASE}/comms"; commsDir "${FOAM_CASE}/comms";
initByExternal yes; initByExternal yes;
stateEnd remove; // (remove | done)
regions regions
{ {
@ -113,6 +114,7 @@ Usage
application. application.
SourceFiles SourceFiles
externalCoupled.C
externalCoupledTemplates.C externalCoupledTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -124,6 +126,7 @@ SourceFiles
#include "DynamicList.H" #include "DynamicList.H"
#include "wordReList.H" #include "wordReList.H"
#include "scalarField.H" #include "scalarField.H"
#include "NamedEnum.H"
#include "Switch.H" #include "Switch.H"
#include "UPtrList.H" #include "UPtrList.H"
@ -147,14 +150,29 @@ class externalCoupled
: :
public functionObject 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 // Private data
//- Reference to the time database //- Reference to the time database
const Time& time_; const Time& time_;
//- Switch for the execution - defaults to 'yes/on'
Switch enabled_;
//- Path to communications directory //- Path to communications directory
fileName commsDir_; fileName commsDir_;
@ -170,6 +188,9 @@ class externalCoupled
//- Flag to indicate values are initialised by external application //- Flag to indicate values are initialised by external application
bool initByExternal_; bool initByExternal_;
//- Lockfile state on termination
stateEnd stateEnd_;
//- Names of (composite) regions //- Names of (composite) regions
DynamicList<word> regionGroupNames_; DynamicList<word> regionGroupNames_;
@ -208,11 +229,15 @@ class externalCoupled
//- Return the file path to the lock file //- Return the file path to the lock file
fileName lockFile() const; fileName lockFile() const;
//- Create lock file
void createLockFile() const;
//- Remove lock file //- Create lock file to indicate that OpenFOAM is in charge
void removeLockFile() const; 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 //- Remove files written by OpenFOAM
void removeWriteFiles() const; void removeWriteFiles() const;
@ -220,8 +245,9 @@ class externalCoupled
//- Remove files written by external code //- Remove files written by external code
void removeReadFiles() const; void removeReadFiles() const;
//- Wait for response from external source //- Wait for indication that the external program has supplied input
void wait() const; // (ie, for the lock file to reappear).
void waitForSlave() const;
//- Read data for a single region, single field //- Read data for a single region, single field
@ -290,10 +316,10 @@ public:
//- Runtime type information //- Runtime type information
TypeName("externalCoupled"); TypeName("externalCoupled");
//- Name of lock file //- Name of lock file (normally 'OpenFOAM.lock')
static word lockName; 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; static string patchKey;
@ -335,7 +361,7 @@ public:
// separated by '_' // separated by '_'
static word compositeName(const wordList&); static word compositeName(const wordList&);
//- Write geometry for the group/patch //- Write geometry for the group as region/patch
static void writeGeometry static void writeGeometry
( (
const UPtrList<const fvMesh>& meshes, const UPtrList<const fvMesh>& meshes,

View File

@ -81,8 +81,6 @@ bool Foam::functionObjects::externalCoupled::readData
label nFound = 0; label nFound = 0;
forAll(meshes, i) forAll(meshes, i)
{ {
const fvMesh& mesh = meshes[i]; const fvMesh& mesh = meshes[i];

View File

@ -79,8 +79,8 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::rhoScale
FatalErrorInFunction FatalErrorInFunction
<< type() << " " << name() << ": " << type() << " " << name() << ": "
<< "pressure identified as incompressible, but reference " << "pressure identified as incompressible, but reference "
<< "density is not set. Please set rhoName to rhoInf, and " << "density is not set. Please set 'rho' to 'rhoInf', and "
<< "set an appropriate value for rhoInf" << "set an appropriate value for 'rhoInf'"
<< exit(FatalError); << exit(FatalError);
} }

View File

@ -27,6 +27,7 @@ License
#include "volFields.H" #include "volFields.H"
#include "dictionary.H" #include "dictionary.H"
#include "wordReListMatcher.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * 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 Foam::functionObjects::zeroGradient::process(const word& fieldName)
{ {
int state = 0; int state = 0;
@ -118,6 +100,7 @@ Foam::functionObjects::zeroGradient::zeroGradient
) )
: :
fvMeshFunctionObject(name, runTime, dict), fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(), selectFields_(),
resultName_(string::null), resultName_(string::null),
results_() results_()
@ -138,8 +121,11 @@ bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
{ {
fvMeshFunctionObject::read(dict); fvMeshFunctionObject::read(dict);
dict.lookup("fields") >> selectFields_; selectFields_ = wordReListMatcher::uniq
uniqWords(selectFields_); (
wordReList(dict.lookup("fields"))
);
Info<< type() << " fields: " << selectFields_ << nl;
resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)"); resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)");
return checkFormatName(resultName_); return checkFormatName(resultName_);
@ -189,12 +175,20 @@ bool Foam::functionObjects::zeroGradient::execute()
<< "Unprocessed field " << ignored << endl; << "Unprocessed field " << ignored << endl;
} }
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true; return true;
} }
bool Foam::functionObjects::zeroGradient::write() bool Foam::functionObjects::zeroGradient::write()
{ {
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size()) if (results_.size())
{ {
Log << type() << ' ' << name() << " write:" << endl; Log << type() << ' ' << name() << " write:" << endl;

View File

@ -95,6 +95,9 @@ class zeroGradient
{ {
// Private data // Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process //- Name of fields to process
wordReList selectFields_; wordReList selectFields_;
@ -110,9 +113,6 @@ class zeroGradient
//- Check that the word contains the appropriate substitution token(s). //- Check that the word contains the appropriate substitution token(s).
static bool checkFormatName(const word&); static bool checkFormatName(const word&);
//- Eliminate duplicate 'word' entries
static void uniqWords(wordReList&);
//- Accept unless field only has constraint patches //- Accept unless field only has constraint patches
// (ie, empty/zero-gradient/processor). // (ie, empty/zero-gradient/processor).

View File

@ -34,9 +34,9 @@ Description
{ {
type filmPyrolysisRadiativeCoupledMixed; type filmPyrolysisRadiativeCoupledMixed;
Tnbr T; Tnbr T;
kappa fluidThermo; kappaMethod fluidThermo;
kappa none;
Qr Qr; Qr Qr;
kappaName none;
filmDeltaDry 0.0; filmDeltaDry 0.0;
filmDeltaWet 3e-4; filmDeltaWet 3e-4;
value $internalField; value $internalField;
@ -66,7 +66,7 @@ Description
Notes: 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. - Qr is the radiative flux defined in the radiation model.

View File

@ -52,8 +52,8 @@ Usage
// Underlaying coupled boundary condition // Underlaying coupled boundary condition
Tnbr T; Tnbr T;
kappa fluidThermo; // or solidThermo kappaMethod fluidThermo; // or solidThermo
KappaName none; kappa none;
QrNbr Qr;//or none.Name of Qr field on neighbourregion QrNbr Qr;//or none.Name of Qr field on neighbourregion
Qr none;// or none.Name of Qr field on localregion Qr none;// or none.Name of Qr field on localregion
value uniform 300; value uniform 300;
@ -122,8 +122,8 @@ Usage
<slavePatchName> <slavePatchName>
{ {
type compressible::thermalBaffle; type compressible::thermalBaffle;
kappa fluidThermo; kappaMethod fluidThermo;
kappaName none; kappa none;
value uniform 300; value uniform 300;
\endverbatim \endverbatim
@ -132,16 +132,16 @@ Usage
bottom bottom
{ {
type compressible::thermalBaffle; type compressible::thermalBaffle;
kappa solidThermo; kappaMethod solidThermo;
kappaName none; kappa none;
value uniform 300; value uniform 300;
} }
top top
{ {
type compressible::thermalBaffle; type compressible::thermalBaffle;
kappa solidThermo; kappaMethod solidThermo;
kappaName none; kappa none;
value uniform 300; value uniform 300;
} }
\endverbatim \endverbatim

View File

@ -170,7 +170,8 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
momentOfInertia_(sDoFRBM.momentOfInertia_), momentOfInertia_(sDoFRBM.momentOfInertia_),
aRelax_(sDoFRBM.aRelax_), aRelax_(sDoFRBM.aRelax_),
aDamp_(sDoFRBM.aDamp_), aDamp_(sDoFRBM.aDamp_),
report_(sDoFRBM.report_) report_(sDoFRBM.report_),
solver_(sDoFRBM.solver_, false)
{} {}

View File

@ -52,6 +52,7 @@ SourceFiles
#include "sixDoFRigidBodyMotionConstraint.H" #include "sixDoFRigidBodyMotionConstraint.H"
#include "Tuple2.H" #include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam

View File

@ -25,6 +25,7 @@ License
#include "sixDoFRigidBodyMotion.H" #include "sixDoFRigidBodyMotion.H"
#include "IOstreams.H" #include "IOstreams.H"
#include "sixDoFSolver.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
@ -112,6 +113,12 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
os << decrIndent << indent << token::END_BLOCK << nl; os << decrIndent << indent << token::END_BLOCK << nl;
} }
if (!solver_.empty())
{
os << indent << "solver";
solver_->write(os);
}
} }

View File

@ -46,7 +46,7 @@ Foam::sixDoFSolvers::CrankNicolson::CrankNicolson
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
) )
: :
sixDoFSolver(body), sixDoFSolver(dict, body),
aoc_(dict.lookupOrDefault<scalar>("aoc", 0.5)), aoc_(dict.lookupOrDefault<scalar>("aoc", 0.5)),
voc_(dict.lookupOrDefault<scalar>("voc", 0.5)) voc_(dict.lookupOrDefault<scalar>("voc", 0.5))
{} {}
@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::CrankNicolson::solve
Q() = Qpi.first(); Q() = Qpi.first();
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -98,6 +98,15 @@ public:
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
); );
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new CrankNicolson(dict_, body_)
);
}
//- Destructor //- Destructor
virtual ~CrankNicolson(); virtual ~CrankNicolson();

View File

@ -46,7 +46,7 @@ Foam::sixDoFSolvers::Newmark::Newmark
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
) )
: :
sixDoFSolver(body), sixDoFSolver(dict, body),
gamma_(dict.lookupOrDefault<scalar>("gamma", 0.5)), gamma_(dict.lookupOrDefault<scalar>("gamma", 0.5)),
beta_ beta_
( (
@ -111,5 +111,4 @@ void Foam::sixDoFSolvers::Newmark::solve
Q() = Qpi.first(); Q() = Qpi.first();
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -96,6 +96,15 @@ public:
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
); );
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new Newmark(dict_, body_)
);
}
//- Destructor //- Destructor
virtual ~Newmark(); virtual ~Newmark();

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "sixDoFSolver.H" #include "sixDoFSolver.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -36,12 +37,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * 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 * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sixDoFSolver::~sixDoFSolver() Foam::sixDoFSolver::~sixDoFSolver()

View File

@ -59,6 +59,9 @@ protected:
//- The rigid body //- The rigid body
sixDoFRigidBodyMotion& body_; sixDoFRigidBodyMotion& body_;
//- Model dictionary
dictionary dict_;
// Protected member functions // Protected member functions
@ -148,7 +151,10 @@ public:
// Constructors // Constructors
// Construct for given body // 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 //- Destructor
@ -175,6 +181,10 @@ public:
scalar deltaT, scalar deltaT,
scalar deltaT0 scalar deltaT0
) = 0; ) = 0;
//- Write
void write(Ostream&) const;
}; };

View File

@ -46,7 +46,7 @@ Foam::sixDoFSolvers::symplectic::symplectic
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
) )
: :
sixDoFSolver(body) sixDoFSolver(dict, body)
{} {}
@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::symplectic::solve
pi() += rConstraints() & aDamp()*0.5*deltaT*tau(); pi() += rConstraints() & aDamp()*0.5*deltaT*tau();
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -95,6 +95,15 @@ public:
sixDoFRigidBodyMotion& body sixDoFRigidBodyMotion& body
); );
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new symplectic(dict_, body_)
);
}
//- Destructor //- Destructor
virtual ~symplectic(); virtual ~symplectic();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd. \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,6 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam:: Foam::
compressible:: compressible::
humidityTemperatureCoupledMixedFvPatchScalarField humidityTemperatureCoupledMixedFvPatchScalarField
@ -94,8 +93,8 @@ Description
myInterfacePatchName myInterfacePatchName
{ {
type thermalHumidityCoupledMixed; type thermalHumidityCoupledMixed;
kappa fluidThermo; kappaMethod fluidThermo;
kappaName none; kappa none;
// Modes of operation: inert, condensation, vaporization, condEvap // Modes of operation: inert, condensation, vaporization, condEvap
mode condEvap; mode condEvap;
@ -137,8 +136,8 @@ Description
myInterfacePatchName myInterfacePatchName
{ {
type thermalInertiaMassTransferCoupledMixed; type thermalInertiaMassTransferCoupledMixed;
kappa solidThermo; kappaMethod solidThermo;
kappaName none; kappa none;
value uniform 260; value uniform 260;
} }
\endverbatim \endverbatim

View File

@ -4,12 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=$(getApplication)
runApplication blockMesh runApplication blockMesh
runApplication boxTurb runApplication boxTurb
runApplication $application runApplication $(getApplication)
runApplication -s enstrophy postProcess -func enstrophy runApplication -s enstrophy postProcess -func enstrophy
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase cleanCase
rm -rf EnSight Ensight Fieldview > /dev/null 2>&1 rm -rf Fieldview > /dev/null 2>&1
rm -f constant/polyMesh/boundary > /dev/null 2>&1
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=$(getApplication)
runAnsysToFoam() runAnsysToFoam()
{ {
if [ -f log.ansysToFoam ] if [ -f log.ansysToFoam ]
@ -19,7 +16,7 @@ runAnsysToFoam()
} }
runAnsysToFoam flange.ans 0.001 runAnsysToFoam flange.ans 0.001
runApplication $application runApplication $(getApplication)
runApplication foamToEnsight -noZero runApplication foamToEnsight -noZero
runApplication foamToEnsightParts -noZero runApplication foamToEnsightParts -noZero
runApplication foamToVTK runApplication foamToVTK

View File

@ -4,8 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
\rm -rf 0 > /dev/null 2>&1
cleanCase cleanCase
rm -rf 0
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application=$(getApplication)
restore0Dir restore0Dir
runApplication blockMesh runApplication blockMesh
runApplication $application -withFunctionObjects -writePhi -writep runApplication $(getApplication) -withFunctionObjects -writePhi -writep
runApplication streamFunction runApplication streamFunction
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,8 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0 > /dev/null 2>&1
cleanCase cleanCase
rm -rf 0
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,11 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
application=$(getApplication)
restore0Dir restore0Dir
runApplication blockMesh runApplication blockMesh
runApplication $application -writePhi -writep runApplication $(getApplication) -writePhi -writep
runApplication streamFunction runApplication streamFunction
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -3,14 +3,10 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase cleanCase
rm -rf 0
rm -rf VTK 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,7 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
@ -12,7 +11,6 @@ runApplication topoSet
runApplication PDRMesh -overwrite runApplication PDRMesh -overwrite
# Run
runApplication $(getApplication) runApplication $(getApplication)
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View 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
#------------------------------------------------------------------------------

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
cd ${0%/*} || exit 1 # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allrun.mesh ./Allrun.mesh
@ -15,3 +15,5 @@ runParallel potentialFoam -pName pPotential -initialiseUBCs
\rm -f processor*/0/phi \rm -f processor*/0/phi
runParallel XiDyMFoam runParallel XiDyMFoam
#------------------------------------------------------------------------------

View File

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
cd ${0%/*} || exit 1 # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -f log.* constant/polyMesh/*Level
runApplication blockMesh runApplication blockMesh
runApplication -s cyclic \ runApplication -s cyclic \
@ -21,3 +19,5 @@ runApplication -s ami \
runApplication transformPoints -scale '(0.01 0.01 0.01)' runApplication transformPoints -scale '(0.01 0.01 0.01)'
runApplication mergeOrSplitBaffles -split -overwrite runApplication mergeOrSplitBaffles -split -overwrite
#------------------------------------------------------------------------------

View File

@ -1,12 +1,13 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase 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 validation/OF_vs_CHEMKINII.eps validation/chemkinII
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,14 +4,12 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application=$(getApplication)
runApplication chemkinToFoam \ runApplication chemkinToFoam \
chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \ chemkin/chem.inp chemkin/therm.dat chemkin/transportProperties \
constant/reactions constant/thermo constant/reactions constant/thermo
runApplication $application runApplication $(getApplication)
(cd validation && ./Allrun $*) (cd validation && ./Allrun $*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Extract Chemkin II data into a friendlier format # Extract Chemkin II data into a friendlier format
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
./createGraph ./createGraph
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name runApplication $(getApplication)
application=$(getApplication)
runApplication $application
(cd validation && ./Allrun $*) (cd validation && ./Allrun $*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Extract Chemkin II data into a friendlier format # Extract Chemkin II data into a friendlier format
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
./createGraph ./createGraph
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name runApplication $(getApplication)
application=$(getApplication)
runApplication $application
(cd validation && ./Allrun $*) (cd validation && ./Allrun $*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Extract Chemkin II data into a friendlier format # Extract Chemkin II data into a friendlier format
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
./createGraph ./createGraph
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,11 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name runApplication $(getApplication)
application=`getApplication`
runApplication $application
(cd validation && ./Allrun $*) (cd validation && ./Allrun $*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Extract Chemkin II data into a friendlier format # Extract Chemkin II data into a friendlier format
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
./createGraph ./createGraph
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -21,5 +21,4 @@ gnuplot<<EOF
"chemkinII" with lines title "Chemkin II" lt -1 "chemkinII" with lines title "Chemkin II" lt -1
EOF EOF
# ----------------------------------------------------------------- end-of-file # -----------------------------------------------------------------------------

View File

@ -1,12 +1,12 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase 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
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,10 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name runApplication $(getApplication)
application=$(getApplication)
runApplication $application
(cd validation && ./Allrun $*) (cd validation && ./Allrun $*)

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory cd ${0%/*} || exit 1 # Run from this directory
# Extract Chemkin II data into a friendlier format # Extract Chemkin II data into a friendlier format
@ -10,5 +9,3 @@ grep '^ Time (sec)' ../chemkin/senk.out | awk '{print $4 " " $8 }' \
./createGraph ./createGraph
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -5,11 +5,10 @@ cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
mv ./-180 temp180 mv ./-180 temp180
cleanCase
rm -rf 0 > /dev/null 2>&1 cleanCase
rm -f constant/polyMesh/boundary > /dev/null 2>&1 rm -rf 0
mv temp180 ./-180 mv temp180 ./-180
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,11 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=$(getApplication)
runApplication kivaToFoam -file otape17 runApplication kivaToFoam -file otape17
runApplication $(getApplication)
runApplication $application
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More