CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Problem with using UDF to modify viscosity

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 3, 2013, 10:15
Default Problem with using UDF to modify viscosity
  #1
New Member
 
teethfish
Join Date: Jul 2012
Posts: 6
Rep Power: 2
teethfish is on a distinguished road
Hi, I want to modify the viscosity in K-W SST model in Fluent 13.0. But I met a problem that my UDF cannot initiate and it shows that:
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: #f

I have tried initialise without using "compute from" ....but the error was still there, I pasted my UDF here, if anone can help me with that?

#include "udf.h"

DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real mu_t;
real a;
real rho;
real k;
real d;

a=(C_R(c,t)-0.5542)/997.6458;
rho = 0.5542+a*a*997.6458;

k = C_K(c,t);
d = C_D(c,t);
mu_t = M_keCmu*rho*k*k/d;
return mu_t;
}
teethfish is offline   Reply With Quote

Old   February 4, 2013, 08:03
Default Specific dissipation rate C_O(c,t)
  #2
akm
New Member
 
Join Date: Jan 2010
Location: United Kingdom
Posts: 26
Rep Power: 5
akm is on a distinguished road
If you are working with k-w turbulence model, the dissipation rate C_D(c,t) will not be available in the UDFs as it is not calculated by the solver. Instead, specific dissipation rate is calculated C_O(c,t).

For the purpose of your udf calculation, you can covert \omega to \epsilon as under:
http://www.cfd-online.com/Wiki/Speci...ssipation_rate
akm is offline   Reply With Quote

Old   February 4, 2013, 09:47
Default
  #3
New Member
 
teethfish
Join Date: Jul 2012
Posts: 6
Rep Power: 2
teethfish is on a distinguished road
Wow, thank you for your help, you really helped me a lot!
And I have one more question, when i use this UDF:

DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real mu_t;
real a;
real rho;
real k;
real d;

a=(C_R(c,t)-0.5542)/997.6458;
rho = 0.5542+a*a*997.6458;

k = C_K(c,t);
d = C_D(c,t);
mu_t = M_keCmu*rho*k*k/d;
return mu_t;
}

with realizable k-epsilon model, the results diverged, but it worked well with the RNG-kepsilon model, are they actually different?


Quote:
Originally Posted by akm View Post
If you are working with k-w turbulence model, the dissipation rate C_D(c,t) will not be available in the UDFs as it is not calculated by the solver. Instead, specific dissipation rate is calculated C_O(c,t).

For the purpose of your udf calculation, you can covert \omega to \epsilon as under:
http://www.cfd-online.com/Wiki/Speci...ssipation_rate
teethfish is offline   Reply With Quote

Old   May 1, 2013, 09:20
Default
  #4
Member
 
Sheng
Join Date: Jun 2011
Posts: 30
Rep Power: 3
micro11sl is on a distinguished road
Hi teethfish,
Did you get your problem sorted?
I have some problems using the modified turbulent viscosity problem as well. I guess, although you hook a same udf to different turbulence models, there're something different more than the udf. The boundary condition, wall treatment, may be different. So a possible circumstance is the solution behavior is different between two distinct turbulence model with an identical udf.

I am still investigating this.

Sheng
micro11sl is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem UDF for Turbulen viscosity fevi84 Fluent UDF and Scheme Programming 0 October 26, 2012 15:40
Problem with divergence TDK FLUENT 10 September 8, 2012 01:11
Help !! UDF for second phase viscosity. yong FLUENT 2 January 24, 2007 11:11
parallel UDF problem kerem FLUENT 2 June 20, 2006 06:56
Help - UDF for solid shear viscosity nbh2801 FLUENT 0 April 21, 2006 07:49


All times are GMT -4. The time now is 21:38.