|
[Sponsors] |
Contribute a forceCoeff plot and merge utility |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 16, 2014, 13:05 |
Contribute a forceCoeffs monitoring, plotting and merging utility
|
#1 |
Senior Member
Daniel WEI (老魏)
Join Date: Mar 2009
Location: Beijing, China
Posts: 689
Blog Entries: 9
Rep Power: 21 |
Dear All,
I'd like to share my small force coefficient merging/plotting utility with you. It can plot and merge and write out a postscript file. The merge function is quite useful in many situations. Download Link: --->fcsp.tar.gz The needs (Situation A):
The needs (Situation B): You just want to monitor your force history This code should work on Ubuntu. To give a few examples: Code:
$ ./fcsp -help --> This will show the help. USAGE: fcsp [-x label] [-y label] [-t title] [-c NUMBER] [-m OFF|ON] [-f] [-d ON|OFF] [-v OFF|ON] [-s width:height] dataFile ... Further Explanation: [**] Merged before or not, the default data file is ALWAYS in the LATEST local forceCoeffs time directory [-c] Number of lines needed to be cut off from the head of data file (100 by default) [-m] Generate a merged data file and then plot it (OFF by default) [-f] Without asking, force replacing the existing merged file [-d] Gnuplot's dumb plot output (ON by default) [-v] Vector plot output (OFF by default), output file name is fcsPlot.eps [-s] Fill Screen by default Code:
./fcsp -m on -v on Cheers,
__________________
~ Daniel WEI ------------- Boeing Research & Technology - China Beijing, China Last edited by lakeat; June 16, 2014 at 16:57. |
|
May 31, 2016, 01:39 |
|
#2 |
New Member
Qin Zhang
Join Date: May 2012
Posts: 10
Rep Power: 14 |
nice tool. I am looking for something like this.
It could be better if the mean value and rms value also calculated. |
|
June 14, 2018, 12:53 |
feedback
|
#3 | |
Member
Ran
Join Date: Aug 2016
Posts: 69
Rep Power: 10 |
Quote:
I try to use your code to merge my data: ========================== $ ./fcsp -c 10 -m on -d off -v off ------------------------------ Folder Name : forcesTesting Data Type : forceCoeffs ------------------------------ 4 time folders need to be merged -- Folder 0 found in case forcesTesting/forceCoeffs. ./fcsp: line 139: bc: command not found ./fcsp: line 140: bc: command not found -- Another folder 45 found in case forcesTesting/forceCoeffs. --> Start merging ... ./fcsp: line 194: bc: command not found ./fcsp: line 195: bc: command not found -- Another folder 90 found in case forcesTesting/forceCoeffs. --> Start merging ... ./fcsp: line 194: bc: command not found ./fcsp: line 195: bc: command not found -- Another folder 136.17 found in case forcesTesting/forceCoeffs. --> Start merging ... ./fcsp: line 194: bc: command not found ./fcsp: line 195: bc: command not found --> The latest simulation time is: 158.003 --> End merging ... ------------------------------ ========================== The force coefficient in my case looks like this in the 0 folder: ================================================== =========== # Time Cm Cd Cl Cl Cl 0.003 1.886651e+02 3.765786e+02 1.110647e-03 1.886657e+02 -1.886645e+02 0.006 -9.400345e+01 -1.876334e+02 -1.919551e-03 -9.400441e+01 9.400249e+01 0.009 2.102545e-01 4.195944e-01 5.499815e-03 2.130044e-01 -2.075046e-01 0.012 1.636652e-01 3.268441e-01 -1.894238e-03 1.627181e-01 -1.646123e-01 ... ================================================== =========== However, I got the result like this in the mergedForceCoeffs.dat ============================== # Time Cm Cd Cl 0 Time Cm Cd 0 Time Cm Cd 1 1.051044e-01 2.097883e-01 -2.932875e-04 2 4.741239e-01 9.463588e-01 1.309910e-04 3 4.638071e-01 9.257501e-01 8.461592e-04 4 2.801007e-01 5.591725e-01 5.642334e-04 5 3.741845e-01 7.446019e-01 7.464010e-03 6 3.897489e-01 7.761408e-01 3.843773e-02 ... ============================== - the time seem not correct after the merging In my cases, the time step is 0.003, but the output is 1,2,3 ... - at the end of the merged data: ================================= ... 158 5.474296e-01 1.081924e+00 -1.853809e-01 158 5.503081e-01 1.087717e+00 -1.837162e-01 158 5.482237e-01 1.083649e+00 -1.835996e-01 158 5.503837e-01 1.087997e+00 -1.827931e-01 158 5.495114e-01 1.086341e+00 -1.812269e-01 158 5.486711e-01 1.084763e+00 -1.803950e-01 158 5.504223e-01 1.088290e+00 -1.792501e-01 158.003 5.504223e-01 1.088290e+00 -1.792501e-01 ===========EOF==================== The time is the same 158. Is there any format requirement for your code? Is my usage correct? What does the meaning of "bc: command not found" ? What pre-requirments of this code? Is that possible to merge the bin data for further development this code? Thanks, Looking forward to hearning from you. P.S. my machine: Linux version 4.4.0-127-generic (buildd@lcy01-amd64-023) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #153-Ubuntu SMP Sat May 19 10:58:46 UTC 2018 Last edited by random_ran; June 14, 2018 at 12:55. Reason: update machine info |
||
October 5, 2018, 13:03 |
|
#4 |
Member
Ran
Join Date: Aug 2016
Posts: 69
Rep Power: 10 |
Hi:
After some time of searching on the Internet, I decided to write my own shell script. As a newbie in shell scripts, I've tried my best effort to make it run. It seems fine in my situation, and I just want to share with anyone who has the same problem. Please see this repository. Hope it can help you. Yours in CFD, Ran |
|
October 5, 2018, 20:05 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
Just a quick comment. bc is a Linux for more advanced calculations in bash. General, it should be installed on your machine. Otherwise install it.
__________________
Keep foaming, Tobias Holzmann |
|
October 5, 2018, 23:48 |
|
#6 |
Member
Ran
Join Date: Aug 2016
Posts: 69
Rep Power: 10 |
Thanks for your comment. I tested on a naive Ubuntu platform and did not notice 'bc' command. It could save me lot of effort if I know this at that time.
Last edited by random_ran; October 6, 2018 at 13:07. |
|
|
|