52 const scalar& maxDelta,
53 const scalar& minDelta,
54 const scalar& extrapolate
57 if (extrapolate > maxDelta + VSMALL)
61 else if (extrapolate < minDelta - VSMALL)
74 const Type& extrapolate
82 maxDelta.component(cmpt),
83 minDelta.component(cmpt),
84 extrapolate.component(cmpt)
99 const faMesh&
mesh = vsf.mesh();
101 tmp<areaVectorField> tGrad = basicGradScheme_().calcGrad(vsf,
name);
121 const label own = owner[facei];
122 const label nei = neighbour[facei];
124 const scalar vsfOwn = vsf[own];
125 const scalar vsfNei = vsf[nei];
127 maxVsf[own] =
max(maxVsf[own], vsfNei);
128 minVsf[own] =
min(minVsf[own], vsfNei);
130 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
131 minVsf[nei] =
min(minVsf[nei], vsfOwn);
136 auto updateLimiter = [&](
const label patchi,
const scalarField&
fld) ->
void 142 const label own = pOwner[facei];
143 const scalar vsf =
fld[facei];
145 maxVsf[own] =
max(maxVsf[own], vsf);
146 minVsf[own] =
min(minVsf[own], vsf);
157 updateLimiter(patchi, psf.patchNeighbourField());
161 updateLimiter(patchi, psf);
170 const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
181 const label own = owner[facei];
182 const label nei = neighbour[facei];
190 (Cf[facei] -
C[own]) &
g[own]
199 (Cf[facei] -
C[nei]) &
g[nei]
206 const vectorField& pCf = Cf.boundaryField()[patchi];
210 const label own = pOwner[pFacei];
217 (pCf[pFacei] -
C[own]) &
g[own]
224 Info<<
"gradient limiter for: " << vsf.name()
231 g.correctBoundaryConditions();
245 const faMesh&
mesh = vsf.mesh();
247 tmp<areaTensorField> tGrad = basicGradScheme_().grad(vsf,
name);
267 const label own = owner[facei];
268 const label nei = neighbour[facei];
270 const vector& vsfOwn = vsf[own];
271 const vector& vsfNei = vsf[nei];
273 maxVsf[own] =
max(maxVsf[own], vsfNei);
274 minVsf[own] =
min(minVsf[own], vsfNei);
276 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
277 minVsf[nei] =
min(minVsf[nei], vsfOwn);
282 auto updateLimiter = [&](
const label patchi,
const vectorField&
fld) ->
void 288 const label own = pOwner[facei];
291 maxVsf[own] =
max(maxVsf[own], vsf);
292 minVsf[own] =
min(minVsf[own], vsf);
303 updateLimiter(patchi, psf.patchNeighbourField());
307 updateLimiter(patchi, psf);
316 const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
330 const label own = owner[facei];
331 const label nei = neighbour[facei];
339 (Cf[facei] -
C[own]) &
g[own]
348 (Cf[facei] -
C[nei]) &
g[nei]
355 const vectorField& pCf = Cf.boundaryField()[patchi];
359 const label own = pOwner[pFacei];
366 ((pCf[pFacei] -
C[own]) &
g[own])
373 Info<<
"gradient limiter for: " << vsf.name()
391 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.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
GeometricBoundaryField< scalar, faPatchField, areaMesh > Boundary
Type of boundary fields.
tmp< areaScalarField > limiter(const areaScalarField &phi)
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 expressions::valueTypeCode::INVALID.
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)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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