CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF : derivate of density (

D.Stratmann January 30, 2001 09:35

UDF : derivate of density
hello cfdler !

can anyone help me to create a user-defined-function ?

situation/case : since i want to compare my simulation results (using fluent) with schlieren-photography, i need to have another scalar for postprocessing.

i want to judge my results by postprocessing the change of density in x-coordinate : d(density)/dx.

best regards.

Dirk (university of dortmund, germany)

Greg Perkins January 31, 2001 22:33

Re: UDF : derivate of density
Try and copy the density into a user scalar and then copy the derivative of this to another location. If you do this within a DEFINE_ON_DEMAN will probable be easiest:

extern Domain *domain;

DEFINE_ON_DEMAND(Density_Grad) { Thread *thread; cell_t cell;





/* ---- copy deensity to UDS */

C_UDSI(cell,thread,0) = C_R(cell,thread);

/* --- store gradient d/dx in UDM */

C_UDMI(cell,thread,0) = C_UDSI_G(cell,thread,0)[0];



} }

Haven't tried it - but might work!


D.Stratmann February 2, 2001 04:02

Re: UDF : derivate of density
Many thanks to you, Greg.....

i will check it.

Best regards.............Dirk (university of dortmund, germany)

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