kmc mobility and external field

41 views
Skip to first unread message

Tobias Koch

unread,
Feb 3, 2020, 6:21:18 AM2/3/20
to votca-ctp
Hello,

We have got some remarks on the evaluation of the mobility in kmc_multiple and the projection of the velocity vector on the external field $\mathbf{F}^{\text{ext}}$.
Due to our knowledge the mobility should be determined as follows:
$$
 \mu = \frac{ \langle \mathbf{v} \rangle \mathbf{U}^{\text{ext}} }{ | \mathbf{F}^{\text{ext}} | \cdot | \mathbf{F}^{\text{ext}}| }
  = \frac{ \langle \mathbf{v} \rangle \mathbf{e}_{\mathbf{F}^{\text{ext}}} }{ | \mathbf{F}^{\text{ext}}| }
$$

In the kmcmultiple.h one finds:

  // calculate mobilities
  //double absolute_field = sqrt(_fieldX*_fieldX + _fieldY*_fieldY + _fieldZ*_fieldZ);
  if (_fieldX*_fieldX + _fieldY*_fieldY + _fieldZ*_fieldZ != 0.0)
  {
  myvec average_mobility = myvec (0.0,0.0,0.0);
  myvec fieldfactors = myvec (0.0, 0.0, 0.0);
  if (_fieldX != 0)
  {
  fieldfactors.setX(1.0E4/_fieldX);
  }
  if (_fieldY != 0)
  {
  fieldfactors.setY(1.0E4/_fieldY);
  }
  if (_fieldZ != 0)
  {
  fieldfactors.setZ(1.0E4/_fieldZ);
  }

  cout << endl << "Mobilities (cm^2/Vs): " << endl;

  for(unsigned int i=0; i<numberofcharges; i++)
  {
  myvec velocity = carrier[i]->dr_travelled/simtime;
  myvec mobility = elementwiseproduct(velocity, fieldfactors);
  average_mobility += mobility;
  cout << std::scientific << " charge " << i+1 << ": ";
  if (_fieldX != 0)
  {
  cout << std::scientific << "muX=" << mobility.getX() << " ";
  }
  if (_fieldY != 0)
  {
  cout << std::scientific << "muY=" << mobility.getY() << " ";
  }
  if (_fieldZ != 0)
  {
  cout << std::scientific << "muZ=" << mobility.getZ() << " ";
  }
  cout << endl;
  }
 
 

The deviations / irritations only occure, if the external field vector is not aligned parallel to the simulation box vectors.
For a correct projection one should evaluate something like this:

  // calculate mobilities
  double absolute_field = sqrt(_fieldX*_fieldX + _fieldY*_fieldY + _fieldZ*_fieldZ);
 
  if (_fieldX*_fieldX + _fieldY*_fieldY + _fieldZ*_fieldZ != 0.0)
  {
  myvec average_mobility = myvec (0.0,0.0,0.0);
  myvec fieldfactors = myvec (0.0, 0.0, 0.0);
  if (_fieldX != 0)
  {
  fieldfactors.setX((1.0E4*_fieldX)/absolute_field/absolute_field);
  }
  if (_fieldY != 0)
  {
  fieldfactors.setY((1.0E4*_fieldY)/absolute_field/absolute_field);
  }
  if (_fieldZ != 0)
  {
  fieldfactors.setZ((1.0E4*_fieldZ)/absolute_field/absolute_field);
  }

  cout << endl << "Mobilities (cm^2/Vs): " << endl;

  for(unsigned int i=0; i<numberofcharges; i++)
  {
  myvec velocity = carrier[i]->dr_travelled/simtime;
  myvec mobility = elementwiseproduct(velocity, fieldfactors);
  average_mobility += mobility;
  cout << std::scientific << " charge " << i+1 << ": ";
  if (_fieldX != 0)
  {
  cout << std::scientific << "muX=" << mobility.getX() << " ";
  }
  if (_fieldY != 0)
  {
  cout << std::scientific << "muY=" << mobility.getY() << " ";
  }
  if (_fieldZ != 0)
  {
  cout << std::scientific << "muZ=" << mobility.getZ() << " ";
  }
  cout << endl;
  }

Maybe someone can help us concerning this issue?

Best wishes Jim and Tobias.

Denis Andrienko

unread,
Feb 3, 2020, 10:24:33 AM2/3/20
to votc...@googlegroups.com
Hi Tobias,

You are right, this will work only if the field is along x, y, or z, otherwise it is wrong. We are aware of it.

This 'fix' has been added by and external contributor and accepted by Christoph without much checking some time ago:

Are you interested in the full mobility tensor? It will not take much time to fix this if needed.

Also note that I have moved the ctp and csg developments of the Max Planck groups to a new repository,

We are in the process of restructuring the repo.

Best,
Denis

--
You received this message because you are subscribed to the Google Groups "votca-ctp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to votca-ctp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/votca-ctp/ca39a7b3-607c-4550-9612-296f90f425c1%40googlegroups.com.

Christoph Junghans

unread,
Feb 3, 2020, 1:46:13 PM2/3/20
to votc...@googlegroups.com
On Mon, Feb 3, 2020 at 8:24 AM 'Denis Andrienko' via votca-ctp <votc...@googlegroups.com> wrote:
Hi Tobias,

You are right, this will work only if the field is along x, y, or z, otherwise it is wrong. We are aware of it.

This 'fix' has been added by and external contributor and accepted by Christoph without much checking some time ago:

Tobias Koch

unread,
Feb 6, 2020, 10:03:24 AM2/6/20
to votca-ctp

The code from razziel89 seems to exhibit the same error in the evaluation of the projection of <v> on F^ext.


Christoph Junghans

unread,
Feb 6, 2020, 10:08:15 AM2/6/20
to votc...@googlegroups.com
On Thu, Feb 6, 2020 at 8:03 AM Tobias Koch <tobiaskoc...@gmail.com> wrote:
>
> The code from razziel89 seems to exhibit the same error in the evaluation of the projection of <v> on F^ext.
Could you create a pull request for the correct projection you proposed?

Christoph


>>
>>
> --
> You received this message because you are subscribed to the Google Groups "votca-ctp" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to votca-ctp+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/votca-ctp/b404ea49-85d7-49dd-a3d9-e51372814276%40googlegroups.com.

Tobias Koch

unread,
Feb 10, 2020, 9:00:48 AM2/10/20
to votca-ctp
Ok, we have tried to include our proposal.
Best wishes
Jim and Tobias

Am Donnerstag, 6. Februar 2020 16:08:15 UTC+1 schrieb Christoph Junghans:
On Thu, Feb 6, 2020 at 8:03 AM Tobias Koch <tobiaskoc...@gmail.com> wrote:
>
> The code from razziel89 seems to exhibit the same error in the evaluation of the projection of <v> on F^ext.
Could you create a pull request for the correct projection you proposed?

Christoph


>>
>>
> --
> You received this message because you are subscribed to the Google Groups "votca-ctp" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to votc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages