# air flux through a boundary with air-water mixture

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 8, 2013, 09:12 air flux through a boundary with air-water mixture #1 Member   Hale Join Date: May 2013 Posts: 53 Rep Power: 4 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

 July 8, 2013, 09:19 #2 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 112 Rep Power: 7 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

July 8, 2013, 09:30
#3
Member

Hale
Join Date: May 2013
Posts: 53
Rep Power: 4
Quote:
 Originally Posted by cutter 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

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; Calculation of mass flow across a boundary)

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?

 July 8, 2013, 09:44 #4 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 112 Rep Power: 7 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

July 8, 2013, 09:54
#5
Member

Hale
Join Date: May 2013
Posts: 53
Rep Power: 4
Quote:
 Originally Posted by cutter 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.

 July 8, 2013, 10:20 #6 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 112 Rep Power: 7 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.

July 8, 2013, 10:59
#7
Member

Hale
Join Date: May 2013
Posts: 53
Rep Power: 4
Quote:
 Originally Posted by cutter 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?

 July 8, 2013, 11:13 #8 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 112 Rep Power: 7 It should be written to the solver's text output at the end of each time step.

July 8, 2013, 11:46
#9
Member

Hale
Join Date: May 2013
Posts: 53
Rep Power: 4
Quote:
 Originally Posted by cutter 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
 controlDict.txt (1.8 KB, 6 views)

 July 9, 2013, 04:06 #10 Member   Hale Join Date: May 2013 Posts: 53 Rep Power: 4 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

 December 15, 2014, 05:05 #11 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 112 Rep Power: 7 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

 January 6, 2015, 13:56 #12 Senior Member   Matthew Denno Join Date: Feb 2010 Posts: 137 Rep Power: 7 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; }```

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post volo87 CFX 5 June 14, 2013 17:44 EtaEta CFX 7 December 8, 2011 18:15 cubicmatrixist Main CFD Forum 0 October 14, 2010 12:26 Shivakanth Main CFD Forum 2 September 25, 2008 09:11 bohis FLUENT 4 January 25, 2008 12:04

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