Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

PID temperature control in Fluent using UDF.

    • suraj9735
      Subscriber

      I have a simple plate (cavity of Injection Mold). I have Cartridge heater to heat it. Now I want to control the maximum temperature of the plate to not exceed more than 180 deg or 453K. I apply simple logic of ON/OFF control and write UDF in Fluent to control it. It works fine. But we know that ON/OFF control is used for a simple application.  In actual practice for Mould, we use the PID controller. It helps to quickly set back to the target temperature when it gets deviates due to the injection of the material inside the mould.


      Manual tuning of PID is difficult and I have to do that for my case. I try to write UDF or PID logic. I found for one parameter (Kp, Ki, Kd) testing, My simulation takes 30 minutes to complete the simulation. Because I don't have the mathematical modelling of my thermal system and I depend on Fluent to receive data after every time-step.


      Now, my question is Fluent can do lots of complex simulation and probably we can't make mathematical modelling of it. If we need to find the PID parameter to control particular output for those simulations. What's the actual way to do that?


      Can MATLAB functions of PID be used in Fluent?


      Could you please provide me with something/example to learn how to implement a PID controller into the Fluent simulation?


      Thanks!

    • Rob
      Forum Moderator

      The control theory will need to be developed by you using whatever method you're comfortable with. In Fluent you'd monitor something (max temperature for example) and then adjust the energy source based on that.  Look in the UDF manual for the source term examples: you'll need the C (or C++) function using the temperature value (look up using data loops or parameters) to set the source value. 

    • suraj9735
      Subscriber

      Can we connect MATLAB with Fluent for data sharing and use available PID functions in MATLAB to control the temperature?


      As I mentioned I have written UDF using different DEFINE macros available in Fluent and it works well for ON/OFF control. But in that way, it takes very much time for one-time testing and I need to test many time. I just looking for an example someone implemented PID control by writing UDF inside Fluent. Thank You!

    • Rob
      Forum Moderator

      There are various hook-ups but I don't think the tools are included in the Student bundle (Digital Twin builder). I'd look to build a UDF using the control theory developed in MATLAB. 


      From memory (I've not done control theory in about 25 years) control response tends to be fast compared to the fluid flow so be careful with timescales. 

Viewing 3 reply threads
  • The topic ‘PID temperature control in Fluent using UDF.’ is closed to new replies.