Commit 59eb1f4d authored by Henry's avatar Henry
Browse files
parents b6f88972 1025e4dd
...@@ -60,8 +60,8 @@ doc/[Dd]oxygen/man ...@@ -60,8 +60,8 @@ doc/[Dd]oxygen/man
# untracked configuration files # untracked configuration files
/etc/prefs.csh /etc/prefs.csh
/etc/prefs.sh /etc/prefs.sh
/etc/config/*.csh /etc/config/prefs.csh
/etc/config/*.sh /etc/config/prefs.sh
# source packages - anywhere # source packages - anywhere
*.tar.bz2 *.tar.bz2
......
...@@ -241,9 +241,11 @@ ...@@ -241,9 +241,11 @@
- works in parallel - works in parallel
+ =snappyHexMesh=: + =snappyHexMesh=:
+ extrude across multi-processor boundaries + extrude across multi-processor boundaries
+ preserve faceZones during layering + preserve faceZones shape during layering
+ combining patch faces after snapping + combining coincident patch faces is now default after snapping
+ *Warning*: + *Warning*:
- snapControls::tolerance setting fixed w.r.t. 17x. Is the
multiplication to calculate the local search distance for nearest.
- minMedianAxisAngle angle fixed w.r.t. 17x. Set to - minMedianAxisAngle angle fixed w.r.t. 17x. Set to
90 to get same behaviour as 130 in 17x. 90 to get same behaviour as 130 in 17x.
- nGrow did not work in 17x. Set to 0 - nGrow did not work in 17x. Set to 0
...@@ -308,6 +310,8 @@ ...@@ -308,6 +310,8 @@
+ multipleBoxes, hotBoxes, panel, evaporationTest + multipleBoxes, hotBoxes, panel, evaporationTest
+ =interDyMFoam= tutorials: + =interDyMFoam= tutorials:
+ testTubeMixer: showcases =solidBodyMotionFunction= + testTubeMixer: showcases =solidBodyMotionFunction=
+ =snappyHexMesh= tutorials:
+ flange: demonstration of feature lines in snappyHexMesh
* Other * Other
+ compilable with =clang= + compilable with =clang=
......
...@@ -49,6 +49,10 @@ int main(int argc, char *argv[]) ...@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
Info<< nl << "Calculating potential flow" << endl; Info<< nl << "Calculating potential flow" << endl;
// Since solver contains no time loop it would never execute
// function objects so do it ourselves.
runTime.functionObjects().start();
adjustPhi(phi, U, p); adjustPhi(phi, U, p);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
...@@ -99,6 +103,9 @@ int main(int argc, char *argv[]) ...@@ -99,6 +103,9 @@ int main(int argc, char *argv[])
p.write(); p.write();
} }
runTime.functionObjects().end();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl; << nl << endl;
......
...@@ -2,7 +2,7 @@ ...@@ -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) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -453,6 +453,7 @@ void Foam::createShellMesh::setRefinement ...@@ -453,6 +453,7 @@ void Foam::createShellMesh::setRefinement
label region0 = pointRegions_[eFaces[0]][fp0]; label region0 = pointRegions_[eFaces[0]][fp0];
label region1 = pointRegions_[eFaces[0]][fp1]; label region1 = pointRegions_[eFaces[0]][fp1];
// Pick up points with correct normal
if (layerI == 0) if (layerI == 0)
{ {
newF[0] = f[fp0]; newF[0] = f[fp0];
...@@ -468,6 +469,22 @@ void Foam::createShellMesh::setRefinement ...@@ -468,6 +469,22 @@ void Foam::createShellMesh::setRefinement
newF[3] = addedPoints[nLayers*region0+layerI]; newF[3] = addedPoints[nLayers*region0+layerI];
} }
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face ordering
// but with NOORDERING we have to do it ourselves.
if (f[fp0] != e[0])
{
// rotate one back to get newF[1] (originating from e[0])
// into newF[0]
label v0 = newF[0];
for (label i = 0; i < newF.size()-1; i++)
{
newF[i] = newF[newF.fcIndex(i)];
}
newF.last() = v0;
}
label minCellI = addedCells[nLayers*eFaces[0]+layerI]; label minCellI = addedCells[nLayers*eFaces[0]+layerI];
label maxCellI; label maxCellI;
label patchI; label patchI;
...@@ -569,6 +586,21 @@ void Foam::createShellMesh::setRefinement ...@@ -569,6 +586,21 @@ void Foam::createShellMesh::setRefinement
newF[3] = addedPoints[nLayers*region0+layerI]; newF[3] = addedPoints[nLayers*region0+layerI];
} }
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face
// ordering but with NOORDERING we have to do it ourselves.
if (f[fp0] != e[0])
{
// rotate one back to get newF[1] (originating
// from e[0]) into newF[0].
label v0 = newF[0];
for (label i = 0; i < newF.size()-1; i++)
{
newF[i] = newF[newF.fcIndex(i)];
}
newF.last() = v0;
}
////if (ePatches.size() == 0) ////if (ePatches.size() == 0)
//{ //{
// Pout<< "Adding from MULTI face:" // Pout<< "Adding from MULTI face:"
......
...@@ -220,7 +220,7 @@ snapControls ...@@ -220,7 +220,7 @@ snapControls
//- Maximum relative distance for points to be attracted by surface. //- Maximum relative distance for points to be attracted by surface.
// True distance is this factor times local maximum edge length. // True distance is this factor times local maximum edge length.
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance) // Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
tolerance 2.0; tolerance 1.0;
//- Number of mesh displacement relaxation iterations. //- Number of mesh displacement relaxation iterations.
nSolveIter 30; nSolveIter 30;
...@@ -228,6 +228,10 @@ snapControls ...@@ -228,6 +228,10 @@ snapControls
//- Maximum number of snapping relaxation iterations. Should stop //- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh. // before upon reaching a correct mesh.
nRelaxIter 5; nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
//nFeatureSnapIter 10;
} }
...@@ -258,6 +262,9 @@ addLayersControls ...@@ -258,6 +262,9 @@ addLayersControls
//- Wanted thickness of final added cell layer. If multiple layers //- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// is the thickness of the layer furthest away from the wall. // is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter. // See relativeSizes parameter.
finalLayerThickness 0.3; finalLayerThickness 0.3;
...@@ -410,7 +417,7 @@ debug 0; ...@@ -410,7 +417,7 @@ debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh. // Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this. // Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6; mergeTolerance 1e-6;
// ************************************************************************* // // ************************************************************************* //
...@@ -144,10 +144,30 @@ bool writeZones(const word& name, const fileName& meshDir, Time& runTime) ...@@ -144,10 +144,30 @@ bool writeZones(const word& name, const fileName& meshDir, Time& runTime)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
timeSelector::addOptions(); timeSelector::addOptions();
argList::addBoolOption
(
"noConstant",
"exclude the 'constant/' dir in the times list"
);
# include "addRegionOption.H" # include "addRegionOption.H"
# include "setRootCase.H" # include "setRootCase.H"
// enable noConstant by switching
if (!args.optionFound("noConstant"))
{
args.setOption("constant", "");
}
else
{
args.unsetOption("constant");
Info<< "Excluding the constant directory." << nl << endl;
}
# include "createTime.H" # include "createTime.H"
// Make sure we do not use the master-only reading since we read // Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries. // fields (different per processor) as dictionaries.
regIOobject::fileModificationChecking = regIOobject::timeStamp; regIOobject::fileModificationChecking = regIOobject::timeStamp;
......
...@@ -98,6 +98,44 @@ autoPtr<fvMesh> createMesh ...@@ -98,6 +98,44 @@ autoPtr<fvMesh> createMesh
xferCopy(labelList()), xferCopy(labelList()),
false false
); );
// Add some dummy zones so upon reading it does not read them
// from the undecomposed case. Should be done as extra argument to
// regIOobject::readStream?
List<pointZone*> pz
(
1,
new pointZone
(
"dummyPointZone",
labelList(0),
0,
dummyMesh.pointZones()
)
);
List<faceZone*> fz
(
1,
new faceZone
(
"dummyFaceZone",
labelList(0),
boolList(0),
0,
dummyMesh.faceZones()
)
);
List<cellZone*> cz
(
1,
new cellZone
(
"dummyCellZone",
labelList(0),
0,
dummyMesh.cellZones()
)
);
dummyMesh.addZones(pz, fz, cz);
//Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath() //Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
// << endl; // << endl;
dummyMesh.write(); dummyMesh.write();
...@@ -239,7 +277,11 @@ autoPtr<fvMesh> createMesh ...@@ -239,7 +277,11 @@ autoPtr<fvMesh> createMesh
if (!haveMesh) if (!haveMesh)
{ {
// Add the zones // Add the zones. Make sure to remove the old dummy ones first
mesh.pointZones().clear();
mesh.faceZones().clear();
mesh.cellZones().clear();
List<pointZone*> pz(pointZoneNames.size()); List<pointZone*> pz(pointZoneNames.size());
forAll(pointZoneNames, i) forAll(pointZoneNames, i)
{ {
...@@ -389,6 +431,12 @@ void printMeshData(const polyMesh& mesh) ...@@ -389,6 +431,12 @@ void printMeshData(const polyMesh& mesh)
globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces()); globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces());
label maxProcCells = 0;
label totProcFaces = 0;
label maxProcPatches = 0;
label totProcPatches = 0;
label maxProcFaces = 0;
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label procI = 0; procI < Pstream::nProcs(); procI++)
{ {
Info<< endl Info<< endl
...@@ -413,7 +461,32 @@ void printMeshData(const polyMesh& mesh) ...@@ -413,7 +461,32 @@ void printMeshData(const polyMesh& mesh)
<< " Number of processor faces = " << nProcFaces << nl << " Number of processor faces = " << nProcFaces << nl
<< " Number of boundary faces = " << " Number of boundary faces = "
<< globalBoundaryFaces.localSize(procI) << endl; << globalBoundaryFaces.localSize(procI) << endl;
maxProcCells = max(maxProcCells, globalCells.localSize(procI));
totProcFaces += nProcFaces;
totProcPatches += nei.size();
maxProcPatches = max(maxProcPatches, nei.size());
maxProcFaces = max(maxProcFaces, nProcFaces);
} }
// Stats
scalar avgProcCells = scalar(globalCells.size())/Pstream::nProcs();
scalar avgProcPatches = scalar(totProcPatches)/Pstream::nProcs();
scalar avgProcFaces = scalar(totProcFaces)/Pstream::nProcs();
Info<< nl
<< "Number of processor faces = " << totProcFaces/2 << nl
<< "Max number of cells = " << maxProcCells
<< " (" << 100.0*(maxProcCells-avgProcCells)/avgProcCells
<< "% above average " << avgProcCells << ")" << nl
<< "Max number of processor patches = " << maxProcPatches
<< " (" << 100.0*(maxProcPatches-avgProcPatches)/avgProcPatches
<< "% above average " << avgProcPatches << ")" << nl
<< "Max number of faces between processors = " << maxProcFaces
<< " (" << 100.0*(maxProcFaces-avgProcFaces)/avgProcFaces
<< "% above average " << avgProcFaces << ")" << nl
<< endl;
} }
...@@ -641,6 +714,16 @@ int main(int argc, char *argv[]) ...@@ -641,6 +714,16 @@ int main(int argc, char *argv[])
); );
# include "setRootCase.H" # include "setRootCase.H"
if (env("FOAM_SIGFPE"))
{
WarningIn(args.executable())
<< "Detected floating point exception trapping (FOAM_SIGFPE)."
<< " This might give" << nl
<< " problems when mapping fields. Switch it off in case"
<< " of problems." << endl;
}
// Create processor directory if non-existing // Create processor directory if non-existing
if (!Pstream::master() && !isDir(args.path())) if (!Pstream::master() && !isDir(args.path()))
{ {
...@@ -906,7 +989,7 @@ int main(int argc, char *argv[]) ...@@ -906,7 +989,7 @@ int main(int argc, char *argv[])
// Debugging: Create additional volField that will be mapped. // Debugging: Create additional volField that will be mapped.
// Used to test correctness of mapping // Used to test correctness of mapping
volVectorField mapCc("mapCc", 1*mesh.C()); //volVectorField mapCc("mapCc", 1*mesh.C());
// Global matching tolerance // Global matching tolerance
const scalar tolDim = getMergeDistance const scalar tolDim = getMergeDistance
...@@ -948,7 +1031,7 @@ int main(int argc, char *argv[]) ...@@ -948,7 +1031,7 @@ int main(int argc, char *argv[])
// Debugging: test mapped cellcentre field. // Debugging: test mapped cellcentre field.
compareFields(tolDim, mesh.C(), mapCc); //compareFields(tolDim, mesh.C(), mapCc);
// Print nice message // Print nice message
// ~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~
......
...@@ -37,7 +37,7 @@ usage() { ...@@ -37,7 +37,7 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: ${0##*/} [OPTION] Usage: ${0##*/} [OPTION] [PARAVIEW_OPTION]
options: options:
-block use blockMesh reader (uses .blockMesh extension) -block use blockMesh reader (uses .blockMesh extension)
-builtin use VTK builtin OpenFOAM reader (uses .foam extension) -builtin use VTK builtin OpenFOAM reader (uses .foam extension)
...@@ -47,6 +47,9 @@ options: ...@@ -47,6 +47,9 @@ options:
-touchAll create .blockMesh, .OpenFOAM files (and for all regions) -touchAll create .blockMesh, .OpenFOAM files (and for all regions)
-help print the usage -help print the usage
paraview options start with a double dashes
* start paraview $ParaView_VERSION with the OpenFOAM libraries * start paraview $ParaView_VERSION with the OpenFOAM libraries
USAGE USAGE
...@@ -57,7 +60,7 @@ USAGE ...@@ -57,7 +60,7 @@ USAGE
# to clean up # to clean up
unset FOAM_ABORT unset FOAM_ABORT
unset regionName touchOpt unset regionName optTouch
# reader extension # reader extension
extension=OpenFOAM extension=OpenFOAM
...@@ -88,12 +91,19 @@ do ...@@ -88,12 +91,19 @@ do
shift 2 shift 2
;; ;;
-touch) -touch)
touchOpt=true optTouch=true
shift shift
;; ;;
-touchAll) -touchAll)
touchOpt=all optTouch=all
shift
;;
--)
shift shift
break # stop here, treat balance as paraview options
;;
--*)
break # stop here, treat this and balance as paraview options
;; ;;
*) *)
usage "unknown option/argument: '$*'" usage "unknown option/argument: '$*'"
...@@ -101,6 +111,28 @@ do ...@@ -101,6 +111,28 @@ do
esac esac
done done
#
# check for --data=... argument
#
hasDataArg()
{
hasData=false
while [ "$#" -gt 0 ]
do
case "$1" in
(--data=*)
hasData=true
break
;;
esac
shift
done
}
hasDataArg $@
# get a sensible caseName from the directory name # get a sensible caseName from the directory name
caseName=${PWD##*/} caseName=${PWD##*/}
caseFile="$caseName.$extension" caseFile="$caseName.$extension"
...@@ -112,7 +144,7 @@ then ...@@ -112,7 +144,7 @@ then
fvControls="$fvControls/$regionName" fvControls="$fvControls/$regionName"
fi fi
case "${touchOpt:-false}" in case "${optTouch:-false}" in
all) all)
extension=OpenFOAM extension=OpenFOAM
if [ -f constant/polyMesh/blockMeshDict ] if [ -f constant/polyMesh/blockMeshDict ]
...@@ -149,33 +181,56 @@ case "$caseName" in ...@@ -149,33 +181,56 @@ case "$caseName" in
esac esac
# if [ "${hasData:-false}" = true ]
# check existence of essential files then
#
case $extension in
blockMesh)
for check in system/controlDict constant/polyMesh/blockMeshDict
do
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
done
;;
builtin | OpenFOAM) # has --data=.., send directly to paraview
for check in system/controlDict $fvControls/fvSchemes $fvControls/fvSolution exec paraview "$@"
do
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'" else
done
;; # check existence of essential files
esac warn="WARN file does not exist:"
case $extension in
blockMesh)
for check in \
system/controlDict \
constant/polyMesh/blockMeshDict \
;
do
[ -s "$parentDir/$check" ] || {
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
builtin | OpenFOAM)
for check in \
system/controlDict \
$fvControls/fvSchemes \
$fvControls/fvSolution \
;
do
[ -s "$parentDir/$check" ] || {
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
esac
# only create/remove caseFile if it didn't already exist
[ -e $caseFile ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"