alasdairtran / fourierflow

[ICLR 2023] Factorized Fourier Neural Operators
https://arxiv.org/abs/2111.13802
MIT License
144 stars 19 forks source link

Incorporating force and viscosity functions #4

Open Tariq97 opened 2 years ago

Tariq97 commented 2 years ago

Hi,

This is a very nice paper and thanks for keeping the code online. I have a doubt regarding how you include viscosity and force function in your input. For example in the original paper, for Navier stokes, the input shape to fourier layer was (batch_size, grid_x, grid_y, widths).

Did you incorporate viscosity and forcing function in this input? If so, can you please let me know how you added these parameters? Viscosity I believe is a scalar, so I am confused how it fit in the inputs.

Looking forward for your reply, Thanks. Tariq

alasdairtran commented 2 years ago

Hi Tariq,

Did you incorporate viscosity and forcing function in this input?

Yes, even though viscosity is a scalar, you can also think of it as a constant function over the (x,y) coordinates. So for every point on the grid, we have 5 pieces of information: vorticity, external force, viscosity, x-coordinate, and y-coordinate. Thus our input shape is now [batch_size, grid_x, grid_y, 5].