CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to make the water slightly compressible in CFX? (https://www.cfd-online.com/Forums/cfx/90169-how-make-water-slightly-compressible-cfx.html)

womo July 3, 2011 05:05

How to make the water slightly compressible in CFX?
 
Dear all,

I am doing a simulation of flow in porous media and came into a problem. Someone suggest me to make the water slightly compressible. I worked on it for several days but still can not make it. Could anyone help me on it? What settings I need to do to make the water slightly compressible in CFX? Many thanks for your help.

Regards
John

ghorrocks July 3, 2011 08:00

Why do you think slightly compressible water will help? Is it likely that the density change is going to be significant? If not then I guarantee it will not help. Your problem is just obtaining convergence.

But compressible water is easy. Get the bulk modulus from google or somewhere, and define density as a function of pressure. I have done it many times and it works fine. And this is not a simplification, you are actually adding more physics to your model so your model will get more accurate - if compressibility is important.

womo July 3, 2011 10:51

Dear ghorrocks,

Thank you so much for your reply. I set the "Heat Transfer" of fluid model to "Total Energy" and defined the water density as "( 997 / (1 - (Absolute Pressure - 101325 [Pa] ) / 2.04e9 [Pa] )) [kg m^-3]". Moreover, a minimum absolute pressure of 1000Pa and a maximum one of 1e6 Pa are set in "Table Generation". However, the model can not work at all. No information is given, even no error code. Could you please help me to figure out the problem in compressibilty setting or is there any other experience of it? Thank you for your kind help.

Regards
John

ghorrocks July 3, 2011 20:03

Do not use Total energy, just the default isothermal is fine.

Please post your out file to help us diagnose the problem.

But as I said previously, if you are doing this because you have convergence problems this will not help. It is more likely to make it worse.

womo July 3, 2011 23:22

Hi ghorrocks,

I turn the total energy to isothermal as your suggestion, but a new problem comes out as bellow:

+--------------------------------------------------------------------+
| ****** Notice ****** |
| While evaluating Static Enthalpy, |
| Absolute Pressure |
| went outside of its lower limit. Its minimum value was |
| -4.3028E+10. The bounds error was handled by clipping. |
| If this situation persists, consider increasing the table range. |
+--------------------------------------------------------------------+

+--------------------------------------------------------------------+
| ERROR #001100279 has occurred in subroutine ErrAction. |
| Message: |
| Stopped in routine ENFORCE_BOUNDS |
| |
| |
| |
| |
| |
+--------------------------------------------------------------------+

I am doing a model of water flowing over a porous medium, with mesh deformation in the water domain. The model can run without mesh deformation in water domain, but can not work with the mesh deformation. Others have suggested to make the water slightly compressible to solve the problem.

ghorrocks July 4, 2011 07:26

Like I have said, adding compressibility will make convergence worse, not better.

If you have convergence problems forget about compressibility and deal with the convergence problem. Do you intend to run this model incompressible? If you run it incompressible what happens?

womo July 4, 2011 09:29

I have run the incompressible model. It can run without mesh deformation of water domain, but can not work with mesh deformation. That's why I would like to try the compressible model. How can I make the porous domain work together with the moving mesh water domain?

stumpy July 4, 2011 10:08

Please describe more details of the case. Total Energy with compressible water is the correct approach to resolve acoustic waves in water (e.g. water hammer), but it's not clear that this is what you want to do. If your timescale is small enough to resolve acoustic waves generated by a moving boundary then this might be a valid approach.

benkematya March 11, 2016 11:33

Quote:

Originally Posted by womo (Post 314525)
Dear ghorrocks,

Thank you so much for your reply. I set the "Heat Transfer" of fluid model to "Total Energy" and defined the water density as "( 997 / (1 - (Absolute Pressure - 101325 [Pa] ) / 2.04e9 [Pa] )) [kg m^-3]". Moreover, a minimum absolute pressure of 1000Pa and a maximum one of 1e6 Pa are set in "Table Generation". However, the model can not work at all. No information is given, even no error code. Could you please help me to figure out the problem in compressibilty setting or is there any other experience of it? Thank you for your kind help.

Regards
John


Folks, the equation is similar to the linearised Tait equation, only the CFX implementation is buggy.

The correct formula would be:

997[kg/m3] * ((Abs.Press - 101325 [Pa]) / 2.04e9 + 1.0)

TUD_FT February 10, 2020 05:12

3 Attachment(s)
Hi,

i also simulate compressible water flows and using a linearised Tait equatuion such as previously recommended. Moreover, I set the heat transfer option to isothermal.

Now i have some problems with the calculation of density. As you can see in the pictures the density calculation looks like a stairway. Because of this i get jumps in the determination of the local speed of sound. This is physically not valid.

I want to have a smooth function for the density and the local speed of sound.Preferably, the local speed of sound becomes constant by 1484m/s. Becauce of the isothermal heat transfer the local speed of sound shouldn’t change with the tempreature (the tempreature is constant, as i can see in the solver manager or in cfx-post). Furthermore, the pressure based change oft the density shouldn’t influence the local speed of sound, because the relationship between pressure and density is linear. It applies: dp/droh = a^2 --> a = konst. for my assumptions

What do I wrong? How can I get smooth functions for density and local speed of sound? I also vary my cell size and makes sure, that CFL is less than 1, but it didn’t help. I suspect that i have to change some settings in the solver control, but im not sure.


Greetings!

ghorrocks February 10, 2020 17:34

You variations in density are small. You chart does not resolve the variation you are seeing, it just shows 998.3 for everything, so the variation you are getting is much smaller than that.

I suspect the problem is related to resolution in density. Here are some ideas of where that might come from:
* Check the material properties table generation. You might need to change the defaults to give you more resolution in your material properties around the conditions of interest to you.
* Check your reference temperatures and pressures, especially your buoyancy reference pressure (if you have one). Make sure they are set correctly.
* Use double precision numerics.

TUD_FT February 11, 2020 06:31

Thank you for your answer!

Yesterday i tried some new settings and i used double precision, which works really well. Furthermore, i changed the material model from a linearised Tait equatuion to the IAPWS libary. From my point of view, this libary is really useful and a nice way to represent the compressibity of water. With this settings, the simulation works very well. I use it to simulate the sound propagation in water.

My reference states are all set correctly, i have checked it.

Table generation is an aspect that i can propably improve. I set the maximum and minimum values for temperature and pressure to suitable values. Moreover, i increase the number of points to 500. I hope this is enough to add more resolution to my material properties.

One more (and hopefully last) question: How can i add more digits after the decimal point in the monitors of the CFX Solver Manager? I want to take a closer look at the change of density.

ghorrocks February 11, 2020 17:32

Not sure if you can add more precision to Solver Manager. All I can suggest is to look at the available options and see if you can find it.

If you need more accuracy then you probably should extract your data straight out of the results file rather than using solver manager. Have a look at the command line tool CFX5mondata.

Gert-Jan February 12, 2020 04:25

I had exactly the some problem with temperatures where I added small amounts of energy to my fluid. I noticed that it is impossible to add more precision to the graphs in the solver manager. It is possible to perform a calculation in double precision. But the solver manager stays in single precision. It is simply not able to create plots in double precision.

There are 2 options:
- the easiest way is to remove digits. You can create a "density difference" variable equal to Density-998.7 [kg/m3] and monitor this variable in the solver manager. This removes at least 4 irrelevant digits. Btw, the same applies for CFD-Post. This is also in single precision!!!! Plotting density in a chart will give discontinuous lines, whereas you have a higher chance for continuous lines when plotting this density difference.
- you can perfrom a run with the solver argument "-save". The result is that at the end of the run, the temporary .dir-folder is kept, in which you find a file named "mon". This text file contains the monitoring data. If you run in double precision, the data in this file is in double precision. Open it in a spread sheet and create your own graphs.

Good luck, Gert-Jan

ghorrocks February 12, 2020 07:20

Hi Gert-Jan: The "cfx5mondata" command does your second recommendation, and it is arguably a bit more elegant. But beauty is in the eye of the beholder, and if it works for you then it is all good.


All times are GMT -4. The time now is 03:43.