|
[Sponsors] |
February 3, 2013, 11:15 |
Problem with using UDF to modify viscosity
|
#1 |
New Member
teethfish
Join Date: Jul 2012
Posts: 7
Rep Power: 14 |
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; } |
|
February 4, 2013, 09:03 |
Specific dissipation rate C_O(c,t)
|
#2 |
New Member
Join Date: Jan 2010
Location: Netherlands
Posts: 28
Rep Power: 16 |
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 |
|
February 4, 2013, 10:47 |
|
#3 | |
New Member
teethfish
Join Date: Jul 2012
Posts: 7
Rep Power: 14 |
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:
|
||
May 1, 2013, 10:20 |
|
#4 |
Member
Sheng
Join Date: Jun 2011
Posts: 62
Rep Power: 15 |
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 |
|
May 17, 2013, 08:33 |
Error occurs in UDF for DPM viscosity
|
#5 |
New Member
Barbara
Join Date: May 2013
Posts: 4
Rep Power: 13 |
Hello to you all,
I hope I post this in the right place, I did not found a more appropriate one...for an atomizer jet I have to write an UDF to express non- newtonian behaviour for the liquid phase. It is not possible to choose any non- newtonian models like cross or carreau or power- law for the DPM- material so I have to write this UDF. I want to realize the model of CROSS with this UDF. I compiled this UDF and everything works fine but after exactly 9 iteration steps the same error as descriped above ocurrs: Error: Ansys 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 contributor. Error: Object f# The code I use for realizing the UDF (and that causes this error) is: ------------------------------------------------------------------ #include "udf.h" #include "dpm.h" DEFINE_DPM_PROPERTY(cell_viscosity_CROSS_m2, c, t, p) { real mu_INF,mu_0,k,mu_CROSS,m; double aux,SR; SR=C_STRAIN_RATE_MAG(c,t); k=0.01372; m=0.7857; mu_0=1.885; mu_INF=0.05320; mu_CROSS=DPM_MU(p); aux=pow(SR,m); mu_CROSS=mu_INF+(mu_0-mu_INF)/(1+k*aux); return mu_CROSS; } I treid it out in steady, in transient, I changed the URF, I just interpreted it I compiled it, but nothing helps...I guess there is some error in the code that I do not see....actually my programming skills are quite bad and I do not have any experience at all with UDF. I would really appreciate if someone could help me or has some advice for me. Greetings and thank you, have a nice weekend! |
|
May 17, 2013, 09:07 |
|
#6 | |
Senior Member
|
Check one of the pointers before actually access them. Try add the highlighted line to see whether it helps.
Quote:
|
||
May 17, 2013, 09:29 |
|
#7 |
New Member
Barbara
Join Date: May 2013
Posts: 4
Rep Power: 13 |
Hello Blackmask,
Thank you for your quick response and your advice. I tried it out but it did not work, the same error occurs at the same iteration step. Maybe there is something wrong with the usage of the macro DPM_MU(p)? I tried to vary the posibilietes to include this (still I am not sure if I need it) but nothing changes...:-( |
|
May 17, 2013, 14:28 |
|
#9 |
New Member
Barbara
Join Date: May 2013
Posts: 4
Rep Power: 13 |
No, not at all...it neither brings any messages of divergences. The residuals are normal and tend to fall than to rise.
|
|
May 20, 2013, 05:16 |
|
#10 | |
New Member
Barbara
Join Date: May 2013
Posts: 4
Rep Power: 13 |
Quote:
Has anyone any ideas? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with divergence | TDK | FLUENT | 13 | December 14, 2018 07:00 |
Problem UDF for Turbulen viscosity | fevi84 | Fluent UDF and Scheme Programming | 2 | June 25, 2017 19:25 |
Help !! UDF for second phase viscosity. | yong | FLUENT | 2 | January 24, 2007 12:11 |
parallel UDF problem | kerem | FLUENT | 2 | June 20, 2006 07:56 |
Help - UDF for solid shear viscosity | nbh2801 | FLUENT | 0 | April 21, 2006 08:49 |