# Create dynamic cellSet

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 26, 2012, 12:34 Create dynamic cellSet #1 New Member   Pierre HORGUE Join Date: May 2009 Posts: 29 Rep Power: 10 Hello, I want to create a dynamic set of cells, i.e., which evolves with time. Example : I created a Bounding box ( xmin(t), ymin(t) ) ( xmax(t), ymax(t) ) With the function boxToCell, I can define a set "myCellSet" which contains all the cells within the Bounding box (using the "setSet" tools). But I want that this set of cells evolves with time which means that i must include this operation in my solver "myInterFoam.C" (for example) : At the timestep 1, "myCellSet" contains all cells in (xmin(1) ymin(1)) (xmax(1) ymax(1) At the timestep 2, "myCellSet" contains all cells in (xmin(2) ymin(2)) (xmax(2) ymax(2)) .... My problem is that i created successfully a "dynamic" bounding box but i can't create a topoSet containing the cell labels of my bounding box. How can I create at each time step this topoSet ? Thank you Pierre

 May 4, 2012, 03:45 #2 New Member   Pierre HORGUE Join Date: May 2009 Posts: 29 Rep Power: 10 Hi , I finally found how to create a cellSet (and the cellZone associated) dynamically in a box which evolves with time. Here is my code : // size of the box where minPoint and maxPoint evolves with time const point minPoint(xmin,ymin,zmin); const point maxPoint(xmax,ymax,zmax); // IStringStream generation string buffer = "("; string aux = " "; std:stringstream sXmin,sYmin,sZmin,sXmax,sYmax,sZmax; sXmin << xmin; sYmin << ymin; sZmin << zmin; sXmax << xmax; sYmax << ymax; sZmax << zmax; buffer = buffer + sXmin.str() + aux + sYmin.str() + aux + sZmin.str(); aux = ") ("; buffer = buffer + aux; aux = " "; buffer = buffer + sXmax.str()+ aux + sYmax.str() + aux + sZmax.str() ; aux = ")"; buffer = buffer + aux; IStringStream isString(buffer); // cellSet creation const globalMeshData& parData = mesh.globalData(); label typSize = max ( parData.nTotalCells(), max ( parData.nTotalFaces(), parData.nTotalPoints() ) ); const word setType = "cellSet"; const word setName = "myVofSet"; autoPtr currentSetPtr = topoSet::New(setType, mesh, setName, typSize); topoSet& currentSet = currentSetPtr(); // boxToCell creation word sourceType="boxToCell"; autoPtr setSource ( topoSetSource::New ( sourceType, mesh, isString ) ); // Application of the topoSetSource to "myVofSet" topoSetSource::setAction action = topoSetSource::toAction("new"); setSource().applyToSet(action, currentSet); // cellZone creation Info<< "Adding set " << currentSet.name() << " as a cellZone." << endl; SortableList

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post voingiappone OpenFOAM Native Meshers: blockMesh 4 May 22, 2015 02:22 bharat OpenFOAM Running, Solving & CFD 26 August 18, 2013 18:35 gizmo OpenFOAM Native Meshers: blockMesh 3 January 13, 2011 13:17 cricke OpenFOAM Running, Solving & CFD 11 July 12, 2009 03:52 Pankaj Siemens 3 October 15, 2008 09:36

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

 Contact Us - CFD Online - Privacy Statement - Top