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

How do I fix negative mass and face area?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2017, 06:56
Default How do I fix negative mass and face area?
  #1
New Member
 
Gene
Join Date: Mar 2017
Posts: 13
Rep Power: 9
gzsakuraz is on a distinguished road
Hi
I use face and cell loop and calculate the mass and area of the face and cell
I dont know why it show negative result according to printing on the console.

please help me

real A[ND_ND]; real area; real totalarea=0;

begin_f_loop(f,t){
t1 = THREAD_T0(t);
int ttt=THREAD_ID(t1);
c=F_C0(f, t);
if(ttt==40){
if(C_LIQF(c,t1)){
x=x+1;
if(C_UDMI(c,t1,0)<C_VOLUME(c,t1)*C_R(c,t1))
F_AREA(A,f,t);/*area vector on the surface*/
area = NV_MAG(A);
totalmass2=C_VOLUME(c,t1)*C_R(c,t1)+totalmass2;
real mass = evaporate*area*current_time; /*in kg*/
totalmass = mass + totalmass;
totalarea = area+totalarea;
C_UDMI(c,t1,1)=C_UDMI(c,t1,1)+mass; /*collect cumulative mass*/
F_UDMI(f,t,2)=1; /*collect the position where heat flux must be applied*/
/*make sure sum not exceed*/
z=z+1; /*check the numbers of cell*/

}
}
}
gzsakuraz 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
To get the element face area using user fortran hwykim CFX 0 October 16, 2016 23:51
Having trouble adapting serial UDF to work in parallel muyuntao Fluent UDF and Scheme Programming 1 November 10, 2015 14:42
set BC mass-flow-inlet via UDF and via GUI perform different result sawa25 FLUENT 1 February 25, 2015 01:51
Mass flux for west, south, bottom cell face marcus Siemens 0 April 19, 2006 04:43
How to get specie mass fraction at a boundary face shuqin FLUENT 0 February 24, 2006 02:52


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