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

Using input parameters (velocity inlet) in UDFs - bad UDF?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 13, 2018, 18:17
Default Using input parameters (velocity inlet) in UDFs - bad UDF?
  #1
New Member
 
Justin
Join Date: Feb 2017
Posts: 4
Rep Power: 9
student_1994 is on a distinguished road
Hi, I am running simulations in volume averaged porous media simulations for various inlet speeds (0.01, 0.02, 0.03...0.15, 0.2 m/s). I am interpreting a UDF with two parts - the first part is for the interfacial heat transfer coefficient (which I have gotten to work without any problems). In the second part of the UDF, I am trying to modify fluid thermal conductivity based on inlet velocity. I made it a parameter for UDFs (went to user-defined tab, parameters, more, use in UDF, select input parameter, clicked the parameter "inlet_vel", define, print (which gives id-to-be-used-in-udf as "real-1"). Then, I go to the same user-defined tab, go to functions, interpreted UDFs, and interpret my UDF. It interprets without any issue. Then, I go to the materials and change fluid thermal conductivity to user-defined "thermal_conductivity_w_dispersion." I run the initialization, which is sometimes where the error arises (at other times, initialization works, but the exact same thing happens). The error causes fluent to crash. The error it gives is (from a screen cap):

"Error at node 2: chip: internal error: invalid builtin -4: pc = 26
Error at node 3: chip: internal error: invalid builtin -4: pc = 26
Error at node 7: chip: internal error: invalid builtin -4: pc = 26
MRI application rank 0 exited before MPI-Finalize() with status 2"

In the code, when I comment in "inlet_vel = 0.1;" instead of "in_vel = RP_Get_Input_Parameter("real-1");" The code when using it equal to 0.1 instead of calling the input parameter works without crashing fluent, so I'm pretty confident that this line is wrong.

Here is my code in its entirety:

#include "udf.h"

DEFINE_PROPERTY(thermal_conductivity_w_dispersion, c, t)
{
real in_vel, inlet_vel, dens, visc, cp, k_with_dispersion, cond_f, rho, permeability, k_fluid;
in_vel = RP_Get_Input_Parameter("real-1");
/*inlet_vel = 0.1; */
permeability = 8.3670e-8; /*Permeability imputted manually*/
cond_f = 0.6; /*Conductivity fluid*/
dens = 1000; /*Density of fluid*/
visc = 0.00001; /*Viscosity fluid*/
cp = 4182; /*Specific heat fluid*/

/*k_with_dispersion = 1.3;*/
k_with_dispersion = cond_f+1*dens*cp*pow(permeability, 0.5)*in_vel;
return k_with_dispersion;
}

DEFINE_PROFILE(h_sf_5PPI_1,t,i)
{
cell_t c;
real vel;

begin_c_loop(c,t)
{
vel = ND_MAG(C_U(c,t),C_V(c,t),C_W(c,t));
F_PROFILE(c, t, i) = 56985.2*pow(vel, 0.67);
}
end_c_loop(c,t)
}

Any suggestions would be appreciated.
student_1994 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
Transient Velocity Inlet (2d synthetic jet) UDF akulagr Fluent UDF and Scheme Programming 4 October 18, 2018 01:31
Problem using UDF for velocity inlet panasonic18 Fluent UDF and Scheme Programming 2 June 13, 2018 02:59
2D UDF for inlet y velocity Keyu Fluent UDF and Scheme Programming 1 April 26, 2016 05:01
UDF to set velocity and pressure in inlet GerardX89 Fluent UDF and Scheme Programming 0 July 16, 2012 10:15
UDF paraboloid velocity inlet Ronak Shah FLUENT 0 June 4, 2003 09:44


All times are GMT -4. The time now is 03:43.