CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to calculate mass flow rate on patches and summation of that during the run? (https://www.cfd-online.com/Forums/openfoam-post-processing/115428-how-calculate-mass-flow-rate-patches-summation-during-run.html)

immortality March 30, 2013 15:11

how to calculate mass flow rate on patches and summation of that during the run?
 
I know I have to use such code.but I don't know where should i put this in the OF files.in solver code(where of it?)or controlDict?
Code:

// find the identification number (e.g. label) for our boundary of interest.
    label inletPatch = mesh.boundaryMesh().findPatchID("velocity_inlet");
 
    // if we don't have such a patch, warn the user
    if (inletPatch==-1)
    {
 
        Info << "Failure to find patch named velocity_inlet for mass flow calc."
            <<endl;
 
    }
    else  // calculate the result and do output
    {
 
// the sum operator implicity loops over the boundary faces and stores the result in inFlux
 
// note inflow is negative according to dot product. Lets multiply by -1 to
// make it positive.
        scalar inFlux = -1.0* sum(phi.boundaryField()[inletPatch]);
 
        Info << "  Inflow= " << inFlux    <<" [kg/s]  " ;
    }


fumiya March 30, 2013 17:46

I think there shouldn't be a problem if you add the code just before

Code:

runTime.write();
Best regards,
Fumiya

immortality March 31, 2013 05:26

thanks Fumiya
and in this thread http://www.cfd-online.com/Forums/ope...ry-values.html
two files are introduced for calculating flow rate during the run.
where have to add the include files and the headers themselves in the solver code?

haakon March 31, 2013 06:06

Although hard-coding this into the solver might give you the data you need, I suppose that it is way much easier to use some of OpenFOAM's run-time postprocessing tools, witch will give you what you need without the need to compile a single line of code.

To calculate the mass flow rates out of a patch/domain you should try something similar to this: https://www.hpc.ntnu.no/display/hpc/...Postprocessing

In addition you might want to look at swak4Foam, witch you can use to create complex expressions (used in the note linked to above).

If you need to integrate the mass flow over time (to find the total volume of discharged mass) you can do that as a post-processing step (for example in Octave/Matlab or similar tools). Integrating by the trapezoid rule should be straight-forward and probably accurate enough.

immortality March 31, 2013 07:58

in this link there is the same as above.but where should i add the header files?
http://www.openfoamwiki.net/index.ph...ting_mass_flow

haakon March 31, 2013 09:36

I really think you should pay more attention to my answers. I certainly expect people to read and find out stuff on their own. That means that I still think you should have a look at this tutorial: https://www.hpc.ntnu.no/display/hpc/...Postprocessing

The reason for me to stress this is that I suspect that your suggested solution, that is creating and compiling a custom-made solver, is way too complicated. The thread you found is from 2005, and the wiki article you link to is not updated since 2006. That is really a long time ago in the OpenFOAM world, and a lot of new features are added since then. Another aspect is that OpenFOAM 1.3 was the newest version in 2006, and you have no guarantees that the code will compile against the 2.x.x-versions of OpenFOAM (without looking at the code at all I would guess that so many things have happened since version 1.3 that it will not compile).

My suggested solution is simple, and a more or less verbatim copy of my recommended tutorial:
  1. Install swak4Foam. This is an extremely useful toolbox, and you will probably find the time well invested. You should find the installation instructions on your own (Google, forum search).
  2. Add the following to the bottom of your system/controlDict file:
    Code:

    libs (
            "libOpenFOAM.so"
            "libsimpleSwakFunctionObjects.so"
            "libswakFunctionObjects.so"
        );

    functions
    {
        volFlow
        {
            type                swakExpression;
            valueType          patch;
            patchName          outletPatchName;
           
            verbose            true;
            expression          "U&Sf()";
            accumulations      ( sum );
        }
    }

The great with this is that you are able to use it with any solver, across different versions and cases without the need to recompile and rewrite a lot of source code each time. If you need more advanced expressions that is certainly possible too, there are a lot of examples out on the internet (search!).

Good luck.

immortality March 31, 2013 16:32

thank you very much.the thread seemed somewhat confusing but now your summary is so useful.but
1)I have one inlet and one outlet.how to introduce both patches?
2)since the boundaries are changing during the run I want to calculate mass flow rates between two times.is it possible to calculating of phi like other parameters as: patchAverage -time '.001:.002' variable patchName ?
3)how to calculate total mass balance at the end of run.does the code
Code:

