CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] How to delete selected cells from mesh and update boundary patches (https://www.cfd-online.com/Forums/openfoam-meshing/65864-how-delete-selected-cells-mesh-update-boundary-patches.html)

kaka June 29, 2009 08:02

How to delete selected cells from mesh and update boundary patches
 
I have selected some cells using the cellset utility. I now need to permanently delete these cells from the mesh. How would i go about doing this?

After deleting these cells from the mesh, i need to update the boundary patches. Im using OpenFOAM v1.5. I have been through the utilities in >applications>utlities>mesh>manipulation but cannot seem to find the right utility. Which utility is the best for this problem? Would this problem be easier using the patchTool in FOAMX in v1.4.1? I have heard that it is a GUI that you can use to select any faces you are interested in?

Thanks in advance for any help!

milleniumrider November 20, 2009 12:14

Hi there,

I wanted to ask if you've managed to delete the cells? If so could you let me know how, since I'm stuck on the same thing.

Cheers,
Vasu

nikwin November 26, 2009 04:17

The following should work where subsetCells is a labelList. Creates a folder in current timeStep...
/NW


word setName("subsetCells");
cellSet currentSet(mesh, setName, subsetCells);
// Create mesh subsetting engine

fvMeshSubset subsetter(U,mesh);

label patchI = -1;

subsetter.setLargeCellSubset(currentSet, patchI, true);

wordList scalarNames(1);
scalarNames[0] = "p";

PtrList<volScalarField> scalarFlds(scalarNames.size());
//extract the slice and write it in a time directory
scalarFlds.set(0, subsetter.interpolate(p));

wordList vectorNames(1);
vectorNames[0] = "U";

PtrList<volVectorField> vectorFlds(vectorNames.size());
//extract the slice and write it in a time directory
vectorFlds.set(0, subsetter.interpolate(U));

subsetter.subMesh().write();
// Subsetting adds 'subset' prefix.
forAll(scalarFlds, js)
{
Info << "subset" << scalarNames[js] << endl;
//write the scalar in the current time directory
scalarFlds[js].write();
}

forAll(vectorFlds, jv)
{
Info << "subset" << vectorNames[jv] << endl;
//write the scalar in the current time directory
vectorFlds[jv].write();
}


All times are GMT -4. The time now is 21:30.