|
[Sponsors] |
Floating point while Run Calculation because using UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 1, 2022, 08:55 |
Floating point while Run Calculation because using UDF
|
#1 |
New Member
Imam Tantowi
Join Date: Jul 2022
Posts: 1
Rep Power: 0 |
Hello every one.
Sorry take your time. here, I want to request your help to solving my simulation problem. Now, I am simulating cooling process of grain. the fluid medium of cooling is moist air. because I want to know temperatur and moisture content of grain, I initiate to model this problem with eulerian multhiphase in ANSYS Fluent. I model the moist air as mixture of air and water vapor, and grain as mixture of dry grain dan water liquid. Because of that, mass transfer UDF has build to describe a moisture transfer phenomena. this is my UDF Code:
#include "udf.h" #include "mem.h" #include "sg_mphase.h" #include "math.h" static real EMC(cell_t c, Thread *tu, int v) /*this function to know Equilibrium moisture content*/ { real MMwl, R_bar; MMwl=18.02; /*Molecular weight of water*/ R_bar=8314.47; real pv; pv=C_R(c,tu)*C_YI(c,tu,v)*R_bar*C_T(c,tu)/MMwl; real RH,emc,pg; pg=610.78*exp(17.296*(C_T(c,tu)-273.15)/(237.3+C_T(c,tu)-273.15)); RH=pv/pg; emc=pow(-1*log(1-RH)/(8.654*pow(10,-5)*(C_T(c,tu)-273.15+49.81)),1/1.8634); emc=emc/100; return emc; } static real masstf_coeff(cell_t c, Thread *tj,Thread *tu) { real h,Sh; real Dv=2.6*pow(10,-5); /*mass diffusivity of air*/ real bul=0.6; /*roundness of grain */ real d=C_PHASE_DIAMETER(c,tj); /*grain's diameter*/ real NV_VEC(v), vel, Re, Sc,Ai,vof; NV_DD(v,=,C_U(c,tj),C_V(c,tj),C_W(c,tj),-,C_U(c,tu),C_V(c,tu),C_W(c,tu)); vel=NV_MAG(v); vof=C_VOF(c,tj); Ai=6*vof/(d*bul); Re=C_R(c,tu)*vel/(C_MU_L(c,tu)*Ai*bul); Sc=C_MU_L(c,tu)/(C_R(c,tu)*Dv); Sh=2+0.552*pow(Re,0.5)*pow(Sc,1/3); h=Sh*Dv/d; return h; } DEFINE_MASS_TRANSFER(pengeringan_source,c,t,j,l,u,v) { real mdot=0; Thread *jg=THREAD_SUB_THREAD(t,j); Thread *udr=THREAD_SUB_THREAD(t,u); real X,Xeq,h; X=C_YI(c,jg,l)/(1-C_YI(c,jg,l)); real bul=0.6; /*kebulatan*/ real d=C_PHASE_DIAMETER(c,jg); /*Grain diameter*/ real vof=C_VOF(c,jg); /*volume fraction of grain*/ real Ai,A; Ai=6*vof/(d*bul); /*interfacial area*/ h=masstf_coeff(c,jg,udr); Xeq=EMC(c,udr,v); mdot=h*Ai*(X-Xeq); return mdot; } Regard Imam |
|
Tags |
regard imam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sloshingTank3D6DoF failed to run in parallel | phsieh2005 | OpenFOAM Running, Solving & CFD | 1 | May 19, 2023 00:51 |
Floating point exception error when rotate the geometry | zyfsoton | OpenFOAM Running, Solving & CFD | 1 | June 20, 2022 06:49 |
[foam-extend.org] foam-extend 3.2 on Ubuntu 12.04, Floating point exception for tutorials | arsalan.dryi | OpenFOAM Installation | 7 | November 14, 2016 18:33 |
Floating point exceptions with own modified k-omega SST with Reboud's correction | A_Pete | OpenFOAM Programming & Development | 3 | October 18, 2016 02:45 |
[snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 15:07 |