From 7dc6dd9a21ffc3ac8f3e6baba663da73e7223b2f Mon Sep 17 00:00:00 2001 From: Zeljko Tukovic Date: Tue, 26 Oct 2010 23:05:25 +0200 Subject: [PATCH] Added cyclic, symmetry and slip faPatchFields --- src/finiteArea/Make/files | 8 +- .../basicSymmetry/basicSymmetryFaPatchField.C | 152 ++++++++++++ .../basicSymmetry/basicSymmetryFaPatchField.H | 170 ++++++++++++++ .../basicSymmetryFaPatchFields.C | 45 ++++ .../basicSymmetryFaPatchFields.H | 50 ++++ .../basicSymmetryFaPatchScalarField.C | 60 +++++ .../constraint/cyclic/cyclicFaPatchField.C | 217 ++++++++++++++++++ .../constraint/cyclic/cyclicFaPatchField.H | 212 +++++++++++++++++ .../constraint/cyclic/cyclicFaPatchFields.C | 45 ++++ .../constraint/cyclic/cyclicFaPatchFields.H | 50 ++++ .../cyclic/cyclicFaPatchFieldsFwd.H | 52 +++++ .../symmetry/symmetryFaPatchField.C | 135 +++++++++++ .../symmetry/symmetryFaPatchField.H | 139 +++++++++++ .../symmetry/symmetryFaPatchFields.C | 44 ++++ .../symmetry/symmetryFaPatchFields.H | 50 ++++ .../symmetry/symmetryFaPatchFieldsFwd.H | 52 +++++ .../derived/slip/slipFaPatchField.C | 97 ++++++++ .../derived/slip/slipFaPatchField.H | 138 +++++++++++ .../derived/slip/slipFaPatchFields.C | 44 ++++ .../derived/slip/slipFaPatchFields.H | 50 ++++ .../derived/slip/slipFaPatchFieldsFwd.H | 52 +++++ .../constraint/cyclic/cyclicFaePatchField.C | 136 +++++++++++ .../constraint/cyclic/cyclicFaePatchField.H | 144 ++++++++++++ .../constraint/cyclic/cyclicFaePatchFields.C | 44 ++++ .../constraint/cyclic/cyclicFaePatchFields.H | 50 ++++ .../cyclic/cyclicFaePatchFieldsFwd.H | 52 +++++ .../symmetry/symmetryFaePatchField.C | 131 +++++++++++ .../symmetry/symmetryFaePatchField.H | 139 +++++++++++ .../symmetry/symmetryFaePatchFields.C | 44 ++++ .../symmetry/symmetryFaePatchFields.H | 50 ++++ .../symmetry/symmetryFaePatchFieldsFwd.H | 52 +++++ 31 files changed, 2703 insertions(+), 1 deletion(-) create mode 100644 src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.C create mode 100644 src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.H create mode 100644 src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.C create mode 100644 src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.H create mode 100644 src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFieldsFwd.H create mode 100644 src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.C create mode 100644 src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H create mode 100644 src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.C create mode 100644 src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.H create mode 100644 src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.C create mode 100644 src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.C create mode 100644 src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFieldsFwd.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.C create mode 100644 src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.C create mode 100644 src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.H create mode 100644 src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFieldsFwd.H diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files index 0e382891c..f9d236778 100644 --- a/src/finiteArea/Make/files +++ b/src/finiteArea/Make/files @@ -17,6 +17,8 @@ faPatchFields = fields/faPatchFields $(faPatchFields)/faPatchField/faPatchFields.C basicFaPatchFields = $(faPatchFields)/basic +$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C +$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchScalarField.C $(basicFaPatchFields)/calculated/calculatedFaPatchFields.C $(basicFaPatchFields)/coupled/coupledFaPatchFields.C $(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C @@ -32,10 +34,13 @@ $(constraintFaPatchFields)/processor/processorFaPatchFields.C $(constraintFaPatchFields)/processor/processorFaPatchScalarField.C $(constraintFaPatchFields)/wedge/wedgeFaPatchFields.C $(constraintFaPatchFields)/wedge/wedgeFaPatchScalarField.C +$(constraintFaPatchFields)/cyclic/cyclicFaPatchFields.C +$(constraintFaPatchFields)/symmetry/symmetryFaPatchFields.C derivedFaPatchFields = $(faPatchFields)/derived $(derivedFaPatchFields)/fixedValueOutflow/fixedValueOutflowFaPatchFields.C $(derivedFaPatchFields)/inletOutlet/inletOutletFaPatchFields.C +$(derivedFaPatchFields)/slip/slipFaPatchFields.C faePatchFields = fields/faePatchFields $(faePatchFields)/faePatchField/faePatchFields.C @@ -49,7 +54,8 @@ constraintFaePatchFields = $(faePatchFields)/constraint $(constraintFaePatchFields)/empty/emptyFaePatchFields.C $(constraintFaePatchFields)/processor/processorFaePatchFields.C $(constraintFaePatchFields)/wedge/wedgeFaePatchFields.C - +$(constraintFaePatchFields)/cyclic/cyclicFaePatchFields.C +$(constraintFaePatchFields)/symmetry/symmetryFaePatchFields.C fields/areaFields/areaFields.C fields/edgeFields/edgeFields.C diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.C b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.C new file mode 100644 index 000000000..327d1bcad --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.C @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicSymmetryFaPatchField.H" +#include "symmTransformField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +basicSymmetryFaPatchField::basicSymmetryFaPatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + transformFaPatchField(p, iF) +{} + + +template +basicSymmetryFaPatchField::basicSymmetryFaPatchField +( + const basicSymmetryFaPatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + transformFaPatchField(ptf, p, iF, mapper) +{} + + +template +basicSymmetryFaPatchField::basicSymmetryFaPatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + transformFaPatchField(p, iF, dict) +{ + this->evaluate(); +} + + +template +basicSymmetryFaPatchField::basicSymmetryFaPatchField +( + const basicSymmetryFaPatchField& ptf +) +: + transformFaPatchField(ptf) +{} + + +template +basicSymmetryFaPatchField::basicSymmetryFaPatchField +( + const basicSymmetryFaPatchField& ptf, + const DimensionedField& iF +) +: + transformFaPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +// Return gradient at boundary +template +tmp > basicSymmetryFaPatchField::snGrad() const +{ + vectorField nHat = this->patch().edgeNormals(); + return + ( + transform(I - 2.0*sqr(nHat), this->patchInternalField()) + - this->patchInternalField() + )*(this->patch().deltaCoeffs()/2.0); +} + + +// Evaluate the field on the patch +template +void basicSymmetryFaPatchField::evaluate(const Pstream::commsTypes) +{ + if (!this->updated()) + { + this->updateCoeffs(); + } + + vectorField nHat = this->patch().edgeNormals(); + Field::operator= + ( + ( + this->patchInternalField() + + transform(I - 2.0*sqr(nHat), this->patchInternalField()) + )/2.0 + ); + + transformFaPatchField::evaluate(); +} + + +// Return defining fields +template +tmp > basicSymmetryFaPatchField::snGradTransformDiag() const +{ + vectorField nHat = this->patch().edgeNormals(); + vectorField diag(nHat.size()); + + diag.replace(vector::X, mag(nHat.component(vector::X))); + diag.replace(vector::Y, mag(nHat.component(vector::Y))); + diag.replace(vector::Z, mag(nHat.component(vector::Z))); + + return transformFieldMask(pow::rank>(diag)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H new file mode 100644 index 000000000..1c05e7597 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchField.H @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::basicSymmetryFaPatchField + +Description + A symmetry patch + +SourceFiles + basicSymmetryFaPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicSymmetryFaPatchField_H +#define basicSymmetryFaPatchField_H + +#include "transformFaPatchField.H" +#include "symmetryFaPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicSymmetryFaPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class basicSymmetryFaPatchField +: + public transformFaPatchField +{ + +public: + + //- Runtime type information + TypeName(symmetryFaPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + basicSymmetryFaPatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + basicSymmetryFaPatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given basicSymmetryFaPatchField onto a new patch + basicSymmetryFaPatchField + ( + const basicSymmetryFaPatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + basicSymmetryFaPatchField + ( + const basicSymmetryFaPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new basicSymmetryFaPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + basicSymmetryFaPatchField + ( + const basicSymmetryFaPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new basicSymmetryFaPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Return gradient at boundary + virtual tmp > snGrad() const; + + //- Evaluate the patch field + // Default argument needed to allow call in constructors + // HJ, 30/Jun/2009 + virtual void evaluate + ( + const Pstream::commsTypes commsType = Pstream::blocking + ); + + //- Return face-gradient transform diagonal + virtual tmp > snGradTransformDiag() const; +}; + + +// * * * * * * * * * * * Template Specialisations * * * * * * * * * * * * * // + +template<> +tmp basicSymmetryFaPatchField::snGrad() const; + +template<> +void basicSymmetryFaPatchField::evaluate +( + const Pstream::commsTypes commsType +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "basicSymmetryFaPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.C b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.C new file mode 100644 index 000000000..19b204bc7 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicSymmetryFaPatchFields.H" +#include "faPatchFields.H" +#include "areaMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaPatchFields(basicSymmetry); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.H b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.H new file mode 100644 index 000000000..75347acc6 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef basicSymmetryFaPatchFields_H +#define basicSymmetryFaPatchFields_H + +#include "basicSymmetryFaPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaPatchTypeFieldTypedefs(basicSymmetry) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C new file mode 100644 index 000000000..acf403c7c --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/basic/basicSymmetry/basicSymmetryFaPatchScalarField.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicSymmetryFaPatchField.H" +#include "areaFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<> +tmp basicSymmetryFaPatchField::snGrad() const +{ + return tmp(new scalarField(size(), 0.0)); +} + + +template<> +void basicSymmetryFaPatchField::evaluate(const Pstream::commsTypes) +{ + if (!updated()) + { + updateCoeffs(); + } + scalarField::operator=(patchInternalField()); + transformFaPatchField::evaluate(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.C new file mode 100644 index 000000000..f49649a61 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchField.C @@ -0,0 +1,217 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +cyclicFaPatchField::cyclicFaPatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + coupledFaPatchField(p, iF), + cyclicPatch_(refCast(p)) +{} + + +template +cyclicFaPatchField::cyclicFaPatchField +( + const cyclicFaPatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + coupledFaPatchField(ptf, p, iF, mapper), + cyclicPatch_(refCast(p)) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "cyclicFaPatchField::cyclicFaPatchField\n" + "(\n" + " const cyclicFaPatchField& ptf,\n" + " const faPatch& p,\n" + " const DimensionedField& iF,\n" + " const faPatchFieldMapper& mapper\n" + ")\n" + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } +} + + +template +cyclicFaPatchField::cyclicFaPatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + coupledFaPatchField(p, iF, dict), + cyclicPatch_(refCast(p)) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "cyclicFaPatchField::cyclicFaPatchField\n" + "(\n" + " const faPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } + + this->evaluate(Pstream::blocking); +} + + +template +cyclicFaPatchField::cyclicFaPatchField +( + const cyclicFaPatchField& ptf +) +: + cyclicLduInterfaceField(), + coupledFaPatchField(ptf), + cyclicPatch_(ptf.cyclicPatch_) +{} + + +template +cyclicFaPatchField::cyclicFaPatchField +( + const cyclicFaPatchField& ptf, + const DimensionedField& iF +) +: + coupledFaPatchField(ptf, iF), + cyclicPatch_(ptf.cyclicPatch_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +tmp > cyclicFaPatchField::patchNeighbourField() const +{ + const Field& iField = this->internalField(); + const unallocLabelList& faceCells = cyclicPatch_.faceCells(); + + tmp > tpnf(new Field(this->size())); + Field& pnf = tpnf(); + + label sizeby2 = this->size()/2; + + if (doTransform()) + { + for (label facei=0; facei +void cyclicFaPatchField::updateInterfaceMatrix +( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix&, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes +) const +{ + scalarField pnf(this->size()); + + label sizeby2 = this->size()/2; + const unallocLabelList& faceCells = cyclicPatch_.faceCells(); + + for (label facei=0; facei +class cyclicFaPatchField +: + virtual public cyclicLduInterfaceField, + public coupledFaPatchField +{ + // Private data + + //- Local reference cast into the cyclic patch + const cyclicFaPatch& cyclicPatch_; + + + // Private member functions + + //- Return neighbour side field given internal fields + template + tmp > neighbourSideField + ( + const Field& + ) const; + + +public: + + //- Runtime type information + TypeName(cyclicFaPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + cyclicFaPatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + cyclicFaPatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given cyclicFaPatchField onto a new patch + cyclicFaPatchField + ( + const cyclicFaPatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + cyclicFaPatchField + ( + const cyclicFaPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new cyclicFaPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + cyclicFaPatchField + ( + const cyclicFaPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new cyclicFaPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Retirn local reference cast into the cyclic patch + const cyclicFaPatch& cyclicPatch() const + { + return cyclicPatch_; + } + + + // Evaluation functions + + //- Return neighbour coupled given internal cell data + virtual tmp > patchNeighbourField() const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + const scalarField& psiInternal, + scalarField& result, + const lduMatrix&, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType + ) const; + + + //- Cyclic coupled interface functions + + //- Does the patch field perform the transfromation + virtual bool doTransform() const + { + return !(cyclicPatch_.parallel() || pTraits::rank == 0); + } + + //- Return face transformation tensor + virtual const tensorField& forwardT() const + { + return cyclicPatch_.forwardT(); + } + + //- Return neighbour-cell transformation tensor + virtual const tensorField& reverseT() const + { + return cyclicPatch_.reverseT(); + } + + //- Return rank of component for transform + virtual int rank() const + { + return pTraits::rank; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "cyclicFaPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.C b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.C new file mode 100644 index 000000000..bbc5051cf --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicFaPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "areaMesh.H" +#include "areaFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaPatchFields(cyclic); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.H new file mode 100644 index 000000000..de9ebbc2e --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaPatchFields_H +#define cyclicFaPatchFields_H + +#include "cyclicFaPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaPatchTypeFieldTypedefs(cyclic) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFieldsFwd.H new file mode 100644 index 000000000..7677022f0 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/cyclic/cyclicFaPatchFieldsFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaPatchFieldsFwd_H +#define cyclicFaPatchFieldsFwd_H + +// #include "faPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class cyclicFaPatchField; + +makeFaPatchTypeFieldTypedefs(cyclic) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.C new file mode 100644 index 000000000..7c794e3f9 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.C @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "symmetryFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +symmetryFaPatchField::symmetryFaPatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + basicSymmetryFaPatchField(p, iF) +{} + + +template +symmetryFaPatchField::symmetryFaPatchField +( + const symmetryFaPatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + basicSymmetryFaPatchField(ptf, p, iF, mapper) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "symmetryFaPatchField::symmetryFaPatchField\n" + "(\n" + " const symmetryFaPatchField& ptf,\n" + " const faPatch& p,\n" + " const DimensionedField& iF,\n" + " const faPatchFieldMapper& mapper\n" + ")\n" + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } +} + + +template +symmetryFaPatchField::symmetryFaPatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + basicSymmetryFaPatchField(p, iF, dict) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "symmetryFaPatchField::symmetryFaPatchField\n" + "(\n" + " const faPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } +} + + +template +symmetryFaPatchField::symmetryFaPatchField +( + const symmetryFaPatchField& ptf +) +: + basicSymmetryFaPatchField(ptf) +{} + + +template +symmetryFaPatchField::symmetryFaPatchField +( + const symmetryFaPatchField& ptf, + const DimensionedField& iF +) +: + basicSymmetryFaPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H new file mode 100644 index 000000000..1dddc7091 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchField.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::symmetryFaPatchField + +Description + Foam::symmetryFaPatchField + +SourceFiles + symmetryFaPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaPatchField_H +#define symmetryFaPatchField_H + +#include "basicSymmetryFaPatchField.H" +#include "symmetryFaPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryFaPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class symmetryFaPatchField +: + public basicSymmetryFaPatchField +{ + +public: + + //- Runtime type information + TypeName(symmetryFaPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + symmetryFaPatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + symmetryFaPatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given symmetryFaPatchField onto a new patch + symmetryFaPatchField + ( + const symmetryFaPatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + symmetryFaPatchField + ( + const symmetryFaPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new symmetryFaPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + symmetryFaPatchField + ( + const symmetryFaPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new symmetryFaPatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "symmetryFaPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.C b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.C new file mode 100644 index 000000000..c666b972f --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "symmetryFaPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "areaFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaPatchFields(symmetry); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.H b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.H new file mode 100644 index 000000000..88965601b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaPatchFields_H +#define symmetryFaPatchFields_H + +#include "symmetryFaPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaPatchTypeFieldTypedefs(symmetry) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFieldsFwd.H new file mode 100644 index 000000000..5eac5da6b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/constraint/symmetry/symmetryFaPatchFieldsFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaPatchFieldsFwd_H +#define symmetryFaPatchFieldsFwd_H + +#include "faPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class symmetryFaPatchField; + +makeFaPatchTypeFieldTypedefs(symmetry) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.C b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.C new file mode 100644 index 000000000..264af2962 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "slipFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +slipFaPatchField::slipFaPatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + basicSymmetryFaPatchField(p, iF) +{} + + +template +slipFaPatchField::slipFaPatchField +( + const slipFaPatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + basicSymmetryFaPatchField(ptf, p, iF, mapper) +{} + + +template +slipFaPatchField::slipFaPatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + basicSymmetryFaPatchField(p, iF, dict) +{} + + +template +slipFaPatchField::slipFaPatchField +( + const slipFaPatchField& ptf, + const DimensionedField& iF +) +: + basicSymmetryFaPatchField(ptf, iF) +{} + + +template +slipFaPatchField::slipFaPatchField +( + const slipFaPatchField& ptf +) +: + basicSymmetryFaPatchField(ptf) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H new file mode 100644 index 000000000..819db7354 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchField.H @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::slipFaPatchField + +Description + Foam::slipFaPatchField + +SourceFiles + slipFaPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef slipFaPatchField_H +#define slipFaPatchField_H + +#include "basicSymmetryFaPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class slipFaPatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class slipFaPatchField +: + public basicSymmetryFaPatchField +{ + +public: + + //- Runtime type information + TypeName("slip"); + + + // Constructors + + //- Construct from patch and internal field + slipFaPatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + slipFaPatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given slipFaPatchField onto a new patch + slipFaPatchField + ( + const slipFaPatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + slipFaPatchField + ( + const slipFaPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new slipFaPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + slipFaPatchField + ( + const slipFaPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new slipFaPatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "slipFaPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.C b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.C new file mode 100644 index 000000000..91cae961b --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "slipFaPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "areaFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaPatchFields(slip); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.H b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.H new file mode 100644 index 000000000..adbe571c0 --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef slipFaPatchFields_H +#define slipFaPatchFields_H + +#include "slipFaPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaPatchTypeFieldTypedefs(slip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFieldsFwd.H new file mode 100644 index 000000000..f38b1594f --- /dev/null +++ b/src/finiteArea/fields/faPatchFields/derived/slip/slipFaPatchFieldsFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef slipFaPatchFieldsFwd_H +#define slipFaPatchFieldsFwd_H + +#include "faPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class slipFaPatchField; + +makeFaPatchTypeFieldTypedefs(slip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.C b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.C new file mode 100644 index 000000000..fcec13828 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.C @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicFaePatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +cyclicFaePatchField::cyclicFaePatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + coupledFaePatchField(p, iF), + cyclicPatch_(refCast(p)) +{} + + +template +cyclicFaePatchField::cyclicFaePatchField +( + const cyclicFaePatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + coupledFaePatchField(ptf, p, iF, mapper), + cyclicPatch_(refCast(p)) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "cyclicFaePatchField::cyclicFaePatchField\n" + "(\n" + " const cyclicFaePatchField& ptf,\n" + " const faPatch& p,\n" + " const DimensionedField& iF,\n" + " const faPatchFieldMapper& mapper\n" + ")\n" + ) << "Field type does not correspond to patch type for patch " + << this->patch().index() << "." << endl + << "Field type: " << typeName << endl + << "Patch type: " << this->patch().type() + << exit(FatalError); + } +} + + +template +cyclicFaePatchField::cyclicFaePatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + coupledFaePatchField(p, iF, dict), + cyclicPatch_(refCast(p)) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "cyclicFaePatchField::cyclicFaePatchField\n" + "(\n" + " const faPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "patch " << this->patch().index() << " not cyclic type. " + << "Patch type = " << p.type() + << exit(FatalIOError); + } +} + + +template +cyclicFaePatchField::cyclicFaePatchField +( + const cyclicFaePatchField& ptf +) +: + coupledFaePatchField(ptf), + cyclicPatch_(ptf.cyclicPatch_) +{} + + +template +cyclicFaePatchField::cyclicFaePatchField +( + const cyclicFaePatchField& ptf, + const DimensionedField& iF +) +: + coupledFaePatchField(ptf, iF), + cyclicPatch_(ptf.cyclicPatch_) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H new file mode 100644 index 000000000..575843257 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchField.H @@ -0,0 +1,144 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicFaePatchField + +Description + Foam::cyclicFaePatchField + +SourceFiles + cyclicFaePatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaePatchField_H +#define cyclicFaePatchField_H + +#include "coupledFaePatchField.H" +#include "cyclicFaPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicFaePatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class cyclicFaePatchField +: + public coupledFaePatchField +{ + // Private data + + //- Local reference cast into the cyclic patch + const cyclicFaPatch& cyclicPatch_; + + +public: + + //- Runtime type information + TypeName(cyclicFaPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + cyclicFaePatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + cyclicFaePatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given cyclicFaePatchField onto a new patch + cyclicFaePatchField + ( + const cyclicFaePatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + cyclicFaePatchField + ( + const cyclicFaePatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new cyclicFaePatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + cyclicFaePatchField + ( + const cyclicFaePatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new cyclicFaePatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "cyclicFaePatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.C b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.C new file mode 100644 index 000000000..ede5b3c10 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicFaePatchFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaePatchFields(cyclic); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.H b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.H new file mode 100644 index 000000000..20f8d7150 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaePatchFields_H +#define cyclicFaePatchFields_H + +#include "cyclicFaePatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaePatchTypeFieldTypedefs(cyclic) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFieldsFwd.H b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFieldsFwd.H new file mode 100644 index 000000000..f3c2ac4a7 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/cyclic/cyclicFaePatchFieldsFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicFaePatchFieldsFwd_H +#define cyclicFaePatchFieldsFwd_H + +#include "faePatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class cyclicFaePatchField; + +makeFaePatchTypeFieldTypedefs(cyclic) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.C b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.C new file mode 100644 index 000000000..5ad44891d --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.C @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "symmetryFaePatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +symmetryFaePatchField::symmetryFaePatchField +( + const faPatch& p, + const DimensionedField& iF +) +: + faePatchField(p, iF) +{} + + +template +symmetryFaePatchField::symmetryFaePatchField +( + const symmetryFaePatchField& ptf, + const faPatch& p, + const DimensionedField& iF, + const faPatchFieldMapper& mapper +) +: + faePatchField(ptf, p, iF, mapper) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "symmetryFaePatchField::symmetryFaePatchField\n" + "(\n" + " const symmetryFaePatchField& ptf,\n" + " const faPatch& p,\n" + " const DimensionedField& iF,\n" + " const faPatchFieldMapper& mapper\n" + ")\n" + ) << "Field type does not correspond to patch type for patch " + << this->patch().index() << "." << endl + << "Field type: " << typeName << endl + << "Patch type: " << this->patch().type() + << exit(FatalError); + } +} + + +template +symmetryFaePatchField::symmetryFaePatchField +( + const faPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + faePatchField(p, iF, dict) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "symmetryFaePatchField::symmetryFaePatchField\n" + "(\n" + " const faPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "patch " << this->patch().index() << " not symmetry type. " + << "Patch type = " << p.type() + << exit(FatalIOError); + } +} + + +template +symmetryFaePatchField::symmetryFaePatchField +( + const symmetryFaePatchField& ptf +) +: + faePatchField(ptf) +{} + + +template +symmetryFaePatchField::symmetryFaePatchField +( + const symmetryFaePatchField& ptf, + const DimensionedField& iF +) +: + faePatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H new file mode 100644 index 000000000..8d8824195 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchField.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::symmetryFaePatchField + +Description + Foam::symmetryFaePatchField + +SourceFiles + symmetryFaePatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaePatchField_H +#define symmetryFaePatchField_H + +#include "faePatchField.H" +#include "symmetryFaPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryFaePatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class symmetryFaePatchField +: + public faePatchField +{ + +public: + + //- Runtime type information + TypeName(symmetryFaPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + symmetryFaePatchField + ( + const faPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + symmetryFaePatchField + ( + const faPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given symmetryFaePatchField onto a new patch + symmetryFaePatchField + ( + const symmetryFaePatchField&, + const faPatch&, + const DimensionedField&, + const faPatchFieldMapper& + ); + + //- Construct as copy + symmetryFaePatchField + ( + const symmetryFaePatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new symmetryFaePatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + symmetryFaePatchField + ( + const symmetryFaePatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new symmetryFaePatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "symmetryFaePatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.C b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.C new file mode 100644 index 000000000..18876faef --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "symmetryFaePatchFields.H" +#include "faePatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFaePatchFields(symmetry); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.H b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.H new file mode 100644 index 000000000..6f7eb5f57 --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaePatchFields_H +#define symmetryFaePatchFields_H + +#include "symmetryFaePatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFaePatchTypeFieldTypedefs(symmetry) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFieldsFwd.H b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFieldsFwd.H new file mode 100644 index 000000000..27e5a06cd --- /dev/null +++ b/src/finiteArea/fields/faePatchFields/constraint/symmetry/symmetryFaePatchFieldsFwd.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryFaePatchFieldsFwd_H +#define symmetryFaePatchFieldsFwd_H + +#include "faPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class symmetryFaePatchField; + +makeFaePatchTypeFieldTypedefs(symmetry) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //