limitedLnGrad.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2017 Wikki Ltd
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "fa.H"
29#include "limitedLnGrad.H"
30#include "areaFields.H"
31#include "edgeFields.H"
32#include "correctedLnGrad.H"
33
34// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35
36namespace Foam
37{
38
39// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40
41namespace fa
42{
43
44// * * * * * * * * * * * * * *< * * Destructor * * * * * * * * * * * * * * * //
45
46template<class Type>
48{}
49
50
51// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
52
53template<class Type>
56(
58) const
59{
61 (
63 );
64
66 (
67 min
68 (
69 limitCoeff_
70 *mag(lnGradScheme<Type>::lnGrad(vf, deltaCoeffs(vf), "orthSnGrad"))
71 /(
72 (1 - limitCoeff_)*mag(corr)
73 + dimensionedScalar("small", corr.dimensions(), SMALL)
74 ),
75 dimensionedScalar("one", dimless, 1.0)
76 )
77 );
78
79 if (fa::debug)
80 {
81 Info<< "limitedLnGrad :: limiter min: " << min(limiter.internalField())
82 << " max: "<< max(limiter.internalField())
83 << " avg: " << average(limiter.internalField()) << endl;
84 }
85
86 return limiter*corr;
87}
88
89
90// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91
92} // End namespace fv
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96} // End namespace Foam
97
98// ************************************************************************* //
const dimensionSet & dimensions() const
Return dimensions.
Generic GeometricField class.
Simple central-difference lnGrad scheme with non-orthogonal correction.
virtual tmp< GeometricField< Type, faePatchField, edgeMesh > > correction(const GeometricField< Type, faPatchField, areaMesh > &) const
Return the explicit correction to the limitedLnGrad.
Definition: limitedLnGrad.C:56
Abstract base class for lnGrad schemes.
Definition: lnGradScheme.H:65
A class for managing temporary objects.
Definition: tmp.H:65
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
const dimensionSet dimless
Dimensionless.
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
tmp< areaScalarField > limiter(const areaScalarField &phi)
Definition: faNVDscheme.C:38