47 const volScalarField& vsf,
51 const fvMesh&
mesh = vsf.mesh();
53 tmp<volVectorField> tGrad = basicGradScheme_().calcGrad(vsf,
name);
60 volVectorField&
g = tGrad.ref();
62 const labelUList& owner =
mesh.owner();
63 const labelUList& neighbour =
mesh.neighbour();
65 const volVectorField&
C =
mesh.C();
66 const surfaceVectorField& Cf =
mesh.Cf();
68 scalarField maxVsf(vsf.primitiveField());
69 scalarField minVsf(vsf.primitiveField());
73 const label own = owner[facei];
74 const label nei = neighbour[facei];
76 const scalar vsfOwn = vsf[own];
77 const scalar vsfNei = vsf[nei];
79 maxVsf[own] = max(maxVsf[own], vsfNei);
80 minVsf[own] = min(minVsf[own], vsfNei);
82 maxVsf[nei] = max(maxVsf[nei], vsfOwn);
83 minVsf[nei] = min(minVsf[nei], vsfOwn);
87 const volScalarField::Boundary& bsf = vsf.boundaryField();
91 const fvPatchScalarField& psf = bsf[patchi];
93 const labelUList& pOwner =
mesh.boundary()[patchi].faceCells();
97 const scalarField psfNei(psf.patchNeighbourField());
101 const label own = pOwner[pFacei];
102 const scalar vsfNei = psfNei[pFacei];
104 maxVsf[own] = max(maxVsf[own], vsfNei);
105 minVsf[own] = min(minVsf[own], vsfNei);
112 const label own = pOwner[pFacei];
113 const scalar vsfNei = psf[pFacei];
115 maxVsf[own] = max(maxVsf[own], vsfNei);
116 minVsf[own] = min(minVsf[own], vsfNei);
126 const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
137 const label own = owner[facei];
138 const label nei = neighbour[facei];
162 const labelUList& pOwner =
mesh.boundary()[patchi].faceCells();
163 const vectorField& pCf = Cf.boundaryField()[patchi];
167 const label own = pOwner[pFacei];
179 g.correctBoundaryConditions();
180 gaussGrad<scalar>::correctBoundaryConditions(vsf,
g);
216 const label own = owner[facei];
217 const label nei = neighbour[facei];
219 const vector& vsfOwn = vsf[own];
220 const vector& vsfNei = vsf[nei];
222 maxVsf[own] =
max(maxVsf[own], vsfNei);
223 minVsf[own] =
min(minVsf[own], vsfNei);
225 maxVsf[nei] =
max(maxVsf[nei], vsfOwn);
226 minVsf[nei] =
min(minVsf[nei], vsfOwn);
234 const fvPatchVectorField& psf = bsf[patchi];
235 const labelUList& pOwner =
mesh.boundary()[patchi].faceCells();
239 const vectorField psfNei(psf.patchNeighbourField());
243 const label own = pOwner[pFacei];
244 const vector& vsfNei = psfNei[pFacei];
246 maxVsf[own] = max(maxVsf[own], vsfNei);
247 minVsf[own] = min(minVsf[own], vsfNei);
254 const label own = pOwner[pFacei];
255 const vector& vsfNei = psf[pFacei];
257 maxVsf[own] =
max(maxVsf[own], vsfNei);
258 minVsf[own] =
min(minVsf[own], vsfNei);
268 const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
279 const label own = owner[facei];
280 const label nei = neighbour[facei];
309 const label own = pOwner[pFacei];
321 g.correctBoundaryConditions();
322 gaussGrad<vector>::correctBoundaryConditions(vsf,
g);
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
const uniformDimensionedVectorField & g
Graphite solid properties.
const Mesh & mesh() const noexcept
Return const reference to mesh.
GeometricBoundaryField< vector, fvPatchField, volMesh > Boundary
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Mesh data needed to do the Finite Volume discretisation.
virtual bool coupled() const
True if the patch field is coupled.
virtual tmp< Field< Type > > patchNeighbourField() const
Return patchField on the opposite patch of a coupled patch.
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 for optional caching.
static void limitFace(typename outerProduct< vector, Type >::type &g, const Type &maxDelta, const Type &minDelta, const vector &dcf)
static void correctBoundaryConditions(const GeometricField< Type, fvPatchField, volMesh > &, GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > &)
Correct the boundary values of the gradient using the patchField snGrad functions.
const fvMesh & mesh() const
Return const reference to mesh.
A class for managing temporary objects.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
#define makeFvGradScheme(SS)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< tensor, fvPatchField, volMesh > volTensorField
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Field< vector > vectorField
Specialisation of Field<T> for vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
UList< label > labelUList
A UList of labels.
fvPatchField< vector > fvPatchVectorField
#define forAll(list, i)
Loop across all elements in list.