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

combustion model modification

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By M_Tidswell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2014, 12:42
Default combustion model modification
  #1
Member
 
Mark
Join Date: Feb 2013
Location: London
Posts: 33
Rep Power: 13
M_Tidswell is on a distinguished road
Dear all

I hope someone can point out what I have done here, I have adapted a UDF provided by ansys to implement a combustion model modification. After attempting to de-bugging it I am left with the error below:

Error: C:\\Users\\Mark\\Documents\\Project post 19-1\\udf stuff\\trialmk2.c: line 32: function "Compute_Trb_Vscal" not found (pc=6).
Error: C:\\Users\\Mark\\Documents\\Project post 19-1\\udf stuff\\trialmk2.c: line 32: function "Calculate_unburnt_rho_and_Xl" not found (pc=97).

Now those two commands are commands from the ansys udf which I have not played with at all so I am lost. The entire code is given below:

/************************************************** *****************
UDF that specifies a custom turbulent flame speed and source
for the premixed combustion model
************************************************** ******************/
#include "udf.h"
#include "sg_pdf.h" /* not included in udf.h so must include here */

DEFINE_TURB_PREMIX_SOURCE(turb_flame_src,c,t,turb_ flame_speed,source)
{
real up = TRB_VEL_SCAL(c,t);
real ut,ul,sct,ka,re_t,dab,L,lf,grad_c,rho_u,Xl,DV[ND_ND];

ul = C_LAM_FLAME_SPEED(c,t);
Calculate_unburnt_rho_and_Xl(t,&rho_u,&Xl);

if(NNULLP(THREAD_STORAGE(t,SV_PREMIXC_G)));
{
NV_V(DV, =, C_STORAGE_R_NV(c,t,SV_PREMIXC_G));
grad_c = sqrt(NV_DOT(DV,DV));
}

sct = 0.498*(C_MU_T(c,t)/C_R(c,t));
dab = C_MU_T(c,t)/sct;
re_t = C_MU_L(c,t)/C_MU_T(c,t);
ka = ((C_MU_T(c,t)/C_R(c,t))*C_D(c,t))/ul;
L = ...;
lf = ...;
ut = .....;
*turb_flame_speed = ut;
*source = rho_u*ut*grad_c;
}

Me and coding are not best friends so I was hoping someone could help me!

Many thanks

Mark

Last edited by M_Tidswell; February 2, 2014 at 08:52.
M_Tidswell is offline   Reply With Quote

Old   February 2, 2014, 07:27
Default Solution
  #2
Member
 
Mark
Join Date: Feb 2013
Location: London
Posts: 33
Rep Power: 13
M_Tidswell is on a distinguished road
Dear All

After banging my head against this for a while I have come up with a solution which appears to side step the issues with compiling UDF's in Fluent within win64 so I thought I would share.

There are a number of threads on here which provide excellent instructions on how to launch Fluent from the x64 visual studios command line whilst this solved a number of the issues Fluent was not entirely happy. You can get around this by copying the contents of the Ansys SRC file into the visual studios include file then following the instructions in the aforementioned threads. I am guessing that windows put some kind of block on one of the proceeding processes as by placing all the header files in here the UDF will compile correctly.

If you get communication error when running the calculation unsurprisingly the name of this error bares no resemblance to the actual issue, I discovered the formatting I had used was incorrect so by correcting this everything worked well.

The working udf has been given below for anyone's interest:

#include "udf.h"
#include "sg_pdf.h" /* not included in udf.h so must include here */
#include "mpi.h"

DEFINE_TURB_PREMIX_SOURCE(MD_adapt,c,t,turb_flame_ speed,source)
{
real up = TRB_VEL_SCAL(c,t);
real lx = TRB_LEN_SCAL(c,t);
real ut,sl0,p,le,Ret, grad_c,rho_u,Xl,DV[ND_ND];

sl0 = C_LAM_FLAME_SPEED(c,t);
p = 1.0;
le=0.2121;
Calculate_unburnt_rho_and_Xl(t,&rho_u,&Xl);

if(NNULLP(THREAD_STORAGE(t,SV_PREMIXC_G)))
{
NV_V(DV, =, C_STORAGE_R_NV(c,t,SV_PREMIXC_G));
grad_c = sqrt(NV_DOT(DV,DV));
}

Ret=.....;

ut = ...........
*turb_flame_speed = ut;
*source = rho_u*ut*grad_c;
}

Please excuse the ut = ... but the formula after that is not mine to distribute, it is just an equation which could be replaced by any equation of your choice.

Hope this is vaguely helpful
Heat80 and SSG_NJ like this.

Last edited by M_Tidswell; February 2, 2014 at 10:49.
M_Tidswell is offline   Reply With Quote

Old   July 3, 2023, 03:42
Default
  #3
New Member
 
Cillian Thomas
Join Date: Jun 2023
Posts: 2
Rep Power: 0
cilliant is on a distinguished road
Hi,

What exactly do you mean when you say you pasted the src file into the header files??

I'm getting the same issue of constantly seeing "Compute_Trb_Tscal" not found or "Calculate_unburnt_rho_and_Xl" not found even after I paste the definition of the turbulent flame source at the bottom of the header files.
cilliant 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
eddy dissipation model: combustion doesn't occur roukaia FLUENT 2 November 18, 2020 10:23
Liquid rocket engine non-premixed combustion model Erik FLUENT 2 November 28, 2013 14:09
eddy dissipation model: combustion doesn't occur roukaia FLUENT 0 December 24, 2011 09:10
Combustion Model for CAI/HCCI - AVL FIRE Patryk Main CFD Forum 0 July 24, 2009 16:43
combustion model Hennie van der Westhuizen Siemens 7 February 27, 2002 02:10


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