|
[Sponsors] |
May 31, 2020, 10:02 |
|
#21 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
I meant to say, the conditional statement is not working. The mass transfer is working on the full fluid phase. Rest of it is fine.
Thanks. |
|
May 31, 2020, 16:43 |
Condition statement
|
#22 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Thanks |
||
June 2, 2020, 06:44 |
Volume Fraction Value
|
#23 |
Senior Member
|
That won't have any effect if both the phases are rather well-mixed, otherwise, it should work. Try plotting volume fraction of phases.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 2, 2020, 08:18 |
Volume fraction contours
|
#24 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
The image below represents the mass transfer which I have used Screenshot 2020-06-02 at 4.37.19 PM.jpg Initial Volume fraction: Water water.jpg Oil oil.jpg Phase interaction: mass transfer: after 100 timesteps. Screenshot 2020-06-02 at 3.41.03 PM.jpg |
||
June 2, 2020, 08:53 |
Phases
|
#25 |
Senior Member
|
How many phases do you have? Since the right-most region neither has water nor oil. So, is there a third phase?
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 2, 2020, 09:36 |
Phases
|
#26 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Screenshot 2020-06-02 at 6.05.48 PM.png Screenshot 2020-06-02 at 6.05.54 PM.png |
||
June 2, 2020, 09:42 |
Mass Transfer
|
#27 |
Senior Member
|
Do you want mass transfer from gas to water or gas to oil? You have to ensure that you have selected correct phases under From and To in Mass Transfer Panel.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 2, 2020, 10:17 |
water to oil.
|
#28 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Thanks |
||
June 2, 2020, 10:27 |
Water to Oil
|
#29 |
Senior Member
|
Your post does not contain Mass Transfer Tab. Anyway, then make changes to your code and use oil in place of gas. Though that is just a variable name yet it helps to remove ambiguity. Furthermore, to debug the code, try to make the condition even stricter. Use product of C_VOF(c, t, water) & C_VOF(c, t, oil) to define m_lg. This will have a non-zero value only at the interface of water and oil.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 4, 2020, 14:58 |
problem with 3rd phase.
|
#30 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Phases: Screenshot 2020-06-04 at 11.19.16 PM.jpg Mass transfer rate: mt.jpg UDF: Code:
#include "udf.h" DEFINE_MASS_TRANSFER(interface_transfer, cell, thread, from_index, from_species_index, to_index, to_species_index) { real m_lg; Thread *water = THREAD_SUB_THREAD(thread, from_index); Thread *oil = THREAD_SUB_THREAD(thread, to_index); m_lg = 0.0; if ( C_VOF(cell,water)*C_VOF(cell,oil) != 0 ) { /*m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)* fabs(t_sat -C_T(cell,gas))/t_sat; m_lg = 0.1* C_VOF(cell,gas) * C_R(cell,gas) * C_YI(cell , gas , 0) ; */ m_lg = 100; /* here C_YI(c, gas, 0 ), denotes species mass fraction of 1st species in the mixture denoted by phase 'gas'.*/ } else m_lg = 0.0; return (m_lg); |
||
June 4, 2020, 15:09 |
Three Phases
|
#31 |
Senior Member
|
That's because there are three phases. I suggested product of volume fractions assuming there are two phases. But with three phases, even with 0.1 volume fractions of water and oil, the condition matches, despite there being 80% air. So, you have to use a condition wherein the air content is extremely low. Ideally, this would mean that the product of volume fractions of oil and water should be 0.25. But that's ideal case, not practical. So, a better approach would be to ensure that the sum of water and oil volume fraction is close to 1, say, above 0.95, as well as their product is close to 0.25, say, above 0.21. These two conditions should get you closer to expected result.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 4, 2020, 15:55 |
|
#32 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Thanks |
||
June 4, 2020, 17:03 |
Condition
|
#33 |
Senior Member
|
That's because the condition is for the product not to be 0, so, even if it is 0.9999 * 0.00001, it's not 0.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
June 4, 2020, 17:08 |
|
#34 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
||
June 4, 2020, 17:33 |
Precision
|
#35 |
Senior Member
|
Solver stores data up to about 32 or even more decimal places.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
July 28, 2020, 09:30 |
UDF help for the same thread
|
#36 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
I have written the code where 'DEFINE_ADJUST(store_gradient, domain)' is calculating the area density of the cell, so that it can be used in the 'mass transfer' expression.
1. I think I can't write the function like this inside another function. 2. Shall I separate the area function ( DEFINE_ADJUST(store_gradient, domain) ) outside the mass transfer function? Code:
#include "udf.h" #include "math.h" DEFINE_MASS_TRANSFER(interface_transfer, cell, thread, from_index, from_species_index, to_index, to_species_index) { real m_lg; real c_tg; real k_g; Thread *water = THREAD_SUB_THREAD(thread, from_index); Thread *oil = THREAD_SUB_THREAD(thread, to_index); m_lg = 0.0; c_tg = 0.0; k_g = 0.0; if ( ( C_VOF(cell,water)*C_VOF(cell,oil) > 0.21 ) && (C_VOF(cell,water) + C_VOF(cell,oil) >0.95) ) { k_g = 0.4 * sqrt(C_DIFF_L(cell,water,0,1)) * pow((C_D(cell,water)/ C_MU_T(cell,water)), 0.25) c_tg = C_VOF(cell,water) * C_R(cell,water) * C_YI(cell , water , 0) ; m_lg = k_g * (NV_MAG(C_VOF_G(c,ppt))) * ( 4e-5 - c_tg ) ; } else m_lg = 0.0; return (m_lg); } |
|
July 28, 2020, 09:54 |
Modifying this in the above thread.
|
#37 | |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
Quote:
Modifying this in the above thread. |
||
August 18, 2022, 21:19 |
|
#38 |
New Member
vikash
Join Date: Oct 2020
Posts: 5
Rep Power: 6 |
I am dealing with a single phase(having two species of water and ethanol). water and ethanol are entering from two different inlets. How can I write UDFs for a single phase and multiple species?
|
|
August 18, 2022, 21:30 |
|
#39 |
New Member
vikash
Join Date: Oct 2020
Posts: 5
Rep Power: 6 |
I am dealing with a single phase(having two species of water and ethanol). water and ethanol are entering from two different inlets. How can I write UDFs for a single phase and multiple species?
|
|
Tags |
fluent, mass transfer, species tranport, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessing phase interaction mass transfer rate in UDF | ahmadimo | Fluent UDF and Scheme Programming | 1 | October 7, 2021 00:08 |
species transport, mass transfer rate | mattK | FLUENT | 4 | September 16, 2021 15:22 |
Coupled Heat and Mass Transfer | Mecroob | OpenFOAM Running, Solving & CFD | 1 | July 12, 2020 20:24 |
UDF Source Terms: Both Species and Mass? | Baum | Fluent UDF and Scheme Programming | 5 | April 17, 2020 10:11 |
Species Mass Transfer | Abu-Khawlah | FLUENT | 0 | December 9, 2005 11:35 |