48 const fvMesh&
mesh = vsf.mesh();
50 tmp<volVectorField> tGrad = basicGradScheme_().calcGrad(vsf, name);
60 const labelUList& neighbour = mesh.neighbour();
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::Boundary& 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()
163 <<
" max = " <<
gMax(limiter)
164 <<
" min = " <<
gMin(limiter)
168 g.primitiveFieldRef() *=
limiter;
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()
324 <<
" max = " <<
gMax(limiter)
325 <<
" min = " <<
gMin(limiter)
Graphite solid properties.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
rDeltaT correctBoundaryConditions()
virtual bool fixesValue() const
Return true if this patch field fixes a value.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const surfaceVectorField & Cf() const
Return face centres as surfaceVectorField.
Type gMin(const FieldField< Field, Type > &f)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
makeFvGradScheme(faceLimitedGrad)
T & ref() const
Return non-const reference or generate a fatal error.
void size(const label)
Override size to be inconsistent with allocated storage.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
volVectorField vectorField(fieldObject, mesh)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
GeometricField< vector, fvPatchField, volMesh > volVectorField
UList< label > labelUList
const labelUList & neighbour() const
Internal face neighbour.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fvPatchField< scalar > fvPatchScalarField
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 PsiMaxType &psiMax, const PsiMinType &psiMin)
A class for handling words, derived from string.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
virtual bool coupled() const
Return true if this patch field is coupled.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
dimensioned< scalar > magSqr(const dimensioned< Type > &)
volScalarField scalarField(fieldObject, mesh)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Mesh & mesh() const
Return mesh.
Type gMax(const FieldField< Field, Type > &f)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const labelUList & owner() const
Internal face owner.
Type gAverage(const FieldField< Field, Type > &f)
Mesh data needed to do the Finite Volume discretisation.
void correctBoundaryConditions()
Correct boundary field.
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.
const volVectorField & C() const
Return cell centres as volVectorField.
A class for managing temporary objects.
const dimensionedVector & g
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.