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

MRFSimpleFoam: what's the point of running setSets…?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 5, 2012, 12:47
Default MRFSimpleFoam: what's the point of running setSets…?
  #1
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Hi all;
I'm trying to simulate a spinning wheel in a free stream.
The tyre was set as a rotating wall and then I set a rotating reference frame for the spokes of the rim. What I did was basically to enclose these within a cylindrical surface that I called "rotating" and I stated this in my snappyHexMeshDict:

Code:
geometry
{
   
   rotating.stl
    {
        type triSurfaceMesh;
        name rotating;
    }

    …
    …
    …
Quote:
refinementSurfaces
{

rotating
{
level (3 3);
faceZone rotating_face;
cellZone rotating_cell;
zoneInside true;
}



}
And then, in my MRFZones:

Code:
1
(
    rotating_cell
    {
        // Fixed patches (by default they 'move' with the MRF zone)
        nonRotatingPatches ();

        origin    origin [0 1 0 0 0 0 0]  (0 0 0.2);
        axis      axis   [0 0 0 0 0 0 0]  (0 -1 0);
        omega     omega  [0 0 -1 0 0 0 0] 100;

        patches         
        1
        (
        rotating_cell
        )
        ;
        faceZoneName   rotating_cell;

    }
)
Now, whether I run or not topoSet, setSets, setsToZones and so on, I keep having the same good result, i.e. the wheel seems to be rotating even if I do not run any of the above…

So, what's the point of these commands in MRFSimpleFoam?

Thank you!
lovecraft22 is offline   Reply With Quote

Old   April 6, 2012, 09:53
Default
  #2
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Also: what is the point of having both SimpleFoam and MRFSimpleFoam solvers since the latter includes the first?

You could just have MRFSimpleFoam which could check for the file MRFZones to exist and trigger or not the multi reference frame functionality…
lovecraft22 is offline   Reply With Quote

Old   April 6, 2012, 16:13
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hello again lovecraft22,

I haven't looked deep enough into this, but here's my deduction based on what I already know and briefly can see:
  • simpleFoam vs MRFSimpleFoam: my guess is that the two exist for educational purposes. The OpenFOAM Team has been merging solvers whenever they can, mostly for simplifying things. But when it comes to more complex solvers - such as having MRF - it's best to have them in separate codes, because this way it's easier to study them and because the simpler ones will not have redundant code.
  • "MRFZones" is a specific designation of the MRF zones, and not associated to any "cellSet" or zone derived from a cell set. I've taken for example the tutorial "incompressible/MRFSimpleFoam/mixerVessel2D", where no setSet batch file nor "topoSetDict" can be found.
  • If "MRFZones" can accept the usage of a cellSetZone or faceSetZone, it shouldn't really matter if that zone has been created with setSet, topoSet or straight out of snappyHexMesh!
  • edit: the "MRFZones" dictionary defines the zone that will be dynamically moving. The cellSetZone or faceSetZone are simply lists of cells/faces that can be used for something, such as porosity or mesh manipulation.
Best regards,
Bruno
__________________

Last edited by wyldckat; April 6, 2012 at 16:15. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   April 6, 2012, 16:45
Default
  #4
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thank you Bruno. Your answer is really clear: I can run MRFSimple foam without the need of setSet or topoSet.

Thank you again.

One day I hope I'll understand what these commands are for…
lovecraft22 is offline   Reply With Quote

Old   April 6, 2012, 17:19
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by lovecraft22 View Post
Thank you Bruno. Your answer is really clear: I can run MRFSimple foam without the need of setSet or topoSet.

Thank you again.

One day I hope I'll understand what these commands are for…
It's simple: setSet and topoSet are basically selection tools that can select parts of the mesh, including points, faces and cells. Once you select parts of the mesh and assign each selection a "tag" (i.e. a "set"), then you can do something with that "tag".

The first example I've seen for setSet was this: http://openfoamwiki.net/index.php/SetSet
Basically it's a command sequence that creates a new selection of the "sets" created by checkMesh and then inverts the selection to select all of the mesh except the previous selection. The inverted selection is then used for extracting only the cells that you really want to use, namely with subsetMesh. In other words, you have at the end a mesh without the bad cells.
FYI: the name "bubu" is used in the sense of "mistake". Googling for it's meaning can be a bit daunting... apparently the technical wording should be "booboo"

Anyway, this example can be a bit dangerous, since removing damaged cells can lead to unbounded zones in the mesh, or simply creates obstacles where they shouldn't be.

I hope this is now clearer to you and any other reader

Best regards,
Bruno
MoeCFD and yaos like this.
__________________
wyldckat is offline   Reply With Quote

Old   April 6, 2012, 17:39
Default
  #6
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thanks again Bruno… I need to reflect a little bit on what you wrote to make things clearer in my head…

I think I'll also have a look at the propeller tutorial (PimpleDyMFoam) to try and understand what's going on there too…
lovecraft22 is offline   Reply With Quote

Old   April 7, 2012, 07:37
Default
  #7
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
So, looking at the wiki page you linked:

Code:
cellSet bubu new cellToCell underdeterminedCells any
This creates a new Set of cells called bubu and subsequently add the undeterminedCells to this set. What's "any" for? I'd say it's to include any of the cells but then what would the alternatives to "any" be?

Code:
cellSet bubu add faceToCell concaveFaces any
This add the concaveFaces to the set of cells bubu

Code:
cellSet bubu invert
This is not so clear… I would say it takes the whole domain without the set bubu, and the new set is, again, called bubu, correct? So, if no argument is passed after invert, the whole domain is considered by default? What if I wanted to subtract bubu to another set called, say, "yoghi"? Would that be something like "cellSet bubu invert yoghi"?

But something still doesn't add up then… because with the commands you set a set of cells called bubu which are the bad cells. The with invert you invert the cells and so at this point you should have the good cells in your set. But then, with

Code:
cellSet bubu subset
these good cells, are subtracted from the domain…

So, where's my mistake here?

Thank you again for your help, I really appreciate that!
lovecraft22 is offline   Reply With Quote

Old   April 7, 2012, 09:11
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi lovecraft22,

setSet has a live help system. Examples:
Code:
help
For getting a list of possible sub-commands, you can use a dummy word, for example:
Code:
cellSet help
Or
Code:
cellSet bananas
About "invert", the help system says:
Quote:
invert - inverts the set (undefined orientation)
Another example for getting the valid values:
Code:
cellSet c0 new faceToCell f0 bananas
That replies:
Code:
Usage: faceToCell <faceSet> neighbour|owner|any|all

Select cells that are the owner|neighbour|any of the faces in the faceSet or where all faces are in the faceSet
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 7, 2012, 09:53
Default
  #9
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thanks Bruno, I'll have a look at the help!
lovecraft22 is offline   Reply With Quote

Old   January 17, 2013, 05:46
Default
  #10
Member
 
Join Date: Sep 2012
Posts: 30
Rep Power: 14
emirust is on a distinguished road
Hey all!

I was reading this interesting and useful thread about setSet and topoSet.

I have been playing around with both, and I was wondering if it was possible to avoid to type the commands of setSet in the command line. The reason I ask, is because I want to include it in a shell script, so I can do things such as:

runScript.sh:

Code:
blockMesh
setSet
cellSet thenameoftheset new boxToCell (xmin ymin zmin) (xmax ymax zmax)
.
.
.
interFoam
Running the previous script will require the user to type the information on cell selection in the command line. How can I avoid that, and make it automatically?

I would rather not use dict files, because I want to automate this, i.e. refine the mesh in a box, and then repeat several times. In other words, I want to select cells on a refined mesh, update the cell set, refine and so on...

Apparently the refineMesh utility will refine only dividing cells in 4 (for a 2D case), and it is not possible to refine more by using it. ;-)

