NVDTVD.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-2012 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::NVDTVD
28
29Description
30 Foam::NVDTVD
31
32\*---------------------------------------------------------------------------*/
33
34#ifndef NVDTVD_H
35#define NVDTVD_H
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38
39namespace Foam
40{
41
42/*---------------------------------------------------------------------------*\
43 Class LimitedScheme Declaration
44\*---------------------------------------------------------------------------*/
46class NVDTVD
47{
48
49public:
51 typedef scalar phiType;
52 typedef vector gradPhiType;
53
54
55 // Null Constructor
57 NVDTVD()
58 {}
59
60
61 // Member Functions
63 scalar phict
64 (
65 const scalar faceFlux,
66 const scalar phiP,
67 const scalar phiN,
68 const vector& gradcP,
69 const vector& gradcN,
70 const vector& d
71 ) const
72 {
73 scalar gradf = phiN - phiP;
74
75 scalar gradcf;
76
77 if (faceFlux > 0)
78 {
79 gradcf = d & gradcP;
80 }
81 else
82 {
83 gradcf = d & gradcN;
84 }
85
86 if (mag(gradf) >= 1000*mag(gradcf))
87 {
88 return 1 - 0.5*1000*sign(gradcf)*sign(gradf);
89 }
90 else
91 {
92 return 1 - 0.5*gradf/gradcf;
93 }
94 }
95
97 scalar r
98 (
99 const scalar faceFlux,
100 const scalar phiP,
101 const scalar phiN,
102 const vector& gradcP,
103 const vector& gradcN,
104 const vector& d
105 ) const
106 {
107 scalar gradf = phiN - phiP;
108
109 scalar gradcf;
110
111 if (faceFlux > 0)
112 {
113 gradcf = d & gradcP;
114 }
115 else
116 {
117 gradcf = d & gradcN;
118 }
119
120 if (mag(gradcf) >= 1000*mag(gradf))
121 {
122 return 2*1000*sign(gradcf)*sign(gradf) - 1;
123 }
124 else
125 {
126 return 2*(gradcf/gradf) - 1;
127 }
128 }
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace Foam
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138#endif
139
140// ************************************************************************* //
Foam::NVDTVD.
Definition: NVDTVD.H:46
vector gradPhiType
Definition: NVDTVD.H:51
scalar phict(const scalar faceFlux, const scalar phiP, const scalar phiN, const vector &gradcP, const vector &gradcN, const vector &d) const
Definition: NVDTVD.H:63
scalar phiType
Definition: NVDTVD.H:50
scalar r(const scalar faceFlux, const scalar phiP, const scalar phiN, const vector &gradcP, const vector &gradcN, const vector &d) const
Definition: NVDTVD.H:97
Namespace for OpenFOAM.
dimensionedScalar sign(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)