|
[Sponsors] |
February 23, 2010, 04:41 |
|
#21 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Alessandro
You could try something like this in the command line: grep -v "<word in header>" forces.dat | tr -d '(' | tr -d ')' > forces.dat.modified I do not have a forces.dat file available, hence just replace <word in header> with a word from the header. Then it should work without any problems. Best regards, Niels |
|
February 23, 2010, 05:05 |
|
#22 | |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17 |
Quote:
__________________
|
||
February 23, 2010, 07:22 |
|
#23 |
Member
Join Date: Sep 2009
Posts: 45
Rep Power: 17 |
You should try this:
sed 's/(/ /g' forces.dat > forcesi sed 's/)/ /g' forcesi > forces where forces is the same file as forces.dat without the brackets. Hope it helps! |
|
February 23, 2010, 11:24 |
|
#24 |
Member
Jean-Peer Lorenz
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 33
Rep Power: 17 |
Hi,
you can use any text postprocessing tool you like (e.g. sed, awk, a perl script) and modify the file (described above). If you want to remove it directly from the output you will have to create your own version of the forces function object and remove the according lines of source code and recompile it. HTH. |
|
February 23, 2010, 11:50 |
|
#25 |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17 |
Thank a lot for your advises, I take in consideration all of them
__________________
|
|
February 25, 2010, 20:48 |
|
#26 |
New Member
|
Hi,
You can do it in a different way, please check [1]. They recommend to add some lines in the foamLog script. Ruben [1] http://www.cfd-online.com/Forums/ope...rces-of15.html |
|
February 26, 2010, 03:59 |
|
#27 | |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17 |
Hi Ruben,
thank you for the advice but I have changed che controlDict in order to obtain the forces values...I don't know how to obtain forces and coeffs from a log file Quote:
__________________
|
||
February 26, 2010, 07:25 |
|
#28 |
New Member
|
Hi Ale,
I use 1.5 version, but I assume that 1.6 version generates a forces directory where the forces.dat file is saved. Check reply # 19 in [1] good luck, R |
|
February 28, 2010, 19:53 |
|
#29 | |
Member
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16 |
Quote:
I'm facing some problems of forces output for several patches. Entering all patch names within Code:
patches (patch1 patch2 patch3 ...); Code:
forces { ... } /Stefan |
||
March 2, 2010, 01:06 |
|
#30 |
New Member
|
Hi Stefan,
I am new to OpenFoam and Cpp, so maybe I will say something stupid. Also, I have never worked with multiple patches, what do you mean when you say "for every patch, the data are separated but mixed together within ./forces/<firstTimeStep>/forces.dat"? I was reading the force.C file, and it looks like in the makeFile() function the force directory is set as: forcesDir = obr_.time().path()/name_/obr_.time().timeName(); So, I think that changing the "/obr_.time().timeName()" part with a kind of "/patchSet_()[# ID of patch in list?]" could work to get a directory <#IDpatch>/forces.dat. That makes sense?, R. |
|
March 3, 2010, 05:31 |
|
#31 |
Member
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16 |
Hello Ruben,
that could be a solution (i didn't try it). What i did to fix it, is some way easier. Ich changed Code:
forces { ... } Code:
patchname { ... } /Stefan |
|
March 17, 2010, 10:29 |
|
#32 |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17 |
Hello,
I need to look inside the code of libforces...How I can do it? I would like to know in which way openfoam compute the forces...
__________________
|
|
March 17, 2010, 18:00 |
|
#33 |
Member
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16 |
In case of 64-bit setup, libforces.so is located at
HTML Code:
/usr/local/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libforces.so http://foam.sourceforge.net/doc/Doxy...1_1forces.html Forces are integrated over given walls with patchIntegrate[patchI]. Viscous forces depends on shear stress, pressure forces are related to the pressure field on the wall. |
|
March 22, 2010, 22:21 |
Calculating forces from results without running the case again
|
#34 |
New Member
Alexis Espinosa
Join Date: Aug 2009
Location: Australia
Posts: 20
Rep Power: 17 |
Following the indications in this thread, I was able to set the force calculation for a flow past a cylinder.
But I have done a lot of runs in the past days without these settings and i want to calculate the forces from the result files that I already have, because running again the cases will be very time consuming. Obvioulsly, it is possible. I just need to read the U and p files for every saved time and use the force functions to calculate forces. But how can I do that??? Thanks a lot. Alexis |
|
March 22, 2010, 22:44 |
|
#35 |
New Member
|
Hi Alexi,
I think that you can use the "execFlowFunctionObjects" utility, but first you need to include in the controlDict file the forceObject as described above. R. |
|
March 23, 2010, 02:27 |
|
#36 |
New Member
Alexis Espinosa
Join Date: Aug 2009
Location: Australia
Posts: 20
Rep Power: 17 |
Thanks Ruben,
The execFlowFunctionObjects is working, BUT it creates a result file for every saved time step! That is a problem, but the biggest problem is that it overwrites it each time step. So, at the end I get just one file with the forces for the latest time step that i have saved. Do you know how to avoid overwriting?? It would be wonderful if execFlowFunctionObjects could work with all the saved timesteps just as if they were being generated in runtime. In that way it would output just one file at the end but with one line per processed time, instead of overwriting. Thanks, Alexis |
|
March 23, 2010, 11:22 |
|
#37 |
New Member
|
Hi Alexi,
I am not sure about it, but it sounds to me like you are using: outputControl timeStep; outputInterval 1; Maybe you can try using outputTime instead. Good luck, R. |
|
March 23, 2010, 20:05 |
|
#38 |
New Member
Alexis Espinosa
Join Date: Aug 2009
Location: Australia
Posts: 20
Rep Power: 17 |
When I use
outputControl outputTime; Then the utility processes every time directory I have with saved results, but it does not create any file. Nothing!! When I use outputControl timeStep; outputInterval 1; Then again, execFlowFunctionObjects process every time directory and creates a forces.dat file for every time, but it always overwrite the old one, so it keeps overwriting files and at the end i finish with just one file. The problem is that in every file there is only one line with the calculated forces for that specific time. So, at the end I finish with just the calculated forces for the last time. Thank you very much. I also started a thread in OpenFoam_bugs about the execFlowFunctionObjects, I hope that we can also get some hints over there. Thanks again, Alexis |
|
March 28, 2010, 09:32 |
|
#39 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
||
March 28, 2010, 10:24 |
|
#40 |
Member
Alessandro
Join Date: Nov 2009
Posts: 67
Rep Power: 17 |
We are a little bit off topic, but why you think k-omega SST?
__________________
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
changes to forces in 1.6 | linnemann | OpenFOAM Running, Solving & CFD | 0 | July 30, 2009 09:49 |
Strange results from interFoam solution converges but sum of all forces not equal to zero | nicasch | OpenFOAM Running, Solving & CFD | 0 | April 15, 2008 03:01 |
2d foil pressure forces problem | mayor | FLUENT | 4 | December 1, 2003 04:57 |
viscous-pressure forces | nico | FLUENT | 0 | June 9, 2003 15:41 |
Valve Forces in CFdesign | Mike Clapp | Main CFD Forum | 3 | March 8, 2001 15:09 |