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

How to define multiple boundary field names

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2011, 00:28
Default How to define multiple boundary field names
  #1
Member
 
Join Date: Nov 2009
Posts: 65
Rep Power: 16
waku2005 is on a distinguished road
Dear all;

I'd like to know how to define multiple boundary field names in 0/U, 0/p files like bellow (i.e., different patches but physical conditions are the same).
The bellow lines are allowable in OF, or there are any other ways?
-------
BC1
{
type fixed value;
value uniform (1 0 0);
}
BC2
{
type fixed value;
value uniform (1 0 0);
}
-------
VVVV
-------
BC1 | BC2 <--------- ??????
{
type fixed value;
value uniform (1 0 0);
}
-------

Thanks in advance,
waku2005
waku2005 is offline   Reply With Quote

Old   May 9, 2011, 03:41
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by waku2005 View Post
Dear all;

I'd like to know how to define multiple boundary field names in 0/U, 0/p files like bellow (i.e., different patches but physical conditions are the same).
The bellow lines are allowable in OF, or there are any other ways?
-------
BC1
{
type fixed value;
value uniform (1 0 0);
}
BC2
{
type fixed value;
value uniform (1 0 0);
}
-------
VVVV
-------
BC1 | BC2 <--------- ??????
{
type fixed value;
value uniform (1 0 0);
}
-------

Thanks in advance,
waku2005

Regular expressions? See "man 7 regex" for syntax.

Code:
 
"BC[0-9]+"
{ 
    type fixedValue;
    value uniform (1 0 0);
}
olesen is offline   Reply With Quote

Old   May 9, 2011, 07:13
Default
  #3
Member
 
Join Date: Nov 2009
Posts: 65
Rep Power: 16
waku2005 is on a distinguished road
Dear olesen

Thank you for your reply !
Oh, Regular expressions like bellow are very useful for me.

For different names which could not be written with the regular expression, what should I do ?

Quote:
Originally Posted by olesen View Post
Regular expressions? See "man 7 regex" for syntax.

Code:
 
"BC[0-9]+"
{ 
    type fixedValue;
    value uniform (1 0 0);
}
waku2005 is offline   Reply With Quote

Old   May 9, 2011, 08:30
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by waku2005 View Post
Dear olesen

Thank you for your reply !
Oh, Regular expressions like bellow are very useful for me.

For different names which could not be written with the regular expression, what should I do ?
There are several solutions, but I have some doubts if you can't formulate most normal things as a regular expression. You can also use a regexp to set a "catchall" condition and use literals to specify the (hopefully few) conditions that deviate. Also observe that the regexs are matched in reversed order http://foam.sourceforge.net/doc/Doxy....html#_details
This property could also be exploited.

Armed with these bits of information, there shouldn't be any huge problem.
As a final alternative, you could post the condition that you figure cannot be expressed as a regular expression and pay 5 Euros to the first one who can solve it for you
olesen is offline   Reply With Quote

Old   May 9, 2011, 09:28
Default
  #5
Member
 
Join Date: Nov 2009
Posts: 65
Rep Power: 16
waku2005 is on a distinguished road
Quote:
Originally Posted by olesen View Post
There are several solutions, but I have some doubts if you can't formulate most normal things as a regular expression. You can also use a regexp to set a "catchall" condition and use literals to specify the (hopefully few) conditions that deviate. Also observe that the regexs are matched in reversed order http://foam.sourceforge.net/doc/Doxy....html#_details
This property could also be exploited.

Armed with these bits of information, there shouldn't be any huge problem.
As a final alternative, you could post the condition that you figure cannot be expressed as a regular expression and pay 5 Euros to the first one who can solve it for you
Thanks Olesen,
Regular expression is enaugh for me.
waku2005 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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55
How to define the boundary condition Merkle FLUENT 0 December 1, 2000 05:01


All times are GMT -4. The time now is 21:59.