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

UDF for heat flux at membrane in membrane distillation process

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2021, 00:58
Default UDF for heat flux at membrane in membrane distillation process
  #1
New Member
 
Gabriel Caetano
Join Date: Jan 2018
Posts: 1
Rep Power: 0
yacarioca is on a distinguished road
Hey! I'm working on the axisymmetric problem of a hollow fiber permeator for membrane distillation. I am trying to implement a UDF for computating the heat flux through the membrane due to water evaporation (water evaporates at the feed side and condenses at the permeate side). I have very little experience with UDFs and C language. I have come up with the following sketch, although I know there are MANY mistakes.

UDF for the feed side:

#include "udf.h"
#include "math.h"
#include "mem.h"
#define ID 4 /* id number of the permeate zone */
DEFINE_PROFILE(membrane_feed, t, i)
{
real x[ND_ND];
real y;
face_t f;
face_tp fp;
Thread *tp = Lookup_Thread(domain,ID);
begin_f_loop(f, t)
{
real ri = F_CENTROID(x, fp, tp);
real ro = F_CENTROID(x, f, t);
real ti = F_T(ri, tp);
real to = F_T(ro, t);
pi = exp(23.238 - ((3841 / (ti - 45))));
po = exp(23.238 - ((3841 / (to - 45))));
q = 0.0000002*(po - pi) * 2375000;
F_PROFILE(f,t,i) = -q;
}
end_f_loop(f, t)
}



UDF for the permeate side:

#include "udf.h"
#include "math.h"
#include "mem.h"
#define ID 5 /* id number of the feed zone */
DEFINE_PROFILE(membrane_permeate, t, i)
{
real x[ND_ND];
face_t f;
face_tf ff;
Thread *tf = Lookup_Thread(domain,ID);
begin_f_loop(f, t)
{
real ri = F_CENTROID(x, f, t);
real ro = F_CENTROID(x, ff, tf);
real ti = F_T(ri, t);
real to = F_T(ro, tf);
pi = exp(23.238 - ((3841 / (ti - 45))));
po = exp(23.238 - ((3841 / (to - 45))));
q = 0.0000002*(po - pi) * 2375000;
F_PROFILE(f,t,i) = q*0.45/0.725;
}
end_f_loop(f,t)
}


Basically I need a UDF that accounts for the vapor pressure difference across the membrane and I intend to do it through two boundary conditions (one at the membrane-feed face and the other at the membrane-permeate face). Could someone with more experience please help me?

My geometry is in the picture. The rotation axis is at the bottom. The lower layer stands for the permeate, the intermediate one, the membrane and the upper layer stands for the feed.

Geometry: https://ibb.co/hLPKtnP

yacarioca 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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Difficulty with UDF code for HEAT FLUX etudiant_IITB Fluent UDF and Scheme Programming 1 December 7, 2015 09:07
UDF for UDS flux gyf135 Fluent UDF and Scheme Programming 0 October 13, 2015 21:02
UDF for Heat Flux kishan kumar jaiswal FLUENT 4 April 21, 2014 19:01
mass transfer from fluids to membrane Peter FLUENT 0 August 2, 2002 15:27


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