accumulations      ( sum );
do such thing?
thanks.

immortality April 1, 2013 03:14

and also i have a compressible fluid.isn't it better to use phi instead of U?
Please Give me a link for other expressions if there is.i haven't found anything.

haakon April 1, 2013 05:39

Quote:

Originally Posted by immortality (Post 417448)
thank you very much.the thread seemed somewhat confusing but now your summary is so useful.but
1)I have one inlet and one outlet.how to introduce both patches?

If you need the flow at the inlet and outlet separately, you can add two copies of the volFlow function, like this:
Code:

functions
{
    volFlowInlet
    {
        type                swakExpression;
        valueType          patch;
        patchName          inletPatchName;
       
        verbose            true;
        expression          "U&Sf()";
        accumulations      ( sum );
    }
   
    volFlowOutlet
    {
        type                swakExpression;
        valueType          patch;
        patchName          outletPatchName;
       
        verbose            true;
        expression          "U&Sf()";
        accumulations      ( sum );
    }
}

If you need to calculate the net difference in flow, then you can do this by summing the two flows. I guess it is easiest to do this in Excel, Octave, Matlab or similar. If you really need it i also guess it is also possible to do this at run-time, but I can't give you an example right now. Check the examples that is distributed with swak4Foam, they are really good. You should pay special attention to the angledDuctImplicit example, as it is packed with swak4Foam examples.

Quote:

Originally Posted by immortality (Post 417448)
2)since the boundaries are changing during the run I want to calculate mass flow rates between two times.is it possible to calculating of phi like other parameters as: patchAverage -time '.001:.002' variable patchName ?

I guess it is easiest to do this based on the results from the individual mass flows as well. Load the data into Matlab, calculate the difference at each time and integrate. A trapezoidal integration is probably fine.

Have you considered doing a volume integration to get the total mass in the domain at each time? The accumulated/lost mass between the two times will then be just the difference in total mass. Isn't that the easiest way to do it?


Quote:

Originally Posted by immortality (Post 417448)
3)how to calculate total mass balance at the end of run.does the code
Code:

accumulations      ( sum );
do such thing?
thanks.

This piece of code sum over the patch, i.e. integrates. I guess, again, that the mass balance over time is easiest to find by postprocessing your numbers. Or perhaps doing a volume integration?

And yes, you can use phi instead of U&Sf(). I have never done any compressible analyses, so all my examples assume constant density (hence volume and mass flow is the same thing). You should watch out for this on your own.

immortality April 1, 2013 07:36

thanks a lot.since i hadn't added the functions you mentioned since first how can I obtain mass flow rate now(in the middle of run.I've stopped the run and now need to know the mass flow rates)

haakon April 1, 2013 07:40

What do you mean? I don't think i understand. It should be perfectly possible to stop a run (assuming you have some saved fields), add the swak4Foam probes in controlDict and start the run again (remember to set startFrom latestTime in controlDict).

immortality April 1, 2013 09:35

