57 const scalar& maxDelta,
58 const scalar& minDelta,
59 const scalar& extrapolate
62 if (extrapolate > maxDelta + VSMALL)
66 else if (extrapolate < minDelta - VSMALL)
79 const Type& extrapolate
82 for (
direction cmpt = 0; cmpt < Type::nComponents; ++cmpt)
87 maxDelta.component(cmpt),
88 minDelta.component(cmpt),
89 extrapolate.component(cmpt)
104 const faMesh&
mesh = vsf.mesh();
106 tmp<areaVectorField> tGrad = basicGradScheme_().calcGrad(vsf,
name);
126 label own = owner[facei];
127 label nei = neighbour[facei];
129 scalar vsfOwn = vsf[own];
130 scalar vsfNei = vsf[nei];
132 maxVsf[own] =
max(maxVsf[own], vsfNei);
133 minVsf[own] =
min(minVsf[own], vsfNei);
135 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
136 minVsf[nei] =
min(minVsf[nei], vsfOwn);
154 label own = pOwner[pFacei];
155 scalar vsfNei = psfNei[pFacei];
157 maxVsf[own] =
max(maxVsf[own], vsfNei);
158 minVsf[own] =
min(minVsf[own], vsfNei);
165 label own = pOwner[pFacei];
166 scalar vsfNei = psf[pFacei];
168 maxVsf[own] =
max(maxVsf[own], vsfNei);
169 minVsf[own] =
min(minVsf[own], vsfNei);
179 scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
190 label own = owner[facei];
191 label nei = neighbour[facei];
199 (Cf[facei] -
C[own]) &
g[own]
208 (Cf[facei] -
C[nei]) &
g[nei]
215 const vectorField& pCf = Cf.boundaryField()[patchi];
219 label own = pOwner[pFacei];
226 (pCf[pFacei] -
C[own]) &
g[own]
233 Info<<
"gradient limiter for: " << vsf.name()
240 g.correctBoundaryConditions();
254 const faMesh&
mesh = vsf.mesh();
256 tmp<areaTensorField> tGrad = basicGradScheme_().grad(vsf,
name);
276 label own = owner[facei];
277 label nei = neighbour[facei];
279 const vector& vsfOwn = vsf[own];
280 const vector& vsfNei = vsf[nei];
282 maxVsf[own] =
max(maxVsf[own], vsfNei);
283 minVsf[own] =
min(minVsf[own], vsfNei);
285 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
286 minVsf[nei] =
min(minVsf[nei], vsfOwn);
303 label own = pOwner[pFacei];
304 const vector& vsfNei = psfNei[pFacei];
306 maxVsf[own] =
max(maxVsf[own], vsfNei);
307 minVsf[own] =
min(minVsf[own], vsfNei);
314 label own = pOwner[pFacei];
315 const vector& vsfNei = psf[pFacei];
317 maxVsf[own] =
max(maxVsf[own], vsfNei);
318 minVsf[own] =
min(minVsf[own], vsfNei);
328 vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
342 label own = owner[facei];
343 label nei = neighbour[facei];
351 (Cf[facei] -
C[own]) &
g[own]
360 (Cf[facei] -
C[nei]) &
g[nei]
367 const vectorField& pCf = Cf.boundaryField()[patchi];
371 label own = pOwner[pFacei];
378 ((pCf[pFacei] -
C[own]) &
g[own])
385 Info<<
"gradient limiter for: " << vsf.name()
403 g.correctBoundaryConditions();
faPatchField< scalar > faPatchScalarField
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > > calcGrad(const GeometricField< Type, faPatchField, areaMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad for optional caching.
Type gMin(const FieldField< Field, Type > &f)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricBoundaryField< scalar, faPatchField, areaMesh > Boundary
Type of boundary fields.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
tmp< areaScalarField > limiter(const areaScalarField &phi)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
GeometricField< tensor, faPatchField, areaMesh > areaTensorField
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
const uniformDimensionedVectorField & g
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Type gAverage(const FieldField< Field, Type > &f)
makeFaGradScheme(faceLimitedGrad)
static void correctBoundaryConditions(const GeometricField< Type, faPatchField, areaMesh > &, GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh > &)
Correct the boundary values of the gradient using the patchField.
faPatchField< vector > faPatchVectorField
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
static void limitEdge(Type &limiter, const Type &maxDelta, const Type &minDelta, const Type &extrapolate)
GeometricField< scalar, faPatchField, areaMesh > areaScalarField