CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Momentum by force equation in UDF (https://www.cfd-online.com/Forums/fluent-udf/125068-momentum-force-equation-udf.html)

tom634 October 18, 2013 05:14

Momentum by force equation in UDF
 
Hello,

I am simulating a wall by momentum equations in Cell Zone Conditions. The flow is stationary.
I have the force given by equation like:
F=c*uxn
Where:
F - force vector
c - constant
u - velocity vector
n - wall normal vector
Force generally is F=momentum/time derivative.
So, my question is, how to provide time in UDF in steady/stationary flow?

For example for X direction of flow I would have something like:
Lx=c*ux*nx
and I have to convert the force into momentum, so I would need to derive by time:
Lx/dt=Mx=c*ux*nx/dt

Code:

#include "udf.h"

DEFINE_SOURCE(name,c,t,dS,eqn)
{
real c, x_vel, L, source, n;
c=5;
x_vel=C_U(c,t);
u=x_vel;
n=2;

L=c*u*n;
source=L/dt;

return source;

}

My question is how to write line:
Code:

source=L/dt;
in a proper way?

Thank you for help!


All times are GMT -4. The time now is 04:27.