CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

How to delete selected cells from mesh and update boundary patches

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 29, 2009, 08:02
Default How to delete selected cells from mesh and update boundary patches
  #1
New Member
 
Join Date: Jun 2009
Posts: 1
Rep Power: 0
kaka is on a distinguished road
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!
kaka is offline   Reply With Quote

Old   November 20, 2009, 13:14
Default
  #2
New Member
 
Vasu
Join Date: Oct 2009
Posts: 17
Rep Power: 7
milleniumrider is on a distinguished road
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
milleniumrider is offline   Reply With Quote

Old   November 26, 2009, 05:17
Default
  #3
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 8
nikwin is on a distinguished road
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();
}
nikwin is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic mesh update problem. David FLUENT 3 March 15, 2012 06:02


All times are GMT -4. The time now is 15:09.