mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -12,7 +12,7 @@ wmake snappyHexMesh
|
||||
if [ -d "$CGAL_ARCH_PATH" ]
|
||||
then
|
||||
foamyHexMesh/Allwmake
|
||||
foamyHex2DMesh/Allwmake
|
||||
foamyQuadMesh/Allwmake
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -2183,54 +2183,59 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
||||
pointIndexHitAndFeature(edHit, featureHit)
|
||||
);
|
||||
}
|
||||
// else if (firstPass)
|
||||
// {
|
||||
// label hitIndex = nearestEdgeHit.index();
|
||||
//
|
||||
// // Calc new edge location
|
||||
//// Foam::point newPt =
|
||||
//// 0.5
|
||||
//// *(
|
||||
//// nearestEdgeHit.hitPoint()
|
||||
//// + edHit.hitPoint()
|
||||
//// );
|
||||
//
|
||||
// pointIndexHit pHitOld =
|
||||
// edgeLocationTreePtr_().findNearest
|
||||
// (
|
||||
// nearestEdgeHit.hitPoint(), GREAT
|
||||
// );
|
||||
//
|
||||
// pointIndexHit pHitNew =
|
||||
// edgeLocationTreePtr_().findNearest
|
||||
// (
|
||||
// edHit.hitPoint(), GREAT
|
||||
// );
|
||||
//
|
||||
// if
|
||||
// (
|
||||
// pHitNew.hitPoint() - pHitOld.hitPoint()
|
||||
// )
|
||||
// {
|
||||
// edHit.setPoint(pHit.hitPoint());
|
||||
//
|
||||
// featureEdgeHits[hitIndex] =
|
||||
// pointIndexHitAndFeature(edHit, featureHit);
|
||||
//
|
||||
// existingEdgeLocations_[hitIndex] =
|
||||
// edHit.hitPoint();
|
||||
//
|
||||
// // Change edge location in featureEdgeHits
|
||||
// // remove index from edge tree
|
||||
// // reinsert new point into tree
|
||||
// edgeLocationTreePtr_().remove(hitIndex);
|
||||
// edgeLocationTreePtr_().insert
|
||||
// (
|
||||
// hitIndex,
|
||||
// hitIndex + 1
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
else if (firstPass)
|
||||
{
|
||||
label hitIndex = nearestEdgeHit.index();
|
||||
|
||||
// Calc new edge location
|
||||
Foam::point newPt =
|
||||
0.5
|
||||
*(
|
||||
nearestEdgeHit.hitPoint()
|
||||
+ edHit.hitPoint()
|
||||
);
|
||||
|
||||
pointIndexHit pHitOld =
|
||||
edgeLocationTreePtr_().findNearest
|
||||
(
|
||||
nearestEdgeHit.hitPoint(), GREAT
|
||||
);
|
||||
|
||||
pointIndexHit pHitNew =
|
||||
edgeLocationTreePtr_().findNearest
|
||||
(
|
||||
edHit.hitPoint(), GREAT
|
||||
);
|
||||
|
||||
if
|
||||
(
|
||||
magSqr(pHitNew.hitPoint() - edHit.hitPoint())
|
||||
< magSqr
|
||||
(
|
||||
pHitOld.hitPoint()
|
||||
- nearestEdgeHit.hitPoint()
|
||||
)
|
||||
)
|
||||
{
|
||||
edHit.setPoint(edHit.hitPoint());
|
||||
|
||||
featureEdgeHits[hitIndex] =
|
||||
pointIndexHitAndFeature(edHit, featureHit);
|
||||
|
||||
existingEdgeLocations_[hitIndex] =
|
||||
edHit.hitPoint();
|
||||
|
||||
// Change edge location in featureEdgeHits
|
||||
// remove index from edge tree
|
||||
// reinsert new point into tree
|
||||
edgeLocationTreePtr_().remove(hitIndex);
|
||||
edgeLocationTreePtr_().insert
|
||||
(
|
||||
hitIndex,
|
||||
hitIndex + 1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,13 +113,12 @@ Foam::Ostream& Foam::operator<<
|
||||
const CGAL::indexedVertex<Gt, Vb>& p
|
||||
)
|
||||
{
|
||||
os << p.point()
|
||||
<< p.index()
|
||||
<< static_cast<int>(p.type())
|
||||
<< p.procIndex()
|
||||
<< p.alignment()
|
||||
<< p.targetCellSize()
|
||||
<< token::SPACE
|
||||
os << p.point() << ' '
|
||||
<< p.index() << ' '
|
||||
<< static_cast<int>(p.type()) << ' '
|
||||
<< p.procIndex() << ' '
|
||||
<< p.alignment() << ' '
|
||||
<< p.targetCellSize() << ' '
|
||||
<< static_cast<int>(p.fixed());
|
||||
|
||||
return os;
|
||||
|
||||
@ -56,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"foamyHexMeshDict",
|
||||
args.executable() + "Dict",
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
|
||||
@ -7,6 +7,6 @@ insertSurfaceNearPointPairs.C
|
||||
insertBoundaryConformPointPairs.C
|
||||
CV2DIO.C
|
||||
shortEdgeFilter2D.C
|
||||
foamyHex2DMesh.C
|
||||
foamyQuadMesh.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/foamyHex2DMesh
|
||||
EXE = $(FOAM_APPBIN)/foamyQuadMesh
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
foamyHex2DMesh
|
||||
foamyQuadMesh
|
||||
|
||||
Description
|
||||
Conformal-Voronoi 2D extruding automatic mesher with grid or read
|
||||
@ -11,31 +11,18 @@ FoamFile
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object foamyHex2DMeshDict;
|
||||
object foamyQuadMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
geometry
|
||||
{
|
||||
laurence_clean_preciser.stl
|
||||
surfaceFile.stl
|
||||
{
|
||||
name laurence_clean_preciser;
|
||||
type closedTriSurfaceMesh;
|
||||
//type triSurfaceMesh;
|
||||
name surfaceFile;
|
||||
type triSurfaceMesh;
|
||||
}
|
||||
// refinementBox
|
||||
// {
|
||||
// type searchableBox;
|
||||
// min (-0.5 0.35 -1000);
|
||||
// max (-0.5 0.35 1000);
|
||||
// }
|
||||
// refinementSphere
|
||||
// {
|
||||
// type searchableSphere;
|
||||
// centre (0.85 0.4 0.0);
|
||||
// radius 0.01;
|
||||
// }
|
||||
}
|
||||
|
||||
surfaceConformation
|
||||
@ -66,10 +53,10 @@ surfaceConformation
|
||||
|
||||
geometryToConformTo
|
||||
{
|
||||
laurence_clean_preciser
|
||||
surfaceFile
|
||||
{
|
||||
featureMethod extendedFeatureEdgeMesh;
|
||||
extendedFeatureEdgeMesh "laurence_clean_preciser.extendedFeatureEdgeMesh";
|
||||
extendedFeatureEdgeMesh "surfaceFile.extendedFeatureEdgeMesh";
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +81,7 @@ motionControl
|
||||
|
||||
cellSizeControlGeometry
|
||||
{
|
||||
laurence_clean_preciser
|
||||
surfaceFile
|
||||
{
|
||||
priority 1;
|
||||
mode bothSides;
|
||||
@ -618,11 +618,11 @@ bool Foam::Time::writeObject
|
||||
)
|
||||
);
|
||||
|
||||
timeDict.add("value", value());
|
||||
timeDict.add("value", timeToUserTime(value()));
|
||||
timeDict.add("name", string(tmName));
|
||||
timeDict.add("index", timeIndex_);
|
||||
timeDict.add("deltaT", deltaT_);
|
||||
timeDict.add("deltaT0", deltaT0_);
|
||||
timeDict.add("deltaT", timeToUserTime(deltaT_));
|
||||
timeDict.add("deltaT0", timeToUserTime(deltaT0_));
|
||||
|
||||
timeDict.regIOobject::writeObject(fmt, ver, cmp);
|
||||
bool writeOK = objectRegistry::writeObject(fmt, ver, cmp);
|
||||
|
||||
@ -4,8 +4,12 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Source tutorial run functions
|
||||
. $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 collapseEdges -latestTime -collapseFaces
|
||||
runApplication checkMesh -latestTime -allGeometry -allTopology
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -7,6 +7,9 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Get the number of processors to run on from system/decomposeParDict
|
||||
nProc=$(getNumberOfProcessors)
|
||||
|
||||
# copy flange surface from resources folder
|
||||
cp $FOAM_TUTORIALS/resources/geometry/blob.stl.gz constant/triSurface/
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication decomposePar
|
||||
|
||||
@ -16,4 +19,5 @@ runParallel checkMesh $nProc -latestTime -allTopology -allGeometry
|
||||
|
||||
runApplication reconstructParMesh -latestTime
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-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
|
||||
@ -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;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# copy flange surface from resources folder
|
||||
cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
|
||||
|
||||
runApplication foamyHexMesh
|
||||
runApplication collapseEdges -latestTime -collapseFaces
|
||||
runApplication checkMesh -latestTime -allGeometry -allTopology
|
||||
|
||||
@ -7,6 +7,9 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Get the number of processors to run on from system/decomposeParDict
|
||||
nProc=$(getNumberOfProcessors)
|
||||
|
||||
# copy flange surface from resources folder
|
||||
cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
|
||||
|
||||
# Create tight-fitting background mesh
|
||||
runApplication blockMesh
|
||||
runApplication topoSet -dict system/topoSetDict-background
|
||||
|
||||
@ -4,6 +4,9 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# copy flange surface from resources folder
|
||||
cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
|
||||
|
||||
# Create tight-fitting background mesh
|
||||
runApplication blockMesh
|
||||
runApplication foamyHexMesh
|
||||
@ -16,4 +19,5 @@ system/collapseDict.org > system/collapseDict
|
||||
|
||||
runApplication collapseEdges -latestTime -collapseFaces
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
Folder to house tri-surfaces
|
||||
|
||||
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
|
||||
folder
|
||||
@ -22,7 +22,7 @@ FoamFile
|
||||
|
||||
geometry
|
||||
{
|
||||
flange.obj
|
||||
flange.stl
|
||||
{
|
||||
name flange;
|
||||
type triSurfaceMesh;
|
||||
|
||||
@ -4,24 +4,22 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
# Source tutorial run functions
|
||||
. $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 \
|
||||
constant/triSurface/coneAndSphere_clean.obj \
|
||||
constant/triSurface/cone.stl \
|
||||
-inside '(0 -0.5 0)' \
|
||||
constant/triSurface/coneAndSphere_clean_orient.obj
|
||||
mv log.surfaceOrient log.surfaceOrient.coneAndSphere
|
||||
constant/triSurface/cone_orient.stl
|
||||
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
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,11 +19,32 @@ FoamFile
|
||||
|
||||
geometry
|
||||
{
|
||||
// Internal shape
|
||||
coneAndSphere_clean_orient.obj
|
||||
sphere_orient.stl
|
||||
{
|
||||
name coneAndSphere;
|
||||
name sphere;
|
||||
type triSurfaceMesh;
|
||||
|
||||
regions
|
||||
{
|
||||
ascii
|
||||
{
|
||||
name sphere_patch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cone_orient.stl
|
||||
{
|
||||
name cone;
|
||||
type triSurfaceMesh;
|
||||
|
||||
regions
|
||||
{
|
||||
ascii
|
||||
{
|
||||
name cone_patch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Outside of domain
|
||||
@ -43,27 +64,53 @@ surfaceConformation
|
||||
|
||||
featurePointControls
|
||||
{
|
||||
specialiseFeaturePoints on;
|
||||
edgeAiming on;
|
||||
specialiseFeaturePoints off;
|
||||
edgeAiming off;
|
||||
guardFeaturePoints off;
|
||||
snapFeaturePoints on;
|
||||
snapFeaturePoints off;
|
||||
circulateEdges off;
|
||||
}
|
||||
|
||||
// Geometry to mesh to
|
||||
geometryToConformTo
|
||||
{
|
||||
coneAndSphere
|
||||
cone
|
||||
{
|
||||
featureMethod extractFeatures;
|
||||
includedAngle 140;
|
||||
featureMethod extractFeatures;
|
||||
includedAngle 140;
|
||||
|
||||
patchInfo
|
||||
{
|
||||
type wall;
|
||||
inGroups (groupConeAndSphere);
|
||||
}
|
||||
}
|
||||
|
||||
sphere
|
||||
{
|
||||
featureMethod none;
|
||||
|
||||
patchInfo
|
||||
{
|
||||
type wall;
|
||||
inGroups (groupConeAndSphere);
|
||||
}
|
||||
}
|
||||
|
||||
domain
|
||||
{
|
||||
featureMethod extractFeatures;
|
||||
includedAngle 100;
|
||||
mode outside;
|
||||
featureMethod extractFeatures;
|
||||
includedAngle 100;
|
||||
mode outside;
|
||||
}
|
||||
}
|
||||
|
||||
additionalFeatures
|
||||
{
|
||||
coneSphereIntersection
|
||||
{
|
||||
featureMethod extendedFeatureEdgeMesh;
|
||||
extendedFeatureEdgeMesh "cone_orient_sphere_orient_intersection.extendedFeatureEdgeMesh";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,7 +118,7 @@ surfaceConformation
|
||||
|
||||
initialPoints
|
||||
{
|
||||
initialPointsMethod autoDensity;
|
||||
initialPointsMethod autoDensity;
|
||||
|
||||
autoDensityCoeffs
|
||||
{
|
||||
@ -97,7 +144,27 @@ motionControl
|
||||
|
||||
shapeControlFunctions
|
||||
{
|
||||
coneAndSphere
|
||||
sphere
|
||||
{
|
||||
type searchableSurfaceControl;
|
||||
priority 2;
|
||||
mode inside;
|
||||
|
||||
surfaceCellSizeFunction uniformValue;
|
||||
uniformValueCoeffs
|
||||
{
|
||||
surfaceCellSizeCoeff 0.25;
|
||||
}
|
||||
|
||||
cellSizeFunction linearDistance;
|
||||
linearDistanceCoeffs
|
||||
{
|
||||
distanceCellSizeCoeff 1;
|
||||
distanceCoeff 2;
|
||||
}
|
||||
}
|
||||
|
||||
cone
|
||||
{
|
||||
type searchableSurfaceControl;
|
||||
priority 1;
|
||||
@ -106,7 +173,7 @@ motionControl
|
||||
surfaceCellSizeFunction uniformValue;
|
||||
uniformValueCoeffs
|
||||
{
|
||||
surfaceCellSizeCoeff 0.75;
|
||||
surfaceCellSizeCoeff 1;
|
||||
}
|
||||
|
||||
cellSizeFunction uniform;
|
||||
|
||||
@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
cp system/controlDict.mesher system/controlDict
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
runApplication foamyHex2DMesh -overwrite
|
||||
runApplication foamyQuadMesh -overwrite
|
||||
runApplication extrude2DMesh -overwrite polyMesh2D
|
||||
runApplication checkMesh -allGeometry -allTopology -constant -noZero
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object foamyHex2DMeshDict;
|
||||
object foamyQuadMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
runApplication foamyHex2DMesh -overwrite
|
||||
runApplication foamyQuadMesh -overwrite
|
||||
runApplication extrude2DMesh -overwrite MeshedSurface
|
||||
runApplication checkMesh -allGeometry -allTopology -constant -noZero
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object foamyHex2DMeshDict;
|
||||
object foamyQuadMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
runApplication foamyHex2DMesh -overwrite
|
||||
runApplication foamyQuadMesh -overwrite
|
||||
runApplication extrude2DMesh -overwrite polyMesh2D
|
||||
runApplication checkMesh -allGeometry -allTopology -constant -noZero
|
||||
|
||||
@ -11,7 +11,7 @@ FoamFile
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object foamyHex2DMeshDict;
|
||||
object foamyQuadMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
BIN
tutorials/resources/geometry/blob.stl.gz
Normal file
BIN
tutorials/resources/geometry/blob.stl.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user