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

air flux through a boundary with air-water mixture

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By cutter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 8, 2013, 10:12
Default air flux through a boundary with air-water mixture
  #1
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Hi,

I have calculated the total flux through boundaries of my model but I further need to calculate the fraction of air flux through the boundaries with air-water mixture. Is there any way to find the air fraction?

Thanks a lot
Hale
Hale is offline   Reply With Quote

Old   July 8, 2013, 10:19
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

which solver do you use and how is you processing done (calculation within solver or via function objects)? You probably need to account for the alpha/alpha1 values.

Cutter
cutter is offline   Reply With Quote

Old   July 8, 2013, 10:30
Default
  #3
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Quote:
Originally Posted by cutter View Post
Hi,

which solver do you use and how is you processing done (calculation within solver or via function objects)? You probably need to account for the alpha/alpha1 values.

Cutter
Thanks for your reply.

I'm using InterFoam and the calculation is done via a function object (calcMassFlow that uses the phi file to calculate the fluxes through boundaries; http://www.cfd-online.com/Forums/ope...-boundary.html)

You are definitely right. I have to multiply the total mass flux (at each boundary and time step) with the corresponding alpha1 values but is it possible to do it after the calculation is performed? How can I distinguish the alpha1 values for different boundaries?
Hale is offline   Reply With Quote

Old   July 8, 2013, 10:44
Default
  #4
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
This should be possible by using the faceSource function object:

Code:
    myFuncObj
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        outputControl   timeStep;
        log             true;
        // Output field values as well
        valueOutput     false;
        source          patch;
        sourceName      outlet; // replace patch name!!!
        operation       sum;

        fields
        (
            rho*phi*alpha // maybe fix eqn. for your purpose!!!
        );
    }
Feedback welcome!

Cutter
cutter is offline   Reply With Quote

Old   July 8, 2013, 10:54
Default
  #5
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Quote:
Originally Posted by cutter View Post
This should be possible by using the faceSource function object:

Code:
    myFuncObj
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        outputControl   timeStep;
        log             true;
        // Output field values as well
        valueOutput     false;
        source          patch;
        sourceName      outlet; // replace patch name!!!
        operation       sum;

        fields
        (
            rho*phi*alpha // maybe fix eqn. for your purpose!!!
        );
    }
Feedback welcome!

Cutter
Sorry for asking simple questions, I'm very new to OpenFOAM. Where should I place this code? and do I need the log file from the calculation in order to use this function? I didn't restore the data in a log file when I ran the simulations.
Hale is offline   Reply With Quote

Old   July 8, 2013, 11:20
Default
  #6
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Function objects are registered within a subdict called 'functions' in $CASE/system/controlDict.

See http://foam.sourceforge.net/docs/cpp/a00002.html and https://www.hpc.ntnu.no/display/hpc/...Postprocessing for example.
gregjunqua likes this.
cutter is offline   Reply With Quote

Old   July 8, 2013, 11:59
Default
  #7
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Quote:
Originally Posted by cutter View Post
Function objects are registered within a subdict called 'functions' in $CASE/system/controlDict.

See http://foam.sourceforge.net/docs/cpp/a00002.html and https://www.hpc.ntnu.no/display/hpc/...Postprocessing for example.
Thanks a lot. I ran the simulations for several seconds now (by having the code you gave in the system/controlDict). But how can I access the results? I mean the air fluxes?
Hale is offline   Reply With Quote

Old   July 8, 2013, 12:13
Default
  #8
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
It should be written to the solver's text output at the end of each time step.
cutter is offline   Reply With Quote

Old   July 8, 2013, 12:46
Default
  #9
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Quote:
Originally Posted by cutter View Post
It should be written to the solver's text output at the end of each time step.
I'm really sorry but nothing is written to the log file. I have attached my controlDict file to this message. I will really be grateful if you could tell me what I have done wrong.
Attached Files
File Type: txt controlDict.txt (1.8 KB, 24 views)
Hale is offline   Reply With Quote

Old   July 9, 2013, 05:06
Default
  #10
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
I have now fixed the problem with getting output from the solver. When I set rho*phi in the faceSource object function it gives the total flux at each time step but when I add the alpha1 (i.e. rho*phi*alpha1) it gives nothing in the output file. How can this problem be fixed?

Thanks
\Hale
Hale is offline   Reply With Quote

Old   December 15, 2014, 05:05
Default
  #11
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

sorry for the really late reply. Maybe it still helps you or any other reader of this thread.

Have a look at https://github.com/OpenFOAM/OpenFOAM...em/controlDict for a working example for OpenFOAM 2.3.x (there are tutorial cases for other versions of OF as well)!

The data will be written into ASCII text files (simple CSV format, with file extension *.dat) in a directory called postProcessing within the root directory of your case.

Feel free to ask follow up questions if necessary, hopefully the answer will come faster next time.

Cutter
cutter is offline   Reply With Quote

Old   January 6, 2015, 13:56
Default
  #12
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 138
Rep Power: 16
mgdenno is on a distinguished road
I have been playing around with this myself and I haven't been able to multiply rho*phi by alpha using faceSource.

One solution is to use swak4foam instead of faceSource. I found this somewhere on the forums, but I can't remember which post it came from.

https://openfoamwiki.net/index.php/Contrib/swak4Foam

Code:
    inlet
    {
        type                swakExpression;
        valueType           patch;
        patchName           c_inlet;
        aliases{alpha alpha.water;}
        verbose             true;
        expression          "alpha*U&Sf()";
        accumulations       ( sum );
        outputControlMode outputTime;
        outputInterval 1;
    }
mgdenno 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15
Simulating A water bubble in air with periodic boundary condition cubicmatrixist Main CFD Forum 0 October 14, 2010 13:26
water and air interface boundary Shivakanth Main CFD Forum 2 September 25, 2008 10:11
Mixture model - water droplet + air - EVAPORATION bohis FLUENT 4 January 25, 2008 12:04


All times are GMT -4. The time now is 17:35.