|
[Sponsors] |
February 8, 2016, 23:52 |
UDF for setting interface concentration
|
#1 |
New Member
Mark Schulte
Join Date: Dec 2015
Posts: 19
Rep Power: 11 |
I am new to writing udfs and am trying to model mass transfer from the gas to liquid phase in a vertical falling film with VOF. First, I would like to just set the concentration (or mass fraction) at the interface to some value. could someone please comment on which is the best macro for doing that? I have seen people do it in a number of different ways and was hoping for a best practice tip.
Thanks |
|
February 9, 2016, 00:56 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
You could force a specified mass fraction of your species at an internal boundary using the DEFINE_PROFILE macro (typically used for inlet conditions).
|
|
February 9, 2016, 04:52 |
|
#3 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Didn't know you could use DEFINE_PROFILE on interfaces
interfaces tend to move all the time |
|
February 9, 2016, 13:13 |
|
#4 |
New Member
Mark Schulte
Join Date: Dec 2015
Posts: 19
Rep Power: 11 |
My plan was to use a loop to pick all the cells on the Gas/Liquid interface in my VOF model, then apply the concentration there. Is there a better was to do it hwet? I have seen examples using DEFINE_ADJUST and DEFINE_SOURCE. This is the first time I have seen DEFINE_PROFILE. in order to apply this, would I need to enable a UDS?
|
|
February 9, 2016, 19:05 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I assumed you have an internal boundary where the interface between your phases are (I haven't used the VOF model and interpreted your question like that). If the interface is unknown (which might normally be the case for VOF simulations) then you can find all cells with a volume fraction between zero and unity, then apply your concentration. Here's a thread on this topic and the key line of code is:
Code:
if ((C_VOF(cell,phase_thread) != 0) && (C_VOF(cell,phase_thread) !=1)) However, wouldn't Fluent calculate the concentration and volume fraction across the domain (including the interface)? Why are you wanting to change this value and is it physically valid? |
|
February 9, 2016, 19:34 |
|
#6 | |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
The interface in VOF is the boundary between two phases. It is constructed with one of the interface construction schemes you have available in Ansys Fluent based on the momentum change of the secondary phase.
It is merely a representation of the volume fractions at the boundary cells of the two phases with a continuous boundary shown as the "interface". Quote:
'e' would you be able to tell if with the C_VOF macro, is it possible to dig out the volume fractions in specific cells? for e.g cells where the interface lies and distinguish between a set of adjoining cells from another similar set? or the maximum extent to what this macro can be utilized is to get the volume fractions at specific walls/faces alone? |
||
February 10, 2016, 00:09 |
|
#7 | |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Quote:
You could loop through all cells and use a conditional statement as they have used in the thread I posted earlier. |
||
February 10, 2016, 00:20 |
|
#8 |
Senior Member
Join Date: Mar 2014
Posts: 375
Rep Power: 13 |
Thanks, all my recent posts were related; which you answered. The confusion was due to not understanding where the data is actually stored. Makes more sense now. Thanks again.
|
|
February 10, 2016, 22:24 |
|
#9 | |
New Member
Mark Schulte
Join Date: Dec 2015
Posts: 19
Rep Power: 11 |
thank you for your detailed replies. First, 'e', I am able to mark the interface as I was using that thread you pointed me to. Glad to know others think it is correct. The udf and results are in a thread I just started, as they are a little odd. I would love you comments. For the other things you said:
Quote:
Is that more clear? hwet, I think 'e' crushed all your questions, so I won't add to them, but I would appreciate you feedback on the above or the thread I just started. Cheers. |
||
February 11, 2016, 06:01 |
|
#10 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I'm not familiar with these VOF simulations so I won't comment on the validity of your approach (I recommend reading what others have done in the literature and be careful of introducing mass into the system without considering the balances). The species mass fraction can be modified using the C_YI macro (UDS are not applicable as Fluent is already solving the mass fractions).
|
|
March 5, 2019, 15:08 |
|
#11 | |
New Member
Join Date: Jul 2018
Posts: 29
Rep Power: 8 |
Quote:
I want to do the same thing as you. I was wondering, can you find the solution for this? Thanks, Amin |
||
March 6, 2019, 12:42 |
|
#12 | |
New Member
Join Date: Jul 2018
Posts: 29
Rep Power: 8 |
Quote:
Hi, I am trying to simulate the falling film flow. I have water and humid air. I want to define a constant value for the mass fraction of water vapor in air at the interface. I wrote the UDF based on Define_adjust. But every time I try to run it I got an error. Can you help me with it? #include "udf.h" #include "sg_mphase.h" DEFINE_ADJUST(vol_frac, domain) { Thread *t; cell_t c; double Y_h2o; Y_h2o = 0.02; begin_c_loop(c,t) { if(C_VOF(c,t)>0. && C_VOF(c,t)<1.) C_UDSI(c,t,0)=Y_h2o; } end_c_loop(c,t); } |
||
Tags |
interface, mass transfer, multiphase, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
obtain species concentration in every time step to use in a udf | solmaz aryafar | Fluent UDF and Scheme Programming | 0 | April 8, 2015 11:52 |
UDF and DPM concentration | caroline | Fluent UDF and Scheme Programming | 5 | January 27, 2015 16:02 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
UDF :Unsteady concentration profile | umesh | FLUENT | 4 | July 13, 2003 18:07 |