|
[Sponsors] |
mass flux at adjacent cell to wall: Hertz-Knudsen-Schrage |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 20, 2020, 06:18 |
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 |
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) } } |
|
June 20, 2020, 16:14 |
Flux or Source
|
#2 |
Senior Member
|
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. |
|
June 21, 2020, 00:41 |
Wick-vapor interface
|
#3 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14 |
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) } } } |
|
June 21, 2020, 01:02 |
|
#4 |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14 |
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.
|
|
June 21, 2020, 01:05 |
|
#5 | |
Senior Member
Arun raj.S
Join Date: Jul 2011
Posts: 194
Rep Power: 14 |
Quote:
|
||
June 21, 2020, 16:12 |
Source and Flux
|
#6 |
Senior Member
|
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. |
|
|
|
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 |