1 Introduction

Actually, modelling and simulation is an important concern in science and engineering, since this helps to understand the expected behaviour of a system while inspecting underlying physical phenomena. In this way, it is possible to implement simulations by exploiting computing tools actually available, without carrying out expensive laboratory tests. Scientific literatures present a huge number of papers dealing with modelling and simulation in several research areas and frameworks, including the study of nanoparticle-based systems and nanofluids (Popa et al. 2016; Rob et al. 2016; Sharifi et al. 2012; Scherer 2004; Loya et al. 2014; Lim and Feng 2012; Reeves and Weaver 2012; Polyakov et al. 2013; Tanygi et al. 2015; Rokidi et al. 2016; Drikakis and Frank 2015; Holland et al. 2015; Hu et al. 2014; Piet et al. 2013; Sreekumari and Ilg 2013). A magnetic nanofluid is a fluid containing magnetic nanoparticles in a stable colloidal suspension. In recent years, the magnetic nanofluids have received attention expecially due to biomedical applications, such as drug delivery and hyperthermia treatment for cancer. For instance, the iron-oxide nanofluids have attracted special attention because of their low inherent toxicity, ease of synthesis, physical and chemical stabilities and suitable magnetic properties (Sharifi et al. 2012). Currently, one of the most important key issues in colloids is the control of agglomeration process, particularly the possibility of determining controlled size and composition of agglomerated structures. The self-assembly of magnetic nanoparticles can lead to local structures with important collective properties (Sreekumari and Ilg 2013; Margabandhul et al. 2016; Usanov et al. 2016).

Recently, many experimental studies have been performed on nanofluid systems (Loya et al. 2014), showing that the presence of an external magnetic field influences the agglomeration of nanoparticles (Margabandhul et al. 2016; Iyengar et al. 2016; Usanov et al. 2016). Laboratory experiments are expensive and time-consuming, since results related to real-world conditions require a lot of efforts and knowledge of experimental procedures (Loya et al. 2014). Since these drawbacks, computer simulations have attracted the interest of researchers, even because of highly empowering computers.

The superparamagnetic properties of colloids are considerably affected by the aggregation of nanoparticles due to the presence of attractive and repulsive interactions. Hence, it is important to take into account the various types of interactions occurring among nanoparticles, as well as to understand their role in the colloidal self-organization and how this self-organization influences the relaxation time of the system. While analysing the physical phenomenon of agglomeration in colloids, we should take into account that the colloidal particles have translational and rotational motions, due to several forces and torques. They are caused by the applied field and interparticle interactions. Besides, the nanoparticles collide each other, causing translational and rotational Brownian motions. Their movements inside the liquid are opposed by viscous, dissipative forces and torques (Scherer 2004). Molecular dynamics (MD) method is increasingly popular for simulating nanofluids (Holland et al. 2015; Hu et al. 2014). Lim and Feng (2012) studied the magnetic nanoparticle agglomeration in suspension using discrete element method (DEM). Langevin dynamics (LD) technique exploits stochastic differential equations with friction and white noise. Reeves and Weaver (Reeves and Weaver 2012) numerically solved the stochastic-type (i.e. Langevin-type) motion equations of nanoparticles by using the Brownian dynamics method and an Euler–Maruyama algorithm and simulated the movements of magnetic nanoparticles for biomedical applications. Sreekumari and Ilg (2013) noticed slow dynamical relaxations in an LD-study of a cobalt nanoparticle suspension. Polyakov et al. (2013) made large-scale ferrofluid simulations on graphics processing units, based on the Barnes–Hut algorithm and using Lennard-Jones potential for short-range interactions. In their recently published paper, Tanygi et al. (2015) used an Euler algorithm based on finite differences. They found some other structures of nanoparticles appearing in uniform magnetic field, besides linear chains, dense globes and ring assembly structures. Unfortunately, the Euler algorithm has a main drawback: the local and global truncations generate errors which could not be negligible. Combinations of MD and the Navier–Stokes equation have been used by Piet et al. (2013) as well, in order to include hydrodynamic flows. Monte Carlo simulation technique is a basic technique in the study of colloidal systems (Stopper et al. 2016; Patra 2016; Tasios et al. 2016; Hatch et al. 2016; Cacciola and Osaci 2016). Several models (some of them based on the MD method, some on the Monte Carlo technique) have been proposed in order to study positioning of nanoparticles in ferrofluids (Cacciola and Osaci 2016). In most models of ferrofluids, the short-range interactions are modelled by the Lennard-Jones function (Loya et al. 2014; Lim and Feng 2012; Reeves and Weaver 2012; Polyakov et al. 2013), but it gives only a general and approximate expression of the short-range potentials. Most of the current models take into account only monodisperse nanoparticle systems (Lim and Feng 2012; Reeves and Weaver 2012; Polyakov et al. 2013), but nanoparticles have usually size dispersion. This kind of situation is usually accounted by using the medium diameter, above all within the models that consider various types of interactions, such as steric repulsion, magnetic dipolar and van der Waals’ interaction energy, provided the case of polydispersity (Rokidi et al. 2016).

In our work, we deal with dynamics of nanoparticles with different sizes in a nanofluid by LD simulations based on a Verlet-type algorithm (Grønbech-Jensena and Faragoa 2013), extending this algorithm for rotational motion.

2 The computational model

