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

Help: Mass transfer is always 0

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By RAJ KIRAN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2016, 08:59
Default Help: Mass transfer is always 0
  #1
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
Hej,
I am using UDF to calculate mass transfer. I need to calculate interfacial area density using alpha fraction gradient. I am using below code,

if (C_VOF(c,liq)>0 && C_VOF(c,liq)<1)
{
if (NULL != THREAD_STORAGE(mixture_thread,SV_VOF_G))
{
vol_lx = C_VOF_G(c, liq)[0];
vol_ly = C_VOF_G(c, liq)[1];
vol_lz = C_VOF_G(c, liq)[2];
printf("THREAD_STORAGE : %f \n", THREAD_STORAGE(gas,SV_VOF_G));
}
ai = fabs (sqrt((vol_lx*vol_lx)+(vol_ly*vol_ly)+(vol_lz*vol_ lz)));
masstransfer = htc*ai*(Tsat-T_l)/h_lt;

}

I Checked Thread_Storage and it is always null, It is not entering loop. I switched on the temporary solver memory,but still it is not working. I saw this question in couple of threads , but there is no answer for the question.

I really appreciate if some one can answer this.

reagrds,
Raju
RAJ KIRAN is offline   Reply With Quote

Old   March 24, 2016, 10:57
Default
  #2
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
I tried accessing the temperature gradient in the same way by replacing SV_VOF_G to SV_T_G and it works.

I really could use some help here,,

Thanks in Advance

regards,
Raju
RAJ KIRAN is offline   Reply With Quote

Old   March 25, 2016, 06:35
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
The manual of Fluent does not mention "SV_VOF_G". The manual of Fluent does mention "SV_T_G".

It is good that you tried, because many things in Fluent are not documented, and "SV_VOF_G" would be a logical name for the thing that you want to have, but at this point you should just conclude that "SV_VOF_G" is not implemented in Fluent, and that you need to find a different approach.
pakk is offline   Reply With Quote

Old   March 25, 2016, 09:35
Default
  #4
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
Thank you for the reply pakk,

I checked sg_mphase.h which contain all the definitions for macros that are associated with VOF multiphase model. I found this definition there

#define C_VOF_G(c,t)C_STORAGE_R_NV(c,t,SV_VOF_G)

So I guess it is implemented in fluent. But, I am not sure whether this definition is the exact one I am looking for. If SV_VOF_G is not implemented in fluent, then I think it should give some sort compilation error but I did not get any.

Is there any other way for accessing volume fraction gradient?

regards,
Raju
RAJ KIRAN is offline   Reply With Quote

Old   March 25, 2016, 09:48
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Your definition does not show that it is implemented; it only shows that if it is implemented, then C_VOF_G is also implemented.

This shows that there certainly were plans to implement it, and that the 'surrounding infrastructure' is already in place, but it does not show that it really is there. And your test shows it is not there...

Maybe it is implemented, but not stored by default. Maybe it is possible to activate it with a TUI text, just as you had to use to activate the other gradients. But there is nothing in the help about this. I think your best option there is to contact the Ansys helpdesk.
pakk is offline   Reply With Quote

Old   March 25, 2016, 09:57
Default
  #6
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
Thanks again,

I have already sent a query regarding this to Ansys support, I will post the reply as soon as I get something from them.

regards,
Raju
RAJ KIRAN is offline   Reply With Quote

Old   March 20, 2017, 20:11
Default
  #7
New Member
 
Join Date: Mar 2015
Posts: 6
Rep Power: 11
stevie-tran is on a distinguished road
Hi Raj,
Can you update me about this issue? I am facing the same problem!


Sent from my iPhone using CFD Online Forum mobile app
stevie-tran is offline   Reply With Quote

Old   March 20, 2017, 20:24
Default
  #8
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
Quote:
Originally Posted by stevie-tran View Post
Hi Raj,
Can you update me about this issue? I am facing the same problem!


Sent from my iPhone using CFD Online Forum mobile app
Hi,

I solved the issue by calculating Interfacial area density in a separate UDF and stored it in a UDM. I called the UDM wherever the interfacial area density is required. Below is the UDF which I wrote for it,

Code:
#include "udf.h"
 
DEFINE_ADJUST(gradient, domain)
 
