|
[Sponsors] |
May 25, 2020, 11:59 |
Species transport equation source term udf
|
#1 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
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? |
|
May 27, 2020, 15:48 |
|
#2 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Any help on this post?
Thanks |
|
May 28, 2020, 12:30 |
|
#3 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
I have tried to use the example given in the fluent tutorial. Code:
#include "udf.h" DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index, from_species_index, to_index, to_species_index) { real m_lg; real T_SAT = 373.15; Thread *gas = THREAD_SUB_THREAD(thread, from_index); // gas phase Thread *liq = THREAD_SUB_THREAD(thread, to_index); // liquid phase 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 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Tabulated thermophysicalProperties library | chriss85 | OpenFOAM Community Contributions | 62 | October 2, 2022 04:50 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
[swak4Foam] swak4foam building problem | GGerber | OpenFOAM Community Contributions | 54 | April 24, 2015 17:02 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |