Merge branch 'master' of ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev
This commit is contained in:
commit
24610e1c00
6
applications/utilities/mesh/generation/extrudeMesh/Allwclean
Executable file
6
applications/utilities/mesh/generation/extrudeMesh/Allwclean
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
wclean libso extrudeModel
|
||||
wclean
|
||||
|
6
applications/utilities/mesh/generation/extrudeMesh/Allwmake
Executable file
6
applications/utilities/mesh/generation/extrudeMesh/Allwmake
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
wmake libso extrudeModel
|
||||
wmake
|
||||
|
@ -1,3 +1,4 @@
|
||||
extrudeMesh.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/extrudeMesh
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -3,6 +3,6 @@
|
||||
Time runTimeExtruded
|
||||
(
|
||||
Time::controlDictName,
|
||||
rootDirTarget,
|
||||
caseDirTarget
|
||||
args.rootPath(),
|
||||
args.caseName()
|
||||
);
|
||||
|
@ -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 <root> <case> 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<extrudedMesh> meshPtr(NULL);
|
||||
|
||||
autoPtr<extrudeModel> 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();
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -0,0 +1,8 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/meshTools/lnInclude \
|
||||
-I$(FOAM_SRC)/dynamicMesh/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh
|
||||
|
@ -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_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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<extrudeModel> 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
|
||||
|
||||
// ************************************************************************* //
|
@ -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> 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<extrudeModel>(cstrIter()(dict));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -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
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -46,19 +46,19 @@ template
|
||||
<
|
||||
class Face,
|
||||
template<class> class FaceList,
|
||||
class PointField,
|
||||
class PointExtruder
|
||||
class PointField
|
||||
>
|
||||
Foam::pointField Foam::extrudedMesh::extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& 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 Face, template<class> class FaceList, class PointField>
|
||||
Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& 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<nInternalEdges; i++)
|
||||
{
|
||||
quad[0] = surfaceEdges[i][1] + currentLayerOffset;
|
||||
quad[1] = surfaceEdges[i][0] + currentLayerOffset;
|
||||
@ -140,7 +141,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
label nextLayerOffset = currentLayerOffset + surfacePoints.size();
|
||||
|
||||
// Side faces across layer
|
||||
for (label i = nInternalEdges; i < surfaceEdges.size(); i++)
|
||||
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
|
||||
{
|
||||
const edge& e = surfaceEdges[i];
|
||||
quad[0] = e[1] + currentLayerOffset;
|
||||
@ -162,7 +163,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
// Top faces
|
||||
forAll(surfaceFaces, i)
|
||||
{
|
||||
eFaces[facei++] = face(surfaceFaces[i]);
|
||||
eFaces[facei++] = face(surfaceFaces[i]);
|
||||
}
|
||||
|
||||
// Bottom faces
|
||||
@ -172,7 +173,7 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
|
||||
face
|
||||
(
|
||||
surfaceFaces[i].reverseFace()
|
||||
+ nLayers*surfacePoints.size()
|
||||
+ nLayers*surfacePoints.size()
|
||||
);
|
||||
}
|
||||
|
||||
@ -184,13 +185,15 @@ template<class Face, template<class> class FaceList, class PointField>
|
||||
Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const label nLayers
|
||||
const extrudeModel& model
|
||||
)
|
||||
{
|
||||
const List<face>& 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<nLayers; layer++)
|
||||
{
|
||||
eCells[i+layer*surfaceFaces.size()].setSize(f.size() + 2);
|
||||
eCells[i + layer*surfaceFaces.size()].setSize(f.size() + 2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,7 +216,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
for (label layer=0; layer<nLayers; layer++)
|
||||
{
|
||||
// Side faces from layer to layer+1
|
||||
for (label i = 0; i < nInternalEdges; i++)
|
||||
for (label i=0; i<nInternalEdges; i++)
|
||||
{
|
||||
// Get patch faces using edge
|
||||
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
|
||||
@ -248,7 +251,7 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
|
||||
for (label layer=0; layer<nLayers; layer++)
|
||||
{
|
||||
// Side faces across layer
|
||||
for (label i = nInternalEdges; i < surfaceEdges.size(); i++)
|
||||
for (label i=nInternalEdges; i<surfaceEdges.size(); i++)
|
||||
{
|
||||
// Get patch faces using edge
|
||||
const labelList& edgeFaces = extrudePatch.edgeFaces()[i];
|
||||
@ -290,30 +293,31 @@ template
|
||||
<
|
||||
class Face,
|
||||
template<class> class FaceList,
|
||||
class PointField,
|
||||
class PointExtruder
|
||||
class PointField
|
||||
>
|
||||
Foam::extrudedMesh::extrudedMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const PrimitivePatch<Face, FaceList, PointField>& 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<polyPatch*> 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
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
@ -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> class FaceList,
|
||||
class PointField,
|
||||
class PointExtruder
|
||||
>
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
pointField extrudedPoints
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& 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<Face, FaceList, PointField>& extrudePatch,
|
||||
const label nLayers
|
||||
const extrudeModel& model
|
||||
);
|
||||
|
||||
//- Construct and return the extruded mesh cells
|
||||
@ -83,7 +82,7 @@ class extrudedMesh
|
||||
cellList extrudedCells
|
||||
(
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const label nLayers
|
||||
const extrudeModel& model
|
||||
);
|
||||
|
||||
|
||||
@ -99,19 +98,12 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from the primitivePatch to extrude
|
||||
template
|
||||
<
|
||||
class Face,
|
||||
template<class> class FaceList,
|
||||
class PointField,
|
||||
class PointExtruder
|
||||
>
|
||||
template<class Face, template<class> class FaceList, class PointField>
|
||||
extrudedMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const PrimitivePatch<Face, FaceList, PointField>& extrudePatch,
|
||||
const label nLayers,
|
||||
const PointExtruder& extruder
|
||||
const extrudeModel& model
|
||||
);
|
||||
};
|
||||
|
||||
@ -133,3 +125,4 @@ public:
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
@ -51,12 +51,14 @@ class faceMesh
|
||||
:
|
||||
public PrimitivePatch<face, List, pointField>
|
||||
{
|
||||
PrimitivePatch<face, List, pointField> read(Istream& is)
|
||||
{
|
||||
pointField points(is);
|
||||
faceList faces(is);
|
||||
return PrimitivePatch<face, Foam::List, pointField>(faces, points);
|
||||
}
|
||||
// Private member functions
|
||||
|
||||
PrimitivePatch<face, List, pointField> read(Istream& is)
|
||||
{
|
||||
pointField points(is);
|
||||
faceList faces(is);
|
||||
return PrimitivePatch<face, Foam::List, pointField>(faces, points);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 ..
|
||||
|
||||
|
@ -46,7 +46,7 @@ solvers
|
||||
|
||||
p GAMG
|
||||
{
|
||||
preconditioner 1e-5;
|
||||
tolerance 1e-8;
|
||||
relTol 0;
|
||||
|
||||
smoother GaussSeidel;
|
||||
|
Loading…
Reference in New Issue
Block a user