|
[Sponsors] |
November 12, 2017, 10:43 |
averagingMethod::average()
|
#1 |
New Member
Saeed
Join Date: Sep 2016
Posts: 16
Rep Power: 10 |
Hello friends, I looked into the code for basic averaging method. The code for function average() uses updateGrad() and reading updateGrad() says it calculates the gradient of the given field (not the average). can anybody enlighten me?
https://cpp.openfoam.org/v5/Averagin...ce.html#l00033 Code:
template<class Type> 119 void Foam::AveragingMethod<Type>::average() 120 { 121 updateGrad(); 122 } Code:
template<class Type> 67 void Foam::AveragingMethods::Basic<Type>::updateGrad() 68 { 69 GeometricField<Type, fvPatchField, volMesh> tempData 70 ( 71 IOobject 72 ( 73 "BasicAverage::Data", 74 this->mesh_, 75 IOobject::NO_READ, 76 IOobject::NO_WRITE, 77 false 78 ), 79 this->mesh_, 80 dimensioned<Type>("zero", dimless, Zero), 81 zeroGradientFvPatchField<Type>::typeName 82 ); 83 tempData.primitiveFieldRef() = data_; 84 tempData.correctBoundaryConditions(); 85 dataGrad_ = fvc::grad(tempData)->primitiveField(); 86 } |
|
Tags |
averagingmethod, basic |
|
|