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

UDF Species of each phase

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2021, 17:20
Default UDF Species of each phase
  #1
New Member
 
U1990
Join Date: Apr 2021
Posts: 8
Rep Power: 5
U1990 is on a distinguished road
Hello,



I am writting a UDF code to simulate chemical reaction between phases. However, I can not found information (macro or routine) about to select a specific specie of a phase.


For example:


Species1(phase 1) + Species1(phase 2) ==> Species2(phase 1)



How can I use data specifically from Specie1(phase2) in a UDF??


Thanks.
U1990 is offline   Reply With Quote

Old   April 8, 2021, 22:43
Default
  #2
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
Code:
Domain *domain;
Thread *mixture_thread;
Thread *phase1_thread;
Thread *phase2_thread;

domain = Get_Domain(1)
mixture_thread = Lookup_Thread(domain, zone_id);
phase1_thread = THREAD_SUB_THREAD(mixture_thread,phase1_index);
phase2_thread = THREAD_SUB_THREAD(mixture_thread,phase2_index);
begin_c_loop(c, mixture_thread)    
  {                                                  
C_YI(cell, phase1_thread, specie_index)
C_YI(cell, phase2_thread, specie_index)
  }
end_c_loop(c, c_thread)
Yasser is offline   Reply With Quote

Old   April 9, 2021, 01:51
Default
  #3
New Member
 
U1990
Join Date: Apr 2021
Posts: 8
Rep Power: 5
U1990 is on a distinguished road
Quote:
Originally Posted by Yasser View Post
Code:
Domain *domain;
Thread *mixture_thread;
Thread *phase1_thread;
Thread *phase2_thread;

domain = Get_Domain(1)
mixture_thread = Lookup_Thread(domain, zone_id);
phase1_thread = THREAD_SUB_THREAD(mixture_thread,phase1_index);
phase2_thread = THREAD_SUB_THREAD(mixture_thread,phase2_index);
begin_c_loop(c, mixture_thread)    
  {                                                  
C_YI(cell, phase1_thread, specie_index)
C_YI(cell, phase2_thread, specie_index)
  }
end_c_loop(c, c_thread)
Thank you very much for you reply. However, I have another question:



Does it works with Eulerian multiphase model? and if it is, The code is the same?
U1990 is offline   Reply With Quote

Old   April 9, 2021, 06:11
Default
  #4
Member
 
Yasser Selima
Join Date: Mar 2009
Location: Canada
Posts: 52
Rep Power: 19
Yasser is on a distinguished road
I want to clarify that this is not a whole code. This is just a procedure to access the mass fraction of specie in a phase. By recalling the phase thread and using Y_CI

The answer to your question is yes, it should work with Euler-Euler model
Yasser is offline   Reply With Quote

Reply

Tags
reaction, species, 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
UDF for Sorption in Species Transport through Porous Medium Kosch Fluent UDF and Scheme Programming 6 October 21, 2020 17:46
UDF for modifying density of mixture phase during the calculating process sola86 Fluent UDF and Scheme Programming 2 May 28, 2019 09:24
Direct numerical simulation of species transport equation with phase change Pmaroul Main CFD Forum 2 October 12, 2018 16:02
Phase change UDF rampal Fluent UDF and Scheme Programming 7 January 27, 2017 23:00
Unexpected species increase in discontinuous phase CeesH Fluent Multiphase 0 August 6, 2014 05:41


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