From c7cf4d9d8769ab9d1b1917921543881bf00e11cd Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 30 Apr 2014 12:03:51 +0100 Subject: [PATCH] Small changes to energyRegionCoupled BC --- .../regionCoupledBaseGAMGInterface.C | 19 ++++---- .../energyRegionCoupledFvPatchScalarField.C | 43 ++++++------------- 2 files changed, 23 insertions(+), 39 deletions(-) diff --git a/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C b/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C index e02fd1a7e5..9066f4dfc7 100644 --- a/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C +++ b/src/meshTools/regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,7 +52,6 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface refCast(fineInterface) ) { - /* // Construct face agglomeration from cell agglomeration { // From coarse face to cell @@ -94,6 +93,7 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface faceRestrictAddressing_.transfer(dynFaceRestrictAddressing); } + /* // On the owner side construct the AMI if (fineRegionCoupledLduInterface_.owner()) { @@ -228,15 +228,14 @@ internalFieldTransfer const labelUList& iF ) const { +// WarningIn +// ( +// "regionCoupledBaseGAMGInterface::internalFieldTransfer" +// "( const Pstream::commsTypes, const labelUList&)" +// " the internal field can not be transfered " +// " as the neighbFvPatch are in different meshes " +// ); /* - WarningIn - ( - "regionCoupledBaseGAMGInterface::internalFieldTransfer" - "( const Pstream::commsTypes, const labelUList&)" - " the internal field can not be transfered " - " as the neighbFvPatch are in different meshes " - ); - //const labelUList& nbrFaceCells = neighbPatch().faceCells(); const labelUList& nbrFaceCells = nbrLduInterface().faceCells(); diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index 56a476f97d..9f0fe9a60c 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -308,6 +308,7 @@ energyRegionCoupledFvPatchScalarField Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: snGrad() const { + Debug("snGrad"); return regionCoupledPatch_.patch().deltaCoeffs() *(*this - patchInternalField()); @@ -317,6 +318,7 @@ snGrad() const Foam::tmp Foam::energyRegionCoupledFvPatchScalarField:: snGrad(const scalarField&) const { + Debug("snGrad"); return snGrad(); } @@ -427,7 +429,6 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix if (&psiInternal == &internalField()) { - label patchi = this->patch().index(); const scalarField& pp = thermoPtr_->p().boundaryField()[patchi]; const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi]; @@ -436,6 +437,8 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix } else { + //NOTE: This is not correct for preconditioned solvers + // psiInternal is not the information needed of the slave forAll(*this, facei) { myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]]; @@ -460,33 +463,15 @@ void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix const Pstream::commsTypes ) const { - setMethod(); - - scalarField myHE(this->size()); - - if (&psiInternal == &internalField()) - { - label patchi = this->patch().index(); - const scalarField& pp = thermoPtr_->p().boundaryField()[patchi]; - const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi]; - - myHE = thermoPtr_->he(pp, Tp, patchi); - } - else - { - forAll(*this, facei) - { - myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]]; - } - } - - // Multiply the field by coefficients and add into the result - const labelUList& faceCells = regionCoupledPatch_.faceCells(); - - forAll(faceCells, elemI) - { - result[faceCells[elemI]] -= coeffs[elemI]*myHE[elemI]; - } + notImplemented + ( + "energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix()" + "(" + "Field& " + "const Field&" + "const scalarField& " + "const Pstream::commsTypes" + ); }