How to change DPD weight function exponent?

Hi Dear all LAMMPS Users

I have a question about how to change the weight function in DPD in LAMMPS. My problem has a little difference with the conventional “LAMMPS” code. My question is actually about the weight function exponent in dissipative forces. This value in original code is equal 2.0 but I want to put this equals 0.5.

Now my question is that whether to achieve this goal the change of source file “pair-dpd.cpp”- as mentioned below- is sufficient or other actions should be taken?

original code:

fpair = a0[itype][jtype]*wd;

fpair -= gamma[itype][jtype]wdwddotrinv;

fpair += sigma[itype][jtype]wdrandnum*dtinvsqrt;

fpair = factor_dpdrinv;

The Modified code:

fpair = a0[itype][jtype]*wd;

fpair -= gamma[itype][jtype]*pow(wd,0.5)dotrinv;

fpair += sigma[itype][jtype]*pow(wd,0.25)randnumdtinvsqrt;

fpair = factor_dpdrinv;

I would be really thankful if anyone could help me to clarifying this problem. Thank you very much in advance.

Best regards

Amir

Hi Dear all LAMMPS Users

I have a question about how to change the weight function in DPD in LAMMPS.
My problem has a little difference with the conventional “LAMMPS” code. My
question is actually about the weight function exponent in dissipative
forces. This value in original code is equal 2.0 but I want to put this

no, it is not:

wd = 1.0 - r/cut[itype][jtype];

is a linear decay.

equals 0.5.

Now my question is that whether to achieve this goal the change of source
file “pair-dpd.cpp”- as mentioned below- is sufficient or other actions
should be taken?

for starters, your change will make the calculation *much* slower due
to useless calls to pow(), which is the by far most time consuming
function in the C math library.

second, the way to proceed would be to set up several test inputs,
compute their results by hand from the proper formula and compare to
what your modified LAMMPS computes.

what if somebody here says "yes, it looks correct to me", but it wasn't??

axel.

If you also change the PairDPD::single() method,
then you will be able to use the pair_write command
to tabulate your modified potential and plot it.

Steve