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

Problem programming UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2018, 03:32
Default Problem programming UDF
  #1
New Member
 
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 7
victorueda7 is on a distinguished road
Good morning, I'm trying to program an UDF for viscosity. I have this code:

#include "udf.h"

DEFINE_PROPERTY(custom_viscosity, c, t)
{
double visco;
double gamma=C_STRAIN_RATE_MAG(c,t);
visco=75/gamma+0.042;
return visco;
}

But, starting to run the calculation, Fluent shows the next message:

"Divergence detected in AMG solver: x-momentum"

Does anybody knows which is the problem with the code?

Thank u very much.
victorueda7 is offline   Reply With Quote

Old   May 11, 2018, 14:36
Default
  #2
Member
 
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10
moh_zain is on a distinguished road
Hi if the calculation start and then stop it may be from the mesh quality or solution method you use( focus on mesh quality first )
moh_zain is offline   Reply With Quote

Old   May 12, 2018, 13:47
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Hint: what happens if the strain rate is zero?
pakk is offline   Reply With Quote

Old   May 16, 2018, 11:38
Default
  #4
New Member
 
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 7
victorueda7 is on a distinguished road
Thank u moh_zain, but the problem is that I'm simulating a function that is already in the database as "Herschel Bulkley" model, so, if the simulation works with the default "Herschel Bulkley" function, it should be the same with my UDF
victorueda7 is offline   Reply With Quote

Old   May 16, 2018, 11:41
Default
  #5
New Member
 
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 7
victorueda7 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Hint: what happens if the strain rate is zero?
Thank u pakk, the problem is that this UDF function is supposed to return the same values as the "Herschel Bulkley" default function, that I have already tried with the same configuration (mesh...). So, I guess the problem is I don't know how to use the "Shear rate" variable, could u help me?

Thank u very much again.
victorueda7 is offline   Reply With Quote

Old   May 17, 2018, 02:02
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
No, your problem is in the physics.
The equation that you give is only valid if the strain rate is larger than the strain rate threshold. For low strain rates (and strain rate = 0 is low), a different equation holds.
pakk 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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Vaporization pressure UDF property problem? lehoanganh07 Fluent UDF and Scheme Programming 1 September 13, 2014 10:59
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
problem with udf programming in fluent saranyasimi Main CFD Forum 0 December 1, 2009 12:19


All times are GMT -4. The time now is 14:49.