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

Setting the same boundary condition at multiple patches at once

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 9 Post By haakon

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 17, 2013, 03:26
Default Setting the same boundary condition at multiple patches at once
  #1
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 15
michielm is on a distinguished road
I am currently working with snappyHexMesh to create a mesh which has a number of regions cut out. I have named these "obstacle1","obstacle2" etc

All these obstacles should have the same boundary conditions. When setting them I am already using the following structure:

Code:
obstacle1_region0
    {   
        type fixedValue;
        value uniform 3;
    }   

    obstacle2_region0
    { 
      $obstacle1_region0;
    }

     obstacle3_region0
    { 
      $obstacle1_region0;
    } 

etc
This saves me some time, but it is still a little annoying to have to add new obstacles in U, p, alpha1 every time I change the number of obstacles.

My question is:
is it possible to set the boundary condition for patches with repetitive names in 1 go? I could imagine that would look something like this:
Code:
obstacle$i_region0 
{
     type fixedValue;
     value uniform 3;
}
michielm is offline   Reply With Quote

Old   October 17, 2013, 05:21
Default
  #2
Senior Member
 
Join Date: Dec 2011
Posts: 111
Rep Power: 19
haakon will become famous soon enough
You can use regular expressions in the patch names, like:

Code:
"obstacle.*"
{
     type fixedValue;
     value uniform 3;
}
for all patches starting with the string "obstacle". More refined expressions can of course also be made.
jiejie, michielm, thiagopl and 6 others like this.
haakon is offline   Reply With Quote

Old   October 17, 2013, 05:23
Default
  #3
Member
 
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 15
michielm is on a distinguished road
Awesome! Thanks!
michielm 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
Setting side/wedge boundary condition Thoma OpenFOAM Pre-Processing 4 July 15, 2014 18:06
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 04:13
inlet velocity boundary condition murali CFX 5 August 3, 2012 08:56
Setting the inlet boundary condition with inclination saisanthoshm88 CFX 1 October 4, 2011 06:41
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 17:16.