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

UDF Pressure

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2016, 06:22
Default UDF Pressure
  #1
New Member
 
scool
Join Date: Feb 2016
Posts: 5
Rep Power: 10
NewFluent is on a distinguished road
Hello,
I have a problem with my UDF (Execut-on-demand) after compiling and interprets it is not execut, and i have this message:
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 my Udf
**************************************************/
#include "udf.h"
DEFINE_ON_DEMAND(my_adjust)
{
int ID=4;
Domain *domain;
Thread *t = Lookup_Thread(domain, ID);
real x[ND_ND];
cell_t c;
face_t f;
domain=Get_Domain(1);

thread_loop_c(t,domain)
{
begin_c_loop(c,t)
if (C_P(c,t)<0)
{C_P(c,t)=0;}
end_c_loop(c,t)
}
thread_loop_f(t,domain)
{
begin_f_loop(f,t)
if (F_P(f,t)<0)
{F_P(f,t)=0;}
end_f_loop(c,t)
}
}
/***********************************************/

Last edited by NewFluent; February 25, 2016 at 11:20.
NewFluent is offline   Reply With Quote

Old   February 24, 2016, 15:36
Default urgent
  #2
New Member
 
scool
Join Date: Feb 2016
Posts: 5
Rep Power: 10
NewFluent is on a distinguished road
Dear all,
In my simulation, I want to modify the pressure in to domain film when the pressure is negative then the pressure equal a zero.
NewFluent is offline   Reply With Quote

Old   February 29, 2016, 17:57
Default
  #3
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
You need to initialise 'domain' before calling it with the Lookup_Thread macro, for example:

Code:
int ID=4; 
Domain *domain = Get_Domain(1);
Thread *t = Lookup_Thread(domain, ID);
`e` is offline   Reply With Quote

Reply


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 to adjust pressure outlet a.lynchy FLUENT 4 February 15, 2021 00:50
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
sonicFoam - pressure driven pipe: flow continuity violation and waveTransmissive BC Endel OpenFOAM Running, Solving & CFD 3 September 11, 2014 16:29
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 11:35
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15


All times are GMT -4. The time now is 08:20.