I am trying to give user defined inlet in openfoam
i do have udf defined for fluent
here is the code
#include "udf.h"//file that contains definitions for define functions and fluent operations
#define PI 3.141592654
double t = (CURRENT_TIME*2-floor(CURRENT_TIME*2))/2; //t is the local time within each period
if(t <= 0.218)
F_PROFILE(f,th,i) = 0.5*sin(4*PI*(t+0.0160236));
F_PROFILE(f,th,i) = 0.1;
how can i convert and use it in openfoam
You can find an example of a user-defined velocity at a boundary in the video below.
The function defined there is a spatially varying one. Since yours is a temporal variation, you can refer to section 220.127.116.11, in the link below, to get an idea on how to define a function in OpenFOAM.