Our system is composed by single-domain, spherical iron-oxide nanoparticles, with a lognormal distribution of grain sizes. Each nanoparticle is composed of a magnetic core and a non-magnetic surface layer of stabilizing surfactant. The temperature of the system is constant. According to the fluctuation–dissipation theorem, the microscopic processes establishing the thermal equilibrium are the same that cause drag in fluids and other types of dissipation (Pribram-Jones et al. 2016; Villa-Torrealba and Toro-Mendoza 2015; Evans 2016).

If we compare the Langevin equation to the one resulting from Newton’s second law for MD, the former is a stochastic differential equation with two terms added to the conservative terms. In case of translational motions, a term represents the friction force and a second term represents the random Brownian force, according to the –dissipation theorem (Pribram-Jones et al. 2016; Villa-Torrealba and Toro-Mendoza 2015; Evans 2016). In case of rotational motions, a term represents the friction torque and the other term represents the random Brownian torque, according to the fluctuation–dissipation theorem (Pribram-Jones et al. 2016; Villa-Torrealba and Toro-Mendoza 2015; Evans 2016). The Langevin equations for the translational and rotational motions of an ith nanoparticle in the basic liquid can be written in the form (Grønbech-Jensena and Faragoa 2013):

$$m_{i} \dot{\vec{v}}_{i} = \vec{f}_{i} - \alpha_{{i,{\text{tr}}}} \ \vec{v}_{i} + \beta_{{i,{\text{tr}}}} (t)$$
(1)
$$\alpha_{{i,{\text{tr}}}} = 6 \pi \eta r_{i}$$
(2)
$$I_{i} \dot{\vec{\omega }}_{i} = \vec{T}_{i,c} - \alpha_{{i,{\text{rot}}}} \vec{\omega }_{i} + \beta_{{i,{\text{rot}}}} (t)$$
(3)
$$\alpha_{{i,{\text{rot}}}} = 8\pi \eta r_{i}^{3}$$
(4)

where m i and \(\vec{v}_{i}\) are the mass and linear speed of the ith nanoparticle, respectively; \(\vec{f}_{i}\) is the resultant of the conservative forces acting on the ith nanoparticle; \(\alpha_{{i,{\text{tr}}}}\) and \(\alpha_{{i,{\text{rot}}}}\) are the translational and rotational friction coefficients, respectively; η is the coefficient of the dynamic viscosity; r i is the radius of the ith nanoparticle; \(\beta_{{i,{\text{tr}}}} (t)\) and \(\beta_{{i,{\text{rot}}}} (t)\) are the random Brownian force and torque, respectively; I i , \(\vec{\omega }_{i}\) and \(\vec{T}_{i,c}\) are the moment of inertia, the angular speed and the resultant of the conservative torques acting of the ith nanoparticle, respectively.

The random Brownian force and torque are usually modelled using the Gaussian noise (Polyakov et al. 2013; Hu et al. 2014), so that:

