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 not working, HELP.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2020, 09:40
Default mass transfer UDF not working, HELP.
  #1
Member
 
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 7
Anshs is on a distinguished road
My UDF for mass transfer is not running , the code stops at "Message("\n\n %f," , NV_MAG(C_VOF_G(cell,w)) );" . I know I had previously made a udf for interface area gradient, by using DEFINE_ADJUST. but tried implementing it here and the code failed. I'll attach the code for 'interface area gradient' code as well

I'm I need to write the whole DEFINE_ADJUST code here as well?

Any bit of help, will do me a great favour! Thank you!



Code:
DEFINE_MASS_TRANSFER(interface_transfer, cell, thread, from_index, from_species_index, to_index, to_species_index)

{

real m_lg;


Thread *w = THREAD_SUB_THREAD(thread, from_index);

Thread *o = THREAD_SUB_THREAD(thread, to_index);


m_lg = 0.0;



if ( ( C_VOF(cell,w)*C_VOF(cell,o) > 0.1 ) && (C_VOF(cell,w) + C_VOF(cell,o) >0.75) )

{


Message("\n\n %f," , C_YI(cell, w, 0));

Message("\n\n %f," , ( C_YI(cell, w, 0) - 0.00005 ));

Message("\n\n %f," , NV_MAG(C_VOF_G(cell,w)) );


m_lg = 0.4 * (NV_MAG(C_VOF_G(cell,w)))* ( C_YI(cell, w, 0) - 0.00005 ) ;


}


else m_lg = 0.0 ;
return (m_lg);

}


Code for interfacial area density:


Code:
#include "udf.h"

DEFINE_ADJUST(store_gradient, domain)

{

Thread *t;
Thread **pt;
cell_t c;

double A_inter3;

int phase_domain_index = 1.;
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];

C_UDMI(c,t,0) = NV_MAG(C_VOF_G(c,ppt)) ;


Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);

}

}
Anshs is offline   Reply With Quote

Old   September 15, 2020, 13:07
Default
  #2
New Member
 
Sharey
Join Date: Jul 2020
Posts: 4
Rep Power: 5
Sharey is on a distinguished road
May be you can check this one (in the attachment):
As per code, the vapor phase is primary phase with index assigned 0
and water is secondary phase with assigned index 1.
Attached Files
File Type: c MassSourceFinal.c (4.2 KB, 25 views)
Sharey is offline   Reply With Quote

Reply

Tags
fluent, mass transfer, multiphase, species transfer, udf


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
Species mass transfer UDF Anshs Fluent UDF and Scheme Programming 38 August 18, 2022 20:30
Coupled Heat and Mass Transfer Mecroob OpenFOAM Running, Solving & CFD 1 July 12, 2020 19:24
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT subhankar_bhandari FLUENT 0 August 19, 2010 03:01
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT subhankar_bhandari Main CFD Forum 0 August 19, 2010 03:01


All times are GMT -4. The time now is 19:24.