|
[Sponsors] |
Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 13, 2019, 11:35 |
Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity
|
#1 |
New Member
ozge akbulbul
Join Date: Apr 2019
Posts: 2
Rep Power: 0 |
Hello All,
I am trying to write "UDF fluent code" that wall average temperature condition depend on inlet velocity. I have the face which ID is 9 and its average temperature depend on inlet velocity. When face average temperature increases, inlet velocity increases each time step (transient). -I use fluent on serial -I use it on transient, energy on, viscous- k-eps or laminar -I have increased Number of user defined memory location -I have interperated my code as (kod.c) (which is has no error on command) -I have done that add function hooks on Execute at end as (execute_at_end) -I have added inlet velocity magnitude as (unsteady_velocity) When I run calculation, after one time step (for instance 10 or 20 iteration) I got error which is; which mean is I can't go through second time step. Error: received a fatal signal (Segmentation fault). Error Object: #f The code is; %%%%%%%%%%%%%%%%%%%%%%%%% #include "udf.h" real T_mean; DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *domain; Thread *thread; face_t face; real area[ND_ND]; real total_area = 0.0; real total_area_ave_temp = 0.0; int ID = 9; domain = Get_Domain(1); thread = Lookup_Thread(domain, ID); begin_f_loop(face, thread) F_AREA(area, face, thread); total_area += NV_MAG(area); total_area_ave_temp += NV_MAG(area)*F_T(face, thread); end_f_loop(face, thread) T_mean = total_area_ave_temp/total_area; printf("Area averaged T on boundary %d = %f K\n", ID, T_mean); } DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = (T_mean-273) ; } end_f_loop(f, thread) } %%%%%%%%%%%%%%%%%%%%%%%%%%%%% I would be grateful if I solve this problem with your helps, thank you very much Best regards. |
|
April 15, 2019, 02:31 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you've missed brackets here:
Code:
begin_f_loop(face, thread) { F_AREA(area, face, thread); total_area += NV_MAG(area); total_area_ave_temp += NV_MAG(area)*F_T(face, thread); } end_f_loop(face, thread) change printf to Message you have Error: received a fatal signal (Segmentation fault). Error Object: #f error, because your T_mean was not calculated, so you are trying to put -273 as a boundary condition, or any other trash by the way, check your units for temperature, by default fluent uses Kelvin best regards |
|
Tags |
ansys, fluent - udf, inlet velocity profile, temperature dependent |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF - Inlet Velocity Profile (Ansys Fluent) | vinayak4399 | Fluent UDF and Scheme Programming | 3 | August 25, 2020 15:15 |
[Commercial meshers] Fluent3DMeshToFoam | simvun | OpenFOAM Meshing & Mesh Conversion | 50 | January 19, 2020 16:33 |
UDF velocity inlet. Different values (compile - Fluent) | asking | FLUENT | 0 | July 13, 2018 18:02 |
UDF inlet velocity profile mismatch with Fluent | ChristineL | Fluent UDF and Scheme Programming | 15 | November 25, 2016 07:45 |
Ansys Fluent 17 UDF Velocity Profile Update. | Phil-M | Fluent UDF and Scheme Programming | 4 | October 17, 2016 10:05 |