$$\left\langle {\beta_{{i,{\text{tr}}}} (t)} \right\rangle = 0$$
(5)
$$\left\langle {\beta_{{i,{\text{tr}}}} (t) \cdot \beta_{{i,{\text{tr}}}} (t')} \right\rangle = 2k_{\text{B}} T\alpha_{{i,{\text{tr}}}} \delta (t - t')$$
(6)
$$\left\langle {\beta_{{i,{\text{rot}}}} (t)} \right\rangle = 0$$
(7)
$$\left\langle {\beta_{{i,{\text{rot}}}} (t) \cdot \beta_{{i,{\text{rot}}}} (t')} \right\rangle = 2k_{\text{B}} T\alpha_{{i,{\text{rot}}}} \delta (t - t')$$
(8)

where δ(t) is the Dirac delta function. The translational and rotational friction coefficients are related to the fluctuations of the random forces and torques by the fluctuation–dissipation theorem.

2.1 Other forces and torques

Theoretically, two kinds of forces can contribute to the interparticle potential in the system: the van der Waals forces and the electrostatic repulsive forces. The theoretical description of these two forces is known as the Derjaguin–Landau–Verwey–Overbeek (DLVO) theory (Horinek 2014; Mikelonis et al. 2016; Liu et al. 2016). With magnetic suspensions, we should add the magnetic dipolar forces between two particles. Finally, the steric repulsion forces have to be taken into account for coated nanoparticles. The stabilization of magnetic particles can be achieved by acting on one or both of the two repulsive forces: electrostatic and steric repulsions. When both electrostatic and steric stabilizations are handled, it is necessary to obtain stable iron-oxide nanoparticles. Controlling the strength of these forces is a key issue in order to model a good stability of nanoparticles (Lim and Feng 2012; Oyegbile et al. 2016). We consider the possibility that nanoparticles interact by such kind of force equations, but they cannot overlap; therefore, there should be a minimum interparticle distance.

2.1.1 The van der Waals force

According to the Derjaguin approximation (Lebovka 2014), the van der Waals’ interaction energy between spherical particles of radii r i and r j is:

$$E_{{{\text{vdw}},ij}} = - \frac{{A_{\text{eff}} }}{6}\left[ {\frac{{2r_{i} r_{j} }}{{s_{ij} \left( {D_{ij} + r_{i} + r_{j} } \right)}} + \frac{{2r_{i} r_{j} }}{{D_{ij}^{2} - \left( {r_{i} - r_{j} } \right)^{2} }} + \ln \frac{{D_{ij}^{2} - \left( {r_{i} + r_{j} } \right)^{2} }}{{D_{ij}^{2} - \left( {r_{i} - r_{j} } \right)^{2} }}} \right]$$
(9)
$$\vec{F}_{{{\text{vdw}},ij}} = - \nabla E_{{{\text{vdw}},ij}} = \frac{{A_{\text{eff}} D_{ij} (4r_{i} r_{j} )^{3} }}{6}\left[ {\frac{1}{{\left( {s_{ij} (D_{ij} + r_{i} + r_{j} )} \right)^{2} \cdot \left( {D_{ij}^{2} - \left( {r_{i} - r_{j} } \right)^{2} } \right)^{2} }}} \right]\hat{n}_{ij}$$
(10)

where \(\hat{n}_{ij}\) is the versor of the direction connecting the ith and jth particles, D ij is the distance between the centres of the ith and jth nanoparticles, s ij  = D ij   (r i  + r j ) is the surface-to-surface separation between the ith and jth nanoparticles and A eff is the Hamaker effective constant for iron-oxide nanoparticles in water. If s ij is less than 1 nm, then it is fixed to 1 nm to avoid a singularity in the above equation (Lim and Feng 2012). The magnitude and range of the van der Waals interaction is closely related to the value of the Hamaker constant, A eff, which depends on the dielectric properties of the involved materials and the intervening medium (Faure et al. 2011). The Hamaker constants for iron-oxide nanoparticles in various media have been calculated by using the Lifshitz theory (Faure et al. 2011). For nanoparticles interacting across water, A eff results between 33 × 10−20 and 39 × 10−20 J (Faure et al. 2011). The expressions for the dielectric responses of three iron-oxide phases (magnetite, maghemite and hematite) were derived from recently published optical data (Babick 2016).

2.1.2 The electrostatic force

The electrostatic stabilization of colloids is the mechanism in which the ionic groups can adsorb to the surface of a colloidal particle, forming a charged layer, in liquid dispersion media. Most charged colloidal particles possess electrical double layers at their surfaces, and these form the basis of repulsive interactions. The potential of double layer electrostatic interaction is used in the literature (Lebovka 2014; Faure et al. 2011; Babick 2016; Yao et al. 2016; Park and Kima 2015; Michel and Gradzielski 2012). If the normalized distances \(k \ \cdot s_{ij} \ge 4\), then we have the following formulation for the electrostatic potential energy \(V_{{{\text{el}},{\text{DL}},ij}}\):

$$V_{{{\text{el}},{\text{DL}},ij}} = 4\pi \varepsilon \ \left( {\frac{{k_{\text{B}} T}}{ze}} \right)^{2} \varPhi_{i}^{*} \ \varPhi_{j}^{*} \ \frac{{r_{i} r_{j} }}{{D_{ij} }} \ e^{{ - \kappa s_{ij} }}$$
(11)
$$\varPhi_{i}^{*} = 4\tanh \left( {\frac{{\varPhi_{i} }}{4}} \right),\,\varPhi_{i} = \frac{{ze\varPhi_{0i} }}{{k_{\text{B}} T}}$$
(12)

where \(\varPhi_{0i}\) is the surface potential of the ith nanoparticle at infinite separation, and the thickness of the screening ionic layer κ is estimated by the inverse of Debye constant, in case of 1:1 salt concentration:

$$\kappa = \sqrt {\frac{{2e^{2} n_{0} z^{2} }}{{\varepsilon k_{\text{B}} T}}}$$
(13)

Here, \(e = 1.6 \ \times 10^{ - 19} {\text{C}}\)(electron charge), n 0 is the concentration of ions in bulk solution, z is the valence of ions in symmetrical (z–z) electrolyte, ε is the electrical permittivity of the solvent (for water \(78.5 \ \times 8.85 \ \times 10^{ - 12} {\text{F/m}}\)), \(k_{\text{B}} = 1.38 \ \times 10^{ - 23} {\text{J/K}}\) is the Boltzmann constant and T is the absolute temperature. If the ions have higher valences, the following formulation is used:

$$\kappa = \sqrt {\frac{{e^{2} \sum\nolimits_{i} {c_{i} z_{i}^{2} } }}{{\varepsilon k_{\text{B}} T}}}$$
(14)

where c i is the concentration of the ith ion species in bulk solution. The local ion concentrations around nanoparticle surfaces can be measured using, for instance, ion-sensitive fluorophores (Zhang et al. 2010, 2011; Riedinger et al. 2010; Wiśniewska et al. 2016). The electrostatic force is then defined as:

$$\vec{F}_{{{\text{el}},{\text{DL}},ij}} = - \nabla V_{{{\text{el}},{\text{DL}},ij}} = - 4\pi \varepsilon \ \left( {\frac{{k_{\text{B}} T}}{ze}} \right)^{2} \varPhi_{i}^{*} \ \varPhi_{j}^{*} \ \frac{{r_{i} r_{j} (1 + kD_{ij} )}}{{D^{2}_{ij} }} \ e^{{ - \kappa s_{ij} }} \hat{n}_{ij}$$
(15)

When the normalized distances \(k \ \cdot s_{ij} < 4\), considering the constant potential approximations (Lebovka 2014), we obtain:

$$V_{{{\text{el}},{\text{DL}},ij}} = 2\pi \varepsilon \ \frac{{r_{i} r_{j} }}{{r_{i} + r_{j} }}\left[ {2\varPhi_{0i} \varPhi_{0j} \ln \left( {\frac{{1 + e^{{ - ks_{ij} }} }}{{1 - e^{{ - ks_{ij} }} }}} \right) + \left( {\varPhi_{0i}^{2} + \varPhi_{0j}^{2} } \right) \ \ln (1 - e^{{ - 2\kappa s_{ij} }} )} \right]$$
(16)
$$\vec{F}_{{{\text{el}},{\text{DL}},ij}} = - 4\pi \varepsilon k \ \left( {\frac{{r_{i} r_{j} }}{{r_{i} + r_{j} }}} \right)^{2} \left( {\frac{{e^{{ - ks_{ij} }} }}{{1 - e^{{ - 2ks_{ij} }} }}} \right) \ (\varPhi_{0i}^{{}} - \varPhi_{0j} )^{2} \hat{n}_{ij}$$
(17)

The surface potential of the ith nanoparticle at infinite separation is given by (Alfimov et al. 2014):

$$\varPhi_{0i} = \frac{q}{{4\pi \varepsilon r_{i} (1 + kr_{i} )}}$$
(18)

where q is the effective charge of the particles. However, due to the advantages in terms of simplicity and computational cost, the charge stabilization is still widely used in stabilizing the dispersions in aqueous media.

2.1.3 The steric force

The steric interactions arise when large molecules are adsorbed on the surface of the particles and prevent direct interparticle contacts. The polymers and surfactants are commonly used as steric stabilizers. In the scientific literature, the most common coatings are dextran, carboxymethylated dextran, carboxydextran, starch, arabinogalactan, glycosaminoglycan, sulfonated styrene–divinylbenzene, polyethylene glycol (PEG), polyvinyl alcohol (PVA), poloxamers and polyoxamines (Scherer and Figueiredo Neto 2005). The steric force is difficult to model and quantify. Many theories have been proposed for explaining the steric stabilization mechanism, and many theoretical equations have been devised for calculating the energy change with the overlap of the adsorption layer (Scherer and Figueiredo Neto 2005; Lin and Wiesner 2012; Runkana et al. 2006; Gillespie 2015; van Gruijthuijsen et al. 2013). The interaction energy between two equal spheres can be obtained from (Scherer and Figueiredo Neto 2005; Lin and Wiesner 2012; Runkana et al. 2006; Gillespie 2015; van Gruijthuijsen et al. 2013):

$$V_{\text{steric}}^{\text{ES}} (s_{ij} ,r_{i} ) = \frac{{k_{B} T\pi d_{i}^{2} \xi }}{2}\left[ {2 - \frac{l + 2}{t}\ln \left( {\frac{1 + t}{1 + l/2}} \right) - \frac{l}{t}} \right]$$
(19)

where \(d_{i} = 2r_{i}\), \(l = 2s_{ij} /d_{i} ,\) s ij is again the separation between the surfaces, \(t = 2\delta /d_{i}\) and \(\xi\) is the surface density of the polymers. The interaction energy between two unequal spheres can be obtained from that of equal spheres, using the following relation (Runkana et al. 2006):

$$V_{\text{steric}}^{\text{ES}} (s_{ij} ,r_{i} ,r_{j} ) = \frac{{2r_{j} }}{{r_{i} + r_{j} }}V_{\text{steric}}^{\text{ES}} (s_{ij} ,r_{i} )$$
(20)
$$\vec{F}_{{{\text{steric}},ij}} = - \nabla V_{steric,ij}^{\text{ES}}$$
(21)
$$\vec{F}_{{{\text{steric}},ij}} = \frac{{k_{\text{B}} T\pi d_{i}^{{}} \xi }}{t} \ \frac{{2r_{j} }}{{r_{i} + r_{j} }} \ \ln \left( {\frac{1 + t}{1 + l/2}} \right) \ \hat{n}_{ij}$$
(22)

The electrostatic and steric stabilizations can be combined as electrosteric stabilization (Wiśniewska et al. 2016). The origin of the electrostatic component may be a net charge on the particle surface and/or charges associated with the polymer attached to the surface (i.e. through an attached polyelectrolyte).

2.1.4 The dipolar magnetic interaction

Each monodomain nanoparticle is characterized by a magnetic moment, which is usually given by Haase and Nowak (2012):

$$\vec{\mu }_{i} = M_{\text{s}} V_{i} \hat{\mu }_{i}$$
(23)

where M s is the spontaneous magnetization, V i is the particle volume and \(\hat{\mu }_{i}\) is the unit vector of the magnetic moments. Let \(\vec{\mu }_{i}\) be the magnetic moment of the ith nanoparticle, and \(\vec{\mu }_{j}\) the magnetic moment of the jth nanoparticle, both with uniaxial anisotropy. The energy of the dipolar magnetic interaction between the two nanoparticles (i and j) is given by the relation (Haase and Nowak 2012):

$$V_{{{\text{md}},ij}} = \frac{{\mu_{0} }}{4\pi } \ \cdot \frac{{\mu_{i} \mu_{j} }}{{D_{ij}^{3} }}\left[ {\hat{\mu }_{i} \ \cdot \hat{\mu }_{j} - 3\left( {\hat{\mu }_{i} \ \cdot \hat{n}_{ij} } \right)\left( {\hat{\mu }_{j} \ \cdot \hat{n}_{ij} } \right)} \right]$$
(24)

where μ0 is the vacuum magnetic permeability; D ij is again the distance between the centres of the two nanoparticles; \(\hat{n}_{ij}\) is again the versor of the direction that connects the nanoparticles i and j; \(\hat{\mu }_{i} \,\) and \(\hat{\mu }_{j}\) are the unit vectors of the magnetic moments of the nanoparticles i and j, respectively.

The dipolar magnetic force exerted between the magnetic moments of the nanoparticles i and j is given by Haase and Nowak (2012):

$$\vec{F}_{{{\text{md}},ij}} = - \nabla V_{{{\text{md}},ij}} = \frac{{3\mu_{0} }}{{4\pi D_{ij}^{5} }}\left[ {(\vec{\mu }_{i} \ \cdot \vec{D}_{ij} ) \ \cdot \vec{\mu }_{j} + (\vec{\mu }_{j} \ \cdot \vec{D}_{ij} ) \ \cdot \vec{\mu }_{i} + (\vec{\mu }_{i} \ \cdot \vec{\mu }_{j} ) \ \cdot \vec{D}_{ij} - \frac{{5(\vec{\mu }_{i} \ \cdot \vec{D}_{ij} ) \ \cdot (\vec{\mu }_{j} \ \cdot \vec{D}_{ij} )}}{{D_{ij}^{2} }}\vec{D}_{ij} } \right]$$
(25)

2.1.5 The magnetic torque

It is well known that the torque acting on an ith nanoparticle can be obtained from:

$$\vec{\tau }_{i} = \mu_{0} (\vec{\mu }_{i} \times \vec{H}_{i} )$$
(26)

where \(\vec{H}_{i}\) is the local magnetic field on ith nanoparticle, expressed as the vectorial sum between the external magnetic field applied \(\vec{H}_{\text{ext}}\) and the internal dipolar magnetic field \(\vec{H}_{\text{id}}\). The latter is determined by the magnetic dipolar interactions among the nanoparticles:

$$\vec{H}_{i} = \vec{H}_{\text{ext}} + \vec{H}_{\text{id}}$$
(27)

3 Algorithm for simulating the Langevin dynamics

In order to numerically solve Eqs. (1) and (3) of motion, we use the effective Verlet-type algorithm introduced by Grønbech-Jensena and Faragoa (2013), for the general simulation of Langevin Dynamics. In order to overcome the difficulties brought by the non-analytical aspect of \(\beta_{{i,{\text{tr}}/{\text{rot}}}} (t)\) in the equations of motion (1) and (3), we replace the delta function in (6) and (8) with a set of rectangular pulses of mean-squared size \(\sqrt {2k_{\text{B}} T\alpha_{{i,{\text{tr}}/{\text{rot}}}} /{\text{d}}t}\), each of which acting over the centred time interval (t n   dt/2, t n  + dt/2).

We randomly initialize the nanoparticle positions in simple centred cubic (scc), or body centred cubic (bcc), or face centred cubic (fcc) lattices. We also initialize the linear speeds using the Maxwell–Boltzmann distribution. We use discrete notation for time-dependant variables \(r_{i}^{n} = r_{i} (t_{n} )\), \(v_{i}^{n} = v_{i} (t_{n} )\) and \(f_{i}^{n} = f_{i} (r_{i}^{n} ,t_{n} )\), for the ith nanoparticle. The algorithm starts by integrating the Langevin Eq. (1) over a small time interval dt between time \(t_{n}\) and \(t_{n + 1} = t_{n} + {\text{d}}t\) (Grønbech-Jensena and Faragoa 2013) and considering the following approximation:

$$r_{i}^{n + 1} - r_{i}^{n} \approx \frac{{{\text{d}}t}}{2}(v_{i}^{n + 1} + v_{i}^{n} )$$
(28)

The integration algorithm for Eq. (1) provides

$$r_{i}^{n + 1} = r_{i}^{n} + b_{{i,{\text{tr}}}} {\text{d}}tv_{i}^{n} + \frac{{b_{{i,{\text{tr}}}} {\text{d}}t^{2} }}{{2m_{i} }}f_{i}^{n} + \frac{{b_{{i,{\text{tr}}}} {\text{d}}t}}{{2m_{i} }}\beta_{{i,{\text{tr}}}}^{n + 1}$$
(29)

with \(b_{{i,{\text{tr}}}} = \frac{1}{{1 + \frac{{\alpha_{{i,{\text{tr}}}} {\text{d}}t}}{{2m_{i} }}}}\). On the other hand, the equation \(v_{i}^{n + 1} = \frac{{r_{i}^{n + 1} - r_{i}^{n} }}{{{\text{d}}t}}\) has been used, with:

$$v_{i}^{n + 1} = v_{i}^{n} + \frac{{{\text{d}}t}}{{2m_{i} }}(f_{i}^{n} + f_{i}^{n + 1} ) - \frac{{\alpha_{{i,{\text{tr}}}}^{{}} }}{{m_{i} }}(r_{i}^{n + 1} - r_{i}^{n} ) + \frac{1}{{m_{i} }}\beta_{{i,{\text{tr}}}}^{n + 1}$$
(30)

We scale the linear speeds to establish the temperature set point

$$v_{i}^{n + 1} = v_{i}^{n + 1} \ \cdot vscale_{i}$$
(31)

with \(v{\text{scale}}_{i} = \sqrt {\frac{{3k_{\text{B}} T}}{{m_{i} \bar{v}^{2} }}}\) where \(\bar{v}^{2}\) is the mean-square velocity. We extended the algorithm presented in Grønbech-Jensena and Faragoa (2013) for translational and rotational LD. In order to define the integration algorithm for Eq. (3), we initialize the rotation angles and the angular rotation speeds of the magnetic moments of nanoparticles. Then, the integration algorithm for Eq. (3) is:

$$\phi_{i}^{n + 1} = \phi_{i}^{n} + b_{{i,{\text{rot}}}} {\text{d}}t\omega_{i}^{n} + \frac{{b_{{i,{\text{rot}}}} {\text{d}}t^{2} }}{{2I_{i} }}T_{i}^{n} + \frac{{b_{{i,{\text{rot}}}} {\text{d}}t}}{{2I_{i} }}\beta_{{i,{\text{rot}}}}^{n + 1}$$
(32)

with \(b_{{i,{\text{rot}}}} = \frac{1}{{1 + \frac{{\alpha_{{i,{\text{rot}}}} {\text{d}}t}}{{2I_{i} }}}}\). On the other hand, the equation \(\omega_{i}^{n + 1} = \frac{{\phi_{i}^{n + 1} - \phi_{i}^{n} }}{{{\text{d}}t}}\) has been used, with

$$\omega_{i}^{n + 1} = \omega_{i}^{n} + \frac{{{\text{d}}t}}{{2I_{i} }}(T_{i}^{n} + T_{i}^{n + 1} ) - \frac{{\alpha_{{i,{\text{rot}}}}^{{}} }}{{I_{i} }}(\phi_{i}^{n + 1} - \phi_{i}^{n} ) + \frac{1}{{I_{i} }}\beta_{{i,{\text{rot}}}}^{n + 1}$$
(33)

We scale the angular speeds to establish the temperature set point

$$\omega_{i}^{n + 1} = \omega_{i}^{n + 1} \ \cdot \omega_{{{\text{scale}}\,i}} ,$$
(34)
$${\text{with}}\quad \omega_{{{\text{scale}}\,i}} = \sqrt {\frac{{3k_{\text{B}} T}}{{I_{i} \bar{\omega }^{2} }}}$$
(35)

where \(\bar{\omega }^{2}\) is the mean-square of the angular velocities. Then, we update the orientation of the ith nanoparticle magnetic moment, i.e.

$$\vec{\mu }_{i}^{n + 1} = \vec{\mu }_{i}^{n} + \left( {\vec{\omega }_{i}^{n + 1} \times \vec{\mu }_{i}^{n} } \right) \ \cdot {\text{d}}t$$
(36)

4 Results and discussion

4.1 Simulation conditions

For this study, we consider the case of a colloid with electrosteric stabilization. We consider that the system comprises 100 spherical nanoparticles of magnetite with spontaneous magnetization of 4.46 × 105 A/m, having sizes and effective magnetic anisotropy constants with lognormal distributions. Nanoparticles are dispersed in water having a dynamic viscosity of 8.9 × 10−4 Pa s, and the relative electric permittivity is 78.5. The Hamaker constant for magnetite in water is 39 × 10−20 J (Faure et al. 2011). We fixed the temperature at 298 K, the coating thickness at 4 nm. The resulting ion concentration in solution is 1026 ions/m3, and ions have valence Z = 1. The surface density of the polymers is fixed at ξ = 10−18 m−2, and the surface charge is 1.6 × 10−15 C. The average diameter of the nanoparticles has been fixed at d m  = 20 nm, with a standard deviation of 0.1 × d m . We consider that the volume fraction of the nanoparticles is f = 0.1. We set the external magnetic field intensity to 15 kA/m along the Z-axis.

Initially, we consider a random placement of the nanoparticles in an fcc grid. Since our interest is to inspect the physical phenomenon of aggregation, we have to consider moving nanoparticles. In this case, it is not possible to exploit the Ewald summation to simulate long-range magnetic dipolar interactions (Wang and Holm 2001). In fact, Ewald summation rearranges the issue of approximating long-range magnetic interactions in a Fourier-like domain. This implies that nanoparticles are fixed when located in a grid, i.e. in a lattice. In our case, instead, nanoparticles move and no spatial constant among possible positions of nanoparticles is present. It means that, when nanoparticles move, the same concept of “grid” vanishes. Therefore, we simulate the magnetic dipole–dipole interactions (referring to potentials and forces) by using direct summation technique.

4.2 The integrator stability

Some of the desired attributes required by a Langevin integrator are: accuracy, stability and efficiency. Accuracy means that the trajectories of nanoparticles obey to the equations of motion with good approximation. Theoretically, the accuracy could be improved by reducing the time integration step dt. Unfortunately, the Lyapunov instability (Liang et al. 2016) introduces constraints on the time integration step dt. Constraints are heightened by limits in viscous approximation when accounting random translations and rotations of nanoparticles (Tanygi et al. 2015). Therefore, time step cannot be reduced too far. For our simulations, the lower limit of the time integration step is 2.154876419097160e−10 s, because of viscous limit approximation. Figure 1 shows the positions of a single nanoparticle during the simulating time, for 3 different values of the time integration step.

Fig. 1
figure 1

Positions assumed by a single nanoparticle during the simulating time, for 3 values of the time integration step: a dt = 10−7 s, b dt = 10−8 s, c dt = 10−9 s

Figure 1 provides well-defined data about the impact of dt on the positions of simulated nanoparticles. As it is possible to notice, reducing the time step affects the precision of positions. In any case, they are located around defined central positions. This occurs above all when time step assumes values of 10−7 and 10−8 s, with a sort of cloud of positions assumed by the considered nanoparticle during the time. Reducing the time step to 10−9 s introduces some sparse agglomerations, emphasizing that the influence of time step on the nanoparticle behaviour is local, affected by approximations of simulation and it does not involve the general spatial behaviour of nanoparticles during the simulation. The accuracy is determined by the magnitude of errors. The total energy drift is defined as the gradual change in the total energy of a closed system over time:

$$Energy\,\,drift = \frac{{E - E_{i} }}{{E_{i} }}$$
(37)

where E is the total energy in the current step and E i is total initial energy. Figure 2 shows the energy drift versus time, for three different values of the time integration step. We can see that the energy drift fluctuations increase as the time integration step increases, but the increases do not exceed 0.5%.

Fig. 2
figure 2

Energy drift versus time, for 3 values of the time integration step

Figure 3 shows the average energy drift versus the time integration step. The average energy drift varies from 0.9 × 10−3 to 1.85 × 10−3. The average energy drift increases with the increasing of the time integration step, more pronounced when the time integration step has low values. We can see that the average energy drift remains approximately constant when the time integration step goes over 5 × 10−8 s.

Fig. 3
figure 3

Average energy drift versus time integration step

The algorithm efficiency refers to the efficiency in time of the algorithm itself. The increasing of the algorithm efficiency primarily involves the simplification of procedures applied to assess the forces and moments in each integration step. The stability implies that the algorithm does not lead to large variations of energy during time. Figure 4 shows the total energy of the system versus time, for 3 values of the time integration step dt. For dt = 10−9 s, the total energy varies in time from 1.47 × 10−14 to 1.4725 × 10−14 J. For dt = 10−8 s, the total energy varies in time from 1.47 × 10−14 to 1.476 × 10−14 J, except a single value found at the beginning. For dt = 10−7 s, the energy variation in time ranges from 1.47 × 10−14 to 1.48 × 10−14 J. The three subfigures of Fig. 4 depict a clear behaviour: refining the time integration step decrements the errors of approximations, but they are not so intense to justify an extreme increasing of computing time and complexity. Therefore, the use of a lower dt reduces the errors of approximation but increases the computing time of simulation. If errors are not relevantly reduced; as in our case, the approximation of dt with one or two orders of magnitude higher than 10−9 s provides similar results with lower computational times. The first value obtained for dt = 10−8 s, appearing as a simulation outlier, could be resulted from a strange behaviour of the simulation algorithm due to the random choice of initial conditions. It does not affect the general considerations, as above described.

Fig. 4
figure 4

Total system energy versus time: a dt = 10−9s, b dt = 10−8 s, c dt = 10−7 s

Figure 5 shows the a) average potential and total energy versus time integration step and b) the average kinetic energy versus time integration step. The average potential and total energies show a slight increase from 1.471 × 10−14 to 1.475 × 10−14 J, with an approximately constant trend from 5 × 10−8 s, while the average kinetic energy slightly decreases from 1.234 × 10−18 to 1.228 × 10−18 J, as integration time step increases. We conclude that, the integrator we have used is quite stable for the time integration steps dt = 10−7 s or dt = 10−8 s. Therefore, in order to have a good balance between precision and computational costs, we used dt = 10−8 s with good accuracy, stability and efficiency.

