Compressible Liquid - Density

  • 65 Views
  • Last Post 11 March 2019
  • Topic Is Solved
Max4 posted this 11 March 2019

Hi,

I´m dealing with a simulation considering the compression of the liquid. In Fluent, I can´t set a value of the Bulk Modulus depending on the pressure.

Nevertheless, I can use "User defined" instead of "compressible liquid" in order to consider the density as function of pressure. I have found this (https://www.cfd-online.com/Forums/star-ccm/73840-user-defined-density.html)

Instead of the pressure at inlet, I want to use the pressure inside the domain. Should the following UDF work? 

When I tried to compile this UDF, I have this error:

It is because of this (Exemple 4 - https://www.sharcnet.ca/Software/Fluent6/html/udf/node43.htm), i.e. I have to include a speed of sound function too?

With a such function, are the density set as a different value at each cells depending on the pressure?

 

Regards,

Maxime

 

Order By: Standard | Newest | Votes
rwoolhou posted this 11 March 2019

With that UDF you should be setting density on a cell basis. Just be careful with the macro as using pressure to set density outside the real/ideal gas models can make the solver less stable and mess with the continuity monitors. 

  • Liked by
  • Max4
Max4 posted this 11 March 2019

Hi,

I found this in Fluent Manuel for setting density depending on pressure by using the Tait Equation. In my case, the bulk modulus is depending on pressure too. It is better to define the Bulk Modulus insteat of the density as function of pressure?

The use of the option " compressible liquid " in Materials induce a less stable solver?

abenhadj posted this 11 March 2019

Compressible liquid is liquid which does not really have a strong pressure dependency which is the case for liquid. As my colleague said if you want to really resolve a strong compressible flow (say you want to re-implement the ideal EOS) then you need real gas model UDF.

Best regards,

Amine

  • Liked by
  • Max4
Max4 posted this 11 March 2019

Hi,

Thank you for the answers.

By using "compressible liquid" in Materials, the solver use the Tait Equation which define the density depending on the pressure. So, why can´t I use the above mentioned UDF? And why should I use the UDF for gas to consider a liquid ?

It i´s certain that it will make the solver less stable, but by changing the under relaxation factors, it can improve the stability.

abenhadj posted this 11 March 2019

You can use it: We just highlighted the issues. For liquid the issues are not as relevant as for gases.

Best regards,

Amine

  • Liked by
  • Max4
Max4 posted this 11 March 2019

Ok thanks, but i have to write both UDF, i.e. for the density and speed of sound too?

abenhadj posted this 11 March 2019

Yes.

Best regards,

Amine

  • Liked by
  • Max4
Close