CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2019, 10:35
Default Ansys Fluent UDF, Wall Average Temperature Depend On Inlet Velocity
  #1
New Member
 
ozge akbulbul
Join Date: Apr 2019
Posts: 2
Rep Power: 0
ozgeozge is on a distinguished road
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.
ozgeozge is offline   Reply With Quote

Old   April 15, 2019, 01:31
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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)
how it is possible to have this error and no error after compilation?
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
AlexanderZ is offline   Reply With Quote

Reply

Tags
ansys, fluent - udf, inlet velocity profile, temperature dependent


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 Off
Pingbacks are On
Refbacks are On


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 14:15
[Commercial meshers] Fluent3DMeshToFoam simvun OpenFOAM Meshing & Mesh Conversion 50 January 19, 2020 15:33
UDF velocity inlet. Different values (compile - Fluent) asking FLUENT 0 July 13, 2018 17:02
UDF inlet velocity profile mismatch with Fluent ChristineL Fluent UDF and Scheme Programming 15 November 25, 2016 06:45
Ansys Fluent 17 UDF Velocity Profile Update. Phil-M Fluent UDF and Scheme Programming 4 October 17, 2016 09:05


All times are GMT -4. The time now is 01:36.