|
[Sponsors] |
how to calculate mass flow rate on patches and summation of that during the run? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 7, 2013, 13:26 |
|
#41 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i created a text file named flowRate in case folder and typed in terminal this:
funkyDoCalc flowRate but this error displayed: Code:
--> FOAM FATAL ERROR: funkyDoCalc: time/latestTime option is required From function main() in file funkyDoCalc.C at line 124. FOAM exiting Code:
funkyDoCalc ':.000539' flowRate Code:
funkyDoCalc :.000539 flowRate Code:
--> FOAM FATAL ERROR: funkyDoCalc: time/latestTime option is required From function main() in file funkyDoCalc.C at line 124. FOAM exiting ehsan@Ehsan-com:~/Desktop/WR_pimple_limited$ funkyDoCalc ':.000539' flowRate Usage: funkyDoCalc [OPTIONS] <expressionDict> options: -case <dir> specify alternate case directory, default is the cwd -foreignMeshesThatFollowTime <<list of mesh names>> -latestTime select the latest time -noDimensionChecking -noFunctionObjects do not execute functionObjects -noZero exclude the '0/' dir from the times list, has precedence over the -zeroTime option -parallel run in parallel -region <name> specify alternative mesh region -roots <(dir1 .. dirN)> slave root directories for distributed running -time <ranges> comma-separated time ranges - eg, ':10,20,40:70,1000:' -srcDoc display source code in browser -doc display application documentation in browser -help print the usage Using: OpenFOAM-2.2.0 (see www.OpenFOAM.org) Build: 2.2.0-b363e8d14789 --> FOAM FATAL ERROR: Wrong number of arguments, expected 1 found 2 FOAM exiting (different subject,different post) could you please test in according to my case? |
|
April 7, 2013, 16:54 |
|
#42 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
I've edited my previous post... it was missing the "-time" argument. Try:
Code:
funkyDoCalc -time :0.000539 flowRate PS: weekends around the world: http://en.wikipedia.org/wiki/Workweek_and_weekend - but there is a clear reduction in posts here on the forum during Saturday and Sunday.
__________________
|
|
April 7, 2013, 18:26 |
|
#43 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
April 8, 2013, 08:19 |
|
#44 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I typed this:
Code:
funkyDoCalc -time :.000539 flowRate Code:
Create time Create mesh for time = 0 No information about foreign meshes in "flowRate.flowInlet" No information about foreign meshes in "flowRate.flowOutlet" No information about foreign meshes in "flowRate.surfacePlane" Time = 0 flowInlet : swak4Foam: Setting default mesh swak4Foam: Allocating new repository for sampledGlobalVariables --> FOAM Warning : From function ConcretePluginFunction<DriverType>::exists in file lnInclude/ConcretePluginFunction.C at line 111 Constructor table of plugin functions for PatchValueExpressionDriver is not initialized --> FOAM FATAL ERROR: Parser Error for driver PatchValueExpressionDriver at "1.1-3" :"field phi not existing or of wrong type" "phi" ^^^ --| Context of the error: - From dictionary: flowRate.flowInlet Evaluating expression "phi" From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 1039. FOAM exiting |
|
April 8, 2013, 08:44 |
|
#45 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I added a phi file in 0 folder.now the results are computed in command shell but no files is created for flowInlet and flowOutlet like what was been doing before in run-time condition.
how to have flow rate written files like before(during run)? |
|
April 9, 2013, 05:18 |
|
#46 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Quick answer: "phi" doesn't seem to be outputted (or even used?) by your solver. Try using "U & Sf()" instead.
__________________
|
|
April 9, 2013, 06:42 |
|
#47 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
yes phi is calculated and outputted in rhoPimpleFoam.there was not a phi file in 0 folder that i added it by calculated type.
I think its because of funkyDoCalc function fault tha only outputs in command shell and doesn't categorize them in a file like original functios do during run. any help or opinion? Last edited by immortality; April 10, 2013 at 13:23. |
|
April 10, 2013, 18:18 |
|
#48 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
It took me a while to understand what you meant... but only after testing and looking at the code for funkyDoCalc did I fully understand it. You're correct, funkyDoCalc does output only onto screen, since it seems hard-coded to do so in the file "funkyDoCalc.C": Code:
Info << " " << aName << "=" << val; Unfortunately, right now I can't remember how OpenFOAM handles file output. My quickest suggestion is to look at a C++ tutorial on the topic: http://www.cplusplus.com/doc/tutorial/files/ Another suggestion is to look into the "$WM_PROJECT_DIR/applications/test" folder and look for coding examples. Best regards, Bruno
__________________
|
|
April 12, 2013, 14:20 |
|
#49 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thank you.how to use test folder?!
it is better to write in a file by arrangement than only in screen. |
|
April 14, 2013, 07:41 |
|
#50 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
I finally managed to get some time to investigate this. Here's what I found out:
In the mean time, I'll update the other thread on calcMassFlow, with a variant that outputs to a file: http://www.cfd-online.com/Forums/ope...tml#post418748 @Ehsan: After so many posts from you, I was expecting you knew what to do with a path and source code . Anyway, the idea from my previous post was:
__________________
|
|
April 14, 2013, 10:50 |
|
#51 | |||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
I once felt tempted to add file-output but at the time it was faster for me to use the pyFoamUtilityRunner.py to run it to get the results into a file. The there were some micro-decisions to be handled (like how to output it: multiple-files or single file, directory, header-line yes/no, filenames) and I felt at the time "I don't need it right now and any of these decisions will feel 'wrong' to 40% of the people as there is no convention for that kind of thing in OF (patchAverage etc don't write files)" Quote:
All that being said: I understand that funkyDoCalc has its shortcomings, but it was written at the time as a utility to quickly do some checks on an existing run (like checking mass conservation etc) and for the other stuff that I'm using it for (checking results inside of a testsuite) output to stdout, parsing it with PyFoam is actually more convenient. Having output for it is on my to-do list but not very high
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||||
April 14, 2013, 11:20 |
|
#52 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Bernhard,
I had already guessed as much; handling stuff directly from stdout is also my usual way of handling this kind of data. But unfortunately I'm not yet familiar enough with PyFoam or which exact PyFoam script, in order to suggest a solution based on it... and I wasn't in the mood for suggesting a solution based on grep+sed+awk... And as I said (er, wrote), I'm interested in doing #3 myself... a funkyDoFunctionObjects seems to be a very interesting topic I'll try to look into it in my next vacation... Best regards, Bruno
__________________
|
|
April 20, 2013, 09:09 |
|
#53 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
hi
is there a simple (for you not me ) script that it writes first and second columns in separate folders so that I can use them easier in libre Office (and get summation on mass flow values)?(because of huge numbers its so difficult to separate them manually) |
|
April 20, 2013, 12:03 |
|
#54 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
April 20, 2013, 13:50 |
|
#55 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
how to select a column?it selects all in file while drag and paste both parts in libre office in one column and have to delete not wanted in each cell manually.
|
|
April 20, 2013, 14:30 |
|
#56 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
@Ehsan:
Quote:
There are so many ways to do it and all of the ones below will show a dialogue box that help you import data (or at least it should):
You can even choose which columns to not include! In the picture attached shows this in practice... An explanation about each one of these controls is shown here: https://help.libreoffice.org/Common/Text_Import As for having to erase one cell at a time... there are at least two ways to do the selection of a complete row or column:
I'm almost speechless... I understand I've known these tricks for so long, but I'm finding it very hard to believe that you don't know about none of these Well, if you can use Libreoffice Calc to post-process data, then you don't need me to spend any more time implementing the total sum of mass flow over time, because Libreoffice Calc can easily help you do that. Best regards, Bruno
__________________
|
||
April 20, 2013, 15:31 |
|
#57 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thanks a lot for the complete explanation!
I was not familiar with office Calc because haven't need it to import any data so far( I am only 4-5 months in Linux) .the I mport page was displayed but the fields was gray.I examined randomly "separated by" and got disappointed (but not space) ! no then you don't have to try more on it. it has been a lot of effort you have done so far.thank you again for all help. could you please help in how to have p,T,U on patches by swak4FOAM post processing functions(and also total pressure by defining it in postProcessing functions not by modifying solver)? Last edited by immortality; April 20, 2013 at 16:55. |
|
April 21, 2013, 05:39 |
|
#58 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
there are several folders of mass flow.is it possible to put them in one sheet rather than different sheets?or how to work with different sheets?
And how can i have a column of deltaT(lower value minus upper value in a time column) I see maybe its more efficient if modify calcMassFlow. |
|
April 21, 2013, 06:40 |
|
#59 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Ehsan,
I forgot that you're not familiar with Libreoffice Calc... If you can access Youtube, here is a playlist with instructional videos on how to use Libreoffice Calc: http://www.youtube.com/watch?v=HdOLx...948B34&index=1 If for some reason you cannot access Youtube (it could be blocked at school, or bandwidth restrictions or some other reason), the following textual tutorials may help:
Bruno
__________________
|
|
April 21, 2013, 07:24 |
|
#60 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Bruno. Have you looked at the country the guy's from? The school blocking/censoring YouTube is the smallest problem
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|