ENH: extrudeToRegionMesh : leave base mesh alone

This commit is contained in:
mattijs
2010-12-20 17:10:41 +00:00
parent fa641d785d
commit f1b5f8d023
8 changed files with 37 additions and 471 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -952,7 +952,7 @@ int main(int argc, char *argv[])
const word shellRegionName(dict.lookup("region"));
const wordList zoneNames(dict.lookup("faceZones"));
const Switch oneD(dict.lookup("oneD"));
const Switch adaptMesh(dict.lookup("adaptMesh"));
Info<< "Extruding zones " << zoneNames
<< " on mesh " << regionName
@ -1096,6 +1096,9 @@ int main(int argc, char *argv[])
// Add interface patches
// ~~~~~~~~~~~~~~~~~~~~~
// Note that these actually get added to the original mesh
// so the shell mesh creation copies them. They then get removed
// from the original mesh.
Info<< "Adding coupling patches:" << nl << nl
<< "patchID\tpatch\ttype" << nl
@ -1707,6 +1710,8 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
autoPtr<mapPolyMesh> addBafflesMap;
if (adaptMesh)
{
polyTopoChange meshMod(mesh);
@ -1817,6 +1822,7 @@ int main(int argc, char *argv[])
// Change master and slave boundary conditions on originating mesh
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (adaptMesh)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size());
@ -1878,22 +1884,27 @@ int main(int argc, char *argv[])
}
mesh.removeFvBoundary();
mesh.addFvPatches(newPatches, true);
}
// Remove any unused patches
deleteEmptyPatches(mesh);
}
Info<< "Writing mesh " << mesh.name()
<< " to " << mesh.facesInstance() << nl
<< endl;
if (!mesh.write())
if (adaptMesh)
{
FatalErrorIn(args.executable())
<< "Failed writing mesh " << mesh.name()
<< " at location " << mesh.facesInstance()
<< exit(FatalError);
}
Info<< "Writing mesh " << mesh.name()
<< " to " << mesh.facesInstance() << nl
<< endl;
if (!mesh.write())
{
FatalErrorIn(args.executable())
<< "Failed writing mesh " << mesh.name()
<< " at location " << mesh.facesInstance()
<< exit(FatalError);
}
}
Info << "End\n" << endl;

View File

@ -17,9 +17,18 @@ FoamFile
// Name of region to create
region liquidFilm;
// faceZones to extrude
// FaceZones to extrude
faceZones (f0);
// Adapt the original mesh to have directMapped patches at where the
// faceZones are?
// If true:
// - extruding internal faces: become baffles on directMapped patches
// - extruding boundary faces: repatched to be on directMapped patches
// If false: leave original mesh intact. Extruded mesh will still have
// directMapped patch which might need to be adapted.
adaptMesh true;
// Extrude 1D-columns of cells?
oneD false;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License