1
$\begingroup$

I am trying to make a 3d grid of a magnetic field with some noises (which will be added to the ordinary field) for a computer simulation. I have the formula for the ordinary field, also I am using a fast Fourier transform (FFT) to create Gaussian Random Field for noises.

The problem is, that the noise field I have created is a scalar field not a vector. So I need to find a way for creating vector-valued Gaussian random field whose divergence will be equal to zero.

$\endgroup$

1 Answer 1

1
$\begingroup$

You can use the fact that the divergence-free constraint, $\nabla\cdot\mathbf{B}=0$, becomes $$ \mathbf{k}\cdot\tilde{\mathbf{B}} = 0 $$ in Fourier space, where $\tilde{\mathbf{B}}$ denotes the Fourier transform of $\mathbf{B}$ and $\mathbf{k}$ is the wavevector.

To get a vector-valued field, you could first generate a random field for each of the three components (e.g. $\tilde{\mathbf{B}} =(\tilde{B}_x,\tilde{B}_y,\tilde{B}_z)$ in Fourier space). Once you have these, you can subtract off the projection of $\tilde{\mathbf{B}}$ along $\mathbf{k}$ to satisfy $\mathbf{k}\cdot\tilde{\mathbf{B}} = 0$: $$ \tilde{\mathbf{B}} \to \tilde{\mathbf{B}} - \frac{\mathbf{k}}{k^2}(\tilde{\mathbf{B}}\cdot\mathbf{k}). $$

Taking the inverse Fourier transform of this new $\tilde{\mathbf{B}}$ will then give you a divergence-free noise field.

$\endgroup$
1
  • $\begingroup$ Thanks for your respond. I was thinking about decomposing my field using Helmholtz decomposition and take the divergence-free part. And eventually I've derived the very same formula that you've suggested) $\endgroup$ Commented Nov 22, 2022 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.