Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

HTML conversions sometimes display errors due to content that did not convert correctly from the source. This paper uses the following packages that are not yet supported by the HTML conversion tool. Feedback on these issues are not necessary; they are known and are being worked on.

  • failed: mhchem

Authors: achieve the best HTML results from your LaTeX submissions by following these best practices.

License: arXiv.org perpetual non-exclusive license
arXiv:2312.00022v3 [math.NA] 19 Mar 2024

A finite element method for stochastic diffusion equations using fluctuating hydrodynamics

P. Martínez-Lera M. De Corato Aragon Institute of Engineering Research (I3A), University of Zaragoza,
50018 Zaragoza, Spain
Abstract

We present a finite element approach for diffusion problems with thermal fluctuations based on a fluctuating hydrodynamics model. The governing equations are stochastic partial differential equations with a fluctuating forcing term. We propose a discrete formulation of the fluctuating forcing term that has the correct covariance matrix up to a standard discretization error. Furthermore, we derive a linear mapping to transform the finite element solution into an equivalent discrete solution that is free of the artificial correlations introduced by the spatial discretization. The method is validated by applying it to two diffusion problems: a second-order diffusion equation and a fourth-order diffusion equation. The theoretical (continuum) solution to the first case presents spatially decorrelated fluctuations, while the second case presents fluctuations correlated over a finite length. In both cases, the numerical solution presents a structure factor that approximates well the continuum one.

keywords:
Stochastic partial differential equations, fluctuating hydrodynamics, finite element method, diffusion equation
journal: Journal of Computational Physics

1 Introduction

With microfluidics technologies becoming increasingly widespread and multiple applications already reaching the market level volpatti2014commercialization , the great challenges of technology now shift towards the nanoscale, with potential for multiple breakthroughs and ground-breaking innovations. In analogy with microfluidics, the rapidly growing field of research that studies the flow and transport phenomena in fluidic environments of nanoscopic dimensions has been termed “nanofluidics” bocquet2020nanofluidics . The blooming of nanofluidics was enabled in the last decade by the improvements and development of new experimental and computational techniques and has shown multiple phenomena that have no counterparts at larger scales faucher2019critical ; laine2020nanotribology .

Fluid flow, solute transport and chemical reactions look very different at the nanoscale than they do at the macroscopic level. At the small scales, the thermal fluctuations of solvent and solute molecules are relevant and cannot be ignored. Even in situations where one can average over many molecules, quantities like mass, temperature and momentum fluctuate around their mean value de2006hydrodynamic . These fluctuations are very well understood around equilibrium de2006hydrodynamic but can lead to unexpected and highly nontrivial phenomena when they occur in systems driven out of equilibrium donev2011diffusive ; peraud2017fluctuation ; vutukuri2020active .

As most of the applications in energy harvesting, membrane technology and biomedicine involve systems driven out from equilibrium, understanding the effects of thermal fluctuations in these instances is of utmost importance. Thermal fluctuations are also particularly large inside eukaryotic cells, where some molecules are present in very small numbers and need to be recruited in specific locations to achieve their biological functions brown2013linking . Deterministic models fail to predict many of the important consequences of thermal fluctuations, which calls for the development of efficient numerical tools that can include them within an efficient framework.

To do so, one possibility is to modify the deterministic partial differential equations (PDEs) that are typically used to model phenomena at larger scales to include stochasticity. One such approach to incorporate the effect of the thermal fluctuations in the transport equations was proposed by Landau and Lifschitz landau2013statistical , and is based on adding a stochastic forcing term that satisfies the fluctuation-dissipation balance. The transport equations that result from adding a fluctuating forcing term are stochastic partial differential equations (SPDEs). This approach to include thermal fluctuations into deterministic PDEs has been called fluctuating hydrodynamics de2006hydrodynamic and it has been used to study stochastic drift-diffusion equations (e.g. donev2011diffusive ; leonard2013stochastic ; chaudhri2014modeling ; peraud2016low ; donev2019fluctuating ), stochastic reaction-diffusion equations (e.g. atzberger2010spatially ; bhattacharjee2015fluctuating ; kim2017stochastic ), the Brownian motion of colloidal particles (e.g. usabiaga2013inertial ; keaveny2014fluctuating ; delmotte2015simulating ; de2016finite ; sprinkle2019brownian ; westwood2022generalised ), fluctuations of viscoelastic fluids hutter2018fluctuating ; hutter2020fluctuating , stochastic thin-film equations (e.g. tsekov1993effect ; sprittles2023rogue ; liu2023thermal ), diffusion within membranes and liquid-liquid interfaces (e.g. wang2013dynamic ; rower2022surface ), and bubble nucleation and growth (e.g. gallo2018thermally ; gallo2023nanoscale ). The advantage of a fluctuating hydrodynamics approach compared to discrete particle methods is apparent when one needs to study mesoscopic systems that involve a vast number of particles and long timescales compared to the characteristic diffusion time of individual particles.

In this work, we propose a finite element framework to solve diffusion equations using fluctuating hydrodynamics. The governing equations are SPDEs of the kind

ut(DF(u))=(2Du𝜻).𝑢𝑡𝐷𝐹𝑢2𝐷𝑢𝜻\frac{\partial{u}}{\partial t}-\nabla\cdot\left(D\nabla F(u)\right)=\nabla% \cdot\left(\sqrt{2Du}\boldsymbol{\zeta}\right)\,.divide start_ARG ∂ italic_u end_ARG start_ARG ∂ italic_t end_ARG - ∇ ⋅ ( italic_D ∇ italic_F ( italic_u ) ) = ∇ ⋅ ( square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ) . (1)

where u𝑢uitalic_u is the number density of a diffusing species, D𝐷Ditalic_D is its diffusion coefficient and 𝜻𝜻\boldsymbol{\zeta}bold_italic_ζ represents white noise in space and time, with stochastic properties given by

ζi(𝐱,t)=0delimited-⟨⟩subscript𝜁𝑖𝐱𝑡0\left<\zeta_{i}(\mathbf{x},t)\right>=0\,⟨ italic_ζ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x , italic_t ) ⟩ = 0 (2)

and

ζi(𝐱,t)ζj(𝐱,t)=δijδ(𝐱𝐱)δ(tt).delimited-⟨⟩subscript𝜁𝑖𝐱𝑡subscript𝜁𝑗superscript𝐱superscript𝑡subscript𝛿𝑖𝑗𝛿𝐱superscript𝐱𝛿𝑡superscript𝑡\left<\zeta_{i}(\mathbf{x},t)\zeta_{j}(\mathbf{x}^{\prime},t^{\prime})\right>=% \delta_{ij}\delta(\mathbf{x}-\mathbf{x}^{\prime})\delta(t-t^{\prime})\,.⟨ italic_ζ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x , italic_t ) italic_ζ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = italic_δ start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT italic_δ ( bold_x - bold_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) . (3)

In the case of F(u)=u𝐹𝑢𝑢F(u)=uitalic_F ( italic_u ) = italic_u, Equation (1) can be formally derived from the motion of independent point-sized Brownian walkers using Ito calculus dean1996langevin ; donev2014dynamic , and it is nothing more than a rewriting of the equations of motion of a collection of independent Brownian walkers in terms of their density, u𝑢uitalic_u. Stochastic equations of the form of Eq. (1) also arise in the context of Dynamic Density Functional Theory donev2014dynamic ; archer2004dynamical . While an ensemble-average of the stochastic equations describing the trajectories of the Brownian walkers would lead to a deterministic PDE describing the time evolution of the particle distribution, an SPDE like Equation (1) describes the evolution of a coarse-grained density distribution instead. Detailed discussions on the derivation of deterministic and stochastic equations in this context and their different interpretations can be found in archer2004dynamical ; donev2014dynamic ; chavanis2015generalized ; chavanis2019generalized .

In Equation (1) we have abused notation to highlight its formal similarity to deterministic PDEs, but, in fact, neither the solution u𝑢uitalic_u nor the white-noise source term 𝜻𝜻\boldsymbol{\zeta}bold_italic_ζ can be interpreted as differentiable point-wise functions. Still, as mentioned above, numerical solutions to equations based on fluctuating hydrodynamics such as Equation (1) are widely used to capture the physical effects from the effect of thermal fluctuations. Furthermore, recent advances in the theoretical analysis front seem to confirm that the truncation of the fluctuations for small wavelengths, including the natural truncation resulting from standard spatial discretization techniques, leads to well-posed fluctuating hydrodynamics equations cornalba2023dean .

When solving such equations, one is interested in the expected value of the solution, but also in its second-order statistical moments. For instance, the so-called structure factor, related to the spatial Fourier transform of the autocorrelation function of the solution, can be measured experimentally de2006hydrodynamic . However, both the choice of spatial discretization and temporal integration schemes influence the fluctuation-dissipation balance and can introduce artificial spatial correlations in the solution, thus leading to non-physical second-order statistical moments. delong2013temporal ; donev2010accuracy

For this reason, the effect of time integrators on the solution of fluctuating-hydrodynamics equations has been investigated in depth delong2013temporal ; donev2010accuracy . As for the spatial discretization, finite volume methods (e.g. donev2010accuracy ; balboa2012staggered ; russo2021finite ; kim2017stochastic ) can be designed so as not to introduce additional artificial correlations, since each degree of freedom typically corresponds to a single finite volume, for which the solution can be integrated independently of the rest of finite volumes. This is not the case, however, for finite element methods in general, which yield solutions with artificial correlations that depend on the choice of shape functions de2015finite . This makes finite element solutions difficult to interpret physically and nonlinear terms in the equations difficult to handle mathematically. To overcome this limitation for general finite element methods, it has been suggested that specialized finite element discretization schemes should be used, which are designed based on physical considerations instead of just numerical analysis de2015finite . The rationale behind this strategy is based on the idea that discretization and physical coarse-graining are deeply connected.

In the present work, we start from a different perspective and propose an approach that yields a finite element solution to Equation (1) in which both the expected value of the solution and its second-order statistical moments are well approximated. In particular, we propose to first obtain a numerical solution using any suitable spatial discretization that is selected based on numerical analysis only and then apply a linear transformation that removes from the numerical solution the artificial correlations introduced by the chosen spatial discretization. With the proposed approach, the choice of spatial discretization techniques is not restricted anymore to those that produce any particular spatial correlations, and we can use the finite element method and its powerful mathematical framework to deal with complex geometries and boundary conditions without limitations. The resulting solution has a physical interpretation that is detached from the numerical discretization, just as numerical solutions to deterministic PDEs do.

We work in a finite element framework with a standard Galerkin discretization. Nevertheless, our conclusions are generalizable to other numerical approaches that involve a spatial discretization. We apply our method to a second-order diffusion equation and to a fourth-order diffusion equation. The two test cases are complementary, since one presents only short-ranged fluctuations, while the other has a solution that is spatially correlated over a finite length. Both cases were already used in Ref. de2015finite to test a Petrov-Galerkin finite element implementation.

The outline of this paper is as follows: In Section 2 we describe the finite element discretization for a second-order fluctuating diffusion equation that has a solution with short-ranged correlations. We also propose an implementation for the fluctuating forcing term that has the correct covariance up to a normal discretization error. In Section 3, we present finite element results for a one-dimensional boundary value problem of the second-order equation, and we discuss the presence of artificial spatial correlations in the solution due to the effects of the spatial discretization and temporal integration. In Section 4, we propose a linear mapping to remove from the numerical solution the artificial correlations introduced by the spatial discretization, and we apply it to the results of the same second-order diffusion equation. In Section 5, we apply the proposed method to a one-dimensional fourth-order diffusion equation, to test its performance in the case of a solution that is spatially correlated over a finite length. Finally, we summarize our conclusions in Section 6.

2 Numerical approximation

In this section, we describe the numerical schemes used to solve Equation (1) numerically. We focus here on the case F(u)=u𝐹𝑢𝑢F(u)=uitalic_F ( italic_u ) = italic_u, for which numerical results will be presented in Sections 3 and 4. Nevertheless, most of the discretization details presented in this section are also relevant for the case F(u)=u+(0/2π)22u,𝐹𝑢𝑢superscriptsubscript02𝜋2superscript2𝑢F(u)=u+\left(\ell_{0}/2\pi\right)^{2}\nabla^{2}u\,,italic_F ( italic_u ) = italic_u + ( roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT / 2 italic_π ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u , which will be discussed in Section 5.

2.1 Weak form and finite element discretization

We consider the second-order equation

utD2u=(2Du𝜻)𝑢𝑡𝐷superscript2𝑢2𝐷𝑢𝜻\frac{\partial{u}}{\partial t}-D\nabla^{2}u=\nabla\cdot\left(\sqrt{2Du}% \boldsymbol{\zeta}\right)\,divide start_ARG ∂ italic_u end_ARG start_ARG ∂ italic_t end_ARG - italic_D ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u = ∇ ⋅ ( square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ) (4)

with constant diffusion coefficient D𝐷Ditalic_D. This corresponds to Dean’s equation dean1996langevin , which describes the fluctuations of the density in a system of particles undergoing independent Brownian motions. The concentration u𝑢uitalic_u represents therefore a coarse-grained number of particles per unit volume.

A weak formulation of Equation (4) can be obtained by multiplying it by the conjugate of a test function v𝑣vitalic_v and integrating over the domain ΩΩ\Omegaroman_Ω. After integration by parts, one obtains

Ωv*utd3𝐱+ΩDv*ud3𝐱=Ωv*(2Du𝜻)d3𝐱++Ωv*(2Du𝜻)𝐧d2𝐱+ΩDv*u𝐧d2𝐱,subscriptΩsuperscript𝑣𝑢𝑡superscript𝑑3𝐱subscriptΩ𝐷superscript𝑣𝑢superscript𝑑3𝐱subscriptΩsuperscript𝑣2𝐷𝑢𝜻superscript𝑑3𝐱subscriptΩsuperscript𝑣2𝐷𝑢𝜻𝐧superscript𝑑2𝐱subscriptΩ𝐷superscript𝑣𝑢𝐧superscript𝑑2𝐱\int_{\Omega}{v^{*}\frac{\partial{u}}{\partial t}}\,d^{3}\mathbf{x}+\int_{% \Omega}{D\nabla v^{*}\cdot\nabla u}\,d^{3}\mathbf{x}=-\int_{\Omega}{\nabla v^{% *}\cdot\left(\sqrt{2Du}\boldsymbol{\zeta}\right)}\,d^{3}\mathbf{x}+\\ +\int_{\partial\Omega}{v^{*}\left(\sqrt{2Du}\boldsymbol{\zeta}\right)\cdot% \mathbf{n}}\,d^{2}\mathbf{x}+\int_{\partial\Omega}{Dv^{*}\nabla u\cdot\mathbf{% n}}\,d^{2}\mathbf{x}\,,start_ROW start_CELL ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT divide start_ARG ∂ italic_u end_ARG start_ARG ∂ italic_t end_ARG italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x + ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_D ∇ italic_v start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ⋅ ∇ italic_u italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = - ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT ∇ italic_v start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ⋅ ( square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x + end_CELL end_ROW start_ROW start_CELL + ∫ start_POSTSUBSCRIPT ∂ roman_Ω end_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ( square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ) ⋅ bold_n italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT bold_x + ∫ start_POSTSUBSCRIPT ∂ roman_Ω end_POSTSUBSCRIPT italic_D italic_v start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ∇ italic_u ⋅ bold_n italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT bold_x , end_CELL end_ROW (5)

where ΩΩ\partial\Omega∂ roman_Ω is the boundary of the domain and 𝐧𝐧\mathbf{n}bold_n its normal unitary vector.

The domain ΩΩ\Omegaroman_Ω is discretized by dividing it into non-overlapping elements ΩesubscriptΩ𝑒\Omega_{e}roman_Ω start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT, such that Ω=eΩeΩsubscript𝑒subscriptΩ𝑒\Omega=\cup_{e}\Omega_{e}roman_Ω = ∪ start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT roman_Ω start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT with ΩeΩe=subscriptΩ𝑒subscriptΩsuperscript𝑒\Omega_{e}\cap\Omega_{e^{\prime}}=\varnothingroman_Ω start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT ∩ roman_Ω start_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT = ∅ for ee𝑒superscript𝑒e\neq e^{\prime}italic_e ≠ italic_e start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. The solution space, as well as the test function space, are discretized using a given basis of shape functions. Here we use a standard Galerkin discretization with Lagrange polynomials as shape functions ϕi=ϕi(𝐱)subscriptitalic-ϕ𝑖subscriptitalic-ϕ𝑖𝐱\phi_{i}=\phi_{i}(\mathbf{x})italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) for both the test function v𝑣vitalic_v and the solution u𝑢uitalic_u, such that

u(𝐱,t)i=1Ndofu~i(t)ϕi(𝐱),𝑢𝐱𝑡superscriptsubscript𝑖1subscript𝑁dofsubscript~𝑢𝑖𝑡subscriptitalic-ϕ𝑖𝐱u(\mathbf{x},t)\approx\sum_{i=1}^{N_{\text{dof}}}{\widetilde{u}_{i}(t)\phi_{i}% (\mathbf{x})}\,,italic_u ( bold_x , italic_t ) ≈ ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) , (6)

and

v(𝐱,t)i=1Ndofv~i(t)ϕi(𝐱).𝑣𝐱𝑡superscriptsubscript𝑖1subscript𝑁dofsubscript~𝑣𝑖𝑡subscriptitalic-ϕ𝑖𝐱v(\mathbf{x},t)\approx\sum_{i=1}^{N_{\text{dof}}}{\widetilde{v}_{i}(t)\phi_{i}% (\mathbf{x})}\,.italic_v ( bold_x , italic_t ) ≈ ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG italic_v end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) . (7)

where Ndofsubscript𝑁dofN_{\text{dof}}italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT is the total number of degrees of freedom.

The goal of the finite element method is to find the values u~i(t)subscript~𝑢𝑖𝑡\widetilde{u}_{i}(t)over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) that satisfy the discretized weak equation (5) for any values v~i(t)subscript~𝑣𝑖𝑡\widetilde{v}_{i}(t)over~ start_ARG italic_v end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ). Using Equations (5), (6) and (7), we can express this problem as a linear system of equations in matrix form

𝐌𝐮~t+𝐃𝐮~=𝐟+𝐟BC,𝐌~𝐮𝑡𝐃~𝐮𝐟subscript𝐟𝐵𝐶\mathbf{M}\frac{\partial\widetilde{\mathbf{u}}}{\partial t}+\mathbf{D}% \widetilde{\mathbf{u}}=\mathbf{f}+\mathbf{f}_{BC}\,,bold_M divide start_ARG ∂ over~ start_ARG bold_u end_ARG end_ARG start_ARG ∂ italic_t end_ARG + bold_D over~ start_ARG bold_u end_ARG = bold_f + bold_f start_POSTSUBSCRIPT italic_B italic_C end_POSTSUBSCRIPT , (8)

where 𝐌𝐌\mathbf{M}bold_M is the so-called mass matrix

Mij=Ωϕiϕjd3𝐱subscript𝑀𝑖𝑗subscriptΩsubscriptitalic-ϕ𝑖subscriptitalic-ϕ𝑗superscript𝑑3𝐱M_{ij}=\int_{\Omega}{\phi_{i}\phi_{j}}d^{3}\mathbf{x}\,italic_M start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x (9)

𝐃𝐃\mathbf{D}bold_D is the diffusion matrix

Dij=ΩDϕiϕjd3𝐱,subscript𝐷𝑖𝑗subscriptΩ𝐷subscriptitalic-ϕ𝑖subscriptitalic-ϕ𝑗superscript𝑑3𝐱D_{ij}=\int_{\Omega}{D\nabla\phi_{i}\cdot\nabla\phi_{j}}d^{3}\mathbf{x}\,,italic_D start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_D ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x , (10)

𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG is an array that contains the coefficients u~isubscript~𝑢𝑖\widetilde{u}_{i}over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT for each degree of freedom, 𝐟BCsubscript𝐟𝐵𝐶\mathbf{f}_{BC}bold_f start_POSTSUBSCRIPT italic_B italic_C end_POSTSUBSCRIPT is an array that incorporates the effect of the boundary conditions in the system and 𝐟𝐟\mathbf{f}bold_f is the random excitation term defined such that

fi(t)=Ωϕi2Du𝜻(t)d3𝐱.subscript𝑓𝑖𝑡subscriptΩsubscriptitalic-ϕ𝑖2𝐷𝑢𝜻𝑡superscript𝑑3𝐱f_{i}(t)=-\int_{\Omega}{\nabla\phi_{i}\cdot\sqrt{2Du}\mathbf{\boldsymbol{\zeta% }}(t)}d^{3}\mathbf{x}\,.italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) = - ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ( italic_t ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x . (11)

The covariance matrix of the components fi(t)subscript𝑓𝑖𝑡f_{i}(t)italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) can be expressed as

fi(t)fj(t)=2Dδ(tt)Ωu(𝐱)ϕi(𝐱)ϕj(𝐱)d3𝐱,delimited-⟨⟩subscript𝑓𝑖𝑡subscript𝑓𝑗superscript𝑡2𝐷𝛿𝑡superscript𝑡subscriptΩ𝑢𝐱subscriptitalic-ϕ𝑖𝐱subscriptitalic-ϕ𝑗𝐱superscript𝑑3𝐱\left<f_{i}(t)f_{j}(t^{\prime})\right>={2D\delta(t-t^{\prime})}\int_{\Omega}{u% (\mathbf{x})\nabla\phi_{i}(\mathbf{x})\cdot\nabla\phi_{j}(\mathbf{x})}d^{3}% \mathbf{x}\,,⟨ italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_f start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = 2 italic_D italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_u ( bold_x ) ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x , (12)

where .\left<.\right>⟨ . ⟩ indicates the expected value. The implementation of 𝐟𝐟\mathbf{f}bold_f, which represents the effect of the thermal fluctuations, is discussed in Section 2.2, and the time integration schemes are presented in Section 2.3.

2.2 Finite element formulation for the thermal fluctuations

To find a discrete approximation of 𝐟𝐟\mathbf{f}bold_f, we seek to postulate a formulation that satisfies Equation (12). Here we propose an approach inspired by previous work in the context of the Stokes equations with fluctuating hydrodynamics de2016finite . To this end, we make use of the same numerical integration schemes that are used in the finite element implementation, and that allow the integration of a given function g(𝐱)𝑔𝐱g(\mathbf{x})italic_g ( bold_x ) as

Ωg(𝐱)d3𝐱k=1Ngwkg(𝐱k),subscriptΩ𝑔𝐱superscript𝑑3𝐱superscriptsubscript𝑘1subscript𝑁𝑔subscript𝑤𝑘𝑔subscript𝐱𝑘\int_{\Omega}g(\mathbf{x})d^{3}\mathbf{x}\approx\sum_{k=1}^{N_{g}}{w_{k}g(% \mathbf{x}_{k})}\,,∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_g ( bold_x ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x ≈ ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_g ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) , (13)

where Ngsubscript𝑁𝑔N_{g}italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT is the number of integration points, g(𝐱k)𝑔subscript𝐱𝑘g(\mathbf{x}_{k})italic_g ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) is the value of the function evaluated at the integration point and wksubscript𝑤𝑘w_{k}italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT is the weight corresponding to integration point k𝑘kitalic_k. If an isoparametric formulation is used, wksubscript𝑤𝑘w_{k}italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT would include both the weight corresponding to the integration rule in the reference element as well as the Jacobian for the mapping from the reference element to the physical element. We assume that wk0subscript𝑤𝑘0w_{k}\geq 0italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ≥ 0. With this, we can postulate the following formulation for array 𝐟𝐟\mathbf{f}bold_f before the time discretization, as defined by Equation (11):

fi=2Dk=1Ngwku(𝐱k,t)𝜻k(t)ϕi(𝐱k),subscript𝑓𝑖2𝐷superscriptsubscript𝑘1subscript𝑁𝑔subscript𝑤𝑘𝑢subscript𝐱𝑘𝑡subscript𝜻𝑘𝑡subscriptitalic-ϕ𝑖subscript𝐱𝑘f_{i}=-\sqrt{2D}\sum_{k=1}^{N_{g}}{\sqrt{w_{k}u(\mathbf{x}_{k},t)}\boldsymbol{% \zeta}_{k}(t)\cdot\nabla\phi_{i}(\mathbf{x}_{k})}\,,italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = - square-root start_ARG 2 italic_D end_ARG ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT square-root start_ARG italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t ) end_ARG bold_italic_ζ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ( italic_t ) ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) , (14)

where the components of 𝜻ksubscript𝜻𝑘\boldsymbol{\zeta}_{k}bold_italic_ζ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT are stochastic Gaussian process with ζk,m=0delimited-⟨⟩subscript𝜁𝑘𝑚0\left<\zeta_{k,m}\right>=0⟨ italic_ζ start_POSTSUBSCRIPT italic_k , italic_m end_POSTSUBSCRIPT ⟩ = 0 and ζk,m(t)ζl,m(t)=δ(tt)δkldelimited-⟨⟩subscript𝜁𝑘𝑚𝑡subscript𝜁𝑙𝑚superscript𝑡𝛿𝑡superscript𝑡subscript𝛿𝑘𝑙\left<\zeta_{k,m}(t)\zeta_{l,m}(t^{\prime})\right>=\delta(t-t^{\prime})\delta_% {kl}⟨ italic_ζ start_POSTSUBSCRIPT italic_k , italic_m end_POSTSUBSCRIPT ( italic_t ) italic_ζ start_POSTSUBSCRIPT italic_l , italic_m end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_δ start_POSTSUBSCRIPT italic_k italic_l end_POSTSUBSCRIPT. The formulation given by Equation (14) leads to the following covariance matrix

fi(t)fj(t)==2Dm=13k=1Ngl=1Ngwkwlu(𝐱k,t)u(𝐱l,t)ϕi(𝐱k)xmϕj(𝐱l)xmζk,m(t)ζl,m(t)=2Dδ(tt)k=1Ngu(𝐱k,t)ϕi(𝐱k)ϕj(𝐱k)wk.delimited-⟨⟩subscript𝑓𝑖𝑡subscript𝑓𝑗superscript𝑡2𝐷superscriptsubscript𝑚13superscriptsubscript𝑘1subscript𝑁𝑔superscriptsubscript𝑙1subscript𝑁𝑔subscript𝑤𝑘subscript𝑤𝑙𝑢subscript𝐱𝑘𝑡𝑢subscript𝐱𝑙superscript𝑡subscriptitalic-ϕ𝑖subscript𝐱𝑘subscript𝑥𝑚subscriptitalic-ϕ𝑗subscript𝐱𝑙subscript𝑥𝑚delimited-⟨⟩subscript𝜁𝑘𝑚𝑡subscript𝜁𝑙𝑚superscript𝑡2𝐷𝛿𝑡superscript𝑡superscriptsubscript𝑘1subscript𝑁𝑔𝑢subscript𝐱𝑘𝑡subscriptitalic-ϕ𝑖subscript𝐱𝑘subscriptitalic-ϕ𝑗subscript𝐱𝑘subscript𝑤𝑘\begin{split}\left<f_{i}\right.&\left.(t)f_{j}(t^{\prime})\right>=\\ \,&={2D}\sum_{m=1}^{3}{\sum_{k=1}^{N_{g}}{\sum_{l=1}^{N_{g}}{\sqrt{w_{k}w_{l}u% (\mathbf{x}_{k},t)u(\mathbf{x}_{l},t^{\prime})}\frac{\partial\phi_{i}(\mathbf{% x}_{k})}{\partial x_{m}}\frac{\partial\phi_{j}(\mathbf{x}_{l})}{\partial x_{m}% }\left<\zeta_{k,m}(t)\mathbf{\zeta}_{l,m}(t^{\prime})\right>}}}\\ \,&={2D\delta(t-t^{\prime})}\sum_{k=1}^{N_{g}}{{u(\mathbf{x}_{k},t)}\nabla\phi% _{i}(\mathbf{x}_{k})\cdot\nabla\phi_{j}(\mathbf{x}_{k}){w_{k}}}\,.\end{split}start_ROW start_CELL ⟨ italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_CELL start_CELL ( italic_t ) italic_f start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL = 2 italic_D ∑ start_POSTSUBSCRIPT italic_m = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT italic_l = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT square-root start_ARG italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT italic_l end_POSTSUBSCRIPT italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t ) italic_u ( bold_x start_POSTSUBSCRIPT italic_l end_POSTSUBSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG divide start_ARG ∂ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) end_ARG start_ARG ∂ italic_x start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT end_ARG divide start_ARG ∂ italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_l end_POSTSUBSCRIPT ) end_ARG start_ARG ∂ italic_x start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT end_ARG ⟨ italic_ζ start_POSTSUBSCRIPT italic_k , italic_m end_POSTSUBSCRIPT ( italic_t ) italic_ζ start_POSTSUBSCRIPT italic_l , italic_m end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL = 2 italic_D italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t ) ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT . end_CELL end_ROW (15)

This covariance matrix is identical to that of Equation (12) up to an error introduced by the numerical integration scheme, thus proving that the postulated formulation for 𝐟𝐟\mathbf{f}bold_f in Equation (14) has the correct second-order statistical moments. To preserve the fluctuation-dissipation balance, the integration rule used to compute the diffusion matrix 𝐃𝐃\mathbf{D}bold_D and the forcing term 𝐟𝐟\mathbf{f}bold_f should be the same de2016finite . In the particular case that the value of the concentration u𝑢uitalic_u is large enough to linearize the fluctuating forcing term, the co-variance of the stochastic noise term for degrees of freedom i𝑖iitalic_i and j𝑗jitalic_j becomes

fi(t)fj(t)=2u0δ(tt)Dijdelimited-⟨⟩subscript𝑓𝑖𝑡subscript𝑓𝑗superscript𝑡2subscript𝑢0𝛿𝑡superscript𝑡subscript𝐷𝑖𝑗\left<f_{i}(t)f_{j}(t^{\prime})\right>=2u_{0}\,\delta(t-t^{\prime}){D}_{ij}\,⟨ italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_f start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = 2 italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_D start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT (16)

where Dijsubscript𝐷𝑖𝑗D_{ij}italic_D start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT is the (i,j)𝑖𝑗(i,j)( italic_i , italic_j ) component of the diffusion matrix 𝐃𝐃\mathbf{D}bold_D and u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT represents the average concentration. In A, an alternative to Equation (14) to define the linearized 𝐟𝐟\mathbf{f}bold_f is described, based on a decomposition of matrix 𝐃𝐃\mathbf{D}bold_D. This alternative implementation of the linearized forcing term has computational advantages and is equivalent to Equation (14) if the average concentration u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT in the domain is large enough.

2.3 Time integration and fluctuation-dissipation balance

The effect of the temporal integrators for fluctuating-hydrodynamics equations has been explored extensively donev2010accuracy ; delong2013temporal . In this work, we use one-stage time integration schemes. For Equation (8), the result for each time iteration can be expressed as

𝐮~n+1=[𝐌+(1α)Δt𝐃]1[(𝐌αΔt𝐃)𝐮~n+Δt𝐟n+Δt𝐟BCn],superscript~𝐮𝑛1superscriptdelimited-[]𝐌1𝛼Δ𝑡𝐃1delimited-[]𝐌𝛼Δ𝑡𝐃superscript~𝐮𝑛Δ𝑡superscript𝐟𝑛Δ𝑡superscriptsubscript𝐟𝐵𝐶𝑛\widetilde{\mathbf{u}}^{n+1}=\left[\mathbf{M}+(1-\alpha)\Delta t\mathbf{D}% \right]^{-1}\left[\left(\mathbf{M}-\alpha\Delta t\mathbf{D}\right)\,\widetilde% {\mathbf{u}}^{n}+\sqrt{\Delta t}\,\mathbf{f}^{n}+\Delta t\mathbf{f}_{BC}^{n}% \right]\,,over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_n + 1 end_POSTSUPERSCRIPT = [ bold_M + ( 1 - italic_α ) roman_Δ italic_t bold_D ] start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT [ ( bold_M - italic_α roman_Δ italic_t bold_D ) over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT + square-root start_ARG roman_Δ italic_t end_ARG bold_f start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT + roman_Δ italic_t bold_f start_POSTSUBSCRIPT italic_B italic_C end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ] , (17)

where the superindex (.)n(.)^{n}( . ) start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT indicates that the term is evaluated at the time step n𝑛nitalic_n, and α𝛼\alphaitalic_α is a constant that indicates whether the time integration is explicit (α=1𝛼1\alpha=1italic_α = 1), implicit (α=0𝛼0\alpha=0italic_α = 0) or semi-implicit (α=1/2𝛼12\alpha=1/2italic_α = 1 / 2). Based on Equation (14) in time, the stochastic forcing term in Equation (17) can be expressed as

fin=2Dk=1Ngwku(𝐱k,tn)𝒛knϕi(𝐱k),superscriptsubscript𝑓𝑖𝑛2𝐷superscriptsubscript𝑘1subscript𝑁𝑔subscript𝑤𝑘𝑢subscript𝐱𝑘subscript𝑡𝑛subscriptsuperscript𝒛𝑛𝑘subscriptitalic-ϕ𝑖subscript𝐱𝑘f_{i}^{n}=-\sqrt{2D}\sum_{k=1}^{N_{g}}{\sqrt{w_{k}u(\mathbf{x}_{k},t_{n})}% \boldsymbol{z}^{n}_{k}\cdot\nabla\phi_{i}(\mathbf{x}_{k})}\,,italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT = - square-root start_ARG 2 italic_D end_ARG ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT square-root start_ARG italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ) end_ARG bold_italic_z start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) , (18)

where the components of 𝒛ksubscript𝒛𝑘\boldsymbol{z}_{k}bold_italic_z start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT are stochastic Gaussian process with zk,m=0delimited-⟨⟩subscript𝑧𝑘𝑚0\left<z_{k,m}\right>=0⟨ italic_z start_POSTSUBSCRIPT italic_k , italic_m end_POSTSUBSCRIPT ⟩ = 0 and zk,m(t)zl,m(t)=δkldelimited-⟨⟩subscript𝑧𝑘𝑚𝑡subscript𝑧𝑙𝑚superscript𝑡subscript𝛿𝑘𝑙\left<z_{k,m}(t)z_{l,m}(t^{\prime})\right>=\delta_{kl}⟨ italic_z start_POSTSUBSCRIPT italic_k , italic_m end_POSTSUBSCRIPT ( italic_t ) italic_z start_POSTSUBSCRIPT italic_l , italic_m end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = italic_δ start_POSTSUBSCRIPT italic_k italic_l end_POSTSUBSCRIPT. We note that the solution, u(𝐱k,tn)𝑢subscript𝐱𝑘subscript𝑡𝑛u(\mathbf{x}_{k},t_{n})italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ), at the integration point, 𝐱ksubscript𝐱𝑘\mathbf{x}_{k}bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT, has to be evaluated at time tnsubscript𝑡𝑛t_{n}italic_t start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT because the stochastic term has been derived using an Ito interpretation dean1996langevin ; donev2014dynamic ; kloeden1992stochastic .

If the fluctuating term can be linearized, the alternative expression provided by Equation (79) can be used. The elements of the covariance matrix of the discrete forcing term given by Equation (18) can be expressed as

finfjm=2Dδnmk=1Ngu(𝐱k,t)ϕi(𝐱k)ϕj(𝐱k)wk.delimited-⟨⟩superscriptsubscript𝑓𝑖𝑛superscriptsubscript𝑓𝑗𝑚2𝐷subscript𝛿𝑛𝑚superscriptsubscript𝑘1subscript𝑁𝑔𝑢subscript𝐱𝑘𝑡subscriptitalic-ϕ𝑖subscript𝐱𝑘subscriptitalic-ϕ𝑗subscript𝐱𝑘subscript𝑤𝑘\left<f_{i}^{n}f_{j}^{m}\right>={2D\delta_{nm}}\sum_{k=1}^{N_{g}}{{u(\mathbf{x% }_{k},t)}\nabla\phi_{i}(\mathbf{x}_{k})\cdot\nabla\phi_{j}(\mathbf{x}_{k}){w_{% k}}}\,.⟨ italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_f start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_m end_POSTSUPERSCRIPT ⟩ = 2 italic_D italic_δ start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_u ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_t ) ∇ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) ⋅ ∇ italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) italic_w start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT . (19)

In Equation (17), the value α=1/2𝛼12\alpha=1/2italic_α = 1 / 2 corresponds to the implicit midpoint method (Crank-Nicholson scheme). This scheme is not only stable regardless of the value of the time step, but it also produces a solution with static spatial correlations that are independent of the time step as well donev2010accuracy ; delong2013temporal . Indeed, if we consider for now an infinite domain, so that we can neglect the effect of the boundary conditions, and we take the covariance of Equation (17), we obtain

𝐃𝐂𝐌T+𝐌𝐂𝐃T+Δt(12α)𝐃𝐂𝐃T=𝐂ff,𝐃𝐂superscript𝐌𝑇𝐌𝐂superscript𝐃𝑇Δ𝑡12𝛼𝐃𝐂superscript𝐃𝑇subscript𝐂𝑓𝑓\mathbf{D}\,\mathbf{C}\,\mathbf{M}^{T}+\mathbf{M}\,\mathbf{C}\,\mathbf{D}^{T}+% \Delta t(1-2\alpha)\mathbf{D}\,\mathbf{C}\,\mathbf{D}^{T}=\mathbf{C}_{ff}\,,bold_D bold_C bold_M start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT + bold_M bold_C bold_D start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT + roman_Δ italic_t ( 1 - 2 italic_α ) bold_D bold_C bold_D start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT = bold_C start_POSTSUBSCRIPT italic_f italic_f end_POSTSUBSCRIPT , (20)

where 𝐂ffsubscript𝐂𝑓𝑓\mathbf{C}_{ff}bold_C start_POSTSUBSCRIPT italic_f italic_f end_POSTSUBSCRIPT is the covariance matrix of the forcing term 𝐟𝐟\mathbf{f}bold_f, given by Equation (19), and 𝐂𝐂\mathbf{C}bold_C is the covariance matrix of the discrete solution

𝐂=(𝐮~𝐮~)(𝐮~T𝐮~T).𝐂delimited-⟨⟩~𝐮delimited-⟨⟩~𝐮superscript~𝐮𝑇delimited-⟨⟩superscript~𝐮𝑇\mathbf{C}=\left<\left(\mathbf{\widetilde{u}}-\left<\mathbf{\widetilde{u}}% \right>\right)\left(\mathbf{\widetilde{u}}^{T}-\left<\mathbf{\widetilde{u}}^{T% }\right>\right)\right>\,.bold_C = ⟨ ( over~ start_ARG bold_u end_ARG - ⟨ over~ start_ARG bold_u end_ARG ⟩ ) ( over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT - ⟨ over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT ⟩ ) ⟩ . (21)

Equation (20) expresses the fluctuation-dissipation balance at the discrete level. The term that depends on the time step vanishes if α=1/2𝛼12\alpha=1/2italic_α = 1 / 2. By contrast, any other value of α𝛼\alphaitalic_α, including α=1𝛼1\alpha=1italic_α = 1 (fully explicit) and α=0𝛼0\alpha=0italic_α = 0 (fully implicit), will not make this term vanish and, as a result, will lead to a solution with spatial correlations that depend on the ratio

β=DΔtΔx2,𝛽𝐷Δ𝑡Δsuperscript𝑥2\beta=\frac{D\Delta t}{\Delta x^{2}}\,,italic_β = divide start_ARG italic_D roman_Δ italic_t end_ARG start_ARG roman_Δ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG , (22)

where ΔtΔ𝑡\Delta troman_Δ italic_t and ΔxΔ𝑥\Delta xroman_Δ italic_x are the time step and the reference cell size, respectively.

The choice of time integration scheme influences, therefore, the fluctuation-dissipation balance, and, therefore, the spatial correlations of the solution. In this work, we use the Crank-Nicholson scheme (α=1/2𝛼12\alpha=1/2italic_α = 1 / 2) unless otherwise stated. With this scheme, Equation (20) becomes

𝐃𝐂𝐌T+𝐌𝐂𝐃T=𝐂ff,𝐃𝐂superscript𝐌𝑇𝐌𝐂superscript𝐃𝑇subscript𝐂𝑓𝑓\mathbf{D}\,\mathbf{C}\,\mathbf{M}^{T}+\mathbf{M}\,\mathbf{C}\,\mathbf{D}^{T}=% \mathbf{C}_{ff}\,,bold_D bold_C bold_M start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT + bold_M bold_C bold_D start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT = bold_C start_POSTSUBSCRIPT italic_f italic_f end_POSTSUBSCRIPT , (23)

which shows that the fluctuation-dissipation balance is independent of the time step. In the linearized case, Equation (23) becomes

𝐃𝐂𝐌T+𝐌𝐂𝐃T=2u0𝐃.𝐃𝐂superscript𝐌𝑇𝐌𝐂superscript𝐃𝑇2subscript𝑢0𝐃\mathbf{D}\,\mathbf{C}\,\mathbf{M}^{T}+\mathbf{M}\,\mathbf{C}\,\mathbf{D}^{T}=% 2u_{0}\mathbf{D}\,.bold_D bold_C bold_M start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT + bold_M bold_C bold_D start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT = 2 italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT bold_D . (24)

It is worth noting that in general, the fluctuation-dissipation balance is modified by the presence of boundary conditions, which we are not considering in this simplified analysis.

We see from Equation (24) that, even with a choice of a temporal integrator that does not introduce additional correlations in the solution, the covariance matrix of the solution will depend on the mass matrix 𝐌𝐌\mathbf{M}bold_M. As a result, the discrete solution may display spatial correlations that are not physical but induced by the spatial discretization. Indeed, if the diffusion and mass matrices are symmetric, the covariance matrix

𝐂=u0𝐌1𝐂subscript𝑢0superscript𝐌1\mathbf{C}=u_{0}\mathbf{M}^{-1}bold_C = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT bold_M start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT (25)

satisfies Equation (24). If 𝐌𝐌\mathbf{M}bold_M is diagonal, 𝐂𝐂\mathbf{C}bold_C will also be diagonal, and the solution for each degree of freedom will be uncorrelated with the solution for the rest of degrees of freedom; conversely, if 𝐌𝐌\mathbf{M}bold_M is not diagonal, as is in general the case with finite-element methods because of the way the shape functions are defined in the elements, the solution for the different degrees of freedom will be correlated. It is worth noting that these artificial correlations do not represent a numerical error, but are instead a natural consequence of the choice of shape functions. Still, even if these artificial correlations do not represent a numerical error, they make the solution difficult to interpret and to compare to experimental measurements, and they can make non-linear terms of fluctuating-hydrodynamics equations difficult to treat. In Section 3, we show finite element results for a (bounded) 1D problem with periodic boundary conditions that present discretization-induced spatial correlations in the solution. Furthermore, in Section 4, we propose a change of basis to transform the discrete solution into an equivalent discrete solution that is free of these artificial correlations.

2.4 Coarse-graining and discretization

Stochastic diffusion equations such as the ones that we are considering in this work can be seen as coarse-grained descriptions of the underlying system of particles. In fact, the macroscopic diffusion equations can be obtained from a description of the microscopic system through a coarse-graining procedure de2011coarse ; espanol2015coupling . In the case of diffusion equations such as Equation (1), the concentration u𝑢uitalic_u is a statistical representation of the distribution of the particles moving in the domain. In particular, u𝑢uitalic_u satisfies

Ωγi(𝐱)u(𝐱,t)d3𝐱=p=1Npγi(𝐱p(t)),subscriptΩsubscript𝛾𝑖𝐱𝑢𝐱𝑡superscript𝑑3𝐱superscriptsubscript𝑝1subscript𝑁𝑝subscript𝛾𝑖subscript𝐱𝑝𝑡\int_{\Omega}{\gamma_{i}(\mathbf{x})u(\mathbf{x},t)}d^{3}\mathbf{x}=\sum_{p=1}% ^{N_{p}}{\gamma_{i}(\mathbf{x}_{p}(t))}\,,∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) italic_u ( bold_x , italic_t ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = ∑ start_POSTSUBSCRIPT italic_p = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ( italic_t ) ) , (26)

where Npsubscript𝑁𝑝N_{p}italic_N start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT is the number of particles of the system, 𝐱psubscript𝐱𝑝\mathbf{x}_{p}bold_x start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT their positions and γisubscript𝛾𝑖\gamma_{i}italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is a suitable coarse-graining function associated with the discrete coarse-graining volume i𝑖iitalic_i.

Using the approximation given by Equation (6), we obtain

Ωγi(𝐱)jϕj(𝐱)u~j(t)d3𝐱=p=1Npγi(𝐱p(t))=n~i.subscriptΩsubscript𝛾𝑖𝐱subscript𝑗subscriptitalic-ϕ𝑗𝐱subscript~𝑢𝑗𝑡superscript𝑑3𝐱superscriptsubscript𝑝1subscript𝑁𝑝subscript𝛾𝑖subscript𝐱𝑝𝑡subscript~𝑛𝑖\int_{\Omega}{\gamma_{i}(\mathbf{x})\sum_{j}\phi_{j}(\mathbf{x})\widetilde{u}_% {j}(t)}d^{3}\mathbf{x}=\sum_{p=1}^{N_{p}}{\gamma_{i}(\mathbf{x}_{p}(t))}=% \widetilde{n}_{i}\,.∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = ∑ start_POSTSUBSCRIPT italic_p = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ( italic_t ) ) = over~ start_ARG italic_n end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT . (27)

In this work, we want to stress that, although the spatial correlations of the coarse-grained variable 𝐧~~𝐧\widetilde{\mathbf{n}}over~ start_ARG bold_n end_ARG depend on the functions γisubscript𝛾𝑖\gamma_{i}italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, the spatial correlations of the discrete concentration 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG depend on the choice of shape functions ϕisubscriptitalic-ϕ𝑖\phi_{i}italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT used to approximate u𝑢uitalic_u as expressed by Equation (6), and not on the coarse-graining functions γisubscript𝛾𝑖\gamma_{i}italic_γ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. We will discuss this further in Section 4.1, where we propose an approach to find a discrete approximation of the continuum concentration u𝑢uitalic_u that is free of discretization-induced spatial correlations.

3 Finite element results for a 1D diffusion problem

In this section, we present numerical results for a one-dimensional version of Equation (4), using the discretization schemes described in Section 2, and illustrate the effects of the spatiotemporal discretization on the spatial correlations of the discrete solution.

3.1 One-dimensional boundary value problem

We consider a one-dimensional diffusion problem with thermal fluctuations, governed by equation

u(x,t)tD2u(x,t)x2=x(2Duζ(x,t)),𝑢𝑥𝑡𝑡𝐷superscript2𝑢𝑥𝑡superscript𝑥2𝑥2𝐷𝑢𝜁𝑥𝑡\frac{\partial u({x},t)}{\partial t}-D\frac{\partial^{2}u({x},t)}{\partial x^{% 2}}=\frac{\partial}{\partial x}\left(\sqrt{2Du}\mathbf{{\zeta}}({x},t)\right)\,,divide start_ARG ∂ italic_u ( italic_x , italic_t ) end_ARG start_ARG ∂ italic_t end_ARG - italic_D divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u ( italic_x , italic_t ) end_ARG start_ARG ∂ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG = divide start_ARG ∂ end_ARG start_ARG ∂ italic_x end_ARG ( square-root start_ARG 2 italic_D italic_u end_ARG italic_ζ ( italic_x , italic_t ) ) , (28)

where D𝐷Ditalic_D is the diffusion coefficient, which we assume to be constant, and ζ𝜁\zetaitalic_ζ is a Gaussian white noise with

ζ(x,t)=0delimited-⟨⟩𝜁𝑥𝑡0\left<\zeta(x,t)\right>=0\,⟨ italic_ζ ( italic_x , italic_t ) ⟩ = 0 (29)

and

ζ(x,t)ζ(x,t)=δ(xx)δ(tt).delimited-⟨⟩𝜁𝑥𝑡𝜁superscript𝑥superscript𝑡𝛿𝑥superscript𝑥𝛿𝑡superscript𝑡\left<\zeta(x,t)\zeta(x^{\prime},t^{\prime})\right>=\delta(x-x^{\prime})\delta% (t-t^{\prime})\,.⟨ italic_ζ ( italic_x , italic_t ) italic_ζ ( italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟩ = italic_δ ( italic_x - italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_δ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) . (30)

The results that will be presented here correspond to dimensionless variables, with a domain length L=1𝐿1L=1italic_L = 1 and reference time T=L2/D=1𝑇superscript𝐿2𝐷1T=L^{2}/D=1italic_T = italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_D = 1. Periodic boundary conditions

u(x=L,t)=u(x=0,t),𝑢𝑥𝐿𝑡𝑢𝑥0𝑡u(x=L,t)=u(x=0,t)\,,italic_u ( italic_x = italic_L , italic_t ) = italic_u ( italic_x = 0 , italic_t ) , (31)

are prescribed at the ends of the computational domain, and the initial conditions are defined as

u(x,t=0)=u0.𝑢𝑥𝑡0subscript𝑢0u(x,t=0)=u_{0}\,.italic_u ( italic_x , italic_t = 0 ) = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT . (32)

The periodic boundary conditions guarantee the conservation of mass (or, equivalently, of the number of particles) in the domain, so that the average concentration in the domain is always u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT.

If we linearize the equation around a large value of the average concentration u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, the equal-time autocorrelation function of the fluctuations at points x𝑥xitalic_x and xsuperscript𝑥x^{\prime}italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT for an infinite domain can be expressed as de2015finite

u(x,t)u(x,t)=u0δ(xx),delimited-⟨⟩superscript𝑢𝑥𝑡superscript𝑢superscript𝑥𝑡subscript𝑢0𝛿𝑥superscript𝑥\left<u^{\prime}(x,t)u^{\prime}(x^{\prime},t)\right>=u_{0}\delta(x-x^{\prime})\,,⟨ italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_x , italic_t ) italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t ) ⟩ = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_δ ( italic_x - italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) , (33)

where u=uu=uu0superscript𝑢𝑢delimited-⟨⟩𝑢𝑢subscript𝑢0u^{\prime}=u-\left<u\right>=u-u_{0}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_u - ⟨ italic_u ⟩ = italic_u - italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, and the so-called static structure factor, which is the Fourier transform of the equal-time correlation function de2006hydrodynamic , becomes

S(k)=𝒰(k,t)𝒰(k,t)=u0𝑆𝑘delimited-⟨⟩𝒰𝑘𝑡𝒰𝑘𝑡subscript𝑢0S(k)=\left<\mathcal{U}(k,t)\mathcal{U}(-k,t)\right>=u_{0}italic_S ( italic_k ) = ⟨ caligraphic_U ( italic_k , italic_t ) caligraphic_U ( - italic_k , italic_t ) ⟩ = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT (34)

where k𝑘kitalic_k is the wavenumber, and where the Fourier transform 𝒰(k)𝒰𝑘\mathcal{U}(k)caligraphic_U ( italic_k ) of u(x)𝑢𝑥u(x)italic_u ( italic_x ) is defined as

𝒰(k)=u(x)exp(ikx)𝑑x.𝒰𝑘superscriptsubscript𝑢𝑥𝑖𝑘𝑥differential-d𝑥\mathcal{U}(k)=\int_{-\infty}^{\infty}{u(x)\exp{(-ikx)}}dx\,.caligraphic_U ( italic_k ) = ∫ start_POSTSUBSCRIPT - ∞ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∞ end_POSTSUPERSCRIPT italic_u ( italic_x ) roman_exp ( - italic_i italic_k italic_x ) italic_d italic_x . (35)

3.2 Discrete model, simulation setup and discrete structure factor

We apply the numerical approximation described in Section 2 to Equation (28). The one-dimensional domain of length L𝐿Litalic_L is split into Nesubscript𝑁𝑒N_{e}italic_N start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT identical elements. Lagrange polynomials are used as shape functions, both linear (p1𝑝1p1italic_p 1-elements) and quadratic (p2𝑝2p2italic_p 2-elements). When p1𝑝1p1italic_p 1-elements are used, the total number of nodes is Nn=Ne+1subscript𝑁𝑛subscript𝑁𝑒1N_{n}=N_{e}+1italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = italic_N start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT + 1; when p2𝑝2p2italic_p 2-elements are used, the number of nodes is Nn=2Ne+1subscript𝑁𝑛2subscript𝑁𝑒1N_{n}=2N_{e}+1italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 2 italic_N start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT + 1. Since the nodes are always equidistant, the distance between two nodes regardless of the type of element is Δx=L/(Nn1)Δ𝑥𝐿subscript𝑁𝑛1\Delta x=L/(N_{n}-1)roman_Δ italic_x = italic_L / ( italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 ). The number of degrees of freedom is NdofNnsubscript𝑁dofsubscript𝑁𝑛N_{\text{dof}}\equiv N_{n}italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT ≡ italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT.

We use u~i0=u0subscriptsuperscript~𝑢0𝑖subscript𝑢0\widetilde{u}^{0}_{i}=u_{0}over~ start_ARG italic_u end_ARG start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT for every i=1,..,Ndofi=1,..,N_{\text{dof}}italic_i = 1 , . . , italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT as the initial condition, where the value of the reference concentration u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is selected to be high enough for the behavior of the problem to be approximately linear. We then simulate an initial number of time steps L2/(DΔt)superscript𝐿2𝐷Δ𝑡L^{2}/(D\Delta t)italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / ( italic_D roman_Δ italic_t ), so that the solution reaches an equilibrium state before starting to collect results, and, finally, we run the simulations for a number Ntsubscript𝑁𝑡N_{t}italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT of time steps, for which data are collected.

The periodic boundary conditions are implemented by adding Lagrange multipliers to the discrete finite element system (8), to force the solution at the extremes of the domain to be identical. These boundary conditions ensure that the total number of particles in the domain remains constant (up to a certain numerical error). This is verified in the computations by integrating the results for the concentration over the domain. For the computations presented in this work, the standard deviation of the total computed number of particles in the domain varies with the discretization parameters, but it is typically smaller or of the order of 1e6u0Lsimilar-toabsent1E-6subscript𝑢0𝐿\sim$110-6$\,u_{0}L∼ start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 6 end_ARG end_ARG italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_L.

As a consequence of the mass conservation in the domain, the structure factor for wavenumber k=0𝑘0k=0italic_k = 0 is zero, unlike the structure factor of the case with an infinite domain given by Equation (34). For the rest of discrete wavenumbers km=2π(m1)/Lsubscript𝑘𝑚2𝜋𝑚1𝐿k_{m}=2\pi(m-1)/Litalic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT = 2 italic_π ( italic_m - 1 ) / italic_L, with m>1𝑚1m>1italic_m > 1, and provided that the discretization does not introduce artificial correlations in the solution, the structure factor of the solution should approximate that of Equation (34), S=u0𝑆subscript𝑢0S=u_{0}italic_S = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. This is equivalent to saying that, although the solution for the continuum equation in an infinite domain has a Gaussian probability distribution, the theoretical discrete solution in our bounded one-dimensional domain follows a multinomial distribution corresponding to Np=u0Lsubscript𝑁𝑝subscript𝑢0𝐿N_{p}=u_{0}Litalic_N start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_L particles in Nn1subscript𝑁𝑛1N_{n}-1italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 bins. It is worth noting that, as the discretization is refined (i.e. as Nnsubscript𝑁𝑛N_{n}italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT increases), the multinomial distribution becomes closer to a Gaussian distribution.

However, the discretization introduces artificial correlations in the solution, so the structure factor of the discrete FE results will not necessarily converge to the theoretical one. An analysis of the one-dimensional discretized equation with uniform linear (p1𝑝1p1italic_p 1) Lagrange elements shows instead that the numerical results with p1𝑝1p1italic_p 1-elements will converge to a solution with a discrete structure factor that can be expressed as de2015finite

Sth, FE-p1(km)=9u0[2+cos(kmΔx)]2j(sin(kmΔx2πj)kΔx2πj)4,subscript𝑆th, FE-p1subscript𝑘𝑚9subscript𝑢0superscriptdelimited-[]2subscript𝑘𝑚Δ𝑥2subscript𝑗superscriptsubscript𝑘𝑚Δ𝑥2𝜋𝑗𝑘Δ𝑥2𝜋𝑗4S_{\text{th, FE-p1}}(k_{m})=\frac{9u_{0}}{\left[2+\cos{(k_{m}\Delta x)}\right]% ^{2}}\sum_{j\in\mathbb{Z}}{\left(\frac{\sin{\left(\frac{k_{m}\Delta x}{2}-\pi j% \right)}}{\frac{k\Delta x}{2}-\pi j}\right)^{4}}\,,italic_S start_POSTSUBSCRIPT th, FE-p1 end_POSTSUBSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) = divide start_ARG 9 italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG [ 2 + roman_cos ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT roman_Δ italic_x ) ] start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_j ∈ blackboard_Z end_POSTSUBSCRIPT ( divide start_ARG roman_sin ( divide start_ARG italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT roman_Δ italic_x end_ARG start_ARG 2 end_ARG - italic_π italic_j ) end_ARG start_ARG divide start_ARG italic_k roman_Δ italic_x end_ARG start_ARG 2 end_ARG - italic_π italic_j end_ARG ) start_POSTSUPERSCRIPT 4 end_POSTSUPERSCRIPT , (36)

where \mathbb{Z}blackboard_Z represents the set of integer numbers. The structure factor given by Equation(36) only converges to the continuum structure factor given by Equation (34) in the limit kmΔx0subscript𝑘𝑚Δ𝑥0k_{m}\Delta x\rightarrow 0italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT roman_Δ italic_x → 0.

To evaluate our numerical approach, we compare the theoretical structure factor with the structure factor of the numerical solution, computed as

S(km)=𝒰~(km)𝒰~*(km),𝑆subscript𝑘𝑚delimited-⟨⟩~𝒰subscript𝑘𝑚superscript~𝒰subscript𝑘𝑚S(k_{m})=\left<{\widetilde{\mathcal{U}}}(k_{m}){{\widetilde{\mathcal{U}}}^{*}}% (k_{m})\right>\,,italic_S ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) = ⟨ over~ start_ARG caligraphic_U end_ARG ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) over~ start_ARG caligraphic_U end_ARG start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) ⟩ , (37)

where 𝒰~(km)~𝒰subscript𝑘𝑚\widetilde{\mathcal{U}}(k_{m})over~ start_ARG caligraphic_U end_ARG ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) is the discrete Fourier transform of the normalized discrete concentration, defined as

𝒰~(km)=1Ln=1Nn1u~nΔL~nexp(i2π(m1)(n1)Nn1),~𝒰subscript𝑘𝑚1𝐿superscriptsubscript𝑛1subscript𝑁𝑛1subscript~𝑢𝑛Δsubscript~𝐿𝑛𝑖2𝜋𝑚1𝑛1subscript𝑁𝑛1{\widetilde{\mathcal{U}}}(k_{m})=\frac{1}{\sqrt{L}}\sum_{n=1}^{N_{n}-1}{% \widetilde{u}}_{n}\Delta\widetilde{L}_{n}\exp\left(-\frac{i2\pi(m-1)(n-1)}{N_{% n}-1}\right)\,,over~ start_ARG caligraphic_U end_ARG ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) = divide start_ARG 1 end_ARG start_ARG square-root start_ARG italic_L end_ARG end_ARG ∑ start_POSTSUBSCRIPT italic_n = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 end_POSTSUPERSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT roman_Δ over~ start_ARG italic_L end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT roman_exp ( - divide start_ARG italic_i 2 italic_π ( italic_m - 1 ) ( italic_n - 1 ) end_ARG start_ARG italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 end_ARG ) , (38)

𝒰~*(km)superscript~𝒰subscript𝑘𝑚{\widetilde{\mathcal{U}}}^{*}(k_{m})over~ start_ARG caligraphic_U end_ARG start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) is its complex conjugate and ΔL~nΔsubscript~𝐿𝑛\Delta\widetilde{L}_{n}roman_Δ over~ start_ARG italic_L end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT is the equivalent volume (equivalent length in 1D) associated to node n𝑛nitalic_n,

ΔL~n=Ωϕn(x)𝑑x.Δsubscript~𝐿𝑛subscriptΩsubscriptitalic-ϕ𝑛𝑥differential-d𝑥\Delta\widetilde{L}_{n}=\int_{\Omega}{\phi_{n}(x)}dx\,.roman_Δ over~ start_ARG italic_L end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( italic_x ) italic_d italic_x . (39)

3.3 Results with a semi-implicit time integrator

Figure 1 shows the discrete structure factor based on the finite element results using linear Lagrange elements and a semi-implicit integration scheme. As explained in Section 2.3, a semi-implicit integration scheme has the advantage of making the spatial correlations independent from the time step. As shown in the figure, the discrete structure factor converges towards the theoretical structure factor of the discrete weak equation, given by Equation (36). The error

eFE=1Nkm=1Nk|S(km)SFE-p1(km)||SFE-p1(km)|,subscript𝑒FE1subscript𝑁𝑘superscriptsubscript𝑚1subscript𝑁𝑘𝑆subscript𝑘𝑚subscript𝑆FE-p1subscript𝑘𝑚subscript𝑆FE-p1subscript𝑘𝑚e_{\text{FE}}=\frac{1}{N_{k}}\sum_{m=1}^{N_{k}}{\frac{\left|S(k_{m})-S_{\text{% FE-p1}}(k_{m})\right|}{\left|S_{\text{FE-p1}}(k_{m})\right|}}\,,italic_e start_POSTSUBSCRIPT FE end_POSTSUBSCRIPT = divide start_ARG 1 end_ARG start_ARG italic_N start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_m = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT end_POSTSUPERSCRIPT divide start_ARG | italic_S ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) - italic_S start_POSTSUBSCRIPT FE-p1 end_POSTSUBSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) | end_ARG start_ARG | italic_S start_POSTSUBSCRIPT FE-p1 end_POSTSUBSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) | end_ARG , (40)

where km=2πm/Lsubscript𝑘𝑚2𝜋𝑚𝐿k_{m}=2\pi m/Litalic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT = 2 italic_π italic_m / italic_L (for m=1,2,..,(Nn1)/2m=1,2,..,(N_{n}-1)/2italic_m = 1 , 2 , . . , ( italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 ) / 2) are the Nk=(Nn1)/2subscript𝑁𝑘subscript𝑁𝑛12N_{k}=(N_{n}-1)/2italic_N start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT = ( italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 ) / 2 discrete wavenumbers, is reduced with increasing number of elements Nesubscript𝑁𝑒N_{e}italic_N start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT following a power law eFENe1proportional-tosubscript𝑒𝐹𝐸superscriptsubscript𝑁𝑒1{e_{FE}}\propto N_{e}^{-1}italic_e start_POSTSUBSCRIPT italic_F italic_E end_POSTSUBSCRIPT ∝ italic_N start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT.

Refer to caption
Refer to caption
Figure 1: Left: Structure factor of the discrete solution; theoretical structure factor for the discrete equation (solid line) and computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted). Right: error eFEsubscript𝑒𝐹𝐸{e_{FE}}italic_e start_POSTSUBSCRIPT italic_F italic_E end_POSTSUBSCRIPT in the computed discrete structure factor vs the number of elements (\circ). All computations have p1𝑝1p1italic_p 1-elements, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000. It can be seen that the solution obtained from the FE computation converges to the theoretical solution of the discretized equation as the number of elements increases.

However, as explained in Section 3.2, this theoretical discrete structure factor towards which the finite element-solution converges is different from the continuum one, which is a constant (S/u0=1𝑆subscript𝑢01S/u_{0}=1italic_S / italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 1). This is due to the fact that the spatial discretization introduces artificial correlations in the discrete solution; as a result, the structure factor only converges to that of the continuum in the low wavenumber limit. In Figure 2, the same results are represented, but as a function of kL𝑘𝐿kLitalic_k italic_L instead of kΔx𝑘Δ𝑥k\Delta xitalic_k roman_Δ italic_x. We see that, as the discretization is refined, the structure factor is close to the continuum one for a larger interval of wavenumbers. Nevertheless, artificial correlations are always present in the solution, and the resulting variance cannot be interpreted independently of the discretization.

Refer to caption
Figure 2: Structure factor of the discrete solution as a function of kL𝑘𝐿kLitalic_k italic_L; computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed), Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted) and Nn=201subscript𝑁𝑛201N_{n}=201italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 201 (dash-dotted). All computations with p1𝑝1p1italic_p 1-elements, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

It is worth noting that the obtained results agree with the finite element solution obtained by de la Torre and co-workers de2015finite , who use a Petrov-Galerkin discretization and also obtain a discrete structure factor that converges to that given by Equation (36). The reason for this is that the artificial correlations only depend on the shape functions used to approximate the solution u𝑢uitalic_u in Equation (6), which are linear Lagrange polynomials in both works.

Figure 3 shows results obtained with both linear and quadratic elements. It can be seen that increasing the order contributes to approximating better the structure factor towards the continuum one. Although the convergence is still limited to the low wavenumber limit, the results obtained with quadratic elements present a larger interval of wavenumbers for which the error in the structure factor is below a given threshold.

Refer to caption
Figure 3: Structure factor of the discrete solution computed with p1𝑝1p1italic_p 1-elements (solid line) and p2𝑝2p2italic_p 2-elements (dash-dot). The computations have been run with Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

Figure 4 shows the results obtained with quadratic elements and different mesh sizes. Like the results obtained with linear elements, the results computed with quadratic elements do not converge towards the continuum as the mesh is refined, indicating the presence of artificial correlations induced by the discretization in the solution.

Refer to caption
Refer to caption
Figure 4: Structure factor of the discrete solution obtained with p2𝑝2p2italic_p 2-elements, computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted). The computations have been run with Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

The results presented in this section have been focused on the static structure factor because it serves the purpose of showing the presence of artificial spatial correlations (or eventual lack thereof) in the solution, which is the focus of this work. Nevertheless, in B, complementary results are presented showing the dynamic structure factor, which contains information on the time evolution of the solution as well.

3.4 Results with fully implicit and fully explicit time integrators

The results shown so far for the semi-implicit time integrator present artificial correlations that are related to the spatial discretization. However, as explained in Section 2.3, if instead of the semi-implicit integration scheme, one uses a fully explicit or a fully implicit scheme, additional spatial correlations dependent on the dimensionless time step β=DΔt/Δx2𝛽𝐷Δ𝑡Δsuperscript𝑥2\beta=D\Delta t/\Delta x^{2}italic_β = italic_D roman_Δ italic_t / roman_Δ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT appear in the solution donev2010accuracy . Figures 5 and 6 show the results obtained for linear and quadratic elements, using fully explicit and fully implicit integration schemes. The results confirm that indeed the obtained structure factor is influenced by additional correlations that depend on the dimensionless time step β𝛽\betaitalic_β. It is worth noting that the influence of the time step on the stability is an independent issue altogether: the implicit method is unconditionally stable, while the explicit becomes unstable if the time step exceeds a certain threshold.

The results obtained with the fully explicit and fully implicit integration schemes are consistent with what other authors have shown before donev2010accuracy ; delong2013temporal , and illustrate the advantage of the semi-implicit integration scheme, as it does not require decreasing the time step to yield the correct spatial structure. In the rest of this work, only results obtained with the semi-implicit scheme (α=1/2𝛼12\alpha=1/2italic_α = 1 / 2) are presented.

Refer to caption
Refer to caption
Figure 5: Structure factor of the discrete solution with p1𝑝1p1italic_p 1-elements, computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted). Left: fully implicit time integration (α=0𝛼0\alpha=0italic_α = 0). Right: fully explicit time integration (α=1𝛼1\alpha=1italic_α = 1). All computations with Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000. As a reference, numerical results obtained with α=1/2𝛼12\alpha=1/2italic_α = 1 / 2 are also displayed (solid line), which are equivalent to the case with β=0𝛽0\beta=0italic_β = 0.
Refer to caption
Refer to caption
Figure 6: Structure factor of the discrete solution with p2𝑝2p2italic_p 2-elements, computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted). Left: fully implicit time integration (α=0𝛼0\alpha=0italic_α = 0). Right: fully explicit time integration (α=1𝛼1\alpha=1italic_α = 1). All computations with Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000. As a reference, numerical results obtained with α=1/2𝛼12\alpha=1/2italic_α = 1 / 2 are also displayed (solid line), which are equivalent to the case with β=0𝛽0\beta=0italic_β = 0.

4 A linear mapping to remove artificial correlations

As explained in Sections 2.3 and 2.4, the spatial discretization can introduce artificial correlations in the numerical solution. These artificial correlations do not represent a numerical error; they are instead the natural consequence of the choice of shape functions for the spatial discretization, and they are thus part of a consistent solution in the context of that basis. In spite of this, these discretization-related correlations make the discrete solution difficult to interprete, and can also make non-linear terms in fluctuating-hydrodynamics equations difficult to handle. In this section, we propose a linear transformation between the numerical solution and an equivalent discrete solution free of these artificial correlations. The goal is to perform a change of basis to obtain an equivalent discrete solution 𝐮~~~~𝐮\widetilde{\widetilde{\mathbf{u}}}over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG that approximates the solution as

u(𝐱,t)i=1Ndofu~~i(t)ψi(𝐱),𝑢𝐱𝑡superscriptsubscript𝑖1subscript𝑁dofsubscript~~𝑢𝑖𝑡subscript𝜓𝑖𝐱u(\mathbf{x},t)\approx\sum_{i=1}^{N_{\text{dof}}}{\widetilde{\widetilde{u}}_{i% }(t)\psi_{i}(\mathbf{x})}\,,italic_u ( bold_x , italic_t ) ≈ ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) , (41)

where ψisubscript𝜓𝑖\psi_{i}italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT are basis functions defined so as not to introduce artificial spatial correlations in the finite element solution, that is, so as to satisfy

Ωψi(𝐱)ψj(𝐱)d3𝐱=0,if ij.formulae-sequencesubscriptΩsubscript𝜓𝑖𝐱subscript𝜓𝑗𝐱superscript𝑑3𝐱0if 𝑖𝑗\int_{\Omega}\psi_{i}(\mathbf{x})\psi_{j}(\mathbf{x})d^{3}\mathbf{x}=0\,,\,\,% \,\,\text{if }i\neq j\,.∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) italic_ψ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = 0 , if italic_i ≠ italic_j . (42)

4.1 Spatial decorrelation matrix

In this section, we show that a linear relationship exists between the discrete solution 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG and an equivalent discrete solution 𝐮~~~~𝐮\widetilde{\widetilde{\mathbf{u}}}over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG that is free of the artificial correlations introduced by the spatial discretization. We start by re-writing here Equation (6)

u(𝐱,t)i=1Ndofu~i(t)ϕi(𝐱),𝑢𝐱𝑡superscriptsubscript𝑖1subscript𝑁dofsubscript~𝑢𝑖𝑡subscriptitalic-ϕ𝑖𝐱u(\mathbf{x},t)\approx\sum_{i=1}^{N_{\text{dof}}}{\widetilde{u}_{i}(t)\phi_{i}% (\mathbf{x})}\,,italic_u ( bold_x , italic_t ) ≈ ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) ,

where ϕi(𝐱)subscriptitalic-ϕ𝑖𝐱\phi_{i}(\mathbf{x})italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) are the basis functions used to approximate the solution, and Equation (41), which provides an alternative approximation using shape functions ψisubscript𝜓𝑖\psi_{i}italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT,

u(𝐱,t)i=1Ndofu~~i(t)ψi(𝐱).𝑢𝐱𝑡superscriptsubscript𝑖1subscript𝑁dofsubscript~~𝑢𝑖𝑡subscript𝜓𝑖𝐱u(\mathbf{x},t)\approx\sum_{i=1}^{N_{\text{dof}}}{\widetilde{\widetilde{u}}_{i% }(t)\psi_{i}(\mathbf{x})}\,.italic_u ( bold_x , italic_t ) ≈ ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) .

In order to satisfy Equation (42) the shape functions ψi(𝐱)subscript𝜓𝑖𝐱\psi_{i}(\mathbf{x})italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_x ) are defined such that matrix 𝐌ψψsubscript𝐌𝜓𝜓\mathbf{M}_{\psi\psi}bold_M start_POSTSUBSCRIPT italic_ψ italic_ψ end_POSTSUBSCRIPT

(Mψψ)ij=Ωψiψjd3𝐱subscriptsubscript𝑀𝜓𝜓𝑖𝑗subscriptΩsubscript𝜓𝑖subscript𝜓𝑗superscript𝑑3𝐱({M}_{\psi\psi})_{ij}=\int_{\Omega}{\psi_{i}\psi_{j}}d^{3}\mathbf{x}\,( italic_M start_POSTSUBSCRIPT italic_ψ italic_ψ end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x (43)

is diagonal, with

(Mψψ)ii=Ωψiψid3𝐱=ΔV~~i,subscriptsubscript𝑀𝜓𝜓𝑖𝑖subscriptΩsubscript𝜓𝑖subscript𝜓𝑖superscript𝑑3𝐱Δsubscript~~𝑉𝑖({M}_{\psi\psi})_{ii}=\int_{\Omega}{\psi_{i}\psi_{i}}d^{3}\mathbf{x}=\Delta% \widetilde{\widetilde{V}}_{i}\,,( italic_M start_POSTSUBSCRIPT italic_ψ italic_ψ end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_i italic_i end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = roman_Δ over~ start_ARG over~ start_ARG italic_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , (44)

where ΔV~~iΔsubscript~~𝑉𝑖\Delta\widetilde{\widetilde{V}}_{i}roman_Δ over~ start_ARG over~ start_ARG italic_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is an equivalent discrete volume associated with each degree of freedom i𝑖iitalic_i,

ΔV~~i=Ωψid3𝐱.Δsubscript~~𝑉𝑖subscriptΩsubscript𝜓𝑖superscript𝑑3𝐱\Delta\widetilde{\widetilde{V}}_{i}=\int_{\Omega}{\psi_{i}}d^{3}\mathbf{x}\,.roman_Δ over~ start_ARG over~ start_ARG italic_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x . (45)

Note that we have not defined the shape functions ψisubscript𝜓𝑖\psi_{i}italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT beyond saying that they lead to a diagonal mass matrix, so ΔVi~~Δ~~subscript𝑉𝑖\Delta\widetilde{\widetilde{{V}_{i}}}roman_Δ over~ start_ARG over~ start_ARG italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG end_ARG is undefined so far. We will discuss later in this section which definition of ΔVi~~Δ~~subscript𝑉𝑖\Delta\widetilde{\widetilde{{V}_{i}}}roman_Δ over~ start_ARG over~ start_ARG italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG end_ARG is most advantageous (see Equation (64)).

Since the discrete solutions 𝐮~~𝐮{\widetilde{\mathbf{u}}}over~ start_ARG bold_u end_ARG and 𝐮~~~~𝐮\widetilde{\widetilde{\mathbf{u}}}over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG both approximate the same continuum function, we require them to satisfy

j=1Ndofu~j(t)ϕj(𝐱)=j=1Ndofu~~j(t)ψj(𝐱).superscriptsubscript𝑗1subscript𝑁dofsubscript~𝑢𝑗𝑡subscriptitalic-ϕ𝑗𝐱superscriptsubscript𝑗1subscript𝑁dofsubscript~~𝑢𝑗𝑡subscript𝜓𝑗𝐱\sum_{j=1}^{N_{\text{dof}}}{{\widetilde{u}}_{j}(t){{\phi}}_{j}(\mathbf{x})}=% \sum_{j=1}^{N_{\text{dof}}}{\widetilde{\widetilde{u}}_{j}(t)\psi_{j}(\mathbf{x% })}\,.∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t ) italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) = ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( italic_t ) italic_ψ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_x ) . (46)

Multiplying by ϕisubscriptitalic-ϕ𝑖\phi_{i}italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and integrating over the domain leads to

Ωϕij=1Ndofϕju~jd3𝐱=Ωϕij=1Ndofψju~~jd3𝐱,subscriptΩsubscriptitalic-ϕ𝑖superscriptsubscript𝑗1subscript𝑁dofsubscriptitalic-ϕ𝑗subscript~𝑢𝑗superscript𝑑3𝐱subscriptΩsubscriptitalic-ϕ𝑖superscriptsubscript𝑗1subscript𝑁dofsubscript𝜓𝑗subscript~~𝑢𝑗superscript𝑑3𝐱\int_{\Omega}{{{\phi}}_{i}\sum_{j=1}^{N_{\text{dof}}}{{\phi}}_{j}}\widetilde{u% }_{j}d^{3}\mathbf{x}=\int_{\Omega}{{{\phi}}_{i}\sum_{j=1}^{N_{\text{dof}}}\psi% _{j}}\widetilde{\widetilde{u}}_{j}d^{3}\mathbf{x}\,,∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_ψ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x , (47)

which is equivalent to the following equation in matrix form

𝐀ϕT𝐮~=𝐀ψ𝐮~~,superscriptsubscript𝐀italic-ϕ𝑇~𝐮subscript𝐀𝜓~~𝐮\mathbf{A}_{\phi}^{T}\widetilde{\mathbf{u}}=\mathbf{A}_{\psi}\,\widetilde{% \widetilde{\mathbf{u}}}\,,bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG , (48)

where 𝐀ψsubscript𝐀𝜓\mathbf{A}_{\psi}bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT is a diagonal matrix satisfying

𝐌ψψ=𝐀ψ𝐀ψ,subscript𝐌𝜓𝜓subscript𝐀𝜓subscript𝐀𝜓\mathbf{M}_{\psi\psi}=\mathbf{A}_{\psi}\,\mathbf{A}_{\psi}\,,bold_M start_POSTSUBSCRIPT italic_ψ italic_ψ end_POSTSUBSCRIPT = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT , (49)

and 𝐀ϕTsuperscriptsubscript𝐀italic-ϕ𝑇\mathbf{A}_{\phi}^{T}bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT is the transpose of 𝐀ϕsubscript𝐀italic-ϕ\mathbf{A}_{\phi}bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT, satisfying

𝐌ϕϕ=𝐀ϕ𝐀ϕT,subscript𝐌italic-ϕitalic-ϕsubscript𝐀italic-ϕsuperscriptsubscript𝐀italic-ϕ𝑇\mathbf{M}_{\phi\phi}=\mathbf{A}_{\phi}\,\mathbf{A}_{\phi}^{T}\,,bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT = bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , (50)

with matrix 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT defined as

