Skip to content

Best pratice to modify p.dt inside a kernel ? #1155

@quai20

Description

@quai20

Hello all !

Within my custom kernel, I would like to change particle.dt because in some part of the advection, I want to refine or enlarge the sampling rate. I see that I can do particle.update_next_dt(new_dt) but :

  • does it apply to all the kernels ? (I have kernels = custom_kernel + AdvectionRK4 + periodicBC)
  • How do I set the file writing ? because my dt is not constant, so what about the ParticleFile outputdt ? Is it possible to write all the data, when irregularly sampled ?

I tried combining particle.update_next_dt(new_dt) in my kernel, and leaving outputdt empty but I only get the first and last values of the simulation in my output file, butI think it's normal with the default outputdt=np.infty.

I you have any recommandation of example of varying, thanks very much.

Kevin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions