CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Mass Conservation and Convergence in Transient CFD Simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree27Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 1, 2023, 13:41
Default
  #41
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post
I am looking, right now, at the Prof. J.Y. Murthy ME608 Notes at Purdue, which has a nice 1D example with Rhie-Chow interpolation at the beginning of chapter 7 and, honestly, I still don't see how RC could produce such solution...

This is because the Rhie and Chow term is something like (pf1 - pf0) * df . Where pf1 and pf0 are interpolated pressure at face from right and left cells. When the solution is smooth the pf1 matches pf0 and this term vanishes. If it does not vanish it becomes part of the flux.

The convergence then only depends on finding some pressure profile that even though produces non zero rhie and chow term , satisfies Sum(fluxes) = 0. Pressure gradient is then just another source term to momentum equation.

In theory rhie and chow term should converge to zero. This in practice does not happen specially in unstructured meshes.
arjun is offline   Reply With Quote

Old   May 1, 2023, 13:45
Default
  #42
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by sbaffini View Post
I am looking, right now, at the Prof. J.Y. Murthy ME608 Notes at Purdue, which has a nice 1D example with Rhie-Chow interpolation at the beginning of chapter 7 and, honestly, I still don't see how RC could produce such solution...

EDIT: Let me say it better and more clearly. Fluent is giving converged residuals and mass imbalance distribution at 1e-17, yet the corresponding solution has div(u) = -1, which is in contrast, to the best of my understanding, to the RC alteration of the continuity equation, which should be order dx^3 (around 1e-7 here) times the 4th order derivative of the pressure (which should be 0 for the solution I'm getting). This is, for Fluent, a fully legit solution of the test problem I've setup but, again, I don't see how this could be possible. I'm maybe wrong, but I see this as very confusing



Actually, the RC term should result like O(dt*h^2), isn't that?


However, I agree, the meaning of a "convergent" solution with a mass imbalance has only added confusion.
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 13:47
Default
  #43
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arjun View Post
This is because the Rhie and Chow term is something like (pf1 - pf0) * df . Where pf1 and pf0 are interpolated pressure at face from right and left cells. When the solution is smooth the pf1 matches pf0 and this term vanishes. If it does not vanish it becomes part of the flux.

The convergence then only depends on finding some pressure profile that even though produces non zero rhie and chow term , satisfies Sum(fluxes) = 0. Pressure gradient is then just another source term to momentum equation.

In theory rhie and chow term should converge to zero. This in practice does not happen specially in unstructured meshes.



That does not answer to the fact that an increasing in div V must be balanced to an increasing (opposite sign) of the RC term. The two terms should indefinitely increase in time ...
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 13:51
Default
  #44
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Another update after another small test.

Took the base converged case and switched the inlet bc to mass flow inlet using the value reported from the monitors as value for the bc.

Residuals suddenly jumped to a constant value slightly below 1e-3 with no further evolution in anything else. The solution stayed exactly the same.

Then, I repeated the test starting from scratch and using mass flow inlet as inlet bc.

Now, everything correctly blows up.

Sounds like a bug in velocity inlet bc to me

If now OP could, at least, tell us what Fluent version he is using...
Ford Prefect and FMDenaro like this.
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 13:54
Default
  #45
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by sbaffini View Post
Another update after another small test.

Took the base converged case and switched the inlet bc to mass flow inlet using the value reported from the monitors as value for the bc.

Residuals suddenly jumped to a constant value slightly below 1e-3 with no further evolution in anything else. The solution stayed exactly the same.

Then, I repeated the test starting from scratch and using mass flow inlet as inlet bc.

Now, everything correctly blows up.

Sounds like a bug in velocity inlet bc to me
Just to simplify anything, are you considering a simple 2d channel with a closed wall?
Is the grid cartesian and structured ?
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 13:56
Default
  #46
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by FMDenaro View Post
Just to simplify anything, are you considering a simple 2d channel with a closed wall?
Is the grid cartesian and structured ?
It's 1D, 128x1x1, inviscid. Honestly, I don't want to make another mesh for this
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 14:24
Default
  #47
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Another small update. SIMPLEC and PISO blow up, but the COUPLED pressure solver doesn't and has the same behavior and solution with both the BCs.
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 16:29
Default
  #48
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by FMDenaro View Post
That does not answer to the fact that an increasing in div V must be balanced to an increasing (opposite sign) of the RC term. The two terms should indefinitely increase in time ...
Well no. Pressure correct equation corrects the pressure until sum(fluxes) = 0 is achieved. Once a balance is found it will stop correcting.

If there is an increase in velocity then it would be corrected by pressure correction to minimise sum of fluxes.
arjun is offline   Reply With Quote

Old   May 1, 2023, 16:31
Default
  #49
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by sbaffini View Post
Another small update. SIMPLEC and PISO blow up, but the COUPLED pressure solver doesn't and has the same behavior and solution with both the BCs.
Simplec might again converge with smaller urfs.
arjun is offline   Reply With Quote

Old   May 1, 2023, 16:38
Default
  #50
New Member
 
Join Date: Jan 2023
Posts: 7
Rep Power: 3
CFDParty is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
Another update after another small test.

Took the base converged case and switched the inlet bc to mass flow inlet using the value reported from the monitors as value for the bc.

Residuals suddenly jumped to a constant value slightly below 1e-3 with no further evolution in anything else. The solution stayed exactly the same.

Then, I repeated the test starting from scratch and using mass flow inlet as inlet bc.

Now, everything correctly blows up.

Sounds like a bug in velocity inlet bc to me

If now OP could, at least, tell us what Fluent version he is using...
First of all, I want to apologize for replying this late to this tread, I was on travel over the long weekend. I see that I've started some frustrations here, so again very sorry for this.

These are the specifics to my case:
1. Fluent 2022 R2
2. The fluid density and viscosity is set to be constant
3. I'm using a pressure-based solver, SIMPLE sheme with Rhie-Chow distance based flux type, first order implicit transient formulation, Least squared cell for gradient, second order for pressure, and second order upwind for momentum.
4. I performed 40 time steps with dt=5e-5, with 100 iterations per time step.
5. The residuals for continuity, x-velocity and y-velocity are all set to default (0.001)
sbaffini likes this.
CFDParty is offline   Reply With Quote

Old   May 1, 2023, 16:40
Default
  #51
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arjun View Post
Well no. Pressure correct equation corrects the pressure until sum(fluxes) = 0 is achieved. Once a balance is found it will stop correcting.

If there is an increase in velocity then it would be corrected by pressure correction to minimise sum of fluxes.



But with a velocity inlet and no outlet, it must be an increasing in velocity gradient, not in the velocity...
That is, we know that, div V must increase, therefore the correction is always in.
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 16:42
Default
  #52
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by FMDenaro View Post
But with a velocity inlet and no outlet, it must be an increasing in velocity gradient, not in the velocity...
That is, we know that, div V must increase, therefore the correction is always in.

Balanced by pressure ie rhie and chow. Thats only way there is stable solution.
arjun is offline   Reply With Quote

Old   May 1, 2023, 17:10
Default
  #53
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by arjun View Post
Balanced by pressure ie rhie and chow. Thats only way there is stable solution.



Ok, let us assume such a mechanism is working. During the time integration each term will increase to ensure to balance the residual. This happens while having a mass imbalance.

But I expect that these terms will become so large in magnitude that at a certain point the run crashes ...
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 17:12
Default
  #54
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by CFDParty View Post
I see that I've started some frustrations here
Hahahha... guilty as charged. Apologies as well from me for showing frustration

However, my suggestion is to try the mass flow inlet bc and see if you have similar results. My guess is that you won't. Also, in my opinion, this is a clear bug of the velocity inlet bc. I haven't tried every other combination of solver settings but, most of your options haven't shown any significant effect on the results of my base case.
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 17:21
Default
  #55
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by arjun View Post
Simplec might again converge with smaller urfs.
For obvious reasons, I kept default values for all the tests, so I dind't attempt any change of method settings, only switched across methods.
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 17:22
Default
  #56
New Member
 
Join Date: Jan 2023
Posts: 7
Rep Power: 3
CFDParty is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
Hahahha... guilty as charged. Apologies as well from me for showing frustration
No worries, I really appreciate all the effort!


Quote:
Originally Posted by sbaffini View Post
However, my suggestion is to try the mass flow inlet bc and see if you have similar results. My guess is that you won't. Also, in my opinion, this is a clear bug of the velocity inlet bc. I haven't tried every other combination of solver settings but, most of your options haven't shown any significant effect on the results of my base case.
In the mean time I set the absolute criteria for continuity to 1e-05. Which has no trouble converging, also reported the mass flow rate at the inlet which is constant, no reversed flow is detected at the inlet.

Now just tried to change the inlet to mass flow inlet, where the solution again convergences without trouble
CFDParty is offline   Reply With Quote

Old   May 1, 2023, 17:33
Default
  #57
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,191
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by CFDParty View Post
No worries, I really appreciate all the effort!



In the mean time I set the absolute criteria for continuity to 1e-05. Which has no trouble converging, also reported the mass flow rate at the inlet which is constant, no reversed flow is detected at the inlet.

Now just tried to change the inlet to mass flow inlet, where the solution again convergences without trouble
Just for a check, I tried with SIMPLE and second order for pressure but I confirm the different behavior of the two inlet bcs. Velocity inlet gives a solution (and actually the pressure seems now to be exactly the Bernoulli solution with no error, except near the inlet), but mass flow inlet doesn't.

I don't know what else to say... just don't do that
CFDParty likes this.
sbaffini is offline   Reply With Quote

Old   May 1, 2023, 17:40
Default
  #58
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,865
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
My final opinion: any kind of numerical solution that does not crash for such problem is rubbish.

In no way a CFD developer should accept that from his code.
CFDParty likes this.
FMDenaro is offline   Reply With Quote

Old   May 1, 2023, 19:10
Default
  #59
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,750
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
I didn't doubt that someone managed to run a Fluent case that "converged" without blowing up in finite time. But it should eventually blow up. And in my personal opinion this isn't a fault of poorly coded Fluent as I'm fairly confident you could repeat it in many other software as well. I don't think any CFD developer expects anyone to use their code to simulation a problem with no solution (known a priori).

In general, just don't do simulations like this. Benchmark against things that actually make sense. And if you must do it anyway, be prepared that it requires a more-than-surface-level understanding to interpret the results. The benefit of discussing it here in this particular user group is that we've experienced and encountered so many crazy things that it isn't crazy talk.
LuckyTran is offline   Reply With Quote

Old   May 2, 2023, 02:05
Default
  #60
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by LuckyTran View Post
IBenchmark against things that actually make sense. And if you must do it anyway, be prepared that it requires a more-than-surface-level understanding to interpret the results.



This is very true.

As a person who writes CFD solvers, my aim is to provide a robust and stable solver but accuracy takes first place. That means stability NOT at the cost of accuracy.

Having said this, user shall be careful and should have good understanding of what he is solving and what is expected solution. He should know how to judge the solution.
JBeilke and CFDParty like this.
arjun 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
axial compressor mass flow convergence issue jyotir SU2 5 July 5, 2024 10:06
SU2 NACA0012 Transitional flow simulation Convergence Issues morgJ SU2 0 July 21, 2022 08:42
mass flow conservation in transient simulations egonalter CFX 20 July 27, 2017 08:18
Problem with an old Simulation FrankW CFX 3 February 8, 2016 05:28
Mass conservation problem in mixing tank multiphase simulation rockewan FLUENT 0 April 6, 2010 13:34


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