interfaceCompression.H
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) 2011 OpenFOAM Foundation
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
26Class
27 Foam::interfaceCompressionLimiter
28
29Description
30 Interface compression scheme currently based on the generic limited
31 scheme although it does not use the NVD/TVD functions.
32
33SourceFiles
34 interfaceCompression.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef interfaceCompression_H
39#define interfaceCompression_H
40
41#include "vector.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class interfaceCompressionWeight Declaration
50\*---------------------------------------------------------------------------*/
53{
54
55public:
58 {}
60 scalar limiter
61 (
62 const scalar cdWeight,
63 const scalar faceFlux,
64 const scalar phiP,
65 const scalar phiN,
66 const vector&,
67 const scalar
68 ) const
69 {
70 // Quadratic compression scheme
71 //return min(max(4*min(phiP*(1 - phiP), phiN*(1 - phiN)), 0), 1);
72
73 // Quartic compression scheme
74 return
75 min(max(
76 1 - max(sqr(1 - 4*phiP*(1 - phiP)), sqr(1 - 4*phiN*(1 - phiN))),
77 0), 1);
78 }
79};
80
81
82// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83
84} // End namespace Foam
85
86// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88#endif
89
90// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Interface compression scheme currently based on the generic limited scheme although it does not use t...
scalar limiter(const scalar cdWeight, const scalar faceFlux, const scalar phiP, const scalar phiN, const vector &, const scalar) const
Namespace for OpenFOAM.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
dimensionedSymmTensor sqr(const dimensionedVector &dv)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33