espressomd-devel
[Top][All Lists]
Advanced

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

Re: [ESPResSo-devel] A bug in Espresso


From: Ulf Schiller
Subject: Re: [ESPResSo-devel] A bug in Espresso
Date: Tue, 3 Jul 2012 17:16:19 +0200
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1

Hi,

On 07/03/2012 04:45 PM, Stefan Kesselheim wrote:
Hi,

On 07/03/2012 04:29 PM, Ivan Cimrak wrote:
 Hello,

 I noticed some strange behaviour. I created an lbfluid, initiated it
 with some nonzero velocity and let it evolve (EXTERNAL_FORCES were
 switched off). I printed the velocity profile of the fluid
 throughout the simulation. Then I put a particle in the fluid and
 again printed the velocity of the fluid. I supposed, that the outcome
 should be different, since any particles influence the behaviour of
 the fluid. But the output was identical.



 Then I did the same with EXTERNAL_VELOCITY switched on and the
 outputs were different.

What is EXTERNAL_VELOCITY? I have never heard of that and the Espresso
sources show no sign of it.



 I think that in file lb.c, in procedure lb_viscous_coupling, after
 local_f is increased by

 local_f[0] += delta[3*x+0]*delta[3*y+1]*delta[3*z+2]*delta_j[0];
 local_f[1] += delta[3*x+0]*delta[3*y+1]*delta[3*z+2]*delta_j[1];
 local_f[2] += delta[3*x+0]*delta[3*y+1]*delta[3*z+2]*delta_j[2];

 also the flag lbfields[node_index[(z*2+y)*2+x]].hasforce shold be set
 to 1. Otherwise, in procedure lb_collide_stream, the procedure
 lb_apply_forces is not called

 if (lbfields[index].has_force) lb_apply_forces(index, modes);

 When EXTERNAL_FORCES are switched on, this problem does not occur.

OK. I just realize that I never checked the LB without having
EXTERNAL_FORCES switched on. Probably if it is deactivated the coupling
just does not work, because the "has_force" flag is not set/read
properly. I will fix that soon, but please switch on EXTERNAL_FORCES
meanwhile. I tend to just remove the has_force flag, because the
computational cost of calculating the influence of the force is not very
large compared to the rest of the LB calculation.

Note that there is a slight difference between external forces and coupling forces. The external forces are applied once every LB update and enter the definition of the hydrodynamic velocity, while the coupling forces have to be applied to the fluid in every MD update and are neglected in the hydrodynamic velocity. Otherwise (total) momentum is not conserved during an MD time step. In principle, the coupling forces would enter the hydrodynamic velocity as well, but that brings up a self-consistency problem as the forces are themselves velocity dependent. To avoid an iterative update I usually neglect the coupling force when determining the momentum density.

Best,
Ulf

--
Dr. Ulf D. Schiller                        Building 04.16, Room 3006
Institute of Complex Systems (ICS-2)       Phone:   +49 2461 61-6144
Forschungszentrum Jülich, Germany          Fax:     +49 2461 61-3180

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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