CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF about boiling phenomenon

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2014, 03:19
Default UDF about boiling phenomenon
  #1
New Member
 
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12
orchiders is on a distinguished road
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!
orchiders is offline   Reply With Quote

Old   July 4, 2014, 03:38
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.)
pakk is offline   Reply With Quote

Old   July 4, 2014, 03:56
Default
  #3
New Member
 
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12
orchiders is on a distinguished road
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].
orchiders is offline   Reply With Quote

Old   July 4, 2014, 04:18
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by orchiders View Post
P_PHASE and S_PHASE is first phase(vapor) and second phase(liquid).
Yes, to me that is clear, but is it also clear to the program? Does the program know what P_PHASE is? Is it something defined by Fluent? (I never saw it before.) Or is is something you defined elsewhere?

Quote:
Originally Posted by orchiders View Post
To use C_CENTROID, I defined xc[ND_ND].
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:
Originally Posted by orchiders View Post
I arppreciate reply to my question.
I succeed UDF compile. however when operating simulation, Error: Divergence detected in AMG solver: pressure correction.
Ok, so at least Fluent can process your UDF. The problem occurs later in the calculation. But I think it might be caused by your UDF.

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.)
pakk is offline   Reply With Quote

Old   July 4, 2014, 05:10
Default
  #5
New Member
 
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12
orchiders is on a distinguished road
I want to change VOF valvue to separate water from vapor.
0<VOF<0.5 : VOF=0
0.5<VOF<1 : VOF=1
orchiders is offline   Reply With Quote

Old   July 4, 2014, 05:23
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
And then? Continue the calculation? Make pictures? Calculate the volume occupied by water?
pakk is offline   Reply With Quote

Old   July 4, 2014, 05:56
Default
  #7
New Member
 
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12
orchiders is on a distinguished road
yes. I make picture of vapor bubble growth using calculated vapor volume fraction. and calcuate heat transfer rate and haet flux.
orchiders is offline   Reply With Quote

Old   July 4, 2014, 06:40
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   July 4, 2014, 06:56
Default
  #9
New Member
 
JeongGyun Ham
Join Date: Mar 2014
Location: Korea
Posts: 12
Rep Power: 12
orchiders is on a distinguished road
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?
orchiders is offline   Reply With Quote

Old   July 4, 2014, 07:17
Default
  #10
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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;
write
Code:
C_UDMI(c,tp,0) = 1;
(and the same for 0)

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.
pakk is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 07:51.