🎉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

How to clear file written after simulation cycle is over?

User: "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?

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "satri"
    Altair Community Member
    OP

    My Main intension is this

    I want to calculate the curvature three particles are creating.

    One logic i thought is

    image.png

    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.

    User: "satri"
    Altair Community Member
    OP

    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

    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

    User: "satri"
    Altair Community Member
    OP

    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.

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