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

How to get data of mass fraction in UDF

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 28, 2019, 00:43
Default How to get data of mass fraction in UDF
  #1
New Member
 
lili
Join Date: May 2019
Posts: 12
Rep Power: 7
lilistar-8216 is on a distinguished road
Hi, I'd like to get mass fraction data and store UDM at the end of tilmestep.
I tried calculation with UDF that can execute value at the end of tilmestep but it doesn't work and i get segmentation error.

My UDF is here,

#include "udf.h"
#include "sg_pdf.h"
#include "pdf_props.h"

DEFINE_EXECUTE_AT_END(mass_fraction)
{
Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1);
real mass;

thread_loop_c(t,d)
{
begin_c_loop(c, t)
{
mass = Pdf_Yi(c, t, 54); /*54 is an index of species i want to get value */
C_UDMI(c, t, 0) = mass;
Message("mf = %g\n", mass);
}
end_c_loop(c,t)
}
}

my calculation model has both solid zone and fluid zone. Addition to that, I use an Chemkin as a species model.

I also tried to change Pdf_Yi(cat,54) into C_YI(c,t,54) but it also didn't work.

Do you know if there are some problems in my UDF or not, how to use C_YI or Pdf_Yi macros, or the other ways to get mass fraction value at the end of tilmestep without these macros.

regards
lilistar-8216 is offline   Reply With Quote

 

Tags
macros, segmentation error, udf


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
mass fraction of species Lilly FLUENT 5 March 13, 2022 17:52
CFD by anderson, chp 10.... supersonic flow over flat plate varunjain89 Main CFD Forum 18 May 11, 2018 07:31
Accessing the species mass fraction for particles data in UDF mac_09 FLUENT 17 August 9, 2017 20:15
Define mass flow profile with regards to species mass fraction danS Fluent UDF and Scheme Programming 0 June 20, 2017 06:21
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32


All times are GMT -4. The time now is 01:47.