(Mϕϕ)ij=Ωϕiϕjd3𝐱.subscriptsubscript𝑀italic-ϕitalic-ϕ𝑖𝑗subscriptΩsubscriptitalic-ϕ𝑖subscriptitalic-ϕ𝑗superscript𝑑3𝐱({M}_{\phi\phi})_{ij}=\int_{\Omega}{\phi_{i}\phi_{j}}d^{3}\mathbf{x}\,.( italic_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x . (51)

It is worth pointing out that, since in Section 2 we have used a standard Galerkin discretization with the same shape functions for test function and solution, 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT and the mass matrix 𝐌𝐌\mathbf{M}bold_M of the finite element system are the same in our numerical setup. However, this is not necessarily the case for a general discretization, in which different shape functions may be used to approximate the test function. Therefore, 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT is not necessarily equal to the mass matrix of the finite element system leading to the solution 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG.

Matrix 𝐀ϕsubscript𝐀italic-ϕ\mathbf{A}_{\phi}bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT, resulting from the decomposition given by Equation (50), can be expressed as

𝐀ϕ=𝐔ϕ𝚺ϕ𝐔ϕT𝐔*T,subscript𝐀italic-ϕsubscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇superscriptsubscript𝐔𝑇\mathbf{A}_{\phi}=\mathbf{U}_{\phi}\sqrt{\mathbf{\Sigma}_{\phi}}\mathbf{U}_{% \phi}^{T}\mathbf{U}_{*}^{T}\,,bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT = bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , (52)

where 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT and 𝐔ϕsubscript𝐔italic-ϕ\mathbf{U}_{\phi}bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT are unitary matrices and 𝚺ϕsubscript𝚺italic-ϕ\mathbf{\Sigma}_{\phi}bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT is a diagonal matrix satisfying

𝐌ϕϕ=𝐔ϕ𝚺ϕ𝐔ϕT.subscript𝐌italic-ϕitalic-ϕsubscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇\mathbf{M}_{\phi\phi}=\mathbf{U}_{\phi}\mathbf{\Sigma}_{\phi}\mathbf{U}_{\phi}% ^{T}\,.bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT = bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT . (53)

Equation (50) holds for any unitary matrix 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT; the decomposition (50) is therefore not unique. However, not every unitary matrix 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT will in addition guarantee that the mass is conserved. Mass conservation requires

j=1NdofΩϕju~jd3𝐱=j=1NdofΩψju~~jd3𝐱,superscriptsubscript𝑗1subscript𝑁dofsubscriptΩsubscriptitalic-ϕ𝑗subscript~𝑢𝑗superscript𝑑3𝐱superscriptsubscript𝑗1subscript𝑁dofsubscriptΩsubscript𝜓𝑗subscript~~𝑢𝑗superscript𝑑3𝐱\sum_{j=1}^{N_{\text{dof}}}\int_{\Omega}{{{\phi}}_{j}}\widetilde{u}_{j}d^{3}% \mathbf{x}=\sum_{j=1}^{N_{\text{dof}}}\int_{\Omega}{\psi_{j}}\widetilde{% \widetilde{u}}_{j}d^{3}\mathbf{x}\,,∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT over~ start_ARG italic_u end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x = ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ψ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x , (54)

which in matrix form can be written as

Δ𝐕~T𝐮~=Δ𝐕~~T𝐮~~,Δsuperscript~𝐕𝑇~𝐮Δsuperscript~~𝐕𝑇~~𝐮\Delta{\widetilde{\mathbf{V}}}^{T}\,\widetilde{\mathbf{u}}=\Delta\widetilde{% \widetilde{\mathbf{V}}}^{T}\,\widetilde{\widetilde{\mathbf{u}}}\,,roman_Δ over~ start_ARG bold_V end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG = roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG , (55)

where Δ𝐕~~Δ~~𝐕\Delta\widetilde{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG and Δ𝐕~Δ~𝐕\Delta{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG bold_V end_ARG are vectors with the corresponding equivalent volume associated with each degree of freedom, with Δ𝐕~~Δ~~𝐕\Delta\widetilde{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG defined by Equation (45) and Δ𝐕~Δ~𝐕\Delta{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG bold_V end_ARG defined by

ΔV~i=Ωϕid3𝐱.Δsubscript~𝑉𝑖subscriptΩsubscriptitalic-ϕ𝑖superscript𝑑3𝐱\Delta\widetilde{V}_{i}=\int_{\Omega}{{{\phi}}_{i}}d^{3}\mathbf{x}\,.roman_Δ over~ start_ARG italic_V end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT roman_Ω end_POSTSUBSCRIPT italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_x . (56)

If we now use Equations (48) and (52) inside Equation (55), we obtain

Δ𝐕~T𝐮~=Δ𝐕~~T𝐀ψ1𝐔*𝐔ϕ𝚺ϕ𝐔ϕT𝐮~.Δsuperscript~𝐕𝑇~𝐮Δsuperscript~~𝐕𝑇superscriptsubscript𝐀𝜓1subscript𝐔subscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇~𝐮\Delta{\widetilde{\mathbf{V}}}^{T}\,\widetilde{\mathbf{u}}=\Delta\widetilde{% \widetilde{\mathbf{V}}}^{T}\,\mathbf{A}_{\psi}^{-1}\,\mathbf{U}_{*}\,\mathbf{U% }_{\phi}\,\sqrt{\mathbf{\Sigma}_{\phi}}\,\mathbf{U}_{\phi}^{T}\,\widetilde{% \mathbf{u}}\,.roman_Δ over~ start_ARG bold_V end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG = roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG . (57)

Given that this identity must be satisfied for any vector 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG, we obtain

𝐔*𝐲~=𝐲~~,subscript𝐔~𝐲~~𝐲\mathbf{U}_{*}\,\widetilde{\mathbf{y}}=\widetilde{\widetilde{\mathbf{y}}}\,,bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT over~ start_ARG bold_y end_ARG = over~ start_ARG over~ start_ARG bold_y end_ARG end_ARG , (58)

where 𝐲~~𝐲{\widetilde{\mathbf{y}}}over~ start_ARG bold_y end_ARG and 𝐲~~~~𝐲\widetilde{\widetilde{\mathbf{y}}}over~ start_ARG over~ start_ARG bold_y end_ARG end_ARG are vectors defined as

𝐲~=𝐔ϕ𝚺ϕ1𝐔ϕTΔ𝐕~,~𝐲subscript𝐔italic-ϕsubscriptsuperscript𝚺1italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇Δ~𝐕{\widetilde{\mathbf{y}}}=\mathbf{U}_{\phi}\,\sqrt{\mathbf{\Sigma}^{-1}_{\phi}}% \,\mathbf{U}_{\phi}^{T}\,\Delta\widetilde{\mathbf{V}}\,,over~ start_ARG bold_y end_ARG = bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT roman_Δ over~ start_ARG bold_V end_ARG , (59)

and

𝐲~~=𝐀ψ1Δ𝐕~~.~~𝐲superscriptsubscript𝐀𝜓1Δ~~𝐕\widetilde{\widetilde{\mathbf{y}}}=\mathbf{A}_{\psi}^{-1}\,\Delta\widetilde{% \widetilde{\mathbf{V}}}\,.over~ start_ARG over~ start_ARG bold_y end_ARG end_ARG = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG . (60)

Therefore, matrix 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT can be defined as the rotation matrix that transforms vector 𝐲~~𝐲{\widetilde{\mathbf{y}}}over~ start_ARG bold_y end_ARG into 𝐲~~~~𝐲\widetilde{\widetilde{\mathbf{y}}}over~ start_ARG over~ start_ARG bold_y end_ARG end_ARG.

With these definitions, we can rewrite Equation (48) as

𝐮~~=𝐀ψ1𝐀ϕT𝐮~=𝐀ψ1𝐔*𝐔ϕ𝚺ϕ𝐔ϕT𝐮~,~~𝐮superscriptsubscript𝐀𝜓1superscriptsubscript𝐀italic-ϕ𝑇~𝐮superscriptsubscript𝐀𝜓1subscript𝐔subscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇~𝐮\widetilde{\widetilde{\mathbf{u}}}=\mathbf{A}_{\psi}^{-1}\,\mathbf{A}_{\phi}^{% T}\,\widetilde{\mathbf{u}}=\mathbf{A}_{\psi}^{-1}\,\mathbf{U}_{*}\,\mathbf{U}_% {\phi}\,\sqrt{\mathbf{\Sigma}_{\phi}}\,\mathbf{U}_{\phi}^{T}\,\widetilde{% \mathbf{u}}\,,over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT over~ start_ARG bold_u end_ARG , (61)

which provides a mass-preserving linear relationship between the discrete solution 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG and a discrete solution 𝐮~~~~𝐮\widetilde{\widetilde{\mathbf{u}}}over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG that does not have artificial spatial correlations introduced by the spatial discretization:

𝐮~~=𝐐𝐮~,~~𝐮𝐐~𝐮\widetilde{\widetilde{\mathbf{u}}}=\mathbf{Q}\,\widetilde{\mathbf{u}}\,,over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG = bold_Q over~ start_ARG bold_u end_ARG , (62)

where matrix 𝐐𝐐\mathbf{Q}bold_Q is given by

𝐐=𝐀ψ1𝐀ϕT=𝐀ψ1𝐔*𝐔ϕ𝚺ϕ𝐔ϕT𝐐superscriptsubscript𝐀𝜓1superscriptsubscript𝐀italic-ϕ𝑇superscriptsubscript𝐀𝜓1subscript𝐔subscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇\mathbf{Q}=\mathbf{A}_{\psi}^{-1}\,\mathbf{A}_{\phi}^{T}=\mathbf{A}_{\psi}^{-1% }\,\mathbf{U}_{*}\,\mathbf{U}_{\phi}\,\sqrt{\mathbf{\Sigma}_{\phi}}\,\mathbf{U% }_{\phi}^{T}\,bold_Q = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT (63)

and can be interpreted as a decorrelation matrix that removes the artificial spatial correlations from the discrete solution. This decorrelation matrix can be applied as a postprocessing step to remove the artificial spatial correlations from the numerical solution.

As mentioned above, Δ𝐕~~Δ~~𝐕\Delta\widetilde{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG is undefined so far. A convenient definition is given by

Δ𝐕~~i𝐲~i2.Δsubscript~~𝐕𝑖superscriptsubscript~𝐲𝑖2\Delta\widetilde{\widetilde{\mathbf{V}}}_{i}\equiv\widetilde{\mathbf{y}}_{i}^{% 2}\,.roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ≡ over~ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (64)

This definition ensures that 𝐲~~𝐲\widetilde{\mathbf{y}}over~ start_ARG bold_y end_ARG and 𝐲~~~~𝐲\widetilde{\widetilde{\mathbf{y}}}over~ start_ARG over~ start_ARG bold_y end_ARG end_ARG are the same, and, therefore, 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT becomes the identity matrix. As a result, 𝐀ϕsubscript𝐀italic-ϕ\mathbf{A}_{\phi}bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT becomes symmetric, and the decorrelation matrix becomes

𝐐=𝐀ψ1𝐀ϕT=𝐀ψ1𝐔ϕ𝚺ϕ𝐔ϕT.𝐐superscriptsubscript𝐀𝜓1superscriptsubscript𝐀italic-ϕ𝑇superscriptsubscript𝐀𝜓1subscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇\mathbf{Q}=\mathbf{A}_{\psi}^{-1}\,\mathbf{A}_{\phi}^{T}=\mathbf{A}_{\psi}^{-1% }\,\mathbf{U}_{\phi}\,\sqrt{\mathbf{\Sigma}_{\phi}}\,\mathbf{U}_{\phi}^{T}\,.bold_Q = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_A start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT . (65)

An advantage of this definition is that the decorrelation matrix can be approximated by a sparse matrix with a higher sparsity degree than what is obtained when the rotation matrix 𝐔*subscript𝐔\mathbf{U}_{*}bold_U start_POSTSUBSCRIPT * end_POSTSUBSCRIPT is a dense matrix. In Section 4.2, we discuss more details about the implementation and computational aspects of the mapping given by Equation (65).

So far, we have not considered any effect of the boundary conditions on the decorrelation matrix, and, in general, the analysis presented in this section is valid for any boundary condition. However, in some cases, it may be desirable to use a decorrelation matrix based on a matrix 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT and vector Δ𝐕~Δ~𝐕\Delta\widetilde{\mathbf{V}}roman_Δ over~ start_ARG bold_V end_ARG that have been modified to incorporate the effect of the boundary conditions. For instance, since here we are solving problems with periodic boundary conditions, in order to maintain the periodicity of the discrete solution, only Ndof1subscript𝑁dof1N_{\text{dof}}-1italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT - 1 elements of 𝐮~~𝐮\widetilde{\mathbf{u}}over~ start_ARG bold_u end_ARG are mapped, thereby excluding the solution of one of the extremes of the domain. Matrix 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT and vector Δ𝐕~Δ~𝐕\Delta\widetilde{\mathbf{V}}roman_Δ over~ start_ARG bold_V end_ARG become, respectively, an (Ndof1)×(Ndof1)subscript𝑁dof1subscript𝑁dof1(N_{\text{dof}}-1)\times(N_{\text{dof}}-1)( italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT - 1 ) × ( italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT - 1 ) matrix and a vector of length (Ndof1)subscript𝑁dof1(N_{\text{dof}}-1)( italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT - 1 ), and the elements in each eliminated row or column are added in suitable positions of the row or column corresponding to the other extreme of the domain, so as to reflect the periodicity of the domain in the arrays.

It is worth noting that the linear mapping given by Equation (62) depends only on the shape functions used to approximate the solution. This means that the choice of finite-element discretization does not need to be based on whether it produces the correct structure factor, because, once a discrete solution is obtained, an equivalent solution with a correct structure factor can be found through the proposed linear transformation. Moreover, this makes explicit that the coarse-graining and the spatial discretization used to solve the diffusion equation numerically are two separate things, and that the spatial discretization should therefore be designed on the basis of numerical analysis exclusively.

In Section 4.3, we present results for the one-dimensional boundary value problem discussed in Section 3, which are obtained by applying the linear mapping presented in this section to remove the artificial correlations introduced by the spatial discretization.

4.2 Implementation and computational aspects

The decorrelation matrix proposed in Section 4.1 is in general a dense matrix. Although this is not an issue for the 1D problems solved in this work, the mapping can lead to a high computational cost for models with a large number of degrees of freedom. To preserve the computational advantages of the finite element method, the matrix should be sparse.

Refer to caption
Refer to caption
Figure 7: Structure factor of the discrete solution after mapping with the decorrelation matrix; computed with a dense decorrelation matrix (dotted) and with a sparse decorrelated matrix with threshold ϵ=1e5italic-ϵ1E-5\epsilon=$110-5$italic_ϵ = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG (×\times×). Left: p1𝑝1p1italic_p 1-elements; right: p2𝑝2p2italic_p 2-elements. All computations with semi-implicit time integration, Ndof=101subscript𝑁dof101N_{\text{dof}}=101italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT = 101, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

If we use the definition of the decorrelation matrix 𝐐𝐐\mathbf{Q}bold_Q given by Equation (65), with the equivalent volumes ΔV~~iΔsubscript~~𝑉𝑖\Delta\widetilde{\widetilde{V}}_{i}roman_Δ over~ start_ARG over~ start_ARG italic_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT defined by Equation (64), the matrix can be approximated by a sparse matrix, by setting to zero the elements of the matrix that have an absolute value below a threshold ϵitalic-ϵ\epsilonitalic_ϵ. This is a reasonable approximation in our case, because the matrix 𝐐𝐐\mathbf{Q}bold_Q that we obtain already has many elements with small value, corresponding to degrees of freedom belonging to two different elements that are not contiguous and that are relatively far from each other. It is worth pointing out that the sparse matrix that we obtain in this way is still a full-rank matrix.

Figure 7 shows the structure factor obtained with such truncated matrices with a threshold ϵ=1e5italic-ϵ1E-5\epsilon=$110-5$italic_ϵ = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG. The truncated matrix gives results that are very close to those of the original dense matrix (with a maximum added relative error in the computed structure factor around 5e55E-5510-5start_ARG 5 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, which is significantly smaller than the typical numerical error in the solution).

Refer to caption
Figure 8: Number Nnzsubscript𝑁nzN_{\text{nz}}italic_N start_POSTSUBSCRIPT nz end_POSTSUBSCRIPT of non-zero elements as a function of the number of degrees of freedom Ndofsubscript𝑁dofN_{\text{dof}}italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT for mass matrix 𝐌𝐌\mathbf{M}bold_M with p1𝑝1p1italic_p 1-elements (\triangle) and p2𝑝2p2italic_p 2-elements (\blacktriangle), truncated decorrelation matrix 𝐐𝐐\mathbf{Q}bold_Q (ϵ=1e5italic-ϵ1E-5\epsilon=$110-5$italic_ϵ = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG) with p1𝑝1p1italic_p 1-elements (\circ) and p2𝑝2p2italic_p 2-elements (\bullet).

Figure 8 shows the number of non-zero elements in the decorrelation matrix with both p1𝑝1p1italic_p 1- and p2𝑝2p2italic_p 2-elements, computed as well with threshold ϵ=1e5italic-ϵ1E-5\epsilon=$110-5$italic_ϵ = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG. Although the number of non-zero elements in the decorrelation matrices is higher than in the respective mass matrices, they both increase linearly with the number of degrees-of-freedom Ndofsubscript𝑁dofN_{\text{dof}}italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT. This indicates that the computational complexity of the problem is not increased by the mapping, thus preserving the efficiency of the computational method.

An example of implementation of a finite-element method including a decorrelation step for the problems discussed in previous sections consists of the following steps:

  1. 1.

    Discretize the domain: define the elements and node connectivity, select the shape functions

  2. 2.

    Assemble system matrices 𝐌𝐌\mathbf{M}bold_M and 𝐃𝐃\mathbf{D}bold_D

  3. 3.

    Implement the components of the boundary conditions (e.g. add Lagrange multipliers for periodic boundary conditions) and source terms (e.g. compute matrix 𝐀𝐃subscript𝐀𝐃\mathbf{A_{D}}bold_A start_POSTSUBSCRIPT bold_D end_POSTSUBSCRIPT for the fluctuating source term) that are not time-dependent

  4. 4.

    Compute the decorrelation matrix 𝐐𝐐\mathbf{Q}bold_Q:

    1. (a)

      Compute 𝐔ϕsubscript𝐔italic-ϕ\mathbf{U}_{\phi}bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT and 𝚺ϕsubscript𝚺italic-ϕ\mathbf{\Sigma}_{\phi}bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT through a singular value decomposition of 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT (note that, since 𝐌ϕϕsubscript𝐌italic-ϕitalic-ϕ\mathbf{M}_{\phi\phi}bold_M start_POSTSUBSCRIPT italic_ϕ italic_ϕ end_POSTSUBSCRIPT is symmetric and positive definite, the eigenvalues and singular values are identical)

    2. (b)

      Compute Δ𝐕~~Δ~~𝐕\Delta\widetilde{\widetilde{\mathbf{V}}}roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG using Equation (64)

    3. (c)

      Compute 𝐀ψsubscript𝐀𝜓\mathbf{A}_{\psi}bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT as a diagonal matrix with diagonal elements given by Δ𝐕~~iΔsubscript~~𝐕𝑖\sqrt{\Delta\widetilde{\widetilde{\mathbf{V}}}_{i}}square-root start_ARG roman_Δ over~ start_ARG over~ start_ARG bold_V end_ARG end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG

    4. (d)

      Compute the decorrelation matrix as 𝐐=𝐀ψ1𝐔ϕ𝚺ϕ𝐔ϕT𝐐superscriptsubscript𝐀𝜓1subscript𝐔italic-ϕsubscript𝚺italic-ϕsuperscriptsubscript𝐔italic-ϕ𝑇\mathbf{Q}=\mathbf{A}_{\psi}^{-1}\,\mathbf{U}_{\phi}\,\sqrt{\mathbf{\Sigma}_{% \phi}}\,\mathbf{U}_{\phi}^{T}bold_Q = bold_A start_POSTSUBSCRIPT italic_ψ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT

    5. (e)

      Make 𝐐𝐐\mathbf{Q}bold_Q sparse by setting elements with absolute value below a given tolerance to zero.

  5. 5.

    Initialize the solution 𝐮~0superscript~𝐮0\widetilde{\mathbf{u}}^{0}over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT

  6. 6.

    Start the time-dependent loop, for n=1𝑛1n=1italic_n = 1 to n=Nt𝑛subscript𝑁𝑡n=N_{t}italic_n = italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT do:

    1. (a)

      Compute the fluctuating source term

    2. (b)

      Solve the linear system to obtain the finite-element solution array 𝐮~nsuperscript~𝐮𝑛\widetilde{\mathbf{u}}^{n}over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT as a function of 𝐮~n1superscript~𝐮𝑛1\widetilde{\mathbf{u}}^{n-1}over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_n - 1 end_POSTSUPERSCRIPT (see Section 2.3)

    3. (c)

      Compute the mapped solution as 𝐮~~n=𝐐𝐮~nsuperscript~~𝐮𝑛𝐐superscript~𝐮𝑛\widetilde{\widetilde{\mathbf{u}}}^{n}=\mathbf{Q}\,\widetilde{\mathbf{u}}^{n}over~ start_ARG over~ start_ARG bold_u end_ARG end_ARG start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT = bold_Q over~ start_ARG bold_u end_ARG start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT and store it

4.3 Results using the spatial decorrelation matrix

Refer to caption
Refer to caption
Refer to caption
Refer to caption
Figure 9: Structure factor of the discrete solution after mapping with the decorrelation matrix computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted), and theoretical structure factor for the continuum equation (solid line). Top left: Δt=1e3Δ𝑡1E-3\Delta t=$110-3$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 3 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG; top right: Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG; bottom left: Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, Nt=1e7subscript𝑁𝑡1E7N_{t}=$1107$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 7 end_ARG end_ARG; bottom right: Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e7subscript𝑁𝑡1E7N_{t}=$1107$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 7 end_ARG end_ARG. All computations with p1𝑝1p1italic_p 1-elements, semi-implicit time integration, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

Figures (9) and (10) show the results obtained applying the linear mapping (61) given by Equation (62) to the finite element results presented in Section 3. Only the results obtained with the semi-implicit integration scheme have been used. The discrete structure factor for the decorrelated results is computed as

S(km)=𝒰~~(km)𝒰~~*(km),𝑆subscript𝑘𝑚delimited-⟨⟩~~𝒰subscript𝑘𝑚superscript~~𝒰subscript𝑘𝑚S(k_{m})=\left<{\widetilde{\widetilde{\mathcal{U}}}}(k_{m}){\widetilde{% \widetilde{\mathcal{U}}}^{*}}(k_{m})\right>\,,italic_S ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) = ⟨ over~ start_ARG over~ start_ARG caligraphic_U end_ARG end_ARG ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) over~ start_ARG over~ start_ARG caligraphic_U end_ARG end_ARG start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) ⟩ , (66)

with

𝒰~~(km)=1Ln=1Nn1u~~nΔL~~nexp(i2π(m1)(n1)Nn1),~~𝒰subscript𝑘𝑚1𝐿superscriptsubscript𝑛1subscript𝑁𝑛1subscript~~𝑢𝑛Δsubscript~~𝐿𝑛𝑖2𝜋𝑚1𝑛1subscript𝑁𝑛1{\widetilde{\widetilde{\mathcal{U}}}}(k_{m})=\frac{1}{\sqrt{L}}\sum_{n=1}^{N_{% n}-1}\widetilde{\widetilde{u}}_{n}\Delta\widetilde{\widetilde{L}}_{n}\exp\left% (-\frac{i2\pi(m-1)(n-1)}{N_{n}-1}\right)\,,over~ start_ARG over~ start_ARG caligraphic_U end_ARG end_ARG ( italic_k start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) = divide start_ARG 1 end_ARG start_ARG square-root start_ARG italic_L end_ARG end_ARG ∑ start_POSTSUBSCRIPT italic_n = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 end_POSTSUPERSCRIPT over~ start_ARG over~ start_ARG italic_u end_ARG end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT roman_Δ over~ start_ARG over~ start_ARG italic_L end_ARG end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT roman_exp ( - divide start_ARG italic_i 2 italic_π ( italic_m - 1 ) ( italic_n - 1 ) end_ARG start_ARG italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 end_ARG ) , (67)

where ΔL~~nΔsubscript~~𝐿𝑛\Delta\widetilde{\widetilde{L}}_{n}roman_Δ over~ start_ARG over~ start_ARG italic_L end_ARG end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT is the equivalent volume (equivalent length in 1D) related to shape function ψ𝜓\psiitalic_ψ for node n𝑛nitalic_n, which can be computed using Equation (64).

The results presented in Figures (9) have been computed for two different meshes (number of nodes Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101) with linear shape functions, and for different values of the time step ΔtΔ𝑡\Delta troman_Δ italic_t and of the number of time steps Ntsubscript𝑁𝑡N_{t}italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT for which solution data are collected. It can be seen that the linear mapping succeeds in yielding a structure factor that closely approximates that of the continuum (S/u0=1𝑆subscript𝑢01S/u_{0}=1italic_S / italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 1). Once the artificial correlations are removed, and since the solution is completely decorrelated in space, refining the mesh does not improve the solution significantly, and, for the largest time step Δt=1e3Δ𝑡1E-3\Delta t=$110-3$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 3 end_ARG end_ARG (see top left plot), refining the mesh actually increases the error, since the dimensionless time step β=ΔtD/Δx2𝛽Δ𝑡𝐷Δsuperscript𝑥2\beta=\Delta tD/\Delta x^{2}italic_β = roman_Δ italic_t italic_D / roman_Δ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT becomes larger. For small-enough values of the time step, increasing the number of time steps Ntsubscript𝑁𝑡N_{t}italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT and the total time of the simulations ttot=NtΔtsubscript𝑡totsubscript𝑁𝑡Δ𝑡t_{\text{tot}}=N_{t}\Delta titalic_t start_POSTSUBSCRIPT tot end_POSTSUBSCRIPT = italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t is what contributes most to decreasing the error.

Figure (10) shows results obtained with both linear shape functions (p1𝑝1p1italic_p 1-elements) and quadratic shape functions (p2𝑝2p2italic_p 2-elements). Just like refining the mesh does not decrease the numerical error in this case, since the solution is white noise, increasing the order does not influence the accuracy of the results significantly.

Refer to caption
Refer to caption
Figure 10: Structure factor of the discrete solution after mapping with the decorrelation matrix computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed) and Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted), and theoretical structure factor for the continuum equation (solid line). Left: p1𝑝1p1italic_p 1-elements; right: p2𝑝2p2italic_p 2-elements. All computations with semi-implicit time integration, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

