Species transport equation source term udf

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

 May 25, 2020, 10:59 Species transport equation source term udf #1 Member   Anshuman Sinha Join Date: Oct 2018 Posts: 70 Rep Power: 4 I am modeling a species mass transfer model, in which I want to transfer a species from one phase to another phase. I am trying to express this process with the last term of the equation given below. [ m_dot(p_j,q_i) = mass transfer of 'species j from p phase' to 'species i of q phase' ] Screenshot 2020-05-23 at 10.31.53 AM.jpg Can anyone please help me with a very basic example of which UDF macro to use and how may I assign the phases and the species? vavnoon likes this.

 May 27, 2020, 14:48 #2 Member   Anshuman Sinha Join Date: Oct 2018 Posts: 70 Rep Power: 4 Any help on this post? Thanks

May 28, 2020, 11:30
#3
Member

Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 4
Quote:
 Originally Posted by Anshs I am modeling a species mass transfer model, in which I want to transfer a species from one phase to another phase. I am trying to express this process with the last term of the equation given below. [ m_dot(p_j,q_i) = mass transfer of 'species j from p phase' to 'species i of q phase' ] Attachment 77892 Can anyone please help me with a very basic example of which UDF macro to use and how may I assign the phases and the species?

I have tried to use the example given in the fluent tutorial.

Code:
```#include "udf.h"

from_species_index, to_index, to_species_index)

{

real m_lg;

real T_SAT = 373.15;

m_lg = 0.;           // initialisation

if ((m_lg == 0. ) && (C_T(cell, gas) <= T_SAT))

{

m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)*

fabs(T_SAT-C_T(cell,gas))/T_SAT;

from_species_index = 0. (let's say the first species)
to_species_index = 2. (let's say the third species)

m_lg = 0.1* C_VOF(cell,gas) * C_R(cell,gas) * C_YI(c , gas , 0)  ;

//here C_YI(c, gas, 0 ), denotes species mass fraction of 1st species in the mixture denoted by phase 'gas'.

}

return (m_lg);```

Is the above UDF correct?

But how will the UDF know whether to transfer the species to 'to_species_index = 2'?

 Tags mass transfer, source term, species equations, udf