UDF : derivate of density
hello cfd´ler !
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) |
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; thread_loop_c(thread,domain) { begin_c_loop(cell,thread) { /* ---- 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]; } end_c_loop(cell,thread) } } Haven't tried it - but might work! Greg |
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 16:11. |