|
[Sponsors] |
About fixedGradient BC and the definition of deltaCoeffs() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 29, 2020, 22:03 |
About fixedGradient BC and the definition of deltaCoeffs()
|
#1 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
I am looking at the implementation of fixedGradient BC in OpenFoam 7. In fixedGradientFvPatchField.C (line 144) we have that the value at the boundary is calculated as:
Code:
Field<Type>::operator= ( this->patchInternalField() + gradient_/this->patch().deltaCoeffs() ); This leads to the second part that I do not fully understand: From surfaceInterpolation.C (line 318), deltaCoeffs is calculated as Code:
nonOrthDeltaCoeffs[facei] = 1.0/max(unitArea & delta, 0.05*mag(delta)); unitArea & delta< 0 < 0.05*mag(delta)) and deltaCoeffs = 1.0/(0.05*mag(delta)). There must be something wrong with this reasoning, but I can't find where. Would you please help me |
|
July 30, 2020, 12:18 |
|
#2 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 376
Rep Power: 11 |
Dear Federico:
I believe surface normal is defined as positive pointing out of the domain, so deltaCoeffs will be positive. Hope that helps, Gerry. |
|
July 30, 2020, 15:11 |
|
#3 | |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
Quote:
Code:
vector delta = C[neighbour[facei]] - C[owner[facei]]; |
||
July 31, 2020, 03:41 |
|
#4 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 376
Rep Power: 11 |
Dear Federico:
Yes, the 'direction' of deltaCoeffs is from the cell center to the patch center. The direction oof the gradient follows the patch normal, i.e., out is positive. However, I must confess I have always thought (too simplistically) that deltaCoeffs is 'just the distance between the cell center and patch center', but this forum post gave a more accurate description: mesh.surfaceInterpolation::deltaCoeffs() Gerry. P.S. - After some digging, I think I know where you are coming from ... |
|
Tags |
deltacoeffs, fixedgradient |
|
|