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

Setting the same boundary condition at multiple patches at once

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

Like Tree2Likes
  • 2 Post By haakon

Reply
 
LinkBack Thread Tools 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: 8
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
 
Håkon Strandenes
Join Date: Dec 2011
Location: Norway
Posts: 111
Rep Power: 11
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.
michielm and RjwV 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: 8
michielm is on a distinguished road
Awesome! Thanks!
michielm 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
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 05: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 CD-adapco 6 November 15, 2004 05:41


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