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

mass flux at adjacent cell to wall: Hertz-Knudsen-Schrage

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2020, 06:18
Default mass flux at adjacent cell to wall: Hertz-Knudsen-Schrage
  #1
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14
arunraj is on a distinguished road
Dear all,

I want to apply the attached mass flux equation to the cells near the wall. Could someone correct my code. I have successfully applied constant heat flux value near the wall. However, applying the function seems bit tricky. Here, Pv and Tv are the vapor pressure and temperature. Pi and Ti are the temperature adjacent to the wall. Pi is calculated from Clausius-Clapeyron equation.

#include "udf.h"
int boundaryID=78;
DEFINE_ON_DEMAND(on_demand_calc)
{
real sigma;
real R=8314.40;
real M=18.015;
real hfg=2406000;
real const;
real pi;
real ti;
real pstatic=C_P(c,t);
real poper=RP_Get_Float("operating-pressure");
real pv;
real tv=C_T(c,t);
real area;
face_t f;
cell_t c;
Domain *domain=Get_Domain(1);
Thread *t;
Thread *tf
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID)
{
begin_f_loop(f,t)
{
F_AREA(area,f,t);
area =NV_MAG(area);
pi=exp(((hfg*M)/R)*((1/373.0)-(1/C_T(c0,t0))))*101325.0;
ti=sqrt(C_T(c0,t0);
pv=pstatic+poper;
const=((2*sigma)/(1-sigma))*(1/sqrt(2*3.141592653589*(R/M)));
C_UDMI(F_C0(f,t),THREAD_T0(t),0)=(const*(((pv)/tv)-(pi/ti))))*area;
}
end_f_loop(f,t)
}
}
Attached Images
File Type: jpg mass flux.JPG (16.0 KB, 12 views)
arunraj is offline   Reply With Quote

Old   June 20, 2020, 16:14
Default Flux or Source
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
You cannot apply flux to the cells; you need to apply these as sources or apply at the faces instead of the cells. As far as the code is concerned, it is not applying anything; only calculating and storing in UDM. And no where is value of sigma being calculated. There is nothing called RP_Get_Float; use RP_Get_Real. There are many other syntactical mistakes in the code. It won't even compile.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   June 21, 2020, 00:41
Default Wick-vapor interface
  #3
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14
arunraj is on a distinguished road
Hi vinerm,
Thanks for your reply. I did things in a hurry. I have attached the corrected UDF. This is compiling successfully. However, I have some doubt. Can we use
C_P(c,t), C_T(c,t), RP_Get_Real("operating-pressure") in the star marked region below. Is this allowed?

thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID)
{
begin_f_loop(f,t)
{
*****
}
end_f_loop(f,t)
}



#include "udf.h"
int boundaryID=78;
DEFINE_SOURCE(massflux1,c,t,dS,eqn)
{
real mdot;
mdot=C_UDMI(c,t,0)/C_VOLUME(c,t);
return (mdot);
}
DEFINE_ON_DEMAND(on_demand_calc)
{
face_t f;
cell_t c;
cell_t c0;
Domain *domain=Get_Domain(1);
Thread *t;
Thread *t0;
real sigma=0.03;
real R=8314.40;
real M=18.015;
real hfg=2406000;
real pi;
real ti;
real pstatic=C_P(c,t);
real poper=RP_Get_Real("operating-pressure");
real pv;
real tv;
real A[ND_ND];
real area;
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=0;
}
end_c_loop(c,t)
}
thread_loop_f(t,domain)
{
if (THREAD_ID(t)==boundaryID)
{
begin_f_loop(f,t)
{
c0=F_C0(f,t);
t0=THREAD_T0(t);
F_AREA(A,f,t);
area=NV_MAG(A);
pi=exp(((hfg*M)/R)*((1/373.0)-(1/C_T(c0,t0))))*101325.0;
ti=sqrt(C_T(c0,t0));
pstatic=C_P(c,t);
pv=pstatic+poper;
tv=C_T(c,t);
C_UDMI(c0,t0,0)=(((2*sigma)/(1-sigma))*(1/sqrt(2*3.141592653589*(R/M)))*((pv/tv)-(pi/ti)))*area;
}
end_f_loop(f,t)
}
}
}
arunraj is offline   Reply With Quote

Old   June 21, 2020, 01:02
Default
  #4
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14
arunraj is on a distinguished road
What do you mean by applying flux at face? Is it possible to apply flux without DEFINE_SOURCE. I thought DEFINE_SOURCE is the only way for this problem. I would like to know more about applying flux directly at the face. May be it is more relevant for my problem. I am not able to achieve the expected results using DEFINE_SOURCE. I will try both the methods simultaneously. Thank you for your kind help.
arunraj is offline   Reply With Quote

Old   June 21, 2020, 01:05
Default
  #5
Senior Member
 
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14
arunraj is on a distinguished road
Quote:
Originally Posted by vinerm View Post
You cannot apply flux to the cells; you need to apply these as sources or apply at the faces instead of the cells. As far as the code is concerned, it is not applying anything; only calculating and storing in UDM. And no where is value of sigma being calculated. There is nothing called RP_Get_Float; use RP_Get_Real. There are many other syntactical mistakes in the code. It won't even compile.
What do you mean by applying flux at face? Is it possible to apply flux without DEFINE_SOURCE. I thought DEFINE_SOURCE is the only way for this problem. I would like to know more about applying flux directly at the face. May be it is more relevant for my problem. I am not able to achieve the expected results using DEFINE_SOURCE. I will try both the methods simultaneously. Thank you for your kind help.
arunraj is offline   Reply With Quote

Old   June 21, 2020, 16:12
Default Source and Flux
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
DEFINE_SOURCE is NOT used for defining flux, but for source. Flux and source are different, though inter-convertible using Gauss' theorem. If you want to apply flux, use DEFINE_PROFILE.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 00:04
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 01:27
Velocity vector in impeller passage ngoc_tran_bao CFX 24 May 3, 2016 21:16
Radiation interface hinca CFX 15 January 26, 2014 17:11


All times are GMT -4. The time now is 02:46.