-
-
March 11, 2019 at 9:57 am
Max4
SubscriberHi,
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
-
March 11, 2019 at 11:30 am
Rob
Forum ModeratorWith 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.
-
March 11, 2019 at 11:50 am
Max4
SubscriberHi,
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?
-
March 11, 2019 at 12:57 pm
DrAmine
Ansys EmployeeCompressible 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.
-
March 11, 2019 at 2:12 pm
Max4
SubscriberHi,
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.
-
March 11, 2019 at 2:44 pm
DrAmine
Ansys EmployeeYou can use it: We just highlighted the issues. For liquid the issues are not as relevant as for gases.
-
March 11, 2019 at 2:56 pm
Max4
SubscriberOk thanks, but i have to write both UDF, i.e. for the density and speed of sound too?
-
March 11, 2019 at 3:28 pm
DrAmine
Ansys EmployeeYes.
-
- The topic ‘Compressible Liquid – Density’ is closed to new replies.
-
6450
-
1906
-
1457
-
1308
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.





