espressomd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hydrodynamic forces analysis


From: Jean-Noël Grad
Subject: Re: Hydrodynamic forces analysis
Date: Tue, 31 Oct 2023 18:00:19 +0100
User-agent: Mozilla Thunderbird

Hi,

To the best of my knowledge, there isn't a way to calculate this quantity from the Python interface, because the particle coupling code that updates particle forces also updates the LB grid and thermostat as a side-effect.

If you are familiar with C++ programming, it would be a fun exercise to update the particle coupling code to also update a dictionary of particle forces. To do so, one would adapt `ParticleCoupling::kernel()` to write forces to a `std::unordered_map<int,Utils::Vector3d> obs` using particle ids as key.

The particle forces from the LB grid are calculated here:
https://github.com/espressomd/espresso/blob/b70d9e8/src/core/lb/particle_coupling.cpp#L279

One can then accumulate forces with `obs[p.id()] += force_on_particle;` and reset all forces to zero as the first step of `couple_particles()` with `for(auto &[k,v] : obs){v=Utils::Vector3d{};}`.

Hope this helps,
JN

On 10/30/23 15:18, Ahmad Reza Motezakker wrote:
Dear EspressoMD Community,


I hope this email finds you well. I am working on a project involving nanoparticles and polymers in a cubic box, simulated with LB fluid dynamics and Lennard-Jones forces.


I am particularly interested in analyzing the hydrodynamic forces acting on the nanoparticles. Could you share any tips or tools in EspressoMD that would help me isolate and accurately calculate these forces and the net force?


Thank you in advance for your assistance.


Best,

ARM





reply via email to

[Prev in Thread] Current Thread [Next in Thread]