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

how to used C_YI(f,t,i)???

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2001, 21:23
Default how to used C_YI(f,t,i)???
  #1
kevin
Guest
 
Posts: n/a
i simulated a mixtures(include oxygen, water vapor,nitrogen)into flow channel in first floor , and mixtures backward diffuse in second floor , i used C code(user-defined-function) to calculate electrochemical equation in third floor , i want to give mass fraction of second gas(water vapor) C_YI(f,t,1) ........in sovler's DEFINE/materials panel's inside have button (mixture species) , i choices order is oxygen ,water vapor,nitrogen ,

C_YI(f,t,0)..........get mass fraction of oxygen C_YI(f,t,1)..........get mass fraction of water vapor

i don't know answer is correct or incorrect ???????

  Reply With Quote

Old   November 8, 2001, 00:53
Default Re: how to used C_YI(f,t,i)???
  #2
hampton
Guest
 
Posts: n/a
Hi,

Both C_YI(f,t,0) and C_YI(f,t,1) are not right expressions .C_YI(c, t, 0) or F_YI(f, t,0 ) is right expression .C_YI gets the cell values, and F_YI gets the face values.

However , You need to know what "0" and "1" are. So, you should see the panel "Define-Material-Material Type-Mixture-Mixture Species-names-Edit".

Then ,the species that you've selected are found in the panel "Species" , and the species are located like this oxygen, water vapor,nitrogen.

In this case, oxygen is to be set "0" . In the same manner, water-vapor is to be set "1, nitrogen is to be set "2"

Thanks.
  Reply With Quote

Old   November 8, 2001, 01:28
Default Re: how to used C_YI(f,t,i)???
  #3
kevin
Guest
 
Posts: n/a
thanks hampton to give info for me . i have one problem i want to simulate electro-chemical , so i writted C code to describe it's electro-chemical reaction. but~~~~~~~~~

DEFINE_SOURCE(test,c,t,ds,eqn) { cell_t c; Thread *t; Domain *d; real source1; thread_loop_c(t, domain) { if( THREAD_ID(t) == 2 ) { begin_c_loop(c, t) { Yo2=C_Y(c,t,0); /* 0--oxygen */ Ywc=C_YI(c,t,1); /* 1--water vapor */ Pc=C_P(c,t); Xo2=Yo2*(Xn2*Mn2-Xn2*Mw+Mw)/(Mo2+Yo2*Mw-Yo2*Mo2); Xwc=(Ywc*Xo2*Mo2+Ywc*Xn2*Mn2)/(Mw-Mw*Ywc); C_UDSI(c,t,AA)=Xo2*Xwc; } end_c_loop(c,t) } }

thread_loop_c(t, domain) { if( THREAD_ID(t) == 2 ) { begin_c_loop(c, t) { source=C_UDSI(c,t,AA); ds[eqn]=0; } end_c_loop(c,t) } }

Fluent solver give me error message don't run C code

  Reply With Quote

Old   November 8, 2001, 03:45
Default Re: how to used C_YI(f,t,i)???
  #4
hampton
Guest
 
Posts: n/a
Hi,

Are you calculating a Fuel-Cell???. I checked your UDF and found some mistakes.

(1)Need to "return source" .

(2)In this case,you don't need to use "THREAD_ID(t)" and "thread_loop_c(t,domain)". Because your domain(zone) that you want to adapt to your UDF is defined explicitly in the BC panel by you.

If a DEFINE_ADJUST function is used, you have to use "THREAD_ID(t)" and "thread_loop_c(t,domain)" to define the domain(zone).

Thanks.
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 02:46.