Sorry to bother you again, but I really am not sure what you mean. I'll write out my understanding as clearly as I can.
I want to measure the standard deviation of particles at a plane and use that as an output parameter for optimisation. I'd like to be able to do this automatically at the end of the solver because the code will have to run for a large number of designs.
So as far as I can see I have three options.
Option 1: I can use
plane) to access the tracked particle data and write it to a .dpm file. I could then use another function to read this file and do the calculations I need. But how do I automatically create the .dpm file at the end of each design simulation?
Option 2: Call
plane) inside of an EXECUTE_AT_EXIT macro to do everything at once. But with this option, how do I pass the arguments (header, fp, tp, t, plane) from fluent into the DPM_OUTPUT?
Option 3: Use the DPM data access macros PP_POS(p)[i] inside a function which loops over all cells on the plane and all particle streams in the injection. I have tried to implement this in the image below. The code compiles but doesn't execute correctly, it doesn't seem to run through the innermost loop at all. I have also tried using PP_POS0(p)[i] instead, but this gives a compile error. (error C2109: subscript requires array or pointer type)
Any advice you can offer on these options would be really appreciated, I've been struggling to get this to work for some time now.