|
[Sponsors] |
August 24, 2020, 10:40 |
mass transfer UDF not working, HELP.
|
#1 |
Member
Anshuman Sinha
Join Date: Oct 2018
Posts: 70
Rep Power: 8 |
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); } } |
|
September 15, 2020, 14:07 |
|
#2 |
New Member
Sharey
Join Date: Jul 2020
Posts: 4
Rep Power: 6 |
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. |
|
Tags |
fluent, mass transfer, multiphase, species transfer, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Species mass transfer UDF | Anshs | Fluent UDF and Scheme Programming | 38 | August 18, 2022 21:30 |
Coupled Heat and Mass Transfer | Mecroob | OpenFOAM Running, Solving & CFD | 1 | July 12, 2020 20:24 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT | subhankar_bhandari | FLUENT | 0 | August 19, 2010 04:01 |
Hooking a DPM Particle Heat and Mass Transfer UDF to FLUENT | subhankar_bhandari | Main CFD Forum | 0 | August 19, 2010 04:01 |