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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "SIBS.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 void Foam::SIBS::polyExtrapolate
31 (
32  const label iest,
33  const scalar xest,
34  const scalarField& yest,
35  scalarField& yz,
36  scalarField& dy,
37  scalarField& x,
39 ) const
40 {
41  label n = yz.size();
42 
43  x[iest] = xest;
44 
45  for (label j=0; j<n; j++)
46  {
47  dy[j] = yz[j] = yest[j];
48  }
49 
50  if (iest == 0)
51  {
52  for (label j=0; j<n; j++)
53  {
54  d(j, 0) = yest[j];
55  }
56  }
57  else
58  {
59  scalarField c(yest);
60 
61  for (label k1=0; k1<iest; k1++)
62  {
63  scalar delta = 1.0/(x[iest - k1 - 1] - xest);
64  scalar f1 = xest*delta;
65  scalar f2 = x[iest - k1 - 1]*delta;
66 
67  for (label j=0; j<n; j++)
68  {
69  scalar q = d[j][k1];
70  d[j][k1] = dy[j];
71  delta = c[j] - q;
72  dy[j] = f1*delta;
73  c[j] = f2*delta;
74  yz[j] += dy[j];
75  }
76  }
77 
78  for (label j=0; j<n; j++)
79  {
80  d[j][iest] = dy[j];
81  }
82  }
83 }
84 
85 
86 // ************************************************************************* //
scalar delta
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
scalar f1
Definition: createFields.H:28
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
volScalarField scalarField(fieldObject, mesh)
const dimensionedScalar c
Speed of light in a vacuum.
label n
RectangularMatrix< scalar > scalarRectangularMatrix