Go to the documentation of this file.
48 const fvMesh&
mesh = vsf.mesh();
50 tmp<volVectorField> tGrad = basicGradScheme_().calcGrad(vsf,
name);
68 scalar rk = (1.0/k_ - 1.0);
72 label own = owner[facei];
73 label nei = neighbour[facei];
75 scalar vsfOwn = vsf[own];
76 scalar vsfNei = vsf[nei];
78 scalar maxFace =
max(vsfOwn, vsfNei);
79 scalar minFace =
min(vsfOwn, vsfNei);
80 scalar maxMinFace = rk*(maxFace - minFace);
81 maxFace += maxMinFace;
82 minFace -= maxMinFace;
88 maxFace - vsfOwn, minFace - vsfOwn,
89 (Cf[facei] -
C[own]) &
g[own]
96 maxFace - vsfNei, minFace - vsfNei,
97 (Cf[facei] -
C[nei]) &
g[nei]
101 const volScalarField::GeometricBoundaryField& bsf = vsf.boundaryField();
112 const scalarField psfNei(psf.patchNeighbourField());
116 label own = pOwner[pFacei];
118 scalar vsfOwn = vsf[own];
119 scalar vsfNei = psfNei[pFacei];
121 scalar maxFace =
max(vsfOwn, vsfNei);
122 scalar minFace =
min(vsfOwn, vsfNei);
123 scalar maxMinFace = rk*(maxFace - minFace);
124 maxFace += maxMinFace;
125 minFace -= maxMinFace;
130 maxFace - vsfOwn, minFace - vsfOwn,
131 (pCf[pFacei] -
C[own]) &
g[own]
135 else if (psf.fixesValue())
139 label own = pOwner[pFacei];
141 scalar vsfOwn = vsf[own];
142 scalar vsfNei = psf[pFacei];
144 scalar maxFace =
max(vsfOwn, vsfNei);
145 scalar minFace =
min(vsfOwn, vsfNei);
146 scalar maxMinFace = rk*(maxFace - minFace);
147 maxFace += maxMinFace;
148 minFace -= maxMinFace;
153 maxFace - vsfOwn, minFace - vsfOwn,
154 (pCf[pFacei] -
C[own]) &
g[own]
162 Info<<
"gradient limiter for: " << vsf.name()
169 g.correctBoundaryConditions();
204 scalar rk = (1.0/k_ - 1.0);
208 label own = owner[facei];
209 label nei = neighbour[facei];
215 vector gradf = (Cf[facei] -
C[own]) &
g[own];
217 scalar vsfOwn = gradf & vvfOwn;
218 scalar vsfNei = gradf & vvfNei;
220 scalar maxFace =
max(vsfOwn, vsfNei);
221 scalar minFace =
min(vsfOwn, vsfNei);
222 scalar maxMinFace = rk*(maxFace - minFace);
223 maxFace += maxMinFace;
224 minFace -= maxMinFace;
229 maxFace - vsfOwn, minFace - vsfOwn,
235 gradf = (Cf[facei] -
C[nei]) &
g[nei];
237 vsfOwn = gradf & vvfOwn;
238 vsfNei = gradf & vvfNei;
240 maxFace =
max(vsfOwn, vsfNei);
241 minFace =
min(vsfOwn, vsfNei);
246 maxFace - vsfNei, minFace - vsfNei,
267 label own = pOwner[pFacei];
270 vector vvfNei = psfNei[pFacei];
272 vector gradf = (pCf[pFacei] -
C[own]) &
g[own];
274 scalar vsfOwn = gradf & vvfOwn;
275 scalar vsfNei = gradf & vvfNei;
277 scalar maxFace =
max(vsfOwn, vsfNei);
278 scalar minFace =
min(vsfOwn, vsfNei);
279 scalar maxMinFace = rk*(maxFace - minFace);
280 maxFace += maxMinFace;
281 minFace -= maxMinFace;
286 maxFace - vsfOwn, minFace - vsfOwn,
295 label own = pOwner[pFacei];
298 vector vvfNei = psf[pFacei];
300 vector gradf = (pCf[pFacei] -
C[own]) &
g[own];
302 scalar vsfOwn = gradf & vvfOwn;
303 scalar vsfNei = gradf & vvfNei;
305 scalar maxFace =
max(vsfOwn, vsfNei);
306 scalar minFace =
min(vsfOwn, vsfNei);
307 scalar maxMinFace = rk*(maxFace - minFace);
308 maxFace += maxMinFace;
309 minFace -= maxMinFace;
314 maxFace - vsfOwn, minFace - vsfOwn,
323 Info<<
"gradient limiter for: " << vvf.name()
330 g.correctBoundaryConditions();
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
Type gAverage(const FieldField< Field, Type > &f)
makeFvGradScheme(faceLimitedGrad)
void limiter(scalarField &allLambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phiBD, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const scalar psiMax, const scalar psiMin)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
const dimensionedVector & g
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool fixesValue() const
Return true if this patch field fixes a value.
virtual bool coupled() const
Return true if this patch field is coupled.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
InternalField & internalField()
Return internal field.
volVectorField vectorField(fieldObject, mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Mesh data needed to do the Finite Volume discretisation.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
U correctBoundaryConditions()
volScalarField scalarField(fieldObject, mesh)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Type gMin(const FieldField< Field, Type > &f)
UList< label > labelUList
Graphite solid properties.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Generic GeometricField class.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Type gMax(const FieldField< Field, Type > &f)
word name(const complex &)
Return a string representation of a complex.
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > calcGrad(const GeometricField< Type, fvPatchField, volMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad.