Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2012-12-05 17:43:19 +00:00
85 changed files with 1185 additions and 712 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -93,7 +93,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
dict dict
) << "unphysical accommodationCoeff specified" ) << "unphysical accommodationCoeff specified"
<< "(0 < accommodationCoeff <= 1)" << endl << "(0 < accommodationCoeff <= 1)" << endl
<< exit(FatalError); << exit(FatalIOError);
} }
if (dict.found("value")) if (dict.found("value"))

View File

@ -94,7 +94,7 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
dict dict
) << "unphysical accommodationCoeff_ specified" ) << "unphysical accommodationCoeff_ specified"
<< "(0 < accommodationCoeff_ <= 1)" << endl << "(0 < accommodationCoeff_ <= 1)" << endl
<< exit(FatalError); << exit(FatalIOError);
} }
if (dict.found("value")) if (dict.found("value"))

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -98,6 +98,7 @@ mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
valueFraction_(ptf.valueFraction_) valueFraction_(ptf.valueFraction_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Map from self // Map from self

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -104,60 +104,50 @@ int main(int argc, char *argv[])
polyMeshDir = polyMesh::meshSubDir; polyMeshDir = polyMesh::meshSubDir;
} }
autoPtr<IOobject> meshDictIoPtr; IOobject meshDictIO
(
dictName,
runTime.constant(),
polyMeshDir,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {
const fileName dictPath = args["dict"]; const fileName dictPath = args["dict"];
meshDictIoPtr.set meshDictIO = IOobject
( (
new IOobject
( (
( isDir(dictPath)
isDir(dictPath) ? dictPath/dictName
? dictPath/dictName : dictPath
: dictPath ),
), runTime,
runTime, IOobject::MUST_READ,
IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE,
IOobject::NO_WRITE, false
false
)
);
}
else
{
meshDictIoPtr.set
(
new IOobject
(
dictName,
runTime.constant(),
polyMeshDir,
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
); );
} }
if (!meshDictIoPtr->headerOk()) if (!meshDictIO.headerOk())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Cannot open mesh description file\n " << "Cannot open mesh description file\n "
<< meshDictIoPtr->objectPath() << meshDictIO.objectPath()
<< nl << nl
<< exit(FatalError); << exit(FatalError);
} }
Info<< "Creating block mesh from\n " Info<< "Creating block mesh from\n "
<< meshDictIoPtr->objectPath() << endl; << meshDictIO.objectPath() << endl;
blockMesh::verbose(true); blockMesh::verbose(true);
IOdictionary meshDict(meshDictIoPtr()); IOdictionary meshDict(meshDictIO);
blockMesh blocks(meshDict, regionName); blockMesh blocks(meshDict, regionName);

View File

@ -1241,8 +1241,7 @@ int main(int argc, char *argv[])
#include "addRegionOption.H" #include "addRegionOption.H"
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
argList::addOption("dict", "name", "specify alternative dictionary"); #include "addDictOption.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
@ -1263,19 +1262,14 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
bool overwrite = args.optionFound("overwrite"); bool overwrite = args.optionFound("overwrite");
const word dictName
(args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
IOdictionary dict
( const word dictName("extrudeToRegionMeshDict");
IOobject
( #include "setSystemMeshDictionaryIO.H"
dictName,
runTime.system(), IOdictionary dict(dictIO);
runTime,
IOobject::MUST_READ_IF_MODIFIED
)
);
// Point generator // Point generator
autoPtr<extrudeModel> model(extrudeModel::New(dict)); autoPtr<extrudeModel> model(extrudeModel::New(dict));

View File

@ -369,7 +369,10 @@ int main(int argc, char *argv[])
// Add all the surface regions as patches // Add all the surface regions as patches
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
labelList globalToPatch; //- Global surface region to patch (non faceZone surface) or patches
// (faceZone surfaces)
labelList globalToMasterPatch;
labelList globalToSlavePatch;
{ {
Info<< nl Info<< nl
<< "Adding patches for surface regions" << nl << "Adding patches for surface regions" << nl
@ -377,7 +380,8 @@ int main(int argc, char *argv[])
<< endl; << endl;
// From global region number to mesh patch. // From global region number to mesh patch.
globalToPatch.setSize(surfaces.nRegions(), -1); globalToMasterPatch.setSize(surfaces.nRegions(), -1);
globalToSlavePatch.setSize(surfaces.nRegions(), -1);
Info<< "Patch\tType\tRegion" << nl Info<< "Patch\tType\tRegion" << nl
<< "-----\t----\t------" << "-----\t----\t------"
@ -394,36 +398,111 @@ int main(int argc, char *argv[])
Info<< surfaces.names()[surfI] << ':' << nl << nl; Info<< surfaces.names()[surfI] << ':' << nl << nl;
forAll(regNames, i) if (surfaces.faceZoneNames()[surfI].empty())
{ {
label globalRegionI = surfaces.globalRegion(surfI, i); // 'Normal' surface
forAll(regNames, i)
label patchI;
if (surfacePatchInfo.set(globalRegionI))
{ {
patchI = meshRefiner.addMeshedPatch label globalRegionI = surfaces.globalRegion(surfI, i);
(
regNames[i], label patchI;
surfacePatchInfo[globalRegionI]
); if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
(
regNames[i],
surfacePatchInfo[globalRegionI]
);
}
else
{
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
(
regNames[i],
patchInfo
);
}
Info<< patchI << '\t' << mesh.boundaryMesh()[patchI].type()
<< '\t' << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
globalToSlavePatch[globalRegionI] = patchI;
} }
else }
else
{
// Zoned surface
forAll(regNames, i)
{ {
dictionary patchInfo; label globalRegionI = surfaces.globalRegion(surfI, i);
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch // Add master side patch
( {
regNames[i], label patchI;
patchInfo
); if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
(
regNames[i],
surfacePatchInfo[globalRegionI]
);
}
else
{
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
(
regNames[i],
patchInfo
);
}
Info<< patchI << '\t'
<< mesh.boundaryMesh()[patchI].type()
<< '\t' << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
}
// Add slave side patch
{
const word slaveName = regNames[i] + "_slave";
label patchI;
if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
(
slaveName,
surfacePatchInfo[globalRegionI]
);
}
else
{
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
(
slaveName,
patchInfo
);
}
Info<< patchI << '\t'
<< mesh.boundaryMesh()[patchI].type()
<< '\t' << slaveName << nl;
globalToSlavePatch[globalRegionI] = patchI;
}
} }
Info<< patchI << '\t' << mesh.boundaryMesh()[patchI].type()
<< '\t' << regNames[i] << nl;
globalToPatch[globalRegionI] = patchI;
} }
Info<< nl; Info<< nl;
@ -479,7 +558,8 @@ int main(int argc, char *argv[])
meshRefiner, meshRefiner,
decomposer, decomposer,
distributor, distributor,
globalToPatch globalToMasterPatch,
globalToSlavePatch
); );
// Refinement parameters // Refinement parameters
@ -510,7 +590,8 @@ int main(int argc, char *argv[])
autoSnapDriver snapDriver autoSnapDriver snapDriver
( (
meshRefiner, meshRefiner,
globalToPatch globalToMasterPatch,
globalToSlavePatch
); );
// Snap parameters // Snap parameters
@ -544,7 +625,12 @@ int main(int argc, char *argv[])
{ {
cpuTime timer; cpuTime timer;
autoLayerDriver layerDriver(meshRefiner, globalToPatch); autoLayerDriver layerDriver
(
meshRefiner,
globalToMasterPatch,
globalToSlavePatch
);
// Layer addition parameters // Layer addition parameters
layerParameters layerParams(layerDict, mesh.boundaryMesh()); layerParameters layerParams(layerDict, mesh.boundaryMesh());

View File

@ -117,14 +117,9 @@ int main(int argc, char *argv[])
"Makes internal faces into boundary faces.\n" "Makes internal faces into boundary faces.\n"
"Does not duplicate points." "Does not duplicate points."
); );
#include "addDictOption.H"
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify alternative dictionary for the createBaffles description"
);
#include "addRegionOption.H" #include "addRegionOption.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
@ -136,14 +131,8 @@ int main(int argc, char *argv[])
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const word dictName const word dictName("createBafflesDict");
( #include "setSystemMeshDictionaryIO.H"
args.optionLookupOrDefault<word>
(
"dict",
"createBafflesDict"
)
);
Switch internalFacesOnly(false); Switch internalFacesOnly(false);
@ -152,17 +141,7 @@ int main(int argc, char *argv[])
PtrList<faceSelection> selectors; PtrList<faceSelection> selectors;
{ {
Info<< "Reading baffle criteria from " << dictName << nl << endl; Info<< "Reading baffle criteria from " << dictName << nl << endl;
IOdictionary dict IOdictionary dict(dictIO);
(
IOobject
(
dictName,
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dict.lookup("internalFacesOnly") >> internalFacesOnly; dict.lookup("internalFacesOnly") >> internalFacesOnly;
noFields = dict.lookupOrDefault("noFields", false); noFields = dict.lookupOrDefault("noFields", false);

View File

@ -505,13 +505,7 @@ int main(int argc, char *argv[])
{ {
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addOption #include "addDictOption.H"
(
"dict",
"word",
"name of dictionary to provide patch information"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
@ -521,38 +515,20 @@ int main(int argc, char *argv[])
const bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
word dictName #include "createNamedPolyMesh.H"
(
args.optionLookupOrDefault<word>("dict", "createPatchDict") const word oldInstance = mesh.pointsInstance();
);
const word dictName("createPatchDict");
#include "setSystemMeshDictionaryIO.H"
Info<< "Reading " << dictName << nl << endl; Info<< "Reading " << dictName << nl << endl;
IOdictionary dict IOdictionary dict(dictIO);
(
IOobject
(
dictName,
runTime.system(),
(
meshRegionName != polyMesh::defaultRegion
? meshRegionName
: word::null
),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
// Whether to synchronise points // Whether to synchronise points
const Switch pointSync(dict.lookup("pointSync")); const Switch pointSync(dict.lookup("pointSync"));
#include "createNamedPolyMesh.H"
const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();

View File

@ -298,12 +298,7 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addBoolOption #include "addDictOption.H"
(
"dict",
"refine according to system/refineMeshDict"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
runTime.functionObjects().off(); runTime.functionObjects().off();
@ -327,19 +322,12 @@ int main(int argc, char *argv[])
if (readDict) if (readDict)
{ {
Info<< "Refining according to refineMeshDict" << nl << endl; const word dictName("refineMeshDict");
#include "setSystemMeshDictionaryIO.H"
refineDict = IOdictionary Info<< "Refining according to " << dictName << nl << endl;
(
IOobject refineDict = IOdictionary(dictIO);
(
"refineMeshDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
const word setName(refineDict.lookup("set")); const word setName(refineDict.lookup("set"));

View File

@ -614,11 +614,7 @@ int main(int argc, char *argv[])
# include "addRegionOption.H" # include "addRegionOption.H"
# include "addOverwriteOption.H" # include "addOverwriteOption.H"
# include "addTimeOptions.H" # include "addTimeOptions.H"
argList::addBoolOption # include "addDictOption.H"
(
"dict",
"renumber according to system/renumberMeshDict"
);
argList::addBoolOption argList::addBoolOption
( (
"frontWidth", "frontWidth",
@ -700,23 +696,13 @@ int main(int argc, char *argv[])
if (readDict) if (readDict)
{ {
Info<< "Renumber according to renumberMeshDict." << nl << endl; const word dictName("renumberMeshDict");
#include "setSystemMeshDictionaryIO.H"
renumberDictPtr.reset Info<< "Renumber according to " << dictName << nl << endl;
(
new IOdictionary renumberDictPtr.reset(new IOdictionary(dictIO));
( const IOdictionary& renumberDict = renumberDictPtr();
IOobject
(
"renumberMeshDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
)
);
const IOdictionary renumberDict = renumberDictPtr();
renumberPtr = renumberMethod::New(renumberDict); renumberPtr = renumberMethod::New(renumberDict);

View File

@ -156,10 +156,21 @@ Foam::boolList Foam::cellSelections::outsideCellSelection::findRegions
reduce(keepRegionI, maxOp<label>()); reduce(keepRegionI, maxOp<label>());
keepRegion[keepRegionI] = true; keepRegion[keepRegionI] = true;
reduce(keepProcI, maxOp<label>());
if (keepProcI == -1)
{
FatalErrorIn
(
"outsideCellSelection::findRegions"
"(const bool, const regionSplit&)"
) << "Did not find " << locationsInMesh_[i]
<< " in mesh." << " Mesh bounds are " << mesh_.bounds()
<< exit(FatalError);
}
if (verbose) if (verbose)
{ {
reduce(keepProcI, maxOp<label>());
Info<< "Found location " << locationsInMesh_[i] Info<< "Found location " << locationsInMesh_[i]
<< " in cell " << cellI << " on processor " << keepProcI << " in cell " << cellI << " on processor " << keepProcI
<< " in global region " << keepRegionI << " in global region " << keepRegionI

View File

@ -155,12 +155,7 @@ int main(int argc, char *argv[])
"select a mesh subset based on a provided cellSet and/or" "select a mesh subset based on a provided cellSet and/or"
" selection criteria" " selection criteria"
); );
argList::addBoolOption #include "addDictOption.H"
(
"dict",
"read mesh subset selection criteria"
" from system/subsetMeshDict"
);
argList::addOption argList::addOption
( (
"cellSet", "cellSet",
@ -210,18 +205,10 @@ int main(int argc, char *argv[])
PtrList<cellSelection> selectors; PtrList<cellSelection> selectors;
if (useDict) if (useDict)
{ {
Info<< "Reading selection criteria from subsetMeshDict" << nl << endl; const word dictName("subsetMeshDict");
IOdictionary dict #include "setSystemMeshDictionaryIO.H"
( Info<< "Reading selection criteria from " << dictName << nl << endl;
IOobject IOdictionary dict(dictIO);
(
"subsetMeshDict",
mesh.time().system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const dictionary& selectionsDict = dict.subDict("selections"); const dictionary& selectionsDict = dict.subDict("selections");

View File

@ -27,7 +27,7 @@ selections
// used by snappyHexMesh, cvMesh. // used by snappyHexMesh, cvMesh.
type badQuality; type badQuality;
// Use the quality criteria from the snappyHexMeshDict // Use the quality criteria from the snappyHexMeshDict
${.meshQualityControls} ${:meshQualityControls}
} }
outside outside
@ -42,7 +42,7 @@ selections
//- Define mesh location for keeping. //- Define mesh location for keeping.
// In this case use the one from snappyHexMeshDict. This can // In this case use the one from snappyHexMeshDict. This can
// optionally be a list of locations. // optionally be a list of locations.
locationsInMesh (${.castellatedMeshControls.locationInMesh}); locationsInMesh (${:castellatedMeshControls.locationInMesh});
} }
} }

View File

@ -193,12 +193,7 @@ polyMesh::readUpdateState meshReadUpdate(polyMesh& mesh)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
timeSelector::addOptions(true, false); timeSelector::addOptions(true, false);
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify an alternative dictionary for the topoSet dictionary"
);
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addBoolOption argList::addBoolOption
( (
@ -216,41 +211,11 @@ int main(int argc, char *argv[])
const bool noSync = args.optionFound("noSync"); const bool noSync = args.optionFound("noSync");
const word dictName("topoSetDict"); const word dictName("topoSetDict");
#include "setSystemMeshDictionaryIO.H"
fileName dictPath = dictName;
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
Info<< "Reading " << dictName << "\n" << endl; Info<< "Reading " << dictName << "\n" << endl;
IOdictionary topoSetDict IOdictionary topoSetDict(dictIO);
(
(
args.optionFound("dict")
? IOobject
(
dictPath,
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
: IOobject
(
dictName,
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
)
);
// Read set construct info from dictionary // Read set construct info from dictionary
PtrList<dictionary> actions(topoSetDict.lookup("actions")); PtrList<dictionary> actions(topoSetDict.lookup("actions"));

View File

@ -51,12 +51,7 @@ int main(int argc, char *argv[])
"keywords", "keywords",
"report keywords for the specified dictionary" "report keywords for the specified dictionary"
); );
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify a dictionary to interrogate"
);
argList::addOption argList::addOption
( (
"entry", "entry",
@ -81,9 +76,12 @@ int main(int argc, char *argv[])
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {
fileName dictPath = args["dict"];
const fileName dictFileName const fileName dictFileName
( (
args.rootPath()/args.caseName()/args["dict"] dictPath.isAbsolute()
? dictPath
: args.rootPath()/args.caseName()/args["dict"]
); );
IFstream dictFile(dictFileName); IFstream dictFile(dictFileName);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,12 +49,7 @@ int main(int argc, char *argv[])
"noWrite", "noWrite",
"suppress writing results" "suppress writing results"
); );
Foam::argList::addOption # include "addDictOption.H"
(
"dict",
"name",
"dictionary to use"
);
if (argc < 2) if (argc < 2)
{ {

View File

@ -1,16 +1,9 @@
word dictName(args.optionLookupOrDefault<word>("dict", "particleTrackDict")); const word dictName("particleTrackDict");
IOdictionary propsDict #include "setConstantMeshDictionaryIO.H"
(
IOobject IOdictionary propsDict(dictIO);
(
dictName,
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED
)
);
word cloudName(propsDict.lookup("cloudName")); word cloudName(propsDict.lookup("cloudName"));
List<word> userFields(propsDict.lookup("fields")); List<word> userFields(propsDict.lookup("fields"));

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -113,7 +113,7 @@ int main(int argc, char *argv[])
argList::noParallel(); argList::noParallel();
timeSelector::addOptions(); timeSelector::addOptions();
#include "addRegionOption.H" #include "addRegionOption.H"
argList::validOptions.insert("dict", ""); #include "addDictOption.H"
#include "setRootCase.H" #include "setRootCase.H"

View File

@ -65,7 +65,6 @@ namespace Foam
IOobject IOobject
( (
args["dict"], args["dict"],
runTime.system(),
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED IOobject::MUST_READ_IF_MODIFIED
) )

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
( (
probes::typeName, probes::typeName,
mesh, mesh,
"probesDict", word("probesDict"), // force the use of the system directory
IOobject::MUST_READ, IOobject::MUST_READ,
true true
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -97,37 +97,82 @@ int main(int argc, char *argv[])
{ {
timeSelector::addOptions(); timeSelector::addOptions();
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addOption #include "addDictOption.H"
(
"dict",
"word",
"name of dictionary to provide sample information"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args); instantList timeDirs = timeSelector::select0(runTime, args);
#include "createNamedMesh.H" #include "createNamedMesh.H"
word sampleDict(args.optionLookupOrDefault<word>("dict", "sampleDict")); const word dictName("sampleDict");
IOsampledSets sSets autoPtr<IOsampledSets> sSetsPtr;
( autoPtr<IOsampledSurfaces> sSurfsPtr;
sampledSets::typeName,
mesh,
sampleDict,
IOobject::MUST_READ_IF_MODIFIED,
true
);
IOsampledSurfaces sSurfs if (args.optionFound("dict"))
( {
sampledSurfaces::typeName, // Construct from fileName
mesh,
sampleDict, fileName dictPath = args["dict"];
IOobject::MUST_READ_IF_MODIFIED, if (isDir(dictPath))
true {
); dictPath = dictPath / dictName;
}
sSetsPtr.reset
(
new IOsampledSets
(
sampledSets::typeName,
mesh,
dictPath,
IOobject::MUST_READ_IF_MODIFIED,
true
)
);
sSurfsPtr.reset
(
new IOsampledSurfaces
(
sampledSurfaces::typeName,
mesh,
dictPath,
IOobject::MUST_READ_IF_MODIFIED,
true
)
);
}
else
{
// Construct from name in system() directory
sSetsPtr.reset
(
new IOsampledSets
(
sampledSets::typeName,
mesh,
dictName,
IOobject::MUST_READ_IF_MODIFIED,
true
)
);
sSurfsPtr.reset
(
new IOsampledSurfaces
(
sampledSurfaces::typeName,
mesh,
dictName,
IOobject::MUST_READ_IF_MODIFIED,
true
)
);
}
IOsampledSets& sSets = sSetsPtr();
IOsampledSurfaces& sSurfs = sSurfsPtr();
forAll(timeDirs, timeI) forAll(timeDirs, timeI)
{ {

View File

@ -140,6 +140,7 @@ sets
patchSeed patchSeed
{ {
type patchSeed;
patches (".*Wall.*"); patches (".*Wall.*");
// Number of points to seed. Divided amongst all processors according // Number of points to seed. Divided amongst all processors according
// to fraction of patches they hold. // to fraction of patches they hold.

View File

@ -385,12 +385,7 @@ bool merge
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify an alternative to system/changeDictionaryDict"
);
argList::addOption argList::addOption
( (
"instance", "instance",
@ -432,21 +427,8 @@ int main(int argc, char *argv[])
runTime.setTime(times[0], 0); runTime.setTime(times[0], 0);
word instance = args.optionLookupOrDefault("instance", runTime.timeName()); word instance = args.optionLookupOrDefault("instance", runTime.timeName());
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word dictName("changeDictionaryDict");
fileName dictPath = dictName;
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
const bool literalRE = args.optionFound("literalRE"); const bool literalRE = args.optionFound("literalRE");
if (literalRE) if (literalRE)
{ {
@ -493,27 +475,10 @@ int main(int argc, char *argv[])
// Get the replacement rules from a dictionary // Get the replacement rules from a dictionary
IOdictionary dict
( const word dictName("changeDictionaryDict");
( #include "setSystemMeshDictionaryIO.H"
args.optionFound("dict") IOdictionary dict(dictIO);
? IOobject
(
dictPath,
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
: IOobject
(
dictName,
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
)
);
const dictionary& replaceDicts = dict.subDict("dictionaryReplacement"); const dictionary& replaceDicts = dict.subDict("dictionaryReplacement");
Info<< "Read dictionary " << dict.name() Info<< "Read dictionary " << dict.name()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,22 +48,22 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "addRegionOption.H" #include "addRegionOption.H"
argList::addOption #include "addDictOption.H"
(
"dict",
"word",
"name of dictionary to provide patch agglomeration controls"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createNamedMesh.H" #include "createNamedMesh.H"
word agglomDictName const word dictName("faceAgglomerateDict");
(
args.optionLookupOrDefault<word>("dict", "faceAgglomerateDict")
);
const polyBoundaryMesh& patches = mesh.boundaryMesh(); #include "setConstantMeshDictionaryIO.H"
// Read control dictionary
const IOdictionary agglomDict(dictIO);
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
labelListIOList finalAgglom labelListIOList finalAgglom
( (
@ -76,27 +76,9 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
), ),
patches.size() boundary.size()
); );
// Read control dictionary
IOdictionary agglomDict
(
IOobject
(
agglomDictName,
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
forAll(boundary, patchId) forAll(boundary, patchId)
{ {
const polyPatch& pp = boundary[patchId]; const polyPatch& pp = boundary[patchId];
@ -178,7 +160,6 @@ int main(int argc, char *argv[])
forAll(boundary, patchId) forAll(boundary, patchId)
{ {
fvPatchScalarField& bFacesAgglomeration = fvPatchScalarField& bFacesAgglomeration =
facesAgglomeration.boundaryField()[patchId]; facesAgglomeration.boundaryField()[patchId];
@ -188,7 +169,7 @@ int main(int argc, char *argv[])
} }
} }
Info << "\nWriting facesAgglomeration" << endl; Info<< "\nWriting facesAgglomeration" << endl;
facesAgglomeration.write(); facesAgglomeration.write();
} }

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object viewFactorsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Write agglomeration as a volScalarField with calculated boundary values
writeFacesAgglomeration true;
// Per patch (wildcard possible) the coarsening level
bottomAir_to_heater
{
nFacesInCoarsestLevel 30;
featureAngle 10;
}
// ************************************************************************* //

View File

@ -680,35 +680,17 @@ int main(int argc, char *argv[])
); );
argList::noParallel(); argList::noParallel();
argList::addOption # include "addDictOption.H"
(
"dict",
"word",
"specify alternative dictionary for the feature extraction information"
);
# include "setRootCase.H" # include "setRootCase.H"
# include "createTime.H" # include "createTime.H"
word dictName const word dictName("surfaceFeatureExtractDict");
( # include "setSystemRunTimeDictionaryIO.H"
args.optionLookupOrDefault<word>("dict", "surfaceFeatureExtractDict")
);
Info<< "Reading " << dictName << nl << endl; Info<< "Reading " << dictName << nl << endl;
IOdictionary dict const IOdictionary dict(dictIO);
(
IOobject
(
dictName,
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
forAllConstIter(dictionary, dict, iter) forAllConstIter(dictionary, dict, iter)
{ {

View File

@ -96,12 +96,7 @@ int main(int argc, char *argv[])
"factor", "factor",
"geometry scaling factor on output" "geometry scaling factor on output"
); );
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify alternative dictionary for the coordinateSystems descriptions"
);
argList::addOption argList::addOption
( (
"from", "from",
@ -154,19 +149,28 @@ int main(int argc, char *argv[])
{ {
autoPtr<IOobject> csDictIoPtr; autoPtr<IOobject> csDictIoPtr;
const word dictName("coordinateSystems::typeName");
// Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary
// is in constant
fileName dictPath = "";
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {
const fileName dictPath = args["dict"]; dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
if (dictPath.size())
{
csDictIoPtr.set csDictIoPtr.set
( (
new IOobject new IOobject
( (
( dictPath,
isDir(dictPath)
? dictPath/coordinateSystems::typeName
: dictPath
),
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
@ -180,7 +184,7 @@ int main(int argc, char *argv[])
( (
new IOobject new IOobject
( (
coordinateSystems::typeName, dictName,
runTime.constant(), runTime.constant(),
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,

View File

@ -103,12 +103,7 @@ int main(int argc, char *argv[])
"factor", "factor",
"geometry scaling factor on output - default is 1" "geometry scaling factor on output - default is 1"
); );
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify an alternative dictionary for constant/coordinateSystems"
);
argList::addOption argList::addOption
( (
"from", "from",

View File

@ -103,12 +103,7 @@ int main(int argc, char *argv[])
"factor", "factor",
"geometry scaling factor on output - default is 1" "geometry scaling factor on output - default is 1"
); );
argList::addOption #include "addDictOption.H"
(
"dict",
"file",
"specify an alternative dictionary for constant/coordinateSystems"
);
argList::addOption argList::addOption
( (
"from", "from",

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -40,7 +40,7 @@ defineTypeNameAndDebug(Foam::IOobject, 0);
// ----- ------ // ----- ------
// "foo" ("", "", "foo") // "foo" ("", "", "foo")
// "foo/bar" ("foo", "", "bar") // "foo/bar" ("foo", "", "bar")
// "/XXX" ERROR - no absolute path // "/XXX/bar" ("/XXX", "", "bar")
// "foo/bar/" ERROR - no name // "foo/bar/" ERROR - no name
// "foo/xxx/bar" ("foo", "xxx", "bar") // "foo/xxx/bar" ("foo", "xxx", "bar")
// "foo/xxx/yyy/bar" ("foo", "xxx/yyy", "bar") // "foo/xxx/yyy/bar" ("foo", "xxx/yyy", "bar")
@ -64,14 +64,6 @@ bool Foam::IOobject::IOobject::fileNameComponents
return false; return false;
} }
if (path.isAbsolute())
{
// called with absolute path
WarningIn("IOobject::fileNameComponents(const fileName&, ...)")
<< "called with absolute path: " << path << "\n";
return false;
}
string::size_type first = path.find('/'); string::size_type first = path.find('/');
if (first == string::npos) if (first == string::npos)
@ -81,6 +73,15 @@ bool Foam::IOobject::IOobject::fileNameComponents
// check afterwards // check afterwards
name.string::operator=(path); name.string::operator=(path);
} }
else if (first == 0)
{
// Leading '/'. Absolute fileName
string::size_type last = path.rfind('/');
instance = path.substr(0, last);
// check afterwards
name.string::operator=(path.substr(last+1));
}
else else
{ {
instance = path.substr(0, first); instance = path.substr(0, first);
@ -246,7 +247,14 @@ const Foam::fileName& Foam::IOobject::rootPath() const
Foam::fileName Foam::IOobject::path() const Foam::fileName Foam::IOobject::path() const
{ {
return rootPath()/caseName()/instance()/db_.dbDir()/local(); if (instance().isAbsolute())
{
return instance();
}
else
{
return rootPath()/caseName()/instance()/db_.dbDir()/local();
}
} }
@ -256,61 +264,80 @@ Foam::fileName Foam::IOobject::path
const fileName& local const fileName& local
) const ) const
{ {
//Note: can only be called with relative instance since is word type
return rootPath()/caseName()/instance/db_.dbDir()/local; return rootPath()/caseName()/instance/db_.dbDir()/local;
} }
Foam::fileName Foam::IOobject::filePath() const Foam::fileName Foam::IOobject::filePath() const
{ {
fileName path = this->path(); if (instance().isAbsolute())
fileName objectPath = path/name();
if (isFile(objectPath))
{ {
return objectPath; fileName objectPath = instance()/name();
if (isFile(objectPath))
{
return objectPath;
}
else
{
return fileName::null;
}
} }
else else
{ {
if fileName path = this->path();
( fileName objectPath = path/name();
time().processorCase()
&& (
instance() == time().system()
|| instance() == time().constant()
)
)
{
fileName parentObjectPath =
rootPath()/caseName()
/".."/instance()/db_.dbDir()/local()/name();
if (isFile(parentObjectPath)) if (isFile(objectPath))
{ {
return parentObjectPath; return objectPath;
}
} }
else
if (!isDir(path))
{ {
word newInstancePath = time().findInstancePath(instant(instance())); if
(
if (newInstancePath.size()) time().processorCase()
&& (
instance() == time().system()
|| instance() == time().constant()
)
)
{ {
fileName fName fileName parentObjectPath =
(
rootPath()/caseName() rootPath()/caseName()
/newInstancePath/db_.dbDir()/local()/name() /".."/instance()/db_.dbDir()/local()/name();
if (isFile(parentObjectPath))
{
return parentObjectPath;
}
}
if (!isDir(path))
{
word newInstancePath = time().findInstancePath
(
instant(instance())
); );
if (isFile(fName)) if (newInstancePath.size())
{ {
return fName; fileName fName
(
rootPath()/caseName()
/newInstancePath/db_.dbDir()/local()/name()
);
if (isFile(fName))
{
return fName;
}
} }
} }
} }
}
return fileName::null; return fileName::null;
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,7 +46,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
( (
const word& outputFilterName, const word& outputFilterName,
const objectRegistry& obr, const objectRegistry& obr,
const fileName& dictName, const word& dictName,
const IOobject::readOption rOpt, const IOobject::readOption rOpt,
const bool readFromFiles const bool readFromFiles
) )
@ -66,6 +66,30 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
{} {}
template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
const word& outputFilterName,
const objectRegistry& obr,
const fileName& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles
)
:
IOdictionary
(
IOobject
(
dictName,
obr,
rOpt,
IOobject::NO_WRITE
)
),
OutputFilter(outputFilterName, obr, *this, readFromFiles)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class OutputFilter> template<class OutputFilter>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -89,7 +89,19 @@ public:
( (
const word& outputFilterName, const word& outputFilterName,
const objectRegistry&, const objectRegistry&,
const fileName& dictName = OutputFilter::typeName() + "Dict", const word& dictName = OutputFilter::typeName() + "Dict",
const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
const bool loadFromFile = false
);
//- Construct for given objectRegistry and dictionary
// Dictionary read from full path.
// Allow the possibility to load fields from files
IOOutputFilter
(
const word& outputFilterName,
const objectRegistry&,
const fileName& dictName,
const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED, const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
const bool loadFromFile = false const bool loadFromFile = false
); );

View File

@ -0,0 +1,10 @@
//
// addDictOption.H
// ~~~~~~~~~~~~~~~~~
Foam::argList::addOption
(
"dict",
"file",
"read control dictionary from specified location"
);

View File

@ -0,0 +1,33 @@
//
// setConstantMeshDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = "";
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
IOobject dictIO
(
dictName,
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
if (dictPath.size())
{
dictIO = IOobject
(
dictPath,
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
}

View File

@ -0,0 +1,33 @@
//
// setSystemMeshDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = "";
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
IOobject dictIO
(
dictName,
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
if (dictPath.size())
{
dictIO = IOobject
(
dictPath,
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
}

View File

@ -0,0 +1,33 @@
//
// setSystemRunTimeDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = "";
if (args.optionFound("dict"))
{
dictPath = args["dict"];
if (isDir(dictPath))
{
dictPath = dictPath / dictName;
}
}
IOobject dictIO
(
dictName,
runTime.system(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
if (dictPath.size())
{
dictIO = IOobject
(
dictPath,
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
);
}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,23 +21,12 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
snGrad scheme with limited non-orthogonal correction.
The limiter is controlled by a coefficient with a value between 0 and 1
which when 0 switches the correction off and the scheme behaves as
uncorrectedSnGrad, when set to 1 the full correction is applied and the
scheme behaves as correctedSnGrad and when set to 0.5 the limiter is
calculated such that the non-orthogonal contribution does not exceed the
orthogonal part.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fv.H" #include "fv.H"
#include "limitedSnGrad.H" #include "limitedSnGrad.H"
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "correctedSnGrad.H"
#include "localMax.H" #include "localMax.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -68,7 +57,7 @@ limitedSnGrad<Type>::correction
{ {
const GeometricField<Type, fvsPatchField, surfaceMesh> corr const GeometricField<Type, fvsPatchField, surfaceMesh> corr
( (
correctedSnGrad<Type>(this->mesh()).correction(vf) correctedScheme_().correction(vf)
); );
const surfaceScalarField limiter const surfaceScalarField limiter
@ -76,7 +65,7 @@ limitedSnGrad<Type>::correction
min min
( (
limitCoeff_ limitCoeff_
*mag(snGradScheme<Type>::snGrad(vf, deltaCoeffs(vf), "orthSnGrad")) *mag(snGradScheme<Type>::snGrad(vf, deltaCoeffs(vf), "SndGrad"))
/( /(
(1 - limitCoeff_)*mag(corr) (1 - limitCoeff_)*mag(corr)
+ dimensionedScalar("small", corr.dimensions(), SMALL) + dimensionedScalar("small", corr.dimensions(), SMALL)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,14 +25,20 @@ Class
Foam::fv::limitedSnGrad Foam::fv::limitedSnGrad
Description Description
Central-difference snGrad scheme with limited non-orthogonal correction. Run-time selected snGrad scheme with limited non-orthogonal correction.
The limiter is controlled by a coefficient with a value between 0 and 1 The limiter is controlled by a coefficient with a value between 0 and 1
which when 0 switches the correction off and the scheme behaves as which when 0 switches the correction off and the scheme behaves as
uncorrectedSnGrad, when set to 1 the full correction is applied and the uncorrectedSnGrad, when set to 1 the full correction of the selected scheme
scheme behaves as correctedSnGrad and when set to 0.5 the limiter is is used and when set to 0.5 the limiter is calculated such that the
calculated such that the non-orthogonal contribution does not exceed the non-orthogonal contribution does not exceed the orthogonal part.
orthogonal part.
Format:
limited <corrected scheme> <coefficient>;
or
limited <coefficient>; // Backward compatibility
SourceFiles SourceFiles
limitedSnGrad.C limitedSnGrad.C
@ -42,7 +48,7 @@ SourceFiles
#ifndef limitedSnGrad_H #ifndef limitedSnGrad_H
#define limitedSnGrad_H #define limitedSnGrad_H
#include "snGradScheme.H" #include "correctedSnGrad.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,6 +71,8 @@ class limitedSnGrad
{ {
// Private data // Private data
tmp<snGradScheme<Type> > correctedScheme_;
scalar limitCoeff_; scalar limitCoeff_;
@ -73,6 +81,34 @@ class limitedSnGrad
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const limitedSnGrad&); void operator=(const limitedSnGrad&);
//- Lookup function for the corrected to support backward compatibility
// of dictionary specification
tmp<snGradScheme<Type> > lookupCorrectedScheme(Istream& schemeData)
{
token nextToken(schemeData);
if (nextToken.isNumber())
{
limitCoeff_ = nextToken.number();
return tmp<snGradScheme<Type> >
(
new correctedSnGrad<Type>(this->mesh())
);
}
else
{
schemeData.putBack(nextToken);
tmp<snGradScheme<Type> > tcorrectedScheme
(
fv::snGradScheme<Type>::New(this->mesh(), schemeData)
);
schemeData >> limitCoeff_;
return tcorrectedScheme;
}
}
public: public:
@ -85,22 +121,24 @@ public:
//- Construct from mesh //- Construct from mesh
limitedSnGrad(const fvMesh& mesh) limitedSnGrad(const fvMesh& mesh)
: :
snGradScheme<Type>(mesh) snGradScheme<Type>(mesh),
correctedScheme_(new correctedSnGrad<Type>(this->mesh())),
limitCoeff_(1)
{} {}
//- Construct from mesh and data stream //- Construct from mesh and data stream
limitedSnGrad(const fvMesh& mesh, Istream& is) limitedSnGrad(const fvMesh& mesh, Istream& schemeData)
: :
snGradScheme<Type>(mesh), snGradScheme<Type>(mesh),
limitCoeff_(readScalar(is)) correctedScheme_(lookupCorrectedScheme(schemeData))
{ {
if (limitCoeff_ < 0 || limitCoeff_ > 1) if (limitCoeff_ < 0 || limitCoeff_ > 1)
{ {
FatalIOErrorIn FatalIOErrorIn
( (
"limitedSnGrad(const fvMesh& mesh, Istream& is) : ", "limitedSnGrad(const fvMesh& mesh, Istream& schemeData) : ",
is schemeData
) << "limitCoeff is specified as " << limitCoeff_ ) << "limitCoeff is specified as " << limitCoeff_
<< " but should be >= 0 && <= 1" << " but should be >= 0 && <= 1"
<< exit(FatalIOError); << exit(FatalIOError);

View File

@ -2372,11 +2372,13 @@ void Foam::autoLayerDriver::getLayerCellsFaces
Foam::autoLayerDriver::autoLayerDriver Foam::autoLayerDriver::autoLayerDriver
( (
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
) )
: :
meshRefiner_(meshRefiner), meshRefiner_(meshRefiner),
globalToPatch_(globalToPatch) globalToMasterPatch_(globalToMasterPatch),
globalToSlavePatch_(globalToSlavePatch)
{} {}
@ -2435,7 +2437,12 @@ void Foam::autoLayerDriver::addLayers
// Create baffles (pairs of faces that share the same points) // Create baffles (pairs of faces that share the same points)
// Baffles stored as owner and neighbour face that have been created. // Baffles stored as owner and neighbour face that have been created.
List<labelPair> baffles; List<labelPair> baffles;
meshRefiner_.createZoneBaffles(globalToPatch_, baffles); meshRefiner_.createZoneBaffles
(
globalToMasterPatch_,
globalToSlavePatch_,
baffles
);
if (debug&meshRefinement::MESH) if (debug&meshRefinement::MESH)
{ {

View File

@ -99,7 +99,10 @@ class autoLayerDriver
meshRefinement& meshRefiner_; meshRefinement& meshRefiner_;
//- From surface region to patch //- From surface region to patch
const labelList globalToPatch_; const labelList globalToMasterPatch_;
//- From surface region to patch
const labelList globalToSlavePatch_;
@ -518,7 +521,8 @@ public:
autoLayerDriver autoLayerDriver
( (
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
); );

View File

@ -1135,6 +1135,12 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
<< " " << medialRatio.name() << " " << medialRatio.name()
<< " : ratio of medial distance to wall distance" << nl << " : ratio of medial distance to wall distance" << nl
<< endl; << endl;
meshRefiner_.mesh().setInstance(meshRefiner_.timeName());
meshRefiner_.write
(
debug,
mesh.time().path()/meshRefiner_.timeName()
);
dispVec.write(); dispVec.write();
medialDist.write(); medialDist.write();
medialVec.write(); medialVec.write();
@ -1409,6 +1415,94 @@ void Foam::autoLayerDriver::shrinkMeshMedialDistance
*dispVec[pointI]; *dispVec[pointI];
} }
//XXXXX
// // Smear displacement away from fixed values (medialRatio=0 or 1)
// {
// const edgeList& edges = mesh.edges();
// scalarField edgeWeight(edges.size(), 0.0);
// forAll(edges, edgeI)
// {
// if (isMasterEdge[edgeI])
// {
// scalar eMag = edges[edgeI].mag(mesh.points());
// if (eMag > VSMALL)
// {
// edgeWeight[edgeI] = 1.0/eMag;
// }
// else
// {
// edgeWeight[edgeI] = GREAT;
// }
// }
// }
// scalarField invSumWeight(mesh.nPoints());
// sumWeights(isMasterEdge, edgeWeight, invSumWeight);
//
//
// // Get smoothly varying patch field.
// Info<< "shrinkMeshDistance : Smoothing displacement ..." << endl;
//
// const scalar lambda = 0.33;
// const scalar mu = -0.34;
//
// pointField average(mesh.nPoints());
// for (label iter = 0; iter < 90; iter++)
// {
// // Calculate average of field
// averageNeighbours
// (
// mesh,
// edgeWeight,
// invSumWeight,
// displacement,
// average
// );
//
// forAll(displacement, i)
// {
// if (medialRatio[i] > SMALL && medialRatio[i] < 1-SMALL)
// {
// displacement[i] =
// (1-lambda)*displacement[i]
// +lambda*average[i];
// }
// }
//
//
// // Calculate average of field
// averageNeighbours
// (
// mesh,
// edgeWeight,
// invSumWeight,
// displacement,
// average
// );
//
// forAll(displacement, i)
// {
// if (medialRatio[i] > SMALL && medialRatio[i] < 1-SMALL)
// {
// displacement[i] = (1-mu)*displacement[i]+mu*average[i];
// }
// }
//
//
// // Do residual calculation every so often.
// if ((iter % 10) == 0)
// {
// Info<< " Iteration " << iter << " residual "
// << gSum(mag(displacement-average))
// /returnReduce(average.size(), sumOp<label>())
// << endl;
// }
// }
// }
//XXXXX
if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO) if (debug&meshRefinement::MESH || debug&meshRefinement::LAYERINFO)
{ {
const_cast<Time&>(mesh.time())++; const_cast<Time&>(mesh.time())++;

View File

@ -57,13 +57,15 @@ Foam::autoRefineDriver::autoRefineDriver
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
decompositionMethod& decomposer, decompositionMethod& decomposer,
fvMeshDistribute& distributor, fvMeshDistribute& distributor,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
) )
: :
meshRefiner_(meshRefiner), meshRefiner_(meshRefiner),
decomposer_(decomposer), decomposer_(decomposer),
distributor_(distributor), distributor_(distributor),
globalToPatch_(globalToPatch) globalToMasterPatch_(globalToMasterPatch),
globalToSlavePatch_(globalToSlavePatch)
{} {}
@ -313,7 +315,8 @@ void Foam::autoRefineDriver::removeInsideCells
meshRefiner_.splitMesh meshRefiner_.splitMesh
( (
nBufferLayers, // nBufferLayers nBufferLayers, // nBufferLayers
globalToPatch_, globalToMasterPatch_,
globalToSlavePatch_,
refineParams.keepPoints()[0] refineParams.keepPoints()[0]
); );
@ -521,7 +524,8 @@ void Foam::autoRefineDriver::baffleAndSplitMesh
!handleSnapProblems, // merge free standing baffles? !handleSnapProblems, // merge free standing baffles?
motionDict, motionDict,
const_cast<Time&>(mesh.time()), const_cast<Time&>(mesh.time()),
globalToPatch_, globalToMasterPatch_,
globalToSlavePatch_,
refineParams.keepPoints()[0] refineParams.keepPoints()[0]
); );
} }
@ -606,7 +610,8 @@ void Foam::autoRefineDriver::splitAndMergeBaffles
//true, // merge free standing baffles? //true, // merge free standing baffles?
motionDict, motionDict,
const_cast<Time&>(mesh.time()), const_cast<Time&>(mesh.time()),
globalToPatch_, globalToMasterPatch_,
globalToSlavePatch_,
refineParams.keepPoints()[0] refineParams.keepPoints()[0]
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,7 +65,10 @@ class autoRefineDriver
fvMeshDistribute& distributor_; fvMeshDistribute& distributor_;
//- From surface region to patch //- From surface region to patch
const labelList globalToPatch_; const labelList globalToMasterPatch_;
//- From surface region to patch
const labelList globalToSlavePatch_;
// Private Member Functions // Private Member Functions
@ -146,7 +149,8 @@ public:
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
decompositionMethod& decomposer, decompositionMethod& decomposer,
fvMeshDistribute& distributor, fvMeshDistribute& distributor,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
); );

View File

@ -573,11 +573,13 @@ bool Foam::autoSnapDriver::outwardsDisplacement
Foam::autoSnapDriver::autoSnapDriver Foam::autoSnapDriver::autoSnapDriver
( (
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
) )
: :
meshRefiner_(meshRefiner), meshRefiner_(meshRefiner),
globalToPatch_(globalToPatch) globalToMasterPatch_(globalToMasterPatch),
globalToSlavePatch_(globalToSlavePatch)
{} {}
@ -1191,7 +1193,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::repatchToSurface
if (hitSurface[i] != -1 && !isZonedFace.get(faceI)) if (hitSurface[i] != -1 && !isZonedFace.get(faceI))
{ {
closestPatch[i] = globalToPatch_ closestPatch[i] = globalToMasterPatch_
[ [
surfaces.globalRegion surfaces.globalRegion
( (
@ -1265,7 +1267,12 @@ void Foam::autoSnapDriver::doSnap
// Create baffles (pairs of faces that share the same points) // Create baffles (pairs of faces that share the same points)
// Baffles stored as owner and neighbour face that have been created. // Baffles stored as owner and neighbour face that have been created.
List<labelPair> baffles; List<labelPair> baffles;
meshRefiner_.createZoneBaffles(globalToPatch_, baffles); meshRefiner_.createZoneBaffles
(
globalToMasterPatch_,
globalToSlavePatch_,
baffles
);
// Selectively 'forget' about the baffles, i.e. not check across them // Selectively 'forget' about the baffles, i.e. not check across them

View File

@ -59,8 +59,11 @@ class autoSnapDriver
//- Mesh+surface //- Mesh+surface
meshRefinement& meshRefiner_; meshRefinement& meshRefiner_;
//- From surface region to patch //- From global surface region to master side patch
const labelList globalToPatch_; const labelList globalToMasterPatch_;
//- From global surface region to slave side patch
const labelList globalToSlavePatch_;
// Private Member Functions // Private Member Functions
@ -390,7 +393,8 @@ public:
autoSnapDriver autoSnapDriver
( (
meshRefinement& meshRefiner, meshRefinement& meshRefiner,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
); );

View File

@ -573,7 +573,7 @@ void Foam::autoSnapDriver::calcNearestFacePointProperties
pFc[i] = pp.faceCentres()[faceI]; pFc[i] = pp.faceCentres()[faceI];
//label meshFaceI = pp.addressing()[faceI]; //label meshFaceI = pp.addressing()[faceI];
//pFid[i] = mesh.boundaryMesh().whichPatch(meshFaceI); //pFid[i] = mesh.boundaryMesh().whichPatch(meshFaceI);
pFid[i] = globalToPatch_[faceSurfaceGlobalRegion[faceI]]; pFid[i] = globalToMasterPatch_[faceSurfaceGlobalRegion[faceI]];
} }
} }

View File

@ -55,6 +55,7 @@ License
#include "searchableSurfaces.H" #include "searchableSurfaces.H"
#include "treeBoundBox.H" #include "treeBoundBox.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "fvMeshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -1700,7 +1701,7 @@ Foam::label Foam::meshRefinement::addPatch
oldToNew[addedPatchI] = insertPatchI; oldToNew[addedPatchI] = insertPatchI;
// Shuffle into place // Shuffle into place
polyPatches.reorder(oldToNew); polyPatches.reorder(oldToNew, true);
fvPatches.reorder(oldToNew); fvPatches.reorder(oldToNew);
reorderPatchFields<volScalarField>(mesh, oldToNew); reorderPatchFields<volScalarField>(mesh, oldToNew);
@ -1736,6 +1737,28 @@ Foam::label Foam::meshRefinement::addMeshedPatch
// Add patch // Add patch
label patchI = addPatch(mesh_, name, patchInfo); label patchI = addPatch(mesh_, name, patchInfo);
// dictionary patchDict(patchInfo);
// patchDict.set("nFaces", 0);
// patchDict.set("startFace", 0);
// autoPtr<polyPatch> ppPtr
// (
// polyPatch::New
// (
// name,
// patchDict,
// 0,
// mesh_.boundaryMesh()
// )
// );
// label patchI = fvMeshTools::addPatch
// (
// mesh_,
// ppPtr(),
// dictionary(), // optional field values
// calculatedFvPatchField<scalar>::typeName,
// true
// );
// Store // Store
label sz = meshedPatches_.size(); label sz = meshedPatches_.size();
meshedPatches_.setSize(sz+1); meshedPatches_.setSize(sz+1);

View File

@ -330,10 +330,11 @@ private:
// Baffle handling // Baffle handling
//- Get faces to repatch. Returns map from face to patch. //- Get faces to repatch. Returns map from face to patch.
Map<label> getZoneBafflePatches Map<labelPair> getZoneBafflePatches
( (
const bool allowBoundary, const bool allowBoundary,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
) const; ) const;
//- Geometric test on see whether face needs to be baffled: //- Geometric test on see whether face needs to be baffled:
@ -349,7 +350,7 @@ private:
//- Determine patches for baffles //- Determine patches for baffles
void getBafflePatches void getBafflePatches
( (
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& neiLevel, const labelList& neiLevel,
const pointField& neiCc, const pointField& neiCc,
labelList& ownPatch, labelList& ownPatch,
@ -426,7 +427,7 @@ private:
const dictionary& motionDict, const dictionary& motionDict,
const bool removeEdgeConnectedCells, const bool removeEdgeConnectedCells,
const scalarField& perpendicularAngle, const scalarField& perpendicularAngle,
const labelList& globalToPatch const labelList& globalToMasterPatch
) const; ) const;
@ -707,7 +708,8 @@ public:
const bool mergeFreeStanding, const bool mergeFreeStanding,
const dictionary& motionDict, const dictionary& motionDict,
Time& runTime, Time& runTime,
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
const point& keepPoint const point& keepPoint
); );
@ -716,7 +718,8 @@ public:
autoPtr<mapPolyMesh> splitMesh autoPtr<mapPolyMesh> splitMesh
( (
const label nBufferLayers, const label nBufferLayers,
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
const point& keepPoint const point& keepPoint
); );
@ -741,7 +744,8 @@ public:
// baffles. // baffles.
autoPtr<mapPolyMesh> createZoneBaffles autoPtr<mapPolyMesh> createZoneBaffles
( (
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
List<labelPair>& List<labelPair>&
); );

View File

@ -259,7 +259,7 @@ bool Foam::meshRefinement::validBaffleTopology
// Determine patches for baffles on all intersected unnamed faces // Determine patches for baffles on all intersected unnamed faces
void Foam::meshRefinement::getBafflePatches void Foam::meshRefinement::getBafflePatches
( (
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& neiLevel, const labelList& neiLevel,
const pointField& neiCc, const pointField& neiCc,
@ -376,11 +376,11 @@ void Foam::meshRefinement::getBafflePatches
} }
// Pick up the patches // Pick up the patches
ownPatch[faceI] = globalToPatch ownPatch[faceI] = globalToMasterPatch
[ [
surfaces_.globalRegion(surface1[i], region1[i]) surfaces_.globalRegion(surface1[i], region1[i])
]; ];
neiPatch[faceI] = globalToPatch neiPatch[faceI] = globalToMasterPatch
[ [
surfaces_.globalRegion(surface2[i], region2[i]) surfaces_.globalRegion(surface2[i], region2[i])
]; ];
@ -406,14 +406,14 @@ void Foam::meshRefinement::getBafflePatches
} }
// Get faces to repatch. Returns map from face to patch. Foam::Map<Foam::labelPair> Foam::meshRefinement::getZoneBafflePatches
Foam::Map<Foam::label> Foam::meshRefinement::getZoneBafflePatches
( (
const bool allowBoundary, const bool allowBoundary,
const labelList& globalToPatch const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch
) const ) const
{ {
Map<label> bafflePatch(mesh_.nFaces()/1000); Map<labelPair> bafflePatch(mesh_.nFaces()/1000);
const wordList& faceZoneNames = surfaces_.faceZoneNames(); const wordList& faceZoneNames = surfaces_.faceZoneNames();
const faceZoneMesh& fZones = mesh_.faceZones(); const faceZoneMesh& fZones = mesh_.faceZones();
@ -427,40 +427,39 @@ Foam::Map<Foam::label> Foam::meshRefinement::getZoneBafflePatches
const faceZone& fZone = fZones[zoneI]; const faceZone& fZone = fZones[zoneI];
//// Get patch allocated for zone // Get patch allocated for zone
//label patchI = surfaceToCyclicPatch_[surfI]; label globalRegionI = surfaces_.globalRegion(surfI, 0);
// Get patch of (first region) of surface labelPair zPatches
label patchI = globalToPatch[surfaces_.globalRegion(surfI, 0)]; (
globalToMasterPatch[globalRegionI],
globalToSlavePatch[globalRegionI]
);
Info<< "For surface " Info<< "For zone " << fZone.name() << " found patches "
<< surfaces_.names()[surfI] << mesh_.boundaryMesh()[zPatches[0]].name() << " and "
<< " found faceZone " << fZone.name() << mesh_.boundaryMesh()[zPatches[1]].name()
<< " and patch " << mesh_.boundaryMesh()[patchI].name()
<< endl; << endl;
forAll(fZone, i) forAll(fZone, i)
{ {
label faceI = fZone[i]; label faceI = fZone[i];
if (allowBoundary || mesh_.isInternalFace(faceI)) if (allowBoundary || mesh_.isInternalFace(faceI))
{ {
if (!bafflePatch.insert(faceI, patchI)) labelPair patches = zPatches;
if (fZone.flipMap()[i])
{ {
label oldPatchI = bafflePatch[faceI]; patches = patches.reversePair();
}
if (oldPatchI != patchI) if (!bafflePatch.insert(faceI, patches))
{ {
FatalErrorIn("getZoneBafflePatches(const bool)") FatalErrorIn("getZoneBafflePatches(..)")
<< "Face " << faceI << "Face " << faceI
<< " fc:" << mesh_.faceCentres()[faceI] << " fc:" << mesh_.faceCentres()[faceI]
<< " in zone " << fZone.name() << " in zone " << fZone.name()
<< " is in patch " << " is in multiple zones!"
<< mesh_.boundaryMesh()[oldPatchI].name() << abort(FatalError);
<< " and in patch "
<< mesh_.boundaryMesh()[patchI].name()
<< abort(FatalError);
}
} }
} }
} }
@ -698,7 +697,8 @@ Foam::List<Foam::labelPair> Foam::meshRefinement::getDuplicateFaces
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
( (
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
List<labelPair>& baffles List<labelPair>& baffles
) )
{ {
@ -714,20 +714,30 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
// Get faces (internal only) to be baffled. Map from face to patch // Get faces (internal only) to be baffled. Map from face to patch
// label. // label.
Map<label> faceToPatch(getZoneBafflePatches(false, globalToPatch)); Map<labelPair> faceToPatch
(
getZoneBafflePatches
(
false,
globalToMasterPatch,
globalToSlavePatch
)
);
label nZoneFaces = returnReduce(faceToPatch.size(), sumOp<label>()); label nZoneFaces = returnReduce(faceToPatch.size(), sumOp<label>());
if (nZoneFaces > 0) if (nZoneFaces > 0)
{ {
// Convert into labelLists // Convert into labelLists
labelList ownPatch(mesh_.nFaces(), -1); labelList ownPatch(mesh_.nFaces(), -1);
forAllConstIter(Map<label>, faceToPatch, iter) labelList neiPatch(mesh_.nFaces(), -1);
forAllConstIter(Map<labelPair>, faceToPatch, iter)
{ {
ownPatch[iter.key()] = iter(); ownPatch[iter.key()] = iter().first();
neiPatch[iter.key()] = iter().second();
} }
// Create baffles. both sides same patch. // Create baffles. both sides same patch.
map = createBaffles(ownPatch, ownPatch); map = createBaffles(ownPatch, neiPatch);
// Get pairs of faces created. // Get pairs of faces created.
// Just loop over faceMap and store baffle if we encounter a slave // Just loop over faceMap and store baffle if we encounter a slave
@ -744,7 +754,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createZoneBaffles
label oldFaceI = faceMap[faceI]; label oldFaceI = faceMap[faceI];
// Does face originate from face-to-patch // Does face originate from face-to-patch
Map<label>::const_iterator iter = faceToPatch.find(oldFaceI); Map<labelPair>::const_iterator iter = faceToPatch.find
(
oldFaceI
);
if (iter != faceToPatch.end()) if (iter != faceToPatch.end())
{ {
@ -1344,7 +1357,8 @@ void Foam::meshRefinement::findCellZoneGeometric
// Sync // Sync
syncTools::syncFaceList(mesh_, namedSurfaceIndex, maxEqOp<label>()); syncTools::syncFaceList(mesh_, namedSurfaceIndex, maxEqOp<label>());
} }
//XXXXXXXXX
void Foam::meshRefinement::findCellZoneInsideWalk void Foam::meshRefinement::findCellZoneInsideWalk
( (
const labelList& locationSurfaces, // indices of surfaces with inside point const labelList& locationSurfaces, // indices of surfaces with inside point
@ -1446,7 +1460,6 @@ void Foam::meshRefinement::findCellZoneInsideWalk
} }
} }
} }
//XXXXXXXXX
bool Foam::meshRefinement::calcRegionToZone bool Foam::meshRefinement::calcRegionToZone
@ -1827,7 +1840,8 @@ void Foam::meshRefinement::baffleAndSplitMesh
const bool mergeFreeStanding, const bool mergeFreeStanding,
const dictionary& motionDict, const dictionary& motionDict,
Time& runTime, Time& runTime,
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
const point& keepPoint const point& keepPoint
) )
{ {
@ -1849,7 +1863,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
labelList ownPatch, neiPatch; labelList ownPatch, neiPatch;
getBafflePatches getBafflePatches
( (
globalToPatch, globalToMasterPatch,
neiLevel, neiLevel,
neiCc, neiCc,
@ -1899,7 +1913,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
motionDict, motionDict,
removeEdgeConnectedCells, removeEdgeConnectedCells,
perpendicularAngle, perpendicularAngle,
globalToPatch globalToMasterPatch
) )
//markFacesOnProblemCellsGeometric(motionDict) //markFacesOnProblemCellsGeometric(motionDict)
); );
@ -1917,7 +1931,7 @@ void Foam::meshRefinement::baffleAndSplitMesh
motionDict, motionDict,
removeEdgeConnectedCells, removeEdgeConnectedCells,
perpendicularAngle, perpendicularAngle,
globalToPatch globalToMasterPatch
) )
); );
forAll(facePatchTopo, faceI) forAll(facePatchTopo, faceI)
@ -2051,7 +2065,8 @@ void Foam::meshRefinement::baffleAndSplitMesh
Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
( (
const label nBufferLayers, const label nBufferLayers,
const labelList& globalToPatch, const labelList& globalToMasterPatch,
const labelList& globalToSlavePatch,
const point& keepPoint const point& keepPoint
) )
{ {
@ -2066,7 +2081,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
labelList ownPatch, neiPatch; labelList ownPatch, neiPatch;
getBafflePatches getBafflePatches
( (
globalToPatch, globalToMasterPatch,
neiLevel, neiLevel,
neiCc, neiCc,
@ -2129,9 +2144,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh
// Patch for exposed faces for lack of anything sensible. // Patch for exposed faces for lack of anything sensible.
label defaultPatch = 0; label defaultPatch = 0;
if (globalToPatch.size()) if (globalToMasterPatch.size())
{ {
defaultPatch = globalToPatch[0]; defaultPatch = globalToMasterPatch[0];
} }
for (label i = 0; i < nBufferLayers; i++) for (label i = 0; i < nBufferLayers; i++)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,12 +68,7 @@ int main(int argc, char *argv[])
"noFlow", "noFlow",
"suppress creating flow models (execFlowFunctionObjects only)" "suppress creating flow models (execFlowFunctionObjects only)"
); );
Foam::argList::addOption #include "addDictOption.H"
(
"dict",
"name",
"dictionary to use"
);
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"

View File

@ -57,14 +57,14 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian((rho*inv((((1)*A(U))+tDragDcu))),p) Gauss linear limited 0.333; laplacian((rho*inv((((1)*A(U))+tDragDcu))),p) Gauss linear limited corrected 0.333;
laplacian(Db,b) Gauss linear limited 0.333; laplacian(Db,b) Gauss linear limited corrected 0.333;
laplacian(Db,ft) Gauss linear limited 0.333; laplacian(Db,ft) Gauss linear limited corrected 0.333;
laplacian(Db,ha) Gauss linear limited 0.333; laplacian(Db,ha) Gauss linear limited corrected 0.333;
laplacian(Db,hau) Gauss linear limited 0.333; laplacian(Db,hau) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -74,7 +74,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -58,7 +58,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.5; default Gauss linear limited corrected 0.5;
} }
interpolationSchemes interpolationSchemes
@ -68,7 +68,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.5; default limited corrected 0.5;
} }
fluxRequired fluxRequired

View File

@ -10,7 +10,7 @@ application=`getApplication`
runApplication blockMesh runApplication blockMesh
runApplication topoSet -dict cRefine.topoSetDict runApplication topoSet -dict cRefine.topoSetDict
runApplication refineMesh -overwrite -dict runApplication refineMesh -overwrite -dict system/refineMeshDict
rm log.topoSet rm log.topoSet
runApplication topoSet -dict f.topoSetDict runApplication topoSet -dict f.topoSetDict

View File

@ -40,7 +40,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.5; default Gauss linear limited corrected 0.5;
} }
interpolationSchemes interpolationSchemes

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(nuEff,U) Gauss linear limited 0.333; laplacian(nuEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(kappaEff,T) Gauss linear limited 0.333; laplacian(kappaEff,T) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -32,7 +32,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(alpha,h) Gauss linear limited 0.333; laplacian(alpha,h) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -42,7 +42,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -32,7 +32,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(alpha,h) Gauss linear limited 0.333; laplacian(alpha,h) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -42,7 +42,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -32,7 +32,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(alpha,h) Gauss linear limited 0.333; laplacian(alpha,h) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -42,7 +42,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -32,7 +32,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(alpha,h) Gauss linear limited 0.333; laplacian(alpha,h) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -42,7 +42,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
}
// ************************************************************************* //

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -32,7 +32,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(alpha,h) Gauss linear limited 0.333; laplacian(alpha,h) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -42,7 +42,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
laplacian(alpha,h) Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
}
// ************************************************************************* //

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited corrected 0.333;
laplacian(Dp,p_rgh) Gauss linear limited 0.333; laplacian(Dp,p_rgh) Gauss linear limited corrected 0.333;
laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited corrected 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited corrected 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.333;
laplacian(DREff,R) Gauss linear limited 0.333; laplacian(DREff,R) Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -23,7 +23,7 @@ done
for i in bottomAir topAir for i in bottomAir topAir
do do
faceAgglomerate -region $i -dict viewFactorsDict > log.faceAgglomerate.$i 2>&1 faceAgglomerate -region $i -dict constant/viewFactorsDict > log.faceAgglomerate.$i 2>&1
done done
for i in bottomAir topAir for i in bottomAir topAir
@ -42,7 +42,7 @@ runApplication `getApplication`
# #
#for i in bottomAir topAir #for i in bottomAir topAir
#do #do
# mpirun -np 4 faceAgglomerate -region $i -dict viewFactorsDict -parallel> log.faceAgglomerate.$i 2>&1 # mpirun -np 4 faceAgglomerate -region $i -dict constant/viewFactorsDict -parallel> log.faceAgglomerate.$i 2>&1
#done #done
#for i in bottomAir topAir #for i in bottomAir topAir

View File

@ -39,7 +39,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.33; default Gauss linear limited corrected 0.33;
} }
interpolationSchemes interpolationSchemes
@ -49,7 +49,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.33; default limited corrected 0.33;
} }
fluxRequired fluxRequired

View File

@ -37,7 +37,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.5; default Gauss linear limited corrected 0.5;
} }
interpolationSchemes interpolationSchemes

View File

@ -42,12 +42,12 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.5; laplacian(muEff,U) Gauss linear limited corrected 0.5;
laplacian(DkEff,k) Gauss linear limited 0.5; laplacian(DkEff,k) Gauss linear limited corrected 0.5;
laplacian(DREff,R) Gauss linear limited 0.5; laplacian(DREff,R) Gauss linear limited corrected 0.5;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5; laplacian(DepsilonEff,epsilon) Gauss linear limited corrected 0.5;
laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5; laplacian((rho*(1|A(U))),p) Gauss linear limited corrected 0.5;
laplacian(alphaEff,e) Gauss linear limited 0.5; laplacian(alphaEff,e) Gauss linear limited corrected 0.5;
} }
interpolationSchemes interpolationSchemes

View File

@ -85,43 +85,7 @@ baffles
name baffles; name baffles;
type wall; type wall;
patchFields ${..master.patchFields}
{
epsilon
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
k
{
type kqRWallFunction;
value uniform 0;
}
nut
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
nuTilda
{
type zeroGradient;
}
p
{
type zeroGradient;
}
U
{
type fixedValue;
value uniform (0 0 0);
}
}
} }
} }
} }

View File

@ -15,7 +15,7 @@ runApplication mirrorMesh -overwrite
rm log.mirrorMesh rm log.mirrorMesh
rm log.changeDictionary rm log.changeDictionary
runApplication changeDictionary -instance system -dict system/changeDictionaryDict.Y runApplication changeDictionary -instance system -dict system/changeDictionaryDict.Y
runApplication mirrorMesh -overwrite runApplication mirrorMesh -overwrite

View File

@ -45,7 +45,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.33; default Gauss linear limited corrected 0.33;
} }
interpolationSchemes interpolationSchemes
@ -55,7 +55,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.33; default limited corrected 0.33;
} }
fluxRequired fluxRequired

View File

@ -35,7 +35,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.333; default Gauss linear limited corrected 0.333;
} }
interpolationSchemes interpolationSchemes
@ -45,7 +45,7 @@ interpolationSchemes
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited corrected 0.333;
} }
fluxRequired fluxRequired

View File

@ -18,7 +18,7 @@ refineMeshByCellSet()
topoSet > log.topoSet.$1 2>&1 topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1" echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 refineMesh -dict system/refineMeshDict -overwrite > log.refineMesh.$1 2>&1
fi fi
shift shift
done done

View File

@ -18,7 +18,7 @@ refineMeshByCellSet()
topoSet > log.topoSet.$1 2>&1 topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1" echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 refineMesh -dict sytem/refineMeshDict -overwrite > log.refineMesh.$1 2>&1
fi fi
shift shift
done done

View File

@ -17,7 +17,7 @@ refineMeshByCellSet()
topoSet > log.topoSet.$1 2>&1 topoSet > log.topoSet.$1 2>&1
echo "refining primary zone - $1" echo "refining primary zone - $1"
refineMesh -dict -overwrite > log.refineMesh.$1 2>&1 refineMesh -dict system/refineMeshDict -overwrite > log.refineMesh.$1 2>&1
fi fi
shift shift
done done

View File

@ -10,7 +10,7 @@ application=`getApplication`
runRefineMesh () runRefineMesh ()
{ {
echo "Running refineMesh on $PWD" echo "Running refineMesh on $PWD"
refineMesh -dict > log.refineMesh 2>&1 refineMesh -dict system/refineMeshDict > log.refineMesh 2>&1
} }
runApplication blockMesh runApplication blockMesh

View File

@ -65,10 +65,7 @@ baffles
type cyclic; type cyclic;
neighbourPatch porous_half0; neighbourPatch porous_half0;
patchFields ${..master.patchFields}
{
${...master.patchFields}
}
} }
} }
} }

View File

@ -21,5 +21,4 @@ turbulence on;
printCoeffs on; printCoeffs on;
// ************************************************************************* // // ************************************************************************* //

View File

@ -42,15 +42,15 @@ gradSchemes
laplacianSchemes laplacianSchemes
{ {
default Gauss linear limited 0.5; default Gauss linear limited corrected 0.5;
} }
snGradSchemes snGradSchemes
{ {
default none; default none;
snGrad(pd) limited 0.5; snGrad(pd) limited corrected 0.5;
snGrad(rho) limited 0.5; snGrad(rho) limited corrected 0.5;
snGrad(alpha1) limited 0.5; snGrad(alpha1) limited corrected 0.5;
} }
fluxRequired fluxRequired