How to clear file written after simulation cycle is over?

satri
satri Altair Community Member

Hello,

I want to do this

  1. Write the position of particles during the contact interaction step to a file
  2. Use the positions written to compute particles with one ID up and One ID down to get the distances.
  3. I want to clear the file written in Step 1 and re-write the file

I can achieve steps 1 and 2

But i do not know how to achieve step 3. Can someone please tell me how I can clear out the file so that I can write the particle positions again?

Tagged:

Answers

  • satri
    satri Altair Community Member

    My Main intension is this

    I want to calculate the curvature three particles are creating.

    One logic i thought is

    Write positions and compute it from there in body force part.

    But the file is so huge that i want only the positions of particles at one instant.

    I am open to hearing out any other ideas as well to evaluate curvature.

  • satri
    satri Altair Community Member

    i think i found a solution but not sure if its correct

    i don't need to write files i can use this equation between the position velocity and acceleration to get curvature.

    Please tell me if this works

  • Stephen Cole
    Stephen Cole
    Altair Employee

    Hi, are you doing this during processing, I would consider using either a particle body force where you get the positions of every particle sequentially in the system, or for each contact storing the information on a custom property and calculating the curvature from the data you store.


    Regards

    Stephen

  • satri
    satri Altair Community Member

    I am doing it when I am calculating body force. I have many contact point so I think it's going to be hard doing it with contact information..I will need to pick id next and id before.

    Rather I would prefer doing it with velocity and acceleration vector. When a particle is undergoing curvilinear motion there is a relationship with velocity and acceleration to get curvature magnitude and it's direction. But only problem is how will I know how much body force the particle is experiencing.

    I can get how much body force it's experiencing in this time step.

    But my confusion is in body force API does results.force give value of previous time step too? Or does it get reset every time step? Please let me know.

  • Stephen Cole
    Stephen Cole
    Altair Employee

    In the Body Force when you query results.force it gives you the forces calculated in the current time-step from the Contact Models.