UDF for setting interface concentration
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 |
You could force a specified mass fraction of your species at an internal boundary using the DEFINE_PROFILE macro (typically used for inlet conditions).
|
Didn't know you could use DEFINE_PROFILE on interfaces :eek:
interfaces tend to move all the time :confused: |
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?
|
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? |
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? |
Quote:
You could loop through all cells and use a conditional statement as they have used in the thread I posted earlier. |
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.
|
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. |
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).
|
Quote:
I want to do the same thing as you. I was wondering, can you find the solution for this? Thanks, Amin |
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); } |
All times are GMT -4. The time now is 09:37. |