CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF to simulate one-way valves in ANSYS Fluent to prevent backflow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2021, 18:30
Default UDF to simulate one-way valves in ANSYS Fluent to prevent backflow
  #1
New Member
 
Viliam Kacerik
Join Date: Aug 2021
Posts: 1
Rep Power: 0
viliam_kacerik is on a distinguished road
Hello,

I am trying to simulate a transient simulation of a system in which fluid flows in tubes. The tubes include one-way valves (=check valves), which prevent backflow in the real life. Yet, I've been having issues with defining the boundary condition to prevent backflow. It is pretty clear to me that I have to apply a custom boundary condition (UDF) on an interior wall where the check valve would sit. Yet, being new to UDFs and programming in C, I do not know how to write such a UDF, even after referring to the Fluent UDF manual: http://www.pmt.usp.br/academic/marto...F%20Manual.pdf

For example, if the one-way valve should prevent backflow in the negative-Y direction (meaning allow flow in the positive-Y direction), the algorithm should resemble such:

For every time step;
If velocity_y < 0;
then velocity_y = 0;

A more refined version would be:

For every time step;
If pressure just before the check valve < pressure just after the check valve;
then velocity_y = 0;

Could you please help me write a UDF which I could apply onto an interior wall to act as a one-way valve to prevent backflow?

I will appreciate your help,

Kind regards,

Viliam
viliam_kacerik is offline   Reply With Quote

Old   August 26, 2021, 15:05
Default
  #2
Sun
Senior Member
 
Sun's Avatar
 
Join Date: Nov 2010
Posts: 103
Rep Power: 16
Sun is on a distinguished road
Hi,
I would say first check the outlet boundary conditions. Usually the backflow is caused by the BCs. If you are certain that the problem can only be resolved by an UDF. I'd suggest you start writing a very first version of it, and then you can post it here to get more help on improving it.
Sun is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Fluent from Python: UDF Compilation problems Ames Fluent UDF and Scheme Programming 5 November 16, 2020 07:12
UDF for coding CFD ANSYS FLUENT zuraidah rasep FLUENT 2 September 5, 2020 23:22
GHow to define UDF for Density in Ansys Fluent? and How to remove Error? Azim07 FLUENT 1 July 31, 2019 00:58
how to understand UDF in ansys fluent? sriyaz Fluent UDF and Scheme Programming 4 November 10, 2015 03:27
sinusoidal horizontal translation udf in ansys fluent shivshankarnair FLUENT 1 September 19, 2014 07:40


All times are GMT -4. The time now is 18:17.