From 9c039e438a54ebceebda885d6f4b2ee612c4a38d Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 24 Oct 2012 15:15:51 +0100 Subject: [PATCH 01/35] 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/35] 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/35] 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/35] 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/35] 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/35] 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/35] 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 ae3b2d91920747bc47f54246e0d2a273feb92aa8 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 25 Oct 2012 10:02:42 +0100 Subject: [PATCH 08/35] 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 09/35] 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 10/35] 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 11/35] 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 12/35] 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 13/35] 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 14/35] 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 15/35] 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 16/35] 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 17/35] 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 18/35] 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 19/35] 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 20/35] 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 21/35] 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&, From 674a15a11f1c13bd8d903f2b980889e00955bde8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 25 Oct 2012 17:28:09 +0100 Subject: [PATCH 22/35] ENH: regExp:improved error message --- src/OSspecific/POSIX/regExp.C | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/OSspecific/POSIX/regExp.C b/src/OSspecific/POSIX/regExp.C index 3ce0d2c447..2023f9ce59 100644 --- a/src/OSspecific/POSIX/regExp.C +++ b/src/OSspecific/POSIX/regExp.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 @@ -80,12 +80,18 @@ void Foam::regExp::set(const char* pattern, const bool ignoreCase) const cflags |= REG_ICASE; } - if (regcomp(preg_, pattern, cflags) != 0) + int err = regcomp(preg_, pattern, cflags); + + if (err != 0) { + char errbuf[200]; + regerror(err, preg_, errbuf, sizeof(errbuf)); + FatalErrorIn ( "regExp::set(const char*)" ) << "Failed to compile regular expression '" << pattern << "'" + << nl << errbuf << exit(FatalError); } } From 8f90eb6037f9b3c96407624943ebcd6ac8da182a Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 25 Oct 2012 17:29:04 +0100 Subject: [PATCH 23/35] STYLE: TableBase: added comment --- src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H index 929e151a0c..da670e2db5 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.H @@ -125,7 +125,7 @@ public: //- Construct from dictionary - note table is not populated TableBase(const word& name, const dictionary& dict); - //- Copy constructor + //- Copy constructor. Note: steals interpolator, tableSamples TableBase(const TableBase& tbl); From 196c51d770f41636533143093db882c0c4f11b4c Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 09:03:50 +0100 Subject: [PATCH 24/35] ENH: Re-worked/simplified temperature jump BC --- src/thermophysicalModels/basic/Make/files | 5 - .../energyJump/energyJumpFvPatchScalarField.C | 6 +- .../energyJumpAMIFvPatchScalarField.C | 6 +- .../temperatureJumpAMIBase.C | 49 ----- .../temperatureJumpAMIBase.H | 79 -------- .../temperatureJumpBase/temperatureJumpBase.C | 49 ----- .../temperatureJumpBase/temperatureJumpBase.H | 79 -------- ...uniformTemperatureJumpFvPatchScalarField.C | 100 ---------- ...uniformTemperatureJumpFvPatchScalarField.H | 174 ----------------- ...formTemperatureJumpAMIFvPatchScalarField.C | 100 ---------- ...formTemperatureJumpAMIFvPatchScalarField.H | 175 ------------------ .../basic/heThermo/heThermo.C | 8 +- 12 files changed, 10 insertions(+), 820 deletions(-) delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H delete mode 100644 src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C delete 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 d8ac16387b..5b82c80476 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -14,11 +14,6 @@ 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 - derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libfluidThermophysicalModels diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index 5f46273991..62ac6516ef 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 "temperatureJumpBase.H" +#include "fixedJumpFvPatchFields.H" #include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -107,8 +107,8 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; - const temperatureJumpBase& TbPatch = - refCast + const fixedJumpFvPatchScalarField& 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 index 01cbc40488..9f596c3cde 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C @@ -25,7 +25,7 @@ License #include "addToRunTimeSelectionTable.H" #include "energyJumpAMIFvPatchScalarField.H" -#include "temperatureJumpBase.H" +#include "fixedJumpAMIFvPatchFields.H" #include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -107,8 +107,8 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; - const temperatureJumpBase& TbPatch = - refCast + const fixedJumpAMIFvPatchScalarField& TbPatch = + refCast ( thermo.T().boundaryField()[patchID] ); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C deleted file mode 100644 index 5368a17bf2..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C +++ /dev/null @@ -1,49 +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 "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 deleted file mode 100644 index 79246c7080..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H +++ /dev/null @@ -1,79 +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 . - -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: - - //- Runtime type information - TypeName("temperatureJumpAMIBase"); - - //- 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.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C deleted file mode 100644 index afd18c0924..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C +++ /dev/null @@ -1,49 +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 "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 deleted file mode 100644 index 32744fd47a..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H +++ /dev/null @@ -1,79 +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 . - -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 deleted file mode 100644 index 5e9a302c47..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C +++ /dev/null @@ -1,100 +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 "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 deleted file mode 100644 index 6dbae8d707..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H +++ /dev/null @@ -1,174 +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::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 | - 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 of 300 K. - -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 deleted file mode 100644 index 379fffb7e3..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C +++ /dev/null @@ -1,100 +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 "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 deleted file mode 100644 index 9fd8c23ae4..0000000000 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H +++ /dev/null @@ -1,175 +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::uniformTemperatureJumpAMIFvPatchScalarField - -Group - grpCoupledBoundaryConditions - -Description - This boundary condition provides a temperature jump condition across a - 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. - - \heading Patch usage - - \table - Property | Description | Required | Default value - patchType | underlying patch type should be \c cyclicAMI| 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 of 300 K. - -Note - The underlying \c patchType should be set to \c cyclicAMI - -SeeAlso - Foam::uniformJumpAMIFvPatchField - Foam::energyJumpAMIFvPatchScalarField - -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 d0b455b7aa..f3902a033d 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -28,8 +28,8 @@ License #include "fixedEnergyFvPatchScalarField.H" #include "gradientEnergyFvPatchScalarField.H" #include "mixedEnergyFvPatchScalarField.H" -#include "temperatureJumpBase.H" -#include "temperatureJumpAMIBase.H" +#include "fixedJumpFvPatchFields.H" +#include "fixedJumpAMIFvPatchFields.H" #include "energyJumpFvPatchScalarField.H" #include "energyJumpAMIFvPatchScalarField.H" @@ -61,11 +61,11 @@ 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])) + else if (isA(tbf[patchi])) { hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName; } From 39aeb1d8f62d68b992b9ff78996e4d899f711c1c Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 09:46:16 +0100 Subject: [PATCH 25/35] ENH: Updated explicit source to semi-implicit source --- src/fieldSources/Make/files | 2 +- .../SemiImplicitSource.C} | 55 +++++++++++++----- .../SemiImplicitSource.H} | 56 +++++++++++-------- .../SemiImplicitSourceI.H} | 18 +++--- .../SemiImplicitSourceIO.C} | 10 ++-- .../semiImplicitSource.C} | 14 ++--- 6 files changed, 97 insertions(+), 58 deletions(-) rename src/fieldSources/general/{explicitSource/ExplicitSource.C => semiImplicitSource/SemiImplicitSource.C} (71%) rename src/fieldSources/general/{explicitSource/ExplicitSource.H => semiImplicitSource/SemiImplicitSource.H} (78%) rename src/fieldSources/general/{explicitSource/ExplicitSourceI.H => semiImplicitSource/SemiImplicitSourceI.H} (72%) rename src/fieldSources/general/{explicitSource/ExplicitSourceIO.C => semiImplicitSource/SemiImplicitSourceIO.C} (83%) rename src/fieldSources/general/{explicitSource/explicitSource.C => semiImplicitSource/semiImplicitSource.C} (78%) diff --git a/src/fieldSources/Make/files b/src/fieldSources/Make/files index 41fecea800..11f91ff58a 100644 --- a/src/fieldSources/Make/files +++ b/src/fieldSources/Make/files @@ -3,7 +3,7 @@ basicSource/basicSourceIO.C basicSource/basicSourceList.C basicSource/IObasicSourceList.C -general/explicitSource/explicitSource.C +general/semiImplicitSource/semiImplicitSource.C general/explicitSetValue/explicitSetValue.C general/codedSource/codedSource.C diff --git a/src/fieldSources/general/explicitSource/ExplicitSource.C b/src/fieldSources/general/semiImplicitSource/SemiImplicitSource.C similarity index 71% rename from src/fieldSources/general/explicitSource/ExplicitSource.C rename to src/fieldSources/general/semiImplicitSource/SemiImplicitSource.C index 64ed783cb9..2e556eaf01 100644 --- a/src/fieldSources/general/explicitSource/ExplicitSource.C +++ b/src/fieldSources/general/semiImplicitSource/SemiImplicitSource.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 @@ -23,15 +23,16 @@ License \*---------------------------------------------------------------------------*/ -#include "ExplicitSource.H" +#include "SemiImplicitSource.H" #include "fvMesh.H" #include "fvMatrices.H" #include "DimensionedField.H" +#include "fvmSup.H" // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // template -const Foam::wordList Foam::ExplicitSource:: +const Foam::wordList Foam::SemiImplicitSource:: volumeModeTypeNames_ ( IStringStream("(absolute specific)")() @@ -41,8 +42,8 @@ volumeModeTypeNames_ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template -typename Foam::ExplicitSource::volumeModeType -Foam::ExplicitSource::wordToVolumeModeType +typename Foam::SemiImplicitSource::volumeModeType +Foam::SemiImplicitSource::wordToVolumeModeType ( const word& vmtName ) const @@ -57,8 +58,8 @@ Foam::ExplicitSource::wordToVolumeModeType FatalErrorIn ( - "ExplicitSource::volumeModeType" - "ExplicitSource::wordToVolumeModeType(const word&)" + "SemiImplicitSource::volumeModeType" + "SemiImplicitSource::wordToVolumeModeType(const word&)" ) << "Unknown volumeMode type " << vmtName << ". Valid volumeMode types are:" << nl << volumeModeTypeNames_ << exit(FatalError); @@ -68,7 +69,7 @@ Foam::ExplicitSource::wordToVolumeModeType template -Foam::word Foam::ExplicitSource::volumeModeTypeToWord +Foam::word Foam::SemiImplicitSource::volumeModeTypeToWord ( const volumeModeType& vmtType ) const @@ -85,7 +86,7 @@ Foam::word Foam::ExplicitSource::volumeModeTypeToWord template -void Foam::ExplicitSource::setFieldData(const dictionary& dict) +void Foam::SemiImplicitSource::setFieldData(const dictionary& dict) { fieldNames_.setSize(dict.toc().size()); injectionRate_.setSize(fieldNames_.size()); @@ -111,7 +112,7 @@ void Foam::ExplicitSource::setFieldData(const dictionary& dict) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::ExplicitSource::ExplicitSource +Foam::SemiImplicitSource::SemiImplicitSource ( const word& name, const word& modelType, @@ -131,7 +132,7 @@ Foam::ExplicitSource::ExplicitSource // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::ExplicitSource::addSup +void Foam::SemiImplicitSource::addSup ( fvMatrix& eqn, const label fieldI @@ -139,15 +140,17 @@ void Foam::ExplicitSource::addSup { if (debug) { - Info<< "ExplicitSource<"<< pTraits::typeName + Info<< "SemiImplicitSource<" << pTraits::typeName << ">::addSup for source " << name_ << endl; } + const GeometricField& psi = eqn.psi(); + DimensionedField Su ( IOobject ( - name_ + fieldNames_[fieldI] + "Sup", + name_ + fieldNames_[fieldI] + "Su", mesh_.time().timeName(), mesh_, IOobject::NO_READ, @@ -163,9 +166,31 @@ void Foam::ExplicitSource::addSup false ); - UIndirectList(Su, cells_) = injectionRate_[fieldI]/VDash_; + UIndirectList(Su, cells_) = injectionRate_[fieldI].first()/VDash_; - eqn += Su; + DimensionedField Sp + ( + IOobject + ( + name_ + fieldNames_[fieldI] + "Sp", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensioned + ( + "zero", + Su.dimensions()/psi.dimensions(), + 0.0 + ), + false + ); + + UIndirectList(Sp, cells_) = injectionRate_[fieldI].second()/VDash_; + + eqn += Su + fvm::Sp(Sp, psi); } diff --git a/src/fieldSources/general/explicitSource/ExplicitSource.H b/src/fieldSources/general/semiImplicitSource/SemiImplicitSource.H similarity index 78% rename from src/fieldSources/general/explicitSource/ExplicitSource.H rename to src/fieldSources/general/semiImplicitSource/SemiImplicitSource.H index 30a18dd5d3..94a174034b 100644 --- a/src/fieldSources/general/explicitSource/ExplicitSource.H +++ b/src/fieldSources/general/semiImplicitSource/SemiImplicitSource.H @@ -22,21 +22,33 @@ License along with OpenFOAM. If not, see . Class - Foam::ExplicitSource + Foam::SemiImplicitSource Description - Explicit source + Semi-implicit source, described using an input dictionary. The injection + rate coefficients are specified as pairs of Su-Sp coefficients, i.e. - Sources described by: + \f[ + S(x) = S_u + S_p x + \f] + + where + \vartable + S(x) | net source for field 'x' + S_u | explicit source contribution + S_p | linearised implicit contribution + \endvartable + + Example of the source specification: \verbatim - ExplicitSourceCoeffs + SemiImplicitSourceCoeffs { volumeMode absolute; // specific - injectionRate + injectionRateSuSp { - k 30.7; - epsilon 1.5; + k (30.7 0); + epsilon (1.5 0); } } \verbatim @@ -49,12 +61,12 @@ SeeAlso Foam::basicSource SourceFiles - ExplicitSource.C + SemiImplicitSource.C \*---------------------------------------------------------------------------*/ -#ifndef ExplicitSource_H -#define ExplicitSource_H +#ifndef SemiImplicitSource_H +#define SemiImplicitSource_H #include "Tuple2.H" #include "basicSource.H" @@ -69,7 +81,7 @@ namespace Foam class fvMesh; template -class ExplicitSource; +class SemiImplicitSource; // Forward declaration of friend functions @@ -77,15 +89,15 @@ template Ostream& operator<< ( Ostream&, - const ExplicitSource& + const SemiImplicitSource& ); /*---------------------------------------------------------------------------*\ - Class ExplicitSource Declaration + Class SemiImplicitSource Declaration \*---------------------------------------------------------------------------*/ template -class ExplicitSource +class SemiImplicitSource : public basicSource { @@ -115,7 +127,7 @@ protected: scalar VDash_; //- Source field values - List injectionRate_; + List > injectionRate_; // Protected functions @@ -133,13 +145,13 @@ protected: public: //- Runtime type information - TypeName("ExplicitSource"); + TypeName("SemiImplicitSource"); // Constructors //- Construct from components - ExplicitSource + SemiImplicitSource ( const word& name, const word& modelType, @@ -156,7 +168,7 @@ public: inline const volumeModeType& volumeMode() const; //- Return const access to the source field values - inline const List& injectionRate() const; + inline const List >& injectionRate() const; // Edit @@ -165,7 +177,7 @@ public: inline volumeModeType& volumeMode(); //- Return access to the source field values - inline List& injectionRate(); + inline List >& injectionRate(); // Evaluation @@ -191,13 +203,13 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "ExplicitSource.C" -# include "ExplicitSourceIO.C" +# include "SemiImplicitSource.C" +# include "SemiImplicitSourceIO.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "ExplicitSourceI.H" +#include "SemiImplicitSourceI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/fieldSources/general/explicitSource/ExplicitSourceI.H b/src/fieldSources/general/semiImplicitSource/SemiImplicitSourceI.H similarity index 72% rename from src/fieldSources/general/explicitSource/ExplicitSourceI.H rename to src/fieldSources/general/semiImplicitSource/SemiImplicitSourceI.H index e3f4b8aa63..eb352de08a 100644 --- a/src/fieldSources/general/explicitSource/ExplicitSourceI.H +++ b/src/fieldSources/general/semiImplicitSource/SemiImplicitSourceI.H @@ -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 @@ -23,35 +23,37 @@ License \*---------------------------------------------------------------------------*/ -#include "ExplicitSource.H" +#include "SemiImplicitSource.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline const typename Foam::ExplicitSource::volumeModeType& -Foam::ExplicitSource::volumeMode() const +inline const typename Foam::SemiImplicitSource::volumeModeType& +Foam::SemiImplicitSource::volumeMode() const { return volumeMode_; } template -inline const Foam::List& Foam::ExplicitSource::injectionRate() const +inline const Foam::List >& +Foam::SemiImplicitSource::injectionRate() const { return injectionRate_; } template -inline typename Foam::ExplicitSource::volumeModeType& -Foam::ExplicitSource::volumeMode() +inline typename Foam::SemiImplicitSource::volumeModeType& +Foam::SemiImplicitSource::volumeMode() { return volumeMode_; } template -inline Foam::List& Foam::ExplicitSource::injectionRate() +inline Foam::List >& Foam::SemiImplicitSource::injectionRate() { return injectionRate_; } diff --git a/src/fieldSources/general/explicitSource/ExplicitSourceIO.C b/src/fieldSources/general/semiImplicitSource/SemiImplicitSourceIO.C similarity index 83% rename from src/fieldSources/general/explicitSource/ExplicitSourceIO.C rename to src/fieldSources/general/semiImplicitSource/SemiImplicitSourceIO.C index f2abe69cbd..6b91798be6 100644 --- a/src/fieldSources/general/explicitSource/ExplicitSourceIO.C +++ b/src/fieldSources/general/semiImplicitSource/SemiImplicitSourceIO.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 @@ -23,12 +23,12 @@ License \*---------------------------------------------------------------------------*/ -#include "ExplicitSource.H" +#include "SemiImplicitSource.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::ExplicitSource::writeData(Ostream& os) const +void Foam::SemiImplicitSource::writeData(Ostream& os) const { os << indent << name_ << endl; dict_.write(os); @@ -36,12 +36,12 @@ void Foam::ExplicitSource::writeData(Ostream& os) const template -bool Foam::ExplicitSource::read(const dictionary& dict) +bool Foam::SemiImplicitSource::read(const dictionary& dict) { if (basicSource::read(dict)) { volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode")); - setFieldData(coeffs_.subDict("injectionRate")); + setFieldData(coeffs_.subDict("injectionRateSuSp")); return true; } diff --git a/src/fieldSources/general/explicitSource/explicitSource.C b/src/fieldSources/general/semiImplicitSource/semiImplicitSource.C similarity index 78% rename from src/fieldSources/general/explicitSource/explicitSource.C rename to src/fieldSources/general/semiImplicitSource/semiImplicitSource.C index 338a422059..e3b294fa59 100644 --- a/src/fieldSources/general/explicitSource/explicitSource.C +++ b/src/fieldSources/general/semiImplicitSource/semiImplicitSource.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 @@ -24,17 +24,17 @@ License \*---------------------------------------------------------------------------*/ #include "makeBasicSource.H" -#include "ExplicitSource.H" +#include "SemiImplicitSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeBasicSource(ExplicitSource, scalar); - makeBasicSource(ExplicitSource, vector); - makeBasicSource(ExplicitSource, sphericalTensor); - makeBasicSource(ExplicitSource, symmTensor); - makeBasicSource(ExplicitSource, tensor); + makeBasicSource(SemiImplicitSource, scalar); + makeBasicSource(SemiImplicitSource, vector); + makeBasicSource(SemiImplicitSource, sphericalTensor); + makeBasicSource(SemiImplicitSource, symmTensor); + makeBasicSource(SemiImplicitSource, tensor); } From 22aaa8d8085367257ea57301e611499de055b6f0 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 10:03:22 +0100 Subject: [PATCH 26/35] ENH: Tutorial file updates --- .../filter/constant/porosityProperties | 7 ++--- .../filter/constant/sourcesProperties | 26 +++++++++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties b/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties index fcd5c5d3f1..93c4de650d 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties +++ b/tutorials/lagrangian/reactingParcelFoam/filter/constant/porosityProperties @@ -23,11 +23,8 @@ filter1 DarcyForchheimerCoeffs { - Darcy - { - d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); - f f [0 -1 0 0 0 0 0] (0 0 0); - } + d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); coordinateSystem { diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/constant/sourcesProperties b/tutorials/lagrangian/reactingParcelFoam/filter/constant/sourcesProperties index 7f40e5d032..e049d42c4b 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/constant/sourcesProperties +++ b/tutorials/lagrangian/reactingParcelFoam/filter/constant/sourcesProperties @@ -17,7 +17,7 @@ FoamFile massSource1 { - type scalarExplicitSource; + type scalarSemiImplicitSource; active true; timeStart 0.2; duration 2.0; @@ -27,13 +27,13 @@ massSource1 (2.75 0.5 0) ); - scalarExplicitSourceCoeffs + scalarSemiImplicitSourceCoeffs { volumeMode absolute; - injectionRate + injectionRateSuSp { - rho 1e-4; // kg/s - H2O 1e-4; // kg/s + rho (1e-4 0); // kg/s + H2O (1e-4 0); // kg/s } } } @@ -41,7 +41,7 @@ massSource1 momentumSource1 { - type vectorExplicitSource; + type vectorSemiImplicitSource; active true; timeStart 0.2; duration 2.0; @@ -51,12 +51,12 @@ momentumSource1 (2.75 0.5 0) ); - vectorExplicitSourceCoeffs + vectorSemiImplicitSourceCoeffs { volumeMode absolute; - injectionRate + injectionRateSuSp { - U (0 0.005 0); + U ((0 0.005 0) 0); } } } @@ -64,7 +64,7 @@ momentumSource1 energySource1 { - type scalarExplicitSource; + type scalarSemiImplicitSource; active true; timeStart 0.2; duration 2.0; @@ -74,12 +74,12 @@ energySource1 (2.75 0.5 0) ); - scalarExplicitSourceCoeffs + scalarSemiImplicitSourceCoeffs { volumeMode absolute; - injectionRate + injectionRateSuSp { - h 10; + h (10 0); } } } From 9429143369734506aa63ba3203a248201aad4bf9 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 10:27:08 +0100 Subject: [PATCH 27/35] BUG: Updated tutorial RunFunctions - mantis #668 --- bin/tools/RunFunctions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index d986057b5f..093c6ed037 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -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 @@ -44,7 +44,7 @@ runApplication() echo "$APP_NAME already run on $PWD: remove log file to re-run" else echo "Running $APP_RUN on $PWD" - $APP_RUN $* > log.$APP_NAME 2>&1 + $APP_RUN "$@" > log.$APP_NAME 2>&1 fi } @@ -65,9 +65,9 @@ runParallel() #if [ "$WM_SCHEDULER" ] #then # echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2 - # $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )" + # $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > log.$APP_NAME 2>&1 )" #else - ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 ) + ( mpirun -np $nProcs $APP_RUN -parallel "$@" < /dev/null > log.$APP_NAME 2>&1 ) #fi fi } From 26d1064022c98969cc236361bd6f9594af32d46a Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 10:27:30 +0100 Subject: [PATCH 28/35] ENH: Updates to tutorial Allrun scripts --- .../buoyantSimpleFoam/circuitBoardCooling/Allrun | 2 +- tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun | 8 ++++++-- tutorials/lagrangian/reactingParcelFoam/filter/Allrun | 6 ++++-- .../multiphase/interFoam/ras/damBreakPorousBaffle/Allrun | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun index 6de4b18840..ed131900d3 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun @@ -13,7 +13,7 @@ unset FOAM_SETNAN unset FOAM_SIGFPE # Create first baffle -createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite # Create region runApplication extrudeToRegionMesh -overwrite diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun index 84758693b8..2374d2fb6c 100755 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun @@ -16,9 +16,13 @@ unset FOAM_SETNAN # Create faceZones for fan and baffles runApplication topoSet + # Create fan cyclics -createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite +mv log.createBaffles log.createBaffles.1 + # Create wall baffles -createBaffles baffleFaces '(baffles baffles)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles baffleFaces '(baffles baffles)' -overwrite +mv log.createBaffles log.createBaffles.2 runApplication $application diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun index 061be5a02e..b7428e064f 100755 --- a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun @@ -21,10 +21,12 @@ setsToZones -noFlipMap > log.setsToZones 2>&1 # - use binary writing to avoid 'nan' # - use setFields to set values unset FOAM_SIGFPE -createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1 +runApplication createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite +mv log.createBaffles log.createBaffles1 # create the second cyclic - rhs of porous zone -createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1 +runApplication createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite +mv log.createBaffles log.createBaffles2 # Initialise newly created patchFields to 0 runApplication changeDictionary diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun index 29758935af..32c7e6f948 100755 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun @@ -16,7 +16,7 @@ unset FOAM_SETNAN # Create faceZones for porous baffles runApplication topoSet -createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite runApplication changeDictionary From 182f66063435cc4aa6c4e316bacc8b1f4e83bce9 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 10:27:30 +0100 Subject: [PATCH 29/35] ENH: Updates to tutorial Allrun scripts --- .../combustion/engineFoam/kivaTest/Allrun | 30 +++---------------- .../mixerVessel2D/makeMesh | 7 +++-- .../sonicFoam/ras/nacaAirfoil/Allrun | 15 ++-------- .../buoyantCavity/validation/createGraphs | 10 ++++++- .../circuitBoardCooling/Allrun | 2 +- .../MRFSimpleFoam/mixerVessel2D/makeMesh | 10 +++++-- .../pimpleDyMFoam/mixerVesselAMI2D/Allrun | 1 - .../pimpleDyMFoam/mixerVesselAMI2D/makeMesh | 13 ++++++-- .../pimpleFoam/TJunctionFan/Allrun | 8 +++-- .../pimpleFoam/elipsekkLOmega/Allrun | 2 +- .../reactingParcelFoam/filter/Allrun | 6 ++-- .../interFoam/ras/damBreakPorousBaffle/Allrun | 2 +- 12 files changed, 51 insertions(+), 55 deletions(-) diff --git a/tutorials/combustion/engineFoam/kivaTest/Allrun b/tutorials/combustion/engineFoam/kivaTest/Allrun index 21d4983a93..5088aaff7b 100755 --- a/tutorials/combustion/engineFoam/kivaTest/Allrun +++ b/tutorials/combustion/engineFoam/kivaTest/Allrun @@ -7,36 +7,14 @@ cd ${0%/*} || exit 1 # run from this directory # Get application name application=`getApplication` -runKivaToFoam() -{ - if [ -f log.kivaToFoam ] - then - echo "kivaToFoam already run: remove log file to re-run" - else - echo "kivaToFoam: converting kiva file" - kivaToFoam -file $1 > log.kivaToFoam 2>&1 - fi -} - - -restartApplication() -{ - if [ -f log-2.$1 ] - then - echo "$1 already run: remove log file to re-run" - else - echo "Running $1" - $1 > log-2.$1 2>&1 - fi -} - - -runKivaToFoam otape17 +runApplication kivaToFoam -file otape17 cp system/controlDict.1st system/controlDict runApplication $application +mv log.$application log.$application.1 cp system/controlDict.2nd system/controlDict -restartApplication $application +runApplication $application +mv log.$application log.$application.2 # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/makeMesh b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/makeMesh index 937900177c..3d13f36b4f 100755 --- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/makeMesh +++ b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/makeMesh @@ -1,5 +1,8 @@ #!/bin/sh -set -x +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict -blockMesh > log.blockMesh 2>&1 +runApplication blockMesh diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun index 6142b9557c..7ff431e35f 100755 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun @@ -7,24 +7,13 @@ cd ${0%/*} || exit 1 # run from this directory # Get application name application=`getApplication` -runStarToFoam() -{ - if [ -f log.star3ToFoam -o -f log.starToFoam ] - then - echo "star3ToFoam already run on $PWD: remove log file to re-run" - else - echo "star3ToFoam: converting mesh $1" - star3ToFoam $1 > log.star3ToFoam 2>&1 - fi -} +runApplication star3ToFoam prostar/nacaAirfoil -runStarToFoam prostar/nacaAirfoil mv constant/polyMesh/boundary temp sed -e s/"\([\t ]*type[\t ]*\)symmetryPlane"/"\1empty"/g \ temp > constant/polyMesh/boundary rm temp + runApplication $application -# end-of-file - # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs index 2d9ceeb49a..4baed11dac 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs +++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/validation/createGraphs @@ -83,8 +83,16 @@ type -P gnuplot &>/dev/null || { exit 1 } +SETSDIR="../sets" + +if [ ! -d $SETSDIR ] +then + echo "createGraphs: results sets not available in folder $SETSDIR" + exit 0 +fi + # paths to data -LATESTTIME=`ls ../sets` +LATESTTIME=`ls $SETSDIR` OFDATAROOT=../sets/$LATESTTIME EXPTDATAROOT=./exptData diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun index 6de4b18840..ed131900d3 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun @@ -13,7 +13,7 @@ unset FOAM_SETNAN unset FOAM_SIGFPE # Create first baffle -createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite # Create region runApplication extrudeToRegionMesh -overwrite diff --git a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh index 937900177c..8cb3ae622e 100755 --- a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh +++ b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/makeMesh @@ -1,5 +1,11 @@ #!/bin/sh -set -x +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict -blockMesh > log.blockMesh 2>&1 + +runApplication blockMesh + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/Allrun b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/Allrun index 3aa63c00d9..f038377853 100755 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/Allrun @@ -1,7 +1,6 @@ #!/bin/sh cd ${0%/*} || exit 1 # run from this directory - # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/makeMesh b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/makeMesh index edcd0dadfe..937765f7cb 100755 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/makeMesh +++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/makeMesh @@ -1,6 +1,13 @@ #!/bin/sh -set -x +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict -blockMesh > log.blockMesh 2>&1 -topoSet + +runApplication blockMesh + +runApplication topoSet + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun index 84758693b8..2374d2fb6c 100755 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun @@ -16,9 +16,13 @@ unset FOAM_SETNAN # Create faceZones for fan and baffles runApplication topoSet + # Create fan cyclics -createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles cyclicFaces '(fan_half0 fan_half1)' -overwrite +mv log.createBaffles log.createBaffles.1 + # Create wall baffles -createBaffles baffleFaces '(baffles baffles)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles baffleFaces '(baffles baffles)' -overwrite +mv log.createBaffles log.createBaffles.2 runApplication $application diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun index fd85f49a95..656b92f3ad 100755 --- a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun @@ -8,7 +8,7 @@ cd ${0%/*} || exit 1 # run from this directory application=`getApplication` runApplication blockMesh -transformPoints -scale '(1.6666 1 1)' +runApplication transformPoints -scale '(1.6666 1 1)' runApplication changeDictionary -instance system -dict system/changeDictionaryDict.X runApplication mirrorMesh -overwrite diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun index 061be5a02e..b7428e064f 100755 --- a/tutorials/lagrangian/reactingParcelFoam/filter/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allrun @@ -21,10 +21,12 @@ setsToZones -noFlipMap > log.setsToZones 2>&1 # - use binary writing to avoid 'nan' # - use setFields to set values unset FOAM_SIGFPE -createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1 +runApplication createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite +mv log.createBaffles log.createBaffles1 # create the second cyclic - rhs of porous zone -createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1 +runApplication createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite +mv log.createBaffles log.createBaffles2 # Initialise newly created patchFields to 0 runApplication changeDictionary diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun index 29758935af..32c7e6f948 100755 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allrun @@ -16,7 +16,7 @@ unset FOAM_SETNAN # Create faceZones for porous baffles runApplication topoSet -createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite > log.createBaffles 2>&1 +runApplication createBaffles cyclicZoneFaces '(porous_half0 porous_half1)' -overwrite runApplication changeDictionary From af1f43183cb985c9f2b64cf64cfc8d6088b52ebe Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Oct 2012 12:10:56 +0100 Subject: [PATCH 30/35] STYLE: variables: have separate token type --- src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C | 2 +- src/OpenFOAM/db/IOstreams/token/token.H | 5 ++++- src/OpenFOAM/db/IOstreams/token/tokenI.H | 22 ++++++++++++++----- src/OpenFOAM/db/IOstreams/token/tokenIO.C | 15 ++++++++++++- .../primitiveEntry/primitiveEntryIO.C | 2 +- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index a3161386e6..c93aad5a36 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -266,7 +266,7 @@ Foam::Istream& Foam::ISstream::read(token& t) else { t = sPtr; - t.type() = token::STRING; + t.type() = token::VARIABLE; } return *this; } diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 75c946d1d4..a1523fd3ff 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -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 @@ -77,6 +77,7 @@ public: PUNCTUATION, WORD, + VARIABLE, STRING, VERBATIMSTRING, LABEL, @@ -331,6 +332,8 @@ public: inline bool isWord() const; inline const word& wordToken() const; + inline bool isVariable() const; + inline bool isString() const; inline const string& stringToken() const; diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H index dfa6cdf93e..e23fc83679 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenI.H +++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H @@ -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 @@ -39,7 +39,7 @@ inline void token::clear() { delete wordTokenPtr_; } - else if (type_ == STRING || type_ == VERBATIMSTRING) + else if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) { delete stringTokenPtr_; } @@ -88,6 +88,7 @@ inline token::token(const token& t) break; case STRING: + case VARIABLE: case VERBATIMSTRING: stringTokenPtr_ = new string(*t.stringTokenPtr_); break; @@ -235,14 +236,19 @@ inline const word& token::wordToken() const } } +inline bool token::isVariable() const +{ + return (type_ == VARIABLE); +} + inline bool token::isString() const { - return (type_ == STRING || type_ == VERBATIMSTRING); + return (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING); } inline const string& token::stringToken() const { - if (type_ == STRING || type_ == VERBATIMSTRING) + if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) { return *stringTokenPtr_; } @@ -411,6 +417,7 @@ inline void token::operator=(const token& t) break; case STRING: + case VARIABLE: case VERBATIMSTRING: stringTokenPtr_ = new string(*t.stringTokenPtr_); break; @@ -518,6 +525,7 @@ inline bool token::operator==(const token& t) const return *wordTokenPtr_ == *t.wordTokenPtr_; case STRING: + case VARIABLE: case VERBATIMSTRING: return *stringTokenPtr_ == *t.stringTokenPtr_; @@ -552,7 +560,11 @@ inline bool token::operator==(const word& w) const inline bool token::operator==(const string& s) const { - return ((type_ == STRING || type_ == VERBATIMSTRING) && stringToken() == s); + return + ( + (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) + && stringToken() == s + ); } inline bool token::operator==(const label l) const diff --git a/src/OpenFOAM/db/IOstreams/token/tokenIO.C b/src/OpenFOAM/db/IOstreams/token/tokenIO.C index 2aedebe681..b513a4be0e 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenIO.C +++ b/src/OpenFOAM/db/IOstreams/token/tokenIO.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 @@ -74,6 +74,11 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t) os << *t.stringTokenPtr_; break; + case token::VARIABLE: + // Write variable as word so without "" + os.writeQuoted(*t.stringTokenPtr_, false); + break; + case token::LABEL: os << t.labelToken_; break; @@ -157,6 +162,10 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy& ip) os << " the string " << t.stringToken(); break; + case token::VARIABLE: + os << " the variable " << t.stringToken(); + break; + case token::VERBATIMSTRING: os << " the verbatim string " << t.stringToken(); break; @@ -231,6 +240,10 @@ Ostream& operator<<(Ostream& os, const InfoProxy& ip) os << " the string " << t.stringToken(); break; + case token::VARIABLE: + os << " the variable " << t.stringToken(); + break; + case token::VERBATIMSTRING: os << " the verbatim string " << t.stringToken(); break; diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C index d5626972cc..04cb8cf165 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C @@ -55,7 +55,7 @@ void Foam::primitiveEntry::append newElmt(tokenIndex()++) = currToken; } } - else if (currToken.isString()) + else if (currToken.isVariable()) { const string& w = currToken.stringToken(); From 233436f4f77fa2d9cce84267ef3df63473901578 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Oct 2012 14:28:18 +0100 Subject: [PATCH 31/35] ENH: snappyHexMesh: switch on multipatch snapping --- tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict index 520d52950f..a1c0e1162f 100644 --- a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict @@ -186,6 +186,10 @@ snapControls //- Use castellatedMeshControls::features explicitFeatureSnap true; + + //- Detect features between multiple surfaces + // (only for explicitFeatureSnap, default = false) + multiRegionFeatureSnap true; } From e03612c106425814a99ba15e99a39019d3698d88 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Oct 2012 14:33:27 +0100 Subject: [PATCH 32/35] ENH: surfaceFeatureExtract: handle baffles --- .../surfaceFeatureExtract.C | 208 +++++++++++++++++- .../surfaceFeatureExtractDict | 3 +- 2 files changed, 199 insertions(+), 12 deletions(-) diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index d06e5d03cb..b3b390af51 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -25,7 +25,8 @@ Application surfaceFeatureExtract Description - Extracts and writes surface features to file + Extracts and writes surface features to file. All but the basic feature + extraction is WIP. \*---------------------------------------------------------------------------*/ @@ -472,6 +473,176 @@ void unmarkBaffles } +//- Divide into multiple normal bins +// - return REGION if != 2 normals +// - return REGION if 2 normals that make feature angle +// - otherwise return NONE and set normals,bins +surfaceFeatures::edgeStatus checkFlatRegionEdge +( + const triSurface& surf, + const scalar tol, + const scalar includedAngle, + const label edgeI +) +{ + const edge& e = surf.edges()[edgeI]; + const labelList& eFaces = surf.edgeFaces()[edgeI]; + + // Bin according to normal + + DynamicList normals(2); + DynamicList bins(2); + + forAll(eFaces, eFaceI) + { + const Foam::vector& n = surf.faceNormals()[eFaces[eFaceI]]; + + // Find the normal in normals + label index = -1; + forAll(normals, normalI) + { + if (mag(n&normals[normalI]) > (1-tol)) + { + index = normalI; + break; + } + } + + if (index != -1) + { + bins[index].append(eFaceI); + } + else if (normals.size() >= 2) + { + // Would be third normal. Mark as feature. + //Pout<< "** at edge:" << surf.localPoints()[e[0]] + // << surf.localPoints()[e[1]] + // << " have normals:" << normals + // << " and " << n << endl; + return surfaceFeatures::REGION; + } + else + { + normals.append(n); + bins.append(labelList(1, eFaceI)); + } + } + + + // Check resulting number of bins + if (bins.size() == 1) + { + // Note: should check here whether they are two sets of faces + // that are planar or indeed 4 faces al coming together at an edge. + //Pout<< "** at edge:" + // << surf.localPoints()[e[0]] + // << surf.localPoints()[e[1]] + // << " have single normal:" << normals[0] + // << endl; + return surfaceFeatures::NONE; + } + else + { + // Two bins. Check if normals make an angle + + //Pout<< "** at edge:" + // << surf.localPoints()[e[0]] + // << surf.localPoints()[e[1]] << nl + // << " normals:" << normals << nl + // << " bins :" << bins << nl + // << endl; + + if (includedAngle >= 0) + { + scalar minCos = Foam::cos(degToRad(180.0 - includedAngle)); + + forAll(eFaces, i) + { + const Foam::vector& ni = surf.faceNormals()[eFaces[i]]; + for (label j=i+1; j 0) + { + regionAndNormal[i] = t.region()+1; + } + else if (dir == 0) + { + FatalErrorIn("problem.") + << exit(FatalError); + } + else + { + regionAndNormal[i] = -(t.region()+1); + } + } + + // 2. check against bin1 + const labelList& bin1 = bins[1]; + labelList regionAndNormal1(bin1.size()); + forAll(bin1, i) + { + const labelledTri& t = surf.localFaces()[eFaces[bin1[i]]]; + int dir = t.edgeDirection(e); + + label myRegionAndNormal; + if (dir > 0) + { + myRegionAndNormal = t.region()+1; + } + else + { + myRegionAndNormal = -(t.region()+1); + } + + regionAndNormal1[i] = myRegionAndNormal; + + label index = findIndex(regionAndNormal, -myRegionAndNormal); + if (index == -1) + { + // Not found. + //Pout<< "cannot find region " << myRegionAndNormal + // << " in regions " << regionAndNormal << endl; + + return surfaceFeatures::REGION; + } + } + + // Passed all checks, two normal bins with the same contents. + //Pout<< "regionAndNormal:" << regionAndNormal << endl; + //Pout<< "myRegionAndNormal:" << regionAndNormal1 << endl; + + return surfaceFeatures::NONE; + } +} + + void writeStats(const extendedFeatureEdgeMesh& fem, Ostream& os) { os << " points : " << fem.points().size() << nl @@ -610,6 +781,8 @@ int main(int argc, char *argv[]) surfaceFeatures set(surf); + scalar includedAngle = -1; + if (extractionMethod == "extractFromFile") { const fileName featureEdgeFile = @@ -630,14 +803,13 @@ int main(int argc, char *argv[]) } else if (extractionMethod == "extractFromSurface") { - const scalar includedAngle = - readScalar + includedAngle = readScalar + ( + surfaceDict.subDict("extractFromSurfaceCoeffs").lookup ( - surfaceDict.subDict("extractFromSurfaceCoeffs").lookup - ( - "includedAngle" - ) - ); + "includedAngle" + ) + ); Info<< nl << "Constructing feature set from included angle " << includedAngle << endl; @@ -727,13 +899,27 @@ int main(int argc, char *argv[]) if (!nonManifoldEdges) { Info<< "Removing all non-manifold edges" - << " (edges with > 2 connected faces)" << endl; + << " (edges with > 2 connected faces) unless they" + << " cross multiple regions" << endl; forAll(edgeStat, edgeI) { - if (surf.edgeFaces()[edgeI].size() > 2) + const labelList& eFaces = surf.edgeFaces()[edgeI]; + + if + ( + eFaces.size() > 2 + && edgeStat[edgeI] == surfaceFeatures::REGION + && (eFaces.size() % 2) == 0 + ) { - edgeStat[edgeI] = surfaceFeatures::NONE; + edgeStat[edgeI] = checkFlatRegionEdge + ( + surf, + 1e-5, //tol, + includedAngle, + edgeI + ); } } } diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict index 6c1eab66e9..a52ebdfa55 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtractDict @@ -69,7 +69,8 @@ surface2.nas // Keep edges outside the box: outsideBox (0 0 0)(1 1 1); - // Keep nonManifold edges (edges with >2 connected faces) + // Keep nonManifold edges (edges with >2 connected faces where + // the faces form more than two different normal planes) nonManifoldEdges yes; // Keep open edges (edges with 1 connected face) From d1c3327d200101b789b2752d378ed7f39fcc15fa Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Oct 2012 14:39:39 +0100 Subject: [PATCH 33/35] COMP: foamDebugSwithces: extraneous lib --- .../utilities/miscellaneous/foamDebugSwitches/Make/options | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 6fe40ed9f1..6fa4104188 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -60,7 +60,6 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -lsurfMesh \ -lsystemCall \ - -lthermalPorousZone \ -lthermophysicalFunctions \ -ltopoChangerFvMesh \ -ltriSurface \ From 2746ec87644bac14a6b28f57f9caa66a59c2542e Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 26 Oct 2012 14:40:04 +0100 Subject: [PATCH 34/35] ENH: snappyHexMeshDict: updated comment --- .../utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index b3be8fe96f..f0cc40a8e4 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -245,6 +245,10 @@ snapControls //- Use castellatedMeshControls::features (default = true) explicitFeatureSnap true; + + //- Detect features between multiple surfaces + // (only for explicitFeatureSnap, default = false) + multiRegionFeatureSnap false; } // Settings for the layer addition. From aa0a47bdfe8967404545ab6532796fdce13e0dc4 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 26 Oct 2012 14:59:34 +0100 Subject: [PATCH 35/35] ENH: Updates to jump BCs --- .../jumpCyclic/jumpCyclicFvPatchField.C | 18 ++++++++---------- .../derived/fan/fanFvPatchFields.C | 3 +-- .../derived/fixedJump/fixedJumpFvPatchField.C | 1 - .../uniformJump/uniformJumpFvPatchField.C | 5 ++--- .../uniformJumpAMIFvPatchField.C | 1 - 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index 67bc7f96db..db6849d267 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -77,7 +77,6 @@ jumpCyclicFvPatchField::jumpCyclicFvPatchField const jumpCyclicFvPatchField& ptf ) : - cyclicLduInterfaceField(), cyclicFvPatchField(ptf) {} @@ -105,12 +104,11 @@ tmp > jumpCyclicFvPatchField::patchNeighbourField() const tmp > tpnf(new Field(this->size())); Field& pnf = tpnf(); - tmp > tjf = jump(); + Field jf(this->jump()); if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); if (this->doTransform()) { @@ -152,12 +150,12 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix // for AMG solve - only apply jump to finest level if (psiInternal.size() == this->internalField().size()) { - tmp > tjf = jump()().component(cmpt); + Field jf(this->jump()().component(cmpt)); + if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); forAll(*this, facei) { @@ -201,12 +199,12 @@ void jumpCyclicFvPatchField::updateInterfaceMatrix // for AMG solve - only apply jump to finest level if (psiInternal.size() == this->internalField().size()) { - tmp > tjf = jump(); + Field jf(this->jump()); + if (!this->cyclicPatch().owner()) { - tjf = -tjf; + jf *= -1.0; } - const Field& jf = tjf(); forAll(*this, facei) { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 1c8e934892..668d43483d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -95,11 +95,10 @@ Foam::fanFvPatchField::fanFvPatchField } else { - // Generic input constructed from dictionary + // Dummy jump table this->jumpTable_.reset(new DataEntry("jumpTable")); } - if (dict.found("value")) { fvPatchScalarField::operator= diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index eb997abf36..e58270ec63 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -72,7 +72,6 @@ Foam::fixedJumpFvPatchField::fixedJumpFvPatchField const fixedJumpFvPatchField& ptf ) : - cyclicLduInterfaceField(), jumpCyclicFvPatchField(ptf), jump_(ptf.jump_) {} diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C index 88e7578141..c4ee64eaa8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -109,9 +109,9 @@ Foam::tmp > Foam::uniformJumpFvPatchField::jump() const { if (this->cyclicPatch().owner()) { - Type j = jumpTable_->value(this->db().time().value()); + const Type value = jumpTable_->value(this->db().time().value()); - return tmp >(new Field(this->size(), j)); + return tmp >(new Field(this->patch().size(), value)); } else { @@ -134,7 +134,6 @@ void Foam::uniformJumpFvPatchField::write(Ostream& os) const { jumpTable_->writeData(os); } - this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C index cb9ff6cd90..a3e1fe6591 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -132,7 +132,6 @@ void Foam::uniformJumpAMIFvPatchField::write(Ostream& os) const { jumpTable_->writeData(os); } - this->writeEntry("value", os); }