🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Surface output data

Hi experts,

I want to extract integrated surface output data (like total heat flux through the output surface) from a given geometry using udfGetOsiData(). I have attached the geometry, along with the code herewith.

I was able to write to a file, but I could see a large number of data (and lines) even for a single time step. Can anyone tell what's going on here and why I am getting large number of data lines for an integrated result?

Another thing is when I write all time steps, I get tremendous number of lines. Do I need to sum those data lines on my own to get an integrated result?

image

image

image

Sort by:
1 - 1 of 11
    acuproUser: "acupro"
    Altair Employee
    Accepted Answer
    Updated by acupro

    This time also it didn't work.

    I have printed values of firstcall and mytimestep. timestep and mytimestep are both same but also if statement is not working.

    image

    image

     

    In the Stokes intialization portion, firstCall is reported as 1 in the first line - which is correct.  Than everywhere else it is reported as 0 - which is also correct.

    I think mytimestep = timeStep should be inside the if portion after that long line is printed - but maybe that doesn't matter, so long as it gets updated

    But it seems that mytimestep is not being updated to match timeStep

    ******************

    (I'm consulting with a colleague on this...)  Found the issue - mytimestep needs to be a static variable.  Instead of 

    Integer mytimestep ;

    We need

    static Integer mytimestep ;

    This will preserve its memory/value outside of the UDF, rather than getting initialized to 0 each time the UDF is called.