the run is reached to a stage that i should check for equality of inflow and outflow to be exactly the same(althogh problem is unsteady compressible since inflow and outflow are in fact connected to combustion chamber that i don't need to simulate but mass since flow rate into and out from combustion chamber should be the same I have to set outflow patch to be closed when the total mass out of it be equal to inflow.it means mass flow rates should be the same.now that the first stage is ended how can i calculate the mass flow rates and modify the settings?

immortality April 1, 2013 09:36

and also please see is this correct?
Code:

functions
{
    volFlowInlet
    {
        type                swakExpression;
        valueType          patch;
        patchName          left;
       
        verbose            true;
        expression          "phi";
        accumulations      ( sum );
    }
   
    volFlowOutlet
    {
        type                swakExpression;
        valueType          patch;
        patchName          right;
       
        verbose            true;
        expression          "phi";
        accumulations      ( sum );
    }
}


immortality April 1, 2013 16:25

i corrected it as below functions:
Code:

functions
{
    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;
    }

but is there a way(a keyword like patchAverage that doesn't work for phi thats surfaceScalarField) to calculate all of mass entered and exited in and out of a patch after the run(post-processing)?

immortality April 2, 2013 00:41

dear Hakon.i did what you said.now there is swak folders that have sum of phi on cells from the time i added the function.now how can i obtain phi on before time folders?
Thanks.

haakon April 2, 2013 03:25

Please, I am not on-line all the time. Be patient. Do not post four follow-up posts. Think before you write. And please also remember that the people here on this forum help you as volunteers, they are not paid consultants. You should re-think the way you ask questions and treat other people. If I answer or helps you, that gives me no further obligations to answer any further questions.

I really think you should learn how to use internet search functionality, both Google and at this forum. Neither me nor other members on this forum am in a position to give you the complete and full answer all the time. In such cases I usually post from my memory, and assume that you are able to do the rest of the work yourself, like correcting bugs and do simple lookups in documentation, user manuals, examples and tutorials.

You, on the other hand, simply demand that the people that helps you give you the complete solution all the time. That is not how things work (at least not for me). I really think you should consider a visit to this forum: http://www.cfd-online.com/Forums/cfd-freelancers/

Btw: I think the answer to your question is the tool execFlowFunctionObjects

immortality April 2, 2013 05:43

im sorry my friend.we are here to help eachother.i only propound my question to reach an answer for myself and for others need it now or in future.its nice to remember we god belivers in all religions believe that all knowledge page we write or learn someone remains and help us in other world.the knowledge value is higher than this assumpsions and comparison to money.
Thank you very much again for posts

immortality April 2, 2013 08:45

the command execFlowFunctionObjects gives this error:
Code:

--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000534/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.000535
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000535/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.000536
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000536/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.000537
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000537/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.000538
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000538/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.000539
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.000539/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

Time = 0.00054
    Reading phi
    Reading U
    Reading p
Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

Selecting RAS turbulence model kOmegaSST
--> Upgrading k to employ run-time selectable wall functions
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ehsan/Desktop/WR_pimple_limited/0.00054/k at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 73.

is there another command for that specific for SWAK4FOAM functions?

immortality April 2, 2013 15:15

its odd if nothing has made yet for mass flux post processing after run.then should i delete all folders and begin from zero again to write mass flux in folders?

immortality April 2, 2013 18:32

if anyone knows a post processing keyword or function please guide me.
Thanks all.

immortality April 3, 2013 03:41

how can move this thread to post processing forum?

immortality April 4, 2013 19:30

is there a suitable post processing tool for calculating mass flow rate after the run?

gschaider April 5, 2013 10:06

Quote:

Originally Posted by immortality (Post 418444)
is there a suitable post processing tool for calculating mass flow rate after the run?

Yep. funkyDoCalc

immortality April 5, 2013 11:06

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 April 5, 2013 12:02

i also examined funkyDoCalc -time '0:.0005' but same error showed.

gschaider April 5, 2013 14:02

Quote:

Originally Posted by immortality (Post 418584)
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

immortality April 5, 2013 14:17

what is expressionDict?

immortality April 5, 2013 14:21

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?

gschaider April 5, 2013 14:29

Quote:

Originally Posted by immortality (Post 418624)
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.

immortality April 5, 2013 14:44

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 April 5, 2013 14:51

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 April 5, 2013 14:56

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 April 5, 2013 17:47

please anyone who knows give me an instance of performing funkyDoCalc.

immortality April 6, 2013 05:56

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?

gschaider April 6, 2013 06:14

Quote:

Originally Posted by immortality (Post 418634)
I'm not native speaker of english.

Neither am I

Quote:

Originally Posted by immortality (Post 418634)
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 (Post 418634)
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

wyldckat April 6, 2013 07:09

Quote:

Originally Posted by immortality (Post 418004)
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 April 6, 2013 09:31

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.

immortality April 6, 2013 10:30

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?:rolleyes:

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! ;)

wyldckat April 7, 2013 10:58

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 :rolleyes:

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" :rolleyes:
  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 :confused: Well, the "sum" result seems to be correct, from what I calculated in ParaView.
Best regards,
Bruno

immortality April 7, 2013 12:11

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,...:D

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?:mad::D 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":p all of us want to know more and resolve our problems and also help others in aspects we know about.


All times are GMT -4. The time now is 15:49.