CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

is it possible to define different mass diffusion coefficients in different zones?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2019, 21:24
Default is it possible to define different mass diffusion coefficients in different zones?
  #1
Senior Member
 
Weiqiang Liu
Join Date: Feb 2018
Posts: 278
Rep Power: 9
Weiqiang Liu is on a distinguished road
Hi all,

I am trying to define an effective mass diffusion coefficient in porous zone while the other fluid zone has mass diffusion coefficient calculated by kinetic theory.

L-J parameters are imported for every species to calculate binary diffusion coefficient and then mixture averaged or multi-component diffusion coefficients are calculated according to model utilized.

In the porous zone, the mass diffusion coefficient is a function of both molecular diffusion coefficient and knudsen diffusion coefficient. In other words, in non-porous zone, diffusion coefficients for every species are calculated by kinetic theory while in porous zone, diffusion coefficients for every species are a combination of molecular diffusion(kinetic theory) and knudsen diffusion coefficient. I wonder is this doable in fluent? I put my UDF code below though it can not be loaded with some errors.

Can anybody help me to check the code whether the logic and syntax is right?

#include "udf.h"
DEFINE_DIFFUSIVITY(mass_diff,c,t,i)
{
double dpore=20e-9;
double gasconstant=8.314;
double Dknudsen;
double T=300.0;
double pi=3.14;
double tortuosity=3.0;
double porosity=0.5;
double Deffective;
double Dmolecular;
int isp;
real mw;
Domain *domain;
Material *mix_mat,*sp;
domain=Get_Domain(1);
mix_mat=mixture_material(domain);
mixture_species_loop(mix_mat,sp,isp)
{
if(isp==i)
{
mw=MATERIAL_PROP(sp,PROP_mwi);
}
}
T=C_T(c,t);
Dmolecular=C_DIFF_EFF(c,t,i);
Dknudsen=dpore/3*sqrt(8*gasconstant*T/(pi*mw))
if(THREAD_ID(t)==ZONE_17)
Deffective=porosity/tortuosity*(1/(1/Dmolecular+1/Dknudsen));
else if(THREAD_ID(t)==ZONE_16)
Deffective=Dmolecular;
return Deffective;
}
Weiqiang Liu is offline   Reply With Quote

Reply

Tags
mass diffusivity, porous zone, 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
Define Diffusion Source Holagee Fluent UDF and Scheme Programming 3 April 5, 2019 03:06
Define udf for mass and energy source in cfx namandoshi CFX 1 April 20, 2018 12:26
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 23:29
mass diffusion and newton's second law mohsenclick Main CFD Forum 8 October 6, 2014 09:39
mass transfer through wall by passive diffusion hagar FLUENT 3 April 10, 2006 14:53


All times are GMT -4. The time now is 21:37.