Commit 1cdcfd72 authored by mattijs's avatar mattijs
Browse files

ENH: new pointPatchField type cyclicSlip.

parent 8d2e5df8
......@@ -506,6 +506,7 @@ $(constraintPointPatchFields)/empty/emptyPointPatchFields.C
$(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C
$(constraintPointPatchFields)/wedge/wedgePointPatchFields.C
$(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C
$(constraintPointPatchFields)/cyclicSlip/cyclicSlipPointPatchFields.C
$(constraintPointPatchFields)/processor/processorPointPatchFields.C
derivedPointPatchFields = $(pointPatchFields)/derived
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 "cyclicSlipPointPatchField.H"
#include "pointConstraint.H"
#include "transformField.H"
#include "symmTransformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(p, iF)
{}
template<class Type>
cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
cyclicPointPatchField<Type>(p, iF, dict)
{}
template<class Type>
cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
(
const cyclicSlipPointPatchField<Type>& ptf,
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
cyclicPointPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
cyclicSlipPointPatchField<Type>::cyclicSlipPointPatchField
(
const cyclicSlipPointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
{
const vectorField& nHat = this->patch().pointNormals();
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());
setInInternalField(iF, tvalues());
}
template<class Type>
void cyclicSlipPointPatchField<Type>::applyConstraint
(
const label pointi,
pointConstraint& pc
) const
{
pc.applyConstraint(this->patch().pointNormals()[pointi]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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::cyclicSlipPointPatchField
Description
Specialisation of cyclic that constrains to the patch
SourceFiles
cyclicSlipPointPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef cyclicSlipPointPatchField_H
#define cyclicSlipPointPatchField_H
#include "cyclicPointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicSlipPointPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class cyclicSlipPointPatchField
:
public cyclicPointPatchField<Type>
{
public:
//- Runtime type information
TypeName("cyclicSlip");
// Constructors
//- Construct from patch and internal field
cyclicSlipPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&
);
//- Construct from patch, internal field and dictionary
cyclicSlipPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
cyclicSlipPointPatchField
(
const cyclicSlipPointPatchField<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 cyclicSlipPointPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
cyclicSlipPointPatchField
(
const cyclicSlipPointPatchField<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 cyclicSlipPointPatchField<Type>
(
*this, iF
)
);
}
// Member functions
//- Update the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
//- Accumulate the effect of constraint direction of this patch
virtual void applyConstraint
(
const label pointi,
pointConstraint&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "cyclicSlipPointPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 "cyclicSlipPointPatchFields.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchFields(cyclicSlip);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 cyclicSlipPointPatchFields_H
#define cyclicSlipPointPatchFields_H
#include "cyclicSlipPointPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchFieldTypedefs(cyclicSlip);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment