CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

buoyantBoussinesqSimpleFoam: Steady state: Mass Flow rate NOT EQUAL at inlet & outlet

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By danielbanos10
  • 1 Post By floquation
  • 1 Post By akidess

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2016, 01:41
Default buoyantBoussinesqSimpleFoam: Steady state: Mass Flow rate NOT EQUAL at inlet & outlet
  #1
Member
 
Sing
Join Date: Jan 2016
Posts: 30
Rep Power: 10
Struggle_Achieve is on a distinguished road
Hello Everybody,

I was trying to simulate flow using buoyantBoussinesqSimpleFoam, my plan is to first simulate and validate flow then come to temperature.
I initially set the case with following residual control
Code:
residualControl
    {
        p_rgh           1e-2;
        U               1e-3; 
        T               1e-3; 
       "(k|epsilon|omega)" 1e-3;
    }
The results converged at around 300 iterations. But when I checked the mass flow rate at inlet and outlet they were different. So I thought, this can be due to improper convergence of my solution so I further reduced the residual controls:

Code:
residualControl
    {
        p_rgh           1e-3;
        U               1e-4; 
        T               1e-3; 
       "(k|epsilon|omega)" 1e-4;
    }
And also to

Code:
residualControl
    {
        p_rgh           1e-4;
        U               1e-4; 
        T               1e-3; 
       "(k|epsilon|omega)" 1e-4;
    }
But still the mass flow rate is not equal at inlet and outlet.

Has anybody else encountered such type of problem.
I would greatly appreciate any help.

Thanks and regards,
Singh.
Struggle_Achieve is offline   Reply With Quote

Old   September 30, 2016, 02:25
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Just troubleshooting...

Recently I used the transient version of that solver: buoyantBoussinesqPimpleFoam, and found that any kind of urf (under relaxation) would worsen my solution. Of course, this might not be the case for the (steady-state) Simple-version of the solver.
Nevertheless, I'd try setting urf to 1, and control convergence by reducing the timestep - just to see what happens.

An alternative of what might be going wrong is: how do you compute the mass flow rate? And how not-equal is "not equal"?
floquation is offline   Reply With Quote

Old   September 30, 2016, 04:40
Default
  #3
Member
 
Sing
Join Date: Jan 2016
Posts: 30
Rep Power: 10
Struggle_Achieve is on a distinguished road
Quote:
Originally Posted by floquation View Post
Just troubleshooting...

Recently I used the transient version of that solver: buoyantBoussinesqPimpleFoam, and found that any kind of urf (under relaxation) would worsen my solution. Of course, this might not be the case for the (steady-state) Simple-version of the solver.
Nevertheless, I'd try setting urf to 1, and control convergence by reducing the timestep - just to see what happens.

An alternative of what might be going wrong is: how do you compute the mass flow rate? And how not-equal is "not equal"?
Hello kevin,
Thanks for the quick reply.
I will try to run the simulation with urf = 1 and reducing the time step. Will update the results for the same.
I am calculating mass flow rate using paraview. First I select the patch (inlet/outlet) then using calculator I define a variable as rho*U_Z (fluid entering and leaving in z direction) then I use integrate variable to get the mass flow rate.
And not equal means at inlet I am getting a mass flow rate of 16.6 and at outlet its 15.5.
Thanks and regards,
Singh.
Struggle_Achieve is offline   Reply With Quote

Old   September 30, 2016, 04:52
Default
  #4
New Member
 
danielbanos10's Avatar
 
Join Date: Jun 2016
Location: Malaga, Spain
Posts: 15
Rep Power: 9
danielbanos10 is on a distinguished road
Hi,
Have you tried to calculate that values directly in Foam, "patchIntegrate"?

I had the same error but the difference between the velocity was around 1e-5,(I think that's due to numerical error).
Struggle_Achieve likes this.
danielbanos10 is offline   Reply With Quote

Old   September 30, 2016, 05:35
Default
  #5
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20
floquation will become famous soon enough
Quote:
Originally Posted by Struggle_Achieve View Post
I am calculating mass flow rate using paraview. First I select the patch (inlet/outlet) then using calculator I define a variable as rho*U_Z (fluid entering and leaving in z direction) then I use integrate variable to get the mass flow rate.
This could very well be the problem. What are your inlet and outlet values, i.e. by how much do they differ?

I've recently had a similar problem.

The reason that this may be troublesome, is that you use the exact relation for the mass-flow rate, which you discretise in a trivial manner on your patch: simply interpolate and then multiply. This makes perfect sense in the exact representation. However, it is plain simply wrong in the discretised representation: that is not how the fluxes were solved by OpenFoam. Hence they are not the fluxes that you calculate.
Depending on your convective scheme, OpenFoam calculates the discretised fluxes in a different way than you do. Therefore, if you wish to calculate the flux properly, you must calculate it in exactly the same way as OpenFoam solved it. If you do so, you'll get a perfectly (within your residuals, of course) conservative solution. After all, OpenFoam uses the Finite-Volume Method which is supposed to be perfectly conservative.

How to do that in ParaView? I have no clue how you can get ParaView to calculate the fluxes as computed using e.g. the vanLeer scheme...
What I do - I use swak4foam to compute such quantities during runtime. An example of the required swak4foam code for the thermal fluxes is shown here.
Struggle_Achieve likes this.
floquation is offline   Reply With Quote

Old   September 30, 2016, 08:10
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Using URF=1 on xSimpleFoam will diverge no matter the time step (which affects only naming).

To get a good result, you should use phi to compare the mass fluxes, not U. As already said, patchIntegrate phi should give you what you are looking for.
Struggle_Achieve likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   October 3, 2016, 05:46
Default Thanks!
  #7
Member
 
Sing
Join Date: Jan 2016
Posts: 30
Rep Power: 10
Struggle_Achieve is on a distinguished road
Hello Everyone,
My deepest gratitude for solving the matter.

Actually I used simpleFunctionObjects, to calculate the mass flow from the inlet and outlet patches. Which seems to be consistent for the case of mass flow.
In functions I used the patchMassFlow type to plot the mass flow rate at inlet and outlet,
http://openfoamwiki.net/index.php/Co...unctionObjects

Thanks and regards,
Singh.
Struggle_Achieve 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 21:43
Species mass flow inlet lorenz FLUENT 3 March 15, 2012 07:26
Net mass flow inlet vs outlet Nigui28 FLUENT 1 August 12, 2011 10:09
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
Inlet and outlet flow rate Neser CFX 1 March 2, 2004 16:02


All times are GMT -4. The time now is 22:41.