56 const scalar& maxDelta,
57 const scalar& minDelta,
58 const scalar& extrapolate
61 if (extrapolate > maxDelta + VSMALL)
65 else if (extrapolate < minDelta - VSMALL)
78 const Type& extrapolate
81 for (
direction cmpt = 0; cmpt < Type::nComponents; ++cmpt)
86 maxDelta.component(cmpt),
87 minDelta.component(cmpt),
88 extrapolate.component(cmpt)
97tmp<areaVectorField> faceLimitedGrad<scalar>::grad
102 const faMesh&
mesh = vsf.mesh();
104 tmp<areaVectorField> tGrad = basicGradScheme_().grad(vsf);
124 label own = owner[facei];
125 label nei = neighbour[facei];
127 scalar vsfOwn = vsf[own];
128 scalar vsfNei = vsf[nei];
130 maxVsf[own] =
max(maxVsf[own], vsfNei);
131 minVsf[own] =
min(minVsf[own], vsfNei);
133 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
134 minVsf[nei] =
min(minVsf[nei], vsfOwn);
152 label own = pOwner[pFacei];
153 scalar vsfNei = psfNei[pFacei];
155 maxVsf[own] =
max(maxVsf[own], vsfNei);
156 minVsf[own] =
min(minVsf[own], vsfNei);
163 label own = pOwner[pFacei];
164 scalar vsfNei = psf[pFacei];
166 maxVsf[own] =
max(maxVsf[own], vsfNei);
167 minVsf[own] =
min(minVsf[own], vsfNei);
177 scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
188 label own = owner[facei];
189 label nei = neighbour[facei];
197 (Cf[facei] -
C[own]) &
g[own]
206 (Cf[facei] -
C[nei]) &
g[nei]
213 const vectorField& pCf = Cf.boundaryField()[patchi];
217 label own = pOwner[pFacei];
224 (pCf[pFacei] -
C[own]) &
g[own]
231 Info<<
"gradient limiter for: " << vsf.name()
238 g.correctBoundaryConditions();
246tmp<areaTensorField> faceLimitedGrad<vector>::grad
251 const faMesh&
mesh = vsf.mesh();
253 tmp<areaTensorField> tGrad = basicGradScheme_().grad(vsf);
273 label own = owner[facei];
274 label nei = neighbour[facei];
276 const vector& vsfOwn = vsf[own];
277 const vector& vsfNei = vsf[nei];
279 maxVsf[own] =
max(maxVsf[own], vsfNei);
280 minVsf[own] =
min(minVsf[own], vsfNei);
282 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
283 minVsf[nei] =
min(minVsf[nei], vsfOwn);
300 label own = pOwner[pFacei];
301 const vector& vsfNei = psfNei[pFacei];
303 maxVsf[own] =
max(maxVsf[own], vsfNei);
304 minVsf[own] =
min(minVsf[own], vsfNei);
311 label own = pOwner[pFacei];
312 const vector& vsfNei = psf[pFacei];
314 maxVsf[own] =
max(maxVsf[own], vsfNei);
315 minVsf[own] =
min(minVsf[own], vsfNei);
325 vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
339 label own = owner[facei];
340 label nei = neighbour[facei];
348 (Cf[facei] -
C[own]) &
g[own]
357 (Cf[facei] -
C[nei]) &
g[nei]
364 const vectorField& pCf = Cf.boundaryField()[patchi];
368 label own = pOwner[pFacei];
375 ((pCf[pFacei] -
C[own]) &
g[own])
382 Info<<
"gradient limiter for: " << vsf.name()
400 g.correctBoundaryConditions();
const uniformDimensionedVectorField & g
GeometricBoundaryField< scalar, faPatchField, areaMesh > Boundary
Type of boundary fields.
void correctBoundaryConditions()
Correct boundary field.
static void limitEdge(Type &limiter, const Type &maxDelta, const Type &minDelta, const Type &extrapolate)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
#define makeFaGradScheme(SS)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, faePatchField, edgeMesh > edgeVectorField
messageStream Info
Information stream (stdout output on master, null elsewhere)
GeometricField< tensor, faPatchField, areaMesh > areaTensorField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
faPatchField< vector > faPatchVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< vector, faPatchField, areaMesh > areaVectorField
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Type gAverage(const FieldField< Field, Type > &f)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Type gMin(const FieldField< Field, Type > &f)
UList< label > labelUList
A UList of labels.
Type gMax(const FieldField< Field, Type > &f)
faPatchField< scalar > faPatchScalarField
tmp< areaScalarField > limiter(const areaScalarField &phi)
#define forAll(list, i)
Loop across all elements in list.