From 729d53b86267d39fd02994ebdefd4ec884c55b01 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 14 Mar 2013 09:15:02 +0000 Subject: [PATCH 1/7] BUG: ideasUnvToFoam: handling faceZones --- .../utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index ec09ef3438..fb5df1f370 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -909,6 +909,8 @@ int main(int argc, char *argv[]) { if (own[faceI] != -1 && nei[faceI] != -1) { + faceToCell[1].insert(faceI, own[faceI]); + faceToCell[0].insert(faceI, nei[faceI]); cnt++; } } From 41aa6d637c8752b38fc43f689559f66cd638bcf5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 14 Mar 2013 10:01:05 +0000 Subject: [PATCH 2/7] ENH: movingCone: add cuttingPlane to show off moving mesh sampling --- .../movingCone/system/controlDict | 4 ++ .../movingCone/system/cuttingPlane | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict index d30e569e91..9b931e305a 100644 --- a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict @@ -49,5 +49,9 @@ adjustTimeStep no; maxCo 0.2; +functions +{ + #include "cuttingPlane" +} // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane new file mode 100644 index 0000000000..ba124eb087 --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.2.0 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +cuttingPlane +{ + type surfaces; + functionObjectLibs ("libsampling.so"); + + outputControl outputTime; + + surfaceFormat vtk; + fields ( p U ); + + interpolationScheme cellPoint; + + surfaces + ( + zNormal + { + type cuttingPlane; + planeType pointAndNormal; + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 0 1); + } + interpolate true; + } + ); +} + + +// ************************************************************************* // From 5d4073b8a3399ce638427d9148159ee70cb72785 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 14 Mar 2013 10:51:21 +0000 Subject: [PATCH 3/7] Icc support: changed optimisation switch to account for the architecture automatically --- wmake/rules/linux64Icc/c++Opt | 2 +- wmake/rules/linuxIcc/c++Opt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wmake/rules/linux64Icc/c++Opt b/wmake/rules/linux64Icc/c++Opt index 66638ffe98..2e2380eee2 100644 --- a/wmake/rules/linux64Icc/c++Opt +++ b/wmake/rules/linux64Icc/c++Opt @@ -1,2 +1,2 @@ c++DBUG = -c++OPT = -xSSE3 -O2 -no-prec-div +c++OPT = -xHost -O2 -no-prec-div diff --git a/wmake/rules/linuxIcc/c++Opt b/wmake/rules/linuxIcc/c++Opt index 66638ffe98..2e2380eee2 100644 --- a/wmake/rules/linuxIcc/c++Opt +++ b/wmake/rules/linuxIcc/c++Opt @@ -1,2 +1,2 @@ c++DBUG = -c++OPT = -xSSE3 -O2 -no-prec-div +c++OPT = -xHost -O2 -no-prec-div From 0c58d7eaf5f21ae5a88c99ce0cf80c3b8e19339b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 14 Mar 2013 11:25:16 +0000 Subject: [PATCH 4/7] BUG: syncTools: swap cell centres as positions --- .../polyMesh/polyMeshCheck/polyMeshTools.C | 6 +-- .../meshes/polyMesh/syncTools/syncTools.C | 38 +++++++++++++++++++ .../meshes/polyMesh/syncTools/syncTools.H | 17 ++++++--- .../searchableSurfaceToFaceZone.C | 4 +- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C index fc0739e79f..55f6a90767 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,7 @@ Foam::tmp Foam::polyMeshTools::faceOrthogonality // Coupled faces pointField neighbourCc; - syncTools::swapBoundaryCellList(mesh, cc, neighbourCc); + syncTools::swapBoundaryCellPositions(mesh, cc, neighbourCc); forAll(pbm, patchI) { @@ -123,7 +123,7 @@ Foam::tmp Foam::polyMeshTools::faceSkewness // (i.e. treat as if mirror cell on other side) pointField neighbourCc; - syncTools::swapBoundaryCellList(mesh, cellCtrs, neighbourCc); + syncTools::swapBoundaryCellPositions(mesh, cellCtrs, neighbourCc); forAll(pbm, patchI) { diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C index 2d007ad9fa..4326d43f38 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C @@ -27,6 +27,44 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +void Foam::syncTools::swapBoundaryCellPositions +( + const polyMesh& mesh, + const UList& cellData, + List& neighbourCellData +) +{ + if (cellData.size() != mesh.nCells()) + { + FatalErrorIn + ( + "syncTools::swapBoundaryCellPositions" + "(const polyMesh&, const UList&, List&)" + ) << "Number of cell values " << cellData.size() + << " is not equal to the number of cells in the mesh " + << mesh.nCells() << abort(FatalError); + } + + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + label nBnd = mesh.nFaces()-mesh.nInternalFaces(); + + neighbourCellData.setSize(nBnd); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + const labelUList& faceCells = pp.faceCells(); + forAll(faceCells, i) + { + label bFaceI = pp.start()+i-mesh.nInternalFaces(); + neighbourCellData[bFaceI] = cellData[faceCells[i]]; + } + } + syncTools::swapBoundaryFacePositions(mesh, neighbourCellData); +} + + Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh) { PackedBoolList isMasterPoint(mesh.nPoints()); diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H index d089d04f9e..cb1484b3b0 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.H @@ -442,18 +442,17 @@ public: } //- Swap coupled positions. - template static void swapBoundaryFacePositions ( const polyMesh& mesh, - UList& l + UList& l ) { syncBoundaryFaceList ( mesh, l, - eqOp(), + eqOp(), mapDistribute::transformPosition() ); } @@ -490,6 +489,14 @@ public: List& neighbourCellData ); + //- Swap to obtain neighbour cell positions for all boundary faces + static void swapBoundaryCellPositions + ( + const polyMesh& mesh, + const UList& cellData, + List& neighbourCellData + ); + // Sparse versions //- Synchronize values on selected points. @@ -531,11 +538,11 @@ public: } //- Synchronize locations on selected edges. - template + template static void syncEdgePositions ( const polyMesh& mesh, - EdgeMap& l, + EdgeMap& l, const CombineOp& cop ) { diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C index b91ec33b82..039e14555f 100644 --- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,7 +120,7 @@ void Foam::searchableSurfaceToFaceZone::applyToSet // Boundary faces vectorField nbrCellCentres; - syncTools::swapBoundaryCellList(mesh_, cc, nbrCellCentres); + syncTools::swapBoundaryCellPositions(mesh_, cc, nbrCellCentres); const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); From 48d8fa9e5c047f074553b8c211179beda53076a4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 14 Mar 2013 11:47:46 +0000 Subject: [PATCH 5/7] STYLE: cuttingPlane: correct version number --- .../incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane index ba124eb087..29b42ee983 100644 --- a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/cuttingPlane @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.2.0 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ From 2e40955557972c6c52e469b5ffbd37d98faef6c0 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 14 Mar 2013 12:25:19 +0000 Subject: [PATCH 6/7] energyRegionCoupledFvPatchScalarField: now derived from coupledFvPatchField --- .../energyRegionCoupledFvPatchScalarField.C | 80 +++++-------------- .../energyRegionCoupledFvPatchScalarField.H | 59 ++++---------- 2 files changed, 34 insertions(+), 105 deletions(-) diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index 83fe6ae2c4..d09ec8ee55 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C @@ -59,12 +59,13 @@ void Foam::energyRegionCoupledFvPatchScalarField::setMethod() const { if (method_ == UNDEFINED) { - if ( - this->db().foundObject - ( - "turbulenceModel" - ) - ) + if + ( + this->db().foundObject + ( + "turbulenceModel" + ) + ) { method_ = FLUID; } @@ -212,8 +213,7 @@ energyRegionCoupledFvPatchScalarField const DimensionedField& iF ) : - LduInterfaceField(refCast(p)), - fvPatchScalarField(p, iF), + coupledFvPatchField(p, iF), regionCoupledPatch_(refCast(p)), method_(UNDEFINED), nbrThermoPtr_(NULL), @@ -230,8 +230,7 @@ energyRegionCoupledFvPatchScalarField const fvPatchFieldMapper& mapper ) : - LduInterfaceField(refCast(p)), - fvPatchScalarField(ptf, p, iF, mapper), + coupledFvPatchField(ptf, p, iF, mapper), regionCoupledPatch_(refCast(p)), method_(ptf.method_), nbrThermoPtr_(NULL), @@ -247,8 +246,7 @@ energyRegionCoupledFvPatchScalarField const dictionary& dict ) : - LduInterfaceField(refCast(p)), - fvPatchScalarField(p, iF, dict), + coupledFvPatchField(p, iF, dict), regionCoupledPatch_(refCast(p)), method_(UNDEFINED), nbrThermoPtr_(NULL), @@ -287,8 +285,7 @@ energyRegionCoupledFvPatchScalarField const energyRegionCoupledFvPatchScalarField& ptf ) : - LduInterfaceField(refCast(ptf.patch())), - fvPatchScalarField(ptf), + coupledFvPatchField(ptf), regionCoupledPatch_(ptf.regionCoupledPatch_), method_(ptf.method_), nbrThermoPtr_(NULL), @@ -303,8 +300,7 @@ energyRegionCoupledFvPatchScalarField const DimensionedField& iF ) : - LduInterfaceField(refCast(ptf.patch())), - fvPatchScalarField(ptf, iF), + coupledFvPatchField(ptf, iF), regionCoupledPatch_(ptf.regionCoupledPatch_), method_(ptf.method_), nbrThermoPtr_(NULL), @@ -314,24 +310,19 @@ energyRegionCoupledFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: snGrad() const { return - (*this - patchInternalField())*regionCoupledPatch_.patch().deltaCoeffs(); + regionCoupledPatch_.patch().deltaCoeffs() + *(*this - patchInternalField()); } -void Foam::energyRegionCoupledFvPatchScalarField::initEvaluate -( - const Pstream::commsTypes -) +Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: +snGrad(const scalarField&) const { - if (!updated()) - { - updateCoeffs(); - } + return snGrad(); } @@ -365,42 +356,6 @@ void Foam::energyRegionCoupledFvPatchScalarField::evaluate } -Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: -valueInternalCoeffs -( - const tmp& w -) const -{ - return scalar(pTraits::one)*w; -} - - -Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: -valueBoundaryCoeffs -( - const tmp& w -) const -{ - return scalar(pTraits::one)*(1.0 - w); -} - - -Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: -gradientInternalCoeffs() const -{ - return - -scalar(pTraits::one) - *regionCoupledPatch_.patch().deltaCoeffs(); -} - - -Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: -gradientBoundaryCoeffs() const -{ - return -this->gradientInternalCoeffs(); -} - - Foam::tmp > Foam::energyRegionCoupledFvPatchScalarField:: patchNeighbourField() const @@ -546,6 +501,7 @@ void Foam::energyRegionCoupledFvPatchScalarField::write(Ostream& os) const this->writeEntry("value", os); } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.H b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.H index 7b0b7df39c..7103f1f1f1 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.H +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,22 +43,23 @@ SourceFiles #include "fvPatchField.H" #include "NamedEnum.H" #include "basicThermo.H" +#include "coupledFvPatchField.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - /*---------------------------------------------------------------------------*\ Class energyRegionCoupledFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class energyRegionCoupledFvPatchScalarField : - public LduInterfaceField, - public fvPatchScalarField + public coupledFvPatchField { + public: enum kappaMethodType @@ -162,12 +163,6 @@ public: const DimensionedField& ); - - //- Destructor - virtual ~energyRegionCoupledFvPatchScalarField() - {} - - //- Construct and return a clone setting internal field reference virtual tmp > clone ( @@ -181,17 +176,15 @@ public: } + //- Destructor + virtual ~energyRegionCoupledFvPatchScalarField() + {} + + // Member functions - // Access - //- Return true if this patch field is coupled - virtual bool coupled() const - { - return true; - } - //- Method to obtain K word kappaMethod() const { @@ -207,11 +200,13 @@ public: //- Return patch-normal gradient virtual tmp snGrad() const; - //- Initialise the evaluation of the patch field - virtual void initEvaluate + //- Return patch-normal gradient + // Note: the deltaCoeffs supplied are not used + virtual tmp snGrad ( - const Pstream::commsTypes commsType - ); + const scalarField& deltaCoeffs + ) const; + //- Evaluate the patch field virtual void evaluate @@ -219,28 +214,6 @@ public: const Pstream::commsTypes commsType ); - //- Return the matrix diagonal coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp valueInternalCoeffs - ( - const tmp& - ) const; - - //- Return the matrix source coefficients corresponding to the - // evaluation of the value of this patchField with given weights - virtual tmp valueBoundaryCoeffs - ( - const tmp& - ) const; - - //- Return the matrix diagonal coefficients corresponding to the - // evaluation of the gradient of this patchField - virtual tmp gradientInternalCoeffs() const; - - //- Return the matrix source coefficients corresponding to the - // evaluation of the gradient of this patchField - virtual tmp gradientBoundaryCoeffs() const; - // Coupled interface functionality From beac4764af7588472c71f52789e390a5acb12827 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 14 Mar 2013 12:26:07 +0000 Subject: [PATCH 7/7] fvPatchFields: Completed handling of deltaCoeffs in snGrad for coupled patches --- .../basic/coupled/coupledFvPatchField.C | 10 -- .../basic/coupled/coupledFvPatchField.H | 9 +- .../processorCyclicFvPatchField.C | 120 ++---------------- .../fvPatchFields/fvPatchField/fvPatchField.C | 12 +- .../fvPatchFields/fvPatchField/fvPatchField.H | 42 +++--- 5 files changed, 43 insertions(+), 150 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C index 4d08364389..1a0aacd030 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.C @@ -104,16 +104,6 @@ Foam::coupledFvPatchField::coupledFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -Foam::tmp > Foam::coupledFvPatchField::snGrad() const -{ - notImplemented("coupledFvPatchField::snGrad()"); - return - this->patch().deltaCoeffs() - *(this->patchNeighbourField() - this->patchInternalField()); -} - - template Foam::tmp > Foam::coupledFvPatchField::snGrad ( diff --git a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H index aa6610709f..4a443c6f11 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/coupled/coupledFvPatchField.H @@ -145,7 +145,14 @@ public: ) const; //- Return patch-normal gradient - virtual tmp > snGrad() const; + virtual tmp > snGrad() const + { + notImplemented + ( + type() + "::coupledFvPatchField::snGrad()" + ); + return *this; + } //- Initialise the evaluation of the patch field virtual void initEvaluate diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C index d36da92ef3..3a0f7fd1b4 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,15 +28,10 @@ License #include "demandDrivenData.H" #include "transformField.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const fvPatch& p, const DimensionedField& iF @@ -48,7 +43,7 @@ processorCyclicFvPatchField::processorCyclicFvPatchField template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -63,7 +58,7 @@ processorCyclicFvPatchField::processorCyclicFvPatchField // Construct by mapping given processorCyclicFvPatchField template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const processorCyclicFvPatchField& ptf, const fvPatch& p, @@ -97,7 +92,7 @@ processorCyclicFvPatchField::processorCyclicFvPatchField template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const fvPatch& p, const DimensionedField& iF, @@ -144,7 +139,7 @@ processorCyclicFvPatchField::processorCyclicFvPatchField template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const processorCyclicFvPatchField& ptf ) @@ -157,7 +152,7 @@ processorCyclicFvPatchField::processorCyclicFvPatchField template -processorCyclicFvPatchField::processorCyclicFvPatchField +Foam::processorCyclicFvPatchField::processorCyclicFvPatchField ( const processorCyclicFvPatchField& ptf, const DimensionedField& iF @@ -172,107 +167,8 @@ processorCyclicFvPatchField::processorCyclicFvPatchField // * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // template -processorCyclicFvPatchField::~processorCyclicFvPatchField() +Foam::processorCyclicFvPatchField::~processorCyclicFvPatchField() {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -//template -//tmp > -//processorCyclicFvPatchField::patchNeighbourField() const -//{ -// return *this; -//} -// -// -//template -//void processorCyclicFvPatchField::initEvaluate -//( -// const Pstream::commsTypes commsType -//) -//{ -// if (Pstream::parRun()) -// { -// procPatch_.compressedSend(commsType, this->patchInternalField()()); -// } -//} -// -// -//template -//void processorCyclicFvPatchField::evaluate -//( -// const Pstream::commsTypes commsType -//) -//{ -// if (Pstream::parRun()) -// { -// procPatch_.compressedReceive(commsType, *this); -// -// if (doTransform()) -// { -// transform(*this, procPatch_.forwardT(), *this); -// } -// } -//} -// -// -//template -//tmp > processorCyclicFvPatchField::snGrad() const -//{ -// return this->patch().deltaCoeffs()*(*this - this->patchInternalField()); -//} -// -// -//template -//void processorCyclicFvPatchField::initInterfaceMatrixUpdate -//( -// scalarField&, -// const scalarField& psiInternal, -// const scalarField&, -// const direction, -// const Pstream::commsTypes commsType -//) const -//{ -// procPatch_.compressedSend -// ( -// commsType, -// this->patch().patchInternalField(psiInternal)() -// ); -//} -// -// -//template -//void processorCyclicFvPatchField::updateInterfaceMatrix -//( -// scalarField& result, -// const scalarField&, -// const scalarField& coeffs, -// const direction cmpt, -// const Pstream::commsTypes commsType -//) const -//{ -// scalarField pnf -// ( -// procPatch_.compressedReceive(commsType, this->size())() -// ); -// -// // Transform according to the transformation tensor -// transformCoupleField(pnf, cmpt); -// -// // Multiply the field by coefficients and add into the result -// -// const labelUList& faceCells = this->patch().faceCells(); -// -// forAll(faceCells, elemI) -// { -// result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; -// } -//} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 5635b348be..f5622451cb 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -173,20 +173,10 @@ void Foam::fvPatchField::check(const fvPatchField& ptf) const } -template -Foam::tmp > Foam::fvPatchField::snGrad -( - const scalarField& deltaCoeffs -) const -{ - return deltaCoeffs*(*this - patchInternalField()); -} - - template Foam::tmp > Foam::fvPatchField::snGrad() const { - return this->snGrad(patch_.deltaCoeffs()); + return patch_.deltaCoeffs()*(*this - patchInternalField()); } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index 0167133a03..6047f1e4af 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -347,13 +347,21 @@ public: // Evaluation functions //- Return patch-normal gradient + virtual tmp > snGrad() const; + + //- Return patch-normal gradient for coupled-patches + // using the deltaCoeffs provided virtual tmp > snGrad ( const scalarField& deltaCoeffs - ) const; - - //- Return patch-normal gradient - virtual tmp > snGrad() const; + ) const + { + notImplemented + ( + type() + "::snGrad(const scalarField& deltaCoeffs)" + ); + return *this; + } //- Update the coefficients associated with the patch field // Sets Updated to true @@ -421,6 +429,15 @@ public: //- Return the matrix diagonal coefficients corresponding to the // evaluation of the gradient of this patchField + virtual tmp > gradientInternalCoeffs() const + { + notImplemented(type() + "::gradientInternalCoeffs()"); + return *this; + } + + //- Return the matrix diagonal coefficients corresponding to the + // evaluation of the gradient of this coupled patchField + // using the deltaCoeffs provided virtual tmp > gradientInternalCoeffs ( const scalarField& deltaCoeffs @@ -434,16 +451,17 @@ public: return *this; } - //- Return the matrix diagonal coefficients corresponding to the + //- Return the matrix source coefficients corresponding to the // evaluation of the gradient of this patchField - virtual tmp > gradientInternalCoeffs() const + virtual tmp > gradientBoundaryCoeffs() const { - notImplemented(type() + "::gradientInternalCoeffs()"); + notImplemented(type() + "::gradientBoundaryCoeffs()"); return *this; } //- Return the matrix source coefficients corresponding to the - // evaluation of the gradient of this patchField + // evaluation of the gradient of this coupled patchField + // using the deltaCoeffs provided virtual tmp > gradientBoundaryCoeffs ( const scalarField& deltaCoeffs @@ -457,14 +475,6 @@ public: return *this; } - //- Return the matrix source coefficients corresponding to the - // evaluation of the gradient of this patchField - virtual tmp > gradientBoundaryCoeffs() const - { - notImplemented(type() + "::gradientBoundaryCoeffs()"); - return *this; - } - //- Manipulate matrix virtual void manipulateMatrix(fvMatrix& matrix);