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

Sequence of matching patches with regexes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2019, 03:54
Default Sequence of matching patches with regexes
  #1
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
If I write, for instance, a 0/p file like this:

Code:
outlet { type fixedValue; ... }
".*" { type zeroGradient; ... }
I am never sure which boundary condition will be assigned to outlet because .* is also a match.

Does OpenFOAM assign the first matching patch name or the last?

Thanks!
__________________
www.damogranlabs.com
kandelabr is offline   Reply With Quote

Old   April 26, 2019, 08:15
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Since boundaryField is a dictionary, first entry lookup is performed by keyword and then, if it was not found, lookup is repeated with regEx (https://github.com/OpenFOAM/OpenFOAM...tionary.C#L469). So outlet in general should become fixedValue, and everything else zeroGradient.
alexeym is offline   Reply With Quote

Old   April 26, 2019, 08:28
Default
  #3
Senior Member
 
kandelabr's Avatar
 
Nejc
Join Date: Feb 2017
Location: Slovenia
Posts: 196
Rep Power: 9
kandelabr is on a distinguished road
Thanks for the reply. I thought this was so but wasn't really sure. Also the code explains everything but is hard to find the right line.
__________________
www.damogranlabs.com
kandelabr 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
Problem using AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 08:19
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 04:50
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 08:00
[mesh manipulation] mirrorMesh and undoing the joining of patches chegdan OpenFOAM Meshing & Mesh Conversion 3 October 21, 2015 08:09
Regarding periodic BC in ICEM generated grid Tarak OpenFOAM 32 April 30, 2013 14:46


All times are GMT -4. The time now is 12:06.