From 9c039e438a54ebceebda885d6f4b2ee612c4a38d Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:15:51 +0100 Subject: [PATCH 01/26] ENH: Moved temperatureJump boundary condition from finiteVolume library to thermo library --- src/thermophysicalModels/basic/Make/files | 1 + .../temperatureJump/temperatureJumpFvPatchScalarField.C | 1 - .../temperatureJump/temperatureJumpFvPatchScalarField.H | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) rename src/{finiteVolume/fields/fvPatchFields/derived => thermophysicalModels/basic/derivedFvPatchFields}/temperatureJump/temperatureJumpFvPatchScalarField.C (99%) rename src/{finiteVolume/fields/fvPatchFields/derived => thermophysicalModels/basic/derivedFvPatchFields}/temperatureJump/temperatureJumpFvPatchScalarField.H (98%) diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 3dc3d0c082..3ec888d37a 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -11,6 +11,7 @@ derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C +derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C similarity index 99% rename from src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C rename to src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C index 99be42e3d6..0ace9a70e4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C @@ -103,7 +103,6 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const { fixedJumpFvPatchField::write(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H similarity index 98% rename from src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H rename to src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H index 0663a1cb86..bdb39e961f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H @@ -29,7 +29,7 @@ Group Description This boundary condition provides a temperature jump condition across a - coupled pair of cyclic patches. + coupled pair of cyclic patches when solving for energy. The jump is specified as a \c DataEntry type, to enable the use of, e.g. contant, polynomial, table values. @@ -61,6 +61,7 @@ Note SeeAlso Foam::fixedJumpFvPatchField + Foam::energyJumpFvPatchScalarField SourceFiles temperatureJumpFvPatchScalarField.C From bcff8bded63a38bde88b5ebfa52f6b7fb51cc1cc Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:17:33 +0100 Subject: [PATCH 02/26] ENH: Added new jumpCyclicAMI constraint boundary condition --- .../jumpCyclicAMI/jumpCyclicAMIFvPatchField.C | 201 ++++++++++++++++++ .../jumpCyclicAMI/jumpCyclicAMIFvPatchField.H | 165 ++++++++++++++ .../jumpCyclicAMIFvPatchFields.C | 43 ++++ .../jumpCyclicAMIFvPatchFields.H | 49 +++++ .../jumpCyclicAMIFvPatchFieldsFwd.H | 50 +++++ 5 files changed, 508 insertions(+) create mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H create mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C create mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H create mode 100644 src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C new file mode 100644 index 0000000000..87d7c20efd --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C @@ -0,0 +1,201 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "jumpCyclicAMIFvPatchField.H" +#include "transformField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + cyclicAMIFvPatchField(p, iF) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicAMIFvPatchField(ptf, p, iF, mapper) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + cyclicAMIFvPatchField(p, iF, dict) +{ + // Call this evaluation in derived classes + //this->evaluate(Pstream::blocking); +} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf +) +: + cyclicAMIFvPatchField(ptf) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + cyclicAMIFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::jumpCyclicAMIFvPatchField::patchNeighbourField() const +{ + const Field& iField = this->internalField(); + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field pnf(iField, nbrFaceCells); + tmp > tpnf + ( + new Field(this->cyclicAMIPatch().interpolate(pnf)) + ); + + if (this->doTransform()) + { + tpnf = transform(this->forwardT(), tpnf); + } + + tmp > tjf = jump(); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + + return tpnf - tjf; +} + + +template +void Foam::jumpCyclicAMIFvPatchField::updateInterfaceMatrix +( + scalarField& result, + const scalarField& psiInternal, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes +) const +{ + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + scalarField pnf(psiInternal, nbrFaceCells); + + pnf = this->cyclicAMIPatch().interpolate(pnf); + + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) + { + tmp > tjf = jump()().component(cmpt); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + pnf -= tjf; + } + + // Transform according to the transformation tensors + this->transformCoupleField(pnf, cmpt); + + // Multiply the field by coefficients and add into the result + const labelUList& faceCells = this->cyclicAMIPatch().faceCells(); + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } +} + + +template +void Foam::jumpCyclicAMIFvPatchField::updateInterfaceMatrix +( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes +) const +{ + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field pnf(psiInternal, nbrFaceCells); + + pnf = this->cyclicAMIPatch().interpolate(pnf); + + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) + { + tmp > tjf = jump(); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + pnf -= tjf; + } + + // Transform according to the transformation tensors + this->transformCoupleField(pnf); + + // Multiply the field by coefficients and add into the result + const labelUList& faceCells = this->cyclicAMIPatch().faceCells(); + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H new file mode 100644 index 0000000000..6759b09a36 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::jumpCyclicAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a base class that enforces a cyclic + condition with a specified 'jump' (or offset) between a pair of boundaries, + whereby communication between the patches is performed using an arbitrary + mesh interface (AMI) interpolation. + +SeeAlso + Foam::cyclicAMIFvPatchField + +SourceFiles + jumpCyclicAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchField_H +#define jumpCyclicAMIFvPatchField_H + +#include "cyclicAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class jumpCyclicAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class jumpCyclicAMIFvPatchField +: + public cyclicAMIFvPatchField +{ + +public: + + //- Runtime type information + TypeName("jumpCyclicAMI"); + + + // Constructors + + //- Construct from patch and internal field + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given jumpCyclicAMIFvPatchField onto a + // new patch + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField& + ); + + //- Construct as copy setting internal field reference + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField&, + const DimensionedField& + ); + + + // Member functions + + // Access + + //- Return the interface type + virtual const word& interfaceFieldType() const + { + return cyclicAMIFvPatchField::type(); + } + + //- Return the "jump" across the patch as a "half" field + virtual tmp > jump() const = 0; + + + // Evaluation functions + + //- Return neighbour coupled given internal cell data + tmp > patchNeighbourField() const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + scalarField& result, + const scalarField& psiInternal, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType + ) const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + Field&, + const Field&, + const scalarField&, + const Pstream::commsTypes commsType + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "jumpCyclicAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C new file mode 100644 index 0000000000..323f460d9f --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "jumpCyclicAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFieldsTypeName(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H new file mode 100644 index 0000000000..6f5039e0bc --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchFields_H +#define jumpCyclicAMIFvPatchFields_H + +#include "jumpCyclicAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000..c4bc6547b0 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchFieldsFwd_H +#define jumpCyclicAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class jumpCyclicAMIFvPatchField; + +makePatchTypeFieldTypedefs(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 682b59e9c3d234c97f46dcea9ab520d938827688 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:18:00 +0100 Subject: [PATCH 03/26] ENH: Added new fixedJumpAMI boundary condition --- src/finiteVolume/Make/files | 46 ++--- .../fixedJumpAMI/fixedJumpAMIFvPatchField.C | 129 ++++++++++++ .../fixedJumpAMI/fixedJumpAMIFvPatchField.H | 186 ++++++++++++++++++ .../fixedJumpAMI/fixedJumpAMIFvPatchFields.C | 43 ++++ .../fixedJumpAMI/fixedJumpAMIFvPatchFields.H | 49 +++++ .../fixedJumpAMIFvPatchFieldsFwd.H | 50 +++++ 6 files changed, 480 insertions(+), 23 deletions(-) create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index d13d012468..b06aa0b259 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -114,66 +114,66 @@ derivedFvPatchFields = $(fvPatchFields)/derived $(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/advective/advectiveFvPatchFields.C -$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C +$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C -$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C -$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C +$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C +$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C -$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C -$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/fixedJumpAMI/fixedJumpAMIFvPatchFields.C +$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C $(derivedFvPatchFields)/freestream/freestreamFvPatchFields.C $(derivedFvPatchFields)/freestreamPressure/freestreamPressureFvPatchScalarField.C $(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C $(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C -$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C +$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C $(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C +$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C $(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C +$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/slip/slipFvPatchFields.C $(derivedFvPatchFields)/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/AverageIOFields.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C +$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C $(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C -$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C -$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C -$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C -$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C -$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/temperatureJump/temperatureJumpFvPatchScalarField.C +$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C +$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C fvsPatchFields = fields/fvsPatchFields $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C new file mode 100644 index 0000000000..ec60f11bc2 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "fixedJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + jumpCyclicAMIFvPatchField(p, iF), + jump_(this->size(), pTraits::zero) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + jumpCyclicAMIFvPatchField(ptf, p, iF, mapper), + jump_(ptf.jump_, mapper) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + jumpCyclicAMIFvPatchField(p, iF), + jump_("jump", dict, p.size()) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf +) +: + jumpCyclicAMIFvPatchField(ptf), + jump_(ptf.jump_) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + jumpCyclicAMIFvPatchField(ptf, iF), + jump_(ptf.jump_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::fixedJumpAMIFvPatchField::autoMap +( + const fvPatchFieldMapper& m +) +{ + jumpCyclicAMIFvPatchField::autoMap(m); + jump_.autoMap(m); +} + + +template +void Foam::fixedJumpAMIFvPatchField::rmap +( + const fvPatchField& ptf, + const labelList& addr +) +{ + jumpCyclicAMIFvPatchField::rmap(ptf, addr); + + const fixedJumpAMIFvPatchField& tiptf = + refCast >(ptf); + jump_.rmap(tiptf.jump_, addr); +} + + +template +void Foam::fixedJumpAMIFvPatchField::write(Ostream& os) const +{ + fvPatchField::write(os); + os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl; + jump_.writeEntry("jump", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H new file mode 100644 index 0000000000..d785ad5289 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::fixedJumpAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +SeeAlso + Foam::jumpCyclicAMIFvPatchField + +SourceFiles + fixedJumpAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchField_H +#define fixedJumpAMIFvPatchField_H + +#include "jumpCyclicAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class fixedJumpAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class fixedJumpAMIFvPatchField +: + public jumpCyclicAMIFvPatchField +{ + +protected: + + // Protected data + + //- "jump" field + Field jump_; + + +public: + + //- Runtime type information + TypeName("fixedJumpAMI"); + + + // Constructors + + //- Construct from patch and internal field + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given fixedJumpAMIFvPatchField onto a + // new patch + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new fixedJumpAMIFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new fixedJumpAMIFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp > jump() const + { + if (this->cyclicAMIPatch().owner()) + { + return jump_; + } + else + { + tmp > nbrJump = + refCast > + ( + this->neighbourPatchField() + ).jump(); + + return this->cyclicAMIPatch().interpolate(nbrJump); + } + } + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap(const fvPatchField&, const labelList&); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "fixedJumpAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C new file mode 100644 index 0000000000..c28877d601 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "fixedJumpAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H new file mode 100644 index 0000000000..b0da67335a --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchFields_H +#define fixedJumpAMIFvPatchFields_H + +#include "fixedJumpAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000..9231539cf3 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchFieldsFwd_H +#define fixedJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class fixedJumpAMIFvPatchField; + +makePatchTypeFieldTypedefs(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 33086285d35874b4a4371127b7a2a698557c1740 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:18:48 +0100 Subject: [PATCH 04/26] STYLE: minor code formatting updates --- .../energyJump/energyJumpFvPatchScalarField.C | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C index d3ba1becdd..400914aac4 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C @@ -103,10 +103,8 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() if (this->cyclicPatch().owner()) { - const basicThermo& thermo = db().lookupObject - ( - "thermophysicalProperties" - ); + const basicThermo& thermo = + db().lookupObject("thermophysicalProperties"); label patchID = patch().index(); @@ -120,7 +118,8 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() const scalar time = this->db().time().value(); const scalarField jumpTb ( - patch().size(), TbPatch.jumpTable().value(time) + patch().size(), + TbPatch.jumpTable().value(time) ); const labelUList& faceCells = this->patch().faceCells(); From f582fab6dd6e91addc3a2f4cb44131fc317b6ea6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:52:56 +0100 Subject: [PATCH 05/26] ENH: re-worked temperature/energy jumps --- .../energyJump/energyJumpFvPatchScalarField.C | 10 +--------- .../temperatureJumpFvPatchScalarField.C | 12 +++++++++++- .../temperatureJumpFvPatchScalarField.H | 3 +++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C index 400914aac4..750252d4bc 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C @@ -77,7 +77,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField const energyJumpFvPatchScalarField& ptf ) : - cyclicLduInterfaceField(), fixedJumpFvPatchField(ptf) {} @@ -115,16 +114,9 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() thermo.T().boundaryField()[patchID] ); - const scalar time = this->db().time().value(); - const scalarField jumpTb - ( - patch().size(), - TbPatch.jumpTable().value(time) - ); - const labelUList& faceCells = this->patch().faceCells(); - jump_ = thermo.he(pp, jumpTb, faceCells); + jump_ = thermo.he(pp, TbPatch.jump(), faceCells); } fixedJumpFvPatchField::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C index 0ace9a70e4..22828d79c7 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C @@ -84,7 +84,6 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField const temperatureJumpFvPatchScalarField& ptf ) : - cyclicLduInterfaceField(), fixedJumpFvPatchField(ptf), jumpTable_(ptf.jumpTable_().clone().ptr()) {} @@ -103,6 +102,17 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +Foam::tmp +Foam::temperatureJumpFvPatchScalarField::jump() const +{ + const scalar time = this->db().time().value(); + + tmp tj(new scalarField(this->size(), jumpTable_->value(time))); + + return tj; +} + + void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const { fixedJumpFvPatchField::write(os); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H index bdb39e961f..b99020189b 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H @@ -166,6 +166,9 @@ public: // Access functions + //- Return a field of the temperature jump + virtual tmp jump() const; + //- Return jumpTable const DataEntry& jumpTable() const { From 26d6f801bf26678e8fcd29dcfb3d27f9877ca095 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 16:46:23 +0100 Subject: [PATCH 06/26] ENH: Updated fixedJump BCs to enable general types (was only for scalar) --- src/finiteVolume/Make/files | 1 + .../jumpCyclic/jumpCyclicFvPatchField.C | 10 ++-- .../derived/fixedJump/fixedJumpFvPatchField.H | 3 ++ .../fixedJump/fixedJumpFvPatchFields.C | 43 ++++++++++++++++ .../fixedJump/fixedJumpFvPatchFields.H | 49 ++++++++++++++++++ .../fixedJump/fixedJumpFvPatchFieldsFwd.H | 50 +++++++++++++++++++ 6 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index b06aa0b259..3e210a8530 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -122,6 +122,7 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/fixedJump/fixedJumpFvPatchFields.C $(derivedFvPatchFields)/fixedJumpAMI/fixedJumpAMIFvPatchFields.C $(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index 193008daff..67bc7f96db 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -105,12 +105,12 @@ tmp > jumpCyclicFvPatchField::patchNeighbourField() const tmp > tpnf(new Field(this->size())); Field& pnf = tpnf(); - tmp > tjf = jump(); + tmp > tjf = jump(); if (!this->cyclicPatch().owner()) { tjf = -tjf; } - const Field& jf = tjf(); + const Field& jf = tjf(); if (this->doTransform()) { @@ -149,7 +149,8 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix const labelUList& nbrFaceCells = this->cyclicPatch().neighbFvPatch().faceCells(); - if (&psiInternal == &this->internalField()) + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) { tmp > tjf = jump()().component(cmpt); if (!this->cyclicPatch().owner()) @@ -197,7 +198,8 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix const labelUList& nbrFaceCells = this->cyclicPatch().neighbFvPatch().faceCells(); - if (&psiInternal == &this->internalField()) + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) { tmp > tjf = jump(); if (!this->cyclicPatch().owner()) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index 30ec57fc54..1beef6b3b1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -72,6 +72,9 @@ protected: public: + //- Runtime type information + TypeName("fixedJump"); + // Constructors //- Construct from patch and internal field diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C new file mode 100644 index 0000000000..b06849691a --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "fixedJumpFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H new file mode 100644 index 0000000000..444d3259bd --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpFvPatchFields_H +#define fixedJumpFvPatchFields_H + +#include "fixedJumpFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H new file mode 100644 index 0000000000..97a42cfa46 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpFvPatchFieldsFwd_H +#define fixedJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class fixedJumpFvPatchField; + +makePatchTypeFieldTypedefs(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From bb4cde58e33be072bea8fb528c4453ed8cb5a933 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 17:20:22 +0100 Subject: [PATCH 07/26] ENH: Updates to temperature jump BC --- .../temperatureJump/temperatureJumpFvPatchScalarField.C | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C index 22828d79c7..ad33df0ddd 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C @@ -61,12 +61,11 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField ) : fixedJumpFvPatchField(p, iF), - jumpTable_(new DataEntry("jumpTable")) + jumpTable_(0) { - if (this->cyclicPatch().owner()) { - jumpTable_ = DataEntry::New("jumpTable", dict); + jumpTable_ = DataEntry::New("jumpTable", dict); } if (dict.found("value")) From 4ae2006824dac8802089897e36a4fb544d043494 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 24 Oct 2012 17:22:51 +0100 Subject: [PATCH 08/26] rhoCentralFoam: Updated energy equation --- .../solvers/compressible/rhoCentralFoam/rhoCentralFoam.C | 3 --- 1 file changed, 3 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 063aaa4fb5..84a122d0dd 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -228,13 +228,10 @@ int main(int argc, char *argv[]) if (!inviscid) { - volScalarField k("k", thermo.Cp()*muEff/Pr); solve ( fvm::ddt(rho, e) - fvc::ddt(rho, e) - fvm::laplacian(turbulence->alphaEff(), e) - + fvc::laplacian(turbulence->alpha(), e) - - fvc::laplacian(k, T) ); thermo.correct(); rhoE = rho*(e + 0.5*magSqr(U)); From 54842e87aae2dede9239b867554efd5ca2b4d949 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 24 Oct 2012 17:24:12 +0100 Subject: [PATCH 09/26] twoLiquidMixingFoam: Converted to using MULES and sub-cycling for alpha1 Operator-splitting is used for the diffusion --- .../twoLiquidMixingFoam/Make/options | 1 + .../multiphase/twoLiquidMixingFoam/alphaEqn.H | 22 +++++++++---------- .../twoLiquidMixingFoam/twoLiquidMixingFoam.C | 12 ++++++---- .../lockExchange/system/controlDict | 1 + .../lockExchange/system/fvSolution | 3 ++- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index c8ce69c074..6e20519ec9 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I../interFoam \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index d152baba0b..c68a0e56c5 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -1,22 +1,22 @@ { - fvScalarMatrix alpha1Eqn + word alphaScheme("div(phi,alpha1)"); + + surfaceScalarField phiAlpha ( - fvm::ddt(alpha1) - + fvm::div(phi, alpha1) - - fvm::laplacian + fvc::flux ( - Dab + alphatab*turbulence->nut(), alpha1, - "laplacian(Dab,alpha1)" + phi, + alpha1, + alphaScheme ) ); - alpha1Eqn.solve(); + MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); - rhoPhi = alpha1Eqn.flux()*(rho1 - rho2) + phi*rho2; - rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; + rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; - Info<< "Phase 1 volume fraction = " - << alpha1.weightedAverage(mesh.V()).value() + Info<< "Phase-1 volume fraction = " + << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 8a2b20e153..22c709c960 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -32,6 +32,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "MULES.H" +#include "subCycle.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" @@ -60,19 +62,21 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" #include "CourantNo.H" + #include "alphaCourantNo.H" #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + #include "alphaDiffusionEqn.H" + // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { - twoPhaseProperties.correct(); - - #include "alphaEqn.H" - #include "UEqn.H" // --- Pressure corrector loop diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict index 13e3d95fac..d8e11662d8 100644 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict @@ -48,6 +48,7 @@ runTimeModifiable yes; adjustTimeStep on; maxCo 0.5; +maxAlphaCo 0.5; maxDeltaT 1; // ************************************************************************* // diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution index a4e4e913ec..19d27d99be 100644 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution @@ -21,7 +21,7 @@ solvers { solver smoothSolver; smoother GaussSeidel; - tolerance 1e-7; + tolerance 1e-9; relTol 0; nSweeps 1; } @@ -66,6 +66,7 @@ PIMPLE nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; + nAlphaSubCycles 2; pRefValue 0; pRefPoint (0.1 0.1 1); } From 766abbc075bf0810d4741f4af940feb64b0a9594 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 24 Oct 2012 17:25:00 +0100 Subject: [PATCH 10/26] multiphase solver: Update and rationalize the alphaEqnSubCycling.H --- .../compressibleInterFoam/alphaEqnsSubCycle.H | 8 +--- .../alphaEqnsSubCycle.H | 40 ------------------- .../compressibleInterDyMFoam.C | 6 +++ .../compressibleInterFoam.C | 6 +++ .../interFoam/LTSInterFoam/LTSInterFoam.C | 1 + .../interFoam/LTSInterFoam/alphaEqn.H | 4 +- .../interFoam/LTSInterFoam/alphaEqnSubCycle.H | 9 +---- .../interFoam/MRFInterFoam/MRFInterFoam.C | 1 + .../multiphase/interFoam/alphaEqnSubCycle.H | 2 - .../interFoam/interDyMFoam/interDyMFoam.C | 1 + .../solvers/multiphase/interFoam/interFoam.C | 2 +- .../porousInterFoam/porousInterFoam.C | 1 + .../interMixingFoam/alphaEqnsSubCycle.H | 2 - .../interMixingFoam/interMixingFoam.C | 1 + .../interPhaseChangeFoam/alphaEqnSubCycle.H | 5 --- .../interPhaseChangeFoam.C | 5 +++ .../twoLiquidMixingFoam/twoLiquidMixingFoam.C | 2 +- 17 files changed, 29 insertions(+), 67 deletions(-) delete mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H index 2d70a5bab5..be34ab52ed 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H @@ -6,7 +6,7 @@ surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - volScalarField divU(fvc::div(phi)); + volScalarField divU(fvc::div(fvc::absolute(phi, U))); if (nAlphaSubCycles > 1) { @@ -29,10 +29,4 @@ { #include "alphaEqns.H" } - - // correct interface on first PIMPLE corrector - if (pimple.corr() == 1) - { - interface.correct(); - } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H deleted file mode 100644 index ade8af0081..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H +++ /dev/null @@ -1,40 +0,0 @@ -{ - label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); - - label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); - - surfaceScalarField phic(mag(phi/mesh.magSf())); - phic = min(interface.cAlpha()*phic, max(phic)); - - fvc::makeAbsolute(phi, U); - volScalarField divU(fvc::div(phi)); - fvc::makeRelative(phi, U); - - if (nAlphaSubCycles > 1) - { - dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum(0.0*rhoPhi); - - for - ( - subCycle alphaSubCycle(alpha1, nAlphaSubCycles); - !(++alphaSubCycle).end(); - ) - { - #include "alphaEqns.H" - rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; - } - - rhoPhi = rhoPhiSum; - } - else - { - #include "alphaEqns.H" - } - - // correct interface on first PIMPLE corrector - if (pimple.corr() == 1) - { - interface.correct(); - } -} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index b9f52944e8..acf563fc8e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -122,6 +122,12 @@ int main(int argc, char *argv[]) { #include "alphaEqnsSubCycle.H" + // correct interface on first PIMPLE corrector + if (pimple.corr() == 1) + { + interface.correct(); + } + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); #include "UEqn.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 7c24e05a1a..54c246f203 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -80,6 +80,12 @@ int main(int argc, char *argv[]) { #include "alphaEqnsSubCycle.H" + // correct interface on first PIMPLE corrector + if (pimple.corr() == 1) + { + interface.correct(); + } + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); #include "UEqn.H" diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 06811c2191..c1d9630a00 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -77,6 +77,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); turbulence->correct(); diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index 0c2cf71e4e..5f5ac824b8 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H @@ -30,8 +30,8 @@ rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; } - Info<< "Liquid phase volume fraction = " - << alpha1.weightedAverage(mesh.V()).value() + Info<< "Phase-1 volume fraction = " + << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index b59b0ae5fe..6c82f94049 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -1,8 +1,5 @@ -const dictionary& pimpleDict = pimple.dict(); - -label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); - -label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); +label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); +label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { @@ -26,6 +23,4 @@ else #include "alphaEqn.H" } -interface.correct(); - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 042a17e1f3..6d2ad224b4 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -81,6 +81,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); #include "zonePhaseVolumes.H" // --- Pressure-velocity PIMPLE corrector loop diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index fa56de00bb..6c82f94049 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -23,6 +23,4 @@ else #include "alphaEqn.H" } -interface.correct(); - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 3d450a3917..730c535eff 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -114,6 +114,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 559916f2ce..20d2777ef5 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -43,7 +43,6 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" -#include "interpolationTable.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,6 +81,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index 244ea75fae..795b7c14a1 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -83,6 +83,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H index d816f8aced..97a09ce017 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -24,8 +24,6 @@ else #include "alphaEqns.H" } -interface.correct(); - { volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3); diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C index d4b1194ba1..9f9095b407 100644 --- a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) threePhaseProperties.correct(); #include "alphaEqnsSubCycle.H" + interface.correct(); #define twoPhaseProperties threePhaseProperties diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index 6e02524e26..ad2cf243d2 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -40,10 +40,5 @@ surfaceScalarField rhoPhi #include "alphaEqn.H" } - if (pimple.nCorrPIMPLE() == 1) - { - interface.correct(); - } - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 5ed807bbad..59cb7f553e 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -82,6 +82,11 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" + if (pimple.nCorrPIMPLE() == 1) + { + interface.correct(); + } + turbulence->correct(); // --- Pressure-velocity PIMPLE corrector loop diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 22c709c960..6113aba01f 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From 6138cf6d475856d2ded1d8fed16e16b871c1024b Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 24 Oct 2012 17:25:12 +0100 Subject: [PATCH 11/26] Update headers --- .../solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C | 2 +- .../solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C | 2 +- .../solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C | 2 +- applications/solvers/multiphase/interFoam/interFoam.C | 2 +- .../solvers/multiphase/interMixingFoam/interMixingFoam.C | 2 +- .../multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index c1d9630a00..9d221b5ca9 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 6d2ad224b4..5cbbc0b3ab 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 730c535eff..ee92734509 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 20d2777ef5..69eb0964ce 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C index 9f9095b407..33647cd28d 100644 --- a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 59cb7f553e..00a7976a2e 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From 314c9475ff7cc5f92e923a14a26437e64d438e6a Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 24 Oct 2012 17:25:23 +0100 Subject: [PATCH 12/26] twoLiquidMixingFoam: Converted to using MULES and sub-cycling for alpha1 Operator-splitting is used for the diffusion --- .../twoLiquidMixingFoam/alphaDiffusionEqn.H | 18 +++++++++++++ .../twoLiquidMixingFoam/alphaEqnSubCycle.H | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H create mode 100644 applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H new file mode 100644 index 0000000000..139646e43c --- /dev/null +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H @@ -0,0 +1,18 @@ +{ + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + - fvc::ddt(alpha1) + - fvm::laplacian + ( + volScalarField("Dab", Dab + alphatab*turbulence->nut()), + alpha1 + ) + ); + + alpha1Eqn.solve(); + + rhoPhi += alpha1Eqn.flux()*(rho1 - rho2); +} + +rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H new file mode 100644 index 0000000000..6c82f94049 --- /dev/null +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H @@ -0,0 +1,26 @@ +label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); +label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); + +if (nAlphaSubCycles > 1) +{ + dimensionedScalar totalDeltaT = runTime.deltaT(); + surfaceScalarField rhoPhiSum(0.0*rhoPhi); + + for + ( + subCycle alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { + #include "alphaEqn.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; +} +else +{ + #include "alphaEqn.H" +} + +rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; From ae3b2d91920747bc47f54246e0d2a273feb92aa8 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 10:02:42 +0100 Subject: [PATCH 13/26] ENH: Updated fixedJump boundary conditions --- .../derived/fixedJump/fixedJumpFvPatchField.C | 17 ++++++++++++++++ .../derived/fixedJump/fixedJumpFvPatchField.H | 17 ++-------------- .../fixedJumpAMI/fixedJumpAMIFvPatchField.C | 20 +++++++++++++++++++ .../fixedJumpAMI/fixedJumpAMIFvPatchField.H | 20 ++----------------- 4 files changed, 41 insertions(+), 33 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index fd2050ffcc..6d692c4887 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -92,6 +92,23 @@ Foam::fixedJumpFvPatchField::fixedJumpFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::tmp > Foam::fixedJumpFvPatchField::jump() const +{ + if (this->cyclicPatch().owner()) + { + return jump_; + } + else + { + return refCast > + ( + this->neighbourPatchField() + ).jump(); + } +} + + template void Foam::fixedJumpFvPatchField::autoMap ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index 1beef6b3b1..ba2fdc9aeb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -141,21 +141,8 @@ public: // Access - //- Return the "jump" across the patch. - virtual tmp > jump() const - { - if (this->cyclicPatch().owner()) - { - return jump_; - } - else - { - return refCast > - ( - this->neighbourPatchField() - ).jump(); - } - } + //- Return the "jump" across the patch + virtual tmp > jump() const; // Mapping functions diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index ec60f11bc2..689981c20d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -91,6 +91,26 @@ Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::tmp > Foam::fixedJumpAMIFvPatchField::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + return jump_; + } + else + { + const fixedJumpAMIFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + template void Foam::fixedJumpAMIFvPatchField::autoMap ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H index d785ad5289..9e9d1a91d1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H @@ -135,24 +135,8 @@ public: // Access - //- Return the "jump" across the patch. - virtual tmp > jump() const - { - if (this->cyclicAMIPatch().owner()) - { - return jump_; - } - else - { - tmp > nbrJump = - refCast > - ( - this->neighbourPatchField() - ).jump(); - - return this->cyclicAMIPatch().interpolate(nbrJump); - } - } + //- Return the "jump" across the patch + virtual tmp > jump() const; // Mapping functions From e83621ba57dd4373ef80a186c1b6e04b9e5edf74 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 10:03:10 +0100 Subject: [PATCH 14/26] ENH: Added uniformJump boundary condition --- .../uniformJump/uniformJumpFvPatchField.C | 141 ++++++++++++++ .../uniformJump/uniformJumpFvPatchField.H | 180 ++++++++++++++++++ .../uniformJump/uniformJumpFvPatchFields.C | 43 +++++ .../uniformJump/uniformJumpFvPatchFields.H | 49 +++++ .../uniformJump/uniformJumpFvPatchFieldsFwd.H | 50 +++++ 5 files changed, 463 insertions(+) create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C new file mode 100644 index 0000000000..a5e268c730 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "uniformJumpFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedJumpFvPatchField(p, iF), + jumpTable_(0) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField(p, iF), + jumpTable_(0) +{ + if (this->cyclicPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField::operator= + ( + Field("value", dict, p.size()) + ); + } +} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf +) +: + fixedJumpFvPatchField(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf, + const DimensionedField& iF +) +: + fixedJumpFvPatchField(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > Foam::uniformJumpFvPatchField::jump() const +{ + if (this->cyclicPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp >(new Field(this->size(), j)); + } + else + { + const uniformJumpFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return nbrPatch.jump(); + } +} + + +template +void Foam::uniformJumpFvPatchField::write(Ostream& os) const +{ + fixedJumpFvPatchField::write(os); + if (this->cyclicPatch().owner()) + { + jumpTable_->writeData(os); + } + this->writeEntry("value", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H new file mode 100644 index 0000000000..d7e8706a59 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::uniformJumpFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + Uniform jump + +SeeAlso + Foam::jumpCyclicFvPatchField + +SourceFiles + uniformJumpFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchField_H +#define uniformJumpFvPatchField_H + +#include "fixedJumpFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformJumpFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class uniformJumpFvPatchField +: + public fixedJumpFvPatchField +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJump"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpFvPatchField onto a + // new patch + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformJumpFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformJumpFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp > jump() const; + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchField&, + const labelList& + ); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "uniformJumpFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C new file mode 100644 index 0000000000..489ab5f633 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "uniformJumpFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H new file mode 100644 index 0000000000..e28916c383 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchFields_H +#define uniformJumpFvPatchFields_H + +#include "uniformJumpFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H new file mode 100644 index 0000000000..e9bcac0bba --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchFieldsFwd_H +#define uniformJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class uniformJumpFvPatchField; + +makePatchTypeFieldTypedefs(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From e18b1ca7c065552fe5da0a475958e84dbbb66475 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 10:03:18 +0100 Subject: [PATCH 15/26] ENH: Added uniformJumpAMI boundary condition --- .../uniformJumpAMIFvPatchField.C | 139 ++++++++++++++ .../uniformJumpAMIFvPatchField.H | 180 ++++++++++++++++++ .../uniformJumpAMIFvPatchFields.C | 43 +++++ .../uniformJumpAMIFvPatchFields.H | 49 +++++ .../uniformJumpAMIFvPatchFieldsFwd.H | 50 +++++ 5 files changed, 461 insertions(+) create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C new file mode 100644 index 0000000000..d4ba13ad75 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "uniformJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(p, iF), + jumpTable_(0) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpAMIFvPatchField(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedJumpAMIFvPatchField(p, iF), + jumpTable_(0) +{ + if (this->cyclicAMIPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField::operator=(Field("value", dict, p.size())); + } +} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf +) +: + fixedJumpAMIFvPatchField(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::uniformJumpAMIFvPatchField::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp >(new Field(this->size(), j)); + } + else + { + const uniformJumpAMIFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + +template +void Foam::uniformJumpAMIFvPatchField::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField::write(os); + if (this->cyclicAMIPatch().owner()) + { + jumpTable_->writeData(os); + } + this->writeEntry("value", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H new file mode 100644 index 0000000000..ddd891dcad --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::uniformJumpAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + Uniform jump + +SeeAlso + Foam::jumpCyclicAMIFvPatchField + +SourceFiles + uniformJumpAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchField_H +#define uniformJumpAMIFvPatchField_H + +#include "fixedJumpAMIFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformJumpAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class uniformJumpAMIFvPatchField +: + public fixedJumpAMIFvPatchField +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpAMIFvPatchField onto a + // new patch + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformJumpAMIFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformJumpAMIFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp > jump() const; + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchField&, + const labelList& + ); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "uniformJumpAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C new file mode 100644 index 0000000000..f17f2849e8 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "uniformJumpAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H new file mode 100644 index 0000000000..0314210967 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchFields_H +#define uniformJumpAMIFvPatchFields_H + +#include "uniformJumpAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000..29080e7ec0 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchFieldsFwd_H +#define uniformJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class uniformJumpAMIFvPatchField; + +makePatchTypeFieldTypedefs(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From fe62b01a8584c4d6b0b5d07d8e3b744462e00d1a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 10:03:40 +0100 Subject: [PATCH 16/26] ENH: Updated Make/files for new jump boundary conditions --- src/finiteVolume/Make/files | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 3e210a8530..e9cf82b3d0 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -170,6 +170,8 @@ $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C $(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C +$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C +$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C $(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C $(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C From ee31016890a66654309da73563cd1cc1de8479ae Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 12:03:15 +0100 Subject: [PATCH 17/26] ENH: Moved temperature and energy jump Bcs into sub-folders --- .../energyJumpFvPatchScalarField.C | 0 .../energyJumpFvPatchScalarField.H | 0 .../temperatureJumpFvPatchScalarField.C | 137 ------------- .../temperatureJumpFvPatchScalarField.H | 191 ------------------ 4 files changed, 328 deletions(-) rename src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/{ => energyJump}/energyJumpFvPatchScalarField.C (100%) rename src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/{ => energyJump}/energyJumpFvPatchScalarField.H (100%) delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C similarity index 100% rename from src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H similarity index 100% rename from src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C deleted file mode 100644 index ad33df0ddd..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C +++ /dev/null @@ -1,137 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ 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 "addToRunTimeSelectionTable.H" -#include "temperatureJumpFvPatchScalarField.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedJumpFvPatchField(p, iF), - jumpTable_(0) -{} - - -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField -( - const temperatureJumpFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedJumpFvPatchField(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) -{} - - -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedJumpFvPatchField(p, iF), - jumpTable_(0) -{ - if (this->cyclicPatch().owner()) - { - jumpTable_ = DataEntry::New("jumpTable", dict); - } - - if (dict.found("value")) - { - fvPatchScalarField::operator= - ( - scalarField("value", dict, p.size()) - ); - } -} - - -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField -( - const temperatureJumpFvPatchScalarField& ptf -) -: - fixedJumpFvPatchField(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) -{} - - -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField -( - const temperatureJumpFvPatchScalarField& ptf, - const DimensionedField& iF -) -: - fixedJumpFvPatchField(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp -Foam::temperatureJumpFvPatchScalarField::jump() const -{ - const scalar time = this->db().time().value(); - - tmp tj(new scalarField(this->size(), jumpTable_->value(time))); - - return tj; -} - - -void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const -{ - fixedJumpFvPatchField::write(os); - if (this->cyclicPatch().owner()) - { - jumpTable_->writeData(os); - } - this->writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - temperatureJumpFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H deleted file mode 100644 index b99020189b..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.H +++ /dev/null @@ -1,191 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ 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 . - -Class - Foam::temperatureJumpFvPatchScalarField - -Group - grpCoupledBoundaryConditions - -Description - This boundary condition provides a temperature jump condition across a - coupled pair of cyclic patches when solving for energy. - - The jump is specified as a \c DataEntry type, to enable the use of, e.g. - contant, polynomial, table values. - - \heading Patch usage - - \table - Property | Description | Required | Default value - patchType | underlying patch type should be \c cyclic| yes | - jump | current jump value | yes | - jumpTable | jump data, e.g. \c csvFile | yes | - \endtable - - Example of the boundary condition specification: - \verbatim - myPatch - { - type temperatureJump; - patchType cyclic; - jumpTable constant 100; - value uniform 300; - } - \endverbatim - - The above example shows the use of a constant jump condition. - -Note - The underlying \c patchType should be set to \c cyclic - -SeeAlso - Foam::fixedJumpFvPatchField - Foam::energyJumpFvPatchScalarField - -SourceFiles - temperatureJumpFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef temperatureJumpFvPatchScalarField_H -#define temperatureJumpFvPatchScalarField_H - -#include "fixedJumpFvPatchField.H" -#include "DataEntry.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class temperatureJumpFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class temperatureJumpFvPatchScalarField -: - public fixedJumpFvPatchField -{ - - // Private data - - //- Interpolation table - autoPtr > jumpTable_; - - -public: - - //- Runtime type information - TypeName("temperatureJump"); - - // Constructors - - //- Construct from patch and internal field - temperatureJumpFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - temperatureJumpFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given temperatureJumpFvPatchScalarField onto a - // new patch - temperatureJumpFvPatchScalarField - ( - const temperatureJumpFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - temperatureJumpFvPatchScalarField - ( - const temperatureJumpFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp > clone() const - { - return tmp > - ( - new temperatureJumpFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - temperatureJumpFvPatchScalarField - ( - const temperatureJumpFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp > clone - ( - const DimensionedField& iF - ) const - { - return tmp > - ( - new temperatureJumpFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - - // Access functions - - //- Return a field of the temperature jump - virtual tmp jump() const; - - //- Return jumpTable - const DataEntry& jumpTable() const - { - return jumpTable_(); - } - - - //- Write - virtual void write(Ostream&) const; -}; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // From bb6eac67ffe8a87691a0f9608dfafe505adc16c3 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 12:24:36 +0100 Subject: [PATCH 18/26] ENH: Re-worked energy jump boundary conditions --- src/thermophysicalModels/basic/Make/files | 8 +- src/thermophysicalModels/basic/Make/options | 6 +- .../energyJump/energyJumpFvPatchScalarField.C | 6 +- .../energyJumpAMIFvPatchScalarField.C | 143 ++++++++++++++ .../energyJumpAMIFvPatchScalarField.H | 164 ++++++++++++++++ .../temperatureJumpAMIBase.H | 78 ++++++++ .../temperatureJumpBase/temperatureJumpBase.H | 81 ++++++++ ...uniformTemperatureJumpFvPatchScalarField.C | 100 ++++++++++ ...uniformTemperatureJumpFvPatchScalarField.H | 175 ++++++++++++++++++ ...formTemperatureJumpAMIFvPatchScalarField.C | 100 ++++++++++ ...formTemperatureJumpAMIFvPatchScalarField.H | 175 ++++++++++++++++++ .../basic/heThermo/heThermo.C | 10 +- 12 files changed, 1036 insertions(+), 10 deletions(-) create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 3ec888d37a..7068030692 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -10,8 +10,12 @@ rhoThermo/rhoThermos.C derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C -derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C -derivedFvPatchFields/temperatureJump/temperatureJumpFvPatchScalarField.C + +derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C + +derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C +derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/Make/options b/src/thermophysicalModels/basic/Make/options index 16d886c766..5f64e9872d 100644 --- a/src/thermophysicalModels/basic/Make/options +++ b/src/thermophysicalModels/basic/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lfiniteVolume \ - -L$(FOAM_USER_LIBBIN)/FvPatchScalarFieldEnthalpyJump + -lfiniteVolume diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index 750252d4bc..6fee73614e 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C @@ -25,7 +25,7 @@ License #include "addToRunTimeSelectionTable.H" #include "energyJumpFvPatchScalarField.H" -#include "temperatureJumpFvPatchScalarField.H" +#include "temperatureJumpBase.H" #include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -108,8 +108,8 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; - const temperatureJumpFvPatchScalarField& TbPatch = - refCast + const temperatureJumpBase& TbPatch = + refCast ( thermo.T().boundaryField()[patchID] ); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C new file mode 100644 index 0000000000..01cbc40488 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "addToRunTimeSelectionTable.H" +#include "energyJumpAMIFvPatchScalarField.H" +#include "temperatureJumpBase.H" +#include "basicThermo.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(p, iF) +{} + + +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField +( + const energyJumpAMIFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpAMIFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedJumpAMIFvPatchField(p, iF) +{ + if (dict.found("value")) + { + fvPatchScalarField::operator= + ( + scalarField("value", dict, p.size()) + ); + } +} + + +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField +( + const energyJumpAMIFvPatchScalarField& ptf +) +: + fixedJumpAMIFvPatchField(ptf) +{} + + +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField +( + const energyJumpAMIFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + if (this->cyclicAMIPatch().owner()) + { + const basicThermo& thermo = + db().lookupObject("thermophysicalProperties"); + + label patchID = patch().index(); + + const scalarField& pp = thermo.p().boundaryField()[patchID]; + const temperatureJumpBase& TbPatch = + refCast + ( + thermo.T().boundaryField()[patchID] + ); + + const labelUList& faceCells = this->patch().faceCells(); + + jump_ = thermo.he(pp, TbPatch.jump(), faceCells); + } + + fixedJumpAMIFvPatchField::updateCoeffs(); +} + + +void Foam::energyJumpAMIFvPatchScalarField::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField::write(os); + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + energyJumpAMIFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H new file mode 100644 index 0000000000..d35859b5a4 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::energyJumpAMIFvPatchScalarField + +Group + grpThermoBoundaryConditions grpCoupledBoundaryConditions + +Description + This boundary condition provides an energy jump condition across a pair + of coupled patches. + + \heading Patch usage + + \table + Property | Description | Required | Default value + jump | energy jump values | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type energyJumpAMI; + jump uniform 100; + } + \endverbatim + +SeeAlso + Foam::fixedJumpFvPatchField + +SourceFiles + energyJumpAMIFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef energyJumpAMIFvPatchScalarField_H +#define energyJumpAMIFvPatchScalarField_H + +#include "fixedJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class energyJumpAMIFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class energyJumpAMIFvPatchScalarField +: + public fixedJumpAMIFvPatchField +{ + +public: + + //- Runtime type information + TypeName("energyJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given energyJumpAMIFvPatchScalarField onto a + // new patch + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new energyJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new energyJumpAMIFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H new file mode 100644 index 0000000000..e8fea6b847 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Description + Base class for temperature jump boundary conditions that provides access + to the jump field + +SourceFiles + temperatureJumpBase.C + +\*---------------------------------------------------------------------------*/ + +#ifndef temperatureJumpAMIBase_H +#define temperatureJumpAMIBase_H + +#include "typeInfo.H" +#include "scalarField.H" +#include "tmp.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class temperatureJumpAMIBase Declaration +\*---------------------------------------------------------------------------*/ + +class temperatureJumpAMIBase +{ + +public: + + //- Construct null + temperatureJumpAMIBase() + {} + + + //- Destructor + virtual ~temperatureJumpAMIBase() + {} + + + // Member functions + + //- Return a field of the temperature jump + virtual tmp jump() const = 0; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H new file mode 100644 index 0000000000..383066966c --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Description + Base class for temperature jump boundary conditions that provides access + to the jump field + +SourceFiles + temperatureJumpBase.C + +\*---------------------------------------------------------------------------*/ + +#ifndef temperatureJumpBase_H +#define temperatureJumpBase_H + +#include "typeInfo.H" +#include "scalarField.H" +#include "tmp.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class temperatureJumpBase Declaration +\*---------------------------------------------------------------------------*/ + +class temperatureJumpBase +{ + +public: + + //- Runtime type information + TypeName("temperatureJumpBase"); + + //- Construct null + temperatureJumpBase() + {} + + + //-Destructor + virtual ~temperatureJumpBase() + {} + + + // Member functions + + //- Return a field of the temperature jump + virtual tmp jump() const = 0; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C new file mode 100644 index 0000000000..5e9a302c47 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + uniformJumpFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + uniformJumpFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf +) +: + uniformJumpFvPatchField(ptf) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + uniformJumpFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + uniformTemperatureJumpFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H new file mode 100644 index 0000000000..d683d9adfb --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::uniformTemperatureJumpFvPatchScalarField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a temperature jump condition across a + coupled pair of cyclic patches when solving for energy. + + The jump is specified as a \c DataEntry type, to enable the use of, e.g. + contant, polynomial, table values. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + jumpTable | jump data, e.g. \c csvFile | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformTemperatureJump; + patchType cyclic; + jumpTable constant 100; + value uniform 300; + } + \endverbatim + + The above example shows the use of a constant jump condition. + +Note + The underlying \c patchType should be set to \c cyclic + +SeeAlso + Foam::uniformJumpFvPatchField + Foam::energyJumpFvPatchScalarField + +SourceFiles + uniformTemperatureJumpFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformTemperatureJumpFvPatchScalarField_H +#define uniformTemperatureJumpFvPatchScalarField_H + +#include "temperatureJumpBase.H" +#include "uniformJumpFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformTemperatureJumpFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class uniformTemperatureJumpFvPatchScalarField +: + public temperatureJumpBase, + public uniformJumpFvPatchField +{ + +public: + + //- Runtime type information + TypeName("uniformTemperatureJump"); + + // Constructors + + //- Construct from patch and internal field + uniformTemperatureJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformTemperatureJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given uniformTemperatureJumpFvPatchScalarField onto a + // new patch + uniformTemperatureJumpFvPatchScalarField + ( + const uniformTemperatureJumpFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformTemperatureJumpFvPatchScalarField + ( + const uniformTemperatureJumpFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformTemperatureJumpFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformTemperatureJumpFvPatchScalarField + ( + const uniformTemperatureJumpFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformTemperatureJumpFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + virtual tmp > jump() const + { + return uniformJumpFvPatchField::jump(); + } +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C new file mode 100644 index 0000000000..379fffb7e3 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpAMIFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + uniformJumpAMIFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpAMIFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + uniformJumpAMIFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf +) +: + uniformJumpAMIFvPatchField(ptf) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + uniformJumpAMIFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + uniformTemperatureJumpAMIFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H new file mode 100644 index 0000000000..0697a3cb97 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +Class + Foam::uniformTemperatureJumpAMIFvPatchScalarField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a temperature jump condition across a + coupled pair of cyclic patches when solving for energy. + + The jump is specified as a \c DataEntry type, to enable the use of, e.g. + contant, polynomial, table values. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + jumpTable | jump data, e.g. \c csvFile | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformTemperatureJumpAMI; + patchType cyclic; + jumpTable constant 100; + value uniform 300; + } + \endverbatim + + The above example shows the use of a constant jump condition. + +Note + The underlying \c patchType should be set to \c cyclic + +SeeAlso + Foam::uniformJumpFvPatchField + Foam::energyJumpFvPatchScalarField + +SourceFiles + uniformTemperatureJumpAMIFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformTemperatureJumpAMIFvPatchScalarField_H +#define uniformTemperatureJumpAMIFvPatchScalarField_H + +#include "temperatureJumpAMIBase.H" +#include "uniformJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformTemperatureJumpAMIFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class uniformTemperatureJumpAMIFvPatchScalarField +: + public temperatureJumpAMIBase, + public uniformJumpAMIFvPatchField +{ + +public: + + //- Runtime type information + TypeName("uniformTemperatureJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // uniformTemperatureJumpAMIFvPatchScalarField onto a new patch + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + virtual tmp > jump() const + { + return uniformJumpAMIFvPatchField::jump(); + } +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 4cace54980..d0b455b7aa 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -28,8 +28,10 @@ License #include "fixedEnergyFvPatchScalarField.H" #include "gradientEnergyFvPatchScalarField.H" #include "mixedEnergyFvPatchScalarField.H" -#include "temperatureJumpFvPatchScalarField.H" +#include "temperatureJumpBase.H" +#include "temperatureJumpAMIBase.H" #include "energyJumpFvPatchScalarField.H" +#include "energyJumpAMIFvPatchScalarField.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -59,10 +61,14 @@ Foam::wordList Foam::heThermo::heBoundaryTypes() { hbt[patchi] = mixedEnergyFvPatchScalarField::typeName; } - else if (isA(tbf[patchi])) + else if (isA(tbf[patchi])) { hbt[patchi] = energyJumpFvPatchScalarField::typeName; } + else if (isA(tbf[patchi])) + { + hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName; + } } return hbt; From 82518f173ad6e0c612f675ce14767912a1c1f10c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 12:26:34 +0100 Subject: [PATCH 19/26] STYLE: minor code formatting --- .../energyJump/energyJump/energyJumpFvPatchScalarField.C | 1 - 1 file changed, 1 deletion(-) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index 6fee73614e..5f46273991 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C @@ -61,7 +61,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField : fixedJumpFvPatchField(p, iF) { - if (dict.found("value")) { fvPatchScalarField::operator= From 5a348322b899b171f3b2e92a5470cf39a5e396b6 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 12:43:49 +0100 Subject: [PATCH 20/26] ENH: Updated boundary condition documentation --- .../derived/fixedJump/fixedJumpFvPatchField.H | 31 ++++++++++++++--- .../fixedJumpAMI/fixedJumpAMIFvPatchField.H | 30 ++++++++++++++++ .../uniformJump/uniformJumpFvPatchField.H | 34 +++++++++++++++++-- .../uniformJumpAMIFvPatchField.H | 31 ++++++++++++++++- .../energyJump/energyJumpFvPatchScalarField.H | 19 ++--------- .../energyJumpAMIFvPatchScalarField.H | 22 +++--------- ...uniformTemperatureJumpFvPatchScalarField.H | 5 ++- ...formTemperatureJumpAMIFvPatchScalarField.H | 12 +++---- 8 files changed, 132 insertions(+), 52 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index ba2fdc9aeb..ede9fea8af 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -28,14 +28,37 @@ Group grpCoupledBoundaryConditions Description - Base class for "jump" of a field + This boundary condition provides a jump condition, using the \c cyclic + condition as a base. + + The jump is specified as a fixed value field, applied as an offset to the + 'owner' patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedJump; + patchType cyclic; + jump uniform 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. Note - not used directly + The underlying \c patchType should be set to \c cyclic SeeAlso - Foam::fanFvPatchScalarField - Foam::fanPressureFvPatchScalarField + Foam::jumpCyclicFvPatchField SourceFiles fixedJumpFvPatchField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H index 9e9d1a91d1..9a0c4bf520 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H @@ -27,6 +27,36 @@ Class Group grpCoupledBoundaryConditions +Description + This boundary condition provides a jump condition, across non-conformal + cyclic path-pairs, employing an arbitraryMeshInterface (AMI). + + The jump is specified as a fixed value field, applied as an offset to the + 'owner' patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedJumpAMI; + patchType cyclic; + jump uniform 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The underlying \c patchType should be set to \c cyclicAMI + SeeAlso Foam::jumpCyclicAMIFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H index d7e8706a59..7e419a2b1c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -27,11 +27,39 @@ Class Group grpCoupledBoundaryConditions -Description - Uniform jump + This boundary condition provides a jump condition, using the \c cyclic + condition as a base. The jump is specified as a time-varying uniform + value across the patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jumpTable | jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedJump; + patchType cyclic; + jumpTable constant 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The uniformValue entry is a DataEntry type, able to describe time + varying functions. The example above gives the usage for supplying a + constant value. + + The underlying \c patchType should be set to \c cyclic SeeAlso - Foam::jumpCyclicFvPatchField + Foam::fixedJumpFvPatchField SourceFiles uniformJumpFvPatchField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H index ddd891dcad..e64382975f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H @@ -28,7 +28,36 @@ Group grpCoupledBoundaryConditions Description - Uniform jump + This boundary condition provides a jump condition, using the \c cyclicAMI + condition as a base. The jump is specified as a time-varying uniform + value across the patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jumpTable | jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformJumpAMI; + patchType cyclicAMI; + jumpTable constant 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The uniformValue entry is a DataEntry type, able to describe time + varying functions. The example above gives the usage for supplying a + constant value. + + The underlying \c patchType should be set to \c cyclic SeeAlso Foam::jumpCyclicAMIFvPatchField diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H index aae2d9597b..833072ad07 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H @@ -29,23 +29,8 @@ Group Description This boundary condition provides an energy jump condition across a pair - of coupled patches. - - \heading Patch usage - - \table - Property | Description | Required | Default value - jump | energy jump values | yes | - \endtable - - Example of the boundary condition specification: - \verbatim - myPatch - { - type energyJump; - jump uniform 100; - } - \endverbatim + of coupled patches. It is not applied directly, but is employed on-the-fly + when converting temperature boundary conditions into energy. SeeAlso Foam::fixedJumpFvPatchField diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H index d35859b5a4..e000c6b200 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H @@ -29,26 +29,12 @@ Group Description This boundary condition provides an energy jump condition across a pair - of coupled patches. - - \heading Patch usage - - \table - Property | Description | Required | Default value - jump | energy jump values | yes | - \endtable - - Example of the boundary condition specification: - \verbatim - myPatch - { - type energyJumpAMI; - jump uniform 100; - } - \endverbatim + of coupled patches with an arbitrary mesh interface (AMI). It is not + applied directly, but is employed on-the-fly when converting temperature + boundary conditions into energy. SeeAlso - Foam::fixedJumpFvPatchField + Foam::fixedJumpAMIFvPatchField SourceFiles energyJumpAMIFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H index d683d9adfb..fa58b32d5e 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H @@ -29,7 +29,7 @@ Group Description This boundary condition provides a temperature jump condition across a - coupled pair of cyclic patches when solving for energy. + coupled pair of cyclic patches, when solving for energy. The jump is specified as a \c DataEntry type, to enable the use of, e.g. contant, polynomial, table values. @@ -39,7 +39,6 @@ Description \table Property | Description | Required | Default value patchType | underlying patch type should be \c cyclic| yes | - jump | current jump value | yes | jumpTable | jump data, e.g. \c csvFile | yes | \endtable @@ -54,7 +53,7 @@ Description } \endverbatim - The above example shows the use of a constant jump condition. + The above example shows the use of a constant jump condition of 300 K. Note The underlying \c patchType should be set to \c cyclic diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H index 0697a3cb97..2fdb6dc385 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H @@ -29,7 +29,8 @@ Group Description This boundary condition provides a temperature jump condition across a - coupled pair of cyclic patches when solving for energy. + coupled pair of non-conformal cyclic patches using an arbitrary mesh + interface (AMI), when solving for energy. The jump is specified as a \c DataEntry type, to enable the use of, e.g. contant, polynomial, table values. @@ -39,7 +40,6 @@ Description \table Property | Description | Required | Default value patchType | underlying patch type should be \c cyclic| yes | - jump | current jump value | yes | jumpTable | jump data, e.g. \c csvFile | yes | \endtable @@ -54,14 +54,14 @@ Description } \endverbatim - The above example shows the use of a constant jump condition. + The above example shows the use of a constant jump condition of 300 K. Note - The underlying \c patchType should be set to \c cyclic + The underlying \c patchType should be set to \c cyclicAMI SeeAlso - Foam::uniformJumpFvPatchField - Foam::energyJumpFvPatchScalarField + Foam::uniformJumpAMIFvPatchField + Foam::energyJumpAMIFvPatchScalarField SourceFiles uniformTemperatureJumpAMIFvPatchScalarField.C From fcf486325986fc803fab22aa3b58b63a79ee4863 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 15:22:35 +0100 Subject: [PATCH 21/26] ENH: Further updates to jump field conditions and updated library dependencies --- src/finiteVolume/Make/files | 1 + .../derived/fixedJump/fixedJumpFvPatchField.C | 1 + .../fixedJumpAMI/fixedJumpAMIFvPatchField.C | 1 + .../uniformJump/uniformJumpFvPatchField.C | 7 +-- .../uniformJump/uniformJumpFvPatchField.H | 19 +------ .../uniformJumpAMIFvPatchField.C | 7 +-- .../uniformJumpAMIFvPatchField.H | 18 +------ src/thermophysicalModels/basic/Make/files | 2 + .../temperatureJumpAMIBase.C | 49 +++++++++++++++++++ .../temperatureJumpAMIBase.H | 9 ++-- .../temperatureJumpBase/temperatureJumpBase.C | 49 +++++++++++++++++++ .../temperatureJumpBase/temperatureJumpBase.H | 6 +-- ...formTemperatureJumpAMIFvPatchScalarField.H | 2 +- .../reactionThermo/Make/options | 8 ++- 14 files changed, 122 insertions(+), 57 deletions(-) create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C create mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index e9cf82b3d0..eee3fd6894 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -102,6 +102,7 @@ $(constraintFvPatchFields)/cyclicAMI/cyclicAMIFvPatchFields.C $(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C $(constraintFvPatchFields)/empty/emptyFvPatchFields.C $(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C +$(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index 6d692c4887..eb997abf36 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -141,6 +141,7 @@ void Foam::fixedJumpFvPatchField::write(Ostream& os) const fvPatchField::write(os); os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl; jump_.writeEntry("jump", os); + this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index 689981c20d..d9cdc383a3 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -143,6 +143,7 @@ void Foam::fixedJumpAMIFvPatchField::write(Ostream& os) const fvPatchField::write(os); os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl; jump_.writeEntry("jump", os); + this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index a5e268c730..7e7e0cbebc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -62,13 +62,8 @@ Foam::uniformJumpFvPatchField::uniformJumpFvPatchField ) : fixedJumpFvPatchField(p, iF), - jumpTable_(0) + jumpTable_(DataEntry::New("jumpTable", dict)) { - if (this->cyclicPatch().owner()) - { - jumpTable_ = DataEntry::New("jumpTable", dict); - } - if (dict.found("value")) { fvPatchField::operator= diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H index 7e419a2b1c..633dc1752e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -27,6 +27,7 @@ Class Group grpCoupledBoundaryConditions +Description This boundary condition provides a jump condition, using the \c cyclic condition as a base. The jump is specified as a time-varying uniform value across the patch. @@ -43,7 +44,7 @@ Group \verbatim myPatch { - type fixedJump; + type uniformJump; patchType cyclic; jumpTable constant 10; } @@ -170,22 +171,6 @@ public: virtual tmp > jump() const; - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchField&, - const labelList& - ); - - //- Write virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C index d4ba13ad75..b34628ef33 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -62,13 +62,8 @@ Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField ) : fixedJumpAMIFvPatchField(p, iF), - jumpTable_(0) + jumpTable_(DataEntry::New("jumpTable", dict)) { - if (this->cyclicAMIPatch().owner()) - { - jumpTable_ = DataEntry::New("jumpTable", dict); - } - if (dict.found("value")) { fvPatchField::operator=(Field("value", dict, p.size())); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H index e64382975f..e5eb2e6826 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H @@ -36,7 +36,7 @@ Description \table Property | Description | Required | Default value - patchType | underlying patch type should be \c cyclic| yes | + patchType | underlying patch type should be \c cyclicAMI| yes | jumpTable | jump value | yes | \endtable @@ -171,22 +171,6 @@ public: virtual tmp > jump() const; - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchField&, - const labelList& - ); - - //- Write virtual void write(Ostream&) const; }; diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 7068030692..d8ac16387b 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -14,6 +14,8 @@ derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C +derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C +derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C new file mode 100644 index 0000000000..5368a17bf2 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "temperatureJumpAMIBase.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(temperatureJumpAMIBase, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::temperatureJumpAMIBase::temperatureJumpAMIBase() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::temperatureJumpAMIBase::~temperatureJumpAMIBase() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H index e8fea6b847..79246c7080 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H @@ -51,14 +51,15 @@ class temperatureJumpAMIBase public: + //- Runtime type information + TypeName("temperatureJumpAMIBase"); + //- Construct null - temperatureJumpAMIBase() - {} + temperatureJumpAMIBase(); //- Destructor - virtual ~temperatureJumpAMIBase() - {} + virtual ~temperatureJumpAMIBase(); // Member functions diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C new file mode 100644 index 0000000000..afd18c0924 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 "temperatureJumpBase.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(temperatureJumpBase, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::temperatureJumpBase::temperatureJumpBase() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::temperatureJumpBase::~temperatureJumpBase() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H index 383066966c..32744fd47a 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H @@ -55,13 +55,11 @@ public: TypeName("temperatureJumpBase"); //- Construct null - temperatureJumpBase() - {} + temperatureJumpBase(); //-Destructor - virtual ~temperatureJumpBase() - {} + virtual ~temperatureJumpBase(); // Member functions diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H index 2fdb6dc385..9fd8c23ae4 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H @@ -39,7 +39,7 @@ Description \table Property | Description | Required | Default value - patchType | underlying patch type should be \c cyclic| yes | + patchType | underlying patch type should be \c cyclicAMI| yes | jumpTable | jump data, e.g. \c csvFile | yes | \endtable diff --git a/src/thermophysicalModels/reactionThermo/Make/options b/src/thermophysicalModels/reactionThermo/Make/options index 9dad3910dd..8c18cf8318 100644 --- a/src/thermophysicalModels/reactionThermo/Make/options +++ b/src/thermophysicalModels/reactionThermo/Make/options @@ -1,7 +1,11 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lfluidThermophysicalModels \ + -lspecie \ + -lmeshTools From 10af522789476bba974038c4cd087e7ea911aa80 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 16:13:44 +0100 Subject: [PATCH 22/26] ENH: Removed duplicate writing of patch value --- .../fields/fvPatchFields/derived/fan/fanFvPatchField.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 477b242b76..8188166dc6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -96,13 +96,11 @@ Foam::fanFvPatchField::fanFvPatchField template void Foam::fanFvPatchField::write(Ostream& os) const { - fixedJumpFvPatchField::write(os); if (this->cyclicPatch().owner()) { jumpTable_->writeData(os); } - this->writeEntry("value", os); } From 29162ece834b0d08065bdb65b5aa9e09ae438930 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 16:27:01 +0100 Subject: [PATCH 23/26] ENH: Updated fan BC - now derived from uniformJump BC --- .../derived/fan/fanFvPatchField.C | 30 ++++--------------- .../derived/fan/fanFvPatchField.H | 13 ++------ .../derived/fan/fanFvPatchFields.C | 16 ++++++---- 3 files changed, 17 insertions(+), 42 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 8188166dc6..3a150c6f70 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -34,8 +34,7 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(0) + uniformJumpFvPatchField(p, iF) {} @@ -48,8 +47,7 @@ Foam::fanFvPatchField::fanFvPatchField const fvPatchFieldMapper& mapper ) : - fixedJumpFvPatchField(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf, p, iF, mapper) {} @@ -61,8 +59,7 @@ Foam::fanFvPatchField::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(DataEntry::New("jumpTable", dict)) + uniformJumpFvPatchField(p, iF, dict) {} @@ -72,9 +69,7 @@ Foam::fanFvPatchField::fanFvPatchField const fanFvPatchField& ptf ) : - cyclicLduInterfaceField(), - fixedJumpFvPatchField(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf) {} @@ -85,23 +80,8 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - fixedJumpFvPatchField(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -template -void Foam::fanFvPatchField::write(Ostream& os) const -{ - fixedJumpFvPatchField::write(os); - if (this->cyclicPatch().owner()) - { - jumpTable_->writeData(os); - } -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 3eea1382f3..463ebeb543 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -83,7 +83,7 @@ SourceFiles #ifndef fanFvPatchField_H #define fanFvPatchField_H -#include "fixedJumpFvPatchField.H" +#include "uniformJumpFvPatchField.H" #include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -98,13 +98,8 @@ namespace Foam template class fanFvPatchField : - public fixedJumpFvPatchField + public uniformJumpFvPatchField { - // Private data - - //- Interpolation table - autoPtr > jumpTable_; - public: @@ -179,10 +174,6 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 1b291d500c..1c8e934892 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -53,8 +53,7 @@ Foam::fanFvPatchField::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(new DataEntry("jumpTable")) + uniformJumpFvPatchField(p, iF) { if (this->cyclicPatch().owner()) { @@ -83,7 +82,7 @@ Foam::fanFvPatchField::fanFvPatchField } } - jumpTable_.reset + this->jumpTable_.reset ( new polynomial("jumpTable", coeffs) ); @@ -91,9 +90,14 @@ Foam::fanFvPatchField::fanFvPatchField else { // Generic input constructed from dictionary - jumpTable_ = DataEntry::New("jumpTable", dict); + this->jumpTable_ = DataEntry::New("jumpTable", dict); } } + else + { + // Generic input constructed from dictionary + this->jumpTable_.reset(new DataEntry("jumpTable")); + } if (dict.found("value")) @@ -136,10 +140,10 @@ void Foam::fanFvPatchField::updateCoeffs() Un /= patch().lookupPatchField("rho"); } - jump_ = jumpTable_->value(Un); + this->jump_ = this->jumpTable_->value(Un); } - fixedJumpFvPatchField::updateCoeffs(); + uniformJumpFvPatchField::updateCoeffs(); } From d09aa312219910951ef5cb7b1f42525639d0824a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 16:33:20 +0100 Subject: [PATCH 24/26] ENH: Updated jump field construction of DataEntries --- .../derived/uniformJump/uniformJumpFvPatchField.C | 7 ++++++- .../derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index 7e7e0cbebc..88e7578141 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -62,8 +62,13 @@ Foam::uniformJumpFvPatchField::uniformJumpFvPatchField ) : fixedJumpFvPatchField(p, iF), - jumpTable_(DataEntry::New("jumpTable", dict)) + jumpTable_(new DataEntry("jumpTable")) { + if (this->cyclicPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + if (dict.found("value")) { fvPatchField::operator= diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C index b34628ef33..cb9ff6cd90 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -62,8 +62,13 @@ Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField ) : fixedJumpAMIFvPatchField(p, iF), - jumpTable_(DataEntry::New("jumpTable", dict)) + jumpTable_(new DataEntry("jumpTable")) { + if (this->cyclicAMIPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + if (dict.found("value")) { fvPatchField::operator=(Field("value", dict, p.size())); From d7881f08a614999eb6b793f7fc0218c5713d8563 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 16:33:41 +0100 Subject: [PATCH 25/26] ENH: Tutorial file update --- tutorials/incompressible/pimpleFoam/TJunctionFan/0/p | 2 -- 1 file changed, 2 deletions(-) diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p b/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p index 16a8bb50ed..e69dbaddef 100644 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p @@ -56,7 +56,6 @@ boundaryField { type fan; patchType cyclic; - jump uniform 0; jumpTable polynomial 2 @@ -71,7 +70,6 @@ boundaryField { type fan; patchType cyclic; - jump uniform 0; value uniform 0; } defaultFaces From 98e7e7d253112c0f4be846a8d85399e86178f92b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 16:36:04 +0100 Subject: [PATCH 26/26] STYLE: limit to 80 chars --- .../uniformTemperatureJumpFvPatchScalarField.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H index fa58b32d5e..6dbae8d707 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H @@ -110,8 +110,8 @@ public: const dictionary& ); - //- Construct by mapping given uniformTemperatureJumpFvPatchScalarField onto a - // new patch + //- Construct by mapping given + // uniformTemperatureJumpFvPatchScalarField onto a new patch uniformTemperatureJumpFvPatchScalarField ( const uniformTemperatureJumpFvPatchScalarField&,