Commit 3f5eda25 authored by Henry's avatar Henry
Browse files

symmetryPlane: add symmetryPlane as a special type of symmetry condition applied to a single plane

    The standard/previous general symmetry type is now named symmetry
    both in class and lookup name for consistency.  The rigorous
    symmetryPlane type is needed for moving-mesh cases in which the
    motion it constrained by one or two planes.
parent 7c54adb1
......@@ -33,6 +33,7 @@ using std::ios;
#include "fluentFvMesh.H"
#include "primitiveMesh.H"
#include "wallFvPatch.H"
#include "symmetryPlaneFvPatch.H"
#include "symmetryFvPatch.H"
#include "cellModeller.H"
......@@ -177,7 +178,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
{
fluentMeshFile << 3;
}
else if (isA<symmetryFvPatch>(boundary()[patchI]))
else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
)
{
fluentMeshFile << 7;
}
......@@ -280,7 +285,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
{
fluentMeshFile << "wall ";
}
else if (isA<symmetryFvPatch>(boundary()[patchI]))
else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
)
{
fluentMeshFile << "symmetry ";
}
......
......@@ -33,6 +33,7 @@ Description
#include "fvCFD.H"
#include "pointFields.H"
#include "emptyPolyPatch.H"
#include "symmetryPlanePolyPatch.H"
#include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H"
#include "OSspecific.H"
......@@ -286,6 +287,8 @@ int main(int argc, char *argv[])
(
!isType<emptyPolyPatch>
(patches[patchNo])
&& !isType<symmetryPlanePolyPatch>
(patches[patchNo])
&& !isType<symmetryPolyPatch>
(patches[patchNo])
&& !isType<wedgePolyPatch>
......
......@@ -51,6 +51,11 @@ symmetryPlane
type symmetryPlane;
}
symmetry
{
type symmetry;
}
wedge
{
type wedge;
......
......@@ -813,6 +813,7 @@ DebugSwitches
symmTensorAverageField 0;
symmTensorField 0;
symmetryPlane 0;
symmetry 0;
syringePressure 0;
tensorAverageField 0;
tensorField 0;
......
......@@ -409,6 +409,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
$(constraintPolyPatches)/processor/processorPolyPatch.C
$(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C
$(constraintPolyPatches)/symmetry/symmetryPolyPatch.C
$(constraintPolyPatches)/wedge/wedgePolyPatch.C
......@@ -528,6 +529,7 @@ $(constraintPointPatches)/empty/emptyPointPatch.C
$(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C
$(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
$(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C
$(constraintPointPatches)/symmetry/symmetryPointPatch.C
$(constraintPointPatches)/wedge/wedgePointPatch.C
......@@ -597,6 +599,7 @@ $(constraintPointPatchFields)/empty/emptyPointPatchFields.C
$(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C
$(constraintPointPatchFields)/processor/processorPointPatchFields.C
$(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C
$(constraintPointPatchFields)/symmetryPlane/symmetryPlanePointPatchFields.C
$(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C
$(constraintPointPatchFields)/wedge/wedgePointPatchFields.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlanePointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
basicSymmetryPointPatchField<Type>(p, iF),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{}
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
basicSymmetryPointPatchField<Type>(p, iF, dict),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{
if (!isType<symmetryPlanePointPatch>(p))
{
FatalIOErrorIn
(
"symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n"
"(\n"
" const pointPatch& p,\n"
" const Field<Type>& field,\n"
" const dictionary& dict\n"
")\n",
dict
) << "patch " << this->patch().index() << " not symmetry type. "
<< "Patch type = " << p.type()
<< exit(FatalIOError);
}
}
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>& ptf,
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
basicSymmetryPointPatchField<Type>(ptf, p, iF, mapper),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{
if (!isType<symmetryPlanePointPatch>(this->patch()))
{
FatalErrorIn
(
"symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n"
"(\n"
" const symmetryPlanePointPatchField<Type>& ptf,\n"
" const pointPatch& p,\n"
" const DimensionedField<Type, pointMesh>& iF,\n"
" const pointPatchFieldMapper& 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<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
)
:
basicSymmetryPointPatchField<Type>(ptf, iF),
symmetryPlanePatch_(ptf.symmetryPlanePatch_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::symmetryPlanePointPatchField<Type>::evaluate
(
const Pstream::commsTypes
)
{
vector nHat = symmetryPlanePatch_.n();
tmp<Field<Type> > tvalues =
(
(
this->patchInternalField()
+ transform(I - 2.0*sqr(nHat), this->patchInternalField())
)/2.0
);
// Get internal field to insert values into
Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
this->setInInternalField(iF, tvalues());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
Class
Foam::symmetryPlanePointPatchField
Description
A symmetry-plane boundary condition for pointField
SourceFiles
symmetryPlanePointPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlanePointPatchField_H
#define symmetryPlanePointPatchField_H
#include "basicSymmetryPointPatchField.H"
#include "symmetryPlanePointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class symmetryPlanePointPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class symmetryPlanePointPatchField
:
public basicSymmetryPointPatchField<Type>
{
// Private data
//- Local reference cast into the symmetryPlane patch
const symmetryPlanePointPatch& symmetryPlanePatch_;
public:
//- Runtime type information
TypeName(symmetryPlanePointPatch::typeName_());
// Constructors
//- Construct from patch and internal field
symmetryPlanePointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&
);
//- Construct from patch, internal field and dictionary
symmetryPlanePointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>&,
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<Type> > clone() const
{
return autoPtr<pointPatchField<Type> >
(
new symmetryPlanePointPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>&,
const DimensionedField<Type, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<Type> > clone
(
const DimensionedField<Type, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<Type> >
(
new symmetryPlanePointPatchField<Type>
(
*this,
iF
)
);
}
// Member functions
//- Return the constraint type this pointPatchField implements
virtual const word& constraintType() const
{
return symmetryPlanePointPatch::typeName;
}
// Evaluation functions
//- Update the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "symmetryPlanePointPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlanePointPatchFields.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchFields(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlanePointPatchFields_H
#define symmetryPlanePointPatchFields_H
#include "symmetryPlanePointPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -25,11 +25,14 @@ Class
Foam::symmetryPointPatch
Description
Symmetry-plane patch.
Symmetry patch for non-planar or multi-plane patches.
SourceFiles
symmetryPointPatch.C
SeeAlso
symmetryPlanePointPatch
\*---------------------------------------------------------------------------*/
#ifndef symmetryPointPatch_H
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlanePointPatch.H"
#include "pointConstraint.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(symmetryPlanePointPatch, 0);
// Add the patch constructor functions to the hash tables
addToRunTimeSelectionTable
(
facePointPatch,
symmetryPlanePointPatch,
polyPatch
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::symmetryPlanePointPatch::symmetryPlanePointPatch
(
const polyPatch& patch,