Thanks!
emirust is offline   Reply With Quote

Old   January 17, 2013, 10:09
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Emirust,

Take a look at the tutorial "heatTransfer/chtMultiRegionFoam/multiRegionHeater" and check the files "makeCellSets.setSet" and "Allrun" in that folder.

You can find more examples by running:
Code:
find $FOAM_TUTORIALS -name "*.set*"
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   January 17, 2013, 15:11
Default
  #12
Member
 
Join Date: Sep 2012
Posts: 30
Rep Power: 14
emirust is on a distinguished road
Awesome! Thanks!

I was also wondering, if there is a way to select cells, after the mesh is refined. What I mean is I want to:

1-Select cells
2-Refine Mesh in selected cells (i.e. dividing cells in 4, for a 2D case) and overwrite current mesh
3-Reselect other cells on the new mesh for further refinement

I can't seem to think of a way to automate this, and my current investigation seem to say that refineMesh need to be called on "manually" selected cellSets. Any trick or other way to do this?

More at the end of the following post: http://www.cfd-online.com/Forums/ope...efinemesh.html

Cheers!

E.
emirust is offline   Reply With Quote

Old   January 19, 2013, 16:55
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Emirust,

I guess you already got your answer at http://www.cfd-online.com/Forums/ope...tml#post402605 post #15.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply


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
CFX Post: Problems with moving point cloud for changing time steps spatialtime CFX 0 December 7, 2009 05:56
Replacing mesh while running a simulation akultane CFX 1 November 15, 2009 14:46
Monitor a point in a rotating domain taichijulie CFX 0 August 12, 2009 17:25
What do you CFD guys do during a long simulation running? bearcat Main CFD Forum 5 July 23, 2009 09:08
Kubuntu uses dash breaks All scripts in tutorials platopus OpenFOAM Bugs 8 April 15, 2008 08:52


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