Fig. 5
figure 5

Total energy, potential (a) and kinetic (b) versus time integration step

4.3 Results

We considered a system composed by 100 spherical magnetite nanoparticles, having the physical properties specified in Sect. 4.1. Initially, we set the external magnetic field intensity to 15 kA/m along the z-axis. Nanoparticles have been placed in a fcc lattice (please, refer to Sect. 4.1 for details), therefore simulating a sort of box containing the colloidal suspension of nanoparticles. We refer to this box with the name of “test cube”, too.

Figures 6 and 7 show the positions of nanoparticles inside the test cube, in a) starting time of simulation and b) after 1 ms. We found that the nanoparticle agglomeration is time dependent: as time elapses, agglomeration increases.

Fig. 6
figure 6

Positions of nanoparticles inside the test cube in a initial moment and b after 1 ms (external magnetic field intensity 15 kA/m)

Fig. 7
figure 7

Orientation of the nanoparticle magnetic moments inside the test cube in a initial moment and b after 1 ms (external magnetic field intensity 15 kA/m)

Initially, the nanoparticles move in random directions and small groups of nanoparticles are formed in different locations. Then nanoparticles are able to minimize the energy via self-assembly into aggregate structure. Thus, as Fig. 6b shows, an aggregate structure consisting either of linear chains or dense globes and rings are formed after 1 ms. This behaviour could be attributed to isotropic attractives forces like van der Waals and anisotropic dipole–dipole interactions. The slow forming of the branched chains can be explained as a cooperative effect of the attractive magnetic interactions among nanoparticles. These chains can be curved due to Brownian motion and different dimensions of nanoparticles. In weak external magnetic field, the nanoparticles easily rotate and form clusters arrangement. These results are also confirmed by other contemporary studies about the same matter (Tanygi et al. 2015; Margabandhul et al. 2016; Iyengar et al. 2016; Usanov et al. 2016). In fact, Tanygi et al. (2015) proposed their simulation results by exploiting an Euler method based on finite differences. These results provide fine structures of the transitions from “linear chains” to “dense globes” through the ring assembly structure. Margabandhul et al. (2016) experimentally observed the aggregation of nanoparticles along the applied magnetic field in a Co-Mn ferrofluid, with diameters of nanoparticles between 88 and 71 nm. Iyengar et al. (2016) reported the development of ultra-stable aqueous colloidal dispersions of magnetite nanocrystals produced by aqueous “coprecipitation method”. TEM images of tetramethylammonium hydroxide coated magnetite nanocrystals indicate the presence of nanoparticle clusters. Usanov et al. (2016) found that the length of agglomerates in a magnetic nanofluid subjected to an external magnetic field substantially increases with weak or strong fields, with a sharp intensification in the latter case.

