CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] 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 Search this Thread Display Modes
Old   June 29, 2009, 09: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: 16
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: 17
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluid Domain moving with Rigid body Lloyd Sullivan CFX 3 August 17, 2018 10:58
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
Difficulty in calculating angular velocity of Savonius turbine simulation alfaruk CFX 14 March 17, 2017 07:08
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
[Netgen] boundary conditions and mesh exporting vaina74 OpenFOAM Meshing & Mesh Conversion 2 May 27, 2010 10:38


All times are GMT -4. The time now is 02:25.