CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   How to read data in DEFINE_SOURCE( ) from DPM? (http://www.cfd-online.com/Forums/fluent/39559-how-read-data-define_source-dpm.html)

Josh February 8, 2006 10:40

How to read data in DEFINE_SOURCE( ) from DPM?
 
I need to calculate particle concentration in DEFINE_SOURCE( ),but the DPM data all have p in their variables like P_MASS(p) which the DEFINE_SOURCE( )cannot recognize. How to solve this problem? Thanks a lot!

RoM February 8, 2006 11:25

Re: How to read data in DEFINE_SOURCE( ) from DPM?
 
particle concentration in kg/m3Cell = C_DPMS_CONCENTRATION(c,t)

RoM

Josh February 8, 2006 11:49

Re: How to read data in DEFINE_SOURCE( ) from DPM?
 
Thank you very much, Rom.

I use a UDF to solve electric field with the source defined by UDF. When I run the UDF, the following error occures:

iter time/iter chip-exec: charge_density: wrong return type: void udf function expected 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: ()

The UDF is shown below:

#include "udf.h" #define QM -5e-6 #define N 2500 DEFINE_SOURCE(charge_density,c,t,dS,eqn) { real density; density=QM*C_DPMS_CONCENTRATION(c,t)/C_VOLUME(c,t); printf("density", density); return density; }


All times are GMT -4. The time now is 00:37.