CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS (https://www.cfd-online.com/Forums/ansys/)
-   -   UDF Species of each phase (https://www.cfd-online.com/Forums/ansys/235288-udf-species-each-phase.html)

U1990 April 8, 2021 17:20

UDF Species of each phase
 
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.

Yasser April 8, 2021 22:43

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)


U1990 April 9, 2021 01:51

Quote:

Originally Posted by Yasser (Post 801004)
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?

Yasser April 9, 2021 06:11

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


All times are GMT -4. The time now is 00:33.