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

i have a problem with my udf when I give it Run Calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2022, 17:50
Default i have a problem with my udf when I give it Run Calculation
  #1
New Member
 
Sergio Andres Correa Zea
Join Date: Feb 2022
Posts: 2
Rep Power: 0
secorreaz is on a distinguished road
Hello good afternoon everyone

When I mount my UDF code there is no problem but when I press the Run Calculation option during the initialization it shows me this error and then it ejects me from Ansys

"999999: mpt_accept: error: accept failed: No error".
The fl process could not be started

Attached is my code

Thank you very much
PHP Code:
#include "udf.h"
#include "sg_mphase.h"
#include "mem.h"
#include "sg_mem.h"
#include "flow.h"
#include "unsteady.h"
#include "metric.h"
#include "math.h"
enum
{
ads,
q_ads,
d_ads
};
/**************************************************/
/* UDF el cual se realizara es el de              */
/* Dubinin Astakov para poder mostrar el fenomeno */
/* de adsorciأ³n                                   */
/**************************************************/
DEFINE_ADJUST(define_ads,domain)
{
#if !RP_HOST
Thread *t;
real E,A,P;
cell_t c;
real tem;

thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
tem C_T(c,t);

P=C_P(c,t)+RP_Get_Real("operating-pressure");

E=3080.0+18.9*tem;

A=8.314*tem*log(1.47e9/P);

C_UDSI(c,t,0) = 71.6*(exp(-((A*A) / (E*E))));

}
end_c_loop(c,t)
}
#endif
}
/******************************************************/
/* El siguiente codigo permitira implementar el LDF          
/*   este presentara 3 cأ³digos distinto el cual albergara
/*   la adsorcion dinamica para cada iteraciأ³n calculada
/*  y almacenada por la ejecuciأ³n de la UDF que esta definida  */
/*  usando DEFINE_ADJUST(q_ads,domain)                         */
/*                                                             */
/***************************************************************/
DEFINE_ADJUST(define_q_ads,domain)
{
#if !RP_HOST
Thread *t;
cell_t c;
real dt;

thread_loop_c(t,domain)
{
begin_c_loop_int(c,t)
{
dt=RP_Get_Real("physical-time-step");
C_UDSI(c,t,0)=C_UDSI_M1(c,t,0)+0.15*dt*(C_UDSI_M1(c,t,1)-C_UDSI_M1(c,t,0));
}
end_c_loop_int(c,t)
}
#endif
}

/*****************************************************************/
/*                                                               */
/*   El siguiente código El término de la fuente de masa de cada */
/*   iteración se calcula y almacena ejecutando la UDF que se    */
/*   define con  DEFINE_ADJUST(d_ads, domain)                    */
/*****************************************************************/ 
DEFINE_ADJUST(define_d_adsdomain)
{
#if !RP_HOST
Thread *t;
cell_t c;

thread_loop_c(tdomain)
{
begin_c_loop_int(c,t)
{
C_UDSI(ct0) = -0.532224*0.15*(C_UDSI(ct1) - C_UDSI(ct0));
}
end_c_loop_int(c,t)
}
#endif
}

DEFINE_SOURCE(m_src,c,t,dS,eqn)
{
dS[eqn]=0.0;

return 
C_UDSI_M1(ct0);

secorreaz is offline   Reply With Quote

Old   April 3, 2022, 23:57
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
what is C_UDSI_M1 macro, how it works?

also you don't need #if !RP_HOST, #endif directives in your code
secorreaz likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
UDF weird problem Sunmax Fluent UDF and Scheme Programming 2 June 26, 2019 22:48
Help with unsteady calculation with source/sink UDF RobV FLUENT 1 November 13, 2016 06:44
Help with unsteady calculation with source/sink UDF RobV Fluent UDF and Scheme Programming 3 March 10, 2016 04:45
UDF hook problem in command line mode. Benlong FLUENT 1 November 12, 2007 15:45
Warning 097- AB Siemens 6 November 15, 2004 05:41


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