Commit cfbc1fcb authored by Henry's avatar Henry
Browse files
parents 730481ae 78ee5c8c
......@@ -43,7 +43,7 @@ Description
#include "polyMeshZipUpCells.H"
#include "wallPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "oldCyclicPolyPatch.H"
#include "Swap.H"
#include "IFstream.H"
#include "readHexLabel.H"
......@@ -900,7 +900,7 @@ int main(int argc, char *argv[])
fluentToFoamType.insert("interface", polyPatch::typeName);
fluentToFoamType.insert("internal", polyPatch::typeName);
fluentToFoamType.insert("solid", polyPatch::typeName);
fluentToFoamType.insert("fan", cyclicPolyPatch::typeName);
fluentToFoamType.insert("fan", oldCyclicPolyPatch::typeName);
fluentToFoamType.insert("radiator", polyPatch::typeName);
fluentToFoamType.insert("porous-jump", polyPatch::typeName);
......
......@@ -41,7 +41,7 @@ Description
#include "wallPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H"
#include "cyclicPolyPatch.H"
#include "oldCyclicPolyPatch.H"
#include "unitConversion.H"
using namespace Foam;
......
......@@ -196,7 +196,7 @@ const word* kivaPatchTypes[nBCs] =
&polyPatch::typeName,
&polyPatch::typeName,
&symmetryPolyPatch::typeName,
&cyclicPolyPatch::typeName
&oldCyclicPolyPatch::typeName
};
enum patchTypeNames
......
......@@ -29,7 +29,7 @@ Description
#include "sammMesh.H"
#include "Time.H"
#include "wallPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "oldCyclicPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "preservePatchTypes.H"
#include "IFstream.H"
......@@ -208,7 +208,7 @@ void sammMesh::readBoundary()
{
// incorrect. should be cyclicPatch but this
// requires info on connected faces.
patchTypes_[patchLabel] = cyclicPolyPatch::typeName;
patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
}
else
{
......
......@@ -29,7 +29,7 @@ Description
#include "starMesh.H"
#include "Time.H"
#include "wallPolyPatch.H"
#include "cyclicPolyPatch.H"
#include "oldCyclicPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "preservePatchTypes.H"
#include "IFstream.H"
......@@ -206,7 +206,7 @@ void starMesh::readBoundary()
{
// incorrect. should be cyclicPatch but this
// requires info on connected faces.
patchTypes_[patchLabel] = cyclicPolyPatch::typeName;
patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
}
else
{
......
......@@ -4,4 +4,5 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lgenericPatchFields
......@@ -346,6 +346,7 @@ $(basicPolyPatches)/generic/genericPolyPatch.C
constraintPolyPatches = $(polyPatches)/constraint
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
$(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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::oldCyclicPolyPatch
Description
'old' style cyclic polyPatch with all faces in single patch. Does ordering
but cannot be used to run. Writes 'type cyclic' so foamUpgradeCyclics
can be run afterwards.
Used to get cyclics from mesh converters that assume cyclics in single
patch (e.g. fluent3DMeshToFoam)
SourceFiles
oldCyclicPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef oldCyclicPolyPatch_H
#define oldCyclicPolyPatch_H
#include "coupledPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class oldCyclicPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class oldCyclicPolyPatch
:
public coupledPolyPatch
{
public:
enum transformType
{
UNKNOWN,
ROTATIONAL,
TRANSLATIONAL
};
static const NamedEnum<transformType, 3> transformTypeNames;
private:
// Private data
//- Morph:angle between normals of neighbouring faces.
// Used to split cyclic into halves.
scalar featureCos_;
//- Type of transformation - rotational or translational
transformType transform_;
// For rotation
//- Axis of rotation for rotational cyclics
vector rotationAxis_;
//- point on axis of rotation for rotational cyclics
point rotationCentre_;
// For translation
//- Translation vector
vector separationVector_;
// Private member functions
//- Find amongst selected faces the one with the largest area
static label findMaxArea(const pointField&, const faceList&);
void calcTransforms();
//- Calculate face centres
static pointField calcFaceCentres
(
const UList<face>&,
const pointField&
);
//- Get f[0] for all faces
static pointField getAnchorPoints
(
const UList<face>&,
const pointField&
);
// Face ordering
//- Find the two parts of the faces of pp using feature edges.
// Returns true if successfull.
bool getGeometricHalves
(
const primitivePatch&,
labelList&,
labelList&
) const;
//- Calculate geometric factors of the two halves.
void getCentresAndAnchors
(
const primitivePatch&,
const faceList& half0Faces,
const faceList& half1Faces,
pointField& ppPoints,
pointField& half0Ctrs,
pointField& half1Ctrs,
pointField& anchors0,
scalarField& tols
) const;
//- Given matched faces matches the anchor point. Sets faceMap,
// rotation. Returns true if all matched.
bool matchAnchors
(
const bool report,
const primitivePatch&,
const labelList&,
const pointField&,
const labelList&,
const faceList&,
const labelList&,
const scalarField&,
labelList& faceMap,
labelList& rotation
) const;
//- For rotational cases, try to find a unique face on each side
// of the cyclic.
label getConsistentRotationFace
(
const pointField& faceCentres
) const;
protected:
// Protected Member functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry(PstreamBuffers&);
//- Calculate the patch geometry
virtual void calcGeometry(PstreamBuffers&);
//- Initialise the patches for moving points
virtual void initMovePoints(PstreamBuffers&, const pointField&);
//- Correct patches after moving points
virtual void movePoints(PstreamBuffers&, const pointField&);
//- Initialise the update of the patch topology
virtual void initUpdateMesh(PstreamBuffers&);
//- Update of the patch topology
virtual void updateMesh(PstreamBuffers&);
public:
//- Runtime type information
TypeName("oldCyclic");
// Constructors
//- Construct from components
oldCyclicPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
);
//- Construct from dictionary
oldCyclicPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm
);
//- Construct as copy, resetting the boundary mesh
oldCyclicPolyPatch(const oldCyclicPolyPatch&, const polyBoundaryMesh&);
//- Construct given the original patch and resetting the
// face list and boundary mesh information
oldCyclicPolyPatch
(
const oldCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new oldCyclicPolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new oldCyclicPolyPatch(*this, bm, index, newSize, newStart)
);
}
// Destructor
virtual ~oldCyclicPolyPatch();
// Member Functions
// Access
//- Does this side own the patch ?
virtual bool owner() const
{
notImplemented("oldCyclicPolyPatch::owner()");
return true;
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const
{
notImplemented("transformPosition(pointField&)");
}
//- Calculate the patch geometry
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
);
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual void initOrder
(
PstreamBuffers&,
const primitivePatch&
) const;
//- Return new ordering for primitivePatch.
// Ordering is -faceMap: for every face
// index of the new face -rotation:for every new face the clockwise
// shift of the original face. Return false if nothing changes
// (faceMap is identity, rotation is 0), true otherwise.
virtual bool order
(
PstreamBuffers&,
const primitivePatch&,
labelList& faceMap,
labelList& rotation
) const;
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -171,6 +171,23 @@ tmp<Field<Type> > cyclicFvPatchField<Type>::patchNeighbourField() const
}
template<class Type>
const cyclicFvPatchField<Type>& cyclicFvPatchField<Type>::neighbourPatchField()
const
{
const GeometricField<Type, fvPatchField, volMesh>& fld =
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
(
this->internalField()
);
return refCast<const cyclicFvPatchField<Type> >
(
fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
);
}
template<class Type>
void cyclicFvPatchField<Type>::updateInterfaceMatrix
(
......
......@@ -150,9 +150,12 @@ public:
// Evaluation functions
//- Return neighbour coupled given internal cell data
//- Return neighbour coupled internal cell data
tmp<Field<Type> > patchNeighbourField() const;
//- Return reference to neighbour patchField
const cyclicFvPatchField<Type>& neighbourPatchField() const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
......
......@@ -140,7 +140,17 @@ public:
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const
{
return jump_;
if (this->cyclicPatch().owner())
{
return jump_;
}
else
{
return refCast<const fanFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
......
......@@ -180,17 +180,31 @@ Foam::label Foam::ptscotchDecomp::decompose
// Info<< "Dumping Scotch graph file to " << str.name() << endl
// << "Use this in combination with gpart." << endl;
//
// label version = 0;
// // Distributed graph file (.grf)
// label version = 2;
// str << version << nl;
// // Numer of vertices
// str << xadj.size()-1 << ' ' << adjncy.size() << nl;
// // Number of files
// // Number of files (procglbnbr)
// str << Pstream::nProcs();
// // My file number (procloc)
// str << ' ' << Pstream::myProcNo() << nl;
//
// // Total number of vertices (vertglbnbr)
// str << returnReduce(mesh.nCells(), sumOp<label>());
// // Total number of connections (edgeglbnbr)
// str << ' ' << returnReduce(xadj[mesh.nCells()], sumOp<label>())
// << nl;
// // Local number of vertices (vertlocnbr)
// str << mesh.nCells();
// // Local number of connections (edgelocnbr)
// str << ' ' << xadj[mesh.nCells()] << nl;
// // Numbering starts from 0
// label baseval = 0;
// // Has weights?
// label hasEdgeWeights = 0;
// label hasVertexWeights = 0;
// label numericflag = 10*hasEdgeWeights+hasVertexWeights;
// str << baseval << ' ' << numericflag << nl;
// // Start of my global vertices (procdsptab[proclocnum])
// str << ' ' << globalCells.toGlobal(0);
// 100*hasVertlabels+10*hasEdgeWeights+1*hasVertWeighs
// str << ' ' << "0" << nl;
// for (label cellI = 0; cellI < xadj.size()-1; cellI++)
// {
// label start = xadj[cellI];
......
......@@ -15,47 +15,47 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 1 -1 0 0 0 0 ];
dimensions [0 1 -1 0 0 0 0];
internalField uniform ( 0 0 0 );
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type pressureInletOutletVelocity;
value uniform ( 0 0 0 );
value uniform (0 0 0);
}
outlet1
{
type inletOutlet;
inletValue uniform ( 0 0 0 );
value uniform ( 0 0 0 );
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
outlet2
{
type inletOutlet;
inletValue uniform ( 0 0 0 );
value uniform ( 0 0 0 );
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
baffles
{
type fixedValue;
value uniform ( 0 0 0 );
value uniform (0 0 0);
}
fan_half0
{
type cyclic;
}
defaultFaces
{
type fixedValue;
value uniform ( 0 0 0 );
}
fan_half1
{
type cyclic;
}
defaultFaces
{
type fixedValue;
value uniform (0 0 0);
}
}
......
......@@ -15,7 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
dimensions [0 2 -3 0 0 0 0];
internalField uniform 1;
......@@ -42,21 +42,27 @@ boundaryField
baffles
{
type epsilonWallFunction;
value uniform 1;
Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
}
fan_half0
{