Extract Derivatives from ADReal #23606
-
Hello: I would like to get the pressure and temperature derivatives from the ADReal variable for density. For example: Real drho_dT = _rho[_qp].derivatives()[1]; This does give me the temperature derivative but only for the 1st quadrature point. So, the "1" appears to correspond to the index of the non-linear variable. How can I get the indices of _T[_qp] and _p[_qp]? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello There is an example in the INSFVMomentumAdvection fvkernel. First we get the dof number (here from the element argument) What kind of kernel or object are you using? Guillaume |
Beta Was this translation helpful? Give feedback.
Hello
There is an example in the INSFVMomentumAdvection fvkernel. First we get the dof number (here from the element argument)
const auto dof_number = sided_elem->dof_number(_sys.number(), _var.number(), 0);
then access the derivatives at that index
const Real d_u_face_d_dof = u_face.derivatives()[dof_number];
What kind of kernel or object are you using?
Are _T and _p both nonlinear variables?
Guillaume