In B, complementary results for the computed dynamic structure structure of the mapped solution are shown, which illustrate that the method not only succeeds in removing artificial spatial correlations from the solution, but is also able to capture the time evolution of the solution.

5 FE solution of a fourth-order 1D diffusion problem

Following de2015finite , we consider next a stochastic diffusion equation of the form given by Equation (1) with

F(u)=u+(02π)22u,𝐹𝑢𝑢superscriptsubscript02𝜋2superscript2𝑢F(u)=u+\left(\frac{\ell_{0}}{2\pi}\right)^{2}\nabla^{2}u\,,italic_F ( italic_u ) = italic_u + ( divide start_ARG roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 2 italic_π end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u , (68)

which leads to the fourth-order equation

utD2(u+(02π)22u)=(2Du𝜻).𝑢𝑡𝐷superscript2𝑢superscriptsubscript02𝜋2superscript2𝑢2𝐷𝑢𝜻\frac{\partial{u}}{\partial t}-D\nabla^{2}\left(u+\left(\frac{\ell_{0}}{2\pi}% \right)^{2}\nabla^{2}u\right)=\nabla\cdot\left(\sqrt{2Du}\boldsymbol{\zeta}% \right)\,.divide start_ARG ∂ italic_u end_ARG start_ARG ∂ italic_t end_ARG - italic_D ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ( italic_u + ( divide start_ARG roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 2 italic_π end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u ) = ∇ ⋅ ( square-root start_ARG 2 italic_D italic_u end_ARG bold_italic_ζ ) . (69)

Unlike Equation (4), the solution of which has only spatially decorrelated fluctuations, Equation (69) has a solution that exhibits spatial correlations with a finite correlation length defined by 0subscript0\ell_{0}roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. This allows us to investigate the effect of the mapping for different ratios of cell size to correlation length Δx/0Δ𝑥subscript0{\Delta x}/{\ell_{0}}roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT.

5.1 One-dimensional boundary value problem

We consider the one-dimensional version of Equation (69)

u(x,t)tD2x2(u(x,t)+(02π)22u(x,t)x2)=x(2Du0ζ(x,t)),𝑢𝑥𝑡𝑡𝐷superscript2superscript𝑥2𝑢𝑥𝑡superscriptsubscript02𝜋2superscript2𝑢𝑥𝑡superscript𝑥2𝑥2𝐷subscript𝑢0𝜁𝑥𝑡\frac{\partial u({x},t)}{\partial t}-D\frac{\partial^{2}}{\partial x^{2}}\left% (u({x},t)+\left(\frac{\ell_{0}}{2\pi}\right)^{2}\frac{\partial^{2}u({x},t)}{% \partial x^{2}}\right)=\frac{\partial}{\partial x}\left(\sqrt{2Du_{0}}{\zeta}(% {x},t)\right)\,,divide start_ARG ∂ italic_u ( italic_x , italic_t ) end_ARG start_ARG ∂ italic_t end_ARG - italic_D divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG ∂ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ( italic_u ( italic_x , italic_t ) + ( divide start_ARG roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 2 italic_π end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u ( italic_x , italic_t ) end_ARG start_ARG ∂ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ) = divide start_ARG ∂ end_ARG start_ARG ∂ italic_x end_ARG ( square-root start_ARG 2 italic_D italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG italic_ζ ( italic_x , italic_t ) ) , (70)

where u0subscript𝑢0u_{0}italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and 0subscript0\ell_{0}roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT are constants. The rest of the variables are defined in the same way as for the second-order problem discussed in Section 3.

Instead of solving Eq. (70) directly, we replace the fourth-order PDE with the coupled set of second-order equations

utD2x2(u+(02π)2w)𝑢𝑡𝐷superscript2superscript𝑥2𝑢superscriptsubscript02𝜋2𝑤\displaystyle\frac{\partial u}{\partial t}-D\frac{\partial^{2}}{\partial x^{2}% }\left(u+\left(\frac{\ell_{0}}{2\pi}\right)^{2}w\right)divide start_ARG ∂ italic_u end_ARG start_ARG ∂ italic_t end_ARG - italic_D divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG ∂ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ( italic_u + ( divide start_ARG roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 2 italic_π end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_w ) =x(2Du0𝜻)absent𝑥2𝐷subscript𝑢0𝜻\displaystyle=\frac{\partial}{\partial x}\left(\sqrt{2Du_{0}}\mathbf{% \boldsymbol{\zeta}}\right)= divide start_ARG ∂ end_ARG start_ARG ∂ italic_x end_ARG ( square-root start_ARG 2 italic_D italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG bold_italic_ζ ) (71a)
w2ux2𝑤superscript2𝑢superscript𝑥2\displaystyle w-\frac{\partial^{2}u}{\partial x^{2}}italic_w - divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_u end_ARG start_ARG ∂ italic_x start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG =0.absent0\displaystyle=0\,.= 0 . (71b)

This allows us to use the same kind of discretization described in Section 2. Periodic boundary conditions are prescribed at the boundaries of the domain,

u(x=L,t)=u(x=0,t),𝑢𝑥𝐿𝑡𝑢𝑥0𝑡u(x=L,t)=u(x=0,t)\,,italic_u ( italic_x = italic_L , italic_t ) = italic_u ( italic_x = 0 , italic_t ) , (72)
w(x=L,t)=w(x=0,t),𝑤𝑥𝐿𝑡𝑤𝑥0𝑡w(x=L,t)=w(x=0,t)\,,italic_w ( italic_x = italic_L , italic_t ) = italic_w ( italic_x = 0 , italic_t ) , (73)

and the initial conditions are defined as

u(x,t=0)=u0,𝑢𝑥𝑡0subscript𝑢0u(x,t=0)=u_{0}\,,italic_u ( italic_x , italic_t = 0 ) = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , (74)
w(x,t=0)=0.𝑤𝑥𝑡00w(x,t=0)=0\,.italic_w ( italic_x , italic_t = 0 ) = 0 . (75)

The theoretical static structure factor of the solution to this problem is given by

S(k)=u011+k2k02,𝑆𝑘subscript𝑢011superscript𝑘2superscriptsubscript𝑘02S(k)=u_{0}\frac{1}{1+\frac{k^{2}}{k_{0}^{2}}}\,,italic_S ( italic_k ) = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT divide start_ARG 1 end_ARG start_ARG 1 + divide start_ARG italic_k start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG italic_k start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG end_ARG , (76)

with the cutoff wavenumber defined as

k0=2π0.subscript𝑘02𝜋subscript0k_{0}=\frac{2\pi}{\ell_{0}}\,.italic_k start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = divide start_ARG 2 italic_π end_ARG start_ARG roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG . (77)

Unlike the case presented in Sec. 3, the covariance of the fluctuating solution to this equation for points x1subscript𝑥1x_{1}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and x2subscript𝑥2x_{2}italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is not proportional to the delta function, but to an exponentially decaying function u0k0ek0(x1x2)proportional-toabsentsubscript𝑢0subscript𝑘0superscript𝑒subscript𝑘0subscript𝑥1subscript𝑥2\propto u_{0}k_{0}e^{-k_{0}(x_{1}-x_{2})}∝ italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_k start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT - italic_k start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) end_POSTSUPERSCRIPT with characteristic length 0subscript0\ell_{0}roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT de2015finite .

This problem has a limit case when Δx/01much-greater-thanΔ𝑥subscript01\Delta x/\ell_{0}\gg 1roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ≫ 1. In this case, the correlation length of the fluctuations is much smaller than the discretization length; this corresponds to the spatially decorrelated case described in Section 3, which needs the mapping proposed in Section 4 to remove the artificial correlations introduced by the discretization. The other limit case occurs when Δx/00Δ𝑥subscript00\Delta x/\ell_{0}\rightarrow 0roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT → 0. In this case, the discretization captures the correlation length of the fluctuations completely, the variance of the fluctuations not resolved by the mesh tends to zero, and, therefore, the direct FE solution without mapping converges to the continuum solution. In the following section, we discuss the results for different ratios Δx/0Δ𝑥subscript0\Delta x/\ell_{0}roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT.

Like in Section 3, all the variables are made dimensionless variables, with the reference length L=1𝐿1L=1italic_L = 1 and the reference time T=L2/D=1𝑇superscript𝐿2𝐷1T=L^{2}/D=1italic_T = italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_D = 1.

5.2 Discretization and results

The simulation setup for this problem is based on the same discretization schemes and numerical procedures described in Sections 2 and 3.2 for the second-order boundary value problem. Figures 11 and 12 show results for the computed structure factor based on the direct FE results and on the results after the linear mapping to remove artificial correlations, for three different ratios Δx/0=L/(Nn1)/0Δ𝑥subscript0𝐿subscript𝑁𝑛1subscript0\Delta x/\ell_{0}=L/(N_{n}-1)/\ell_{0}roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_L / ( italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - 1 ) / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and for both p1𝑝1p1italic_p 1-elements (Figure 11) and p2𝑝2p2italic_p 2-elements (Figure 12). The numerical results are close to the theoretical curve given by Eq. (76) for all discretizations when the linear mapping provided by Equation (62) is applied. The direct FE results without the mapping step tend to converge to the theoretical curve too as the mesh is refined for both p1𝑝1p1italic_p 1- and p2𝑝2p2italic_p 2-elements, with the results obtained with quadratic elements approximating better the theoretical curve for the structure factor than those obtained with linear elements. However, if no mapping is applied, a finer discretization is needed, as the characteristic length of the mesh needs to be significantly smaller than the typical correlation length to avoid the presence of significant artificial correlations. Therefore, applying the decorrelation matrix seems to be advantageous even in the case where there are spatial correlations over a finite length 0>0subscript00\ell_{0}>0roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT > 0, and its effect is larger for increasing Δx/0Δ𝑥subscript0\Delta x/\ell_{0}roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT.

Refer to caption
Refer to caption
Figure 11: Structure factor of the FE results before (left) and after applying the decorrelation matrix (right): theoretical structure factor (solid line), Δx/0=0.25Δ𝑥subscript00.25\Delta x/\ell_{0}=0.25roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 0.25 (dash-dot), Δx/0=0.5Δ𝑥subscript00.5\Delta x/\ell_{0}=0.5roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 0.5 (dotted) and Δx/0=1Δ𝑥subscript01\Delta x/\ell_{0}=1roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 1 (dashed). The results have been computed with p1𝑝1p1italic_p 1-elements, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=5e6subscript𝑁𝑡5E6N_{t}=$5106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 5 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.
Refer to caption
Refer to caption
Figure 12: Structure factor of the FE results before (left) and after applying the decorrelation matrix (right): theoretical structure factor (solid line), Δx/0=0.25Δ𝑥subscript00.25\Delta x/\ell_{0}=0.25roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 0.25 (dash-dot), Δx/0=0.5Δ𝑥subscript00.5\Delta x/\ell_{0}=0.5roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 0.5 (dotted) and Δx/0=1Δ𝑥subscript01\Delta x/\ell_{0}=1roman_Δ italic_x / roman_ℓ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 1 (dashed). The results have been computed with p2𝑝2p2italic_p 2-elements, Δt=1e4Δ𝑡1E-4\Delta t=$110-4$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 4 end_ARG end_ARG, Nt=5e6subscript𝑁𝑡5E6N_{t}=$5106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 5 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000.

6 Discussion and conclusions

In this work, we have presented a numerical approach based on the finite element method to solve stochastic diffusion equations with thermal fluctuations. In particular, we have proposed a general formulation for the discrete fluctuating forcing term that is not restricted to any particular kind of element or shape function, and we have also derived a mass-conserving linear mapping to remove from the discrete solution the artificial correlations introduced by the spatial discretization.

The proposed mapping provides a solution that has a straightforward physical interpretation regardless of the spatial discretization, so it enables the use of finite element schemes without restrictions. Our analysis makes explicit the fact that the spatial discretization and the coarse-graining are two separate things, and that the artificial correlations due to the spatial discretization depend exclusively on the basis functions used to approximate the finite element solution. The mapping can be applied to any spatial discretization, including those defined on unstructured meshes. While the performance of the mapping has been demonstrated for linear equations, the approach is valid for nonlinear equations as well. In fact, the existence of an equivalent mapped solution that is free of artificial correlations can make treating non-linear terms in fluctuating-hydrodynamics equations easier.

In the case of problems for which the fluctuations are spatially correlated over a finite length, if the spatial discretization is refined enough with respect to the correlation length, the finite element method will eventually provide a solution with physically-meaningful spatial correlations. Nevertheless, the mapping succeeds in removing the artificial correlations related to underresolved fluctuations, thus providing physically meaningful results for coarser meshes.

Acknowledgement

This work was supported by the Ramon y Cajal fellowship RYC2021-030948-I funded by the MCIN/AEI/10.13039/501100011033 and by the EU under the NextGenerationEU/PRTR program, and by the research grant PID2020-113033GB-I00 funded by the MCIN/AEI/10.13039/501100011033.

References

  • (1) L. R. Volpatti and A. K. Yetisen, “Commercialization of microfluidic devices,” Trends Biotechnol, vol. 32, no. 7, pp. 347–350, 2014.
  • (2) L. Bocquet, “Nanofluidics coming of age,” Nat. Mater., vol. 19, no. 3, pp. 254–256, 2020.
  • (3) S. Faucher, N. Aluru, M. Z. Bazant, D. Blankschtein, A. H. Brozena, J. Cumings, J. Pedro de Souza, M. Elimelech, R. Epsztein, J. T. Fourkas, et al., “Critical knowledge gaps in mass transport through single-digit nanopores: A review and perspective,” J. Phys. Chem. C, vol. 123, no. 35, pp. 21309–21326, 2019.
  • (4) A. Lainé, A. Niguès, L. Bocquet, and A. Siria, “Nanotribology of ionic liquids: transition to yielding response in nanometric confinement with metallic surfaces,” Phys. Rev. X, vol. 10, no. 1, p. 011068, 2020.
  • (5) J. M. O. De Zarate and J. V. Sengers, Hydrodynamic fluctuations in fluids and fluid mixtures. Elsevier, 2006.
  • (6) A. Donev, J. B. Bell, A. de la Fuente, and A. L. Garcia, “Diffusive transport by thermal velocity fluctuations,” Phys. Rev. Lett., vol. 106, no. 20, p. 204501, 2011.
  • (7) J.-P. Péraud, A. J. Nonaka, J. B. Bell, A. Donev, and A. L. Garcia, “Fluctuation-enhanced electric conductivity in electrolyte solutions,” Proc. Natl. Acad. Sci. U.S.A., vol. 114, no. 41, pp. 10829–10833, 2017.
  • (8) H. R. Vutukuri, M. Hoore, C. Abaurrea-Velasco, L. van Buren, A. Dutto, T. Auth, D. A. Fedosov, G. Gompper, and J. Vermant, “Active particles induce large shape deformations in giant lipid vesicles,” Nature, vol. 586, no. 7827, pp. 52–56, 2020.
  • (9) C. R. Brown, C. Mao, E. Falkovskaia, M. S. Jurica, and H. Boeger, “Linking stochastic fluctuations in chromatin structure and gene expression,” PLoS Biol, vol. 11, no. 8, p. e1001621, 2013.
  • (10) L. D. Landau and E. M. Lifshitz, Statistical Physics: Volume 5, vol. 5. Elsevier, 2013.
  • (11) T. Leonard, B. Lander, U. Seifert, and T. Speck, “Stochastic thermodynamics of fluctuating density fields: Non-equilibrium free energy differences under coarse-graining,” J. Chem. Phys., vol. 139, no. 20, 2013.
  • (12) A. Chaudhri, J. B. Bell, A. L. Garcia, and A. Donev, “Modeling multiphase flow using fluctuating hydrodynamics,” Phys. Rev. E, vol. 90, no. 3, p. 033014, 2014.
  • (13) J.-P. Péraud, A. Nonaka, A. Chaudhri, J. B. Bell, A. Donev, and A. L. Garcia, “Low Mach number fluctuating hydrodynamics for electrolytes,” Phys. Rev. Fluids, vol. 1, no. 7, p. 074103, 2016.
  • (14) A. Donev, A. L. Garcia, J.-P. Péraud, A. J. Nonaka, and J. B. Bell, “Fluctuating hydrodynamics and debye-hückel-onsager theory for electrolytes,” Curr. Opin. Electrochem., vol. 13, pp. 1–10, 2019.
  • (15) P. J. Atzberger, “Spatially adaptive stochastic numerical methods for intrinsic fluctuations in reaction–diffusion systems,” J. Comput. Phys, vol. 229, no. 9, pp. 3474–3501, 2010.
  • (16) A. K. Bhattacharjee, K. Balakrishnan, A. L. Garcia, J. B. Bell, and A. Donev, “Fluctuating hydrodynamics of multi-species reactive mixtures,” J. Chem. Phys., vol. 142, no. 22, 2015.
  • (17) C. Kim, A. Nonaka, J. B. Bell, A. L. Garcia, and A. Donev, “Stochastic simulation of reaction-diffusion systems: A fluctuating-hydrodynamics approach,” J. Chem. Phys., vol. 146, no. 12, p. 124110, 2017.
  • (18) F. Balboa Usabiaga, I. Pagonabarraga, and R. Delgado-Buscalioni, “Inertial coupling for point particle fluctuating hydrodynamics,” J. Comput. Phys, vol. 235, pp. 701–722, 2013.
  • (19) E. E. Keaveny, “Fluctuating force-coupling method for simulations of colloidal suspensions,” J. Comput. Phys, vol. 269, pp. 61–79, 2014.
  • (20) B. Delmotte and E. E. Keaveny, “Simulating Brownian suspensions with fluctuating hydrodynamics,” J. Chem. Phys., vol. 143, no. 24, 2015.
  • (21) M. De Corato, J. Slot, M. Hütter, G. D’Avino, P. L. Maffettone, and M. A. Hulsen, “Finite element formulation of fluctuating hydrodynamics for fluids filled with rigid particles using boundary fitted meshes,” J. Comput. Phys, vol. 316, pp. 632–651, 2016.
  • (22) B. Sprinkle, A. Donev, A. P. S. Bhalla, and N. Patankar, “Brownian dynamics of fully confined suspensions of rigid particles without Green’s functions,” J. Chem. Phys., vol. 150, no. 16, 2019.
  • (23) T. A. Westwood, B. Delmotte, and E. E. Keaveny, “A generalised drift-correcting time integration scheme for Brownian suspensions of rigid particles with arbitrary shape,” J. Comput. Phys, vol. 467, p. 111437, 2022.
  • (24) M. Hütter, M. A. Hulsen, and P. D. Anderson, “Fluctuating viscoelasticity,” J. Nonnewton. Fluid Mech., vol. 256, pp. 42–56, 2018.
  • (25) M. Hütter, P. D. Olmsted, and D. J. Read, “Fluctuating viscoelasticity based on a finite number of dumbbells,” Eur. Phys. J. E, vol. 43, pp. 1–14, 2020.
  • (26) R. Tsekov and E. Ruckenstein, “Effect of thermal fluctuations on the stability of draining thin films,” Langmuir, vol. 9, no. 11, pp. 3264–3269, 1993.
  • (27) J. E. Sprittles, J. Liu, D. A. Lockerby, and T. Grafke, “Rogue nanowaves: A route to film rupture,” Phys. Rev. Fluids, vol. 8, no. 9, p. L092001, 2023.
  • (28) J. Liu, C. Zhao, D. A. Lockerby, and J. E. Sprittles, “Thermal capillary waves on bounded nanoscale thin films,” Phys. Rev. E, vol. 107, no. 1, p. 015105, 2023.
  • (29) Y. Wang, J. K. Sigurdsson, E. Brandt, and P. J. Atzberger, “Dynamic implicit-solvent coarse-grained models of lipid bilayer membranes: Fluctuating hydrodynamics thermostat,” Phys. Rev. E, vol. 88, no. 2, p. 023301, 2013.
  • (30) D. A. Rower, M. Padidar, and P. J. Atzberger, “Surface fluctuating hydrodynamics methods for the drift-diffusion dynamics of particles and microstructures within curved fluid interfaces,” J. Comput. Phys, vol. 455, p. 110994, 2022.
  • (31) M. Gallo, F. Magaletti, and C. M. Casciola, “Thermally activated vapor bubble nucleation: The Landau-Lifshitz–Van der Waals approach,” Phys. Rev. Fluids, vol. 3, no. 5, p. 053604, 2018.
  • (32) M. Gallo, F. Magaletti, A. Georgoulas, M. Marengo, J. De Coninck, and C. M. Casciola, “A nanoscale view of the origin of boiling and its dynamics,” Nat. Commun., vol. 14, no. 1, p. 6428, 2023.
  • (33) D. S. Dean, “Langevin equation for the density of a system of interacting Langevin processes,” J. Phys. A: Math. Gen., vol. 29, no. 24, p. L613, 1996.
  • (34) A. Donev and E. Vanden-Eijnden, “Dynamic density functional theory with hydrodynamic interactions and fluctuations,” J. Chem. Phys., vol. 140, no. 23, 2014.
  • (35) A. J. Archer and M. Rauscher, “Dynamical density functional theory for interacting Brownian particles: stochastic or deterministic?,” J. Phys. A, vol. 37, no. 40, p. 9325, 2004.
  • (36) P.-H. Chavanis, “Generalized stochastic Fokker-Planck Equations,” Entropy, vol. 17, no. 5, pp. 3205–3252, 2015.
  • (37) P.-H. Chavanis, “The generalized stochastic Smoluchowski equation,” Entropy, vol. 21, no. 10, p. 1006, 2019.
  • (38) F. Cornalba and J. Fischer, “The Dean–Kawasaki equation and the structure of density fluctuations in systems of diffusing particles,” Arch Ration Mech Anal, vol. 247, no. 5, p. 76, 2023.
  • (39) S. Delong, B. E. Griffith, E. Vanden-Eijnden, and A. Donev, “Temporal integrators for fluctuating hydrodynamics,” Phys. Rev. E, vol. 87, no. 3, p. 033302, 2013.
  • (40) A. Donev, E. Vanden-Eijnden, A. Garcia, and J. Bell, “On the accuracy of finite-volume schemes for fluctuating hydrodynamics,” Comm App Math Comp Sci, vol. 5, no. 2, pp. 149–197, 2010.
  • (41) F. Balboa Usabiaga, J. B. Bell, R. Delgado-Buscalioni, A. Donev, T. G. Fai, B. E. Griffith, and C. S. Peskin, “Staggered schemes for fluctuating hydrodynamics,” Multiscale Model Simul, vol. 10, no. 4, pp. 1369–1408, 2012.
  • (42) A. Russo, S. P. Perez, M. A. Durán-Olivencia, P. Yatsyshin, J. A. Carrillo, and S. Kalliadasis, “A finite-volume method for fluctuating dynamical density functional theory,” J. Comput. Phys, vol. 428, p. 109796, 2021.
  • (43) J. de la Torre, P. Español, and A. Donev, “Finite element discretization of non-linear diffusion equations with thermal fluctuations,” J. Chem. Phys., vol. 142, no. 9, p. 094115, 2015.
  • (44) P. E. Kloeden and E. Platen, Stochastic differential equations. Springer, 1992.
  • (45) J. de la Torre and P. Español, “Coarse-graining Brownian motion: From particles to a discrete diffusion equation,” J. Chem. Phys., vol. 135, no. 11, p. 114103, 2011.
  • (46) P. Español and A. Donev, “Coupling a nano-particle with isothermal fluctuating hydrodynamics: Coarse-graining from microscopic to mesoscopic dynamics,” J. Chem. Phys., vol. 143, no. 23, p. 234104, 2015.

Appendix A Implementation of the linearized stochastic forcing term

Based on Equation (16), an implementation of the stochastic forcing term may be proposed through a decomposition of the diffusion matrix, which for our standard Galerkin discretization is symmetric, and can therefore always be decomposed into

𝐃=𝐀D𝐀DT,𝐃subscript𝐀𝐷superscriptsubscript𝐀𝐷𝑇\mathbf{D}=\mathbf{A}_{D}\,\mathbf{A}_{D}^{T}\,,bold_D = bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , (78)

where matrix 𝐀DTsuperscriptsubscript𝐀𝐷𝑇\mathbf{A}_{D}^{T}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT is the transpose of matrix 𝐀Dsubscript𝐀𝐷\mathbf{A}_{D}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT. After integrating in time (see also Section 2.3), we can compute the array 𝐟nsuperscript𝐟𝑛\mathbf{f}^{n}bold_f start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT at every time step n𝑛nitalic_n as

fin=2u0ain,subscriptsuperscript𝑓𝑛𝑖2subscript𝑢0subscriptsuperscript𝑎𝑛𝑖{f}^{n}_{i}=\sqrt{2u_{0}}\,a^{n}_{i}\,,italic_f start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = square-root start_ARG 2 italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG italic_a start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , (79)

with array 𝐚n={ain}i=1Ndofsuperscript𝐚𝑛superscriptsubscriptsubscriptsuperscript𝑎𝑛𝑖𝑖1subscript𝑁dof\mathbf{a}^{n}=\left\{a^{n}_{i}\right\}_{i=1}^{N_{\text{dof}}}bold_a start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT = { italic_a start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT } start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT end_POSTSUPERSCRIPT defined as

𝐚n=𝐀D𝐳n,superscript𝐚𝑛subscript𝐀𝐷superscript𝐳𝑛\mathbf{a}^{n}=\mathbf{A}_{D}\,\mathbf{z}^{n}\,,bold_a start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT = bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT bold_z start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT , (80)

where 𝐳(t)𝐳𝑡\mathbf{z}(t)bold_z ( italic_t ) is an array of random numbers of length Ndofsubscript𝑁dofN_{\text{dof}}italic_N start_POSTSUBSCRIPT dof end_POSTSUBSCRIPT following a Gaussian distribution of expected value 00 and variance 1111. Matrix 𝐀Dsubscript𝐀𝐷\mathbf{A}_{D}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT can be computed once before the time-stepping starts, and then 𝐟nsuperscript𝐟𝑛\mathbf{f}^{n}bold_f start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT can be computed at each time step based on it. The decomposition given by Equation (78) is not unique, but a convenient definition is

𝐀D=𝐔D𝚺D𝐔DT,subscript𝐀𝐷subscript𝐔𝐷subscript𝚺𝐷superscriptsubscript𝐔𝐷𝑇\mathbf{A}_{D}=\mathbf{U}_{D}\sqrt{\boldsymbol{\Sigma}_{D}}\mathbf{U}_{D}^{T}\,,bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT = bold_U start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT square-root start_ARG bold_Σ start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT end_ARG bold_U start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT , (81)

where 𝐔Dsubscript𝐔𝐷\mathbf{U}_{D}bold_U start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT is a unitary matrix and 𝚺Dsubscript𝚺𝐷{\boldsymbol{\Sigma}_{D}}bold_Σ start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT is a diagonal matrix, satisfying

𝐃=𝐔D𝚺D𝐔DT.𝐃subscript𝐔𝐷subscript𝚺𝐷superscriptsubscript𝐔𝐷𝑇\mathbf{D}=\mathbf{U}_{D}{\boldsymbol{\Sigma}_{D}}\mathbf{U}_{D}^{T}\,.bold_D = bold_U start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT bold_Σ start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT bold_U start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT . (82)

The definition of 𝐀Dsubscript𝐀𝐷\mathbf{A}_{D}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT provided by Equation (81) makes 𝐀Dsubscript𝐀𝐷\mathbf{A}_{D}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT symmetric. Moreover, while in general a matrix 𝐀Dsubscript𝐀𝐷\mathbf{A}_{D}bold_A start_POSTSUBSCRIPT italic_D end_POSTSUBSCRIPT satisfying Equation (78) will be a dense matrix, the definition provided by Equation (81) makes it possible to approximate it by a sparse matrix, which is important to preserve the computational efficiency of the finite element method.

Appendix B Dynamic structure factor

In this appendix, we present complementary results to those presented in Sections 3 and 4.3. In particular, we present results for the dynamic structure factor, which, unlike the static structure factor discussed in previous sections, contains information about the time evolution of the solution. The dynamic structure factor is defined as the Fourier transform of the time-dependent correlation function. For the problem discussed in Section 3, the analytical expression for the dynamic structure factor is given by

Sdyn(k,τ)=𝒰(k,t)𝒰(k,tτ)=u0eDk2τ.subscript𝑆dyn𝑘𝜏delimited-⟨⟩𝒰𝑘𝑡𝒰𝑘𝑡𝜏subscript𝑢0superscript𝑒𝐷superscript𝑘2𝜏S_{\text{dyn}}(k,\tau)=\left<\mathcal{U}(k,t)\mathcal{U}(-k,t-\tau)\right>=u_{% 0}e^{-Dk^{2}\tau}\,.italic_S start_POSTSUBSCRIPT dyn end_POSTSUBSCRIPT ( italic_k , italic_τ ) = ⟨ caligraphic_U ( italic_k , italic_t ) caligraphic_U ( - italic_k , italic_t - italic_τ ) ⟩ = italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT - italic_D italic_k start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_τ end_POSTSUPERSCRIPT . (83)

Figure 13 shows the dynamic structure factor corresponding to the finite element solution (before mapping) for two values of the wavenumber k𝑘kitalic_k as a function of the time lag τ𝜏\tauitalic_τ. As also explained in Section 3, for a given value of k𝑘kitalic_k, the results converge to their theoretical value as the mesh is refined.

Refer to caption
Refer to caption
Figure 13: Dynamic structure factor of the finite-element solution (before applying the decorrelation matrix) as a function of the time lag for k=20(2π/L)𝑘202𝜋𝐿k=20\,(2\pi/L)italic_k = 20 ( 2 italic_π / italic_L ) (left) and k=30(2π/L)𝑘302𝜋𝐿k=30\,(2\pi/L)italic_k = 30 ( 2 italic_π / italic_L ) (right): computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed), Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted) and Nn=201subscript𝑁𝑛201N_{n}=201italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 201 (dash-dot), and theoretical dynamic structure factor (solid line). All computations with p1𝑝1p1italic_p 1-elements, Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000, α=1/2𝛼12\alpha=1/2italic_α = 1 / 2.

Figure 14 displays the dynamic structure factor corresponding to the mapped finite element solution for the same two values of k𝑘kitalic_k. A key difference with respect to the finite element results before mapping (Figure 13) is that the mapped results present a good agreement with the theoretical value for τ𝜏\tauitalic_τ values close to zero regardless of the size of the mesh. For larger values of τ𝜏\tauitalic_τ, the dynamic structure factor of the mapped results converges as well towards the theoretical one as the mesh is refined.

Refer to caption
Refer to caption
Figure 14: Dynamic structure factor of the mapped solution (after applying the decorrelation matrix) as a function of the time lag for k=20(2π/L)𝑘202𝜋𝐿k=20\,(2\pi/L)italic_k = 20 ( 2 italic_π / italic_L ) (left) and k=30(2π/L)𝑘302𝜋𝐿k=30\,(2\pi/L)italic_k = 30 ( 2 italic_π / italic_L ) (right): computed with Nn=51subscript𝑁𝑛51N_{n}=51italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 51 (dashed), Nn=101subscript𝑁𝑛101N_{n}=101italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 101 (dotted) and Nn=201subscript𝑁𝑛201N_{n}=201italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 201 (dash-dot), and theoretical dynamic structure factor (solid line). All computations with p1𝑝1p1italic_p 1-elements, Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, Nt=1e6subscript𝑁𝑡1E6N_{t}=$1106$italic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG 6 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000, α=1/2𝛼12\alpha=1/2italic_α = 1 / 2.

Figures 15 and 16 show the effect of the time step ΔtΔ𝑡\Delta troman_Δ italic_t and of the total simulated time NtΔtsubscript𝑁𝑡Δ𝑡N_{t}\Delta titalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t on the computed structure factor based on the mapped solution, and illustrate the convergence of the numerical solution towards the theoretical one as the time step decreases and the total simulated time increases. For values of τ𝜏\tauitalic_τ below a threshold, decreasing the time step leads to a better agreement with the theoretical solution, as seen in Figure 15. For values of τ𝜏\tauitalic_τ above a certain threshold, the value of the dynamic structure factor is small, and the residual error due to the finite time NtΔtsubscript𝑁𝑡Δ𝑡N_{t}\Delta titalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t that is simulated dominates the solution. As shown in Figure 16, this error decreases as the total simulated time NtΔtsubscript𝑁𝑡Δ𝑡N_{t}\Delta titalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t increases.

Refer to caption
Figure 15: Influence of the time step on the dynamic structure factor of the mapped solution for k=20(2π/L)𝑘202𝜋𝐿k=20\,(2\pi/L)italic_k = 20 ( 2 italic_π / italic_L ): computed with Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG (dashed) and Δt=5e5Δ𝑡5E-5\Delta t=$510-5$roman_Δ italic_t = start_ARG 5 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG (dotted), and theoretical dynamic structure factor (solid line). All computations with p1𝑝1p1italic_p 1-elements, Nn=201subscript𝑁𝑛201N_{n}=201italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 201, NtΔt=10L2/Dsubscript𝑁𝑡Δ𝑡10superscript𝐿2𝐷N_{t}\Delta t=10L^{2}/Ditalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t = 10 italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_D, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000, α=1/2𝛼12\alpha=1/2italic_α = 1 / 2.
Refer to caption
Figure 16: Influence of the total simulation time on the dynamic structure factor of the mapped solution for k=20(2π/L)𝑘202𝜋𝐿k=20\,(2\pi/L)italic_k = 20 ( 2 italic_π / italic_L ): computed with NtΔt=10L2/Dsubscript𝑁𝑡Δ𝑡10superscript𝐿2𝐷N_{t}\Delta t=10L^{2}/Ditalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t = 10 italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_D (dashed) and NtΔt=100L2/Dsubscript𝑁𝑡Δ𝑡100superscript𝐿2𝐷N_{t}\Delta t=100L^{2}/Ditalic_N start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT roman_Δ italic_t = 100 italic_L start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_D (dotted), and theoretical dynamic structure factor (solid line). All computations with p1𝑝1p1italic_p 1-elements, Nn=201subscript𝑁𝑛201N_{n}=201italic_N start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 201, Δt=1e5Δ𝑡1E-5\Delta t=$110-5$roman_Δ italic_t = start_ARG 1 end_ARG start_ARG ⁢ end_ARG start_ARG roman_e start_ARG - 5 end_ARG end_ARG, u0=10000subscript𝑢010000u_{0}=10000italic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 10000, α=1/2𝛼12\alpha=1/2italic_α = 1 / 2.

These results show that the numerical approach based on applying the decorrelation matrix to the finite element results, as proposed in Section 4, can capture the time evolution of the solution.