Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
709fc12c
Commit
709fc12c
authored
May 17, 2011
by
andy
Browse files
ENH: Robustness updates to pointMVC interpolation
parent
1e77abbe
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/Make/files
View file @
709fc12c
...
...
@@ -204,8 +204,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C
$(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C
$(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
$(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
$(interpolation)/interpolationPoint/pointMVCWeight.C
$(interpolation)/interpolationPoint/makeInterpolationPoint.C
$(interpolation)/interpolationPoint
MVC
/pointMVCWeight.C
$(interpolation)/interpolationPoint
MVC
/makeInterpolationPoint
MVC
.C
volPointInterpolation = interpolation/volPointInterpolation
$(volPointInterpolation)/volPointInterpolation.C
...
...
src/finiteVolume/Make/options
View file @
709fc12c
EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/interpolationPoint
MVC
.C
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,13 +23,13 @@ License
\*---------------------------------------------------------------------------*/
#include
"interpolationPoint.H"
#include
"interpolationPoint
MVC
.H"
#include
"volPointInterpolation.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template
<
class
Type
>
Foam
::
interpolationPoint
<
Type
>::
interpolationPoint
Foam
::
interpolationPoint
MVC
<
Type
>::
interpolationPoint
MVC
(
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
psi
)
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.H
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/interpolationPoint
MVC
.H
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interpolationPoint
Foam::interpolationPoint
MVC
Description
Given cell centre values interpolates to vertices and uses these to
...
...
@@ -30,8 +30,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef interpolationPoint_H
#define interpolationPoint_H
#ifndef interpolationPoint
MVC
_H
#define interpolationPoint
MVC
_H
#include
"interpolation.H"
#include
"pointMVCWeight.H"
...
...
@@ -42,11 +42,11 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolationPoint Declaration
Class interpolationPoint
MVC
Declaration
\*---------------------------------------------------------------------------*/
template
<
class
Type
>
class
interpolationPoint
class
interpolationPoint
MVC
:
public
interpolation
<
Type
>
{
...
...
@@ -57,16 +57,17 @@ protected:
//- Interpolated volfield
const
GeometricField
<
Type
,
pointPatchField
,
pointMesh
>
psip_
;
public:
//- Runtime type information
TypeName
(
"point"
);
TypeName
(
"point
MVC
"
);
// Constructors
//- Construct from components
interpolationPoint
interpolationPoint
MVC
(
const
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
psi
);
...
...
@@ -93,12 +94,12 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include
"interpolationPointI.H"
#include
"interpolationPoint
MVC
I.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "interpolationPoint.C"
# include "interpolationPoint
MVC
.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPointI.H
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/interpolationPoint
MVC
I.H
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
inline
Type
Foam
::
interpolationPoint
<
Type
>::
interpolate
inline
Type
Foam
::
interpolationPoint
MVC
<
Type
>::
interpolate
(
const
pointMVCWeight
&
cpw
)
const
...
...
@@ -36,7 +36,7 @@ inline Type Foam::interpolationPoint<Type>::interpolate
template
<
class
Type
>
inline
Type
Foam
::
interpolationPoint
<
Type
>::
interpolate
inline
Type
Foam
::
interpolationPoint
MVC
<
Type
>::
interpolate
(
const
vector
&
position
,
const
label
cellI
,
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/makeInterpolationPoint.C
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/makeInterpolationPoint
MVC
.C
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -23,13 +23,13 @@ License
\*---------------------------------------------------------------------------*/
#include
"interpolationPoint.H"
#include
"interpolationPoint
MVC
.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makeInterpolation
(
interpolationPoint
);
makeInterpolation
(
interpolationPoint
MVC
);
}
// ************************************************************************* //
src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.C
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/pointMVCWeight.C
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -56,7 +56,7 @@ void Foam::pointMVCWeight::calcWeights
forAll
(
f
,
j
)
{
label
jPlus1
=
f
.
fcIndex
(
j
);
scalar
l
=
mag
(
u
[
j
]
-
u
[
jPlus1
]);
scalar
l
=
mag
(
u
[
j
]
-
u
[
jPlus1
]);
theta
[
j
]
=
2
.
0
*
Foam
::
asin
(
l
/
2
.
0
);
}
...
...
@@ -68,7 +68,7 @@ void Foam::pointMVCWeight::calcWeights
weights
[
pid
]
=
1
.
0
/
dist
[
pid
]
*
(
Foam
::
tan
(
theta
[
jMin1
]
/
2
.
0
)
+
Foam
::
tan
(
theta
[
j
]
/
2
.
0
));
*
(
Foam
::
tan
(
theta
[
jMin1
]
/
2
.
0
)
+
Foam
::
tan
(
theta
[
j
]
/
2
.
0
));
sumWeight
+=
weights
[
pid
];
}
...
...
@@ -132,11 +132,10 @@ void Foam::pointMVCWeight::calcWeights
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1]
// << " temp:" << temp << endl;
scalar
l
=
mag
(
u
[
j
]
-
u
[
jPlus1
]);
scalar
l
=
min
(
mag
(
u
[
j
]
-
u
[
jPlus1
])
,
2
.
0
)
;
scalar
angle
=
2
.
0
*
Foam
::
asin
(
l
/
2
.
0
);
//Pout<< " j:" << j << " l:" << l
// << " angle:" << angle << endl;
//Pout<< " j:" << j << " l:" << l << " angle:" << angle << endl;
v
+=
0
.
5
*
angle
*
temp
;
}
...
...
@@ -145,14 +144,14 @@ void Foam::pointMVCWeight::calcWeights
v
/=
vNorm
;
// Make sure v points towards the polygon
//if (((v&u[0]) < 0) != (mesh.faceOwner()[faceI] != cellIndex_))
//{
// FatalErrorIn("pointMVCWeight::calcWeights(..)")
// << "v:" << v << " u[0]:" << u[0]
// << exit(FatalError);
//}
if
((
v
&
u
[
0
])
<
0
)
//if (((v&u[0]) < 0) != (mesh.faceOwner()[faceI] != cellIndex_))
//{
// FatalErrorIn("pointMVCWeight::calcWeights(..)")
// << "v:" << v << " u[0]:" << u[0]
// << exit(FatalError);
//}
if
((
v
&
u
[
0
])
<
0
)
{
v
=
-
v
;
}
...
...
@@ -165,22 +164,22 @@ void Foam::pointMVCWeight::calcWeights
label
jPlus1
=
f
.
fcIndex
(
j
);
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
vector
n0
=
u
[
j
]
^
v
;
vector
n0
=
u
[
j
]
^
v
;
n0
/=
mag
(
n0
);
vector
n1
=
u
[
jPlus1
]
^
v
;
vector
n1
=
u
[
jPlus1
]
^
v
;
n1
/=
mag
(
n1
);
scalar
l
=
mag
(
n0
-
n1
);
scalar
l
=
min
(
mag
(
n0
-
n1
),
2
.
0
);
//Pout<< " l:" << l << endl;
alpha
(
j
)
=
2
.
0
*
Foam
::
asin
(
l
/
2
.
0
);
vector
temp
=
n0
^
n1
;
vector
temp
=
n0
^
n1
;
if
((
temp
&
v
)
<
0
.
0
)
{
alpha
[
j
]
=
-
alpha
[
j
];
}
l
=
mag
(
u
[
j
]
-
v
);
l
=
min
(
mag
(
u
[
j
]
-
v
),
2
.
0
);
//Pout<< " l:" << l << endl;
theta
(
j
)
=
2
.
0
*
Foam
::
asin
(
l
/
2
.
0
);
}
...
...
@@ -211,7 +210,7 @@ void Foam::pointMVCWeight::calcWeights
sum
+=
1
.
0
/
Foam
::
tan
(
theta
[
j
])
*
(
Foam
::
tan
(
alpha
[
j
]
/
2
.
0
)
+
Foam
::
tan
(
alpha
[
jMin1
]
/
2
.
0
));
*
(
Foam
::
tan
(
alpha
[
j
]
/
2
.
0
)
+
Foam
::
tan
(
alpha
[
jMin1
]
/
2
.
0
));
}
// The special case when x lies on the polygon, handle it using 2D mvc.
...
...
@@ -234,7 +233,7 @@ void Foam::pointMVCWeight::calcWeights
/
sum
/
dist
[
pid
]
/
Foam
::
sin
(
theta
[
j
])
*
(
Foam
::
tan
(
alpha
[
j
]
/
2
.
0
)
+
Foam
::
tan
(
alpha
[
jMin1
]
/
2
.
0
));
*
(
Foam
::
tan
(
alpha
[
j
]
/
2
.
0
)
+
Foam
::
tan
(
alpha
[
jMin1
]
/
2
.
0
));
}
}
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.H
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/pointMVCWeight.H
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeightI.H
→
src/finiteVolume/interpolation/interpolation/interpolationPoint
MVC
/pointMVCWeightI.H
View file @
709fc12c
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 200
4
-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 20
1
0-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment