CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   differential pressure UDF (

Phil August 20, 2004 09:13

differential pressure UDF

i want to write a udf which defines the motion of a piston. the motion depends on the differential pressure across the piston. I have used the following code previously when the piston has had a planar face and there has been no pressure on the other side of the piston. Can anyone tell me if this will take into account the direction in which the force is acting and do if i use it on the two sides of a piston will it calculate the force from the differential pressure?

#if !RP_NODE force = 0.0; begin_f_loop (f, t)


real *AA;

AA = F_AREA_CACHE (f, t);

force += F_P (f, t) * AA[0];

} end_f_loop (f, t)

# if RP_2D if (rp_axi)

force *= 2.0 * M_PI; # endif

Phil August 20, 2004 10:10

sorry wrong forum

All times are GMT -4. The time now is 05:48.