CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Unknown solver source removing fluid in steady state model

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2024, 09:01
Default Unknown solver source removing fluid in steady state model
  #1
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
So normally when one performs a steady state model for buoyant flow in a closed cavity, the solver adds or removes fluid mass to achieve the steady state solution at the reference pressure. I understand why this is done, and it makes sense.

I have a model with an inlet and three outlets, and the solver seems to be doing the same thing. Pressure stays at the reference pressure, and nothing goes out the outlets. I don't accumulate any additional fluid mass even though I am continuously adding fluid at the inlet. volumeInt(Density)@Domain is constant with slight fluctuations up and down depending on temperature.

Is there a way to turn off this steady state solver source term which is removing fluid?

I'm using:
Ideal Gas, Total Energy. (Tried buoyancy both on and off)
Mass Flow Inlet
Mass Flow Outlets: using a function that references local pressure and temperature at those outlets. Starts opening @ 0.3psi, but the model never rises in pressure to reach opening pressure.

I tried adding a constant small flow at each outlet to coax the solver into knowing there is flow in and out, and stop the source, but nothing seems to be working.
I'm thinking i may need to specify a pressure boundary somewhere?
evcelica is offline   Reply With Quote

Old   March 26, 2024, 09:42
Default
  #2
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
Searching help, I found "Pressure Level Information" and "compressible transient option" may be useful. They are in Solver Control>>Advanced Options. I'll try messing with those and setting the transient option to "None" instead of "shift pressure" I have no idea what the default is as it wasn't checked to begin with.
If that doesn't work, I may have to include a pressure boundary somewhere, but since this pressure depends on other variables, I'll have to get creative.
Any other input would be appreciated, I'll report back if anything works.

UPDATE 1: Nope, compressible transient did nothing, it is for transient simulations I believe.
Looks like I may need to throw a pressure boundary in there somewhere, what a pain....

UPDATE 2: I put in a pressure boundary and this fixed the problem. Though it's a complex function and a bit numerically unstable as it references the other two flow rates and its own local temperature. Pretty inconvenient that the solver can't just run as I set up the problem initially. I wish there was a way to turn off that pressure normalizing it does when there is no pressure boundary set. That should work for compressible flows.

Last edited by evcelica; March 26, 2024 at 14:56.
evcelica is offline   Reply With Quote

Old   March 26, 2024, 16:27
Default
  #3
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
I do not think your initial assumption that there is a deliberate mass loss/gain to obtain convergence is correct. "the solver adds or removes fluid mass to achieve the steady state solution at the reference pressure." - I do not think it does this.

In an ideal gas simulation with a closed cavity then the ideal gas equation links the pressure, temperature and mass. In a perfect solution the mass will not change and the pressure and temperature will then sort themselves out, but in a numerical solution there will be convergence errors and round off errors so the mass is not perfectly conserved. This means the temperature and pressure need to also vary slightly to account for the mass loss or gain from these errors. I do not think it is any more complex than that. I am not aware of any deliberate mass loss or gain as you describe.

So my suggestion if you want to reduce these mass losses is to converge tighter.
Opaque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   March 26, 2024, 19:26
Default
  #4
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
Quote:
Originally Posted by evcelica View Post
Pretty inconvenient that the solver can't just run as I set up the problem initially. I wish there was a way to turn off that pressure normalizing it does when there is no pressure boundary set. That should work for compressible flows.
It is not about convenience, it is about physics.

For a trivial example, say we want to solver Laplacian(phi) = 0 with all boundary conditions of the 2nd kind, i.e. grad(phi).n = Known function all around.

Can you solve that problem w/o ever knowing the level of phi?

Another example, flow in a pipe with both inlet and outlet with static pressure specified. Will it ever converge? For all mesh resolution?

Think about why both examples are not possible to solve neither analytically, nor numerically. Hint: ill conditioned physics.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   March 27, 2024, 13:16
Default
  #5
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,167
Rep Power: 23
evcelica is on a distinguished road
Thank you Glenn and Opaque for your responses.
I am aware you are both more knowledgeable than I, and understand some of what you are saying, but not all. I'll try to explain my understanding a bit more and experience with this model.

Glenn,
I believe the solver was inadvertently removing mass by adjusting pressure to the reference pressure, per the following message:
+--------------------------------------------------------------------+
| Reference Pressure Information |
+--------------------------------------------------------------------+

Domain Group: HeliumDomain

