mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Update cellShapeControl to work with 2D mesher and remove dependency on the Triangulation
This commit is contained in:
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -174,12 +174,7 @@ Foam::tmp<Foam::triadField> buildAlignmentField(const T& mesh)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
alignments[vit->index()] = triad
|
alignments[vit->index()] = vit->alignment();
|
||||||
(
|
|
||||||
vit->alignment().x(),
|
|
||||||
vit->alignment().y(),
|
|
||||||
vit->alignment().z()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tAlignments;
|
return tAlignments;
|
||||||
@ -214,6 +209,61 @@ Foam::tmp<Foam::pointField> buildPointField(const T& mesh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void refine
|
||||||
|
(
|
||||||
|
cellShapeControlMesh& mesh,
|
||||||
|
const conformationSurfaces& geometryToConformTo,
|
||||||
|
const label maxRefinementIterations,
|
||||||
|
const scalar defaultCellSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (label iter = 0; iter < maxRefinementIterations; ++iter)
|
||||||
|
{
|
||||||
|
DynamicList<point> ptsToInsert;
|
||||||
|
|
||||||
|
for
|
||||||
|
(
|
||||||
|
CellSizeDelaunay::Finite_cells_iterator cit =
|
||||||
|
mesh.finite_cells_begin();
|
||||||
|
cit != mesh.finite_cells_end();
|
||||||
|
++cit
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const point newPoint =
|
||||||
|
topoint
|
||||||
|
(
|
||||||
|
CGAL::centroid
|
||||||
|
(
|
||||||
|
cit->vertex(0)->point(),
|
||||||
|
cit->vertex(1)->point(),
|
||||||
|
cit->vertex(2)->point(),
|
||||||
|
cit->vertex(3)->point()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (geometryToConformTo.inside(newPoint))
|
||||||
|
{
|
||||||
|
ptsToInsert.append(newPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< " Adding " << returnReduce(ptsToInsert.size(), sumOp<label>())
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
forAll(ptsToInsert, ptI)
|
||||||
|
{
|
||||||
|
mesh.insert
|
||||||
|
(
|
||||||
|
ptsToInsert[ptI],
|
||||||
|
defaultCellSize,
|
||||||
|
triad::unset,
|
||||||
|
Vb::vtInternal
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
@ -221,10 +271,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
label maxRefinementIterations = 0;
|
label maxRefinementIterations = 2;
|
||||||
label maxSmoothingIterations = 200;
|
label maxSmoothingIterations = 200;
|
||||||
scalar minResidual = 0;
|
scalar minResidual = 0;
|
||||||
scalar defaultCellSize = 0.0004;
|
scalar defaultCellSize = 0.001;
|
||||||
scalar nearFeatDistSqrCoeff = 1e-8;
|
scalar nearFeatDistSqrCoeff = 1e-8;
|
||||||
|
|
||||||
|
|
||||||
@ -305,7 +355,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< nl << "Inserting points from surface " << surface.name()
|
Info<< nl << "Inserting points from surface " << surface.name()
|
||||||
<< " (" << surface.type() << ")" << endl;
|
<< " (" << surface.type() << ")" << endl;
|
||||||
|
|
||||||
const tmp<pointField> tpoints = surface.points();
|
const tmp<pointField> tpoints(surface.points());
|
||||||
const pointField& points = tpoints();
|
const pointField& points = tpoints();
|
||||||
|
|
||||||
Info<< " Number of points = " << points.size() << endl;
|
Info<< " Number of points = " << points.size() << endl;
|
||||||
@ -396,7 +446,8 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
points[pI],
|
points[pI],
|
||||||
defaultCellSize,
|
defaultCellSize,
|
||||||
pointAlignment()
|
pointAlignment(),
|
||||||
|
Vb::vtInternalNearBoundary
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -406,56 +457,22 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
points[pI],
|
points[pI],
|
||||||
defaultCellSize,
|
defaultCellSize,
|
||||||
pointAlignment()
|
pointAlignment(),
|
||||||
|
Vb::vtInternalNearBoundary
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (label iter = 0; iter < maxRefinementIterations; ++iter)
|
// Refine the mesh
|
||||||
{
|
refine
|
||||||
DynamicList<point> ptsToInsert;
|
(
|
||||||
|
mesh,
|
||||||
for
|
geometryToConformTo,
|
||||||
(
|
maxRefinementIterations,
|
||||||
CellSizeDelaunay::Finite_cells_iterator cit =
|
defaultCellSize
|
||||||
mesh.finite_cells_begin();
|
);
|
||||||
cit != mesh.finite_cells_end();
|
|
||||||
++cit
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const point newPoint =
|
|
||||||
topoint
|
|
||||||
(
|
|
||||||
CGAL::centroid
|
|
||||||
(
|
|
||||||
cit->vertex(0)->point(),
|
|
||||||
cit->vertex(1)->point(),
|
|
||||||
cit->vertex(2)->point(),
|
|
||||||
cit->vertex(3)->point()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (geometryToConformTo.inside(newPoint))
|
|
||||||
{
|
|
||||||
ptsToInsert.append(newPoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< " Adding " << returnReduce(ptsToInsert.size(), sumOp<label>())
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
forAll(ptsToInsert, ptI)
|
|
||||||
{
|
|
||||||
mesh.insert
|
|
||||||
(
|
|
||||||
ptsToInsert[ptI],
|
|
||||||
defaultCellSize,
|
|
||||||
triad::unset
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
@ -463,9 +480,11 @@ int main(int argc, char *argv[])
|
|||||||
mesh.distribute(bMesh);
|
mesh.distribute(bMesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
labelListList pointPoints;
|
labelListList pointPoints;
|
||||||
autoPtr<mapDistribute> meshDistributor = buildMap(mesh, pointPoints);
|
autoPtr<mapDistribute> meshDistributor = buildMap(mesh, pointPoints);
|
||||||
|
|
||||||
|
|
||||||
triadField alignments(buildAlignmentField(mesh));
|
triadField alignments(buildAlignmentField(mesh));
|
||||||
pointField points(buildPointField(mesh));
|
pointField points(buildPointField(mesh));
|
||||||
|
|
||||||
@ -483,20 +502,12 @@ int main(int argc, char *argv[])
|
|||||||
++vit
|
++vit
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (vit->real())
|
if (vit->nearBoundary())
|
||||||
{
|
{
|
||||||
const tensor& alignment = vit->alignment();
|
fixedAlignments[vit->index()] = vit->alignment();
|
||||||
|
|
||||||
fixedAlignments[vit->index()] = triad
|
|
||||||
(
|
|
||||||
alignment.x(),
|
|
||||||
alignment.y(),
|
|
||||||
alignment.z()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "Smoothing alignments" << endl;
|
Info<< nl << "Smoothing alignments" << endl;
|
||||||
|
|
||||||
for (label iter = 0; iter < maxSmoothingIterations; iter++)
|
for (label iter = 0; iter < maxSmoothingIterations; iter++)
|
||||||
@ -522,13 +533,16 @@ int main(int argc, char *argv[])
|
|||||||
const triad& oldTriad = alignments[pI];
|
const triad& oldTriad = alignments[pI];
|
||||||
triad& newTriad = triadAv[pI];
|
triad& newTriad = triadAv[pI];
|
||||||
|
|
||||||
|
// Enforce the boundary conditions
|
||||||
|
const triad& fixedAlignment = fixedAlignments[pI];
|
||||||
|
|
||||||
forAll(pPoints, adjPointI)
|
forAll(pPoints, adjPointI)
|
||||||
{
|
{
|
||||||
const label adjPointIndex = pPoints[adjPointI];
|
const label adjPointIndex = pPoints[adjPointI];
|
||||||
|
|
||||||
scalar dist = mag(points[pI] - points[adjPointIndex]);
|
scalar dist = mag(points[pI] - points[adjPointIndex]);
|
||||||
|
|
||||||
dist = max(dist, SMALL);
|
// dist = max(dist, SMALL);
|
||||||
|
|
||||||
triad tmpTriad = alignments[adjPointIndex];
|
triad tmpTriad = alignments[adjPointIndex];
|
||||||
|
|
||||||
@ -545,16 +559,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
newTriad.normalize();
|
newTriad.normalize();
|
||||||
newTriad.orthogonalize();
|
newTriad.orthogonalize();
|
||||||
newTriad = newTriad.sortxyz();
|
// newTriad = newTriad.sortxyz();
|
||||||
|
|
||||||
// Enforce the boundary conditions
|
|
||||||
const triad& fixedAlignment = fixedAlignments[pI];
|
|
||||||
|
|
||||||
label nFixed = 0;
|
label nFixed = 0;
|
||||||
|
|
||||||
forAll(fixedAlignment, dirI)
|
forAll(fixedAlignment, dirI)
|
||||||
{
|
{
|
||||||
if (fixedAlignment[dirI] != triad::unset[dirI])
|
if (fixedAlignment.set(dirI))
|
||||||
{
|
{
|
||||||
nFixed++;
|
nFixed++;
|
||||||
}
|
}
|
||||||
@ -597,26 +608,20 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newTriad.set(vector::X) && oldTriad.set(vector::X))
|
for (direction dir = 0; dir < 3; ++dir)
|
||||||
{
|
{
|
||||||
scalar dotProd = (oldTriad.x() & newTriad.x());
|
if
|
||||||
|
(
|
||||||
|
newTriad.set(dir)
|
||||||
|
&& oldTriad.set(dir)
|
||||||
|
//&& !fixedAlignment.set(dir)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar dotProd = (oldTriad[dir] & newTriad[dir]);
|
||||||
|
scalar diff = mag(dotProd) - 1.0;
|
||||||
|
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
residual += mag(diff);
|
||||||
residual += mag(diff);
|
}
|
||||||
}
|
|
||||||
if (newTriad.set(vector::Y) && oldTriad.set(vector::Y))
|
|
||||||
{
|
|
||||||
scalar dotProd = (oldTriad.y() & newTriad.y());
|
|
||||||
|
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
|
||||||
residual += mag(diff);
|
|
||||||
}
|
|
||||||
if (newTriad.set(vector::Z) && oldTriad.set(vector::Z))
|
|
||||||
{
|
|
||||||
scalar dotProd = (oldTriad.z() & newTriad.z());
|
|
||||||
|
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
|
||||||
residual += mag(diff);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -26,10 +26,10 @@ License
|
|||||||
#include "cellShapeControl.H"
|
#include "cellShapeControl.H"
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "scalarField.H"
|
#include "scalarField.H"
|
||||||
|
#include "triadField.H"
|
||||||
#include "cellSizeAndAlignmentControl.H"
|
#include "cellSizeAndAlignmentControl.H"
|
||||||
#include "searchableSurfaceControl.H"
|
#include "searchableSurfaceControl.H"
|
||||||
#include "cellSizeFunction.H"
|
#include "cellSizeFunction.H"
|
||||||
#include "triad.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -200,12 +200,7 @@ Foam::tmp<Foam::triadField> Foam::cellShapeControl::buildAlignmentField
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
alignments[vit->index()] = triad
|
alignments[vit->index()] = vit->alignment();
|
||||||
(
|
|
||||||
vit->alignment().x(),
|
|
||||||
vit->alignment().y(),
|
|
||||||
vit->alignment().z()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tAlignments;
|
return tAlignments;
|
||||||
@ -259,13 +254,15 @@ Foam::cellShapeControl::cellShapeControl
|
|||||||
allGeometry_(allGeometry),
|
allGeometry_(allGeometry),
|
||||||
geometryToConformTo_(geometryToConformTo),
|
geometryToConformTo_(geometryToConformTo),
|
||||||
defaultCellSize_(readScalar(lookup("defaultCellSize"))),
|
defaultCellSize_(readScalar(lookup("defaultCellSize"))),
|
||||||
|
minimumCellSize_(readScalar(lookup("minimumCellSize"))),
|
||||||
shapeControlMesh_(runTime),
|
shapeControlMesh_(runTime),
|
||||||
aspectRatio_(motionDict),
|
aspectRatio_(motionDict),
|
||||||
sizeAndAlignment_
|
sizeAndAlignment_
|
||||||
(
|
(
|
||||||
runTime,
|
runTime,
|
||||||
motionDict.subDict("shapeControlFunctions"),
|
motionDict.subDict("shapeControlFunctions"),
|
||||||
geometryToConformTo
|
geometryToConformTo,
|
||||||
|
defaultCellSize_
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -489,30 +486,29 @@ void Foam::cellShapeControl::cellSizeAndAlignment
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
triad tri;
|
// triad tri;
|
||||||
|
|
||||||
forAll(bary, pI)
|
forAll(bary, pI)
|
||||||
{
|
{
|
||||||
size += bary[pI]*ch->vertex(pI)->targetCellSize();
|
size += bary[pI]*ch->vertex(pI)->targetCellSize();
|
||||||
|
|
||||||
triad triTmp2
|
// triad triTmp2 = ch->vertex(pI)->alignment();
|
||||||
(
|
// tri += triTmp2*bary[pI];
|
||||||
ch->vertex(pI)->alignment().x(),
|
|
||||||
ch->vertex(pI)->alignment().y(),
|
|
||||||
ch->vertex(pI)->alignment().z()
|
|
||||||
);
|
|
||||||
|
|
||||||
tri += triTmp2*bary[pI];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tri.normalize();
|
// tri.normalize();
|
||||||
tri.orthogonalize();
|
// tri.orthogonalize();
|
||||||
tri = tri.sortxyz();
|
// tri = tri.sortxyz();
|
||||||
|
//
|
||||||
|
// alignment = tri;
|
||||||
|
|
||||||
alignment = tensor
|
cellShapeControlMesh::Vertex_handle nearV =
|
||||||
(
|
shapeControlMesh_.nearest_vertex
|
||||||
tri.x(), tri.y(), tri.z()
|
(
|
||||||
);
|
toPoint<cellShapeControlMesh::Point>(pt)
|
||||||
|
);
|
||||||
|
|
||||||
|
alignment = nearV->alignment();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -545,36 +541,59 @@ void Foam::cellShapeControl::initialMeshPopulation
|
|||||||
Info<< "Inserting points from " << controlFunction.name()
|
Info<< "Inserting points from " << controlFunction.name()
|
||||||
<< " (" << controlFunction.type() << ")" << endl;
|
<< " (" << controlFunction.type() << ")" << endl;
|
||||||
|
|
||||||
pointField pts(1);
|
pointField pts;
|
||||||
scalarField sizes(1);
|
scalarField sizes;
|
||||||
Field<triad> alignments(1);
|
triadField alignments;
|
||||||
|
|
||||||
controlFunction.initialVertices(pts, sizes, alignments);
|
controlFunction.initialVertices(pts, sizes, alignments);
|
||||||
|
|
||||||
label nRejected = 0;
|
List<Vb> vertices(pts.size());
|
||||||
|
|
||||||
forAll(pts, pI)
|
// Clip the minimum size
|
||||||
|
forAll(vertices, vI)
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
vertices[vI] = Vb(pts[vI], Vb::vtInternal);
|
||||||
{
|
vertices[vI].targetCellSize() = max(sizes[vI], minimumCellSize_);
|
||||||
if (!decomposition().positionOnThisProcessor(pts[pI]))
|
vertices[vI].alignment() = alignments[vI];
|
||||||
{
|
|
||||||
nRejected++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shapeControlMesh_.insert
|
|
||||||
(
|
|
||||||
pts[pI],
|
|
||||||
sizes[pI],
|
|
||||||
alignments[pI]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pts.clear();
|
||||||
|
sizes.clear();
|
||||||
|
alignments.clear();
|
||||||
|
|
||||||
|
label nRejected = 0;
|
||||||
|
|
||||||
|
PackedBoolList keepVertex(vertices.size(), true);
|
||||||
|
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
forAll(vertices, vI)
|
||||||
|
{
|
||||||
|
const bool onProc = decomposition().positionOnThisProcessor
|
||||||
|
(
|
||||||
|
topoint(vertices[vI].point())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!onProc)
|
||||||
|
{
|
||||||
|
keepVertex[vI] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inplaceSubset(keepVertex, vertices);
|
||||||
|
|
||||||
|
const label preInsertedSize = shapeControlMesh_.number_of_vertices();
|
||||||
|
|
||||||
|
shapeControlMesh_.rangeInsertWithInfo(vertices.begin(), vertices.end());
|
||||||
|
|
||||||
Info<< " Inserted "
|
Info<< " Inserted "
|
||||||
<< returnReduce(pts.size() - nRejected, sumOp<label>())
|
<< returnReduce
|
||||||
<< "/" << pts.size()
|
(
|
||||||
|
shapeControlMesh_.number_of_vertices()
|
||||||
|
- preInsertedSize, sumOp<label>()
|
||||||
|
)
|
||||||
|
<< "/" << vertices.size()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -662,7 +681,7 @@ Foam::label Foam::cellShapeControl::refineMesh
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
lastCellSize < GREAT
|
lastCellSize < GREAT
|
||||||
&& mag(interpolatedSize - lastCellSize)/lastCellSize > 0.2
|
//&& mag(interpolatedSize - lastCellSize)/lastCellSize > 0.2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
@ -694,7 +713,7 @@ Foam::label Foam::cellShapeControl::refineMesh
|
|||||||
|
|
||||||
void Foam::cellShapeControl::smoothMesh()
|
void Foam::cellShapeControl::smoothMesh()
|
||||||
{
|
{
|
||||||
label maxSmoothingIterations = 200;
|
label maxSmoothingIterations = readLabel(lookup("maxSmoothingIterations"));
|
||||||
scalar minResidual = 0;
|
scalar minResidual = 0;
|
||||||
|
|
||||||
labelListList pointPoints;
|
labelListList pointPoints;
|
||||||
@ -719,9 +738,7 @@ void Foam::cellShapeControl::smoothMesh()
|
|||||||
{
|
{
|
||||||
if (vit->real())
|
if (vit->real())
|
||||||
{
|
{
|
||||||
const tensor& alignment = vit->alignment();
|
fixedAlignments[vit->index()] = vit->alignment();
|
||||||
|
|
||||||
fixedAlignments[vit->index()] = alignment;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -755,8 +772,6 @@ void Foam::cellShapeControl::smoothMesh()
|
|||||||
|
|
||||||
scalar dist = mag(points[pI] - points[adjPointIndex]);
|
scalar dist = mag(points[pI] - points[adjPointIndex]);
|
||||||
|
|
||||||
dist = max(dist, SMALL);
|
|
||||||
|
|
||||||
triad tmpTriad = alignments[adjPointIndex];
|
triad tmpTriad = alignments[adjPointIndex];
|
||||||
|
|
||||||
for (direction dir = 0; dir < 3; dir++)
|
for (direction dir = 0; dir < 3; dir++)
|
||||||
@ -781,7 +796,7 @@ void Foam::cellShapeControl::smoothMesh()
|
|||||||
|
|
||||||
forAll(fixedAlignment, dirI)
|
forAll(fixedAlignment, dirI)
|
||||||
{
|
{
|
||||||
if (fixedAlignment[dirI] != triad::unset[dirI])
|
if (fixedAlignment.set(dirI))
|
||||||
{
|
{
|
||||||
nFixed++;
|
nFixed++;
|
||||||
}
|
}
|
||||||
@ -826,27 +841,32 @@ void Foam::cellShapeControl::smoothMesh()
|
|||||||
|
|
||||||
const triad& oldTriad = alignments[pI];
|
const triad& oldTriad = alignments[pI];
|
||||||
|
|
||||||
if (newTriad.set(vector::X) && oldTriad.set(vector::X))
|
for (direction dir = 0; dir < 3; ++dir)
|
||||||
{
|
{
|
||||||
scalar dotProd = (oldTriad.x() & newTriad.x());
|
if
|
||||||
|
(
|
||||||
|
newTriad.set(dir)
|
||||||
|
&& oldTriad.set(dir)
|
||||||
|
//&& !fixedAlignment.set(dir)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar dotProd = (oldTriad[dir] & newTriad[dir]);
|
||||||
|
scalar diff = mag(dotProd) - 1.0;
|
||||||
|
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
residual += mag(diff);
|
||||||
residual += mag(diff);
|
}
|
||||||
}
|
}
|
||||||
if (newTriad.set(vector::Y) && oldTriad.set(vector::Y))
|
|
||||||
{
|
|
||||||
scalar dotProd = (oldTriad.y() & newTriad.y());
|
|
||||||
|
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
// if (iter == 198 || iter == 199)
|
||||||
residual += mag(diff);
|
// {
|
||||||
}
|
// Info<< "Triad" << nl
|
||||||
if (newTriad.set(vector::Z) && oldTriad.set(vector::Z))
|
// << " Fixed (" << nFixed << ") = " << fixedAlignment
|
||||||
{
|
// << nl
|
||||||
scalar dotProd = (oldTriad.z() & newTriad.z());
|
// << " Old = " << oldTriad << nl
|
||||||
|
// << " Pre-Align= " << triadAv[pI] << nl
|
||||||
scalar diff = mag(dotProd) - 1.0;
|
// << " New = " << newTriad << nl
|
||||||
residual += mag(diff);
|
// << " Residual = " << residual << endl;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(alignments, pI)
|
forAll(alignments, pI)
|
||||||
@ -858,7 +878,7 @@ void Foam::cellShapeControl::smoothMesh()
|
|||||||
|
|
||||||
Info<< ", Residual = " << residual << endl;
|
Info<< ", Residual = " << residual << endl;
|
||||||
|
|
||||||
if (residual <= minResidual)
|
if (iter > 0 && residual <= minResidual)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -41,7 +41,6 @@ SourceFiles
|
|||||||
#include "point.H"
|
#include "point.H"
|
||||||
#include "primitiveFieldsFwd.H"
|
#include "primitiveFieldsFwd.H"
|
||||||
#include "pointFieldFwd.H"
|
#include "pointFieldFwd.H"
|
||||||
#include "triadField.H"
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "searchableSurfaces.H"
|
#include "searchableSurfaces.H"
|
||||||
#include "conformationSurfaces.H"
|
#include "conformationSurfaces.H"
|
||||||
@ -74,6 +73,8 @@ class cellShapeControl
|
|||||||
|
|
||||||
const scalar defaultCellSize_;
|
const scalar defaultCellSize_;
|
||||||
|
|
||||||
|
const scalar minimumCellSize_;
|
||||||
|
|
||||||
cellShapeControlMesh shapeControlMesh_;
|
cellShapeControlMesh shapeControlMesh_;
|
||||||
|
|
||||||
cellAspectRatioControl aspectRatio_;
|
cellAspectRatioControl aspectRatio_;
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -52,8 +52,7 @@ Foam::cellSizeAndAlignmentControl::cellSizeAndAlignmentControl
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
runTime_(runTime),
|
runTime_(runTime),
|
||||||
name_(name),
|
name_(name)
|
||||||
priority_(readLabel(controlFunctionDict.lookup("priority")))
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -39,7 +39,7 @@ SourceFiles
|
|||||||
#include "conformationSurfaces.H"
|
#include "conformationSurfaces.H"
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "quaternion.H"
|
#include "quaternion.H"
|
||||||
#include "triad.H"
|
#include "triadField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,9 +64,6 @@ private:
|
|||||||
|
|
||||||
const word name_;
|
const word name_;
|
||||||
|
|
||||||
//- Priority of this cellSizeFunction
|
|
||||||
label priority_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -138,10 +135,7 @@ public:
|
|||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline label priority() const
|
virtual label priority() const = 0;
|
||||||
{
|
|
||||||
return priority_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Query
|
// Query
|
||||||
@ -150,7 +144,7 @@ public:
|
|||||||
(
|
(
|
||||||
pointField& pts,
|
pointField& pts,
|
||||||
scalarField& sizes,
|
scalarField& sizes,
|
||||||
Field<triad>& alignments
|
triadField& alignments
|
||||||
) const = 0;
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,6 +24,91 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "cellSizeAndAlignmentControls.H"
|
#include "cellSizeAndAlignmentControls.H"
|
||||||
|
#include "searchableSurfaceControl.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
defineTypeNameAndDebug(cellSizeAndAlignmentControls, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::cellSizeAndAlignmentControls::evalCellSizeFunctions
|
||||||
|
(
|
||||||
|
const point& pt,
|
||||||
|
scalar& minSize
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
bool anyFunctionFound = false;
|
||||||
|
|
||||||
|
// Regions requesting with the same priority take the smallest
|
||||||
|
|
||||||
|
if (controlFunctions_.size())
|
||||||
|
{
|
||||||
|
// Maintain priority of current hit. Initialise so it always goes
|
||||||
|
// through at least once.
|
||||||
|
label previousPriority = -1;
|
||||||
|
|
||||||
|
forAll(controlFunctions_, i)
|
||||||
|
{
|
||||||
|
const cellSizeAndAlignmentControl& cSF = controlFunctions_[i];
|
||||||
|
|
||||||
|
if (isA<searchableSurfaceControl>(cSF))
|
||||||
|
{
|
||||||
|
const searchableSurfaceControl& sSC =
|
||||||
|
refCast<const searchableSurfaceControl>(cSF);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "size function "
|
||||||
|
<< sSC.name()
|
||||||
|
<< " priority " << sSC.priority()
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sSC.priority() < previousPriority)
|
||||||
|
{
|
||||||
|
return minSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
scalar sizeI;
|
||||||
|
|
||||||
|
if (sSC.sizeFunction().cellSize(pt, sizeI))
|
||||||
|
{
|
||||||
|
anyFunctionFound = true;
|
||||||
|
|
||||||
|
if (sSC.priority() == previousPriority)
|
||||||
|
{
|
||||||
|
if (sizeI < minSize)
|
||||||
|
{
|
||||||
|
minSize = sizeI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
minSize = sizeI;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "sizeI " << sizeI
|
||||||
|
<<" minSize " << minSize << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
previousPriority = sSC.priority();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return anyFunctionFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -31,12 +116,14 @@ Foam::cellSizeAndAlignmentControls::cellSizeAndAlignmentControls
|
|||||||
(
|
(
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
const dictionary& shapeControlDict,
|
const dictionary& shapeControlDict,
|
||||||
const conformationSurfaces& allGeometry
|
const conformationSurfaces& allGeometry,
|
||||||
|
const scalar defaultCellSize
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
shapeControlDict_(shapeControlDict),
|
shapeControlDict_(shapeControlDict),
|
||||||
allGeometry_(allGeometry),
|
allGeometry_(allGeometry),
|
||||||
controlFunctions_(shapeControlDict_.size())
|
controlFunctions_(shapeControlDict_.size()),
|
||||||
|
defaultCellSize_(defaultCellSize)
|
||||||
{
|
{
|
||||||
label functionI = 0;
|
label functionI = 0;
|
||||||
|
|
||||||
@ -74,5 +161,17 @@ Foam::cellSizeAndAlignmentControls::~cellSizeAndAlignmentControls()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::scalar Foam::cellSizeAndAlignmentControls::cellSize
|
||||||
|
(
|
||||||
|
const point& pt
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar size = defaultCellSize_;
|
||||||
|
|
||||||
|
evalCellSizeFunctions(pt, size);
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -35,7 +35,6 @@ SourceFiles
|
|||||||
#define cellSizeAndAlignmentControls_H
|
#define cellSizeAndAlignmentControls_H
|
||||||
|
|
||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
#include "cellShapeControlMesh.H"
|
|
||||||
#include "cellSizeAndAlignmentControl.H"
|
#include "cellSizeAndAlignmentControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -43,7 +42,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class cellSizeAndAlignmentControls Declaration
|
Class cellSizeAndAlignmentControls Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -58,9 +56,13 @@ class cellSizeAndAlignmentControls
|
|||||||
|
|
||||||
PtrList<cellSizeAndAlignmentControl> controlFunctions_;
|
PtrList<cellSizeAndAlignmentControl> controlFunctions_;
|
||||||
|
|
||||||
|
const scalar defaultCellSize_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
bool evalCellSizeFunctions(const point& pt, scalar& minSize) const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
cellSizeAndAlignmentControls(const cellSizeAndAlignmentControls&);
|
cellSizeAndAlignmentControls(const cellSizeAndAlignmentControls&);
|
||||||
|
|
||||||
@ -70,6 +72,10 @@ class cellSizeAndAlignmentControls
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
ClassName("cellSizeAndAlignmentControls");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
@ -77,7 +83,8 @@ public:
|
|||||||
(
|
(
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
const dictionary& shapeControlDict,
|
const dictionary& shapeControlDict,
|
||||||
const conformationSurfaces& allGeometry
|
const conformationSurfaces& allGeometry,
|
||||||
|
const scalar defaultCellSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -96,6 +103,8 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// Query
|
// Query
|
||||||
|
|
||||||
|
scalar cellSize(const point& pt) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -70,7 +70,8 @@ Foam::fileControl::fileControl
|
|||||||
),
|
),
|
||||||
pointsFile_(controlFunctionDict.lookup("pointsFile")),
|
pointsFile_(controlFunctionDict.lookup("pointsFile")),
|
||||||
sizesFile_(controlFunctionDict.lookup("sizesFile")),
|
sizesFile_(controlFunctionDict.lookup("sizesFile")),
|
||||||
alignmentsFile_(controlFunctionDict.lookup("alignmentsFile"))
|
alignmentsFile_(controlFunctionDict.lookup("alignmentsFile")),
|
||||||
|
priority_(readLabel(controlFunctionDict.lookup("priority")))
|
||||||
{
|
{
|
||||||
Info<< indent << "Loading from file... " << nl
|
Info<< indent << "Loading from file... " << nl
|
||||||
<< indent << " points : " << pointsFile_ << nl
|
<< indent << " points : " << pointsFile_ << nl
|
||||||
@ -160,12 +161,11 @@ Foam::fileControl::~fileControl()
|
|||||||
// alignment = cellAlignment(pt);
|
// alignment = cellAlignment(pt);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
void Foam::fileControl::initialVertices
|
void Foam::fileControl::initialVertices
|
||||||
(
|
(
|
||||||
pointField& pts,
|
pointField& pts,
|
||||||
scalarField& sizes,
|
scalarField& sizes,
|
||||||
Field<triad>& alignments
|
triadField& alignments
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
Info<< " Reading points from file : " << pointsFile_ << endl;
|
Info<< " Reading points from file : " << pointsFile_ << endl;
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,6 +58,8 @@ class fileControl
|
|||||||
|
|
||||||
const fileName alignmentsFile_;
|
const fileName alignmentsFile_;
|
||||||
|
|
||||||
|
label priority_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -117,9 +119,13 @@ public:
|
|||||||
(
|
(
|
||||||
pointField& pts,
|
pointField& pts,
|
||||||
scalarField& sizes,
|
scalarField& sizes,
|
||||||
Field<triad>& alignments
|
triadField& alignments
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
virtual label priority() const
|
||||||
|
{
|
||||||
|
return priority_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -168,7 +168,8 @@ Foam::searchableSurfaceControl::searchableSurfaceControl
|
|||||||
controlFunctionDict,
|
controlFunctionDict,
|
||||||
allGeometry
|
allGeometry
|
||||||
),
|
),
|
||||||
searchableSurface_(allGeometry.geometry()[name]),
|
surfaceName_(controlFunctionDict.lookupOrDefault<word>("surface", name)),
|
||||||
|
searchableSurface_(allGeometry.geometry()[surfaceName_]),
|
||||||
allGeometry_(allGeometry),
|
allGeometry_(allGeometry),
|
||||||
cellSizeFunction_
|
cellSizeFunction_
|
||||||
(
|
(
|
||||||
@ -557,21 +558,17 @@ Foam::searchableSurfaceControl::~searchableSurfaceControl()
|
|||||||
// alignment = cellAlignment(pt);
|
// alignment = cellAlignment(pt);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
void Foam::searchableSurfaceControl::initialVertices
|
void Foam::searchableSurfaceControl::initialVertices
|
||||||
(
|
(
|
||||||
pointField& pts,
|
pointField& pts,
|
||||||
scalarField& sizes,
|
scalarField& sizes,
|
||||||
Field<triad>& alignments
|
triadField& alignments
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
pts = searchableSurface_.points();
|
pts = searchableSurface_.points();
|
||||||
|
|
||||||
const scalar nearFeatDistSqrCoeff = 1e-8;
|
const scalar nearFeatDistSqrCoeff = 1e-8;
|
||||||
|
|
||||||
sizes.setSize(pts.size());
|
|
||||||
alignments.setSize(pts.size());
|
|
||||||
|
|
||||||
forAll(pts, pI)
|
forAll(pts, pI)
|
||||||
{
|
{
|
||||||
// Is the point in the extendedFeatureEdgeMesh? If so get the
|
// Is the point in the extendedFeatureEdgeMesh? If so get the
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,7 +34,6 @@ SourceFiles
|
|||||||
#ifndef searchableSurfaceControl_H
|
#ifndef searchableSurfaceControl_H
|
||||||
#define searchableSurfaceControl_H
|
#define searchableSurfaceControl_H
|
||||||
|
|
||||||
#include "cellShapeControl.H"
|
|
||||||
#include "cellSizeFunction.H"
|
#include "cellSizeFunction.H"
|
||||||
#include "triad.H"
|
#include "triad.H"
|
||||||
|
|
||||||
@ -54,13 +53,15 @@ class searchableSurfaceControl
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference to the searchableSurface object holding the geometry
|
//- Name of the surface
|
||||||
// data
|
const word surfaceName_;
|
||||||
const searchableSurface& searchableSurface_;
|
|
||||||
|
|
||||||
const conformationSurfaces& allGeometry_;
|
//- Reference to the searchableSurface object holding the geometry data
|
||||||
|
const searchableSurface& searchableSurface_;
|
||||||
|
|
||||||
autoPtr<cellSizeFunction> cellSizeFunction_;
|
const conformationSurfaces& allGeometry_;
|
||||||
|
|
||||||
|
autoPtr<cellSizeFunction> cellSizeFunction_;
|
||||||
|
|
||||||
|
|
||||||
// const conformationSurfaces& geometryToConformTo_;
|
// const conformationSurfaces& geometryToConformTo_;
|
||||||
@ -143,7 +144,7 @@ public:
|
|||||||
(
|
(
|
||||||
pointField& pts,
|
pointField& pts,
|
||||||
scalarField& sizes,
|
scalarField& sizes,
|
||||||
Field<triad>& alignments
|
triadField& alignments
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
const cellSizeFunction& sizeFunction() const
|
const cellSizeFunction& sizeFunction() const
|
||||||
@ -151,6 +152,11 @@ public:
|
|||||||
return cellSizeFunction_();
|
return cellSizeFunction_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual label priority() const
|
||||||
|
{
|
||||||
|
return cellSizeFunction_().priority();
|
||||||
|
}
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,8 @@ Foam::cellSizeFunction::cellSizeFunction
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
coeffsDict_(subDict(type + "Coeffs")),
|
coeffsDict_(subDict(type + "Coeffs")),
|
||||||
sideMode_()
|
sideMode_(),
|
||||||
|
priority_(readLabel(cellSizeFunctionDict.lookup("priority")))
|
||||||
{
|
{
|
||||||
word mode = cellSizeFunctionDict.lookup("mode");
|
word mode = cellSizeFunctionDict.lookup("mode");
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,6 +97,8 @@ protected:
|
|||||||
//- Mode of size specification, i.e. inside, outside or bothSides
|
//- Mode of size specification, i.e. inside, outside or bothSides
|
||||||
sideMode sideMode_;
|
sideMode sideMode_;
|
||||||
|
|
||||||
|
label priority_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -180,6 +182,11 @@ public:
|
|||||||
<< endl;
|
<< endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label priority() const
|
||||||
|
{
|
||||||
|
return priority_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -880,11 +880,24 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
|
|||||||
cellSizeMesh.distribute(decomposition_);
|
cellSizeMesh.distribute(decomposition_);
|
||||||
}
|
}
|
||||||
|
|
||||||
label nMaxIter = 2;
|
label nMaxIter = readLabel
|
||||||
|
(
|
||||||
|
cvMeshControls().cvMeshDict().subDict("motionControl").lookup
|
||||||
|
(
|
||||||
|
"maxRefinementIterations"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Maximum number of refinement iterations : " << nMaxIter << endl;
|
||||||
|
|
||||||
for (label i = 0; i < nMaxIter; ++i)
|
for (label i = 0; i < nMaxIter; ++i)
|
||||||
{
|
{
|
||||||
|
// label nRemoved = cellSizeMesh.removePoints();
|
||||||
|
label nRemoved = 0;
|
||||||
|
reduce(nRemoved, sumOp<label>());
|
||||||
|
|
||||||
label nAdded = cellShapeControl_.refineMesh(decomposition_);
|
label nAdded = cellShapeControl_.refineMesh(decomposition_);
|
||||||
|
// label nAdded = 0;
|
||||||
reduce(nAdded, sumOp<label>());
|
reduce(nAdded, sumOp<label>());
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun())
|
||||||
@ -892,12 +905,14 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
|
|||||||
cellSizeMesh.distribute(decomposition_);
|
cellSizeMesh.distribute(decomposition_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nAdded == 0)
|
if (nRemoved + nAdded == 0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< " Iteration " << i << ": Added = " << nAdded << " points"
|
Info<< " Iteration " << i
|
||||||
|
<< " Added = " << nAdded << " points"
|
||||||
|
<< ", Removed = " << nRemoved << " points"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -906,7 +921,11 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
|
|||||||
Info<< "Background cell size and alignment mesh:" << endl;
|
Info<< "Background cell size and alignment mesh:" << endl;
|
||||||
cellSizeMesh.printInfo(Info);
|
cellSizeMesh.printInfo(Info);
|
||||||
|
|
||||||
// cellSizeMesh.write();
|
if (cvMeshControls().objOutput())
|
||||||
|
{
|
||||||
|
cellSizeMesh.writeTriangulation();
|
||||||
|
cellSizeMesh.write();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -345,6 +345,12 @@ private:
|
|||||||
DynamicList<Vb>& pts
|
DynamicList<Vb>& pts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
inline bool isPointPair
|
||||||
|
(
|
||||||
|
const Vertex_handle& vA,
|
||||||
|
const Vertex_handle& vB
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Insert pairs of points on the surface with the given normals, at the
|
//- Insert pairs of points on the surface with the given normals, at the
|
||||||
// specified spacing
|
// specified spacing
|
||||||
void insertSurfacePointPairs
|
void insertSurfacePointPairs
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -2106,7 +2106,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
|
|
||||||
// If the two vertices are a pair, then the patch face is
|
// If the two vertices are a pair, then the patch face is
|
||||||
// a desired one.
|
// a desired one.
|
||||||
if (vA->type() == vB->index())
|
if (!isPointPair(vA, vB))
|
||||||
{
|
{
|
||||||
indirectPatchFace[patchIndex].append(true);
|
indirectPatchFace[patchIndex].append(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,13 +27,7 @@ License
|
|||||||
|
|
||||||
inline Foam::scalar Foam::conformalVoronoiMesh::defaultCellSize() const
|
inline Foam::scalar Foam::conformalVoronoiMesh::defaultCellSize() const
|
||||||
{
|
{
|
||||||
return readScalar
|
return cvMeshControls().defaultCellSize();
|
||||||
(
|
|
||||||
cvMeshControls().cvMeshDict().subDict("motionControl").lookup
|
|
||||||
(
|
|
||||||
"defaultCellSize"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -336,12 +330,20 @@ inline void Foam::conformalVoronoiMesh::createPointPair
|
|||||||
|
|
||||||
pts.append
|
pts.append
|
||||||
(
|
(
|
||||||
Vb(surfPt - ppDistn, Vb::vtInternalSurface)
|
Vb
|
||||||
|
(
|
||||||
|
surfPt - ppDistn,
|
||||||
|
Vb::vtInternalSurface
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
pts.append
|
pts.append
|
||||||
(
|
(
|
||||||
Vb(surfPt + ppDistn, Vb::vtExternalSurface)
|
Vb
|
||||||
|
(
|
||||||
|
surfPt + ppDistn,
|
||||||
|
Vb::vtExternalSurface
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,6 +390,76 @@ inline void Foam::conformalVoronoiMesh::createBafflePointPair
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::conformalVoronoiMesh::isPointPair
|
||||||
|
(
|
||||||
|
const Vertex_handle& vA,
|
||||||
|
const Vertex_handle& vB
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Want to do this topologically, but problem if vertices are redistributed
|
||||||
|
// so that one of the point pair is one processor and the other is on
|
||||||
|
// another.
|
||||||
|
|
||||||
|
const Foam::point& ptA = topoint(vA->point());
|
||||||
|
const Foam::point& ptB = topoint(vB->point());
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(
|
||||||
|
vA->type() == Vb::vtInternalSurface
|
||||||
|
&& vB->type() == Vb::vtExternalSurface
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vB->type() == Vb::vtInternalSurface
|
||||||
|
&& vA->type() == Vb::vtExternalSurface
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vA->type() == Vb::vtInternalFeatureEdge
|
||||||
|
&& vB->type() == Vb::vtExternalFeatureEdge
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vB->type() == Vb::vtInternalFeatureEdge
|
||||||
|
&& vA->type() == Vb::vtExternalFeatureEdge
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vA->type() == Vb::vtInternalSurface
|
||||||
|
&& vB->type() == Vb::vtExternalFeatureEdge
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vB->type() == Vb::vtInternalSurface
|
||||||
|
&& vA->type() == Vb::vtExternalFeatureEdge
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vA->type() == Vb::vtExternalSurface
|
||||||
|
&& vB->type() == Vb::vtInternalFeatureEdge
|
||||||
|
)
|
||||||
|
||
|
||||||
|
(
|
||||||
|
vB->type() == Vb::vtExternalSurface
|
||||||
|
&& vA->type() == Vb::vtInternalFeatureEdge
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const scalar distSqr = magSqr(ptA - ptB);
|
||||||
|
|
||||||
|
const scalar ppDistSqr = sqr(2*pointPairDistance(0.5*(ptA + ptB)));
|
||||||
|
|
||||||
|
if (distSqr > 1.001*ppDistSqr)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::conformalVoronoiMesh::isBoundaryDualFace
|
inline bool Foam::conformalVoronoiMesh::isBoundaryDualFace
|
||||||
(
|
(
|
||||||
const Delaunay::Finite_edges_iterator& eit
|
const Delaunay::Finite_edges_iterator& eit
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -125,6 +125,10 @@ Foam::cvControls::cvControls
|
|||||||
|
|
||||||
const dictionary& motionDict(cvMeshDict_.subDict("motionControl"));
|
const dictionary& motionDict(cvMeshDict_.subDict("motionControl"));
|
||||||
|
|
||||||
|
defaultCellSize_ = readScalar(motionDict.lookup("defaultCellSize"));
|
||||||
|
|
||||||
|
minimumCellSize_ = readScalar(motionDict.lookup("minimumCellSize"));
|
||||||
|
|
||||||
objOutput_ = Switch(motionDict.lookupOrDefault<Switch>("objOutput", false));
|
objOutput_ = Switch(motionDict.lookupOrDefault<Switch>("objOutput", false));
|
||||||
|
|
||||||
timeChecks_ = Switch
|
timeChecks_ = Switch
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -126,6 +126,16 @@ class cvControls
|
|||||||
|
|
||||||
// Motion control controls
|
// Motion control controls
|
||||||
|
|
||||||
|
|
||||||
|
// Cell size criteria
|
||||||
|
|
||||||
|
//- Default cell size
|
||||||
|
scalar defaultCellSize_;
|
||||||
|
|
||||||
|
//- Minimum cell size
|
||||||
|
scalar minimumCellSize_;
|
||||||
|
|
||||||
|
|
||||||
//- Switch to control the output of obj files for debug
|
//- Switch to control the output of obj files for debug
|
||||||
Switch objOutput_;
|
Switch objOutput_;
|
||||||
|
|
||||||
@ -255,6 +265,12 @@ public:
|
|||||||
//- Return the iterationToInitialHitRatioLimit
|
//- Return the iterationToInitialHitRatioLimit
|
||||||
scalar iterationToInitialHitRatioLimit() const;
|
scalar iterationToInitialHitRatioLimit() const;
|
||||||
|
|
||||||
|
//- Return the defaultCellSize
|
||||||
|
inline scalar defaultCellSize() const;
|
||||||
|
|
||||||
|
//- Return the minimumCellSize
|
||||||
|
inline scalar minimumCellSize() const;
|
||||||
|
|
||||||
//- Return the objOutput Switch
|
//- Return the objOutput Switch
|
||||||
inline Switch objOutput() const;
|
inline Switch objOutput() const;
|
||||||
|
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,6 +112,18 @@ inline Foam::scalar Foam::cvControls::iterationToInitialHitRatioLimit() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::cvControls::defaultCellSize() const
|
||||||
|
{
|
||||||
|
return defaultCellSize_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::scalar Foam::cvControls::minimumCellSize() const
|
||||||
|
{
|
||||||
|
return minimumCellSize_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::Switch Foam::cvControls::objOutput() const
|
inline Foam::Switch Foam::cvControls::objOutput() const
|
||||||
{
|
{
|
||||||
return objOutput_;
|
return objOutput_;
|
||||||
|
|||||||
@ -271,6 +271,9 @@ motionControl
|
|||||||
// Absolute cell size of back ground mesh. This is the maximum cell size.
|
// Absolute cell size of back ground mesh. This is the maximum cell size.
|
||||||
defaultCellSize 0.00075;
|
defaultCellSize 0.00075;
|
||||||
|
|
||||||
|
// Absolute cell size of back ground mesh. This is the minimum cell size.
|
||||||
|
minimumCellSize 0;
|
||||||
|
|
||||||
//cellShapeControl constantControl;
|
//cellShapeControl constantControl;
|
||||||
//cellShapeControl fileControl;
|
//cellShapeControl fileControl;
|
||||||
cellShapeControl surfaceControl;
|
cellShapeControl surfaceControl;
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -114,6 +114,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.append("surfaceFormat");
|
argList::validArgs.append("surfaceFormat");
|
||||||
|
|
||||||
|
#include "addOverwriteOption.H"
|
||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
Info<< "Create time\n" << endl;
|
Info<< "Create time\n" << endl;
|
||||||
@ -128,6 +130,7 @@ int main(int argc, char *argv[])
|
|||||||
runTimeExtruded.functionObjects().off();
|
runTimeExtruded.functionObjects().off();
|
||||||
|
|
||||||
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
|
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
|
||||||
|
const bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
Info<< "Extruding from " << ExtrudeModeNames[surfaceFormat]
|
Info<< "Extruding from " << ExtrudeModeNames[surfaceFormat]
|
||||||
<< " at time " << runTimeExtruded.timeName() << endl;
|
<< " at time " << runTimeExtruded.timeName() << endl;
|
||||||
@ -304,6 +307,15 @@ int main(int argc, char *argv[])
|
|||||||
mesh().updateMesh(morphMap);
|
mesh().updateMesh(morphMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!overwrite)
|
||||||
|
{
|
||||||
|
runTimeExtruded++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mesh().setInstance("constant");
|
||||||
|
}
|
||||||
|
|
||||||
// Take over refinement levels and write to new time directory.
|
// Take over refinement levels and write to new time directory.
|
||||||
Pout<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
|
Pout<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ collapseFacesCoeffs
|
|||||||
meshQualityCoeffs
|
meshQualityCoeffs
|
||||||
{
|
{
|
||||||
#include "meshQualityDict";
|
#include "meshQualityDict";
|
||||||
maximumIterations 30;
|
maximumIterations 10;
|
||||||
maximumSmoothingIterations 1;
|
maximumSmoothingIterations 1;
|
||||||
maxPointErrorCount 5;
|
maxPointErrorCount 5;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ FoamFile
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
startFrom latestTime;
|
startFrom startTime;
|
||||||
|
|
||||||
startTime 0;
|
startTime 0;
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ collapseFacesCoeffs
|
|||||||
meshQualityCoeffs
|
meshQualityCoeffs
|
||||||
{
|
{
|
||||||
#include "meshQualityDict";
|
#include "meshQualityDict";
|
||||||
maximumIterations 30;
|
maximumIterations 10;
|
||||||
maximumSmoothingIterations 1;
|
maximumSmoothingIterations 1;
|
||||||
maxPointErrorCount 5;
|
maxPointErrorCount 5;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ deltaT 1;
|
|||||||
|
|
||||||
writeControl timeStep;
|
writeControl timeStep;
|
||||||
|
|
||||||
writeInterval 10;
|
writeInterval 100;
|
||||||
|
|
||||||
purgeWrite 0;
|
purgeWrite 0;
|
||||||
|
|
||||||
|
|||||||
@ -80,8 +80,8 @@ surfaceConformation
|
|||||||
{
|
{
|
||||||
flange.obj
|
flange.obj
|
||||||
{
|
{
|
||||||
featureMethod extendedFeatureEdgeMesh;
|
featureMethod extendedFeatureEdgeMesh;
|
||||||
extendedFeatureEdgeMesh "flange.extendedFeatureEdgeMesh";
|
extendedFeatureEdgeMesh "flange.extendedFeatureEdgeMesh";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user