How to calculate the divergence of the gradient of a scalar?
Posted: Thu Jan 19, 2012 2:18 pm
Hi, everyone!
I
define a user scalar (marked by “f”) in the program, and I want to calculate
the divergence of the gradient of the scalar.
I
want to calculate it in the following way.
First,
the gradient of “f” can be obtained by calling the subroutine “grdcel”,
the three components of the gradient are “fx”, “fy” and “fz”.
Second, the gradient of “fx” can also be obtained by calling the subroutine
“grdcel”, the three components of the gradient of “fx” are “fxx”, “fxy”
and “fxz”. The gradient of “fy” and “fz” can be obtained in the same way, the components
of the gradient of “fy” are “fyx”, “fyy” and “fyz”, the components of the gradient of “fz” are “fzx”, “fzy” and “fzz”. So the divergence of
the gradient of “f” is equal to “fxx” +”fyy”+”fzz”.
But
there is a problem, calling the subroutine “grdcel” need the boundary
coefficients. The coefficients of “f” is known, the coefficients of “fx”, “fy”
and “fz” are unkown, how to get the boundary coefficients of “fx”, “fy” and “fz”?
Is there another way to calculate the divergence
of the gradient of a scalar ? Thanks very much! Yuan Huang
I
define a user scalar (marked by “f”) in the program, and I want to calculate
the divergence of the gradient of the scalar.
I
want to calculate it in the following way.
First,
the gradient of “f” can be obtained by calling the subroutine “grdcel”,
the three components of the gradient are “fx”, “fy” and “fz”.
Second, the gradient of “fx” can also be obtained by calling the subroutine
“grdcel”, the three components of the gradient of “fx” are “fxx”, “fxy”
and “fxz”. The gradient of “fy” and “fz” can be obtained in the same way, the components
of the gradient of “fy” are “fyx”, “fyy” and “fyz”, the components of the gradient of “fz” are “fzx”, “fzy” and “fzz”. So the divergence of
the gradient of “f” is equal to “fxx” +”fyy”+”fzz”.
But
there is a problem, calling the subroutine “grdcel” need the boundary
coefficients. The coefficients of “f” is known, the coefficients of “fx”, “fy”
and “fz” are unkown, how to get the boundary coefficients of “fx”, “fy” and “fz”?
Is there another way to calculate the divergence
of the gradient of a scalar ? Thanks very much! Yuan Huang