|
[Sponsors] |
July 4, 2014, 03:19 |
UDF about boiling phenomenon
|
#1 |
New Member
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12 |
Hi. everyone.
I’m studying boiling phenomenon and carrying out the vof simulation on bubble growth when boiling. A boundary between liquid and vapor is not clear. So I assumed that 0< volume fraction <0.5 : water 0.5< volume fraction <1 : vapor DEFINE_INIT(my_init_function, domain) { Thread *t; Thread **pt; Thread **st; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); Domain *sDomain = DOMAIN_SUB_DOMAIN(domain,S_PHASE); real xc[ND_ND], vof1, vof2; mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { C_CENTROID(xc,c,t); vof1=C_VOF(c,tp); if ( 0.5 < vof1 ) C_VOF(c,tp) = 1; } end_c_loop (c,t) } mp_thread_loop_c (t,domain,st) if (FLUID_THREAD_P(t)) { Thread *sp = st[P_PHASE]; begin_c_loop (c,t) { C_CENTROID(xc,c,t); vof2=C_VOF(c,sp); if ( 0.5 < vof2 ) C_VOF(c,sp) = 0; } end_c_loop (c,t) } } and I wrote UDF. but It didn’t operate. Would you please do me a favor? Please give me reply anytime you feel free. Thank you! |
|
July 4, 2014, 03:38 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Does it fail when you compile it? Or when you interpret it? Or when you load it? Or when you run it?
What are P_PHASE and S_PHASE? Does the program know what to do with it? (You calculate xc, but never do anything with it. That will not cause any problem, but you could remove it, to make the code smaller.) |
|
July 4, 2014, 03:56 |
|
#3 |
New Member
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12 |
I arppreciate reply to my question.
I succeed UDF compile. however when operating simulation, Error: Divergence detected in AMG solver: pressure correction. P_PHASE and S_PHASE is first phase(vapor) and second phase(liquid). To use C_CENTROID, I defined xc[ND_ND]. |
|
July 4, 2014, 04:18 |
|
#4 | ||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Quote:
The only use that C_CENTROID has, is to give a value to xc. You never use xc, so you can remove xc and C_CENTROID without consequence. Quote:
I can more or less see what your UDF does. But I don't know what you want it to do. What do you want your UDF to do? (Be as exact as possible, for example "VOF calculations" or "separate water from vapor" is not detailed enough.) |
|||
July 4, 2014, 05:10 |
|
#5 |
New Member
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12 |
I want to change VOF valvue to separate water from vapor.
0<VOF<0.5 : VOF=0 0.5<VOF<1 : VOF=1 |
|
July 4, 2014, 05:23 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
And then? Continue the calculation? Make pictures? Calculate the volume occupied by water?
|
|
July 4, 2014, 05:56 |
|
#7 |
New Member
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12 |
yes. I make picture of vapor bubble growth using calculated vapor volume fraction. and calcuate heat transfer rate and haet flux.
|
|
July 4, 2014, 06:40 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Two questions:
- Why do you need the VOF to be either 0 or 1? If the values in the simulation are in between, you can still make pictures, and do these calculations. - Why do you continue the simulation after making these values 0 or 1? Fluent will get really confused by this, as you noticed. |
|
July 4, 2014, 06:56 |
|
#9 |
New Member
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12 |
As the boundary between water and vapor is not claer, I think a boundary using volume fraction value may be simplied. However, I agree your opinion 2. I think fluent is comfused, so errors happen. Do you have any ideas?
|
|
July 4, 2014, 07:17 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
My opinion: don't change the VOF...
If you really want to have a strict distinction between vapor and liquid, add a user defined memory (UDM) and store the value there. So instead of Code:
C_VOF(c,tp) = 1; Code:
C_UDMI(c,tp,0) = 1; In that way, you don't change the VOF, so Fluent will not get confused, and you can make the same plots by plotting UDM0. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for Subcooled Nucleate Boiling | Jake | Fluent UDF and Scheme Programming | 3 | December 30, 2019 05:10 |
boiling in pipe (UDF) | malay | Fluent UDF and Scheme Programming | 2 | November 13, 2016 06:54 |
udf for boiling and condensation | brusly | FLUENT | 0 | November 22, 2006 22:17 |
udf for boiling and condensation | brusly | FLUENT | 0 | November 20, 2006 01:10 |
-What udf macro for boiling - | thomas | FLUENT | 6 | January 19, 2004 07:31 |