Commit aa57b759 authored by andy's avatar andy
Browse files

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

parents b8ce43b9 cecf469e
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,6 +47,8 @@ Description
#include "snapParameters.H"
#include "layerParameters.H"
#include "vtkSetWriter.H"
#include "faceSet.H"
#include "motionSmoother.H"
using namespace Foam;
......@@ -675,6 +677,31 @@ int main(int argc, char *argv[])
}
{
// Check final mesh
Info<< "Checking final mesh ..." << endl;
faceSet wrongFaces(mesh, "wrongFaces", mesh.nFaces()/100);
motionSmoother::checkMesh(false, mesh, motionDict, wrongFaces);
const label nErrors = returnReduce
(
wrongFaces.size(),
sumOp<label>()
);
if (nErrors > 0)
{
Info<< "Finished meshing with " << nErrors << " illegal faces"
<< " (concave, zero area or negative cell pyramid volume)"
<< endl;
wrongFaces.write();
}
else
{
Info<< "Finished meshing without any errors" << endl;
}
}
Info<< "Finished meshing in = "
<< runTime.elapsedCpuTime() << " s." << endl;
......
......@@ -138,6 +138,8 @@ baffles
//- Select faces and orientation through a searchableSurface
type searchableSurface;
surface searchablePlate;
//name sphere.stl; // name if surface=triSurfaceMesh
origin (0.099 -0.006 0.004);
span (0 0.012 0.012);
......
......@@ -28,6 +28,7 @@ License
#include "syncTools.H"
#include "searchableSurface.H"
#include "fvMesh.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -61,7 +62,15 @@ Foam::faceSelections::searchableSurfaceSelection::searchableSurfaceSelection
searchableSurface::New
(
word(dict.lookup("surface")),
mesh.objectRegistry::db(),
IOobject
(
dict.lookupOrDefault("name", mesh.objectRegistry::db().name()),
mesh.time().constant(),
"triSurface",
mesh.objectRegistry::db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
dict
)
)
......
......@@ -378,6 +378,7 @@ FoamFile
// surface searchableSphere;
// centre (0.05 0.05 0.005);
// radius 0.025;
// //name sphere.stl; // Optional name if surface triSurfaceMesh
// }
// }
//
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -179,7 +179,10 @@ void Foam::vtkPV3Foam::convertMeshPatches
const word patchName = getPartName(partId);
labelHashSet patchIds(patches.patchSet(List<wordRe>(1, patchName)));
labelHashSet patchIds
(
patches.patchSet(List<wordRe>(1, wordRe(patchName)))
);
if (debug)
{
......
......@@ -120,22 +120,25 @@ public:
inline wordRe(const wordRe&);
//- Construct from keyType
inline wordRe(const keyType&, const compOption=LITERAL);
inline explicit wordRe(const keyType&);
//- Construct from keyType
inline wordRe(const keyType&, const compOption);
//- Construct as copy of word
inline explicit wordRe(const word&);
//- Construct as copy of character array
// Optionally specify how it should be treated.
inline wordRe(const char*, const compOption = LITERAL);
inline explicit wordRe(const char*, const compOption = LITERAL);
//- Construct as copy of string.
// Optionally specify how it should be treated.
inline wordRe(const string&, const compOption = LITERAL);
inline explicit wordRe(const string&, const compOption = LITERAL);
//- Construct as copy of std::string
// Optionally specify how it should be treated.
inline wordRe(const std::string&, const compOption = LITERAL);
inline explicit wordRe(const std::string&, const compOption = LITERAL);
//- Construct from Istream
// Words are treated as literals, strings with an auto-test
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -65,6 +65,18 @@ inline Foam::wordRe::wordRe(const word& str)
{}
inline Foam::wordRe::wordRe(const keyType& str)
:
word(str, false),
re_()
{
if (str.isPattern())
{
compile();
}
}
inline Foam::wordRe::wordRe(const keyType& str, const compOption opt)
:
word(str, false),
......
......@@ -678,34 +678,8 @@ void Foam::motionSmoother::correct()
}
void Foam::motionSmoother::setDisplacement(pointField& patchDisp)
void Foam::motionSmoother::setDisplacementPatchFields()
{
// See comment in .H file about shared points.
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, i)
{
displacement_[meshPoints[i]] = vector::zero;
}
}
}
const labelList& ppMeshPoints = pp_.meshPoints();
// Set internal point data from displacement on combined patch points.
forAll(ppMeshPoints, patchPointI)
{
displacement_[ppMeshPoints[patchPointI]] = patchDisp[patchPointI];
}
// Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches)
forAll(adaptPatchIDs_, i)
......@@ -765,6 +739,42 @@ void Foam::motionSmoother::setDisplacement(pointField& patchDisp)
displacement_.boundaryField()[patchI] ==
displacement_.boundaryField()[patchI].patchInternalField();
}
}
void Foam::motionSmoother::setDisplacement(pointField& patchDisp)
{
// See comment in .H file about shared points.
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, i)
{
displacement_[meshPoints[i]] = vector::zero;
}
}
}
const labelList& ppMeshPoints = pp_.meshPoints();
// Set internal point data from displacement on combined patch points.
forAll(ppMeshPoints, patchPointI)
{
displacement_[ppMeshPoints[patchPointI]] = patchDisp[patchPointI];
}
// Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches)
setDisplacementPatchFields();
if (debug)
{
......
......@@ -385,6 +385,10 @@ public:
//- Take over existing mesh position.
void correct();
//- Set patch fields on displacement to be consistent with
// internal values.
void setDisplacementPatchFields();
//- Set displacement field from displacement on patch points.
// Modify provided displacement to be consistent with actual
// boundary conditions on displacement. Note: resets the
......
......@@ -25,7 +25,18 @@ Class
Foam::mappedPatchFieldBase
Description
Functionality for sampling fields using mappedPatchBase.
Functionality for sampling fields using mappedPatchBase. Every call to
mappedField() returns a sampled field, optionally scaled to maintain an
area-weighted average.
Example usage:
{
fieldName T; // default is same as fvPatchField
setAverage false;
average 1.0; // only if setAverage=true
interpolationScheme cellPoint; // default is cell
}
SourceFiles
mappedPatchFieldBase.C
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -29,7 +29,7 @@ Group
Description
This velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient condtion is
boundaries where the pressure is specified. A zero-gradient condition is
applied for outflow (as defined by the flux); for inflow, the velocity is
obtained from the patch-face normal component of the internal-cell value.
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -138,6 +138,7 @@ Foam::layerParameters::layerParameters
readLabel(dict.lookup("nSmoothSurfaceNormals"))
),
nSmoothNormals_(readLabel(dict.lookup("nSmoothNormals"))),
nSmoothDisplacement_(dict.lookupOrDefault("nSmoothDisplacement", 0)),
nSmoothThickness_(readLabel(dict.lookup("nSmoothThickness"))),
maxFaceThicknessRatio_
(
......@@ -278,7 +279,7 @@ Foam::layerParameters::layerParameters
const keyType& key = iter().keyword();
const labelHashSet patchIDs
(
boundaryMesh.patchSet(List<wordRe>(1, key))
boundaryMesh.patchSet(List<wordRe>(1, wordRe(key)))
);
if (patchIDs.size() == 0)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -119,6 +119,8 @@ private:
label nSmoothNormals_;
label nSmoothDisplacement_;
label nSmoothThickness_;
scalar maxFaceThicknessRatio_;
......@@ -275,6 +277,12 @@ public:
return layerTerminationCos_;
}
//- Smooth internal displacement
label nSmoothDisplacement() const
{
return nSmoothDisplacement_;
}
//- Smooth layer thickness over surface patches
label nSmoothThickness() const
{
......
......@@ -28,6 +28,7 @@ License
#include "faceZoneSet.H"
#include "searchableSurface.H"
#include "syncTools.H"
#include "Time.H"
#include "addToRunTimeSelectionTable.H"
......@@ -69,7 +70,15 @@ Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone
searchableSurface::New
(
word(dict.lookup("surface")),
mesh.objectRegistry::db(),
IOobject
(
dict.lookupOrDefault("name", mesh.objectRegistry::db().name()),
mesh.time().constant(),
"triSurface",
mesh.objectRegistry::db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
dict
)
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment