Fluids

Fluids

Value of a UDF depending on another UDF

    • Max4
      Subscriber

      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) -> mass flow of x kg/s ; when the acceleration is positiv (Case 2) -> pressure of X Pa


      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?


      Thank you.


      Regards,


      Maxime

    • DrAmine
      Ansys Employee

      Yes to change the kind of boundary you need to use scheme. So mixture of UDF and Scheme is required here. Or just use Dynamic Mesh Events to change a boundary type after certain time lasted.

    • Max4
      Subscriber

      Thank you for your reply. I can´t use Events because I want to do it for a random velocity profil, but good to know that it exists.


      In the UDF for the movement of the piston, I have defined the velocity. Can I just define a variable (e.g. acceleration = -sin(..*time)) which has no effect for this UDF, but which is mandatory for the inlet/outlet boundaries UDF? In order to use this variable (acceleration) for the UDF of inlet/outlet, may I have to use UDM?


      Regards,


      Maxime

    • DrAmine
      Ansys Employee

      Yes you can use the UDM's as placeholder for that.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.