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

UDF fails to model 9.81m/s^2 gravity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 24, 2012, 17:44
Default UDF fails to model 9.81m/s^2 gravity
  #1
jpo
Member
 
Join Date: Apr 2009
Posts: 93
Rep Power: 7
jpo is on a distinguished road
Hello,

I tried to add a z-momentum source term to model constant gravity of 9.81 m/s^2. The UDF is below.
Gravity in operating conditions panel was turned off.

Then I removed the UDF and turned gravity on in operating conditions panel and set "operating density" to 0.


The UDF failed to model 9.81m/s^2 gravity. Would anyone know why?


UDF file>>>>>>
#include "udf.h"
DEFINE_SOURCE(gravity_source,c,t,dS,eqn)
{
/* VAR */
double xc[ND_ND];
double gravity;
double source;


/* BEGIN */
C_CENTROID(xc,c,t);
gravity = 9.81;
source = gravity*C_R(c,t); /*rho g */
return source;
}
jpo is offline   Reply With Quote

Old   January 24, 2012, 18:06
Default
  #2
Senior Member
 
Real Name :)
Join Date: Jan 2010
Location: United States
Posts: 178
Rep Power: 6
ComputerGuy is on a distinguished road
JPO,

First: think about posting udf-related questions in the UDF forum (http://www.cfd-online.com/Forums/fluent-udf/)

Next: how is it failing? What are the error messages?

ComputerGuy

Quote:
Originally Posted by jpo View Post
Hello,

I tried to add a z-momentum source term to model constant gravity of 9.81 m/s^2. The UDF is below.
Gravity in operating conditions panel was turned off.

Then I removed the UDF and turned gravity on in operating conditions panel and set "operating density" to 0.


The UDF failed to model 9.81m/s^2 gravity. Would anyone know why?


UDF file>>>>>>
#include "udf.h"
DEFINE_SOURCE(gravity_source,c,t,dS,eqn)
{
/* VAR */
double xc[ND_ND];
double gravity;
double source;


/* BEGIN */
C_CENTROID(xc,c,t);
gravity = 9.81;
source = gravity*C_R(c,t); /*rho g */
return source;
}
ComputerGuy is offline   Reply With Quote

Old   January 24, 2012, 18:15
Default
  #3
jpo
Member
 
Join Date: Apr 2009
Posts: 93
Rep Power: 7
jpo is on a distinguished road
ComputerGuy, Thank you for suggesting the UDF forum. I was not aware of it.

How it fails? - Residuals oscillate and do not converge... The same case without UDF (gravity is defined in the oper. conditions panel) converges well.
jpo is offline   Reply With Quote

Reply

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
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 11 December 21, 2013 04:50
udf: volume fraction gradient in eulerian model jwwang FLUENT 21 September 14, 2010 15:33
UDF: how to know domain number in the model? mssound FLUENT 0 May 17, 2010 15:00
UDF for defining granular viscosity in mixture model priyanka.asp FLUENT 0 March 25, 2010 13:32
How to access only one phase in multiphase model by UDF wersoe Fluent UDF and Scheme Programming 0 September 23, 2009 07:57


All times are GMT -4. The time now is 05:16.