|
[Sponsors] |
October 23, 2017, 12:55 |
Whats is wrong with my UDF
|
#1 |
New Member
Join Date: Aug 2017
Posts: 1
Rep Power: 0 |
Hi,
I'm trying to model blood flow on a backward facing step (2D) using a shear-dependent viscosity (non-newtonian). When I use a UDF-defined carreau viscosity, I get normal convergence and results. However, when I'm using a UDF-defined viscosity for both the power-law viscosity and Walburn-Schneck model, I getting following messege (before any iterations took place). "Error: Divergence detected in AMG solver: x-momentum Error Object: #f" code for carreau-viscosity: #include "udf.h" #define LAMBDA 3.313 #define N 0.3568 #define MU_ZERO 0.056 #define MU_INF 0.0035 DEFINE_PROPERTY(carr_viscosity,c,t) { real mu; /*I created a variable mu*/ real strain_rate; strain_rate = C_STRAIN_RATE_MAG(c,t); mu = MU_INF+(MU_ZERO-MU_INF)*pow((1+pow((LAMBDA*strain_rate),2)),(N-1)/2); return mu; } Code for power-law: #include "udf.h" #define N 0.6 #define MU_ZERO 0.035 DEFINE_PROPERTY(cell_viscosity,c,t) { real mu; real strain_rate; strain_rate = C_STRAIN_RATE_MAG(c,t); mu = MU_ZERO*pow(strain_rate,N-1); return mu; } code for Walburn-Schneck: #include "udf.h" #define C_1 0.00797 #define C_2 0.0608 #define C_3 0.00499 #define C_4 14.585 #define H 0.40 #define TPMA 25.9 #define E 2.71828182846 DEFINE_PROPERTY(cell_viscosity,c,t) { real mu; real strain_rate; strain_rate = C_STRAIN_RATE_MAG(c,t); mu = C_1*pow(E,C_2*H)*pow(E,C_4*TPMA/pow(H,2))*pow(strain_rate,-C_3*H); return mu; } Could someone tell me what I'm doing wrong? Thanks! |
|
September 3, 2018, 19:43 |
|
#2 |
Member
Liliana de Luca Xavier Augusto
Join Date: Feb 2013
Posts: 69
Rep Power: 13 |
Hi,
try to set the relaxation factor to a lower value on your initialization. It worked for me. |
|
September 5, 2018, 16:58 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Not the problem, but really ugly:
Code:
pow(E,C_2*H) Code:
exp(C_2*H) - Initialize your case with the carreau-viscosity that worked. - Change the viscosity to the power law. Don't run the simulation! - Plot the viscosity, and look which values you get. Are they reasonable? |
|
Tags |
non-newtonian, power-law, udf, walburn-schneck |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
udf for valve closing a pipe using dynamic mesh | chem engineer | Fluent UDF and Scheme Programming | 2 | May 13, 2017 10:39 |
whats wrong with this udf ? | h.mortezaee | Fluent UDF and Scheme Programming | 3 | September 14, 2015 08:32 |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
something wrong when compiling udf, however the code is correct when interpreting | richard ben | Fluent UDF and Scheme Programming | 7 | May 11, 2013 08:36 |
what's wrong with the UDF | major | FLUENT | 6 | March 3, 2005 07:39 |