Skip to content
Snippets Groups Projects
Commit db69053e authored by Henry Weller's avatar Henry Weller
Browse files

fluentMeshToFoam: Added '-2D' option consistent with plot3dToFoam

Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2238
parent fcde201a
Branches
Tags
2 merge requests!121Merge develop into master for v1706 release,!99Integration foundation
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -871,6 +871,12 @@ int main(int argc, char *argv[])
"factor",
"geometry scaling factor - default is 1"
);
argList::addOption
(
"2D",
"thickness",
"use when converting a 2-D mesh (applied before scale)"
);
argList::addBoolOption
(
"writeSets",
......@@ -957,22 +963,26 @@ int main(int argc, char *argv[])
// Construct shapes from face lists
cellShapeList cellShapes(nCells);
// Extrude 2-D mesh into 3-D
Info<< "dimension of grid: " << dimensionOfGrid << endl;
faceList frontAndBackFaces;
if (dimensionOfGrid == 2)
{
const scalar extrusionFactor = 0.01;
// Extrude 2-D mesh into 3-D, in z-direction
boundBox box(max(points), min(points));
scalar twoDThickness = 1.0;
const scalar zOffset = extrusionFactor*box.mag();
if (!args.optionReadIfPresent("2D", twoDThickness))
{
const scalar extrusionFactor = 0.02; //0.01 in each direction
boundBox box(points);
twoDThickness = extrusionFactor*box.mag();
}
Info<< "Grid is 2-D. Extruding in z-direction by: " << twoDThickness
<< endl;
// two-dimensional grid. Extrude in z-direction
Info<< "Grid is 2-D. Extruding in z-direction by: "
<< 2*zOffset << endl;
const scalar zOffset = twoDThickness / 2;
pointField oldPoints = points;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
(
"2D",
"thickness",
"use when converting a 2-D geometry"
"use when converting a 2-D mesh (applied before scale)"
);
argList args(argc, argv);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment