CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF Source Term Units? (http://www.cfd-online.com/Forums/fluent/38351-udf-source-term-units.html)

Brian October 24, 2005 08:28

UDF Source Term Units?
 
I am trying to add a source term through a UDF to the x-momentum equations. I have a simple box with water on bottom/air on top. The source term is just an acceleration term to sway the fluid left/right in the x-direction. My units on the source term are m/s^2 (acceleration): -amplitude * frequency^2 * sin(frequency * time). Do I need to add in the density of the fluids as well? Here is my UDF:

#include "udf.h"

#define period 2.61799

#define amplitude 0.02

DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn) {

real source;

/* source term */

source =(-1.0*amplitude)*pow((2.0*M_PI/period),2.0)*C_R(cell,thread)*sin((2.0*M_PI/period)*CURRENT_TIME);

/* derivative of source term w.r.t. x-velocity. */

dS[eqn] = 0.0;

return source;

}

RoM October 24, 2005 09:15

Re: UDF Source Term Units?
 
The source term is correct. It will return a force by volume (N/m^3) which is the unit fluent wants.

Happy swaying

RoM


All times are GMT -4. The time now is 19:29.