diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/ggi/ggiFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/ggi/ggiFvPatchField.C index fe4628f75..db3a366e3 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/ggi/ggiFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/ggi/ggiFvPatchField.C @@ -231,10 +231,10 @@ void ggiFvPatchField::initEvaluate template void ggiFvPatchField::evaluate ( - const Pstream::commsTypes + const Pstream::commsTypes commsTypes ) { - fvPatchField::evaluate(); + coupledFvPatchField::evaluate(commsTypes); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.C index 3c557ef40..a9fe248f8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved @@ -38,7 +39,6 @@ Note on parallelisation \*---------------------------------------------------------------------------*/ #include "jumpGgiFvPatchField.H" -//#include "symmTransformField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -122,44 +122,46 @@ void jumpGgiFvPatchField::initInterfaceMatrixUpdate const unallocLabelList& sfc = this->ggiPatch().shadow().faceCells(); scalarField sField(sfc.size()); + + forAll (sField, i) + { + sField[i] = psiInternal[sfc[i]]; + } + + Field pnf = this->ggiPatch().interpolate(sField); + + + // Multiply the field by coefficients and add into the result + const unallocLabelList& fc = this->ggiPatch().faceCells(); + + const Field jf = jump()().component(cmpt); + if ( reinterpret_cast(&psiInternal) == reinterpret_cast(&this->internalField()) ) { - const scalarField jf = jump()().component(cmpt); - - forAll (sField, i) + forAll(pnf, elemI) { - sField[i] = psiInternal[sfc[i]] + jf[i]; - } - } - else - { - forAll (sField, i) - { - sField[i] = psiInternal[sfc[i]]; + pnf[elemI] += jf[elemI]; } } - scalarField pnf = this->ggiPatch().interpolate(sField); - - // Multiply the field by coefficients and add into the result - const unallocLabelList& fc = this->ggiPatch().faceCells(); + multiply(pnf, coeffs, pnf); if (switchToLhs) { forAll(fc, elemI) { - result[fc[elemI]] += coeffs[elemI]*pnf[elemI]; + result[fc[elemI]] += pnf[elemI]; } } else { forAll(fc, elemI) { - result[fc[elemI]] -= coeffs[elemI]*pnf[elemI]; + result[fc[elemI]] -= pnf[elemI]; } } } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.H index 85c9ee336..7f74e09a9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchField.H @@ -32,6 +32,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.C index 929f7ac23..35fc42eb3 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.H index e27dc794f..36c12360b 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFields.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFieldsFwd.H index 383d42484..3d73dc940 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpGgi/jumpGgiFvPatchFieldsFwd.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.C index 6ef6fc17a..9563c46f0 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved @@ -109,7 +110,7 @@ jumpMixingPlaneFvPatchField::patchNeighbourField() const if (this->mixing() == mixingPlaneInterpolation::AREA_AVERAGING) { // Area-weighted averaging - return this->mixingPlanePatch().interpolate(sField); + return this->mixingPlanePatch().interpolate(sField) + jump(); } else if (this->mixing() == mixingPlaneInterpolation::FLUX_AVERAGING) { @@ -134,11 +135,12 @@ jumpMixingPlaneFvPatchField::patchNeighbourField() const ) ) + this->mixingPlanePatch().fromProfile(1 - mask)* - this->patchInternalField(); + this->patchInternalField() + + jump(); } else if (this->mixing() == mixingPlaneInterpolation::ZERO_GRADIENT) { - return this->patchInternalField(); + return this->patchInternalField() + jump(); } else { @@ -195,19 +197,46 @@ void jumpMixingPlaneFvPatchField::initInterfaceMatrixUpdate scalarField pnf = this->mixingPlanePatch().interpolate(sField); - // Multiply the field by coefficients and add into the result - if (switchToLhs) + if + ( + reinterpret_cast(&psiInternal) + == reinterpret_cast(&this->internalField()) + ) { - forAll(fc, elemI) + const Field jf = jump()().component(cmpt); + + // Multiply the field by coefficients and add into the result + if (switchToLhs) { - result[fc[elemI]] += coeffs[elemI]*pnf[elemI]; + forAll(fc, elemI) + { + result[fc[elemI]] += coeffs[elemI]*(pnf[elemI] + jf[elemI]); + } + } + else + { + forAll(fc, elemI) + { + result[fc[elemI]] -= coeffs[elemI]*(pnf[elemI] + jf[elemI]); + } } } else { - forAll(fc, elemI) + // Multiply the field by coefficients and add into the result + if (switchToLhs) { - result[fc[elemI]] -= coeffs[elemI]*pnf[elemI]; + forAll(fc, elemI) + { + result[fc[elemI]] += coeffs[elemI]*pnf[elemI]; + } + } + else + { + forAll(fc, elemI) + { + result[fc[elemI]] -= coeffs[elemI]*pnf[elemI]; + } } } } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.H index bd499307d..3c13e309a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchField.H @@ -32,6 +32,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.C index 5f4ed5ee6..f56ab7922 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.C @@ -30,6 +30,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.H index c5f8f59b6..fd2ab43f8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFields.H @@ -33,6 +33,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFieldsFwd.H index 9d7b01d05..252e3e15b 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFieldsFwd.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpMixingPlane/jumpMixingPlaneFvPatchFieldsFwd.H @@ -33,6 +33,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.C new file mode 100644 index 000000000..82fe496e8 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Author + Ilaria De Dominicis, General Electric Power, (March 2016) + +Contributor + Hrvoje Jasak, Wikki Ltd. + +GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved + +\*---------------------------------------------------------------------------*/ + +#include "jumpOverlapGgiFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +jumpOverlapGgiFvPatchField::jumpOverlapGgiFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + overlapGgiFvPatchField(p, iF) +{} + + +template +jumpOverlapGgiFvPatchField::jumpOverlapGgiFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + overlapGgiFvPatchField(p, iF, dict) +{} + + +template +jumpOverlapGgiFvPatchField::jumpOverlapGgiFvPatchField +( + const jumpOverlapGgiFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + overlapGgiFvPatchField(ptf, p, iF, mapper) +{} + + +template +jumpOverlapGgiFvPatchField::jumpOverlapGgiFvPatchField +( + const jumpOverlapGgiFvPatchField& ptf +) +: + overlapGgiFvPatchField(ptf) +{} + + +template +jumpOverlapGgiFvPatchField::jumpOverlapGgiFvPatchField +( + const jumpOverlapGgiFvPatchField& ptf, + const DimensionedField& iF +) +: + overlapGgiFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +template +tmp > +jumpOverlapGgiFvPatchField::patchNeighbourField() const +{ + return overlapGgiFvPatchField::patchNeighbourField() + jump(); +} + + +template +void jumpOverlapGgiFvPatchField::initInterfaceMatrixUpdate +( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix&, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType, + const bool switchToLhs +) const +{ + + // Get shadow face-cells and assemble shadow field + const unallocLabelList& sfc = this->overlapGgiPatch().shadow().faceCells(); + + scalarField sField(sfc.size()); + + forAll (sField, i) + { + sField[i] = psiInternal[sfc[i]]; + } + + scalarField pnf = this->overlapGgiPatch().interpolate(sField); + + // Multiply the field by coefficients and add into the result + const unallocLabelList& fc = this->overlapGgiPatch().faceCells(); + + if + ( + reinterpret_cast(&psiInternal) + == reinterpret_cast(&this->internalField()) + ) + { + const Field jf = jump()().component(cmpt); + + if (switchToLhs) + { + forAll(fc, elemI) + { + result[fc[elemI]] += coeffs[elemI]*(pnf[elemI] + jf[elemI]); + } + } + else + { + forAll(fc, elemI) + { + result[fc[elemI]] -= coeffs[elemI]*(pnf[elemI] + jf[elemI]); + } + } + } + else + { + if (switchToLhs) + { + forAll(fc, elemI) + { + result[fc[elemI]] += coeffs[elemI]*(pnf[elemI]); + } + } + else + { + forAll(fc, elemI) + { + result[fc[elemI]] -= coeffs[elemI]*(pnf[elemI]); + } + } + } +} + + +template +void jumpOverlapGgiFvPatchField::updateInterfaceMatrix +( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix&, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes, + const bool switchToLhs +) const +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.H new file mode 100644 index 000000000..21860b451 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchField.H @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Class + jumpOverlapGgiFvPatchField + +Description + OverlapGgi interface patch field with a jump condition + +Author + Ilaria De Dominicis, General Electric Power, (March 2016) + +Contributor + Hrvoje Jasak, Wikki Ltd. + +GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved + +SourceFiles + jumpOverlapGgiFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpOverlapGgiFvPatchField_H +#define jumpOverlapGgiFvPatchField_H + +#include "overlapGgiFvPatchField.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class jumpOverlapGgiFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class jumpOverlapGgiFvPatchField +: + public overlapGgiFvPatchField +{ +public: + + //- Runtime type information + TypeName("jumpOverlapGgi"); + + + // Constructors + + //- Construct from patch and internal field + jumpOverlapGgiFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + jumpOverlapGgiFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given jumpOverlapGgiFvPatchField + // onto a new patch + jumpOverlapGgiFvPatchField + ( + const jumpOverlapGgiFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + jumpOverlapGgiFvPatchField + ( + const jumpOverlapGgiFvPatchField& + ); + + //- Construct as copy setting internal field reference + jumpOverlapGgiFvPatchField + ( + const jumpOverlapGgiFvPatchField&, + const DimensionedField& + ); + + + // Member functions + + // Access + + //- Return the interface type + virtual const word& interfaceFieldType() const + { + return overlapGgiFvPatchField::type(); + } + + + //- Return the "jump" across the patch as a "half" field + virtual tmp > jump() const = 0; + + + // Evaluation functions + + //- Return neighbour patch field + virtual tmp > patchNeighbourField() const; + + //- Initialise neighbour matrix update + virtual void initInterfaceMatrixUpdate + ( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix& m, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType, + const bool switchToLhs + ) const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix&, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType, + const bool switchToLhs + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "jumpOverlapGgiFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.C new file mode 100644 index 000000000..c1d938b5d --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Description + OverlapGgi patch field, providing coupling with a jump condition + between arbitrary patches + +Author + Ilaria De Dominicis, General Electric Power, (March 2016) + +Contributor + Hrvoje Jasak, Wikki Ltd. + +GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved + +\*---------------------------------------------------------------------------*/ + +#include "jumpOverlapGgiFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFieldsTypeName(jumpOverlapGgi); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.H new file mode 100644 index 000000000..581836a8e --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFields.H @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Class + jumpOverlapGgiFvPatchFields + +Description + OverlapGgi patch field, providing coupling with a jump condition + between arbitrary patches + +Author + Ilaria De Dominicis, General Electric Power, (March 2016) + +Contributor + Hrvoje Jasak, Wikki Ltd. + +GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved + +SourceFiles + jumpOverlapGgiFvPatchFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpOverlapGgiFvPatchFields_H +#define jumpOverlapGgiFvPatchFields_H + +#include "jumpOverlapGgiFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(jumpOverlapGgi) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFieldsFwd.H new file mode 100644 index 000000000..5b1faf7ad --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpOverlapGgi/jumpOverlapGgiFvPatchFieldsFwd.H @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | foam-extend: Open Source CFD + \\ / O peration | Version: 4.0 + \\ / A nd | Web: http://www.foam-extend.org + \\/ M anipulation | For copyright notice see file Copyright +------------------------------------------------------------------------------- +License + This file is part of foam-extend. + + foam-extend 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. + + foam-extend 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 foam-extend. If not, see . + +Class + jumpOverlapGgiFvPatchField + +Description + OverlapGgi patch field, providing coupling with a jump condition + between arbitrary patches + +Author + Ilaria De Dominicis, General Electric Power, (March 2016) + +Contributor + Hrvoje Jasak, Wikki Ltd. + +GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpOverlapGgiFvPatchFieldsFwd_H +#define jumpOverlapGgiFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class jumpOverlapGgiFvPatchField; + +makePatchTypeFieldTypedefs(jumpOverlapGgi) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/mixingPlane/mixingPlaneFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/mixingPlane/mixingPlaneFvPatchField.C index 47f1202f0..b9642cfbd 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/mixingPlane/mixingPlaneFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/mixingPlane/mixingPlaneFvPatchField.C @@ -522,10 +522,10 @@ void mixingPlaneFvPatchField::initEvaluate template void mixingPlaneFvPatchField::evaluate ( - const Pstream::commsTypes + const Pstream::commsTypes commsTypes ) { - fvPatchField::evaluate(); + coupledFvPatchField::evaluate(commsTypes); } diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/overlapGgi/overlapGgiFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/overlapGgi/overlapGgiFvPatchField.H index 144ed833f..fbf55ab36 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/overlapGgi/overlapGgiFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/overlapGgi/overlapGgiFvPatchField.H @@ -125,6 +125,14 @@ public: // Member functions + //- Access + + // Return overlapGgiFvPatch + const overlapGgiFvPatch& overlapGgiPatch() const + { + return overlapGgiPatch_; + } + // Evaluation functions diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 1297f150b..9fda3c5f0 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -29,6 +29,7 @@ derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.C derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.C +derivedFvPatchFields/overlapGgiEnthalpyJump/overlapGgiEnthalpyJumpFvPatchFields.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C index c1d842c6b..d118ca8bf 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C @@ -116,13 +116,15 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs() ) { // Get access to relative and rotational velocity - const word UrelName("Urel"); - const word UrotName("Urot"); + const word UName("U"); + const word URotName("URot"); + const word UThetaName("UTheta"); if ( - !this->db().objectRegistry::found(UrelName) - || !this->db().objectRegistry::found(UrotName) + !this->db().objectRegistry::found(URotName) + || !this->db().objectRegistry::found(UName) + || !this->db().objectRegistry::found(UThetaName) ) { // Velocities not available, do not update @@ -130,8 +132,9 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs() ( "void gradientEnthalpyFvPatchScalarField::" "updateCoeffs(const vectorField& Up)" - ) << "Velocity fields " << UrelName << " or " - << UrotName << " not found. " + ) << "Velocity fields " << UName << " or " + << URotName << " or " + << UThetaName << " not found. " << "Performing enthalpy value update for field " << this->dimensionedInternalField().name() << " and patch " << patchi @@ -141,16 +144,20 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs() } else { - const fvPatchVectorField& Urelp = - lookupPatchField(UrelName); + const fvPatchVectorField& Up = + lookupPatchField(UName); - const fvPatchVectorField& Urotp = - lookupPatchField(UrotName); + const fvPatchVectorField& URotp = + lookupPatchField(URotName); + + const fvPatchScalarField& UThetap = + lookupPatchField(UThetaName); operator== ( thermo.h(Tw, patchi) - - 0.5*(magSqr(Urotp) - magSqr(Urelp)) + + 0.5*magSqr(Up) + - mag(UThetap)*mag(URotp) ); } } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.C index 9a6800ec2..a775fd045 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.H index d70db6233..992e7b901 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchField.H @@ -32,6 +32,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.C b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.C index 93b9bb62f..323be24ec 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved @@ -58,13 +59,15 @@ void Foam::ggiEnthalpyJumpFvPatchField::updateCoeffs() } // Get access to relative and rotational velocity - const word UrelName("Urel"); - const word UName("U"); + const word URotName("URot"); + const word UThetaName("UTheta"); + + jump_ = 0; if ( - !this->db().objectRegistry::found(UrelName) - || !this->db().objectRegistry::found(UName) + !this->db().objectRegistry::found(URotName) + || !this->db().objectRegistry::found(UThetaName) ) { // Velocities not available, do not update @@ -72,31 +75,37 @@ void Foam::ggiEnthalpyJumpFvPatchField::updateCoeffs() ( "void gradientEnthalpyFvPatchScalarField::" "updateCoeffs(const vectorField& Up)" - ) << "Velocity fields " << UrelName << " or " - << UName << " not found. " + ) << "Velocity fields " << URotName << " or " + << UThetaName << " not found. " << "Performing enthalpy value update" << endl; jump_ = 0; } else { - const fvPatchVectorField& Urelp = - lookupPatchField(UrelName); + const fvPatchVectorField& URotp = + lookupPatchField(URotName); - const fvPatchVectorField& Up = - lookupPatchField(UName); + const fvPatchScalarField& UThetap = + lookupPatchField(UThetaName); if (rotating_) { - jump_ = - mag(Up.patchInternalField())*mag(Urelp.patchInternalField()) - - magSqr(Up.patchInternalField()); + const scalarField UThetaIn = UThetap.patchInternalField(); + + jump_ = - ( + mag(UThetaIn) + *mag(URotp.patchInternalField()) + ); } else { - jump_ = - mag(Up.patchNeighbourField())*mag(Urelp.patchNeighbourField()) - - magSqr(Up.patchNeighbourField()); + const scalarField UThetaIn = UThetap.patchNeighbourField(); + + jump_ = ( + mag(UThetaIn) + *mag(URotp.patchNeighbourField()) + ); } } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.H b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.H index 4666e4bfd..cbc0f92a1 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFields.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFieldsFwd.H b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFieldsFwd.H index 3135b1096..e9e6bbf39 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFieldsFwd.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/ggiEnthalpyJump/ggiEnthalpyJumpFvPatchFieldsFwd.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C index df190b610..529ae6560 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C @@ -122,13 +122,15 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs() ) { // Get access to relative and rotational velocity - const word UrelName("Urel"); - const word UrotName("Urot"); + const word UName("U"); + const word URotName("URot"); + const word UThetaName("UTheta"); if ( - !this->db().objectRegistry::found(UrelName) - || !this->db().objectRegistry::found(UrotName) + !this->db().objectRegistry::found(UName) + || !this->db().objectRegistry::found(URotName) + || !this->db().objectRegistry::found(UThetaName) ) { // Velocities not available, do not update @@ -136,8 +138,9 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs() ( "void gradientEnthalpyFvPatchScalarField::" "updateCoeffs(const vectorField& Up)" - ) << "Velocity fields " << UrelName << " or " - << UrotName << " not found. " + ) << "Velocity fields " << UName << " or " + << URotName << " or " + << UThetaName << " not found. " << "Performing enthalpy value update for field " << this->dimensionedInternalField().name() << " and patch " << patchi @@ -152,11 +155,14 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs() } else { - const fvPatchVectorField& Urelp = - lookupPatchField(UrelName); + const fvPatchVectorField& Up = + lookupPatchField(UName); - const fvPatchVectorField& Urotp = - lookupPatchField(UrotName); + const fvPatchVectorField& URotp = + lookupPatchField(URotName); + + const fvPatchScalarField& UThetap = + lookupPatchField(UThetaName); gradient() = thermo.Cp(Tw, patchi)*Tw.snGrad() + patch().deltaCoeffs()* @@ -164,8 +170,8 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs() thermo.h(Tw, patchi) - thermo.h(Tw, patch().faceCells()) ) - - mag(Urotp)*mag(Urotp.snGrad()) - + mag(Urelp)*mag(Urelp.snGrad()); + + 0.5*mag(Up)*mag(Up.snGrad()) + - mag(UThetap)*mag(URotp.snGrad()); } } else diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C index 476226256..78eeed605 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C @@ -131,13 +131,15 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() ) { // Get access to relative and rotational velocity - const word UrelName("Urel"); - const word UrotName("Urot"); + const word UName("U"); + const word URotName("URot"); + const word UThetaName("UTheta"); if ( - !this->db().objectRegistry::found(UrelName) - || !this->db().objectRegistry::found(UrotName) + !this->db().objectRegistry::found(UName) + || !this->db().objectRegistry::found(URotName) + || !this->db().objectRegistry::found(UThetaName) ) { // Velocities not available, do not update @@ -145,8 +147,9 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() ( "void gradientEnthalpyFvPatchScalarField::" "updateCoeffs(const vectorField& Up)" - ) << "Velocity fields " << UrelName << " or " - << UrotName << " not found. " + ) << "Velocity fields " << UName << " or " + << URotName << " or " + << UThetaName << " not found. " << "Performing enthalpy value update for field " << this->dimensionedInternalField().name() << " and patch " << patchi @@ -162,14 +165,18 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() } else { - const fvPatchVectorField& Urelp = - lookupPatchField(UrelName); + const fvPatchVectorField& Up = + lookupPatchField(UName); - const fvPatchVectorField& Urotp = - lookupPatchField(UrotName); + const fvPatchVectorField& URotp = + lookupPatchField(URotName); + + const fvPatchScalarField& UThetap = + lookupPatchField(UThetaName); refValue() = thermo.h(Tw.refValue(), patchi) - - 0.5*(magSqr(Urotp) - magSqr(Urelp)); + + 0.5*magSqr(Up) + - mag(UThetap)*mag(URotp); refGrad() = thermo.Cp(Tw, patchi)*Tw.refGrad() + patch().deltaCoeffs()* @@ -177,8 +184,8 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs() thermo.h(Tw, patchi) - thermo.h(Tw, patch().faceCells()) ) - - mag(Urotp)*mag(Urotp.snGrad()) - + mag(Urelp)*mag(Urelp.snGrad()); + + 0.5*mag(Up)*mag(Up.snGrad()) + - mag(UThetap)*mag(URotp.snGrad()); } } else diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.C index da4210d8d..1365b5cba 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.H index 4cc8d1855..5666844ea 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchField.H @@ -32,6 +32,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.C index 3e69083b9..1acc99744 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.C @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved @@ -58,13 +59,15 @@ void Foam::mixingPlaneEnthalpyJumpFvPatchField::updateCoeffs() } // Get access to relative and rotational velocity - const word UrelName("Urel"); - const word UName("U"); + const word URotName("URot"); + const word UThetaName("UTheta"); + + jump_ = 0; if ( - !this->db().objectRegistry::found(UrelName) - || !this->db().objectRegistry::found(UName) + !this->db().objectRegistry::found(URotName) + || !this->db().objectRegistry::found(UThetaName) ) { // Velocities not available, do not update @@ -72,31 +75,40 @@ void Foam::mixingPlaneEnthalpyJumpFvPatchField::updateCoeffs() ( "void gradientEnthalpyFvPatchScalarField::" "updateCoeffs(const vectorField& Up)" - ) << "Velocity fields " << UrelName << " or " - << UName << " not found. " + ) << "Velocity fields " << URotName << " or " + << UThetaName << " not found. " << "Performing enthalpy value update" << endl; jump_ = 0; } else { - const fvPatchVectorField& Urelp = - lookupPatchField(UrelName); + const fvPatchVectorField& URotp = + lookupPatchField(URotName); - const fvPatchVectorField& Up = - lookupPatchField(UName); + const fvPatchScalarField& UThetap = + lookupPatchField(UThetaName); if (rotating_) { - jump_ = - mag(Up.patchInternalField())*mag(Urelp.patchInternalField()) - - magSqr(Up.patchInternalField()); + // We can either make jump_ on neighbour field and interpolate (in + // jumpOverlapGgi) or interpolate first, then add jump_ for + // internalField + const scalarField UThetaIn = UThetap.patchInternalField(); + + jump_ = - ( + mag(UThetaIn) + *mag(URotp.patchInternalField()) + ); } else { - jump_ = - mag(Up.patchNeighbourField())*mag(Urelp.patchNeighbourField()) - - magSqr(Up.patchNeighbourField()); + const scalarField UThetaIn = UThetap.patchNeighbourField(); + + jump_ = ( + mag(UThetaIn) + *mag(URotp.patchNeighbourField()) + ); } } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.H b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.H index c9ea78be3..fe80c6e3b 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFields.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFieldsFwd.H b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFieldsFwd.H index c82d4355b..b23f0b362 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFieldsFwd.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixingPlaneEnthalpyJump/mixingPlaneEnthalpyJumpFvPatchFieldsFwd.H @@ -26,6 +26,7 @@ Author Contributor Hrvoje Jasak, Wikki Ltd. + Gregor Cvijetic, FMENA Zagreb. GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved