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

How to define multiple boundary field names

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 7, 2011, 23:28
Default How to define multiple boundary field names
  #1
Member
 
Join Date: Nov 2009
Posts: 62
Rep Power: 8
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, 02:41
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 780
Rep Power: 19
olesen will become famous soon enough
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, 06:13
Default
  #3
Member
 
Join Date: Nov 2009
Posts: 62
Rep Power: 8
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, 07:30
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 780
Rep Power: 19
olesen will become famous soon enough
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, 08:28
Default
  #5
Member
 
Join Date: Nov 2009
Posts: 62
Rep Power: 8
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

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
Wind turbine simulation Saturn CFX 45 February 8, 2016 05:42
Import problem ARC Open Source Meshers: Gmsh, Netgen, CGNS, ... 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:08.