|
[Sponsors] |
May 9, 2018, 04:32 |
Problem programming UDF
|
#1 |
New Member
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 8 |
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. |
|
May 11, 2018, 15:36 |
|
#2 |
Member
mohamed
Join Date: Apr 2016
Posts: 34
Rep Power: 10 |
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 )
|
|
May 12, 2018, 14:47 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Hint: what happens if the strain rate is zero?
|
|
May 16, 2018, 12:38 |
|
#4 |
New Member
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 8 |
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
|
|
May 16, 2018, 12:41 |
|
#5 |
New Member
Víctor Rueda García
Join Date: May 2018
Posts: 6
Rep Power: 8 |
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. |
|
May 17, 2018, 03:02 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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. |
|
|
|
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 07:05 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Vaporization pressure UDF property problem? | lehoanganh07 | Fluent UDF and Scheme Programming | 1 | September 13, 2014 11:59 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 07:56 |
problem with udf programming in fluent | saranyasimi | Main CFD Forum | 0 | December 1, 2009 13:19 |