Pressure has not been set at any boundary conditions.
The pressure will be set to 0.00000E+00 at the following location:
Domain : HeliumDomain
Node : 1 (equation 1)
Coordinates : ( 1.01000E+00,-1.82582E-01,-2.39150E-01).

This means my outlets were never able to reach a pressure high enough to start opening and letting flow out. So I could add mass forever, but the solver doesn't increase pressure, meaning it was essentially removing mass by not increasing pressure.
The solution was as converged as it would get, but of course had 100% domain imbalance for P-mass, since I was adding mass, but none was accumulating since pressure was being artificially set by the solver instead of being solved for like I expected.

Opaque:
Sorry, I don't fully understand what you are stating.
I agree specifying mass flow for both IN and OUT would be unsolvable for a compressible flow, as there are infinite solutions depending on absolute pressure. In my case I didn't have a DIRECT pressure specification for a boundary, but my MassFlow OUT specification was a function of local pressure, so I don't see why it couldn't work.
Simple example: If Inlet MassFlow is 5[kg/s] and Outlet MassFlow is f(P) = 1[kg/s/psi] then my OUT pressure would be 5 psi. It is an indirect pressure specification.
This method works just fine when running transient sims in the past. Transient sims don't do this reference pressure adjustment, which again indicates the problem is this Pressure adjustment CFX does with steady state models when no direct pressure boundary is defined.

I don't understand your first "trivial example" at all, but that's just my mathematical ignorance, so skip that for now.
Can you expand further on your second example for the problem with using Static Pressure IN and OUT? While I know using both MassFlow and Pressure are numerically better, I don't see an obvious problem with either incompressible nor compressible flows, except maybe for additional heat transfer/temperature effects on compressible flows which could lead to multiple solutions.

Thank you both again for your responses, I appreciate it very much.
evcelica is offline   Reply With Quote

Old   March 27, 2024, 14:33
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
Quote:
Originally Posted by evcelica View Post

I don't understand your first "trivial example" at all, but that's just my mathematical ignorance, so skip that for now.
Can you expand further on your second example for the problem with using Static Pressure IN and OUT? While I know using both MassFlow and Pressure are numerically better, I don't see an obvious problem with either incompressible nor compressible flows, except maybe for additional heat transfer/temperature effects on compressible flows which could lead to multiple solutions.

Thank you both again for your responses, I appreciate it very much.
Recall we are modeling a process by using equations. Those equations must be subject to VALID boundary conditions that can be satisfied by the equations --> the BC MUST be compatible with the physics and the math.

Steady flow in a pipe:
1 - Draw a full control volume around the pipe and do a force balance
2 - The drawing will include forces due to -> static pressure inlet, static pressure outlet, shear at the wall, and linear momentum at inlet and outlet. If the inlet flow is already fully developed, the inlet-outlet linear momentum contribution is identically 0.

3 - That leaves us with a problem. The value of the predicted total shear force at the wall is prescribed since it should pressure inlet - outlet * area.

So, how can the discrete equation ALWAYS predict the same shear regardless of turbulence model, mesh resolution. The solver will be going around but it will never converge.

Another trivial example, imagine you setup a problem that is equivalent to find the solution of

F(X) = 1 + X^2 = 0

It will never find a solution, but the residual will converge to 1.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   March 27, 2024, 16:45
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
As opaque is saying, I think running this model as a steady state model is not well-posed mathematically.

For instance your valves with a cracking pressure - physically, as the pressure increases they would stay shut until you reach the cracking pressure and then they would open and the pressure would go down and they would close once they are below the cracking pressure (with some hysteresis to stop on/off juddering). This is an inherently transient process which cannot be modelled steady state - at least not without assuming the valve is always shut or always open.

But in steady state I am not sure the solver is set up to correctly converge in an ideal gas with no pressure set anywhere. I assume here you have set an initial condition pressure (you must do that, of course). But the numerics involved in converging on a closed cavity with fix gas mass is very different to a flow through cavity and I do not think CFX operates well that way. And this poor operation shows itself as the pressure level wandering.

And finally, you have a mass flow inlet and you say the valves are always shut which means you have no outlets. This is not a steady state condition as the mass in the chamber is going to rise over time - it is not steady.

The fix is obvious - just run it transient. This is physically more realistic as things like your valves are going to open and close properly over time, your chamber can accumulate mass from the inlet over time but also you can specify an initial condition in your domain and it can be allowed to do what it wants according to the ideal gas equations and flow conditions without the need to specify a pressure at a point.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks 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
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 06:33
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 16, 2020 23:44
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32


All times are GMT -4. The time now is 04:29.