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

This commit is contained in:
laurence
2013-06-04 14:58:41 +01:00
14 changed files with 234 additions and 21591 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-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,6 +35,116 @@ Description
#include "meshTools.H" #include "meshTools.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void checkConnectedAgglomeration
(
const lduMesh& mesh,
const labelUList& restrict,
const label nCoarse
)
{
if (mesh.lduAddr().size() != restrict.size())
{
FatalErrorIn
(
"checkConnectedAgglomeration(const lduMesh&, const labelList&)"
) << "nCells:" << mesh.lduAddr().size()
<< " agglom:" << restrict.size()
<< abort(FatalError);
}
// Seed (master) for every region
labelList regionToMaster(nCoarse, -1);
labelList master(mesh.lduAddr().size(), -1);
forAll(restrict, cellI)
{
label region = restrict[cellI];
if (regionToMaster[region] == -1)
{
// Set cell to be master for region
//Pout<< "For region " << region
// << " allocating local master " << cellI
// << endl;
regionToMaster[region] = cellI;
master[cellI] = cellI;
}
}
// Now loop and transport master through region
const labelUList& lower = mesh.lduAddr().lowerAddr();
const labelUList& upper = mesh.lduAddr().upperAddr();
while (true)
{
label nChanged = 0;
forAll(lower, faceI)
{
label own = lower[faceI];
label nei = upper[faceI];
if (restrict[own] == restrict[nei])
{
// Region-internal face
if (master[own] != -1)
{
if (master[nei] == -1)
{
master[nei] = master[own];
nChanged++;
}
else if (master[nei] != master[own])
{
FatalErrorIn("checkConnectedAgglomeration(..)")
<< "problem" << abort(FatalError);
}
}
else if (master[nei] != -1)
{
master[own] = master[nei];
nChanged++;
}
}
}
reduce(nChanged, sumOp<label>());
if (nChanged == 0)
{
break;
}
}
// Check that master is set for all cells
boolList singleRegion(nCoarse, true);
label nSet = nCoarse;
forAll(master, cellI)
{
if (master[cellI] == -1)
{
label region = restrict[cellI];
if (singleRegion[region] == true)
{
singleRegion[region] = false;
nSet--;
}
}
}
label totalNCoarse = returnReduce(nCoarse, sumOp<label>());
label totalNVisited = returnReduce(nSet, sumOp<label>());
if (totalNVisited < totalNCoarse)
{
WarningIn("checkConnectedAgglomeration(..)")
<< "out of " << totalNCoarse
<< " agglomerated cells have " << totalNCoarse-totalNVisited
<< " cells that are not a single connected region" << endl;
}
}
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -117,6 +227,14 @@ int main(int argc, char *argv[])
<< " agglomerated size : " << " agglomerated size : "
<< returnReduce(coarseSize, sumOp<label>()) << endl; << returnReduce(coarseSize, sumOp<label>()) << endl;
checkConnectedAgglomeration
(
agglom.meshLevel(level),
addr,
coarseSize
);
forAll(addr, fineI) forAll(addr, fineI)
{ {
const labelList& cellLabels = coarseToCell[fineI]; const labelList& cellLabels = coarseToCell[fineI];

View File

@ -222,14 +222,6 @@ int main(int argc, char *argv[])
} }
Info<< "Writing surface to " << outFileName << " ..." << endl; Info<< "Writing surface to " << outFileName << " ..." << endl;
// meshedSurface
// (
// xferMove(newPoints),
// xferCopy(surf1.localFaces()),
// xferCopy(surf1.surfZones())
// ).write(outFileName);
surf1.write(outFileName); surf1.write(outFileName);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -457,7 +457,7 @@ hline
echo "$COL1 $COL2 $COL3" echo "$COL1 $COL2 $COL3"
hline hline
reportExecutable flex reportExecutable flex
reportExecutable gcc reportExecutable "$WM_CC"
reportExecutable gzip reportExecutable gzip
if [ "$OSTYPE" = Linux ] if [ "$OSTYPE" = Linux ]
then then

View File

