Fluidforce with intg.grad_soln

Hi,

I was trying to use the physical gradients at the solution points obtained by the intg.grad_soln to compute the forces on the surface with the fluidforce plugin but the results seem to differ. Did you ever try? If so, is it normal? And why?

An MWE of the change is:

# Physical gradient at solution points
  duupts = intg.grad_soln[etype][..., surfaceindices]
  duupts = duupts.reshape(ndims, nupts, -1)

  # Interpolate gradient to flux points
  dufpts = np.array([m0 @ du for du in duupts])
  dufpts = dufpts.reshape(ndims, nfpts, nvars, -1)
  dufpts = dufpts.swapaxes(1, 2)

  # Viscous stress
  vis = self.stress_tensor(ufpts, dufpts)

  # Do the quadrature
  fm[1, :ndims] += np.einsum('i...,klij,jil', qwts, vis, norms)

The results obtained with the plugin are (for the viscous part):
[ 22.14644846, -29.03589684]]

and using intg.soln:

[ 34.32209827, -43.92922663]

Best

It should be associated with the use of the corrected solution, therefore using intg.grad_soln is the correct one. Correct me if I am wrong. If you want I can submit a pull request

Yes, as you note fluid force doesn’t use the corrected gradients. This is mostly a historical artefact; it was developed before PyFR had support for giving plugins access to corrected gradients. If it was written or rewritten today we’d almost certainly use corrected gradients.

Regards, Freddie.

1 Like

Yes, please.

Regards, Freddie.

Just did, let me know