|
[Sponsors] |
January 2, 2023, 16:47 |
Problem with Define_Profile
|
#1 |
New Member
Roy King
Join Date: Jan 2023
Posts: 1
Rep Power: 0 |
Hello,
I created the following udf to calculate the velocity at the outlet(define adjust) and then take that value and apply it to the inlet(define profile). My problem is the define profile seems to run at the same time as define adjust so the define profile is taking the initialized value of 0 and applying it at the inlet. To fix this I added an if statement, the calculated value is inputted into the define profile but now the begin f loop does not loop over the inlet. Any idea what is wrong? Thank you! (Also this is a compiled udf) DEFINE_ADJUST(vel_calc,fluid) { int zone_id = 7; Thread *outlet = Lookup_Thread(fluid, zone_id); face_t first; begin_f_loop(first, outlet) { v_out += F_U(first, outlet); iter = iter + 1.0; } end_f_loop(first, outlet) if (iter > 0.0) { v_out = v_out / iter; v_final = v_out; printf("Test 0.5=%f\n", v_final); } iter = 0; } DEFINE_PROFILE(vel_in, here, i) { if (v_final > 0.0) { face_t second; printf("\nTest 1= %f \n", v_final); begin_f_loop(second, here) { printf("Test 1.5= %f \n", v_final); F_PROFILE(second, here, i) = v_final; } end_f_loop(second, here) printf("Test 2= %f \n\n", v_final); } } |
|
Tags |
define_adjust, define_profile, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SU2-7.0.1 on ubuntu 18.04 | hyunko | SU2 Installation | 7 | March 16, 2020 05:37 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |