CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   lumped parameter udf-include pressure profile (http://www.cfd-online.com/Forums/fluent-udf/107745-lumped-parameter-udf-include-pressure-profile.html)

Lilly October 5, 2012 11:59

lumped parameter udf-include pressure profile
 
Dear all,

I want to use a lumped paramter outflow boundary condition for my coronary artery geometry and need to additionaly implement the pressure of the left ventricle there. I am working at writing a udf for this problem and thought of including a profile of this form (one of the normal profiles you can read with "File->Read->profiles"):
((pressure transient 10 1)
(time ....)
(pressure ....))
Is it possible to include it in a normal udf and how can I do this?
Thanks a million for any help and idea!
Lilly

Lilly October 8, 2012 06:59

lumped parameter udf-udf function in certain range
 
I just wanted to add something:
Maybe I could also implement another udf inside the lumped parameter udf describing the pressure profile instead of using a "point profile".
But my problem is: my profile should be periodic, that means it should start at 0s and it's duration should 1s and afterwards it should just start again from the beginning (This should go like this for about 50 times). Since it is a fit function, only the values of the function in a certain range (0-1s) are interesting for me. Is there a way to define this?
Thanks a million for any help and ideas!
Lilly

Krishna prasad May 19, 2015 05:21

Quote:

Originally Posted by Lilly (Post 385504)
I just wanted to add something:
Maybe I could also implement another udf inside the lumped parameter udf describing the pressure profile instead of using a "point profile".
But my problem is: my profile should be periodic, that means it should start at 0s and it's duration should 1s and afterwards it should just start again from the beginning (This should go like this for about 50 times). Since it is a fit function, only the values of the function in a certain range (0-1s) are interesting for me. Is there a way to define this?
Thanks a million for any help and ideas!
Lilly

sir as part of my btech project on "numerical simulation of blood flow analysis" on left coronary descending artery using fluent as analysis software I have to write blood velocity udf. I wrote it as following but when I run it on fluent it was observed that "parse error" Anyone please help us to solve this problem

#include "udf.h"//file that contains definitions for define functions and fluent operations
#define PI 3.141592654

DEFINE_PROFILE(inlet_velocity,th,i)
{
face_t f;
begin_f_loop(f,th)
double t = (CURRENT_TIME*2-floor(CURRENT_TIME*2))/2; //t is the local time within each period

{
if(t <= 0.015)
F_PROFILE(f,th,i) = (.0003-.03t)/.02;
else if((t >.015)&&(t<=.02))
F_PROFILE(f,th,i) = (t-19.999)/333.33;
else if((t >.02)&&(t<=.285))
F_PROFILE(f,th,i) = .085*sin((10.375*t)-.2075);
else if((t >.285)&&(t<=.325))
F_PROFILE(f,th,i) = (-28.33*t*t)+(20.3563*t)-3.4679;
else if((t >.325)&&(t<=.47))
F_PROFILE(f,th,i) = (-2.7037*t*t)+(2.1696*t)-.2646;
else if((t >.47)&&(t<=1))
F_PROFILE(f,th,i) = (.0206*t*t)-(.2995*t)+.2939;
}
end_f_loop(f,th);
}

pakk May 19, 2015 11:22

It would help if you are more exact on the error that you get.
Probably you don't just get "parse error", but something like "parse error on line 12", which tells you to look carefully at line 12.

Anyway, you have a problem in your line 12:

Code:

F_PROFILE(f,th,i) = (.0003-.03t)/.02;
.03t is not the same as 0.03*t.

Krishna prasad May 22, 2015 22:15

Quote:

Originally Posted by pakk (Post 546905)
It would help if you are more exact on the error that you get.
Probably you don't just get "parse error", but something like "parse error on line 12", which tells you to look carefully at line 12.

Anyway, you have a problem in your line 12:

Code:

F_PROFILE(f,th,i) = (.0003-.03t)/.02;
.03t is not the same as 0.03*t.

thank you sir, I could correct my udf that also worked in fluent well. Thank you dear Mr pakk for you valuable suggestion. :)
:)


All times are GMT -4. The time now is 17:37.