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

[PyFoam] customRegexp with pyFoamPlotWatcher.py for force coefficents

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 27, 2017, 12:26
Default customRegexp with pyFoamPlotWatcher.py for force coefficents
  #1
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
BendikS is on a distinguished road
Hi,

I'm trying to make a custom regular expression for my force coefficients so I can plot them on the fly with pyFoamPlotWatcher.py, but I'm not really sure on how my customRegexp file should look like. Does anybody have an working example?

My force coefficient output looks like this btw:
Code:
forceCoeffs forceCoeffs output:
    Coefficients
        Cm       : -2.34093e-05    (pressure: -2.32145e-05    viscous: -1.94815e-07)
        Cd       : -0.010548    (pressure: -0.0105261    viscous: -2.18705e-05)
        Cl       : -0.010548    (pressure: -0.0105261    viscous: -2.18705e-05)
        Cl(f)    : -0.00529742
        Cl(r)    : -0.0052506
Thanks!
BendikS is offline   Reply With Quote

Old   March 30, 2017, 09:06
Default
  #2
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
BendikS is on a distinguished road
Anyone? Or can someone point me in a direction where I could find more resources for customregexp for pyfoam?
BendikS is offline   Reply With Quote

Old   January 31, 2018, 12:15
Default
  #3
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
You can create one regexp for each line of your force coefficient output, and then use the new master-slave feature to merge all data into a single plot.

This is how your file customRegexp could look like:
Code:
dragOF5 {
	theTitle "Forces";
	expr "Cd += (%f%)";
	titles ("Drag Coeff");
}
dragOF5slave
{
	expr "Cl += (%f%)";
	titles ( "Lift Coeff" );
	type slave;
	master dragOF5;
}
The regular expression is told that there might be an arbitrary number of spaces between the keyword "Cd" and the equal sign using the plus sign.

More info on how to create these files can be found here: http://openfoamwiki.net/index.php/Co...oam#New_format
elmo555 is offline   Reply With Quote

Reply

Tags
customregexp, force coefficients, pyfoam, pyfoam customregexp, pyfoamplotwatcher.py


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
[PyFoam] Using pyFoamPlotWatcher.py To Plot Residuals m_ridzon OpenFOAM Community Contributions 22 January 26, 2021 19:48
How to caculate the coefficents in sylindical sys Kevin Siemens 1 March 17, 2006 00:04


All times are GMT -4. The time now is 00:45.