|
[Sponsors] |
May 23, 2009, 07:46 |
F_YI(f,t,i) is creating a problem
|
#1 |
New Member
itoa
Join Date: May 2009
Posts: 12
Rep Power: 17 |
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 |
|
May 23, 2009, 08:30 |
|
#2 |
New Member
itoa
Join Date: May 2009
Posts: 12
Rep Power: 17 |
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 |
|
May 23, 2009, 10:54 |
|
#3 |
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18 |
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 |
|
May 24, 2009, 04:10 |
|
#4 |
New Member
itoa
Join Date: May 2009
Posts: 12
Rep Power: 17 |
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 |
|
May 24, 2009, 07:00 |
|
#5 |
Member
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18 |
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! |
|
May 24, 2009, 12:23 |
|
#6 |
New Member
itoa
Join Date: May 2009
Posts: 12
Rep Power: 17 |
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 |
|
September 3, 2009, 09:03 |
|
#7 |
Member
Byron Smith R J
Join Date: Mar 2009
Location: India
Posts: 46
Rep Power: 17 |
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 |
|
April 2, 2015, 06:36 |
|
#8 |
Senior Member
Join Date: Jun 2014
Location: Taiwan
Posts: 100
Rep Power: 12 |
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! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[SOWFA] NREL SOWFA ABLTerrainSolver tutorial problem | cico0815 | OpenFOAM Community Contributions | 36 | February 3, 2022 12:54 |
Problem with building geometry - concentric cylinders | Rhoddwen | OpenFOAM Pre-Processing | 9 | December 17, 2014 11:02 |
[snappyHexMesh] Problem creating patches using snappyheymesh | kewsinger | OpenFOAM Meshing & Mesh Conversion | 3 | November 10, 2014 05: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 05:36 |
Having problem in creating a volume mech in GAMBIT | Jake | FLUENT | 1 | April 25, 2008 06:01 |