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

SIMPLE relaxationFactors nomenclature ".*"

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tas38

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2020, 05:53
Default SIMPLE relaxationFactors nomenclature ".*"
  #1
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
A trivial question, but I could not find any reference to this online. The relaxationFactors subdictionary of fvSolution for one of the SIMPLE solver tutorial cases reads as follows:

Quote:
relaxationFactors
{
equations
{
U 0.9;
".*" 0.9;
}
}
This clearly sets the factor for the U equations (first line) and all the other variables (second line). In the OpenFoam User Guide, I have seen:

Quote:
equations
{
U 0.7;
"(k|omega|epsilon).*" 0.7;
}
Can anyone please explain the terminology here? What is the .* referring to? I can see how to use it, but I'd like to know what it means, rather than it being a black box. Many thanks.

Last edited by Tobermory; April 3, 2020 at 11:51. Reason: Clarifying the text
Tobermory is offline   Reply With Quote

Old   April 3, 2020, 12:27
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Ok - solved. Section 4.2.12 of the User Guide talks about Regular Expressions, of which this is an example.
Tobermory is offline   Reply With Quote

Old   April 3, 2020, 22:54
Default
  #3
Senior Member
 
Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
tas38 is on a distinguished road
As you mentioned. This is detailed with the OF user guide. But for those who future reference this forum entry, here is the explanation (taken directly from OF user guide v7)...


"inlet.*" matches any word beginning inlet. . . , including inlet itself, because ‘.’
denotes “any character” and ‘*’ denotes “repeated any number of times, including 0
times”.

"(inlet|output)" matches inlet and outlet because () specified an expression
grouping and | is an OR operator.
Tobermory likes this.
tas38 is offline   Reply With Quote

Old   April 4, 2020, 09:33
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Thanks, Troy. The one that had me scratching my head was ".*" ... I was wondering: why not just "*". But that's not the way the regexp language works. As you point out, the "." means any character (including an empty space, but not endline) and the "*" means repeated any number of times (including zero times).

I suggest reading up the page on wikipedia: it's pretty informative.

https://en.wikipedia.org/wiki/Regular_expression
Tobermory 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
Continuity divergence in simple gas flow Okka FLUENT 7 January 11, 2019 01:01
Simple loop in LaplacianFoam Houthuys OpenFOAM Programming & Development 1 January 24, 2017 03:18
SIMPLE vs. PISO Kappa OpenFOAM Running, Solving & CFD 1 October 17, 2016 08:08
Simple doesn't stop after convergence criteria is achieved thiagopl OpenFOAM Running, Solving & CFD 3 April 2, 2015 10:29
SIMPLE algorithm Jonathan Castro Main CFD Forum 3 December 10, 1999 04:59


All times are GMT -4. The time now is 09:01.