From 5bde9ad11781410a7c6640cc553ffad26d37ff34 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Aug 2010 11:22:38 +0100 Subject: [PATCH 01/83] BUG: MRFZoneTemplates : absoluteFlux missing rho --- .../cfdTools/general/MRF/MRFZoneTemplates.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C index 3a357601f3..2f1da5c6a0 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZoneTemplates.C @@ -71,7 +71,7 @@ void Foam::MRFZone::relativeRhoFlux phi.boundaryField()[patchi][patchFacei] -= rho.boundaryField()[patchi][patchFacei] - *(Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) + * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) & Sf.boundaryField()[patchi][patchFacei]; } } @@ -95,7 +95,7 @@ void Foam::MRFZone::absoluteRhoFlux forAll(internalFaces_, i) { label facei = internalFaces_[i]; - phi[facei] += (Omega ^ (Cf[facei] - origin)) & Sf[facei]; + phi[facei] += rho[facei]*(Omega ^ (Cf[facei] - origin)) & Sf[facei]; } // Included patches @@ -106,7 +106,8 @@ void Foam::MRFZone::absoluteRhoFlux label patchFacei = includedFaces_[patchi][i]; phi.boundaryField()[patchi][patchFacei] += - (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) + rho.boundaryField()[patchi][patchFacei] + * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) & Sf.boundaryField()[patchi][patchFacei]; } } @@ -119,7 +120,8 @@ void Foam::MRFZone::absoluteRhoFlux label patchFacei = excludedFaces_[patchi][i]; phi.boundaryField()[patchi][patchFacei] += - (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) + rho.boundaryField()[patchi][patchFacei] + * (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin)) & Sf.boundaryField()[patchi][patchFacei]; } } From d40df85591c288640f07a7a5545e057ba3b3f4a6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Aug 2010 16:17:18 +0100 Subject: [PATCH 02/83] ENH: interpolationPoint : interpolation from point values only (using Mean Value Coordinates) --- src/finiteVolume/Make/files | 2 + .../interpolationPoint/interpolationPoint.C | 255 ++++++++++++++ .../interpolationPoint/interpolationPoint.H | 108 ++++++ .../interpolationPoint/interpolationPointI.H | 53 +++ .../makeInterpolationPoint.C | 35 ++ .../interpolationPoint/pointMVCWeight.C | 324 ++++++++++++++++++ .../interpolationPoint/pointMVCWeight.H | 162 +++++++++ .../interpolationPoint/pointMVCWeightI.H | 48 +++ 8 files changed, 987 insertions(+) create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPointI.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/makeInterpolationPoint.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.C create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeight.H create mode 100644 src/finiteVolume/interpolation/interpolation/interpolationPoint/pointMVCWeightI.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 84ff879b50..126669d56a 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -196,6 +196,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 volPointInterpolation = interpolation/volPointInterpolation /* diff --git a/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C b/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C new file mode 100644 index 0000000000..598a5807ee --- /dev/null +++ b/src/finiteVolume/interpolation/interpolation/interpolationPoint/interpolationPoint.C @@ -0,0 +1,255 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2010 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 3 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, see . + +\*---------------------------------------------------------------------------*/ + +#include "interpolationPoint.H" +#include "volPointInterpolation.H" + +// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // + +template +Foam::interpolationPoint::interpolationPoint +( + const GeometricField& psi +) +: + interpolation(psi), + psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +//template +//void Foam::interpolationPoint::calcWeights +//( +// const vector& position, +// const label cellI, +// const label faceI, +// scalarField& weights +//) const +//{ +// const polyMesh& mesh = this->pMesh_; +// const pointField& points = mesh.points(); +// +// +// const scalar eps = 0.00000001; +// +// +// // Addressing - face vertices to local points +// const labelList& toGlobal = mesh.cellPoints()[cellI]; +// Map