Added cyclic and symmetry faPatches
This commit is contained in:
parent
9c56d4947b
commit
b8c23bbe6b
14 changed files with 1627 additions and 1 deletions
|
@ -10,6 +10,8 @@ $(faPatches)/basic/coupled/coupledFaPatch.C
|
|||
$(faPatches)/constraint/empty/emptyFaPatch.C
|
||||
$(faPatches)/constraint/processor/processorFaPatch.C
|
||||
$(faPatches)/constraint/wedge/wedgeFaPatch.C
|
||||
$(faPatches)/constraint/cyclic/cyclicFaPatch.C
|
||||
$(faPatches)/constraint/symmetry/symmetryFaPatch.C
|
||||
|
||||
faPatchFields = fields/faPatchFields
|
||||
$(faPatchFields)/faPatchField/faPatchFields.C
|
||||
|
|
|
@ -80,7 +80,7 @@ void coupledFaPatch::calcTransformTensors
|
|||
const vectorField& nr
|
||||
) const
|
||||
{
|
||||
if (sum(mag(nf & nr)) < size() - SMALL)
|
||||
if (sum(mag(nf & nr)) < Cf.size() - SMALL)
|
||||
{
|
||||
separation_.setSize(0);
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 116
|
||||
/svnroot/openfoam-extend/!svn/ver/1829/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/cyclic
|
||||
END
|
||||
cyclicFaPatch.H
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 132
|
||||
/svnroot/openfoam-extend/!svn/ver/1829/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/cyclic/cyclicFaPatch.H
|
||||
END
|
||||
cyclicFaPatch.C
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 132
|
||||
/svnroot/openfoam-extend/!svn/ver/1829/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/cyclic/cyclicFaPatch.C
|
||||
END
|
|
@ -0,0 +1,96 @@
|
|||
10
|
||||
|
||||
dir
|
||||
1842
|
||||
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/cyclic
|
||||
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend
|
||||
|
||||
|
||||
|
||||
2010-09-14T12:57:06.769771Z
|
||||
1829
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
e4e07f05-0c2f-0410-a05a-b8ba57e0c909
|
||||
|
||||
cyclicFaPatch.H
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-16T13:27:43.000000Z
|
||||
fe64dd1fb60fbe9006cd17b5edff6a58
|
||||
2010-09-14T12:57:06.769771Z
|
||||
1829
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4831
|
||||
|
||||
cyclicFaPatch.C
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-16T13:27:43.000000Z
|
||||
2c0a22cc11cb3e1d06cb8f6fe845f668
|
||||
2010-09-14T12:57:06.769771Z
|
||||
1829
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
10204
|
||||
|
|
@ -0,0 +1,353 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "cyclicFaPatch.H"
|
||||
#include "coupledPolyPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "faMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(cyclicFaPatch, 0);
|
||||
addToRunTimeSelectionTable(faPatch, cyclicFaPatch, dictionary);
|
||||
|
||||
const scalar cyclicFaPatch::matchTol_
|
||||
(
|
||||
debug::tolerances("patchFaceMatchTol", 1e-3)
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::cyclicFaPatch::calcTransforms()
|
||||
{
|
||||
if (size() > 0)
|
||||
{
|
||||
pointField half0Ctrs(size()/2);
|
||||
pointField half1Ctrs(size()/2);
|
||||
for (label i=0; i<size()/2; i++)
|
||||
{
|
||||
half0Ctrs[i] = this->edgeCentres()[i];
|
||||
half1Ctrs[i] = this->edgeCentres()[i+size()/2];
|
||||
}
|
||||
|
||||
vectorField half0Normals(size()/2);
|
||||
vectorField half1Normals(size()/2);
|
||||
|
||||
vectorField eN = edgeNormals()*magEdgeLengths();
|
||||
|
||||
scalar maxMatchError = 0;
|
||||
label errorEdge = -1;
|
||||
|
||||
for (label edgei = 0; edgei < size()/2; edgei++)
|
||||
{
|
||||
half0Normals[edgei] = eN[edgei];
|
||||
label nbrEdgei = edgei + size()/2;
|
||||
half1Normals[edgei] = eN[nbrEdgei];
|
||||
|
||||
scalar magLe = mag(half0Normals[edgei]);
|
||||
scalar nbrMagLe = mag(half1Normals[edgei]);
|
||||
scalar avLe = (magLe + nbrMagLe)/2.0;
|
||||
|
||||
if (magLe < ROOTVSMALL && nbrMagLe < ROOTVSMALL)
|
||||
{
|
||||
// Undetermined normal. Use dummy normal to force separation
|
||||
// check. (note use of sqrt(VSMALL) since that is how mag
|
||||
// scales)
|
||||
half0Normals[edgei] = point(1, 0, 0);
|
||||
half1Normals[edgei] = half0Normals[edgei];
|
||||
}
|
||||
else if
|
||||
(
|
||||
mag(magLe - nbrMagLe)/avLe
|
||||
> matchTol_
|
||||
)
|
||||
{
|
||||
// Error in area matching. Find largest error
|
||||
maxMatchError =
|
||||
Foam::max(maxMatchError, mag(magLe - nbrMagLe)/avLe);
|
||||
errorEdge = edgei;
|
||||
}
|
||||
else
|
||||
{
|
||||
half0Normals[edgei] /= magLe;
|
||||
half1Normals[edgei] /= nbrMagLe;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for error in edge matching
|
||||
if (maxMatchError > matchTol_)
|
||||
{
|
||||
label nbrEdgei = errorEdge + size()/2;
|
||||
scalar magLe = mag(half0Normals[errorEdge]);
|
||||
scalar nbrMagLe = mag(half1Normals[errorEdge]);
|
||||
scalar avLe = (magLe + nbrMagLe)/2.0;
|
||||
|
||||
FatalErrorIn
|
||||
(
|
||||
"cyclicFaPatch::calcTransforms()"
|
||||
) << "edge " << errorEdge
|
||||
<< " area does not match neighbour "
|
||||
<< nbrEdgei << " by "
|
||||
<< 100*mag(magLe - nbrMagLe)/avLe
|
||||
<< "% -- possible edge ordering problem." << endl
|
||||
<< "patch:" << name()
|
||||
<< " my area:" << magLe
|
||||
<< " neighbour area:" << nbrMagLe
|
||||
<< " matching tolerance:" << matchTol_
|
||||
<< endl
|
||||
<< "Mesh edge:" << start() + errorEdge
|
||||
<< endl
|
||||
<< "Neighbour edge:" << start() + nbrEdgei
|
||||
<< endl
|
||||
<< "Other errors also exist, only the largest is reported. "
|
||||
<< "Please rerun with cyclic debug flag set"
|
||||
<< " for more information." << exit(FatalError);
|
||||
}
|
||||
|
||||
// Calculate transformation tensors
|
||||
calcTransformTensors
|
||||
(
|
||||
half0Ctrs,
|
||||
half1Ctrs,
|
||||
half0Normals,
|
||||
half1Normals
|
||||
);
|
||||
|
||||
// Check transformation tensors
|
||||
if (!parallel())
|
||||
{
|
||||
if (forwardT().size() > 1 || reverseT().size() > 1)
|
||||
{
|
||||
SeriousErrorIn
|
||||
(
|
||||
"void cyclicFaPatch::calcTransforms()"
|
||||
) << "Transformation tensor is not constant for the cyclic "
|
||||
<< "patch. Please reconsider your setup and definition of "
|
||||
<< "cyclic boundaries." << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Make patch weighting factors
|
||||
void cyclicFaPatch::makeWeights(scalarField& w) const
|
||||
{
|
||||
const scalarField& magL = magEdgeLengths();
|
||||
|
||||
scalarField deltas = edgeNormals() & faPatch::delta();
|
||||
label sizeby2 = deltas.size()/2;
|
||||
|
||||
scalar maxMatchError = 0;
|
||||
label errorEdge = -1;
|
||||
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
scalar avL = (magL[edgei] + magL[edgei + sizeby2])/2.0;
|
||||
|
||||
if
|
||||
(
|
||||
mag(magL[edgei] - magL[edgei + sizeby2])/avL
|
||||
> matchTol_
|
||||
)
|
||||
{
|
||||
// Found error. Look for largest matching error
|
||||
maxMatchError =
|
||||
Foam::max
|
||||
(
|
||||
maxMatchError,
|
||||
mag(magL[edgei] - magL[edgei + sizeby2])/avL
|
||||
);
|
||||
|
||||
errorEdge = edgei;
|
||||
}
|
||||
|
||||
scalar di = deltas[edgei];
|
||||
scalar dni = deltas[edgei + sizeby2];
|
||||
|
||||
w[edgei] = dni/(di + dni);
|
||||
w[edgei + sizeby2] = 1 - w[edgei];
|
||||
}
|
||||
|
||||
// Check for error in matching
|
||||
if (maxMatchError > cyclicPolyPatch::areaMatchTol)
|
||||
{
|
||||
scalar avL = (magL[errorEdge] + magL[errorEdge + sizeby2])/2.0;
|
||||
|
||||
FatalErrorIn("cyclicFaPatch::makeWeights(scalarField& w) const")
|
||||
<< "edge " << errorEdge << " and " << errorEdge + sizeby2
|
||||
<< " areas do not match by "
|
||||
<< 100*mag(magL[errorEdge] - magL[errorEdge + sizeby2])/avL
|
||||
<< "% -- possible edge ordering problem." << nl
|
||||
<< "Cyclic area match tolerance = "
|
||||
<< cyclicPolyPatch::areaMatchTol << " patch: " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Make patch edge - neighbour cell distances
|
||||
void cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
|
||||
{
|
||||
scalarField deltas = edgeNormals() & faPatch::delta();
|
||||
label sizeby2 = deltas.size()/2;
|
||||
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
scalar di = deltas[edgei];
|
||||
scalar dni = deltas[edgei + sizeby2];
|
||||
|
||||
dc[edgei] = 1.0/(di + dni);
|
||||
dc[edgei + sizeby2] = dc[edgei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::initGeometry()
|
||||
{
|
||||
faPatch::initGeometry();
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::calcGeometry()
|
||||
{
|
||||
faPatch::calcGeometry();
|
||||
calcTransforms();
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::initMovePoints(const pointField& p)
|
||||
{
|
||||
faPatch::initMovePoints(p);
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::movePoints(const pointField& p)
|
||||
{
|
||||
faPatch::movePoints(p);
|
||||
calcTransforms();
|
||||
}
|
||||
|
||||
// Return delta (P to N) vectors across coupled patch
|
||||
tmp<vectorField> cyclicFaPatch::delta() const
|
||||
{
|
||||
vectorField patchD = faPatch::delta();
|
||||
label sizeby2 = patchD.size()/2;
|
||||
|
||||
tmp<vectorField> tpdv(new vectorField(patchD.size()));
|
||||
vectorField& pdv = tpdv();
|
||||
|
||||
// Do the transformation if necessary
|
||||
if (parallel())
|
||||
{
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
vector ddi = patchD[edgei];
|
||||
vector dni = patchD[edgei + sizeby2];
|
||||
|
||||
pdv[edgei] = ddi - dni;
|
||||
pdv[edgei + sizeby2] = -pdv[edgei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
vector ddi = patchD[edgei];
|
||||
vector dni = patchD[edgei + sizeby2];
|
||||
|
||||
pdv[edgei] = ddi - transform(forwardT()[0], dni);
|
||||
pdv[edgei + sizeby2] = -transform(reverseT()[0], pdv[edgei]);
|
||||
}
|
||||
}
|
||||
|
||||
return tpdv;
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::interfaceInternalField
|
||||
(
|
||||
const unallocLabelList& internalData
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData);
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::transfer
|
||||
(
|
||||
const Pstream::commsTypes,
|
||||
const unallocLabelList& interfaceData
|
||||
) const
|
||||
{
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; edgei++)
|
||||
{
|
||||
pnf[edgei] = interfaceData[edgei + sizeby2];
|
||||
pnf[edgei + sizeby2] = interfaceData[edgei];
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& iF
|
||||
) const
|
||||
{
|
||||
const unallocLabelList& edgeCells = this->faceCells();
|
||||
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; edgei++)
|
||||
{
|
||||
pnf[edgei] = iF[edgeCells[edgei + sizeby2]];
|
||||
pnf[edgei + sizeby2] = iF[edgeCells[edgei]];
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,172 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::cyclicFaPatch
|
||||
|
||||
Description
|
||||
Cyclic-plane patch.
|
||||
|
||||
SourceFiles
|
||||
cyclicFaPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef cyclicFaPatch_H
|
||||
#define cyclicFaPatch_H
|
||||
|
||||
#include "coupledFaPatch.H"
|
||||
#include "cyclicLduInterface.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class cyclicFaPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class cyclicFaPatch
|
||||
:
|
||||
public coupledFaPatch,
|
||||
public cyclicLduInterface
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Private member functions
|
||||
|
||||
void calcTransforms();
|
||||
|
||||
protected:
|
||||
|
||||
// Protected static data
|
||||
|
||||
//- Relative tolerance (for geometric matching). Is factor of
|
||||
// maximum edge length per face.
|
||||
static const scalar matchTol_;
|
||||
|
||||
// Protected Member functions
|
||||
|
||||
//- Make patch weighting factors
|
||||
void makeWeights(scalarField&) const;
|
||||
|
||||
//- Make patch face - neighbour cell distances
|
||||
void makeDeltaCoeffs(scalarField&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("cyclic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
cyclicFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
coupledFaPatch(name, dict, index, bm)
|
||||
{}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~cyclicFaPatch()
|
||||
{}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return face transformation tensor
|
||||
virtual const tensorField& forwardT() const
|
||||
{
|
||||
return coupledFaPatch::forwardT();
|
||||
}
|
||||
|
||||
//- Return neighbour-cell transformation tensor
|
||||
virtual const tensorField& reverseT() const
|
||||
{
|
||||
return coupledFaPatch::reverseT();
|
||||
}
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry();
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry();
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
virtual void initMovePoints(const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
virtual void movePoints(const pointField&);
|
||||
|
||||
//- Return delta (P to N) vectors across coupled patch
|
||||
virtual tmp<vectorField> delta() const;
|
||||
|
||||
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const unallocLabelList& internalData
|
||||
) const;
|
||||
|
||||
//- Transfer and return neighbour field
|
||||
virtual tmp<labelField> transfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& interfaceData
|
||||
) const;
|
||||
|
||||
//- Return neighbour field
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& internalData
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,353 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "cyclicFaPatch.H"
|
||||
#include "coupledPolyPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "faMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(cyclicFaPatch, 0);
|
||||
addToRunTimeSelectionTable(faPatch, cyclicFaPatch, dictionary);
|
||||
|
||||
const scalar cyclicFaPatch::matchTol_
|
||||
(
|
||||
debug::tolerances("patchFaceMatchTol", 1e-3)
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::cyclicFaPatch::calcTransforms()
|
||||
{
|
||||
if (size() > 0)
|
||||
{
|
||||
pointField half0Ctrs(size()/2);
|
||||
pointField half1Ctrs(size()/2);
|
||||
for (label i=0; i<size()/2; i++)
|
||||
{
|
||||
half0Ctrs[i] = this->edgeCentres()[i];
|
||||
half1Ctrs[i] = this->edgeCentres()[i+size()/2];
|
||||
}
|
||||
|
||||
vectorField half0Normals(size()/2);
|
||||
vectorField half1Normals(size()/2);
|
||||
|
||||
vectorField eN = edgeNormals()*magEdgeLengths();
|
||||
|
||||
scalar maxMatchError = 0;
|
||||
label errorEdge = -1;
|
||||
|
||||
for (label edgei = 0; edgei < size()/2; edgei++)
|
||||
{
|
||||
half0Normals[edgei] = eN[edgei];
|
||||
label nbrEdgei = edgei + size()/2;
|
||||
half1Normals[edgei] = eN[nbrEdgei];
|
||||
|
||||
scalar magLe = mag(half0Normals[edgei]);
|
||||
scalar nbrMagLe = mag(half1Normals[edgei]);
|
||||
scalar avLe = (magLe + nbrMagLe)/2.0;
|
||||
|
||||
if (magLe < ROOTVSMALL && nbrMagLe < ROOTVSMALL)
|
||||
{
|
||||
// Undetermined normal. Use dummy normal to force separation
|
||||
// check. (note use of sqrt(VSMALL) since that is how mag
|
||||
// scales)
|
||||
half0Normals[edgei] = point(1, 0, 0);
|
||||
half1Normals[edgei] = half0Normals[edgei];
|
||||
}
|
||||
else if
|
||||
(
|
||||
mag(magLe - nbrMagLe)/avLe
|
||||
> matchTol_
|
||||
)
|
||||
{
|
||||
// Error in area matching. Find largest error
|
||||
maxMatchError =
|
||||
Foam::max(maxMatchError, mag(magLe - nbrMagLe)/avLe);
|
||||
errorEdge = edgei;
|
||||
}
|
||||
else
|
||||
{
|
||||
half0Normals[edgei] /= magLe;
|
||||
half1Normals[edgei] /= nbrMagLe;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for error in edge matching
|
||||
if (maxMatchError > matchTol_)
|
||||
{
|
||||
label nbrEdgei = errorEdge + size()/2;
|
||||
scalar magLe = mag(half0Normals[errorEdge]);
|
||||
scalar nbrMagLe = mag(half1Normals[errorEdge]);
|
||||
scalar avLe = (magLe + nbrMagLe)/2.0;
|
||||
|
||||
FatalErrorIn
|
||||
(
|
||||
"cyclicFaPatch::calcTransforms()"
|
||||
) << "edge " << errorEdge
|
||||
<< " area does not match neighbour "
|
||||
<< nbrEdgei << " by "
|
||||
<< 100*mag(magLe - nbrMagLe)/avLe
|
||||
<< "% -- possible edge ordering problem." << endl
|
||||
<< "patch:" << name()
|
||||
<< " my area:" << magLe
|
||||
<< " neighbour area:" << nbrMagLe
|
||||
<< " matching tolerance:" << matchTol_
|
||||
<< endl
|
||||
<< "Mesh edge:" << start() + errorEdge
|
||||
<< endl
|
||||
<< "Neighbour edge:" << start() + nbrEdgei
|
||||
<< endl
|
||||
<< "Other errors also exist, only the largest is reported. "
|
||||
<< "Please rerun with cyclic debug flag set"
|
||||
<< " for more information." << exit(FatalError);
|
||||
}
|
||||
|
||||
// Calculate transformation tensors
|
||||
calcTransformTensors
|
||||
(
|
||||
half0Ctrs,
|
||||
half1Ctrs,
|
||||
half0Normals,
|
||||
half1Normals
|
||||
);
|
||||
|
||||
// Check transformation tensors
|
||||
if (!parallel())
|
||||
{
|
||||
if (forwardT().size() > 1 || reverseT().size() > 1)
|
||||
{
|
||||
SeriousErrorIn
|
||||
(
|
||||
"void cyclicFaPatch::calcTransforms()"
|
||||
) << "Transformation tensor is not constant for the cyclic "
|
||||
<< "patch. Please reconsider your setup and definition of "
|
||||
<< "cyclic boundaries." << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Make patch weighting factors
|
||||
void cyclicFaPatch::makeWeights(scalarField& w) const
|
||||
{
|
||||
const scalarField& magL = magEdgeLengths();
|
||||
|
||||
scalarField deltas = edgeNormals() & faPatch::delta();
|
||||
label sizeby2 = deltas.size()/2;
|
||||
|
||||
scalar maxMatchError = 0;
|
||||
label errorEdge = -1;
|
||||
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
scalar avL = (magL[edgei] + magL[edgei + sizeby2])/2.0;
|
||||
|
||||
if
|
||||
(
|
||||
mag(magL[edgei] - magL[edgei + sizeby2])/avL
|
||||
> matchTol_
|
||||
)
|
||||
{
|
||||
// Found error. Look for largest matching error
|
||||
maxMatchError =
|
||||
Foam::max
|
||||
(
|
||||
maxMatchError,
|
||||
mag(magL[edgei] - magL[edgei + sizeby2])/avL
|
||||
);
|
||||
|
||||
errorEdge = edgei;
|
||||
}
|
||||
|
||||
scalar di = deltas[edgei];
|
||||
scalar dni = deltas[edgei + sizeby2];
|
||||
|
||||
w[edgei] = dni/(di + dni);
|
||||
w[edgei + sizeby2] = 1 - w[edgei];
|
||||
}
|
||||
|
||||
// Check for error in matching
|
||||
if (maxMatchError > cyclicPolyPatch::areaMatchTol)
|
||||
{
|
||||
scalar avL = (magL[errorEdge] + magL[errorEdge + sizeby2])/2.0;
|
||||
|
||||
FatalErrorIn("cyclicFaPatch::makeWeights(scalarField& w) const")
|
||||
<< "edge " << errorEdge << " and " << errorEdge + sizeby2
|
||||
<< " areas do not match by "
|
||||
<< 100*mag(magL[errorEdge] - magL[errorEdge + sizeby2])/avL
|
||||
<< "% -- possible edge ordering problem." << nl
|
||||
<< "Cyclic area match tolerance = "
|
||||
<< cyclicPolyPatch::areaMatchTol << " patch: " << name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Make patch edge - neighbour cell distances
|
||||
void cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
|
||||
{
|
||||
scalarField deltas = edgeNormals() & faPatch::delta();
|
||||
label sizeby2 = deltas.size()/2;
|
||||
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
scalar di = deltas[edgei];
|
||||
scalar dni = deltas[edgei + sizeby2];
|
||||
|
||||
dc[edgei] = 1.0/(di + dni);
|
||||
dc[edgei + sizeby2] = dc[edgei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::initGeometry()
|
||||
{
|
||||
faPatch::initGeometry();
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::calcGeometry()
|
||||
{
|
||||
faPatch::calcGeometry();
|
||||
calcTransforms();
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::initMovePoints(const pointField& p)
|
||||
{
|
||||
faPatch::initMovePoints(p);
|
||||
}
|
||||
|
||||
|
||||
void Foam::cyclicFaPatch::movePoints(const pointField& p)
|
||||
{
|
||||
faPatch::movePoints(p);
|
||||
calcTransforms();
|
||||
}
|
||||
|
||||
// Return delta (P to N) vectors across coupled patch
|
||||
tmp<vectorField> cyclicFaPatch::delta() const
|
||||
{
|
||||
vectorField patchD = faPatch::delta();
|
||||
label sizeby2 = patchD.size()/2;
|
||||
|
||||
tmp<vectorField> tpdv(new vectorField(patchD.size()));
|
||||
vectorField& pdv = tpdv();
|
||||
|
||||
// Do the transformation if necessary
|
||||
if (parallel())
|
||||
{
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
vector ddi = patchD[edgei];
|
||||
vector dni = patchD[edgei + sizeby2];
|
||||
|
||||
pdv[edgei] = ddi - dni;
|
||||
pdv[edgei + sizeby2] = -pdv[edgei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (label edgei = 0; edgei < sizeby2; edgei++)
|
||||
{
|
||||
vector ddi = patchD[edgei];
|
||||
vector dni = patchD[edgei + sizeby2];
|
||||
|
||||
pdv[edgei] = ddi - transform(forwardT()[0], dni);
|
||||
pdv[edgei + sizeby2] = -transform(reverseT()[0], pdv[edgei]);
|
||||
}
|
||||
}
|
||||
|
||||
return tpdv;
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::interfaceInternalField
|
||||
(
|
||||
const unallocLabelList& internalData
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData);
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::transfer
|
||||
(
|
||||
const Pstream::commsTypes,
|
||||
const unallocLabelList& interfaceData
|
||||
) const
|
||||
{
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; edgei++)
|
||||
{
|
||||
pnf[edgei] = interfaceData[edgei + sizeby2];
|
||||
pnf[edgei + sizeby2] = interfaceData[edgei];
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
tmp<labelField> cyclicFaPatch::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& iF
|
||||
) const
|
||||
{
|
||||
const unallocLabelList& edgeCells = this->faceCells();
|
||||
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; edgei++)
|
||||
{
|
||||
pnf[edgei] = iF[edgeCells[edgei + sizeby2]];
|
||||
pnf[edgei + sizeby2] = iF[edgeCells[edgei]];
|
||||
}
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,172 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::cyclicFaPatch
|
||||
|
||||
Description
|
||||
Cyclic-plane patch.
|
||||
|
||||
SourceFiles
|
||||
cyclicFaPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef cyclicFaPatch_H
|
||||
#define cyclicFaPatch_H
|
||||
|
||||
#include "coupledFaPatch.H"
|
||||
#include "cyclicLduInterface.H"
|
||||
#include "cyclicPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class cyclicFaPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class cyclicFaPatch
|
||||
:
|
||||
public coupledFaPatch,
|
||||
public cyclicLduInterface
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Private member functions
|
||||
|
||||
void calcTransforms();
|
||||
|
||||
protected:
|
||||
|
||||
// Protected static data
|
||||
|
||||
//- Relative tolerance (for geometric matching). Is factor of
|
||||
// maximum edge length per face.
|
||||
static const scalar matchTol_;
|
||||
|
||||
// Protected Member functions
|
||||
|
||||
//- Make patch weighting factors
|
||||
void makeWeights(scalarField&) const;
|
||||
|
||||
//- Make patch face - neighbour cell distances
|
||||
void makeDeltaCoeffs(scalarField&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("cyclic");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
cyclicFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
coupledFaPatch(name, dict, index, bm)
|
||||
{}
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~cyclicFaPatch()
|
||||
{}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return face transformation tensor
|
||||
virtual const tensorField& forwardT() const
|
||||
{
|
||||
return coupledFaPatch::forwardT();
|
||||
}
|
||||
|
||||
//- Return neighbour-cell transformation tensor
|
||||
virtual const tensorField& reverseT() const
|
||||
{
|
||||
return coupledFaPatch::reverseT();
|
||||
}
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry();
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry();
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
virtual void initMovePoints(const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
virtual void movePoints(const pointField&);
|
||||
|
||||
//- Return delta (P to N) vectors across coupled patch
|
||||
virtual tmp<vectorField> delta() const;
|
||||
|
||||
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const unallocLabelList& internalData
|
||||
) const;
|
||||
|
||||
//- Transfer and return neighbour field
|
||||
virtual tmp<labelField> transfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& interfaceData
|
||||
) const;
|
||||
|
||||
//- Return neighbour field
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const unallocLabelList& internalData
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,17 @@
|
|||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 118
|
||||
/svnroot/openfoam-extend/!svn/ver/1836/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/symmetry
|
||||
END
|
||||
symmetryFaPatch.C
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 136
|
||||
/svnroot/openfoam-extend/!svn/ver/1836/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.C
|
||||
END
|
||||
symmetryFaPatch.H
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 136
|
||||
/svnroot/openfoam-extend/!svn/ver/1836/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.H
|
||||
END
|
|
@ -0,0 +1,96 @@
|
|||
10
|
||||
|
||||
dir
|
||||
1842
|
||||
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/src/finiteArea/faMesh/faPatches/constraint/symmetry
|
||||
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend
|
||||
|
||||
|
||||
|
||||
2010-10-14T08:34:13.105584Z
|
||||
1836
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
e4e07f05-0c2f-0410-a05a-b8ba57e0c909
|
||||
|
||||
symmetryFaPatch.C
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-16T13:27:43.000000Z
|
||||
e55f241fbf11de5782528d6efe57ee16
|
||||
2010-10-14T08:34:13.105584Z
|
||||
1836
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2612
|
||||
|
||||
symmetryFaPatch.H
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2010-10-16T13:27:43.000000Z
|
||||
a1b8b629dc8bc7e4c0f2682bd86e299f
|
||||
2010-10-14T08:34:13.105584Z
|
||||
1836
|
||||
ztukovic
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2638
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "symmetryFaPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(symmetryFaPatch, 0);
|
||||
addToRunTimeSelectionTable(faPatch, symmetryFaPatch, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void symmetryFaPatch::makeCorrVecs(vectorField& cv) const
|
||||
{
|
||||
// Non-orthogonal correction not allowed. HJ, 16/Apr/2009
|
||||
cv = vector::zero;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Construct from dictionary
|
||||
symmetryFaPatch::symmetryFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
faPatch(name, dict, index, bm)
|
||||
{
|
||||
if(ngbPolyPatchIndex() == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"symmetryFaPatch::symmetryFaPatch(const word&, const dictionary&, const label, const faBoundaryMesh&)"
|
||||
) << "Neighbour polyPatch index is not specified for faPatch "
|
||||
<< this->name() << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,96 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::symmetryFaPatch
|
||||
|
||||
Description
|
||||
Symmetry-plane patch.
|
||||
|
||||
SourceFiles
|
||||
symmetryFaPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef symmetryFaPatch_H
|
||||
#define symmetryFaPatch_H
|
||||
|
||||
#include "faPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class symmetryFaPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class symmetryFaPatch
|
||||
:
|
||||
public faPatch
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Make patch face non-orthogonality correction vectors
|
||||
virtual void makeCorrVecs(vectorField&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(symmetryPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
symmetryFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
);
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~symmetryFaPatch()
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,78 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "symmetryFaPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(symmetryFaPatch, 0);
|
||||
addToRunTimeSelectionTable(faPatch, symmetryFaPatch, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void symmetryFaPatch::makeCorrVecs(vectorField& cv) const
|
||||
{
|
||||
// Non-orthogonal correction not allowed. HJ, 16/Apr/2009
|
||||
cv = vector::zero;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//- Construct from dictionary
|
||||
symmetryFaPatch::symmetryFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
faPatch(name, dict, index, bm)
|
||||
{
|
||||
if(ngbPolyPatchIndex() == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"symmetryFaPatch::symmetryFaPatch(const word&, const dictionary&, const label, const faBoundaryMesh&)"
|
||||
) << "Neighbour polyPatch index is not specified for faPatch "
|
||||
<< this->name() << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,96 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::symmetryFaPatch
|
||||
|
||||
Description
|
||||
Symmetry-plane patch.
|
||||
|
||||
SourceFiles
|
||||
symmetryFaPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef symmetryFaPatch_H
|
||||
#define symmetryFaPatch_H
|
||||
|
||||
#include "faPatch.H"
|
||||
#include "symmetryPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class symmetryFaPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class symmetryFaPatch
|
||||
:
|
||||
public faPatch
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Make patch face non-orthogonality correction vectors
|
||||
virtual void makeCorrVecs(vectorField&) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(symmetryPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
symmetryFaPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const faBoundaryMesh& bm
|
||||
);
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~symmetryFaPatch()
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
Reference in a new issue