You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have Smagorinsky implemented and working. However we are taking a large number of ffts:
uh=-il*ph
vh=ik*ph
Sxx = torch.fft.irfftn(uh*ik,dim=(1,2))
Syy = torch.fft.irfftn(vh*il,dim=(1,2))
Sxy = 0.5 * torch.fft.irfftn(uh * il + vh * ik)
nu = (self.constant * dx)**2 * torch.sqrt(2 * (Sxx**2 + Syy**2 + 2 * Sxy**2))
nu_Sxxh = torch.fft.rfftn(nu * Sxx,dim=(1,2))
nu_Sxyh = torch.fft.rfftn(nu * Sxy,dim=(1,2))
nu_Syyh = torch.fft.rfftn(nu * Syy,dim=(1,2))
du = 2 * (torch.fft.irfftn(nu_Sxxh * ik,dim=(1,2)) + torch.fft.irfftn(nu_Sxyh * il,dim=(1,2)))
dv = 2 * (torch.fft.irfftn(nu_Sxyh * ik,dim=(1,2)) + torch.fft.irfftn(nu_Syyh * il,dim=(1,2)))
## Take curl to convert u, v forcing to potential vorticity forcing
dq = -torch.fft.irfftn(il*torch.fft.rfftn(du,dim=(1,2)),dim=(1,2))+torch.fft.irfftn(ik*torch.fft.rfftn(dv,dim=(1,2)),dim=(1,2))
Given the relationship between the velocities and the streamfunction, and that we are mostly just taking derivatives here, there should be some speedups possible. And given that we need this Smag even for our "DNS", we should make this as efficient as possible.
The text was updated successfully, but these errors were encountered:
We have Smagorinsky implemented and working. However we are taking a large number of ffts:
Given the relationship between the velocities and the streamfunction, and that we are mostly just taking derivatives here, there should be some speedups possible. And given that we need this Smag even for our "DNS", we should make this as efficient as possible.
The text was updated successfully, but these errors were encountered: