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

converting instructions of a wall to instructions of a domain

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By pakk
  • 1 Post By pakk
  • 1 Post By pakk

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 29, 2018, 10:20
Default converting instructions of a wall to instructions of a domain
  #1
Member
 
youhane kha
Join Date: Sep 2017
Posts: 36
Rep Power: 8
youhane is on a distinguished road
hello everybody,

Can any one help me please. I'm working with an UDF that makes the velocity inlet in a pipe varies with respect to the average temperature of a wall (THREAD_ID(t)==2 in my UDF).

The UDF works perfectly when the thread_id concerned is a wall, but when I change the wall by a surface (2d domain) by changing the THREAD_ID(t) in the code, Fluent generate this error:

Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

This is my udf code:

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity_profile, th, position)
{
Domain *d; /* declare domain pointer since it is not passed as an
argument to the DEFINE macro */
face_t f;
real tavg = 0.;
Thread *t;
real tempe,volume,vol_tot,area;

real A[ND_ND];

d = Get_Domain(1); /* Get the domain using Fluent utility */

/* Loop over all cell threads in the domain */
thread_loop_f(t,d)
{
/* only use thread with id=2 */
if (THREAD_ID(t)==2) {
/* Loop over all cells */
begin_f_loop(f,t)
{

tempe = F_T(f,t);
area=NV_MAG(A);

vol_tot += area;
tavg += (tempe*area);

}
end_f_loop(f,t)
tavg /= vol_tot;

}
}

begin_f_loop(f, th)
{
if ( tavg <= 298. )
F_PROFILE(f, th, position) = 0.5;
if ( tavg > 301.4 )
F_PROFILE(f, th, position) = 0.;
}
end_f_loop(f, th)
}
youhane is offline   Reply With Quote

 


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
Centrifugal fan j0hnny CFX 13 October 1, 2019 13:55
Periodic Pressure drop cfd_begin CFX 10 May 25, 2017 07:09
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field xiexing CFX 3 March 29, 2017 10:00
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 17:30
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00


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