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/)
-   -   Water hammer simulation in Fluent (https://www.cfd-online.com/Forums/fluent-udf/234961-water-hammer-simulation-fluent.html)

Parth0208 March 25, 2021 17:13

Water hammer simulation in Fluent
 
I am trying to simulate water hammer effect in a pipe.
The condition is that, when I close outlet for 2 sec, then water hammer should occur. I am simulating 2 water hammer effects in 30 secs.
from 0 to 13 sec the inlet velocity is 2 m/s, from 13 to 15 sec it is 0, from 15 to 28 it is again 2 m/s, then again from 28 to 30 sec it is 0 m/s.
For this I have tried to write IF statement in UDF, but it is showing error.
BCs: @Inlet: Pressure inlet, @Outlet: Velocity inlet, @Wall: wall

Function that I wrote:
IF(13[s]<=t&&t<=15[s], 0[m/s], 2[m/s])
IF(28[s]<=t&&t<=30[s], 0[m/s], 2[m/s])

Kindly help me.
thank you

Yasser April 2, 2021 21:50

I am assuming you have a typo in your boundary conditions ... but anyway, You don't need UDF .. you can use expression. If you want to use a UDF, you need to use DEFINE_PROFILE

Go to the UDF manual and look at the examples and try to modify one to fit your case. And if it doesn't work, bring it here and someone will help you for debugging


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