We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Electronics

Electronics

Topics related to HFSS, Maxwell, SIwave, Icepak, Electronics Enterprise and more.

ANSYS Icepak Attaching UDF

    • mfaro5
      Subscriber

      Hi, I am currently doing a senior design project with a system integrating heatsinks, a PCB, four fans, M&P chips, and a Pelter. I am trying to attach a UDF to each fan, but I am getting an error saying "more than one curve." In addition, what should I attach within parallel settings specifically for the UDF? My thought would be to attach a UDF for the M&P face to get the maximum temp of either the M or P chip. Then, attach a UDF for each fan specifically, which commands the fans to turn on after reaching the threshold temperature based on the M&P chip. I will attach my code below, but I feel the error is caused by having multiple zone IDs in a single UDF. I was initially thinking that I would need to have the code to obtain the M&P chips temps for each UDF for each fan that I want to turn on. However, I am fairly new to Icepak and developing UDFs. I would greatly appreciate it if anyone could help me!  

       

       

       

    • mfaro5
      Subscriber

      CODE:

       

      #include "udf.h"

       

      #define mface 20 //initialize to 20 degrees ambient

      #define pface 20 //initialize to 20 degrees ambient

      #define threshold 50 //max temp threshold

      #define winsinnface1 20 //initialize to 20 degrees ambient

      #define fspeed 1.35 //winsinn fans speed in CFM

       

      // You can use DEFINE_PROFILE to define a custom boundary profile that varies as a function of spatial coordinates or time.

      // Some of the variables you can customize at a boundary are: Temperature, velocity, pressure, etc

       

      // There are three arguments to DEFINE_PROFILE: name, t, and i.

      // You supply name, the name of the UDF. t and i are variables that are passed by the ANSYS FLUENT solver to your UDF.

       

      DEFINE_PROFILE(name_of_file, t, i) {

       

      //defining m & p temps as well as a TMP(temporary variable) called tempcare which will act based off of max of m and p faces

      real mtemp, ptemp, tempcare;

       

      //In the case of single-phase flows, domain_id is 1 and Get_Domain(1) will return the fluid domain pointer. Only Air Present - single phase.

      Domain *domain;

      domain = Get_Domain(1);

       

      // get temperatures from m and p faces

      // start with f_loop

      // Next, you supply the zone_ID as an argument to Lookup_Thread

      // Lookup_Thread returns the pointer to the thread that is associated with the given zone ID.

      // You can then assign the thread pointer to a thread_name and use it in your UDF.

       

      int M_ID = 10; //zone ID for M face

      Thread *t_m = Lookup_Thread(domain, M_ID); //t_m is the thread name for m face

      begin_f_loop(mface, t_m)

      {

      mtemp = F_T(mface, t_m, i); //face of m chip

      }

      end_f_loop(mface, t_m)

       

      int P_ID = 11; //zone ID for P face

      Thread *t_p = Lookup_Thread(domain, P_ID); ////t_p is the thread name for p face

       

      begin_f_loop(pface, t_p)

      {

      ptemp = F_T(pface, t, i); //face of p chip

      }

      end_f_loop(pface, t_p)

       

       

      //finding max of m and p temps and will turn on fans based off of the max of either m or p face

      if (mtemp > ptemp){

      tempcare = mtemp;

      }

      else{

      tempcare = ptemp;

      }

       

      //Set Boundary Condition Value (F_PROFILE)

       

      //F_PROFILE is typically used in a DEFINE_PROFILE UDF to set a boundary condition value in memory for a given face and thread.

      //The index i that is an argument to F_PROFILE is also an argument to DEFINE_PROFILE and identifies the particular boundary variable

      // (e.g., pressure, temperature, velocity) that is to be set.

       

      if (tempcare > threshold){

      int W1_ID = 13; //zone ID for 1st Winsinn face // intake

      Thread *w1_f = Lookup_Thread(domain, W1_ID); ////w1_f stands for the thread name for the 1st winsinn fan

       

      begin_f_loop(winsinnface1, w1_f)

      {

      F_PROFILE(winsinnface1, w1_f, i) = fspeed; //tell winsinn fans to turn on based off of tempcare

       

      }

      end_f_loop(winsinnface1, w1_f)

       

       

      }

       

      else{

      F_PROFILE = 0;

      }




      }

    • Rabindra Paul
      Ansys Employee

      Hi Thanks for contacting forum. As the error messsage is saying each fan should have their respective fan curve under non-linear fan curve.

      Regarding UDF question. Icepak interface does not allow to attach any external UDF files like fluent. But some Icepak features may use internal UDFs if needed. The option in the network parallel panel is just to turn on the switch to use the shared path for any internal UDFs used by the model.  Please let me know if this helps. Please feel free to use support portal to discuss your requirement.

       

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