CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   problem when I interpret my UDF for granular viscosity (https://www.cfd-online.com/Forums/fluent-udf/152690-problem-when-i-interpret-my-udf-granular-viscosity.html)

spanish May 6, 2015 13:00

problem when I interpret my UDF for granular viscosity
 
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.

pakk May 8, 2015 05:44

Are you able to interpret or compile other udfs? The ones from the manual for example?

spanish May 8, 2015 12:37

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:confused:. 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

pakk May 11, 2015 07:27

If you need help, you should ask a specific question. Right now it is not clear how anybody can help you.

spanish May 11, 2015 10:28

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 May 11, 2015 10:29

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 May 18, 2015 12:00

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 June 11, 2015 10:40

I solved my problem initialazing with a previous solution. Thank you for your help


All times are GMT -4. The time now is 12:20.