CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

calc of mass flux

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2009, 06:01
Default calc of mass flux
  #1
Senior Member
 
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 186
Rep Power: 8
mabinty is on a distinguished road
dear all!!

I added the in Calculation of integral boundary values posted codes into chtMultiRegionFoam to get the net mass flux in the fluid region(s) (see code-sniped below).

************************************************** ******************************
// --- PIMPLE loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "
<< fluidRegions[i].name() << endl;
#include "setRegionFluidFields.H"
#include "readFluidMultiRegionPIMPLEControls.H"
#include "solveFluid.H"
wordList globalBoundaryList;
globalBoundaryList = buildGlobalBoundaryList(fluidRegions[i]);
#include "calculateMassFlux.H"
}

........

}

************************************************** ********************************

it compiles but gives me the following warnings:

************************************************** *******************************
fluid/setRegionFluidFields.H: In function ‘int main(int, char**)’:
fluid/setRegionFluidFields.H:1: warning: unused variable ‘mesh’
fluid/setRegionFluidFields.H:5: warning: unused variable ‘K’
fluid/setRegionFluidFields.H:6: warning: unused variable ‘U’
fluid/setRegionFluidFields.H:7: warning: unused variable ‘phi’
fluid/setRegionFluidFields.H:8: warning: unused variable ‘g’
fluid/setRegionFluidFields.H:10: warning: unused variable ‘turb’
fluid/setRegionFluidFields.H:11: warning: unused variable ‘DpDt’
fluid/setRegionFluidFields.H:14: warning: unused variable ‘psi’
fluid/setRegionFluidFields.H:15: warning: unused variable ‘h
************************************************** *******************************

but the code is apparently running. should I still care about the warnings, or did I oversee something??

greatly appreciate your comments!

aram
mabinty is offline   Reply With Quote

Old   October 27, 2009, 15:43
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Hello Aram... This kind of warning has the aim of remember you that there are some defined variables that you aren't using. For example:

Code:
int a=2;
int b=4;
int g;

printf("2 by 4 is %d: \n",a*b);
if you put this in a main, etc. and compile it you'll receive a warning because the non-utilization of g. These messages warns you about defining variables and then forget the code associate to them, erasing by error or simply for leave code without use. These warnings don't impede your code to be compiled and ran, but it's a good practice to avoid warnings.

Try it and share your conclusions, it's important to close the question appropriately.

Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   October 28, 2009, 05:43
Default
  #3
Senior Member
 
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 186
Rep Power: 8
mabinty is on a distinguished road
Hi Santiago,

thank you very much for your comments!!! Thats what I assumed, that the variables mesh, K, U etc. are "not used". That again made me to be sceptical as these variables (defined in "setRegionFluidFields.H") are then used in "readFluidMultiRegionPIMPLEControls.H" and "solveFluid.H" to solve U-Equation, h-Equation etc; and indeed when I comment the reportedly "unnused" variables in "setRegionFluidFields.H" I get an error ("not declared in this scope"). BTW, this is also the case when I remove the modifications for the calculation of the mass-flux ....

Appreciate your comments,
Aram
mabinty is offline   Reply With Quote

Old   October 29, 2009, 03:54
Default
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
Has anyone any experience with calculating the mass flow/volume flow in paraview?

I've used the 'Surface Flow' filter, but the accuracy is really bad.

I've come up with a way which seems abit more accurate.
You calculate the Normals of the Slice.
You dot it with U to calculate flux, i.e flux=U.Normals, and
then you use the filter 'integrate variables'
It's still a bit sensitive to where I create the slice, but far less than the 'Surface Flow' filter.

Anyone know a better approach I would be happy to hear it.
niklas is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
Mass flux - Axisymmetric problems. JSM FLUENT 0 May 2, 2007 23:56
Definition of Mass flux F1 Gavin CD-adapco 1 April 17, 2006 17:51
How are the mass flux and mass flow rate defined? Miles CD-adapco 2 November 7, 2002 09:45
total mass flux correction for compressible fluid? Francesco Di Maio Main CFD Forum 0 August 21, 2000 04:23


All times are GMT -4. The time now is 02:38.