{
#if !RP_HOST
 
Thread *t;
 
Thread **pt;
 
cell_t c;
 
 
int phase_domain_index = 0;  /* Check the phase whether it is primary or secondary */
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index);
 
 {
 
   Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
 
   Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);
 
   Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);
 
 
 }
 
mp_thread_loop_c (t,domain,pt)
 
 
if (FLUID_THREAD_P(t))
 
 {
 
  Thread *ppt = pt[phase_domain_index];
 
 
  begin_c_loop (c,t)
 
   { 
 
     C_UDMI(c,t,0) = sqrt((C_VOF_G(c,ppt)[0]*C_VOF_G(c,ppt)[0])+(C_VOF_G(c,ppt)[1]*C_VOF_G(c,ppt)[1]));
    
/*  C_UDMI(c,t,1) = C_VOF_G(c,ppt) [1];
    C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2];*/
   
   }
   
end_c_loop (c,t)
 
 } 
 
Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
 #endif
}
This is written for a 2d case, Hope this helps, Good luck !!
pakk likes this.
RAJ KIRAN is offline   Reply With Quote

Old   March 23, 2017, 09:01
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
You can make this part shorter (and thus easier to understand and maintain):
Code:
C_UDMI(c,t,0) = sqrt((C_VOF_G(c,ppt)[0]*C_VOF_G(c,ppt)[0])+(C_VOF_G(c,ppt)[1]*C_VOF_G(c,ppt)[1]));
Replace it by:
Code:
C_UDMI(c,t,0) = NV_MAG(C_VOF_G(c,ppt));
NV_MAG means the magnitude of the vector.
pakk is offline   Reply With Quote

Old   March 12, 2018, 07:28
Default
  #10
New Member
 
xiatiantian
Join Date: Dec 2017
Posts: 5
Rep Power: 8
xiatt is on a distinguished road
Quote:
Originally Posted by RAJ KIRAN View Post
Hi,

I solved the issue by calculating Interfacial area density in a separate UDF and stored it in a UDM. I called the UDM wherever the interfacial area density is required. Below is the UDF which I wrote for it,

Code:
#include "udf.h"
 
DEFINE_ADJUST(gradient, domain)
 
{
#if !RP_HOST
 
Thread *t;
 
Thread **pt;
 
cell_t c;
 
 
int phase_domain_index = 0;  /* Check the phase whether it is primary or secondary */
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index);
 
 {
 
   Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
 
   Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);
 
   Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);
 
 
 }
 
mp_thread_loop_c (t,domain,pt)
 
 
if (FLUID_THREAD_P(t))
 
 {
 
  Thread *ppt = pt[phase_domain_index];
 
 
  begin_c_loop (c,t)
 
   { 
 
     C_UDMI(c,t,0) = sqrt((C_VOF_G(c,ppt)[0]*C_VOF_G(c,ppt)[0])+(C_VOF_G(c,ppt)[1]*C_VOF_G(c,ppt)[1]));
    
/*  C_UDMI(c,t,1) = C_VOF_G(c,ppt) [1];
    C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2];*/
   
   }
   
end_c_loop (c,t)
 
 } 
 
Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
 #endif
}
This is written for a 2d case, Hope this helps, Good luck !!
Hi PAJ, based on your case, I alter mine. But when I run calculate, it take on a
error:
received a fatal signal (segmentation fault)
Could you tell me the reason?
xiatt is offline   Reply With Quote

Old   March 13, 2018, 12:31
Default
  #11
Senior Member
 
Join Date: Sep 2017
Posts: 246
Rep Power: 11
obscureed is on a distinguished road
Hi All,

Going back to the original post (admittedly 2 years ago), it strikes me that the test for existence of the vector quantity C_VOF_G might not involve if(NNULLP(THREAD_STORAGE(mixture_thread,SV_VOF_G)) )
but rather
if(NNULLP(T_STORAGE_R_NV(mixture_thread,SV_VOF_G)) )

I have not checked whether there is a difference in outcomes.

Ed
obscureed is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
mass transfer coefficient ArturTU FLUENT 1 October 27, 2015 11:04
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
About phase change heat and mass transfer Michael FLUENT 2 February 13, 2011 02:49
How to calculate Volumetric Mass transfer coefficient using CFX? tuks_123 CFX 2 July 22, 2010 02:15
Vof, udf and mass transfer panel Jay FLUENT 1 March 15, 2005 01:29


All times are GMT -4. The time now is 15:00.