CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF problem------How to get parameters of boundary condition in UDF? (https://www.cfd-online.com/Forums/fluent/234332-udf-problem-how-get-parameters-boundary-condition-udf.html)

Silence March 3, 2021 03:22

UDF problem------How to get parameters of boundary condition in UDF?
 
Hi everyone,
I encountered a problem when I was coding UDF.
Here is the background:
Figure 1 presents the model I put in Fluent, inlet was set as pressure inlet and corresponding value, shown in Figure 2, was input by a profile document(because of inlet pressure consists of discrete points. I want to exert an external force F on the bottom surface to push the surface to move along axis y, and the force F can be calculated by inlet pressure, for example,
F=2*Pi*Ab (1)
Where Pi is inlet pressure, Ab is area of bottom surface.
In UDF, we can use function to specify external force, such as external force command in macro DEFINE_SDOF_PROPERTIES(), or expected boundary condition, however, in my case, the load I want to exert on surface cannot be expressed by function, actually, it consists of numerous points.
My questions:
1. how to collect the inlet pressure as my data source?
There are two ways, I guess, can realize this goal, but I don’t know how to do and I am not sure if my suppose is right.
First method, reading the profile by UDF.
Second method, getting the pressure directly from inlet by UDF, do not need to reading the profile once more.
2. How to put the obtained data in function?
If both of these two methods can get the data, is it possible to set the obtained data as input(i.e. Pi) of equation (1) in UDF?

P.S. is there any relevant cases or references to be recommended, so I can educate myself?

Regards,

https://i.loli.net/2021/03/03/iqxrVbv3pRkuwlQ.png
Figure 1(a)

https://i.loli.net/2021/03/03/VbQoFIkc7ARyqwL.png
Figure 1(b)

https://i.loli.net/2021/03/03/zN37hU6TnPYr4Ax.png
Figure 2(a) pressure curve consists of discrete points

https://i.loli.net/2021/03/03/sd5WM17oj4JOxUE.png
Figure 2(b) table of corresponding discrete points


All times are GMT -4. The time now is 01:00.