In Fig. 7, we can see that the nanoparticle magnetic moments are not fully aligned with the external magnetic field when the external magnetic field intensity is 15 kA/m. Initially, orientations of the magnetic moments of the nanoparticles are random (Fig. 7a). After 1 ms, many circular arrangements can be detected, with magnetic moments of the arrangements rotating in both directions (clockwise and counterclockwise, Fig. 7b). These approximately circular arrangements are probably due to the action of long-range attractive forces. The experimental observations of formation and annihilation of vortices are reported in the scientific literature (Pinilla-Cienfuegos et al. 2016), with 25-nm molecular-based magnetic nanoparticles, inspected by low-temperature, variable-field magnetic force microscopy. Authors remark that the switching of the vortex structure can be induced with very small values of the applied static magnetic field. The observations of a resonant toroidal response in metamaterials are already known (Papasimakis et al. 2016). These observations have enabled the systematic study of a number of phenomena: e.g. the toroidal electrodynamics with a wide-range toroidal order, the magnetoelectric effect, the ferrotoroidic order and the hysteretic effects of these kinds of materials. These studies open new perspectives for understanding the behaviour of nanofluids, with applications in engineering and medicine.

If we increase the external magnetic field intensity to 150 kA/m along the z-axis, we obtain aggregate structures consisting of several chains oriented more or less along the external magnetic field (Fig. 8). Figure 8 shows that the magnetic moments of nanoparticles are generally aligned, being the orientation of the local magnetic fields closer to the external magnetic field. A high external magnetic field breaks circular structures and forms chains, almost oriented along the direction of the external field.

