Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Which type of macro is required for data sampling UDF?

    • pc_singh
      Subscriber
    • Rob
      Forum Moderator
      I suspect it's related to the duration that's sampled, but the exact meaning of the whole C_STORAGE_R.... macro may not be fully defined. n
    • Amine Ben Hadj Ali
      Ansys Employee
      You have access to the Cell Storage Values as mentioned in the documentation.n
    • pc_singh
      Subscriber
      Sir, Please help me out.nn
    • Amine Ben Hadj Ali
      Ansys Employee
      What do you want?n
    • Amine Ben Hadj Ali
      Ansys Employee
      All what you required is mentioned in the docu.n
    • YasserSelima
      Subscriber
      ArraySV_T_MEAN is the time integral of the temperature ... if you are sampling data for 0.5 seconds, you need to divide this value by 0.5 to get average temperature.nThe sampled time appears to you in the Run Calculation Task page.nTo know it nIn your UDF, it should be equal toCorrection: I have just checked the manual.ndelta_time_sampled = Sampling Interval;n
    • pc_singh
      Subscriber
      Ideas to write UDF for time-sampled data and which macro I have use..n
    • pc_singh
      Subscriber
      Thanks. Is there any macro I have to use?n
    • pc_singh
      Subscriber
      I have one more doubt... I want this UDF at the outlet only (my aim is to calculate the average temperature at the outlet only). How will I do that?n
    • pc_singh
      Subscriber
      @ yasserSelima Thanks for the correction.n
    • YasserSelima
      Subscriber
      The macro is what you put in your photo. C_STORAGE_RnYou will write the equation as it is ... c and t are cell and thread at outlet. and delta_time_sampled = Sampling Interval;nAnd by the way, if you are interested only in average temperature, why don't you make mass average and monitor it in the solution. You don't need UDF for thatn
    • pc_singh
      Subscriber
      Ok.nI have to run for at least 140-160 cycles (each cycle is of 4.2 sec). And before every next cycle, I have to patch the average temperature of the Last cycle.nRight now I am doing it manually by calculating the average temperature manually and patch it. It is taking so much time.nMy plan is to make a UDF for this work and do the whole simulation automatically. nPlease suggest if you have an any better idea. n
    • pc_singh
      Subscriber

      The macro is what you put in your photo. C_STORAGE_RYou will write the equation as it is ... c and t are cell and thread at outlet. and delta_time_sampled = Sampling Interval;And by the way, if you are interested only in average temperature, why don't you make mass average and monitor it in the solution. You don't need UDF for that/forum/discussion/comment/106154#Comment_106154

      Is this enough to calculate the average temperature at the outlet? Or I have to define something else too.n
    • YasserSelima
      Subscriber
      Make a report definition of the mass averaged temperature at the outlet. And make this value averaged over whatever you want flow time ... Then monitor it and write it in a file
    • YasserSelima
      Subscriber
      No UDF needed .. you can get your values right away in a filen
    • pc_singh
      Subscriber
      I am doing that way right now, Let me explain what I am doing right now so that u can understand it in a better way:non a heated plate, I am flowing cooled water(say T kelvin) for 2 sec so with time, the temperature will decrease and by report definition, It is getting written on every 0.2 sec, in this way I will get 10 data sets and by dividing it by 10, I will get the net average temperature for the simulation of 2 sec. say it is T1 kelvin. Obviously, T1 will be less than T.nin the next cycle, I have to flow the water of T1 kelvin for 2 sec, so for this, I have to patch it. After this cycle of simulation again by doing the same way as explained above, I calculate the average temperature, say it T2 kelvin, which is less than T1.nIn the next cycle, as I need T2 temperature of water to flow so I have to patch it before the next simulation.nIn this way, I have to do it up to 140-150 cycles.nby it will be very hectic if I go for a manual, that's why I want to write a UDF.nn
    • YasserSelima
      Subscriber
      When defining the report definition, make it averaged over flow time 2 seceonds ... and now you will get your value directly on the file.n
    • Amine Ben Hadj Ali
      Ansys Employee
      Create a report definition per udf for your outlet to get average output parameter. We are working on having that done automatically. But you can write an averaged report file without an UDF. You just provide the average over interval.n
Viewing 18 reply threads
  • The topic ‘Which type of macro is required for data sampling UDF?’ is closed to new replies.