Commit b07e4f55 authored by Henry's avatar Henry
Browse files

Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

parents b2b3d049 5a62444c
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
buoyantSimpleRadiationFoam
buoyantSimpleFoam
Description
Steady-state solver for buoyant, turbulent flow of compressible fluids,
......
......@@ -337,55 +337,75 @@ addLayersControls
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 60;
// At non-patched sides allow mesh to slip if extrusion direction makes
// angle larger than slipFeatureAngle.
slipFeatureAngle 30;
// Static analysis of starting mesh
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 130;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Patch displacement
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Medial axis analysis
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130
// in 17x.
minMedianAxisAngle 90;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Optional: smooth displacement after medial axis determination.
// default is 0.
nSmoothDisplacement 90;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Mesh shrinking
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Optional: at non-patched sides allow mesh to slip if extrusion
// direction makes angle larger than slipFeatureAngle. Default is
// 0.5*featureAngle.
slipFeatureAngle 30;
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
// Overall max number of layer addition iterations. The mesher will
// exit if it reaches this number of iterations; possibly with an
// illegal mesh.
nLayerIter 50;
// Max number of iterations after which relaxed meshQuality controls
// get used. Up to nRelaxIter it uses the settings in meshQualityControls,
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
nRelaxedIter 20;
// Max number of iterations after which relaxed meshQuality controls
// get used. Up to nRelaxIter it uses the settings in
// meshQualityControls,
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
nRelaxedIter 20;
// Additional reporting: if there are just a few faces where there
// are mesh errors (after adding the layers) print their face centres.
// This helps in tracking down problematic mesh areas.
//additionalReporting true;
// Additional reporting: if there are just a few faces where there
// are mesh errors (after adding the layers) print their face centres.
// This helps in tracking down problematic mesh areas.
//additionalReporting true;
}
// Generic mesh quality settings. At any undoable phase these determine
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -97,7 +97,7 @@ void Foam::faceSelections::searchableSurfaceSelection::select
// Boundary faces
vectorField neighbourCellCentres;
syncTools::swapBoundaryCellList
syncTools::swapBoundaryCellPositions
(
mesh_,
mesh_.cellCentres(),
......
......@@ -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 anispulation |
-------------------------------------------------------------------------------
License
......@@ -494,7 +494,13 @@ autoPtr<mapPolyMesh> reorderMesh
newFlipMap[i] = fZone.flipMap()[i];
}
}
fZone.resetAddressing(newAddressing, newFlipMap);
labelList newToOld;
sortedOrder(newAddressing, newToOld);
fZone.resetAddressing
(
UIndirectList<label>(newAddressing, newToOld)(),
UIndirectList<bool>(newFlipMap, newToOld)()
);
}
}
// Re-do the cellZones
......@@ -508,6 +514,7 @@ autoPtr<mapPolyMesh> reorderMesh
reverseCellOrder,
cellZones[zoneI]
)();
Foam::sort(cellZones[zoneI]);
}
}
......
......@@ -1404,6 +1404,7 @@ int main(int argc, char *argv[])
(
"splits mesh into multiple regions (detected by walking across faces)"
);
# include "addRegionOption.H"
#include "addOverwriteOption.H"
argList::addBoolOption
(
......@@ -1467,7 +1468,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createMesh.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
word blockedFacesName;
......
......@@ -9,6 +9,9 @@ EXE_INC = \
EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lLESdeltas \
-lreactionThermophysicalModels \
-lfiniteVolume \
-lgenericPatchFields \
......
createExternalCoupledPatchGeometry.C
EXE = $(FOAM_APPBIN)/createExternalCoupledPatchGeometry
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lcompressibleTurbulenceModel
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
createExternalCoupledPatchGeometry.
Description
Application to generate the patch geometry (points and faces) for use
with the externalCoupled boundary condition.
Usage:
createExternalCoupledPatchGeometry <fieldName>
On execution, the field <fieldName> is read, and its boundary conditions
interrogated for the presence of an \c externalCoupled type. If found,
the patch geometry (points and faces) for the coupled patches are output
to the communications folder.
Note:
The addressing is patch-local, i.e. point indices for each patch point
used for face addressing starts at index 0.
SeeAlso
externalCoupledMixedFvPatchField
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "createExternalCoupledPatchGeometryTemplates.H"
#include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "addRegionOption.H"
argList::validArgs.append("fieldName");
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const word fieldName = args[1];
IOobjectList objects(IOobjectList(mesh, mesh.time().timeName()));
label processed = -1;
processField<scalar>(mesh, objects, fieldName, processed);
processField<vector>(mesh, objects, fieldName, processed);
processField<sphericalTensor>(mesh, objects, fieldName, processed);
processField<symmTensor>(mesh, objects, fieldName, processed);
processField<tensor>(mesh, objects, fieldName, processed);
if (processed == -1)
{
Info<< "Field " << fieldName << " not found" << endl;
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "createExternalCoupledPatchGeometryTemplates.H"
#include "externalCoupledMixedFvPatchField.H"
#include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void processField
(
const fvMesh& mesh,
const IOobjectList& objects,
const word& fieldName,
label& processed
)
{
if (processed != -1)
{
return;
}
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const word timeName(mesh.time().timeName());
IOobjectList fieldObjbjects(objects.lookupClass(fieldType::typeName));
if (fieldObjbjects.lookup(fieldName) != NULL)
{
fieldType vtf(*fieldObjbjects.lookup(fieldName), mesh);
const typename fieldType::GeometricBoundaryField& bf =
vtf.boundaryField();
forAll(bf, patchI)
{
if (isA<externalCoupledMixedFvPatchField<Type> >(bf[patchI]))
{
Info<< "Generating external coupled geometry for field "
<< fieldName << endl;
const externalCoupledMixedFvPatchField<Type>& pf =
refCast<const externalCoupledMixedFvPatchField<Type> >
(
bf[patchI]
);
pf.writeGeometry();
processed = 1;
break;
}
}
if (processed != 1)
{
processed = 0;
Info<< "Field " << fieldName << " found, but does not have any "
<< externalCoupledMixedFvPatchField<Type>::typeName
<< " boundary conditions" << endl;
}
}
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef createExternalCoupledPatchGeometryTemplates_H
#define createExternalCoupledPatchGeometryTemplates_H
#include "word.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
void processField(bool& processed, const word& fieldName);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "createExternalCoupledPatchGeometryTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -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
......@@ -148,6 +148,27 @@ Foam::IOobject* Foam::IOobjectList::lookup(const word& name) const
}
Foam::IOobjectList Foam::IOobjectList::lookupRe(const wordRe& name) const
{
IOobjectList objectsOfName(size());
forAllConstIter(HashPtrTable<IOobject>, *this, iter)
{
if (name.match(iter()->name()))
{
if (IOobject::debug)
{
Info<< "IOobjectList::lookupRe : found " << iter.key() << endl;
}
objectsOfName.insert(iter.key(), new IOobject(*iter()));
}
}
return objectsOfName;
}
Foam::IOobjectList Foam::IOobjectList::lookupClass(const word& ClassName) const
{
IOobjectList objectsOfClass(size());
......
......@@ -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
......@@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class IOobjectList Declaration
Class IOobjectList Declaration
\*---------------------------------------------------------------------------*/
class IOobjectList
......@@ -91,6 +91,9 @@ public:
//- Lookup a given name and return IOobject ptr if found else NULL
IOobject* lookup(const word& name) const;
//- Return the list for all IOobects whose name matches name
IOobjectList lookupRe(const wordRe& name) const;
//- Return the list for all IOobjects of a given class
IOobjectList lookupClass(const word& className) const;
......
......@@ -163,6 +163,10 @@ public:
template<class Type>
HashTable<Type*> lookupClass(const bool strict = false);
//- Return the list of objects whose name matches the input regExp
template<class Type>
wordList foundObjectRe(const wordRe& name) const;
//- Is the named Type found?
template<class Type>
bool foundObject(const word& name) const;
......
......@@ -127,6 +127,31 @@ bool Foam::objectRegistry::foundObject(const word& name) const
}
template<class Type>
Foam::wordList Foam::objectRegistry::foundObjectRe(const wordRe& name) const
{
wordList objectNames(size());
label count = 0;
forAllConstIter(HashTable<regIOobject*>, *this, iter)
{
if (isA<Type>(*iter()))
{
const word& objectName = iter()->name();
if (name.match(objectName))
{
objectNames[count++] = objectName;
}
}
}
objectNames.setSize(count);
return objectNames;
}
template<class Type>
const Type& Foam::objectRegistry::lookupObject(const word& name) const
{
......
......@@ -254,8 +254,8 @@ public:
);
//- Gather points and faces onto master and merge (geometrically) into
// single patch.
//- Gather points and faces onto master and merge into single patch.
// Note: uses faces/points, not localFaces/localPoints.
template
<
class Face,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -52,7 +52,8 @@ void Foam::PatchTools::gatherAndMerge
labelList pointSizes;
{
List<Field<PointType> > gatheredPoints(Pstream::nProcs());
gatheredPoints[Pstream::myProcNo()] = p.localPoints();
gatheredPoints[Pstream::myProcNo()] = p.points();
Pstream::gatherList(gatheredPoints);
if (Pstream::master())
......@@ -75,7 +76,7 @@ void Foam::PatchTools::gatherAndMerge
// gathered points
{
List<List<Face> > gatheredFaces(Pstream::nProcs());