Hello, everyone,
I want to obtain the derivative of all the solution points. And I am confused about something.
In the navstokes/elements.py, velocity gradients, pressure gradient and density gradient are presented, but I did’t see where to use it. and Where does grad_cons pass from?
@staticmethod
def grad_con_to_pri(cons, grad_cons, cfg):
rho, *rhouvw = cons[:-1]
grad_rho, *grad_rhouvw, grad_E = grad_cons
# Divide momentum components by ρ
uvw = [rhov / rho for rhov in rhouvw]
# Velocity gradients:
grad_uvw = [(grad_rhov - v*grad_rho) / rho for grad_rhov, v in zip(grad_rhouvw, uvw)]
# Pressure gradient:
gamma = cfg.getfloat('constants', 'gamma')
grad_p = grad_E - 0.5*(np.einsum('ijk,iljk->ljk', uvw, grad_rhouvw) + np.einsum('ijk,iljk->ljk', rhouvw, grad_uvw))
grad_p *= (gamma - 1)
return [grad_rho] + grad_uvw + [grad_p]
Second, in the navstokes/inters.py, gradul=self._vect_lhs, _vect_lhs is views matrix, I know that the views used by the interface flux calculation are views onto data at flux points. And I didn’t see any derivative operations in _vect_view matrix. Could someone have some idea about these quesions?