Fig. 8
figure 8

Nanoparticles inside the test cube after 1 ms (external magnetic field intensity 150 kA/m): a positions and b orientation of magnetic moments

Figure 9 presents the positions of nanoparticles inside the test cube after 5 and 10 ms, with an intensity of the external magnetic field equal to 150 kA/m. We can see that chain structures persist and grow in size during time. When simulation time increases, more nanoparticles attach to these chains. As it is possible to see by Fig. 9, the aggregate structures, such as linear chains, are oriented along the external magnetic field direction (i.e. the direction of the z-axis in our simulation), while time elapses.

Fig. 9
figure 9

Positions of nanoparticles inside the test cube after a 5 ms and b 10 ms (external magnetic field intensity 150 kA/m)

5 Conclusions

This paper presents a study about the agglomeration of nanoparticles in a magnetic nanofluid. We inspected long-range and short-range interactions, summarized in dissipative and conservative contributions in a Langevin-type model for translation and rotation movements simultaneously, exploiting a self-implemented Verlet-type integrator.

Our method considers the case of a colloid with electrosteric stabilization, lognormal distributions of sizes and effective magnetic anisotropy constants of magnetic nanoparticles, as well as the coating thickness of nanoparticles and long-range magnetic dipolar interactions. Our method enables time-by-time access to positions, velocities and energies of nanoparticles. This knowledge is useful in other studies related to possible applications like magnetic hyperthermia or heat transfer phenomena.

