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

UDF Error for defining 2D circular mass flow rate inlet type

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2019, 10:21
Default UDF Error for defining 2D circular mass flow rate inlet type
  #1
New Member
 
Roozbeh Shahvelayati
Join Date: Jul 2017
Posts: 3
Rep Power: 9
R.Velayati is on a distinguished road
Hi All!
I'm Using UDF, PROFILE_DEFINE Macro for defining an inlet. my inlet is a 2D circle and that flow comes out of it and I have an equation for its mass flow rate:
mass flow rate = 5 sin(3.14*t/10)
that "t" is the physical time. I used below UDF Code:
#include "udf.h"
#define PI 3.14159265
DEFINE_PROFILE(inlet_mass_Flow_rate,th,i)
{
face_t f;
double x;
x = RP_Get_Real("flow-time");
begin_f_loop(f,th)
{
F_PROFILE(f,th,i) = 0.5* sin(x*PI/10);
}
end_f_loop(f,th);
}
but I recieved floating point error. anybody has any advice?
R.Velayati is offline   Reply With Quote

Old   July 8, 2019, 01:54
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
try
Code:
#include "udf.h"

DEFINE_PROFILE(inlet_mass_Flow_rate,th,i)
{
face_t f;
real x;
x = RP_Get_Real("flow-time");
begin_f_loop(f,th)
{
F_PROFILE(f,th,i) = 0.5* sin(x*M_PI/10);
}
end_f_loop(f,th);
}
best regards
AlexanderZ 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
Inlet patch problems martyn88 OpenFOAM Running, Solving & CFD 6 April 21, 2017 19:34
Pressure Outlet Targeted Mass Flow Rate LuckyTran FLUENT 1 November 23, 2016 11:40
LES supersonic free jet martyn88 OpenFOAM 22 April 17, 2015 07:00
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 15:16
UDF for inlet mass flow rate rahulsuresh89 Fluent UDF and Scheme Programming 1 October 16, 2010 18:06


All times are GMT -4. The time now is 13:08.