OpenFOAM: API Guide
v2112
The open source CFD toolbox
polyExtrapolate.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) 2011-2016 OpenFOAM Foundation
9
-------------------------------------------------------------------------------
10
License
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 "
SIBS.H
"
29
30
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32
void
Foam::SIBS::polyExtrapolate
33
(
34
const
label iest,
35
const
scalar xest,
36
const
scalarField
& yest,
37
scalarField
& yz,
38
scalarField
& dy,
39
scalarField
&
x
,
40
scalarRectangularMatrix
& d
41
)
const
42
{
43
label
n
= yz.size();
44
45
x
[iest] = xest;
46
47
for
(label j=0; j<
n
; j++)
48
{
49
dy[j] = yz[j] = yest[j];
50
}
51
52
if
(iest == 0)
53
{
54
for
(label j=0; j<
n
; j++)
55
{
56
d(j, 0) = yest[j];
57
}
58
}
59
else
60
{
61
scalarField
c
(yest);
62
63
for
(label k1=0; k1<iest; k1++)
64
{
65
scalar
delta
= 1.0/(
x
[iest - k1 - 1] - xest);
66
scalar f1 = xest*
delta
;
67
scalar f2 =
x
[iest - k1 - 1]*
delta
;
68
69
for
(label j=0; j<
n
; j++)
70
{
71
scalar q = d[j][k1];
72
d[j][k1] = dy[j];
73
delta
=
c
[j] - q;
74
dy[j] = f1*
delta
;
75
c
[j] = f2*
delta
;
76
yz[j] += dy[j];
77
}
78
}
79
80
for
(label j=0; j<
n
; j++)
81
{
82
d[j][iest] = dy[j];
83
}
84
}
85
}
86
87
88
// ************************************************************************* //
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition:
primitiveFieldsFwd.H:52
n
label n
Definition:
TABSMDCalcMethod2.H:31
delta
scalar delta
Definition:
LISASMDCalcMethod2.H:8
x
x
Definition:
LISASMDCalcMethod2.H:52
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
SIBS.H
Foam::scalarRectangularMatrix
RectangularMatrix< scalar > scalarRectangularMatrix
Definition:
scalarMatrices.H:56
src
ODE
ODESolvers
SIBS
polyExtrapolate.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.