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

how to calculate mass flow rate on patches and summation of that during the run?

Register Blogs Community New Posts Updated Threads Search

Like Tree23Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2013, 04:41
Default
  #21
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
how can move this thread to post processing forum?
immortality is offline   Reply With Quote

Old   April 4, 2013, 20:30
Default
  #22
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
is there a suitable post processing tool for calculating mass flow rate after the run?
immortality is offline   Reply With Quote

Old   April 5, 2013, 11:06
Default
  #23
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
is there a suitable post processing tool for calculating mass flow rate after the run?
Yep. funkyDoCalc
__________________
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
gschaider is offline   Reply With Quote

Old   April 5, 2013, 12:06
Default
  #24
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thank you.
I did it in the folder of case terminal but
this gives this error:
Code:
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 0


FOAM exiting
immortality is offline   Reply With Quote

Old   April 5, 2013, 13:02
Default
  #25
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
i also examined funkyDoCalc -time '0:.0005' but same error showed.
immortality is offline   Reply With Quote

Old   April 5, 2013, 15:02
Default
  #26
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
i also examined funkyDoCalc -time '0:.0005' but same error showed.
Have you looked at the text of the error message? You've got to provide it the name of a dictionary. It says so twice: on the top ("expressionDict") and at the bottom ("wrong number of arguments").

Examples for such dictionaries are in the Examples-folder of swak4foam
__________________
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
gschaider is offline   Reply With Quote

Old   April 5, 2013, 15:17
Default
  #27
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
what is expressionDict?
immortality is offline   Reply With Quote

Old   April 5, 2013, 15:21
Default
  #28
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I found it in Examples folder:
Code:
/ just for testing a problem with surfaceFields that become variables

compareSame {
    valueType internalField;
    variables (
        "phiSq=phi*phi;"
        "phiAvg=average(phi);"
    );
    expression "phiAvg*phiAvg-average(phiSq)";
    //    expression "phiSq";
    accumulations (
        min
        max
        average
    );
}

getPtsAvg {
    valueType internalField;
    variables (
        "avgPoint=average(pts());"
    );
    expression "pts()-avgPoint";
    accumulations (
        min
        max
        average
    );
}

