Resumen: 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. Idioma: Inglés DOI: 10.1016/j.jcp.2024.113098 Año: 2024 Publicado en: Journal of Computational Physics 510 (2024), 113098 [20 pp.] ISSN: 0021-9991 Financiación: info:eu-repo/grantAgreement/ES/MICINN/PID2020-113033GB-I00 Financiación: info:eu-repo/grantAgreement/ES/MICINN/RYC2021-030948-I Tipo y forma: Article (Published version) Área (Departamento): Área Mecánica de Fluidos (Dpto. Ciencia Tecnol.Mater.Fl.)