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

Help! Having problem in accessing volume fraction gradient

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pranab_jha

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2013, 12:44
Exclamation Help! Having problem in accessing volume fraction gradient
  #1
New Member
 
Geng Fu
Join Date: Mar 2012
Location: Beijing, China
Posts: 5
Rep Power: 14
Geng Fu is on a distinguished road
Hi, I am using DEFINE_MASS_TRANSFER to add a new phase change model into VOF model.

There is a problem in accessing volume fraction gradient with C_VOF_G. The results of mass transfer rate are 0 on the interface.

After I checked the thread storage(thread, SV_VOF_G), I found it always equals null.

Any help would be appreciated. Thanks in advance.

Code:
  DEFINE_MASS_TRANSFER(liq_gas_source_Sun, cell, thread, from_index, from_species_index, to_index, to_species_index)
  {
    real m_lg; // mass transfer rate on the interface, kg/s/m3 ;
    real h_lg = 2257600; // evaporation enthalpy, J/kg 
    real vof_cutoff = 0.05;
    real vpVofT; // dot product of temperature gradient and volume fraction gradient
    real v_sx; // volume fraction gradient dx
    real v_sy; // volume fraction gradient dy
    Thread *liq, *gas;    
    liq = THREAD_SUB_THREAD(thread, from_index); 
    gas = THREAD_SUB_THREAD(thread, to_index); //  from_index and to_index are defined in the Mass panel of Phase interaction.
    m_lg = 0.0; // Initial value of m_lg.
 
        if ((C_VOF(cell, liq) > vof_cutoff) && (C_VOF(cell, liq) < (1-vof_cutoff)))
        {                                               
           if (NULL != THREAD_STORAGE(thread,SV_VOF_G))
              {
                v_sx = C_VOF_G(cell, gas)[0];
                v_sy = C_VOF_G(cell, gas)[1];  
                printf("THREAD_STORAGE : %f \n", THREAD_STORAGE(gas,SV_VOF_G));     
              }
          vpVofT = v_sx*C_T_G(cell, thread)[0] + v_sy*C_T_G(cell, thread)[1];
          printf("v_sy: %f \n", v_sy);
          printf("TempGradx: %f \n", C_T_G(cell, thread)[0]);
          printf("dot product of TempGrad and VOFGrad: %f \n", vpVofT);
          m_lg = 2/h_lg*C_K_L(cell, gas)*vpVofT; //mass transfer rate from liquid to gas;
        }
       return (m_lg);
   }
Geng Fu is offline   Reply With Quote

Old   May 23, 2013, 18:31
Default
  #2
Member
 
pranab_jha's Avatar
 
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 17
pranab_jha is on a distinguished road
Hi Geng Fu,

This should solve your problem:
http://www.eureka.im/883.html

Alternatively, you can also enable the temporary solver memory (yes) by using the TUI.
solve-set-expert. I believe its the 4th question in Fluent v6.3.
6863523 likes this.
pranab_jha is offline   Reply With Quote

Old   May 24, 2013, 04:05
Default
  #3
New Member
 
Geng Fu
Join Date: Mar 2012
Location: Beijing, China
Posts: 5
Rep Power: 14
Geng Fu is on a distinguished road
Quote:
Originally Posted by pranab_jha View Post
Hi Geng Fu,

This should solve your problem:
http://www.eureka.im/883.html

Alternatively, you can also enable the temporary solver memory (yes) by using the TUI.
solve-set-expert. I believe its the 4th question in Fluent v6.3.
Great thanks for your reply!

I will read the link you gave first.

I already enabled the temporary solver memory.

Thank you again!
All the best.
Geng Fu is offline   Reply With Quote

Old   May 27, 2013, 05:11
Default
  #4
New Member
 
Geng Fu
Join Date: Mar 2012
Location: Beijing, China
Posts: 5
Rep Power: 14
Geng Fu is on a distinguished road
Quote:
Originally Posted by pranab_jha View Post
Hi Geng Fu,

This should solve your problem:
http://www.eureka.im/883.html

Alternatively, you can also enable the temporary solver memory (yes) by using the TUI.
solve-set-expert. I believe its the 4th question in Fluent v6.3.
Problem solved. Thank you so much!
Geng Fu is offline   Reply With Quote

Old   November 28, 2013, 10:20
Default the same problem
  #5
New Member
 
anonymous
Join Date: Nov 2013
Posts: 9
Rep Power: 13
MichaelVS is on a distinguished road
Dear Colleagues,

I tried to compile the udf from the link (http://www.eureka.im/883.html), but got the error:

Scalar_Reconstruction: undeclared variable

Did you manage to compile this udf? Everything was fine?

Dear Geng Fu, could you please specify the solution for your original problem?
MichaelVS is offline   Reply With Quote

Old   November 28, 2013, 21:04
Default
  #6
New Member
 
Geng Fu
Join Date: Mar 2012
Location: Beijing, China
Posts: 5
Rep Power: 14
Geng Fu is on a distinguished road
Quote:
Originally Posted by MichaelVS View Post
Dear Colleagues,

I tried to compile the udf from the link (http://www.eureka.im/883.html), but got the error:

Scalar_Reconstruction: undeclared variable

Did you manage to compile this udf? Everything was fine?

Dear Geng Fu, could you please specify the solution for your original problem?
Sorry, i solved this problem about half year ago, i really need some time to recall it. This weekend i will redo this process and hope it will help you.
Geng Fu is offline   Reply With Quote

Old   November 29, 2013, 04:46
Default
  #7
New Member
 
anonymous
Join Date: Nov 2013
Posts: 9
Rep Power: 13
MichaelVS is on a distinguished road
Thank you very much, it is very kind of you!

I am looking forward to hearing from you.

Quote:
Originally Posted by Geng Fu View Post
Sorry, i solved this problem about half year ago, i really need some time to recall it. This weekend i will redo this process and hope it will help you.
MichaelVS is offline   Reply With Quote

Old   December 16, 2013, 00:54
Default
  #8
New Member
 
Brian
Join Date: Oct 2012
Posts: 1
Rep Power: 0
froverstyl1 is on a distinguished road
Hi MichaelVS,

I had same error below.

Scalar_Reconstruction: argument 5 type mismatch (int instead of pointer to function returning void)

And when I compiled the udf not interpreted, there is no such an error. But now, I have an error below when I run calculation.

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.

or

The UDF library you are trying to load (libudf) is not compiled for 2ddp on the curent platform (win64).

anyone can help?
froverstyl1 is offline   Reply With Quote

Old   January 23, 2014, 03:40
Default
  #9
New Member
 
Geng Fu
Join Date: Mar 2012
Location: Beijing, China
Posts: 5
Rep Power: 14
Geng Fu is on a distinguished road
Quote:
Originally Posted by MichaelVS View Post
Thank you very much, it is very kind of you!

I am looking forward to hearing from you.
I feel so sorry to reply u two months later.
Hope u have solved your problem. If not, let me have a look at ur case file if possible. nictse911@bit.edu.cn
Sorry again!

Best regards!
Geng Fu is offline   Reply With Quote

Old   August 23, 2014, 10:55
Default hamed.moradkhani@yahoo.com
  #10
New Member
 
sarighulikhan
Join Date: Mar 2014
Posts: 15
Rep Power: 12
hane is on a distinguished road
do the precedure below
1.define->user-defined->functions->interprated..
interprate the .c file
2.type on the command window of fluent
solve(press enter)
set(press enter)
expert(press enter)
answer for the 4 comming questions respectively are:
no-yes-no-yes

after these 2 steps u can hook the udf from phase intraction->mass tab->user defined->selecting udf...
now you can start runing calculation
inform me about ur results
regards
hane is offline   Reply With Quote

Old   March 23, 2016, 10:52
Default
  #11
Member
 
Rajukiran Antham
Join Date: Dec 2012
Location: Sweden
Posts: 41
Rep Power: 13
RAJ KIRAN is on a distinguished road
Hi,

I am having the same problem, mass transfer is always 0. I switched on the temporary solver memory, but that did not solve the problem.

Could you tell me how you solved this issue.
RAJ KIRAN is offline   Reply With Quote

Old   March 13, 2020, 09:35
Default
  #12
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by Geng Fu View Post
Great thanks for your reply!

I will read the link you gave first.

I already enabled the temporary solver memory.

Thank you again!
All the best.
hi
how to store mass fraction gradients in my case?
mahdi-united is offline   Reply With Quote

Old   April 29, 2020, 11:27
Default
  #13
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by pranab_jha View Post
Hi Geng Fu,

This should solve your problem:
http://www.eureka.im/883.html

Alternatively, you can also enable the temporary solver memory (yes) by using the TUI.
solve-set-expert. I believe its the 4th question in Fluent v6.3.
hi

when i run my case in transient mood, this message and error apprear and suddenly FLUENT crashes.


warning: SV_VOF_G not allocated, returning 0
warning: SV_VOF_G not allocated, returning 0
warning: SV_VOF_G not allocated, returning 0


the f1 process could not be started


Error:Error writing "| gzip -2cf > FFF-1-58-00000.dat.gz".
Error object: #f
mahdi-united is offline   Reply With Quote

Old   April 29, 2020, 11:29
Default
  #14
Senior Member
 
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6
mahdi-united is on a distinguished road
Quote:
Originally Posted by Geng Fu View Post
Hi, I am using DEFINE_MASS_TRANSFER to add a new phase change model into VOF model.

There is a problem in accessing volume fraction gradient with C_VOF_G. The results of mass transfer rate are 0 on the interface.

After I checked the thread storage(thread, SV_VOF_G), I found it always equals null.

Any help would be appreciated. Thanks in advance.

Code:
  DEFINE_MASS_TRANSFER(liq_gas_source_Sun, cell, thread, from_index, from_species_index, to_index, to_species_index)
  {
    real m_lg; // mass transfer rate on the interface, kg/s/m3 ;
    real h_lg = 2257600; // evaporation enthalpy, J/kg 
    real vof_cutoff = 0.05;
    real vpVofT; // dot product of temperature gradient and volume fraction gradient
    real v_sx; // volume fraction gradient dx
    real v_sy; // volume fraction gradient dy
    Thread *liq, *gas;    
    liq = THREAD_SUB_THREAD(thread, from_index); 
    gas = THREAD_SUB_THREAD(thread, to_index); //  from_index and to_index are defined in the Mass panel of Phase interaction.
    m_lg = 0.0; // Initial value of m_lg.
 
        if ((C_VOF(cell, liq) > vof_cutoff) && (C_VOF(cell, liq) < (1-vof_cutoff)))
        {                                               
           if (NULL != THREAD_STORAGE(thread,SV_VOF_G))
              {
                v_sx = C_VOF_G(cell, gas)[0];
                v_sy = C_VOF_G(cell, gas)[1];  
                printf("THREAD_STORAGE : %f \n", THREAD_STORAGE(gas,SV_VOF_G));     
              }
          vpVofT = v_sx*C_T_G(cell, thread)[0] + v_sy*C_T_G(cell, thread)[1];
          printf("v_sy: %f \n", v_sy);
          printf("TempGradx: %f \n", C_T_G(cell, thread)[0]);
          printf("dot product of TempGrad and VOFGrad: %f \n", vpVofT);
          m_lg = 2/h_lg*C_K_L(cell, gas)*vpVofT; //mass transfer rate from liquid to gas;
        }
       return (m_lg);
   }
hi in your problem, how to calculate latent heat due to mass transfer in FLUENT?
mahdi-united is offline   Reply With Quote

Reply

Tags
c_vof_g, vof phase change, volume fraction gradient


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
udf: volume fraction gradient in eulerian model jwwang FLUENT 22 April 15, 2015 07:27
Zero Gradient for Volume fraction at inlet Kushagra CFX 1 January 1, 2014 06:58
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
Problem with Volume Fraction Multihull STAR-CCM+ 4 May 9, 2010 12:50


All times are GMT -4. The time now is 17:04.