added interpolationCellPointWallModified

This commit is contained in:
andy
2009-03-04 09:43:45 +00:00
parent cb697ea37a
commit 3b07525b5a
9 changed files with 411 additions and 5 deletions

View File

@ -164,6 +164,8 @@ $(interpolation)/interpolationCell/makeInterpolationCell.C
$(interpolation)/interpolationCellPoint/cellPointWeight/cellPointWeight.C
$(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C
$(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C
$(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
$(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
volPointInterpolation = interpolation/volPointInterpolation
$(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C

View File

@ -51,7 +51,9 @@ class polyMesh;
class cellPointWeight
{
// Private data
protected:
// Protected data
//- Cell index
const label cellIndex_;
@ -63,7 +65,7 @@ class cellPointWeight
FixedList<label, 3> faceVertices_;
// Private Member Functions
// Protected Member Functions
void findTetrahedron
(

View File

@ -42,7 +42,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolationCellPoint Declaration
Class interpolationCellPoint Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
@ -50,7 +50,9 @@ class interpolationCellPoint
:
public interpolation<Type>
{
// Private data
protected:
// Protected data
//- Interpolated volfield
const GeometricField<Type, pointPatchField, pointMesh> psip_;
@ -79,7 +81,7 @@ public:
//- Interpolate field to the given point in the given cell
inline Type interpolate
(
const vector& position,
const vector& position,
const label nCell,
const label facei = -1
) const;

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cellPointWeightWallModified.H"
#include "wallPolyPatch.H"
#include "polyMesh.H"
#include "polyBoundaryMesh.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cellPointWeightWallModified::cellPointWeightWallModified
(
const polyMesh& mesh,
const vector& position,
const label cellIndex,
const label faceIndex
)
:
cellPointWeight(mesh, position, cellIndex, faceIndex)
{
if (faceIndex < 0)
{
findTetrahedron(mesh, position, cellIndex);
}
else
{
const polyBoundaryMesh& bm = mesh.boundaryMesh();
label patchI = bm.whichPatch(faceIndex);
if (patchI != -1)
{
if (isA<wallPolyPatch>(bm[patchI]))
{
// Apply cell centre value wall faces
weights_[0] = 0.0;
weights_[1] = 0.0;
weights_[2] = 0.0;
weights_[3] = 1.0;
}
}
else
{
// Interpolate
findTriangle(mesh, position, faceIndex);
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cellPointWeightWallModified
Description
Foam::cellPointWeightWallModified
SourceFiles
cellPointWeightWallModified.C
\*---------------------------------------------------------------------------*/
#ifndef cellPointWeightWallModified_H
#define cellPointWeightWallModified_H
#include "cellPointWeight.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class polyMesh;
/*---------------------------------------------------------------------------*\
Class cellPointWeightWallModified Declaration
\*---------------------------------------------------------------------------*/
class cellPointWeightWallModified
:
public cellPointWeight
{
public:
// Constructors
//- Construct from components
cellPointWeightWallModified
(
const polyMesh& mesh,
const vector& position,
const label nCell,
const label facei = -1
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "interpolationCellPointWallModified.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::interpolationCellPointWallModified<Type>::
interpolationCellPointWallModified
(
const GeometricField<Type, fvPatchField, volMesh>& psi
)
:
interpolationCellPoint<Type>(psi)
{}
// ************************************************************************* //

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::interpolationCellPoint
Description
Same as interpolationCellPoint, but if interpolating a wall face, uses
cell centre value instead
\*---------------------------------------------------------------------------*/
#ifndef interpolationCellPointWallModified_H
#define interpolationCellPointWallModified_H
#include "interpolationCellPoint.H"
#include "cellPointWeightWallModified.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolationCellPoint Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class interpolationCellPointWallModified
:
public interpolationCellPoint<Type>
{
public:
//- Runtime type information
TypeName("cellPointWallModified");
// Constructors
//- Construct from components
interpolationCellPointWallModified
(
const GeometricField<Type, fvPatchField, volMesh>& psi
);
// Member Functions
//- Interpolate field for the given cellPointWeight
inline Type interpolate(const cellPointWeightWallModified& cpw) const;
//- Interpolate field to the given point in the given cell
inline Type interpolate
(
const vector& position,
const label nCell,
const label facei = -1
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "interpolationCellPointWallModifiedI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "interpolationCellPointWallModified.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline Type Foam::interpolationCellPointWallModified<Type>::interpolate
(
const cellPointWeightWallModified& cpw
) const
{
const FixedList<scalar, 4>& weights = cpw.weights();
const FixedList<label, 3>& faceVertices = cpw.faceVertices();
Type t = this->psip_[faceVertices[0]]*weights[0];
t += this->psip_[faceVertices[1]]*weights[1];
t += this->psip_[faceVertices[2]]*weights[2];
t += this->psi_[cpw.cell()]*weights[3];
return t;
}
template<class Type>
inline Type Foam::interpolationCellPointWallModified<Type>::interpolate
(
const vector& position,
const label celli,
const label facei
) const
{
return
interpolate
(
cellPointWeightWallModified
(
this->pMesh_,
position,
celli,
facei
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "interpolationCellPointWallModified.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeInterpolation(interpolationCellPointWallModified);
}
// ************************************************************************* //