From 3c4200e62e1b41b304f796cf7b550a7cd9f8dd10 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 30 Jun 2008 11:09:38 +0100 Subject: [PATCH 1/3] update to make extrusion run-time selectable --- .../mesh/generation/extrudeMesh/Allwclean | 6 + .../mesh/generation/extrudeMesh/Allwmake | 6 + .../mesh/generation/extrudeMesh/Make/files | 1 + .../mesh/generation/extrudeMesh/Make/options | 5 +- .../extrudeMesh/createTimeExtruded.H | 4 +- .../mesh/generation/extrudeMesh/extrudeMesh.C | 77 +++------- .../extrudeMesh/extrudeModel/Make/files | 9 ++ .../extrudeMesh/extrudeModel/Make/options | 8 ++ .../extrudeModel/extrudeModel/extrudeModel.C | 66 +++++++++ .../extrudeModel/extrudeModel/extrudeModel.H | 136 ++++++++++++++++++ .../extrudeModel/newExtrudeModel.C | 59 ++++++++ .../extrudeModel/linearNormal/linearNormal.C | 79 ++++++++++ .../linearNormal/linearNormal.H} | 38 ++--- .../extrudeModel/linearRadial/linearRadial.C | 82 +++++++++++ .../linearRadial/linearRadial.H} | 42 +++--- .../extrudeModel/sigmaRadial/sigmaRadial.C | 87 +++++++++++ .../sigmaRadial/sigmaRadial.H} | 50 +++---- .../extrudeMesh/extrudeModel/wedge/wedge.C | 127 ++++++++++++++++ .../wedge/wedge.H} | 94 ++++-------- .../generation/extrudeMesh/extrudeProperties | 50 +++++++ .../extrudeMesh/extrudedMesh/extrudedMesh.C | 53 +++---- .../extrudeMesh/extrudedMesh/extrudedMesh.H | 33 ++--- .../mesh/generation/extrudeMesh/faceMesh.H | 14 +- .../mesh/generation/extrudeMesh/setRoots.H | 20 --- 24 files changed, 887 insertions(+), 259 deletions(-) create mode 100755 applications/utilities/mesh/generation/extrudeMesh/Allwclean create mode 100755 applications/utilities/mesh/generation/extrudeMesh/Allwmake create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/options create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.C create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.H create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.C rename applications/utilities/mesh/generation/extrudeMesh/{extrudedMesh/linearNormalExtruder.H => extrudeModel/linearNormal/linearNormal.H} (80%) create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.C rename applications/utilities/mesh/generation/extrudeMesh/{extrudedMesh/linearRadialExtruder.H => extrudeModel/linearRadial/linearRadial.H} (77%) create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.C rename applications/utilities/mesh/generation/extrudeMesh/{extrudedMesh/sigmaRadialExtruder.H => extrudeModel/sigmaRadial/sigmaRadial.H} (73%) create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C rename applications/utilities/mesh/generation/extrudeMesh/{extrudedMesh/wedgeExtruder.H => extrudeModel/wedge/wedge.H} (56%) create mode 100644 applications/utilities/mesh/generation/extrudeMesh/extrudeProperties diff --git a/applications/utilities/mesh/generation/extrudeMesh/Allwclean b/applications/utilities/mesh/generation/extrudeMesh/Allwclean new file mode 100755 index 0000000000..f7842e25d0 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/Allwclean @@ -0,0 +1,6 @@ +#!/bin/sh +set -x + +wclean libso extrudeModel +wclean + diff --git a/applications/utilities/mesh/generation/extrudeMesh/Allwmake b/applications/utilities/mesh/generation/extrudeMesh/Allwmake new file mode 100755 index 0000000000..876125ce82 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/Allwmake @@ -0,0 +1,6 @@ +#!/bin/sh +set -x + +wmake libso extrudeModel +wmake + diff --git a/applications/utilities/mesh/generation/extrudeMesh/Make/files b/applications/utilities/mesh/generation/extrudeMesh/Make/files index f5a718066d..08f746cc3f 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/Make/files +++ b/applications/utilities/mesh/generation/extrudeMesh/Make/files @@ -1,3 +1,4 @@ extrudeMesh.C EXE = $(FOAM_APPBIN)/extrudeMesh + diff --git a/applications/utilities/mesh/generation/extrudeMesh/Make/options b/applications/utilities/mesh/generation/extrudeMesh/Make/options index cd6c02a3f0..8326ac3b50 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/Make/options +++ b/applications/utilities/mesh/generation/extrudeMesh/Make/options @@ -1,8 +1,11 @@ EXE_INC = \ -IextrudedMesh \ + -IextrudeModel/lnInclude \ -I$(FOAM_SRC)/meshTools/lnInclude \ -I$(FOAM_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ -lmeshTools \ - -ldynamicMesh + -ldynamicMesh \ + -lextrudeModel + diff --git a/applications/utilities/mesh/generation/extrudeMesh/createTimeExtruded.H b/applications/utilities/mesh/generation/extrudeMesh/createTimeExtruded.H index 0774b15d2c..7a4ce1ed73 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/createTimeExtruded.H +++ b/applications/utilities/mesh/generation/extrudeMesh/createTimeExtruded.H @@ -3,6 +3,6 @@ Time runTimeExtruded ( Time::controlDictName, - rootDirTarget, - caseDirTarget + args.rootPath(), + args.caseName() ); diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index 6517e92e33..bcb9df59c0 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -23,39 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Extrude mesh from existing patch or from patch read from file. Merges close - points so be careful. + Extrude mesh from existing patch or from patch read from file. + Note: Merges close points so be careful. - Can do wedges: - - use wedgeExtruder instead of e.g. linearNormalExtruder - - extrusion is opposite the surface/patch normal so inwards the source - mesh - - axis direction has to be consistent with this. - - use -mergeFaces option if doing full 360 and want to merge front and back - - E.g. starting from 'movingWall' patch of cavity tutorial: - - we want to rotate around the left side of this patch (is at x=0,y=0.1) - for a full 360 degrees: - - wedgeExtruder - ( - point(0,0.1,0), // point on axis - vector(0,0,-1), // (normalized!) direction of axis - 360.0/180.0*mathematicalConstant::pi // angle - ) - - - note direction of axis. This should be consistent with rotating against - the patch normal direction. If you get it wrong you'll see all cells - with extreme aspect ratio and internal faces wrong way around in - checkMesh - - - call with e.g. 10 layers. Thickness argument (0.1) is not used! - - extrudeMesh 10 0.1 \ - -sourceRoot $FOAM_TUTORIALS/icoFoam \ - -sourceCase cavity \ - -sourcePatch movingWall - -mergeFaces + Type of extrusion prescribed by run-time selectable model. \*---------------------------------------------------------------------------*/ @@ -72,10 +43,7 @@ Description #include "perfectInterface.H" #include "extrudedMesh.H" -#include "linearNormalExtruder.H" -#include "linearRadialExtruder.H" -#include "sigmaRadialExtruder.H" -#include "wedgeExtruder.H" +#include "extrudeModel.H" using namespace Foam; @@ -99,6 +67,23 @@ int main(int argc, char *argv[]) autoPtr meshPtr(NULL); + autoPtr model + ( + extrudeModel::New + ( + IOdictionary + ( + IOobject + ( + "extrudeProperties", + runTimeExtruded.constant(), + runTimeExtruded, + IOobject::MUST_READ + ) + ) + ) + ); + if (args.options().found("sourceRoot")) { fileName rootDirSource(args.options()["sourceRoot"]); @@ -115,7 +100,6 @@ int main(int argc, char *argv[]) rootDirSource, caseDirSource ); - # include "createPolyMesh.H" label patchID = mesh.boundaryMesh().findPatchID(patchName); @@ -153,20 +137,7 @@ int main(int argc, char *argv[]) runTimeExtruded ), pp, - nLayers, // number of layers - linearNormalExtruder(-thickness) // overall thickness(signed!) - //wedgeExtruder - //( - // point(0,0.1,0), // point on axis - // vector(0,0,-1), // (normalized!) direction of axis - // 360.0/180.0*mathematicalConstant::pi // angle - //) - //wedgeExtruder - //( - // point(0,0,0), // point on axis - // vector(0,1,0), // (normalized!) direction of axis - // 30.0/180.0*mathematicalConstant::pi // angle - //) + model() ) ); } @@ -198,12 +169,10 @@ int main(int argc, char *argv[]) runTimeExtruded ), fMesh, - nLayers, // number of layers - linearNormalExtruder(-thickness) // overall thickness (signed!) + model() ) ); } - extrudedMesh& mesh = meshPtr(); diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files new file mode 100644 index 0000000000..c8d0cc571b --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/files @@ -0,0 +1,9 @@ +extrudeModel/extrudeModel.C +extrudeModel/newExtrudeModel.C +linearNormal/linearNormal.C +linearRadial/linearRadial.C +sigmaRadial/sigmaRadial.C +wedge/wedge.C + +LIB = $(FOAM_LIBBIN)/libextrudeModel + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/options b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/options new file mode 100644 index 0000000000..2a37902358 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/Make/options @@ -0,0 +1,8 @@ +EXE_INC = \ + -I$(FOAM_SRC)/meshTools/lnInclude \ + -I$(FOAM_SRC)/dynamicMesh/lnInclude + +EXE_LIBS = \ + -lmeshTools \ + -ldynamicMesh + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.C new file mode 100644 index 0000000000..50a6ab0886 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "extrudeModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(extrudeModel, 0); + defineRunTimeSelectionTable(extrudeModel, dictionary); +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::extrudeModel::extrudeModel +( + const word& modelType, + const dictionary& dict +) +: + nLayers_(readLabel(dict.lookup("nLayers"))), + dict_(dict), + coeffDict_(dict.subDict(modelType + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::extrudeModel::~extrudeModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::label Foam::extrudeModel::nLayers() const +{ + return nLayers_; +} + + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.H b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.H new file mode 100644 index 0000000000..a6d2fc741f --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/extrudeModel.H @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::extrudeModel + +Description + Top level extrusion model class + +SourceFiles + extrudeModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef extrudeModel_H +#define extrudeModel_H + +#include "dictionary.H" +#include "point.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class extrudeModel Declaration +\*---------------------------------------------------------------------------*/ + +class extrudeModel +{ +protected: + + // Protected data + + const label nLayers_; + + const dictionary& dict_; + + const dictionary& coeffDict_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + extrudeModel(const extrudeModel&); + + //- Disallow default bitwise assignment + void operator=(const extrudeModel&); + + +public: + + //- Runtime type information + TypeName("extrudeModel"); + + //- Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + extrudeModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from dictionary + extrudeModel(const word& modelType, const dictionary&); + + + // Selectors + + //- Select null constructed + static autoPtr New(const dictionary&); + + + //- Destructor + virtual ~extrudeModel(); + + + // Member Functions + + // Access + + label nLayers() const; + + + // Member Operators + + virtual point operator() + ( + const point& surfacePoint, + const vector& surfaceNormal, + const label layer + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C new file mode 100644 index 0000000000..4b076aa378 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/extrudeModel/newExtrudeModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "extrudeModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::extrudeModel::New +( + const dictionary& dict +) +{ + word extrudeModelType(dict.lookup("extrudeModel")); + + Info<< "Selecting extrudeModel " << extrudeModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(extrudeModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("extrudeModel::New(const dictionary&)") + << "Unknown extrudeModelType type " + << extrudeModelType + << ", constructor not in hash table" << nl << nl + << " Valid extrudeModel types are :" << nl + << dictionaryConstructorTablePtr_->toc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.C new file mode 100644 index 0000000000..74bb7ef501 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "linearNormal.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace extrudeModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(linearNormal, 0); + +addToRunTimeSelectionTable(extrudeModel, linearNormal, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +linearNormal::linearNormal(const dictionary& dict) +: + extrudeModel(typeName, dict), + thickness_(readScalar(coeffDict_.lookup("thickness"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +linearNormal::~linearNormal() +{} + + +// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // + +point linearNormal::operator() +( + const point& surfacePoint, + const vector& surfaceNormal, + const label layer +) const +{ + scalar d = thickness_*layer/nLayers_; + return surfacePoint + d*surfaceNormal; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace extrudeModels +} // End namespace Foam + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearNormalExtruder.H b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.H similarity index 80% rename from applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearNormalExtruder.H rename to applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.H index d1c86f97df..1b6e499888 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearNormalExtruder.H +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearNormal/linearNormal.H @@ -23,27 +23,33 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::linearNormalExtruder + Foam::extrudeModels::linearNormal Description + Extrudes by transforming points normal to the surface by a given distance \*---------------------------------------------------------------------------*/ -#ifndef linearNormalExtruder_H -#define linearNormalExtruder_H +#ifndef linearNormal_H +#define linearNormal_H #include "point.H" +#include "extrudeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace extrudeModels +{ /*---------------------------------------------------------------------------*\ - Class linearNormalExtruder Declaration + Class linearNormal Declaration \*---------------------------------------------------------------------------*/ -class linearNormalExtruder +class linearNormal +: + public extrudeModel { // Private data @@ -53,13 +59,17 @@ class linearNormalExtruder public: + //- Runtime type information + TypeName("linearNormal"); + // Constructors //- Construct from components - linearNormalExtruder(const scalar thickness) - : - thickness_(thickness) - {} + linearNormal(const dictionary& dict); + + + //- Destructor + ~linearNormal(); // Member Operators @@ -68,19 +78,14 @@ public: ( const point& surfacePoint, const vector& surfaceNormal, - const label nLayers, const label layer - ) const - { - scalar d = thickness_*layer/nLayers; - - return surfacePoint + d*surfaceNormal; - } + ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace extrudeModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -88,3 +93,4 @@ public: #endif // ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.C new file mode 100644 index 0000000000..3c9ab8162a --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "linearRadial.H" +#include "addToRunTimeSelectionTable.H" + +namespace Foam +{ +namespace extrudeModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(linearRadial, 0); + +addToRunTimeSelectionTable(extrudeModel, linearRadial, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +linearRadial::linearRadial(const dictionary& dict) +: + extrudeModel(typeName, dict), + R_(readScalar(coeffDict_.lookup("R"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +linearRadial::~linearRadial() +{} + + +// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // + +point linearRadial::operator() +( + const point& surfacePoint, + const vector& surfaceNormal, + const label layer +) const +{ + // radius of the surface + scalar rs = mag(surfacePoint); + vector rsHat = surfacePoint/rs; + + scalar delta = (R_ - rs)/nLayers_; + scalar r = rs + layer*delta; + return r*rsHat; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace extrudeModels +} // End namespace Foam + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearRadialExtruder.H b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.H similarity index 77% rename from applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearRadialExtruder.H rename to applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.H index 5a20c66042..be6073da99 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/linearRadialExtruder.H +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/linearRadial/linearRadial.H @@ -23,27 +23,31 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::linearRadialExtruder + Foam::extrudeModels::linearRadial Description \*---------------------------------------------------------------------------*/ -#ifndef linearRadialExtruder_H -#define linearRadialExtruder_H +#ifndef linearRadial_H +#define linearRadial_H -#include "point.H" +#include "extrudeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace extrudeModels +{ /*---------------------------------------------------------------------------*\ - Class linearRadialExtruder Declaration + Class linearRadial Declaration \*---------------------------------------------------------------------------*/ -class linearRadialExtruder +class linearRadial +: + public extrudeModel { // Private data @@ -52,13 +56,17 @@ class linearRadialExtruder public: + //- Runtime type information + TypeName("linearRadial"); + // Constructors //- Construct from components - linearRadialExtruder(const scalar R) - : - R_(R) - {} + linearRadial(const dictionary& dict); + + + //- Destructor + ~linearRadial(); // Member Operators @@ -67,23 +75,14 @@ public: ( const point& surfacePoint, const vector& surfaceNormal, - const label nLayers, const label layer - ) const - { - // radius of the surface - scalar rs = mag(surfacePoint); - vector rsHat = surfacePoint/rs; - - scalar delta = (R_ - rs)/nLayers; - scalar r = rs + layer*delta; - return r*rsHat; - } + ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace extrudeModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -91,3 +90,4 @@ public: #endif // ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.C new file mode 100644 index 0000000000..b1536800bb --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "sigmaRadial.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace extrudeModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(sigmaRadial, 0); + +addToRunTimeSelectionTable(extrudeModel, sigmaRadial, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +sigmaRadial::sigmaRadial(const dictionary& dict) +: + extrudeModel(typeName, dict), + RTbyg_(readScalar(coeffDict_.lookup("RTbyg"))), + pRef_(readScalar(coeffDict_.lookup("pRef"))), + pStrat_(readScalar(coeffDict_.lookup("pStrat"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +sigmaRadial::~sigmaRadial() +{} + + +// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // + +point sigmaRadial::operator() +( + const point& surfacePoint, + const vector& surfaceNormal, + const label layer +) const +{ + // radius of the surface + scalar rs = mag(surfacePoint); + vector rsHat = surfacePoint/rs; + + scalar p = pRef_ - layer*(pRef_ - pStrat_)/nLayers_; + scalar r = rs - RTbyg_*log(p/pRef_); + + return r*rsHat; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace extrudeModels +} // End namespace Foam + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/sigmaRadialExtruder.H b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.H similarity index 73% rename from applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/sigmaRadialExtruder.H rename to applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.H index 9bc1bfc6ae..4819ded58c 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/sigmaRadialExtruder.H +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/sigmaRadial/sigmaRadial.H @@ -23,27 +23,31 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::sigmaRadialExtruder + Foam::extrudeModels::sigmaRadial Description \*---------------------------------------------------------------------------*/ -#ifndef sigmaRadialExtruder_H -#define sigmaRadialExtruder_H +#ifndef sigmaRadial_H +#define sigmaRadial_H -#include "point.H" +#include "extrudeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace extrudeModels +{ /*---------------------------------------------------------------------------*\ - Class sigmaRadialExtruder Declaration + Class sigmaRadial Declaration \*---------------------------------------------------------------------------*/ -class sigmaRadialExtruder +class sigmaRadial +: + public extrudeModel { // Private data @@ -54,20 +58,17 @@ class sigmaRadialExtruder public: + //- Runtime type information + TypeName("sigmaRadial"); + // Constructors //- Construct from components - sigmaRadialExtruder - ( - const scalar RTbyg, - const scalar pRef, - const scalar pStrat - ) - : - RTbyg_(RTbyg), - pRef_(pRef), - pStrat_(pStrat) - {} + sigmaRadial(const dictionary& dict); + + + //-Destructor + ~sigmaRadial(); // Member Operators @@ -76,24 +77,14 @@ public: ( const point& surfacePoint, const vector& surfaceNormal, - const label nLayers, const label layer - ) const - { - // radius of the surface - scalar rs = mag(surfacePoint); - vector rsHat = surfacePoint/rs; - - scalar p = pRef_ - layer*(pRef_ - pStrat_)/nLayers; - scalar r = rs - RTbyg_*Foam::log(p/pRef_); - - return r*rsHat; - } + ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace extrudeModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -101,3 +92,4 @@ public: #endif // ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C new file mode 100644 index 0000000000..589d04443a --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "wedge.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace extrudeModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(wedge, 0); + +addToRunTimeSelectionTable(extrudeModel, wedge, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +wedge::wedge(const dictionary& dict) +: + extrudeModel(typeName, dict), + axisPt_(coeffDict_.lookup("axisPt")), + axisNormal_(coeffDict_.lookup("axisNormal")), + angle_ + ( + readScalar(coeffDict_.lookup("angle")) + *mathematicalConstant::pi/180.0 + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +wedge::~wedge() +{} + + +// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // + +point wedge::operator() +( + const point& surfacePoint, + const vector& surfaceNormal, + const label layer +) const +{ + scalar sliceAngle; + // For the case of a single layer extrusion assume a + // symmetric wedge about the reference plane is required + if (nLayers_ == 1) + { + if (layer == 0) + { + sliceAngle = -angle_/2.0; + } + else + { + sliceAngle = angle_/2.0; + } + } + else + { + sliceAngle = angle_*(layer + 1)/nLayers_; + } + + // Find projection onto axis (or rather decompose surfacePoint + // into vector along edge (proj), vector normal to edge in plane + // of surface point and surface normal. + point d = surfacePoint - axisPt_; + + d -= (axisNormal_ & d)*axisNormal_; + + scalar dMag = mag(d); + + point edgePt = surfacePoint - d; + + // Rotate point around sliceAngle. + point rotatedPoint = edgePt; + + if (dMag > VSMALL) + { + vector n = (d/dMag) ^ axisNormal_; + + rotatedPoint += + + cos(sliceAngle)*d + - sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal + } + + return rotatedPoint; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace extrudeModels +} // End namespace Foam + +// ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/wedgeExtruder.H b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.H similarity index 56% rename from applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/wedgeExtruder.H rename to applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.H index b4d6c68644..681cff2c7f 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/wedgeExtruder.H +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.H @@ -23,29 +23,40 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::wedgeExtruder + Foam::extrudeModels::wedge Description Extrudes by rotating a surface around an axis - + - extrusion is opposite the surface/patch normal so inwards the source + mesh + - axis direction has to be consistent with this. + - use -mergeFaces option if doing full 360 and want to merge front and back + - note direction of axis. This should be consistent with rotating against + the patch normal direction. If you get it wrong you'll see all cells + with extreme aspect ratio and internal faces wrong way around in + checkMesh \*---------------------------------------------------------------------------*/ -#ifndef wedgeExtruder_H -#define wedgeExtruder_H +#ifndef wedge_H +#define wedge_H -#include "point.H" +#include "extrudeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace extrudeModels +{ /*---------------------------------------------------------------------------*\ - Class wedgeExtruder Declaration + Class wedge Declaration \*---------------------------------------------------------------------------*/ -class wedgeExtruder +class wedge +: + public extrudeModel { // Private data @@ -58,22 +69,19 @@ class wedgeExtruder //- overall angle (radians) const scalar angle_; + public: + //- Runtime type information + TypeName("wedge"); + // Constructors //- Construct from components - wedgeExtruder - ( - const point& axisPt, - const point& axisNormal, - const scalar angle - ) - : - axisPt_(axisPt), - axisNormal_(axisNormal), - angle_(angle) - {} + wedge(const dictionary& dict); + + //- Destrcuctor + ~wedge(); // Member Operators @@ -82,60 +90,14 @@ public: ( const point& surfacePoint, const vector& surfaceNormal, - const label nLayers, const label layer - ) const - { - scalar sliceAngle; - - // For the case of a single layer extrusion assume a - // symmetric wedge about the reference plane is required - if (nLayers == 1) - { - if (layer == 0) - { - sliceAngle = -angle_/2.0; - } - else - { - sliceAngle = angle_/2.0; - } - } - else - { - sliceAngle = angle_ * (layer+1)/nLayers; - } - - // Find projection onto axis (or rather decompose surfacePoint - // into vector along edge (proj), vector normal to edge in plane - // of surface point and surface normal. - point d = surfacePoint - axisPt_; - - d -= (axisNormal_&d)*axisNormal_; - - scalar dMag = mag(d); - - point edgePt = surfacePoint - d; - - // Rotate point around sliceAngle. - point rotatedPoint = edgePt; - - if (dMag > VSMALL) - { - vector n = (d/dMag) ^ axisNormal_; - - rotatedPoint += - + cos(sliceAngle)*d - - sin(sliceAngle)*mag(d)*n; // Use either n or surfaceNormal - } - - return rotatedPoint; - } + ) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace extrudeModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties new file mode 100644 index 0000000000..c9b7977508 --- /dev/null +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +extrudeModel wedge; +//extrudeModel linearNormal; +//extrudeModel linearRadial; +//extrudeModel sigmaRadial; + +nLayers 1; + +wedgeCoeffs +{ + axisPt (0 0 0); + axisNormal (0 -1 0); + angle 2.0; +} + +linearNormalCoeffs +{ + thickness 0.1; +} + +linearRadialCoeffs +{ + R 0.1; +} + +sigmaRadialCoeffs +{ + RTbyg 1; + pRef 1; + pStrat 1; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C index 6ac35c797f..b650224ec8 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C @@ -46,19 +46,19 @@ template < class Face, template class FaceList, - class PointField, - class PointExtruder + class PointField > Foam::pointField Foam::extrudedMesh::extrudedPoints ( const PrimitivePatch& extrudePatch, - const label nLayers, - const PointExtruder& extruder + const extrudeModel& model ) { const pointField& surfacePoints = extrudePatch.localPoints(); const vectorField& surfaceNormals = extrudePatch.pointNormals(); + const label nLayers = model.nLayers(); + pointField ePoints((nLayers + 1)*surfacePoints.size()); for (label layer=0; layer<=nLayers; layer++) @@ -67,11 +67,10 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints forAll(surfacePoints, i) { - ePoints[offset + i] = extruder + ePoints[offset + i] = model ( surfacePoints[i], surfaceNormals[i], - nLayers, layer ); } @@ -85,7 +84,7 @@ template class FaceList, class PointField> Foam::faceList Foam::extrudedMesh::extrudedFaces ( const PrimitivePatch& extrudePatch, - const label nLayers + const extrudeModel& model ) { const pointField& surfacePoints = extrudePatch.localPoints(); @@ -93,6 +92,8 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces const edgeList& surfaceEdges = extrudePatch.edges(); const label nInternalEdges = extrudePatch.nInternalEdges(); + const label nLayers = model.nLayers(); + label nFaces = (nLayers + 1)*surfaceFaces.size() + nLayers*surfaceEdges.size(); @@ -108,7 +109,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces label nextLayerOffset = currentLayerOffset + surfacePoints.size(); // Side faces from layer to layer+1 - for (label i = 0; i < nInternalEdges; i++) + for (label i=0; i class FaceList, class PointField> Foam::cellList Foam::extrudedMesh::extrudedCells ( const PrimitivePatch& extrudePatch, - const label nLayers + const extrudeModel& model ) { const List& surfaceFaces = extrudePatch.localFaces(); const edgeList& surfaceEdges = extrudePatch.edges(); const label nInternalEdges = extrudePatch.nInternalEdges(); + const label nLayers = model.nLayers(); + cellList eCells(nLayers*surfaceFaces.size()); // Size the cells @@ -200,7 +203,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells for (label layer=0; layer class FaceList, - class PointField, - class PointExtruder + class PointField > Foam::extrudedMesh::extrudedMesh ( const IOobject& io, const PrimitivePatch& extrudePatch, - const label nLayers, - const PointExtruder& extruder + const extrudeModel& model ) : polyMesh ( io, - extrudedPoints(extrudePatch, nLayers, extruder), - extrudedFaces(extrudePatch, nLayers), - extrudedCells(extrudePatch, nLayers) - ) + extrudedPoints(extrudePatch, model), + extrudedFaces(extrudePatch, model), + extrudedCells(extrudePatch, model) + ), + model_(model) { List patches(3); label facei = nInternalFaces(); - label sz = nLayers*(extrudePatch.nEdges() - extrudePatch.nInternalEdges()); + label sz = + model_.nLayers() + *(extrudePatch.nEdges() - extrudePatch.nInternalEdges()); patches[0] = new wallPolyPatch ( @@ -351,3 +355,4 @@ Foam::extrudedMesh::extrudedMesh // ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H index b40210cfa2..71bfb2e07b 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H @@ -36,6 +36,7 @@ SourceFiles #define extrudedMesh_H #include "polyMesh.H" +#include "extrudeModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,24 +51,22 @@ class extrudedMesh : public polyMesh { + // Private data + + const extrudeModel& model_; + + // Private Member Functions //- Do edge and face use points in same order? static bool sameOrder(const face&, const edge&); //- Construct and return the extruded mesh points - template - < - class Face, - template class FaceList, - class PointField, - class PointExtruder - > + template class FaceList, class PointField> pointField extrudedPoints ( const PrimitivePatch& extrudePatch, - const label nLayers, - const PointExtruder& extruder + const extrudeModel& model ); //- Construct and return the extruded mesh faces @@ -75,7 +74,7 @@ class extrudedMesh faceList extrudedFaces ( const PrimitivePatch& extrudePatch, - const label nLayers + const extrudeModel& model ); //- Construct and return the extruded mesh cells @@ -83,7 +82,7 @@ class extrudedMesh cellList extrudedCells ( const PrimitivePatch& extrudePatch, - const label nLayers + const extrudeModel& model ); @@ -99,19 +98,12 @@ public: // Constructors //- Construct from the primitivePatch to extrude - template - < - class Face, - template class FaceList, - class PointField, - class PointExtruder - > + template class FaceList, class PointField> extrudedMesh ( const IOobject& io, const PrimitivePatch& extrudePatch, - const label nLayers, - const PointExtruder& extruder + const extrudeModel& model ); }; @@ -133,3 +125,4 @@ public: #endif // ************************************************************************* // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H index cb5f89a7e1..a9714d9bac 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H +++ b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H @@ -51,12 +51,14 @@ class faceMesh : public PrimitivePatch { - PrimitivePatch read(Istream& is) - { - pointField points(is); - faceList faces(is); - return PrimitivePatch(faces, points); - } + // Private member functions + + PrimitivePatch read(Istream& is) + { + pointField points(is); + faceList faces(is); + return PrimitivePatch(faces, points); + } public: diff --git a/applications/utilities/mesh/generation/extrudeMesh/setRoots.H b/applications/utilities/mesh/generation/extrudeMesh/setRoots.H index fd37e12e37..255949426b 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/setRoots.H +++ b/applications/utilities/mesh/generation/extrudeMesh/setRoots.H @@ -1,13 +1,6 @@ argList::validArgs.clear(); argList::noParallel(); - argList::validArgs.append("target root"); - argList::validArgs.append("target case"); - - argList::validArgs.append("nLayers"); - argList::validArgs.append("overal thickness"); - - argList::validOptions.insert("sourceRoot", "source root"); argList::validOptions.insert("sourceCase", "source case"); argList::validOptions.insert("sourcePatch", "source patch"); @@ -23,16 +16,3 @@ FatalError.exit(); } - - fileName rootDirTarget(args.additionalArgs()[0]); - fileName caseDirTarget(args.additionalArgs()[1]); - - label nLayers(readLabel(IStringStream(args.additionalArgs()[2])())); - scalar thickness(readScalar(IStringStream(args.additionalArgs()[3])())); - - Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl; - - Info<< "Extruding layers:" << nl - << " number of layers " << nLayers << nl - << " overall thickness " << thickness << nl - << endl; From ad42db8f07f5e928c7d78d284a036447ca47e6fd Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 30 Jun 2008 11:16:12 +0100 Subject: [PATCH 2/3] fix typo in p solver selection --- tutorials/rasCavitatingFoam/throttle/system/fvSolution | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/rasCavitatingFoam/throttle/system/fvSolution b/tutorials/rasCavitatingFoam/throttle/system/fvSolution index ecacbfeb1d..f6bad1ada0 100644 --- a/tutorials/rasCavitatingFoam/throttle/system/fvSolution +++ b/tutorials/rasCavitatingFoam/throttle/system/fvSolution @@ -46,7 +46,7 @@ solvers p GAMG { - preconditioner 1e-5; + tolerance 1e-8; relTol 0; smoother GaussSeidel; From 2573b0e8f11de7a7c072c0b8d7ca146023786782 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 30 Jun 2008 11:33:15 +0100 Subject: [PATCH 3/3] consistency update - 0.orig->0.org --- tutorials/lesCavitatingFoam/Allclean | 2 +- tutorials/lesCavitatingFoam/Allrun | 3 ++- tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/U | 0 tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/gamma | 0 tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/k | 0 tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/nuSgs | 0 tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/p | 0 tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/rho | 0 8 files changed, 3 insertions(+), 2 deletions(-) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/U (100%) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/gamma (100%) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/k (100%) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/nuSgs (100%) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/p (100%) rename tutorials/lesCavitatingFoam/throttle3D/{0.orig => 0.org}/rho (100%) diff --git a/tutorials/lesCavitatingFoam/Allclean b/tutorials/lesCavitatingFoam/Allclean index d37677187f..35d86a2121 100755 --- a/tutorials/lesCavitatingFoam/Allclean +++ b/tutorials/lesCavitatingFoam/Allclean @@ -14,7 +14,7 @@ cd .. cd throttle3D rm -rf constant/polyMesh/sets > /dev/null 2>&1 rm -rf 0 > /dev/null 2>&1 - cp -r 0.orig 0 + cp -r 0.org 0 rm system/cellSetDict > /dev/null 2>&1 rm -rf processor[0-9] > /dev/null 2>&1 diff --git a/tutorials/lesCavitatingFoam/Allrun b/tutorials/lesCavitatingFoam/Allrun index f16d9a5c00..33517002c0 100755 --- a/tutorials/lesCavitatingFoam/Allrun +++ b/tutorials/lesCavitatingFoam/Allrun @@ -26,7 +26,7 @@ cd throttle cd .. cd throttle3D - cp -r 0.orig 0 + cp -r 0.org 0 runApplication blockMesh @@ -42,3 +42,4 @@ cd throttle3D runParallel $application 4 system/machines runApplication reconstructPar cd .. + diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/U b/tutorials/lesCavitatingFoam/throttle3D/0.org/U similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/U rename to tutorials/lesCavitatingFoam/throttle3D/0.org/U diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/gamma b/tutorials/lesCavitatingFoam/throttle3D/0.org/gamma similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/gamma rename to tutorials/lesCavitatingFoam/throttle3D/0.org/gamma diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/k b/tutorials/lesCavitatingFoam/throttle3D/0.org/k similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/k rename to tutorials/lesCavitatingFoam/throttle3D/0.org/k diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/nuSgs b/tutorials/lesCavitatingFoam/throttle3D/0.org/nuSgs similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/nuSgs rename to tutorials/lesCavitatingFoam/throttle3D/0.org/nuSgs diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/p b/tutorials/lesCavitatingFoam/throttle3D/0.org/p similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/p rename to tutorials/lesCavitatingFoam/throttle3D/0.org/p diff --git a/tutorials/lesCavitatingFoam/throttle3D/0.orig/rho b/tutorials/lesCavitatingFoam/throttle3D/0.org/rho similarity index 100% rename from tutorials/lesCavitatingFoam/throttle3D/0.orig/rho rename to tutorials/lesCavitatingFoam/throttle3D/0.org/rho