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

Multi-UDFs Initialisation error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2011, 21:47
Default Multi-UDFs Initialisation error
  #1
New Member
 
ZHAOHUI
Join Date: Jan 2011
Location: QLD
Posts: 9
Rep Power: 15
Zhaohui Lu is on a distinguished road
Please have a look at my problem.Just so confused on this.hope someone could help me to figure it out. thanks in advance!

the UDFs is posted below:
#include <udf.h>
#define BMODULUS 2.2e9
#define rho_ref 1000.0
#define p_ref 101325
DEFINE_PROPERTY(superfluid_density, c, t)
{
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;
}

DEFINE_PROPERTY(sound_speed, c,t)
{
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 = (1.-dp/BMODULUS)*sqrt(BMODULUS/rho_ref);
return a;
}

DEFINE_PROFILE (unsteady_pressure, thread, position)
{
face_t f;
float a = 0.000470;
begin_f_loop(f, thread)
{
real t = RP_Get_Real("flow-time");
F_PROFILE(f, thread, position) = (1e+12)*t-(2e+15)*t*t-(6e+17)*t*t*t+10;
}
end_f_loop(f, thread)
}

the error displayed as:
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: ()
Zhaohui Lu is offline   Reply With Quote

Old   May 24, 2011, 08:17
Default
  #2
New Member
 
Join Date: Mar 2011
Posts: 10
Rep Power: 15
dmalcher is on a distinguished road
Hi,

as I can see you copied big parts of your UDF out of the FLUENT UDF manual. Note that "RP_Get_Real ("operating-pressure")" is referring to a Scheme variable you have to define within the command line of FLUENT.
Alternatively, define "operating_pressure" as a constant or global variable in your UDF.

The same with "real t = RP_Get_Real("flow-time")". Use the solver macro CURRENT_TIME instead.

I hope that helps.

Regards
d
dmalcher is offline   Reply With Quote

Old   May 24, 2011, 09:01
Default
  #3
New Member
 
Join Date: Mar 2011
Posts: 10
Rep Power: 15
dmalcher is on a distinguished road
so this is what I meant with declaring p_operating as a constant. In my case the reference pressure and the operating operating pressure have the same value, so dp = p, but I left it to make it clear.


#define BMODULUS 2.2e9 /* Pa*/
#define rho_ref 1000.0 /* kg/m³*/
#define p_ref 101325 /*Pa*/
#define p_operating 101325 /*Pa*/

DEFINE_PROPERTY(mod_density,c,t)
{
real rho_water;
real p, dp;

p = C_P(c,t) + p_operating;
dp = p - p_ref;
rho_water = rho_ref/(1.0-dp/BMODULUS);
return rho_water;
}
dmalcher is offline   Reply With Quote

Old   May 25, 2011, 02:47
Default
  #4
New Member
 
ZHAOHUI
Join Date: Jan 2011
Location: QLD
Posts: 9
Rep Power: 15
Zhaohui Lu is on a distinguished road
Quote:
Originally Posted by dmalcher View Post
so this is what I meant with declaring p_operating as a constant. In my case the reference pressure and the operating operating pressure have the same value, so dp = p, but I left it to make it clear.


#define BMODULUS 2.2e9 /* Pa*/
#define rho_ref 1000.0 /* kg/m³*/
#define p_ref 101325 /*Pa*/
#define p_operating 101325 /*Pa*/

DEFINE_PROPERTY(mod_density,c,t)
{
real rho_water;
real p, dp;

p = C_P(c,t) + p_operating;
dp = p - p_ref;
rho_water = rho_ref/(1.0-dp/BMODULUS);
return rho_water;
}
Thanks dmalcher!
Just as you thought, I am really a begainer on Fluent.When face some problem, i usually try to find help from Fluent Doc first.I appreciate your kind help!
In order to conquer this with your assistance, maybe it would be better to show you some details about my case first .what i am simulating is the process of high pressure(transient) water ejecting into air using VoF Multiphase +turbulent model k-epsilon.
I made some modification in my UDF file posted below and the same error happened.hope you help me again on this! thanks a lot!

Regards
truly,
zhao


#include <udf.h>
#define BMODULUS 2.2e9 /* Pa*/
#define rho_ref 1000.0 /* kg/m?*/
#define p_ref 101325 /*Pa*/
#define p_operating 101325 /*Pa*/
DEFINE_PROPERTY(mod_density,c,t)
{
real rho_water;
real p, dp;
p = C_P(c,t) + p_operating;
dp = p - p_ref;
rho_water = rho_ref/(1.0-dp/BMODULUS);
return rho_water;
}
DEFINE_PROPERTY(sound_speed, c,t)
{
real a;
real p, dp;
p = C_P(c,t) + p_operating;
dp = p-p_ref;
a = (1.-dp/BMODULUS)*sqrt(BMODULUS/rho_ref);
return a;
}
DEFINE_PROFILE (unsteady_pressure, thread, position)
{
face_t f;
begin_f_loop(f, thread)
{
real t = CURRENT_TIME;
F_PROFILE(f, thread, position) = (1e12)*t-(2e15)*t*t-(6e17)*t*t*t+10;

}
end_f_loop(f, thread)
}
Zhaohui Lu is offline   Reply With Quote

Old   January 10, 2014, 18:23
Default
  #5
New Member
 
Aileen Magee
Join Date: Sep 2013
Posts: 24
Rep Power: 12
0906536m is on a distinguished road
Hello,
I am having the same problem as you! Did you manage to correct it?
Thankyou
0906536m is offline   Reply With Quote

Reply


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
CGNS Compiling Diego Main CFD Forum 17 December 21, 2014 01:40
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
compile errors of boundary condition "expDirectionMixed" liying02ts OpenFOAM Bugs 2 February 1, 2010 20:11
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


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