CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   correct UDF code for unsteady pressure boundary (https://www.cfd-online.com/Forums/fluent/38469-correct-udf-code-unsteady-pressure-boundary.html)

 James W November 2, 2005 12:38

correct UDF code for unsteady pressure boundary

I am trying to set the pressure on a pressure outlet boundary on a 3d pipe. The pressure is a pressure wave.

the magnitude of the pulse when measured using a monitor point by fluent is less than that calculated by the UDF.

I have my suspicions that the problem maybe due to the UDF code. Especially the section where it loops over the boundary - should this be different in 2d and 3d?

I will admit i am not fully up to spead on the UDF code and have adapted some from a 2d example i seen in a tutorial.

I have included the code below. If its not this then any other ideas, using the RSM model. unsteady coupled solver, 10 iterations per timestep. convergence seams good.

#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position) {

float t, pressure; face_t f;

/* Get real flow time from fluent using RP_Get_Real command*/

t = RP_Get_Real("flow-time");

/* Set pressure dependant on time for pulse duration */

if (t<=0.00821) { pressure = 60000*sin(3.14159*t/0.00821); } else { pressure = 0; }

/* loop over the whole boundary condition */

begin_f_loop(f, thread) {

F_PROFILE(f, thread, position) = pressure; } end_f_loop(f, thread)

}

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