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

F_YI(f,t,i) is creating a problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2009, 06:46
Default F_YI(f,t,i) is creating a problem
  #1
New Member
 
itoa
Join Date: May 2009
Posts: 12
Rep Power: 16
techy is on a distinguished road
Hello everybody,

Here is the UDF

#include "udf.h"

DEFINE_ADJUST(mfrac,domain)
{
FILE *fp;
float mfrac;
int i = 0;
int zone_ID = 2;
Thread *thread = Lookup_Thread(domain,zone_ID);
face_t f ;
fp = fopen("check.txt","w+");
begin_f_loop(f, thread)
{
mfrac = F_YI(f,thread,i); /* Here lies the problem */
fprintf(fp,"%d\n",mfrac);
}
end_f_loop(f, thread)
fclose(fp);
}

The zone_ID is for a wall.
I have compiled this successfully but it gives ACCESS VIOLATION.
But when i replace F_YI with F_T there is just no problem at all.
F_YI(f,thread,i) is causing this error.
But i am unable to figure out the mistake.
Any help is highly appreciated


techy
techy is offline   Reply With Quote

Old   May 23, 2009, 07:30
Default
  #2
New Member
 
itoa
Join Date: May 2009
Posts: 12
Rep Power: 16
techy is on a distinguished road
there is a small mistake

fprintf(fp,"%d\n",mfrac);

as mfrac is defined as float
so i am using

fprintf(fp,"%f\n",mfrac);

but F_YI(f,t,i) is still causing that error

Please help somebody

techy
techy is offline   Reply With Quote

Old   May 23, 2009, 09:54
Default
  #3
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 17
Daniel Tanner is on a distinguished road
Not sure what the problem is!
Are you sure F_T is working?
Some quick things to try:
1) Do you need to include "fstream.h"?
2) Should the face_t f; come before the Thread *thread... statement?
3) Remove the file commands (FILE, fp, fprintf, fclose) and see if that helps.
Sorry not sure why it has a problem. Good luck
Daniel Tanner is offline   Reply With Quote

Old   May 24, 2009, 03:10
Default
  #4
New Member
 
itoa
Join Date: May 2009
Posts: 12
Rep Power: 16
techy is on a distinguished road
yes Daniel F_T is working for sure.

I have tried everything you listed without
any effect.

Please help somebody its a bit urgent.

Techy
techy is offline   Reply With Quote

Old   May 24, 2009, 06:00
Default
  #5
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 17
Daniel Tanner is on a distinguished road
I saw the following on a different forum:
http://university.fluent.com/forum/v...e6ba41c1408da3

It gives some useful bits of info:
"The macros C_YI, F_YI cannot be used while using pdf combustion model.

The species mass fractions can be accessed using the macro Pdf_Yi(c,t,i). When using this macro, please include the library sg_pdf.h in your UDF."

Sorry, I have no other ideas!
Daniel Tanner is offline   Reply With Quote

Old   May 24, 2009, 11:23
Default
  #6
New Member
 
itoa
Join Date: May 2009
Posts: 12
Rep Power: 16
techy is on a distinguished road
thanks daniel

but i am only using species transport and nothing
else.
means no benefit from Pdf_Yi

But i am sure this forum is
gonna certainly solve my problem.

Techy
techy is offline   Reply With Quote

Old   September 3, 2009, 08:03
Default
  #7
Member
 
Byron Smith R J
Join Date: Mar 2009
Location: India
Posts: 46
Rep Power: 17
byronsmith is on a distinguished road
Hai,
The problem is that mfrac is not defined as a array whereas F_YI(c,t,i) generates an arrray of mass fractions of species.

Byron SMith
byronsmith is offline   Reply With Quote

Old   April 2, 2015, 05:36
Default
  #8
Senior Member
 
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 11
SJSW is on a distinguished road
I am using Non-premixed model in Ansys 14.0.
The description in
3.2.3.6.1.*Species Fractions Calculations with the Non- and Partially- Premixed Models
says that "... Pdf_Yi(c, t, n) or Pdf_XY(c,t,x,y). The functions are defined in the header file pdf_props.h, which you will need to include in your UDF."

However, I would like to acquire the species fraction on a certain face.
In other cases without Non-premixed model, it should be F_YI(f,t,i).
Could anyone kindly tell me how to get the mass fraction on a face when using Non-premixed model?
Thank you!
SJSW 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
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem cico0815 OpenFOAM Community Contributions 36 February 3, 2022 11:54
Problem with building geometry - concentric cylinders Rhoddwen OpenFOAM Pre-Processing 9 December 17, 2014 10:02
[snappyHexMesh] Problem creating patches using snappyheymesh kewsinger OpenFOAM Meshing & Mesh Conversion 3 November 10, 2014 04:48
[Commercial meshers] Handling cyclic BC from gambit to openfoam for a cascade airfoil problem - OF 1.6 maverick OpenFOAM Meshing & Mesh Conversion 2 June 18, 2011 04:36
Having problem in creating a volume mech in GAMBIT Jake FLUENT 1 April 25, 2008 05:01


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