|
[Sponsors] |
October 19, 2022, 09:33 |
UDF for gradient of VOF fonction
|
#1 |
New Member
Join Date: Oct 2022
Posts: 12
Rep Power: 4 |
Dear sir, i hope this mail find you good , I am working on a two-phase (gas-liquid) flow problem using the VOF method. I need to calculate the vof gardient (both magnitude and three componants vector) to use them in define source terms, i'm using DEFINE_ADJUST to store vof gradient in UDMIS, but I get errors when interpreting th UDF , : Scalar_Reconstruction undeclared variable;
DEFINE_ADJUST(adjust_gradient_heat, domain) { Thread *t; Thread **pt; cell_t c; int phase_domain_index = 1.0; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,phase_domain_index); { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); 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) = C_VOF_G(c,ppt)[0]; C_UDMI(c,t,1) = C_VOF_G(c,ppt)[1]; C_UDMI(c,t,2) = C_VOF_G(c,ppt)[2]; C_UDMI(c,t,3) = sqrt(C_UDMI(c,t,0)*C_UDMI(c,t,0) + C_UDMI(c,t,1)*C_UDMI(c,t,1) + C_UDMI(c,t,2)*C_UDMI(c,t,2)); // magnitude of gradient of volume fraction C_UDMI(c,t,4) = C_UDMI(c,t,0)/C_UDMI(c,t,3); // nx -> x gradient of volume fraction divided by magnitude of gradient of volume fraction C_UDMI(c,t,5) = C_UDMI(c,t,1)/C_UDMI(c,t,3); // ny -> y gradient of volume fraction divided by magnitude of gradient of volume fraction C_UDMI(c,t,6) = C_UDMI(c,t,2)/C_UDMI(c,t,3); // nz -> z gradient of volume fraction divided by magnitude of gradient of volume fraction } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
Vof udf | malay | Fluent UDF and Scheme Programming | 9 | May 26, 2014 14:13 |
VOF UDF unsteady inlet/outlet | danielvhm | Fluent Multiphase | 1 | January 30, 2014 11:32 |
Vof, udf and mass transfer panel | Jay | FLUENT | 1 | March 15, 2005 01:29 |
UDF sourse term for VOF equation | ROOZBEH | FLUENT | 5 | April 22, 2003 07:56 |