ludwig-cf / ludwig

A lattice Boltzmann code for complex fluids
https://ludwig.epcc.ed.ac.uk
Other
54 stars 35 forks source link

Predetermining colloid positions. #253

Closed aaronpim closed 1 year ago

aaronpim commented 1 year ago

I am am considering a large number of randomly dispersed colloids, I wish to consider multiple initial states and the way that I am attempting to achieve this is by varying the random_seed number in the input file.

However, these seeds have often led to colloid overlap, after which I increment the seed number and try again.

Is there an easier way to vary the initial colloid configuration? Potentially by allowing ludwig to read from a file of colloid positions?

If that is not possible then is there an easier way of varying the seed number, that does not require a manual edit?

colloid-input.txt

kevinstratford commented 1 year ago

It may be easier to produce a file of initial conditions, particularly if you are moving to higher solid volume fractions.

There's an example in util/colloid_init.c of how to produce a file with the correct format.

If one just wanted to generate a lot of different input files, then one could use sed to introduce different random seeds, I guess.

aaronpim commented 1 year ago

Hi Kevin, Could you please elaborate on the use of sed to introduce random seeds.

I have looked through colloid_init.c and was not able to see a random seed in this file. Tracing back the dependencies, I tried editing the scalar seed value in ran.c but that did not change the locations of the colloids.

ohenrich commented 1 year ago

Hi Aaron,

Changing the seed in both instances in /src/ran.c worked for me when I did a make clean followed by make, so basically a recompile.

Cheers, O

aaronpim commented 1 year ago

Thank you, that has completely sorted the issue; I did not recompile before running colloid_init. Thank you for the help.