Questions on Jacobian

92 views
Skip to first unread message

moos...@gmail.com

unread,
May 5, 2016, 3:46:23 PM5/5/16
to moose-users
I have a couple of questions related to my still fairly tenuous understanding of MOOSE, Jacobians,and shape functions,.

Question 1:
 
It is not required to overwrite the Jacobian in the kernel.C program, as I understand. From this, can I take it that a converged solution is possible if the Jacobian has not been cast exactly correctly? I would assume the poorer your Jacobian representation is, the the slower your convergence, or convergence might be possible if it is poor enough?

Question 2:
 I was looking at how the off-diagonal Jacobian is calculated in tutorial 6 of darcy_thermo_mech. In DarcyConvection.C, there is a variable, superficial velocity which is calculated. In calculating the residual, it is calculated as:
 
superficial_velocity = _porosity[_qp] * -(_permeability[_qp]/_viscosity[_qp]) * _pressure_gradient[_qp]

For the off-diagonal Jacobian term, which is darcy_pressure, this becomes:
 
superficial_velocity = _porosity[_qp] * -(_permeability[_qp]/_viscosity[_qp]) * _grad_phi[_j][_qp]
 

The "_u" variable for this kernel, I believe, is the temperature. Therefore, is not the term "_grad_phi[_j][_qp]" above related to the shape function for temperature?
Is this necessarily the same shape function that is used for darcy_pressure? Even if different finite element methods are used for the different variables? Should not the term "_grad_phi[_j][_qp]" be related to darcy_pressure?
If so, I do not know how the distinction is made. Hopefully these questions make sense.


Peterson, JW

unread,
May 5, 2016, 4:46:52 PM5/5/16
to moose-users
On Thu, May 5, 2016 at 1:46 PM, <moos...@gmail.com> wrote:
I have a couple of questions related to my still fairly tenuous understanding of MOOSE, Jacobians,and shape functions,.

Question 1:
 
It is not required to overwrite the Jacobian in the kernel.C program, as I understand. From this, can I take it that a converged solution is possible if the Jacobian has not been cast exactly correctly? I would assume the poorer your Jacobian representation is, the the slower your convergence, or convergence might be possible if it is poor enough?

Yes, as long as you are using the PJFNK solve type (i.e. not NEWTON) the computeQpJacobian() is optional as it is only used for preconditioning.  The action of the Jacobian is computed correctly from computeQpResidual().


 

Question 2:
 I was looking at how the off-diagonal Jacobian is calculated in tutorial 6 of darcy_thermo_mech. In DarcyConvection.C, there is a variable, superficial velocity which is calculated. In calculating the residual, it is calculated as:
 
superficial_velocity = _porosity[_qp] * -(_permeability[_qp]/_viscosity[_qp]) * _pressure_gradient[_qp]

For the off-diagonal Jacobian term, which is darcy_pressure, this becomes:
 
superficial_velocity = _porosity[_qp] * -(_permeability[_qp]/_viscosity[_qp]) * _grad_phi[_j][_qp]
 

The "_u" variable for this kernel, I believe, is the temperature. Therefore, is not the term "_grad_phi[_j][_qp]" above related to the shape function for temperature?

Not in the context of computeQpOffDiagJacobian().  MOOSE has swapped out the meaning of _grad_phi[_j][_qp] based on the variable it is currently computing the Jacobian contribution for.

--
John
Reply all
Reply to author
Forward
0 new messages