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

C_P(c,t) is giving incorrect values.

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 20, 2012, 16:10
Default C_P(c,t) is giving incorrect values.
  #1
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 5
Hershey is on a distinguished road
Hello all,

I have been struggling with this problem in my UDF. I am working on getting density to be a function of "Static Pressure". I have read that C_P(c,t) is supposed to give me static pressure relative to the operating pressure set. I interpret that as:

C_P(c,t) = Static Pressure - Operating Pressure

So in my UDF I define Pressure to be:

P = C_P(c,t)+RP_Get_Real("operating-pressure")

However when I include a Message Statement to printout the values of pressure, I get values that are anywhere between -7000000 to 7000000. I need my static pressure to be around 100 Pa in order for my equation to work.

Does anyone have suggestions as to how I should handle C_P(c,t)?

Density is changing with pressure in a manner similar to:

rho = rho_initial/(1+c/P)

where c is a value changing with time.
Hershey is offline   Reply With Quote

Old   October 20, 2012, 16:29
Default
  #2
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 5
Hershey is on a distinguished road
As I initialize the solution (even using a UDF DEFINE_INIT) to make the entire domain 100 Pa, the Message printout which is:

Message("Pressure:%d\n",P);

Keeps displaying zero.

If I run a quick contour plot, the static pressure is 100 Pa.

The solution immediately diverges at the beginning of the simulation because if Pressure is equal to zero, then obviously density is being divided by zero from how I have it defined.
Hershey is offline   Reply With Quote

Old   July 28, 2015, 22:33
Default
  #3
New Member
 
New South Wales
Join Date: May 2015
Location: UNSW, NSW, Sydney
Posts: 11
Rep Power: 2
mac_09 is on a distinguished road
Hi,

Do you solve this issue?

I am facing the similar problem.

Thanks

Regards:
MAC
mac_09 is offline   Reply With Quote

Old   July 28, 2015, 23:26
Default
  #4
Member
 
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 5
Hershey is on a distinguished road
Hello MAC,

Yes, I did solve my issue. There was a problem with another part of my code which gave incorrect values.

To properly use static pressure you should have in your UDF:

real P_absolute;
real P_operating = RP_Get_Real("operating-pressure");

P_absolute = C_P(c,t)+P_operating;

The implementation obviously depends on what your UDF looks like. If you attach it, I can try to take a look at it.
Hershey is offline   Reply With Quote

Reply

Tags
c_p, density, pressure, static, udf

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
Retrieving boundary patch values adjacent to a given cell brooksmoses OpenFOAM Post-Processing 2 December 8, 2008 11:00
DieselEngineFoam stefanke OpenFOAM Pre-Processing 42 December 3, 2008 23:53
Plotting raw data values Wilesco CD-adapco 0 January 5, 2006 06:34
Mass Flux values and calculations Cb CD-adapco 1 January 22, 2005 10:21
node based or cell centered Ts values acboge FLUENT 0 February 6, 2004 07:41


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