In many situations in unstructured mesh solvers, one needs to compute gradient of arbitrary variable $\phi$ such as temperature or velocity at face centers (one of such situations is correction for mesh non-orthogonality), which can be approximated as:
$$ \nabla \phi_f = (g_C \ \nabla \phi_C) + (g_F \ \nabla \phi_F)$$
Where $C$ & $F$ are two adjacent cells sharing the face $f$ and $g_C$ & $g_F$ are interpolation weight factors.
Now, $\nabla \phi_C$ and $\nabla \phi_F$ can be approximated as the average gradient across the cell, using Gauss-Green theorem as: $$ \nabla \phi_C = \frac{1}{V_C} \sum_{faces} \phi_f \mathbf{S_f} $$
where $\mathbf{S_f}$ is the face normal vector at face $f$, and $V_C$ is the cell volume.
The $\phi_f$ values for interior faces can be easily known.
- What if the face is a boundary face and insulated? how to get $\phi_f$ in such case?
- What if the face has a fixed boundary condition $\phi_{f} = \phi_{specified}$ (meaning that face has only one adjacent cell, so first interpolation equation cannot be used), how to compute the gradient at the face in such case?