CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF linking Adjust and Profile macro functions

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 28, 2015, 07:12
Default UDF linking Adjust and Profile macro functions
  #1
New Member
 
Ramkumar
Join Date: Nov 2014
Location: pondicherry, India
Posts: 2
Rep Power: 0
Ramkumar21194 is on a distinguished road
hi friends, i am a bit new to UDFs in fluent. now iam trying to link the adjust macro with profile so that the boundary condition can be adjusted, but i dont know how to do that. The following is my code to adjust velocity boundary condition:

#include<udf.h>
DEFINE_PROFILE(velocity_inlet,thread,equation)
{
face_t f;
float v=50;
begin_f_loop(f,thread)
{
F_PROFILE(f,thread,equation)=v;
}
end_f_loop(f,thread)
}
DEFINE_ADJUST(velocity_variation_execution,domain)
{
face_t f;
Thread *thread_inlet=Lookup_Thread(domain,12);
Thread *thread_outlet=Lookup_Thread(domain,14);
int i=0;
float v=0,velocity_outlet=0,velocity_inlet=0;
begin_f_loop(f,thread_outlet)
{
v+=F_U(f,thread_outlet);
i++;
}
end_f_loop(f,thread_outlet)
velocity_outlet=v/i;
v=0;i=0;
begin_f_loop(f,thread_inlet)
{
v+=F_U(f,thread_inlet);
i++;
}
end_f_loop(f,thread_inlet)
velocity_inlet=v/i;
if(velocity_outlet<300 && velocity_outlet!=0)
{
F_PROFILE(f,thread_inlet)=velocity_inlet+5;
}
else
{
return;
}
}

if above code is interpreted and run the solver, an error showing "Segmentation violation " within first iteration. could any one please help me with this?..if possible, show me a simple program using adjust macro to change the inlet velocity based on outlet velocity in a convergent nozzle......thanks in advance!!...
Ramkumar21194 is offline   Reply With Quote

Reply

Tags
adjust function, profile-adjust macro, 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
ADJUST or PROFILE?? gina Fluent UDF and Scheme Programming 0 September 1, 2009 13:52
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29


All times are GMT -4. The time now is 03:58.