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

UDF for charge density parameter

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2020, 15:30
Default UDF for charge density parameter
  #1
New Member
 
Alex
Join Date: May 2019
Posts: 2
Rep Power: 0
ofsavier is on a distinguished road
Hello, i'm trying to use UDF for charge density of inert particles. I'm using MHD module and DPM.
When using discrete phase sample on reports (particle tracks for example) i see error:
Error at Node 2: get_udf_function: function charge_density_macro has wrong type: 2! = 46.

It happened even with simple code like i used last time:

#include "udf.h"
DEFINE_DPM_PROPERTY(charge_density_macro, c, t, p, T)
{
real charge_density;
charge_density = -1;
return charge_density;
}

I know, error means that i'm using wrong type of udf for this parameter, but i wonder what i do wrong...
P.S. If i use interpreted , here is no mistake. That erroe happenes only when i use compiled code (i need to use compiled for main code)

Last edited by ofsavier; August 22, 2020 at 07:42.
ofsavier is offline   Reply With Quote

Old   August 24, 2020, 00:26
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
I've compiled this code without any error

Are you sure you can define negative density?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
mhd, udf


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 for modifying density of mixture phase during the calculating process sola86 Fluent UDF and Scheme Programming 2 May 28, 2019 09:24
confusion on how to write udf for density of a mixture solution in multiphase problem Hirakjyoti Fluent UDF and Scheme Programming 1 September 11, 2017 01:21
Density UDF Divergence Baden Fluent UDF and Scheme Programming 0 January 11, 2017 15:25
UDF for solid density gghazal Fluent UDF and Scheme Programming 3 November 13, 2012 03:10
UDF: Density Cell Gradient Vector Macros matteo FLUENT 0 December 1, 2007 12:14


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