Fluids

Fluids

How can I find mean vertical position of all particles in the domain?

    • mirikardn
      Subscriber
      I want to obtain temporal variation of the mean vertical position of all particles. How can I obtain this info.nFor example, suppose there are 100 particles in domain, every particle has current position in the domain.nI want to add 'y' coordinate of all particles and divide by no of particles (100). I want this to be my output, what should I do?.
    • Rob
      Ansys Employee
      As the particles are tracked in the Lagrangian reference frame most of the reporting tools aren't much help. I think your best option will be the report files, nWhich you'll need to get every time step and then process outside of Fluent. nA UDF will also work, but you'd then need to export that result to a file.
    • mirikardn
      Subscriber
      Thanks for your reply.nSo, I'll need to save these files manually after every few timesteps, right? This can be done but it is not efficient.nDo you have any reference to UDF, which can be helpful creating udf?nI especially want to know how to access each element in domain. In eulerian simulation we go from x[ND_ND] then x[1] to obtain 'y' position of the each cell, then loop over cell in all threads. How should I loop over all particles?nAppreciate your support, thanks.n
    • Rob
      Ansys Employee
      Not exactly a manual process, have a look at Execute Commands and find the report function via the TUI. Combine the two for an automatic process. Working with the data may take more doing, but if you know the file format (it's text and human readable) Python or the like ought to do it. Note, someone else in the community may have a better idea! n
    • YasserSelima
      Subscriber
      File - Export - calculation data - During Calculations ... and by this you can save file every time step (Not sure if you will find DPM data available there or not, but worth trying). I use this to save almost everything I need for post processingnIf you decide to go with the UDF option suggested by Rob, you can use Define_report_definition_fn macro and you will be able to monitor this during calculationsn
    • mirikardn
      Subscriber

      Not exactly a manual process, have a look at Execute Commands and find the report function via the TUI. Combine the two for an automatic process. Working with the data may take more doing, but if you know the file format (it's text and human readable) Python or the like ought to do it. Note, someone else in the community may have a better idea!https://forum.ansys.com/discussion/comment/109499#Comment_109499

      Thanks for your inputs, Rob.nI was able to save the particle history data after some interval as ensight file (as of now, I have not used it for post-processing but hopefully I'll be able to do it). By default, the save/export option was cfd post, and for that saving option for the interval was not there. Let's see how it goes. Thanks again.n
    • mirikardn
      Subscriber

      File - Export - calculation data - During Calculations ... and by this you can save file every time step (Not sure if you will find DPM data available there or not, but worth trying). I use this to save almost everything I need for post processingIf you decide to go with the UDF option suggested by Rob, you can use Define_report_definition_fn macro and you will be able to monitor this during calculationshttps://forum.ansys.com/discussion/comment/109510#Comment_109510

      Thanks, Yasser,nPreviously I didn't find the way to auto-export after every a few timesteps. But when I changed the export file type from CFD post to insight I was able to input interval for file export. So, I'm able to export the file and hopefully, I'll be able to do something in ensight (which I haven't used until now)nI'll simultaneously see if I can write a UDF for the same. Thanks.n
    • YasserSelima
      Subscriber
      If this is your first time writing UDF, it will be a little bit difficult ... but the learning experience will open the door for you to do lots of staff in your simulation that you were not able to do earlier. nThe UDF manual has many examples ... the first thing you need to decide which macro you need. In your case, you will look in the DPM macros. Go read what every macro does. After deciding you need to use this, look at the example and you can start from there. Try to understand the sequence and try to modify the example to your case. And if you need help, you can come ask questions here in the forum. n
    • mirikardn
      Subscriber
      Thanks Yasser, I have made some basic UDF's for heat source, and moving diaphragm for dynamic mesh...nI'll surely look into UDF's for DPM. n
    • DrAmine
      Ansys Employee
      You can write the positions of all particles and then do reduction on the position. This can be done either outside of Fluent using the exported particle tracks or in Fluent using some UDF's. I think and if you want to see the results on the Euler Grid, I usually use DEFINE_DPM_SOURCE to store the particle information into the cell and just returning zero as source. Using that you can then save the particles positions of all particles located in that cell and do some weighting using residence time.Another cheaper alternative is to rely on the DPM mean values which might provide some quick and dirty solutions for you!n
Viewing 9 reply threads
  • You must be logged in to reply to this topic.