In our simulations, we noticed that there is a collective process of aggregation influenced by the local orientations of nanoparticles, subjected to the actions of complex resulting forces and torques acting within the physical system, during time. By applying this model to a nanofluid with magnetite nanoparticles, we obtained aggregate structures consisting of either linear chains or dense globes and rings in weak external magnetic field. These clusters, presenting circular rotations of the magnetic moments in both directions (clockwise and counterclockwise), are confirmed by the actual scientific literature (Pinilla-Cienfuegos et al. 2016; Papasimakis et al. 2016) and open new perspectives for understanding the behaviour of nanofluids with innovative uses in engineering and medicine. With high external magnetic field, the aggregate structures, such as linear chains, grow in time and are oriented along the direction of the external magnetic field, as confirmed by experimental studies proposed in scientific literature (Margabandhul et al. 2016; Usanov et al. 2016). Therefore, the studies and results that we are actually proposing are confirmed by experimental studies already existing in scientific literature. Thus, we can assert that the collective motion of nanoparticles is an organized process that can be simulated by our algorithm. The motion takes place over time and allows organized agglomerations of nanoparticles. The algorithm we have used can be easily implemented.

Controlling the assembly of nanoparticles in nanofluid is the key for a new class of magnetic materials with immediate applications in engineering and nanomedicine, for instance. Reliable computer simulations become really important within this framework, since they can provide a good knowledge of physical behaviour of phenomena during time, contemporaneously allowing the reduction of costs.