31 template<
class Type,
class Limiter>
42 template<
class Type,
class Limiter>
61 template<
class Type,
class Limiter>
68 const VolField<Type>& vsf,
75 tGrad = basicGradScheme_().calcGrad(vsf,
name);
90 Field<Type> maxVsf(vsf.primitiveField());
91 Field<Type> minVsf(vsf.primitiveField());
95 label own = owner[facei];
96 label nei = neighbour[facei];
98 const Type& vsfOwn = vsf[own];
99 const Type& vsfNei = vsf[nei];
101 maxVsf[own] =
max(maxVsf[own], vsfNei);
102 minVsf[own] =
min(minVsf[own], vsfNei);
104 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
105 minVsf[nei] =
min(minVsf[nei], vsfOwn);
109 const typename VolField<Type>::Boundary& bsf =
114 const fvPatchField<Type>& psf = bsf[
patchi];
119 const Field<Type> psfNei(psf.patchNeighbourField());
123 label own = pOwner[pFacei];
124 const Type& vsfNei = psfNei[pFacei];
126 maxVsf[own] =
max(maxVsf[own], vsfNei);
127 minVsf[own] =
min(minVsf[own], vsfNei);
134 label own = pOwner[pFacei];
135 const Type& vsfNei = psf[pFacei];
137 maxVsf[own] =
max(maxVsf[own], vsfNei);
138 minVsf[own] =
min(minVsf[own], vsfNei);
148 const Field<Type> maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
156 Field<Type>
limiter(vsf.primitiveField().size(), pTraits<Type>::one);
160 label own = owner[facei];
161 label nei = neighbour[facei];
169 (Cf[facei] -
C[own]) & g[own]
178 (Cf[facei] -
C[nei]) & g[nei]
189 label own = pOwner[pFacei];
196 ((pCf[pFacei] -
C[own]) & g[own])
203 Info<<
"gradient limiter for: " << vsf.name()
210 g.correctBoundaryConditions();
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
const volVectorField & C() const
Return cell centres.
const labelUList & owner() const
Internal face owner.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const surfaceVectorField & Cf() const
Return face centres.
const labelUList & neighbour() const
Internal face neighbour.
const polyMesh & mesh() const
Return reference to polyMesh.
cellLimitedGrad gradient scheme applied to a runTime selected base gradient scheme.
virtual tmp< VolField< typename outerProduct< vector, Type >::type > > calcGrad(const VolField< Type > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad.
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
volVectorField vectorField(fieldObject, mesh)
U correctBoundaryConditions()
void limiter(const control &controls, surfaceScalarField &lambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const scalarField &SuCorr, const surfaceScalarField &phi, const surfaceScalarField &phiCorr, const SpType &Sp, const PsiMaxType &psiMax, const PsiMinType &psiMin)
static const coefficient C("C", dimTemperature, 234.5)
void cmptMultiply(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1, const LagrangianPatchField< Type > &f2)
VolField< vector > volVectorField
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Type gAverage(const FieldField< Field, Type > &f)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Type gMin(const FieldField< Field, Type > &f)
SurfaceField< vector > surfaceVectorField
UList< label > labelUList
Type gMax(const FieldField< Field, Type > &f)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.