|
[Sponsors] |
UDF linking Adjust and Profile macro functions |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 28, 2015, 08:12 |
UDF linking Adjust and Profile macro functions
|
#1 |
New Member
Ramkumar
Join Date: Nov 2014
Location: pondicherry, India
Posts: 16
Rep Power: 12 |
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!!... |
|
Tags |
adjust function, profile-adjust macro, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ADJUST or PROFILE?? | gina | Fluent UDF and Scheme Programming | 0 | September 1, 2009 14:52 |
I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 12:29 |