getPosAvg {
    valueType internalField;
    variables (
        "avgPoint=average(pos());"
    );
    expression "pos()-avgPoint";
    accumulations (
        min
        max
        average
    );
}
but i have these in controlDict:
Code:
flowInlet
    {
        type swakExpression;
        valueType patch;
        patchName left;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    flowOutlet
    {
        type swakExpression;
        valueType patch;
        patchName right;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    surfacePlane
    {
        type swakExpression;
        valueType surface;
        surfaceName midPlane;
        surface {
            type plane;
            basePoint       (0.034 0.002 0);
            normalVector    (1 0 0);
            interpolate true;
        }
        verbose true;
        expression "mag(U)";
        accumulations (
            min
            max
        );
    }
    /*surfacePlaneReuse
    {
        type swakExpression;
        valueType surface;
        surfaceName midPlane;
        verbose true;
        expression "p";
        accumulations (
            min
            max
        );
    }
I'm confused.what thing should I call in expressionDict?the name of functions?
immortality is offline   Reply With Quote

Old   April 5, 2013, 15:29
Default
  #29
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
what is expressionDict?
Ehsan. I think your main problem is that you don't stop to think for 3 minutes before you start typing (because then you would have reread the error message in your previous posting and by just thinking "what could these english sentences mean" you would have come to the answer). Of course expressionDict is the placeholder name for whatever dictionary file you chose to use (the syntax <expressionDict> is quite common in man-pages, etc).

One effect of your quick-fire follow-up questions is that people regret that they answered your first question.
__________________
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
gschaider is offline   Reply With Quote

Old   April 5, 2013, 15:44
Default
  #30
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I'm not native speaker of english.then how its possible that i understand what expressionDict means.I read the message.but its not rational to expect someone who is not familiar by something could grasp all of aspects eventually himself.if it was so no one ask anyone.
how its certain that "expressionDict" means the name of dictionary function?
its possible to use better error messages than be angry!
its valuable to remember when we didn't know that thing.
although i'm sometimes like you and soon become angry when someone ask something that i know now.but i try consciously to control this sense.
i always thank you for your guidances.
immortality is offline   Reply With Quote

Old   April 5, 2013, 15:51
Default
  #31
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I typed funkyDoCalc flowInlet
but seems there is a trouble in reading dictionary.
Code:
--> FOAM FATAL IO ERROR: 
Istream not OK for reading dictionary 

file: flowInlet at line 1.

    From function dictionary::read(Istream&, bool)
    in file db/dictionary/dictionaryIO.C at line 91.

FOAM exiting
immortality is offline   Reply With Quote

Old   April 5, 2013, 15:56
Default
  #32
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
the flowInlet is as below:
Code:
flowInlet
    {
        type swakExpression;
        valueType patch;
        patchName left;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    flowOutlet
    {
        type swakExpression;
        valueType patch;
        patchName right;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    surfacePlane
    {
        type swakExpression;
        valueType surface;
        surfaceName midPlane;
        surface {
            type plane;
            basePoint       (0.034 0.002 0);
            normalVector    (1 0 0);
            interpolate true;
        }
        verbose true;
        expression "mag(U)";
        accumulations (
            min
            max
        );
    }
i have put this in controlDict.is this wrong?should i place it anywhere( a text file maybe)else?
thank you again.please don't be regretful of helping.
immortality is offline   Reply With Quote

Old   April 5, 2013, 18:47
Default
  #33
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
please anyone who knows give me an instance of performing funkyDoCalc.

Last edited by immortality; April 6, 2013 at 06:50.
immortality is offline   Reply With Quote

Old   April 6, 2013, 06:56
Default
  #34
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
what do you mean by dictionary file exactly?which dictionary name should i add?
I added the function name used if you mean that.but that error was displayed.why?how to use this tool correctly?
Any example?
immortality is offline   Reply With Quote

Old   April 6, 2013, 07:14
Default
  #35
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
I'm not native speaker of english.
Neither am I

Quote:
Originally Posted by immortality View Post
then how its possible that i understand what expressionDict means.I read the message.but its not rational to expect someone who is not familiar by something could grasp all of aspects eventually himself.
The <someFile>-convention is used consistently across all OpenFOAM-utilities and something you should have encountered before (in fact the OF-guys didn't invent it. It comes from the Backus-Maur Form http://en.wikipedia.org/wiki/Backus–Naur_Form)

Quote:
Originally Posted by immortality View Post
if it was so no one ask anyone.
how its certain that "expressionDict" means the name of dictionary function?
its possible to use better error messages than be angry!
its valuable to remember when we didn't know that thing.
although i'm sometimes like you and soon become angry when someone ask something that i know now.but i try consciously to control this sense.
i always thank you for your guidances.
The error messages are generated by OpenFOAM if an argument is missing. There is nothing the utility can do about it (the utility only tells OF "I will need this argument". OF ensures that it is there). The advantage is that this is handled consistently. If you don't like the error message file a bug at http://www.openfoam.org/bugs/

Examples for the use of funkyDoCalc will be found around slide 107 of
http://openfoamwiki.net/images/2/2a/...esentation.pdf

And please don't post a new question every 10 minutes: you're only proving my point
immortality likes this.
__________________
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
gschaider is offline   Reply With Quote

Old   April 6, 2013, 08:09
Default
  #36
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by immortality View Post
how can move this thread to post processing forum?
I've moved the thread to the Post-Processing forum.
Next time you need a thread moved, contact one of the moderators or administrators:
  1. Go to the main forum: http://www.cfd-online.com/Forums/
  2. Scroll down to near the end of the page.
  3. You should see the following text+link at the bottom of the forums table: View Forum Leaders
  4. In that page you should see the list of admins and moderators you can contact to ask that they move your thread.
immortality likes this.
__________________
wyldckat is offline   Reply With Quote

Old   April 6, 2013, 10:31
Default
  #37
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I saw the presentation slide notes.but i didn't figure it out what does " dictionary checkSimulation" mean yet.
Code:
funkyDoCalc -time 0.05: checkSimulation
this is part of controlDict I think the required dictionary should be here or am i wrong?
Code:
libs (
         "libOpenFOAM.so"
         "libgroovyBC.so"
         "libsimpleSwakFunctionObjects.so" 
         "libswakFunctionObjects.so"
         "libfixedMeanValue.so"
     );

functions
{
    /*massflow
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        log             true;
        valueOutput     false;
        source          patch;
        sourceName      left;
        operation       sum;

        fields
        (
            phi
        );
    }
   massflow
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        log             true;
        valueOutput     false;
        source          patch;
        sourceName      right;
        operation       sum;

        fields
        (
            phi
        );
    }*/
    

    flowInlet
    {
        type swakExpression;
        valueType patch;
        patchName left;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    flowOutlet
    {
        type swakExpression;
        valueType patch;
        patchName right;
        expression "phi";
        accumulations (
            sum
        );
        verbose true;
    }
    surfacePlane
    {
        type swakExpression;
        valueType surface;
        surfaceName midPlane;
        surface {
            type plane;
            basePoint       (0.034 0.002 0);
            normalVector    (1 0 0);
            interpolate true;
        }
        verbose true;
        expression "mag(U)";
        accumulations (
            min
            max
        );
    }
which phrase should i use instead of expressionDict?
would you please give me a brief but clear answer so that i don't need to ask again what that is simple to you but i'm unfamiliar with?
thank you very much.
syavash likes this.
immortality is offline   Reply With Quote

Old   April 6, 2013, 11:30
Default
  #38
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
and how to edit the title dear Bruno? I've written "how to calculating" in return of "how to calculate"by mistake.could edit it please?

edit: my trouble with funkyDoCalc is remained yet.I don't know how to apply it.

edit 2: dear Bruno,there was more traffic in solving thread and i reached answers somewhat more quickly!

edit 3: dear Bruno,there was more traffic in solving thread and i reached answers somewhat more quickly!
Why did you transferred me to the desert!
There are many post processing threads in solving forum to move them.
Don't turn sad.I'm just jesting!

Last edited by wyldckat; April 7, 2013 at 11:11. Reason: Too many posts... I couldn't figure out what Ehsan was talking about...
immortality is offline   Reply With Quote

Old   April 7, 2013, 11:58
Default
  #39
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

Seriously, if you have anything to add to a post, edit the last one... and before you post, refresh the page, to confirm if you have already posted or not

Otherwise, the same way you wrote sometime ago about ignoring certain answers people give you, other people will start ignoring or continue to ignore your questions
And it's the weekend... people are resting, not spending unlimited time in online support...

OK, it took me a while to look into the PDF file and do some tests. Here's what I've done:
  1. I used the tutorial "incompressible/simpleFoam/pitzDaily" as the test case.
  2. Ran the standard applications that should be executed:
    Code:
    blockMesh
    simpleFoam
  3. The PDF file Bernhard gave the link for, in page 108, says the following:
    Quote:
    And starts editing a dictionary checkSimulation
    This means that the user began editing the file named "checkSimulation". It does not say anything about "controlDict"
  4. Instead, I've created the file "fdcMassFlow", inside the case folder, with the following content:
    Code:
    massFlow
    {
      valueType patch;
      patchName inlet;
      variables (
        "rhoMagU{inlet} = 1000.0*( U & Sf() );"
      );
      expression "rhoMagU";
      accumulations (
        min
        max
        average
        sum
      );
    }
    A lot of "accumulations" here, because I wanted to check what each value provided. I used "variables", only because it was a good way to test what could be done with it.
    The expression used is a replacement for the "phi" field, because in this case we don't have it.
  5. Now, to run the funkyDoCalc application with the file "fdcMassFlow", I ran:
    Code:
    funkyDoCalc -time :200 fdcMassFlow
  6. It gave me the following output:
    Code:
    Time = 0
    massFlow : swak4Foam: Setting default mesh
    swak4Foam: Allocating new repository for sampledGlobalVariables
    --> FOAM Warning : 
        From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
        in file ExpressionResult/ExpressionResultI.H at line 324
        The minimum value -0.0178262 and the maximum -0.00313389 differ. I will use the average -0.00846667
     min=-0.00846667 max=-0.00846667 average=-0.00846667 sum=-0.254
    
    Time = 50
    massFlow : --> FOAM Warning : 
        From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
        in file ExpressionResult/ExpressionResultI.H at line 324
        The minimum value -0.0178262 and the maximum -0.00313389 differ. I will use the average -0.00846667
     min=-0.00846667 max=-0.00846667 average=-0.00846667 sum=-0.254
    
    Time = 100
    massFlow : --> FOAM Warning : 
        From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
        in file ExpressionResult/ExpressionResultI.H at line 324
        The minimum value -0.0178262 and the maximum -0.00313389 differ. I will use the average -0.00846667
     min=-0.00846667 max=-0.00846667 average=-0.00846667 sum=-0.254
    
    Time = 150
    massFlow : --> FOAM Warning : 
        From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
        in file ExpressionResult/ExpressionResultI.H at line 324
        The minimum value -0.0178262 and the maximum -0.00313389 differ. I will use the average -0.00846667
     min=-0.00846667 max=-0.00846667 average=-0.00846667 sum=-0.254
    
    Time = 200
    massFlow : --> FOAM Warning : 
        From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
        in file ExpressionResult/ExpressionResultI.H at line 324
        The minimum value -0.0178262 and the maximum -0.00313389 differ. I will use the average -0.00846667
     min=-0.00846667 max=-0.00846667 average=-0.00846667 sum=-0.254
    End
    Which is... strange Well, the "sum" result seems to be correct, from what I calculated in ParaView.
Best regards,
Bruno
immortality likes this.
__________________

Last edited by wyldckat; April 7, 2013 at 16:48. Reason: forgot "-time"
wyldckat is offline   Reply With Quote

Old   April 7, 2013, 13:11
Default
  #40
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thank you.
ok.thanks for advice.I'll edit my posts into one.
a)humm.then we should make a separate text file in the folder of case.
a question occurred to me now.is not it possible to answer such this clearly:"make a text file in case folder and put your functions in it and put its name in place of <expressionDict>" in return of giving confusing links and taking some days and...was that so difficult?

b)when I told such thing that i ignore other answers?
i remember that always appreciate any idea,hint,remark,thought,opinion,...

c)here is not weekend.weekend is friday.sunday is working day like sun is shining in the sky.friday is holiday not sunday.you mistake there

d)the high numbers of dear visitors shows that nobody ignores me.why such thing should occur in your opinion? in our iranians culture and according to what my adviser told is an our proverb"not knowing is not bad but not asking is bad" all of us want to know more and resolve our problems and also help others in aspects we know about.
syavash likes this.
immortality is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 14:03.