diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files index 940f0c7a2..0e382891c 100644 --- a/src/finiteArea/Make/files +++ b/src/finiteArea/Make/files @@ -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 diff --git a/src/finiteArea/faMesh/faPatches/basic/coupled/coupledFaPatch.C b/src/finiteArea/faMesh/faPatches/basic/coupled/coupledFaPatch.C index 458a38989..94b4b070d 100644 --- a/src/finiteArea/faMesh/faPatches/basic/coupled/coupledFaPatch.C +++ b/src/finiteArea/faMesh/faPatches/basic/coupled/coupledFaPatch.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); diff --git a/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/all-wcprops b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/all-wcprops new file mode 100644 index 000000000..da0b85803 --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/all-wcprops @@ -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 diff --git a/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/entries b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/entries new file mode 100644 index 000000000..c5b6fe161 --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/entries @@ -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 + diff --git a/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/text-base/cyclicFaPatch.C.svn-base b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/text-base/cyclicFaPatch.C.svn-base new file mode 100644 index 000000000..2de9b87cb --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/cyclic/.svn/text-base/cyclicFaPatch.C.svn-base @@ -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; iedgeCentres()[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 cyclicFaPatch::delta() const +{ + vectorField patchD = faPatch::delta(); + label sizeby2 = patchD.size()/2; + + tmp 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 cyclicFaPatch::interfaceInternalField +( + const unallocLabelList& internalData +) const +{ + return patchInternalField(internalData); +} + + +tmp cyclicFaPatch::transfer +( + const Pstream::commsTypes, + const unallocLabelList& interfaceData +) const +{ + tmp tpnf(new labelField(this->size())); + labelField& pnf = tpnf(); + + label sizeby2 = this->size()/2; + + for (label edgei=0; edgei cyclicFaPatch::internalFieldTransfer +( + const Pstream::commsTypes commsType, + const unallocLabelList& iF +) const +{ + const unallocLabelList& edgeCells = this->faceCells(); + + tmp tpnf(new labelField(this->size())); + labelField& pnf = tpnf(); + + label sizeby2 = this->size()/2; + + for (label edgei=0; edgei delta() const; + + + // Interface transfer functions + + //- Return the values of the given internal data adjacent to + // the interface as a field + virtual tmp interfaceInternalField + ( + const unallocLabelList& internalData + ) const; + + //- Transfer and return neighbour field + virtual tmp transfer + ( + const Pstream::commsTypes commsType, + const unallocLabelList& interfaceData + ) const; + + //- Return neighbour field + virtual tmp internalFieldTransfer + ( + const Pstream::commsTypes commsType, + const unallocLabelList& internalData + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/faMesh/faPatches/constraint/cyclic/cyclicFaPatch.C b/src/finiteArea/faMesh/faPatches/constraint/cyclic/cyclicFaPatch.C new file mode 100644 index 000000000..2de9b87cb --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/cyclic/cyclicFaPatch.C @@ -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; iedgeCentres()[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 cyclicFaPatch::delta() const +{ + vectorField patchD = faPatch::delta(); + label sizeby2 = patchD.size()/2; + + tmp 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 cyclicFaPatch::interfaceInternalField +( + const unallocLabelList& internalData +) const +{ + return patchInternalField(internalData); +} + + +tmp cyclicFaPatch::transfer +( + const Pstream::commsTypes, + const unallocLabelList& interfaceData +) const +{ + tmp tpnf(new labelField(this->size())); + labelField& pnf = tpnf(); + + label sizeby2 = this->size()/2; + + for (label edgei=0; edgei cyclicFaPatch::internalFieldTransfer +( + const Pstream::commsTypes commsType, + const unallocLabelList& iF +) const +{ + const unallocLabelList& edgeCells = this->faceCells(); + + tmp tpnf(new labelField(this->size())); + labelField& pnf = tpnf(); + + label sizeby2 = this->size()/2; + + for (label edgei=0; edgei delta() const; + + + // Interface transfer functions + + //- Return the values of the given internal data adjacent to + // the interface as a field + virtual tmp interfaceInternalField + ( + const unallocLabelList& internalData + ) const; + + //- Transfer and return neighbour field + virtual tmp transfer + ( + const Pstream::commsTypes commsType, + const unallocLabelList& interfaceData + ) const; + + //- Return neighbour field + virtual tmp internalFieldTransfer + ( + const Pstream::commsTypes commsType, + const unallocLabelList& internalData + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/all-wcprops b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/all-wcprops new file mode 100644 index 000000000..e4f034962 --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/all-wcprops @@ -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 diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/entries b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/entries new file mode 100644 index 000000000..a5a5d3edb --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/entries @@ -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 + diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.C.svn-base b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.C.svn-base new file mode 100644 index 000000000..3027dab7b --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.C.svn-base @@ -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 + +// ************************************************************************* // diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.H.svn-base b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.H.svn-base new file mode 100644 index 000000000..d3b52b8f4 --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/.svn/text-base/symmetryFaPatch.H.svn-base @@ -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 + +// ************************************************************************* // diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.C b/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.C new file mode 100644 index 000000000..3027dab7b --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.C @@ -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 + +// ************************************************************************* // diff --git a/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.H b/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.H new file mode 100644 index 000000000..d3b52b8f4 --- /dev/null +++ b/src/finiteArea/faMesh/faPatches/constraint/symmetry/symmetryFaPatch.H @@ -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 + +// ************************************************************************* //