|
[Sponsors] |
Pressure&Temperature dependent viscosity UDF - error in calculation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 11, 2023, 02:23 |
Pressure&Temperature dependent viscosity UDF - error in calculation
|
#1 |
New Member
Join Date: Jan 2023
Posts: 4
Rep Power: 3 |
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! |
|
January 11, 2023, 04:11 |
|
#2 |
New Member
Join Date: Jan 2023
Posts: 4
Rep Power: 3 |
Realizable k-e turbulence model, SIMPLEC method
|
|
January 11, 2023, 10:18 |
|
#3 |
New Member
Andrew
Join Date: Dec 2022
Posts: 29
Rep Power: 3 |
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. |
|
January 11, 2023, 12:30 |
|
#4 |
Senior Member
Lorenzo Galieti
Join Date: Mar 2018
Posts: 375
Rep Power: 12 |
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 ? |
|
January 12, 2023, 05:16 |
|
#5 |
New Member
Join Date: Jan 2023
Posts: 4
Rep Power: 3 |
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. |
|
January 12, 2023, 05:24 |
|
#6 | |
New Member
Join Date: Jan 2023
Posts: 4
Rep Power: 3 |
Quote:
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. |
||
|
|
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 |