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

Mass transfer UDF fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2019, 09:38
Default Mass transfer UDF fluent
  #1
New Member
 
Join Date: Jul 2018
Posts: 29
Rep Power: 8
aminhgn is on a distinguished road
Hi,

I am trying to model mass transfer between air and air. My equation is as follow:

m_lg = ((density of gas*Ds) / (1- mass fraction water vap t the interface))*(dc/dy)

I want to use define_mass transfer as follow:

#include "udf.h"

DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index,

from_species_index, to_index, to_species_index)

{

Thread *liq = THREAD_SUB_THREAD(thread, from_index);

Thread *gas = THREAD_SUB_THREAD(thread, to_index);

real m_lg;

m_lg = (-2.88e-5*C_R(cell,gas)/(1-C_YI(cell,gas,0)))*C_YI_G(cell,gas,0)[1];

return (m_lg);

}

but every time I use gradient I get a fatal error after one iteration. In addition, I set solve/set/expert/linearized mss transfer to no and (rpsetvar 'species/save-gradients? #t) for gradient for pressure-bsed.

I hope that anyone can help me with it.
aminhgn is offline   Reply With Quote

Old   March 27, 2019, 09:52
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by aminhgn View Post
Hi,

I am trying to model mass transfer between air and air. My equation is as follow:

m_lg = ((density of gas*Ds) / (1- mass fraction water vap t the interface))*(dc/dy)

I want to use define_mass transfer as follow:

#include "udf.h"

DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index,

from_species_index, to_index, to_species_index)

{

Thread *liq = THREAD_SUB_THREAD(thread, from_index);

Thread *gas = THREAD_SUB_THREAD(thread, to_index);

real m_lg;

m_lg = (-2.88e-5*C_R(cell,gas)/(1-C_YI(cell,gas,0)))*C_YI_G(cell,gas,0)[1];

return (m_lg);

}

but every time I use gradient I get a fatal error after one iteration. In addition, I set solve/set/expert/linearized mss transfer to no and (rpsetvar 'species/save-gradients? #t) for gradient for pressure-bsed.

I hope that anyone can help me with it.

You tell your UDF to calculate the mass flux based on the gradient calculated in the previous iteration. That fails in the first iteration, because there is no previous iteration.


The practical solution is to run your simulation without this UDF for a few time steps, and then add it.
pakk is offline   Reply With Quote

Old   March 27, 2019, 12:26
Default
  #3
New Member
 
Join Date: Jul 2018
Posts: 29
Rep Power: 8
aminhgn is on a distinguished road
Quote:
Originally Posted by pakk View Post
You tell your UDF to calculate the mass flux based on the gradient calculated in the previous iteration. That fails in the first iteration, because there is no previous iteration.


The practical solution is to run your simulation without this UDF for a few time steps, and then add it.
Thank you for your reply. Yeah so I let it run for a while then i add my FUNCTION but still after one iteration suddenly diverge.
aminhgn is offline   Reply With Quote

Old   March 27, 2019, 14:56
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Then you might have cells were C_YI(cell,gas,0)=1, so your equation becomes infinite.
pakk is offline   Reply With Quote

Old   January 9, 2020, 04:34
Default
  #5
New Member
 
Kate Hall
Join Date: Jan 2020
Posts: 1
Rep Power: 0
Converged001 is on a distinguished road
Quote:
Originally Posted by aminhgn View Post
Thank you for your reply. Yeah so I let it run for a while then i add my FUNCTION but still after one iteration suddenly diverge.
hi,I see that many people think the unit of the return value of DEFINE_MASS_TRANSFER is Kg/cubic meter*s).But,I think in your UDF,the unit of the return value is Kg/(Square meter*s).Maybe you can have a try.
Converged001 is offline   Reply With Quote

Old   November 5, 2021, 08:01
Default
  #6
New Member
 
Jun
Join Date: Aug 2021
Posts: 3
Rep Power: 5
RestlessBreeze is on a distinguished road
Hello, I am also working on the topic of droplet evaporation based on Fick's law recently. I would like to ask if your problem is solved.
RestlessBreeze 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
Accessing phase interaction mass transfer rate in UDF ahmadimo Fluent UDF and Scheme Programming 1 October 7, 2021 00:08
UDF for mass and heat source with heat transfer rajendra1 Fluent UDF and Scheme Programming 35 October 13, 2017 05:04
Mass Transfer UDF using Fluent VOF Anirudh_Deodhar Fluent UDF and Scheme Programming 3 November 18, 2015 10:29
The fluent stopped and errors with "Emergency: received SIGHUP signal" yuyuxuan FLUENT 0 December 3, 2013 23:56
Help,I have some questions about UDF of mass diffusivity in fluent apolloking Fluent UDF and Scheme Programming 0 March 20, 2011 12:40


All times are GMT -4. The time now is 18:10.