@ -147,7 +147,7 @@ checkIllegalCode()
do do
case "$f" in case "$f" in
# exclude potential makefiles # exclude potential makefiles
(*[Mm]akefile* | wmake/rules/* | *.f* | *.v[cf]proj | *.pdf | *.png | *.html | *.gif | *.css) (*[Mm]akefile* | wmake/rules/* | *.f* | *.v[cf]proj | *.pdf | *.png | *.html | *.gif | *.css | *.gz)
;; ;;
(*) (*)
fileType=`file -b $f` fileType=`file -b $f`

View File

@ -105,3 +105,30 @@ Boundary conditions must then be applied to all geometric patches in the usual,
manner, and the cases can be executed in parallel (as shown when running the manner, and the cases can be executed in parallel (as shown when running the
Allrun-parallel script) without any speacial treatment, i.e. the case set-up is Allrun-parallel script) without any speacial treatment, i.e. the case set-up is
the same as when operating in serial mode. the same as when operating in serial mode.
checkMesh
---------
checkMesh will see the 'duplicate' boundary faces but does not know about
the area factors so will complain:
***Boundary openness (-0.0103092 2.3845e-17 3.80774e-17) possible hole in boundary description.
***Open cells found, max cell openness: 0.333333, number of open cells 136
<<Writing 136 non closed cells to set nonClosedCells
As long as these non-closed cells are on the ACMI they can be ignored.
paraFoam
--------
- display: it will not display the outside of the ACMI, there will be a hole.
- cuttingPlanes: they leave out the duplicate faces (i.e. the cells on
the ACMI patches)
- interpolation: the interpolation does not take into account the
area-weights on the ACMI.
pointFields
-----------
Same as paraFoam: the interpolation does not take into account the
area-weights on the ACMI.

View File

@ -4,8 +4,12 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy flange surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/blob.stl.gz constant/triSurface/
runApplication foamyHexMesh runApplication foamyHexMesh
runApplication collapseEdges -latestTime -collapseFaces runApplication collapseEdges -latestTime -collapseFaces
runApplication checkMesh -latestTime -allGeometry -allTopology runApplication checkMesh -latestTime -allGeometry -allTopology
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -7,6 +7,9 @@ cd ${0%/*} || exit 1 # run from this directory
# Get the number of processors to run on from system/decomposeParDict # Get the number of processors to run on from system/decomposeParDict
nProc=$(getNumberOfProcessors) nProc=$(getNumberOfProcessors)
# copy flange surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/blob.stl.gz constant/triSurface/
runApplication blockMesh runApplication blockMesh
runApplication decomposePar runApplication decomposePar
@ -16,4 +19,5 @@ runParallel checkMesh $nProc -latestTime -allTopology -allGeometry
runApplication reconstructParMesh -latestTime runApplication reconstructParMesh -latestTime
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,18 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication foamyHexMesh
# Change collapseEdges to only do one iteration
cp system/collapseDict system/collapseDict.org
sed -e s/"\(maximumIterations[ \t]*\)\([0-9]*\);"/"\1 1;"/g \
system/collapseDict.org > system/collapseDict
runApplication collapseEdges -latestTime -collapseFaces
# ----------------------------------------------------------------- end-of-file

View File

@ -1,28 +0,0 @@
/*--------------------------------*- 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 polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1
(
walls
{
type wall;
nFaces 638;
startFace 2948;
}
)
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
Folder to house tri-surfaces
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
folder

File diff suppressed because it is too large Load Diff

View File

@ -4,24 +4,22 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
# Remove any small triangles (edges < 1e-4, sliver with Q < 1e-6) from surface
# (cvMesh will try to conform to every feature).
runApplication surfaceClean \
constant/triSurface/coneAndSphere.obj \
1e-4 1e-6 \
constant/triSurface/coneAndSphere_clean.obj
mv log.surfaceClean log.surfaceClean.coneAndSphere
# Orient so point to be meshed is inside surface
runApplication surfaceOrient \ runApplication surfaceOrient \
constant/triSurface/coneAndSphere_clean.obj \ constant/triSurface/cone.stl \
-inside '(0 -0.5 0)' \ -inside '(0 -0.5 0)' \
constant/triSurface/coneAndSphere_clean_orient.obj constant/triSurface/cone_orient.stl
mv log.surfaceOrient log.surfaceOrient.coneAndSphere mv log.surfaceOrient log.surfaceOrient.cone
unset FOAM_SIGFPE runApplication surfaceOrient \
constant/triSurface/sphere.stl \
-inside '(0 -0.5 0)' \
constant/triSurface/sphere_orient.stl
mv log.surfaceOrient log.surfaceOrient.sphere
runApplication surfaceBooleanFeatures intersection \
constant/triSurface/cone_orient.stl \
constant/triSurface/sphere_orient.stl
# Generate aligned points (in constant/internalDelaunayVertices) and a
# mesh from that.
runApplication foamyHexMesh runApplication foamyHexMesh

View File

@ -19,10 +19,15 @@ FoamFile
geometry geometry
{ {
// Internal shape sphere_orient.stl
coneAndSphere_clean_orient.obj
{ {
name coneAndSphere; name sphere;
type triSurfaceMesh;
}
cone_orient.stl
{
name cone;
type triSurfaceMesh; type triSurfaceMesh;
} }
@ -43,27 +48,53 @@ surfaceConformation
featurePointControls featurePointControls
{ {
specialiseFeaturePoints on; specialiseFeaturePoints off;
edgeAiming on; edgeAiming off;
guardFeaturePoints off; guardFeaturePoints off;
snapFeaturePoints on; snapFeaturePoints off;
circulateEdges off; circulateEdges off;
} }
// Geometry to mesh to // Geometry to mesh to
geometryToConformTo geometryToConformTo
{ {
coneAndSphere cone
{ {
featureMethod extractFeatures; featureMethod extractFeatures;
includedAngle 140; includedAngle 140;
patchInfo
{
type wall;
inGroups (groupConeAndSphere);
}
}
sphere
{
featureMethod none;
patchInfo
{
type wall;
inGroups (groupConeAndSphere);
}
} }
domain domain
{ {
featureMethod extractFeatures; featureMethod extractFeatures;
includedAngle 100; includedAngle 100;
mode outside; mode outside;
}
}
additionalFeatures
{
coneSphereIntersection
{
featureMethod extendedFeatureEdgeMesh;
extendedFeatureEdgeMesh "cone_orient_sphere_orient_intersection.extendedFeatureEdgeMesh";
} }
} }
} }
@ -71,7 +102,7 @@ surfaceConformation
initialPoints initialPoints
{ {
initialPointsMethod autoDensity; initialPointsMethod autoDensity;
autoDensityCoeffs autoDensityCoeffs
{ {
@ -97,7 +128,24 @@ motionControl
shapeControlFunctions shapeControlFunctions
{ {
coneAndSphere sphere
{
type searchableSurfaceControl;
priority 1;
mode bothSides;
surfaceCellSizeFunction uniformValue;
uniformValueCoeffs
{
surfaceCellSizeCoeff 0.5;
}
cellSizeFunction uniform;
uniformCoeffs
{}
}
cone
{ {
type searchableSurfaceControl; type searchableSurfaceControl;
priority 1; priority 1;

Binary file not shown.