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

problem of udf with material property

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2014, 08:53
Default problem of udf with material property
  #1
New Member
 
ganhai
Join Date: Feb 2014
Posts: 14
Rep Power: 12
france is on a distinguished road
hello everyone,Recently I come up with some problems in my master project.I write a udf for my simulation model.The udf main use to define density and viscosity.At the same time,I run the model in parallel way.When I set well all the parameters and initialization,the fluent software will automatic close. And sometimes it can successfully initialization ,but run to the first step the fluent software close.The error information almost can't see.So I don't know what the problem with my project.I guess that it must be the property udf have some problems.
Here I paste my udf .Hope someone can help me. Thanks very much in advance.
#include "udf.h"
#define BMODULUS 1.1e9
#define rho_ref 870.0
#define p_ref 101325.0
DEFINE_PROPERTY(superfluid_density,c,t)
{
#if !RP_HOST
real rho;
real p, dp;
real p_operating;
p_operating = RP_Get_Real("operating-pressure");
p = C_P(c,t)+p_operating;
dp = p-p_ref;
rho = rho_ref/(1.0-dp/BMODULUS);
return rho;
#endif
}
DEFINE_PROPERTY(sound_speed,c,t)
{
#if !RP_HOST
real a;
real p,dp,p_operating;
p_operating = RP_Get_Real ("operating-pressure");
p = C_P(c,t)+p_operating;
dp = p-p_ref;
a = sqrt((BMODULUS-dp)/rho_ref);
return a;
#endif
}

#define f1 5.1e-9
#define f2 2.3e-8
#define f3 -1.16
DEFINE_PROPERTY(viscosity,c,t)
{
#if !RP_HOST
real tt,p,kv,p_operating;
p_operating = RP_Get_Real ("operating-pressure");
tt=C_T(c,t);
p=C_P(c,t)+p_operating;
kv=0.0457*exp(6.58*pow(1+f1*p,f2)*pow((tt-138)/265,f3)-1);
return kv;
#endif
}
france is offline   Reply With Quote

Old   April 4, 2014, 07:51
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
I think that your problem is that you use the function "pow" but you don't include "math.h"

If still don't work:

żDo other UDF work in you computer?

In that case, I would change your formulation of "operating-pressure", I guess it comes from a scheme code and maybe that is what is not working.

Yot can try something like:

#define p_operating RP_Get_Real("operating-pressure")

at the begining of the code instead.

Cheers
upeksa is offline   Reply With Quote

Old   May 27, 2014, 09:08
Smile have your problems been solved?
  #3
New Member
 
Join Date: Jul 2012
Posts: 25
Rep Power: 14
yuanmengyuan1989 is on a distinguished road
my UDF are similar with yours. but i met the Initialization error.

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: ()
do you know the reason ?
yuanmengyuan1989 is offline   Reply With Quote

Reply

Tags
udf density viscosity


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
Mesh UDF problem kornetka Fluent UDF and Scheme Programming 4 July 25, 2013 07:54
a problem of property UDF!I need help hw0076 Fluent UDF and Scheme Programming 2 August 29, 2012 23:28
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
UDF using problem, error happens-heip!! Michael FLUENT 1 December 9, 2008 08:51
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 11:22


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