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

problem when I interpret my UDF for granular viscosity

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2015, 13:00
Post problem when I interpret my UDF for granular viscosity
  #1
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
Hello,

I'm doing my degree’s final project and I need to create an UDF for granular viscosity in Eulerian model.

I have two UDF's for granular viscosity, but both have the same problem when I interpret it.

The UDFs are these:

1)
#include "udf.h"

DEFINE_PROPERTY(Shear_Vis_Lun_modified,cell,thread )

{
real shear_vis_lun;
real strain_rate;
strain_rate= C_STRAIN_RATE_MAG(cell,thread);
shear_vis_lun = 11224*pow(strain_rate, (0.323-1));
return shear_vis_lun;
}

2)
#include "udf.h"

DEFINE_PROPERTY(solid_viscosity,cell, thread)
{
real mu;
real str=C_STRAIN_RATE_MAG(cell,thread);
mu=11224*pow(str,(0.323-1));
return mu;
}

The mistake that appears in fluent is the following:

cpp - I"/ansys_inc/v140/fluent/fluent14.0.0/src" - I"/ansys_inc/v140/fluent/fluent14.0.0/cortex/src" - I"/ansys_inc/v140/fluent/fluent14.0.0/client/src" - I"/ansys_inc/v140/fluent/fluent14.0.0/multiport/src" - I. DUDFCONFIG_H="<udfconfig.h>" "/home/jfernandez/Proyecto jfernandez/malla1/caso 1/solid viscosity.c"

Error: /home/jfernandez/Proyecto jfernandez/malla1/caso 1/solid viscosity.c: line2: syntax error.


I have to compile these UDFs but encountered other problems also.

I don`t know what would be better, to compile or to interpret.

If it would be better to compile; I would be able to show my problem as I do so.


It is very important for my project; I would really appreciate any help I can get.


Thank you beforehand.
spanish is offline   Reply With Quote

Old   May 8, 2015, 05:44
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Are you able to interpret or compile other udfs? The ones from the manual for example?
pakk is offline   Reply With Quote

Old   May 8, 2015, 12:37
Default
  #3
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
Hello

I have to get to compile my UDFs mysteriously. I don't know how I did it, lol

But I have a new problem now. UDFs are so difficult

Thank you for your help


[ Moderator note: text below came from post that was in this thread: http://www.cfd-online.com/Forums/flu...ure-model.html ]

Hello

I need to create an UDF for granular viscosity. I have to try with differents UDFs but I always have some problem.

Do you get to creat an UDF for granular viscosity?

I would really appreciate any help I can get

Thank you beforehand

Last edited by wyldckat; May 8, 2015 at 15:22. Reason: moved and merged posts on the same question
spanish is offline   Reply With Quote

Old   May 11, 2015, 07:27
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
If you need help, you should ask a specific question. Right now it is not clear how anybody can help you.
pakk is offline   Reply With Quote

Old   May 11, 2015, 10:28
Default
  #5
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
Hello

I'm going to try to explain better my case.

I have created two UDF's for granular viscosity. Both UDF's are up.

Firstly, I don't know if this UDF's are correct for granular viscosity in Eulerian model.

When I compile some of this UDF, I obtain the following:

[IMG]file:///C:\Users\javier\AppData\Local\Temp\msohtmlclip1\01 \clip_image002.jpg[/IMG]


And then, I build without problem.

spanish is offline   Reply With Quote

Old   May 11, 2015, 10:29
Default
  #6
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
Then, I change settings,


Finally, when I start the calculation, It appear this message:

# Divergence detected in AMG solver :mp-x-momentum -> decreasing coarsening group size!
# Divergence detected in AMG solver :mp-x-momentum -> Increasing relaxation sweeps!
# Divergence detected in AMG solver : presure correction -> turning off correction scaling!
# Divergence detected in AMG solver : pressure correction -> Increasing relaxation sweeps!

Error: DIvergence detected in amg solver: pressure correction
Error Object: #f

I don't know how can I solve these problems.

I would appreciate your help

Thank you
spanish is offline   Reply With Quote

Old   May 18, 2015, 12:00
Default
  #7
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
Hello again,

I think that I found the mistake. I changed the udf, fixing granular viscosity for check the udf, and the result was perfect

#include "udf.h"

DEFINE_PROPERTY(Shear_Vis_Lun_modified,cell,thread )

{
real shear_vis_lun;
shear_vis_lun = 850;
return shear_vis_lun;
}

Also, I created a UDF for viscosity on primary phase, using C_STRAIN_RATE_MAG(c,t) and the result was wrong. The error was the same (DIVERGENCE DETECTED....)
#include "udf.h"

DEFINE_PROPERTY(viscosity,c,t)
{
real visco;
visco = 380.18*pow(C_STRAIN_RATE_MAG(C,t),0.547-1.);
return visco;
}
I think the mistake is in strain rate function, but I don´t know how I can change this problem.

thanks in your advance.
best regards
spanish is offline   Reply With Quote

Old   June 11, 2015, 10:40
Default
  #8
New Member
 
javier
Join Date: May 2015
Posts: 6
Rep Power: 10
spanish is on a distinguished road
I solved my problem initialazing with a previous solution. Thank you for your help
spanish is offline   Reply With Quote

Reply

Tags
compile error, granular viscosity, interpreted udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
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 2 June 25, 2017 18:25
compile a udf or interpret it? ndabir Fluent UDF and Scheme Programming 1 July 14, 2012 02:49
UDF interpret in Fluent wanghaojie Fluent UDF and Scheme Programming 1 February 3, 2012 14:51
UDF using problem, error happens-heip!! Michael FLUENT 1 December 9, 2008 07:51
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 10:22


All times are GMT -4. The time now is 16:03.