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

Pressure&Temperature dependent viscosity UDF - error in calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By andrew-c
  • 1 Post By JINXING

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2023, 02:23
Default Pressure&Temperature dependent viscosity UDF - error in calculation
  #1
New Member
 
Join Date: Jan 2023
Posts: 4
Rep Power: 3
JINXING is on a distinguished road
Hello,

I am trying to write a UDF for Fluent to define the working fluid viscosity through the pressure and temperature inside control valve.
Using pressure inlet(40bar) and pressure outlet(0) steady simulation method. Before applying UDF, I used constant viscosity to check the model and determined the pressure range inside the simulation domain(-1.4bar, 40bar).
The UDF can be successfully compiled and loaded. After starting calculation, I got error messages.
I tried to set temperature as constant or pressure as constant to check the reliability of UDF. The simulation worked well when the UDF pressure condition was set as constant(real P = 40.). But the same error appeared when the UDF temperature condition was set as constant(real T = 72.).
I also tried to use constant viscosity to get a converged result and then apply UDF, but the same error appeared.
Here is my UDF and error messages:
UDF.PNG
1.PNG
2.PNG
3.PNG
4.PNG
Any help is greatly appreciated.

Thank you!
JINXING is offline   Reply With Quote

Old   January 11, 2023, 04:11
Default
  #2
New Member
 
Join Date: Jan 2023
Posts: 4
Rep Power: 3
JINXING is on a distinguished road
Realizable k-e turbulence model, SIMPLEC method
JINXING is offline   Reply With Quote

Old   January 11, 2023, 10:18
Default
  #3
New Member
 
Andrew
Join Date: Dec 2022
Posts: 29
Rep Power: 3
andrew-c is on a distinguished road
Have you validated the values of viscosity that are coming out of your UDF to ensure they are reasonable? You can add a line in your UDF to print the mu when the UDF runs.

It may also be the distinction between gauge and absolute pressure. I'm pretty sure C_P gives you gauge pressure values, whereas i'm guessing your equation for viscosity is based on absolute pressures. You can add your operating pressure to C_P to make it the absolute pressure, this may fix it.

I think there's a command for obtaining the operating pressure during the run too; something like "get_real("operating-pressure") or something similar. You can also just use the value of your operating pressure if you don't plan on changing it frequently.
JINXING likes this.
andrew-c is offline   Reply With Quote

Old   January 11, 2023, 12:30
Default
  #4
Senior Member
 
Lorenzo Galieti
Join Date: Mar 2018
Posts: 375
Rep Power: 12
LoGaL is on a distinguished road
Most probably you are using gauge pressures and not absolute ones like andrew-c is saying.

For which fluid do you need to implement this model ?
LoGaL is offline   Reply With Quote

Old   January 12, 2023, 05:16
Default
  #5
New Member
 
Join Date: Jan 2023
Posts: 4
Rep Power: 3
JINXING is on a distinguished road
Thank you andrew-c for your reply.

Printing the mu valve is a good method to monitor the equation's reliability.
I solved the error by changing the unit to SI format. I found the UDF can only use the SI unit even though I changed the unit format(pa->bar, K->℃) in Fluent.

Thank you very much for your suggestion.
andrew-c likes this.
JINXING is offline   Reply With Quote

Old   January 12, 2023, 05:24
Default
  #6
New Member
 
Join Date: Jan 2023
Posts: 4
Rep Power: 3
JINXING is on a distinguished road
Quote:
Originally Posted by LoGaL View Post
Most probably you are using gauge pressures and not absolute ones like andrew-c is saying.

For which fluid do you need to implement this model ?
Thank you LoGaL for your reply.

I solved the error by changing the unit to SI format used in the equation.
I am studying the fuel(IFO380) flow characteristics inside the control valve of different opening degrees.

Thank you very much for your suggestion.
JINXING 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
Temperature and Strain Rate Dependent Viscosity UDF Code SANDIPSINH JODDHA Fluent UDF and Scheme Programming 2 April 5, 2022 12:48
viscosity udf don't use correct temperature and strain rate rezvani Fluent UDF and Scheme Programming 8 May 27, 2021 06:40
Time dependent angular velocity calculation UDF shashankmechguy Fluent UDF and Scheme Programming 1 July 26, 2018 03:23
Help with unsteady calculation with source/sink UDF RobV Fluent UDF and Scheme Programming 3 March 10, 2016 04:45
Temperature dependent Non-Newtonian viscosity UDF cric92 Fluent UDF and Scheme Programming 0 April 14, 2013 07:31


All times are GMT -4. The time now is 07:27.