Finding the Min/Max value of a field in a pyro sim?

   1929   0   0
User Avatar
Member
51 posts
Joined: April 2011
Offline
I am trying to figure out how to get the converse of a field, mathematically. I am attempting to blur a Cd field in using a Gas Blur microsolver. I have some mixed results, but I want to get some finer control over the radius, namely that I want it to blur more as it slows down. I have used the gas analysis microsolver to get the speed field by taking the length of the velocity, but I can't figure out how to get larger values to be in the lower speed areas. Obviously I would love to use a fit to invert the values, but I am struggling with an elegant way to get the minimum and maximum values for a given field. I could easily just do a loop in a wrangle and get the min/max values that way, but that is going to be extremely slow as this is a very large, dense simulation. Is there a simple way I can get the min/max values in a field so I can use (fit(@speed, min, max, 1, 0) * scale) in a Gas Field Wrangle node to get the converse of my field and scale it properly?

It was brought up over on OdForce that there are hscript commands to do this, which I would absolutely LOVE to use, but I can't figure out how to do it in the DOPs context nor how to throw the data around to other nodes. There are a few other modifications I need to do to the field for my purposes and would really like to do as much in VEX as I can. I have tried using a chf() to bring in the expression versions of volumemin() and volumemax(), but apparently I am unable to target my @speed field with them properly.
Edited by Adam F - Sept. 23, 2019 14:31:35
  • Quick Links