|
[Sponsors] |
UDF Error for defining 2D circular mass flow rate inlet type |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 5, 2019, 10:21 |
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 |
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? |
|
July 8, 2019, 01:54 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
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); } |
|
|
|
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 |