error in calculating grad field. possible bug?
In the file write.H in laplacianFoam solver, I simply add a line
recompile and run the tutorial for laplacianFoam. (the flange tutorial)
In file gradT: zeroGradient for all patches!
In files gradTx,gradTy,gradTz: non-zero values for gradTx, gradTy and gradTz on patches where zeroGradient is specified! and non zero for other patches too, though the gradT file shows zeroGradient.
Whats wrong and with whom? (me or OF)
im not sure but i think when you fixed zeroGradient at patch it will consider the patch normal gradient zero so the gradient of the patch in the other directions are non- zero
what about patches with a fixedValue bc? Why does the gradient come out as zero?
as you said the value on patch is fixed so tangential gradients should be zero but normal gradient can be non zero!
Not sure what your problem is: the gradient of T at a boundary will be a vector and only a surface-normal component of this gradient is specified in the T boundary conditions. The other two components will be non-zero, due to eg. tangential component of the gradient and picked up from the cell inside of the domain next to the patch. The code that does this is:
const GeometricField<Type, fvPatchField, volMesh>& vsf,
typename outerProduct<vector, Type>::type, fvPatchField, volMesh
vectorField n =
gGrad.boundaryField()[patchi] += n *
- (n & gGrad.boundaryField()[patchi])
All is fine,
|All times are GMT -4. The time now is 23:33.|