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

the difference of pressure calculated by fluent and udf

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2020, 08:42
Default the difference of pressure calculated by fluent and udf
  #1
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
I'm using incompressible ideal gas model,and when I use UDM to monitor the pressure,I find it is different from the value calculated by fluent's counter.I don't understand


Code:
#include"udf.h"                                                                                                     
#define H2 0
#define H2O 1
#define N2 2
#define O2 3
#define SO2 4
#define NUM_SPECS 5
#define R 8.31447
#define pi 3.14159
#define F 96485

DEFINE_DIFFUSIVITY(gas_diff,c,t,i)
{
	real v[4],y[4],Dkn[4],D[4][4];
	real M[4]={2e-3,18e-3,28e-3,32e-3};

	real tem=C_T(c,t);
    concen0=C_R(c,t)*C_YI(c,t,0)/M[0];     /*H2*/
    concen1=C_R(c,t)*C_YI(c,t,1)/M[1];     /*H2O*/
    concen2=C_R(c,t)*C_YI(c,t,2)/M[2];     /*N2*/
    concen3=C_R(c,t)*C_YI(c,t,3)/M[3];     /*O2*/
    concent1=concen0+concen1;               /*Anode*/                       
    concent2=concen2+concen3;               /*cathode*/                      
    p1=concent1*R*tem;                                             
    p2=concent2*R*tem;                                            
	C_UDMI(c,t,14)=p1;
	C_UDMI(c,t,15)=p2;
Here the mole fraction of SO2 is always zero,and there are H2 and H20(g)in the anode,N2 and O2 in the cathode, for additional explanation.
lbj007 is offline   Reply With Quote

Old   October 11, 2020, 09:04
Default
  #2
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
does it due to that fluent uses Density = P_operate/(R*T),it is a constant,and in udf the density is not a constant?
lbj007 is offline   Reply With Quote

Old   October 12, 2020, 07:44
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
not sure, but you may check it
macro to get operating pressure is
Code:
p_op = RP_Get_Real("operating-pressure");
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   October 12, 2020, 08:20
Default
  #4
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
not sure, but you may check it
macro to get operating pressure is
Code:
p_op = RP_Get_Real("operating-pressure");
but operating-pressure is the value you set in fluent,it is of course a constant..
lbj007 is offline   Reply With Quote

Old   October 20, 2020, 10:47
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
It might help if you share the value that fluent shows, and the value that your UDF shows.
pakk is offline   Reply With Quote

Old   October 21, 2020, 06:48
Default
  #6
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by pakk View Post
It might help if you share the value that fluent shows, and the value that your UDF shows.
I've already showed the picture.
lbj007 is offline   Reply With Quote

Old   October 22, 2020, 23:32
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by lbj007 View Post
I've already showed the picture.
I don't see any picture.
pakk is offline   Reply With Quote

Old   October 23, 2020, 09:40
Default
  #8
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by pakk View Post
I don't see any picture.
can you open: http://cdn.img.headns.com/2010/3934b2dcef76f.png
lbj007 is offline   Reply With Quote

Old   October 23, 2020, 13:26
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Very nice picture.

Now back to the topic: which value does fluent give, and which bakkie does your UDF give? You say they are different, shoe me the difference!
pakk is offline   Reply With Quote

Old   October 23, 2020, 23:55
Default
  #10
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Very nice picture.

Now back to the topic: which value does fluent give, and which bakkie does your UDF give? You say they are different, shoe me the difference!
what I've given you is fluent's value,and here is the udf's value:http://cdn.img.headns.com/2010/395056fbb492a.png
lbj007 is offline   Reply With Quote

Old   October 24, 2020, 00:12
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Looking at the minima: one says 101083 Pa, the other 101325 Pa. That is a difference of only 0.2%, very small.

So, what small inaccuracy do you have in your code? I think the values of the molecular weights.
lbj007 likes this.
pakk is offline   Reply With Quote

Old   October 24, 2020, 08:32
Default
  #12
Senior Member
 
Join Date: Feb 2020
Posts: 114
Rep Power: 6
lbj007 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Looking at the minima: one says 101083 Pa, the other 101325 Pa. That is a difference of only 0.2%, very small.

So, what small inaccuracy do you have in your code? I think the values of the molecular weights.
ok,I got it.Thanks
lbj007 is offline   Reply With Quote

Reply

Tags
post-processing, pressure, 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
how to put udf inlet velocity and udf outlet pressure in fluent raminostadi Fluent UDF and Scheme Programming 4 July 3, 2017 07:43
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
Calling zone name, zone id and total pressure from Fluent scheme to UDF kuldip Fluent UDF and Scheme Programming 2 October 6, 2014 01:23
Fluent 5.2, UDF and Pressure BC's Alfonso Ferrandez FLUENT 0 May 4, 2000 08:02


All times are GMT -4. The time now is 22:35.