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

how to perform condensation on a boundary face

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 20, 2011, 02:18
Exclamation how to perform condensation on a boundary face
  #1
New Member
 
mu lin
Join Date: Oct 2010
Posts: 8
Rep Power: 6
wwt650420 is on a distinguished road
hi, everyboby.
Recently I would like to use UDF to preform condensaion phenomenon on a boundary face.
And the model I used is a mixture model. In this model phase one is a multi-species gas which contains N2, CO2, O2, H2O, SO2, NO and a specifically defined condensable gas, phase two is the liquid condensation product due to condensation of that specifically defined gas.
The boundary condition is that phase one (i.e. mixture gas) flows into the space through the inlet with 10m/s, and phase two is zero.
When the mixture gas flows into adjacent cells of the boundary face, and if the condensation condition is satisfied, the specifically defined gas condenses.
The evaluation formula is w=rho*(pi-psi)/p.
rho is mixture gas density;
pi is condensable gas pressure in the adjacent cell;
psi is condensable gas saturation pressure dependence of cell temperature.
p is mixture gas pressure.

The following is my UDF:
#include "udf.h"
#include "dpm.h"
#include "sg_mphase.h"
#include "mem.h"
#include "sg.h"
#include "surf.h"
#include "cxiface.h"
#include "models.h"
# define dtube 51.e-3
/***********************************************/
/***********mass transfer coefficient******************/
/***********************************************/
DEFINE_MASS_TRANSFER(source,cell,thread,from_index ,from_species_index, to_index, to_species_index)
{
real mc=0.;
real wendu, density, niandu, usudu, vsudu, uv, shijisudu, reshu, scshu, shshu, dliusuanna, km, liusuannaflux;
real A[ND_ND],ds,es[ND_ND],A_by_es,dr0[ND_ND];
real daa=15.03, dab= 37452., dac=0, pn=100000.;
real psi, pliusuanna, pgas;
Thread *gas = THREAD_SUB_THREAD(thread, from_index);
Thread *liq = THREAD_SUB_THREAD(thread, to_index);
Thread *liusuanna = THREAD_SUB_THREAD(thread,from_species_index);
cell_t c;
cell_t c0;
Thread *t0;
Thread *t;
face_t f;

t0=THREAD_T0(thread);
begin_f_loop(f,thread)
{
c0 = F_C0(f,thread);
BOUNDARY_FACE_GEOMETRY(f,thread,A,ds,es,A_by_es,dr 0);
density=C_R(c0,gas);
wendu=C_T(c0,gas);
psi=pn*exp(daa-dab/(wendu+dac));
pliusuanna=C_P(c0,liusuanna);
pgas=C_P(c0,gas);
/*the following functions are used to evaluate some important data for myself*/
niandu=4.4184*(pow(10,-7))*(pow(C_T(c0,gas),0.66666667));
usudu=C_U(c0,gas);
vsudu=C_V(c0,gas);
uv=pow(usudu,2)+pow(vsudu,2);
shijisudu=pow(uv,0.5);
reshu=C_R(c0,gas)*shijisudu*dtube/niandu;
scshu=niandu/C_R(c0,t0)/dtube;
shshu=0.3+0.62*pow(reshu,(1/2))*pow(scshu,(1/3))/pow(1+0.4/(pow(scshu,(2/3))),0.25)*pow((1+pow((reshu/282000),0.625)),0.8);
dliusuanna=1.7434*pow(10,(-9))*(pow(C_T(c0,gas),1.5));
km=shshu*dliusuanna/dtube;
if(wendu>1150)
{
if(pliusuanna>psi)
{
mc=(pliusuanna-psi)*pgas/density;
}
else
{
mc=C_R(c0,liusuanna);
}
}
else
{
mc=C_R(c0,liusuanna);
}
}
end_f_loop(f,thread)

return (mc);
}

when i compiled it, it works, and it is used to

Define-Phase-Interaction


but when i initialized it ,the error encountered:
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

I really do not know what is wrong with my UDF.
Maybe some thread is used in an inaccurate way?
Could some friends give me help?
Thank you very much!
And my email is wwt650420@sina.com.cn and wwtmwtd@hotmail.com.

Last edited by wwt650420; April 20, 2011 at 03:52.
wwt650420 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
Face ordering problem for nonrectangular cyclic boundary conditions cfdmarkus OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 August 17, 2011 15:07
How to define the velocity_inlet boundary condition with existed data for a face? Byron FLUENT 4 September 4, 2010 03:47
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 02:54


All times are GMT -4. The time now is 10:19.