|
[Sponsors] |
November 6, 2019, 11:09 |
binData in forces functionObject
|
#1 |
Member
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 7 |
Hi,
I am writing my own functionObject and since I am quite new to OpenFOAM i started off by making a copy of the standard functionObject forces and I am now about to adopt it to my needs. I have managed to understand quite a bit of what is going on in there but on thing that I still don't understand is the binData, that is referred on many places in the code. For example: Code:
case BINS_FILE: { // bin data writeHeader(file(i), "Force bins"); writeHeaderValue(file(i), "bins", nBin_); writeHeaderValue(file(i), "start", binMin_); writeHeaderValue(file(i), "delta", binDx_); writeHeaderValue(file(i), "direction", binDir_); vectorField binPoints(nBin_); writeCommented(file(i), "x co-ords :"); forAll(binPoints, pointi) { binPoints[pointi] = (binMin_ + (pointi + 1)*binDx_)*binDir_; file(i) << tab << binPoints[pointi].x(); } file(i) << nl; writeCommented(file(i), "y co-ords :"); forAll(binPoints, pointi) { file(i) << tab << binPoints[pointi].y(); } file(i) << nl; writeCommented(file(i), "z co-ords :"); forAll(binPoints, pointi) { file(i) << tab << binPoints[pointi].z(); } file(i) << nl; writeCommented(file(i), "Time"); const word binForceTypes("[pressure,viscous]"); for (label j = 0; j < nBin_; j++) { const word jn('(' + Foam::name(j) + ')'); const word f("forces" + jn + binForceTypes); file(i)<< tab << f; } if (localSystem_) { for (label j = 0; j < nBin_; j++) { const word jn('(' + Foam::name(j) + ')'); const word f("localMoments" + jn + binForceTypes); file(i)<< tab << f; } } break; } Thankful for any explanation on this. Cheers, David |
|
February 27, 2020, 18:25 |
|
#2 |
Member
Gang Wang
Join Date: Oct 2019
Location: China
Posts: 64
Rep Power: 8 |
Hi!
I also felt confused about this, do you have any idea about bindata? Best regards, Gang |
|
February 29, 2020, 12:26 |
|
#3 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25 |
It's writing out a file of the binned data.
|
|
March 2, 2020, 05:52 |
|
#4 |
Member
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 7 |
||
March 2, 2020, 07:05 |
|
#5 |
Member
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 94
Rep Power: 15 |
Hii there,
well if you read the description it says the following : "Member function forces::write() calculates the forces/moments and writes the forces/moments into the file \<timeDir\>/forces.dat and bin data (if selected) to the file \<timeDir\>/forces_bin.dat" also later it follows with the usage of it as : "Bin data is optional, but if the dictionary is present, the entries must be defined according o \table nBin | number of data bins | yes | direction | direction along which bins are defined | yes | cumulative | bin data accumulated with increasing distance | yes | \endtable" It is an optional feature and it seems that you may use it when you want to have spatial distribution of forces/moments along a certain direction ... You may try it out to see how it works... |
|
March 2, 2020, 20:03 |
|
#6 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25 |
In other words this will get you a distribution of forces along a direction.
This is typical for aero cases where one is interested in seeing where drag or lift has the largest increase or decrease, allowing focused development of that area. |
|
March 3, 2020, 03:43 |
|
#7 |
Member
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 7 |
Alright, now I have a better idea of what it does. Thank you for your help!
|
|
Tags |
forces, functionobjects, openfoam, programming, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
forces functionObject with interFoam and dynamic pressure | AnnaF | OpenFOAM Post-Processing | 4 | June 20, 2019 21:46 |
Point of action of 'forces' functionObject? | vikramrajagopalan | OpenFOAM Post-Processing | 2 | March 21, 2019 16:08 |
Residuals and forces spiraling out of control before failing | edomalley1 | OpenFOAM Running, Solving & CFD | 3 | September 7, 2018 11:42 |
Forces for airfoil test case | Martin_ | OpenFOAM Running, Solving & CFD | 1 | July 2, 2012 12:58 |
Patch names amp forces functionObject | david | OpenFOAM Bugs | 3 | April 26, 2011 22:59 |