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/)
-   -   Value of a UDF depending on another UDF (https://www.cfd-online.com/Forums/fluent-udf/211599-value-udf-depending-another-udf.html)

Mkouu67 November 16, 2018 06:17

Value of a UDF depending on another UDF
 
1 Attachment(s)
Hi everyone,


As an attachment, an illustration of the problem. This models a cylinder with an inlet and outlet and piston movement.


- Case 1: When the piston goes down, we have mass flow at intlet and a closed outlet.


- Case 2: When the piston goes up, we have a closed inlet and a pressure at outlet.


I have write the UDF for the movement of the piston.


I want to write a UDF for the inlet and outlet depending on the movement of the piston, i.e. when the acceleration is negativ -> Case 1 ; when the acceleration is positiv -> Case 2



Do i have to use UDM Macros ? In order to change the type of the boundary (mass flow inlet to wall), may I have to use a Scheme file and the TUI-Command or use a journal file?


Thnank you.


Regards,


M.

AlexanderZ November 27, 2018 23:48

according to my knowledge as of now we may change boundary condition using scheme only.

as I know, you cant execute scheme/journal from UDF -> so you should think how you will execute UDF from scheme/journal

best regards

sanketdange2007 December 5, 2018 15:39

Quote:

Originally Posted by Mkouu67 (Post 715818)
Hi everyone,


As an attachment, an illustration of the problem. This models a cylinder with an inlet and outlet and piston movement.


- Case 1: When the piston goes down, we have mass flow at intlet and a closed outlet.


- Case 2: When the piston goes up, we have a closed inlet and a pressure at outlet.


I have write the UDF for the movement of the piston.


I want to write a UDF for the inlet and outlet depending on the movement of the piston, i.e. when the acceleration is negativ -> Case 1 ; when the acceleration is positiv -> Case 2



Do i have to use UDM Macros ? In order to change the type of the boundary (mass flow inlet to wall), may I have to use a Scheme file and the TUI-Command or use a journal file?


Thnank you.


Regards,


M.

I assume that this is a transient simulation and piston movement is periodic (repeating after certain time).
This is a tricky problem. Solution to this is to use scheme or journal file and write TUI commands in it to flip boundary conditions after appropriate number of time steps.

Just to elaborate, if piston is going down from time step 0 to 10 then after time step 10 BCs will get flip, similarly after time step 20 and so on till the simulation ends.
Also you will have to drive your simulation from scheme or journal file.


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