diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index cf33a413b6..9433725104 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -520,7 +520,7 @@ void subsetMesh ( cellLabels, exposedFaces, - labelList(patchI, exposedFaces.size()), + labelList(exposedFaces.size(), patchI), meshMod ); diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index 9a5f6cf633..1599857d62 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -1164,7 +1164,12 @@ Foam::labelList Foam::meshRefinement::refineCandidates // Refinement based on curvature of surface // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if (curvatureRefinement && (curvature >= -1 && curvature <= 1)) + if + ( + curvatureRefinement + && (curvature >= -1 && curvature <= 1) + && (surfaces_.minLevel() != surfaces_.maxLevel()) + ) { label nCurv = markSurfaceCurvatureRefinement ( diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index cb664b5757..b1776b3c9e 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -436,7 +436,13 @@ void Foam::searchableBox::findLineAll // Work array DynamicList hits; - // Tolerances +//XXX + // Tolerances: + // To find all intersections we add a small vector to the last intersection + // This is chosen such that + // - it is significant (SMALL is smallest representative relative tolerance; + // we need something bigger since we're doing calculations) + // - if the start-end vector is zero we still progress const vectorField dirVec(end-start); const scalarField magSqrDirVec(magSqr(dirVec)); const vectorField smallVec @@ -447,34 +453,44 @@ void Foam::searchableBox::findLineAll forAll(start, pointI) { - hits.clear(); + // See if any intersection between pt and end + pointIndexHit inter = findLine(start[pointI], end[pointI]); - // Current starting point of ray. - point pt = start[pointI]; - - while (true) + if (inter.hit()) { - // See if any intersection between pt and end - pointIndexHit inter = findLine(pt, end[pointI]); - - if (!inter.hit()) - { - break; - } + hits.clear(); hits.append(inter); - pt = inter.hitPoint() + smallVec[pointI]; + point pt = inter.hitPoint() + smallVec[pointI]; - if (((pt-start[pointI])&dirVec[pointI]) > magSqrDirVec[pointI]) + while (((pt-start[pointI])&dirVec[pointI]) <= magSqrDirVec[pointI]) { - // Adding smallVec has taken us beyond end - break; - } - } + // See if any intersection between pt and end + pointIndexHit inter = findLine(pt, end[pointI]); - hits.shrink(); - info[pointI].transfer(hits); - hits.clear(); + // Check for not hit or hit same face as before (can happen + // if vector along surface of face) + if + ( + !inter.hit() + || (inter.index() == hits[hits.size()-1].index()) + ) + { + break; + } + hits.append(inter); + + pt = inter.hitPoint() + smallVec[pointI]; + } + + hits.shrink(); + info[pointI].transfer(hits); + hits.clear(); + } + else + { + info[pointI].clear(); + } } } diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index 9751e3a3ef..61b760699d 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -443,7 +443,12 @@ void Foam::triSurfaceMesh::findLineAll // Work array DynamicList hits; - // Tolerances + // Tolerances: + // To find all intersections we add a small vector to the last intersection + // This is chosen such that + // - it is significant (SMALL is smallest representative relative tolerance; + // we need something bigger since we're doing calculations) + // - if the start-end vector is zero we still progress const vectorField dirVec(end-start); const scalarField magSqrDirVec(magSqr(dirVec)); const vectorField smallVec @@ -454,34 +459,44 @@ void Foam::triSurfaceMesh::findLineAll forAll(start, pointI) { - hits.clear(); + // See if any intersection between pt and end + pointIndexHit inter = octree.findLine(start[pointI], end[pointI]); - // Current starting point of ray. - point pt = start[pointI]; - - while (true) + if (inter.hit()) { - // See if any intersection between pt and end - pointIndexHit inter = octree.findLine(pt, end[pointI]); - - if (!inter.hit()) - { - break; - } + hits.clear(); hits.append(inter); - pt = inter.hitPoint() + smallVec[pointI]; + point pt = inter.hitPoint() + smallVec[pointI]; - if (((pt-start[pointI])&dirVec[pointI]) > magSqrDirVec[pointI]) + while (((pt-start[pointI])&dirVec[pointI]) <= magSqrDirVec[pointI]) { - // Adding smallVec has taken us beyond end - break; - } - } + // See if any intersection between pt and end + pointIndexHit inter = octree.findLine(pt, end[pointI]); - hits.shrink(); - info[pointI].transfer(hits); - hits.clear(); + // Check for not hit or hit same triangle as before (can happen + // if vector along surface of triangle) + if + ( + !inter.hit() + || (inter.index() == hits[hits.size()-1].index()) + ) + { + break; + } + hits.append(inter); + + pt = inter.hitPoint() + smallVec[pointI]; + } + + hits.shrink(); + info[pointI].transfer(hits); + hits.clear(); + } + else + { + info[pointI].clear(); + } } } diff --git a/src/turbulenceModels/RAS/compressible/LRR/LRR.C b/src/turbulenceModels/RAS/compressible/LRR/LRR.C index 9c544bc009..4a703d2c8f 100644 --- a/src/turbulenceModels/RAS/compressible/LRR/LRR.C +++ b/src/turbulenceModels/RAS/compressible/LRR/LRR.C @@ -214,8 +214,8 @@ LRR::LRR FatalErrorIn ( "LRR::LRR" - "(const volVectorField& U, const surfaceScalarField& phi," - "incompressibleTransportModel& lamTransportModel)" + "( const volScalarField&, const volVectorField&" + ", const surfaceScalarField&, incompressibleTransportModel&)" ) << "couplingFactor = " << couplingFactor_ << " is not in range 0 - 1" << nl << exit(FatalError); diff --git a/src/turbulenceModels/RAS/compressible/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/RAS/compressible/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 47bac57df9..4b977f0809 100644 --- a/src/turbulenceModels/RAS/compressible/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/RAS/compressible/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -236,8 +236,8 @@ LaunderGibsonRSTM::LaunderGibsonRSTM FatalErrorIn ( "LaunderGibsonRSTM::LaunderGibsonRSTM" - "(const volVectorField& U, const surfaceScalarField& phi," - "incompressibleTransportModel& lamTransportModel)" + "(const volScalarField&, const volVectorField&" + ", const surfaceScalarField&, basicThermo&)" ) << "couplingFactor = " << couplingFactor_ << " is not in range 0 - 1" << nl << exit(FatalError); diff --git a/src/turbulenceModels/RAS/compressible/RASModel/newRASModel.C b/src/turbulenceModels/RAS/compressible/RASModel/newRASModel.C index 2d908397df..339e9ad2d2 100644 --- a/src/turbulenceModels/RAS/compressible/RASModel/newRASModel.C +++ b/src/turbulenceModels/RAS/compressible/RASModel/newRASModel.C @@ -74,8 +74,8 @@ autoPtr RASModel::New { FatalErrorIn ( - "RASModel::New(const volScalarField& rho, " - "const volVectorField& U, const surfaceScalarField& phi, " + "RASModel::New(const volScalarField&, " + "const volVectorField&, const surfaceScalarField&, " "basicThermo&)" ) << "Unknown RASModel type " << RASModelTypeName << endl << endl diff --git a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index d2784bbc0e..01b341748d 100644 --- a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -35,6 +35,8 @@ License namespace Foam { +namespace compressible +{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -144,6 +146,7 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace compressible } // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 6fbd983e32..8b13df2af0 100644 --- a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -23,7 +23,8 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField + Foam::compressible:: + turbulentMixingLengthDissipationRateInletFvPatchScalarField Description Calculate epsilon via the mixing length [m] @@ -43,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef turbulentMixingLengthDissipationRateInletFvPatchScalarField_H -#define turbulentMixingLengthDissipationRateInletFvPatchScalarField_H +#ifndef compressibleturbulentMixingLengthDissipationRateInletFvPatchField_H +#define compressibleturbulentMixingLengthDissipationRateInletFvPatchField_H #include "fixedValueFvPatchFields.H" @@ -52,6 +53,8 @@ SourceFiles namespace Foam { +namespace compressible +{ /*---------------------------------------------------------------------------*\ Class turbulentMixingLengthDissipationRateInletFvPatch Declaration @@ -154,6 +157,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace compressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 29e1db1017..92f01a9a7b 100644 --- a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -35,6 +35,8 @@ License namespace Foam { +namespace compressible +{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -150,6 +152,7 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace compressible } // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index a0db1440f2..ebba209f1e 100644 --- a/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/RAS/compressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::turbulentMixingLengthFrequencyInletFvPatchScalarField + Foam::compressible::turbulentMixingLengthFrequencyInletFvPatchScalarField Description Calculate omega via the mixing length @@ -44,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef turbulentMixingLengthFrequencyInletFvPatchScalarField_H -#define turbulentMixingLengthFrequencyInletFvPatchScalarField_H +#ifndef compressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define compressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H #include "fixedValueFvPatchFields.H" @@ -53,6 +53,8 @@ SourceFiles namespace Foam { +namespace compressible +{ /*---------------------------------------------------------------------------*\ Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration @@ -159,6 +161,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace compressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 20c44ffb20..699559c2cf 100644 --- a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -35,6 +35,8 @@ License namespace Foam { +namespace incompressible +{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -144,6 +146,7 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace incompressible } // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 6fbd983e32..63a764f225 100644 --- a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -23,7 +23,8 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField + Foam::incompressible:: + turbulentMixingLengthDissipationRateInletFvPatchScalarField Description Calculate epsilon via the mixing length [m] @@ -43,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef turbulentMixingLengthDissipationRateInletFvPatchScalarField_H -#define turbulentMixingLengthDissipationRateInletFvPatchScalarField_H +#ifndef incompressibleturbulentMixingLengthDissipationRateInlet_H +#define incompressibleturbulentMixingLengthDissipationRateInlet_H #include "fixedValueFvPatchFields.H" @@ -52,6 +53,8 @@ SourceFiles namespace Foam { +namespace incompressible +{ /*---------------------------------------------------------------------------*\ Class turbulentMixingLengthDissipationRateInletFvPatch Declaration @@ -154,6 +157,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace incompressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index b467fe2617..465118cdbf 100644 --- a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -35,6 +35,8 @@ License namespace Foam { +namespace incompressible +{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -150,6 +152,7 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace incompressible } // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index a0db1440f2..bdfa5e845a 100644 --- a/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/RAS/incompressible/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::turbulentMixingLengthFrequencyInletFvPatchScalarField + Foam::incompressible::turbulentMixingLengthFrequencyInletFvPatchScalarField Description Calculate omega via the mixing length @@ -44,8 +44,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef turbulentMixingLengthFrequencyInletFvPatchScalarField_H -#define turbulentMixingLengthFrequencyInletFvPatchScalarField_H +#ifndef incompressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define incompressibleturbulentMixingLengthFrequencyInletFvPatchScalarField_H #include "fixedValueFvPatchFields.H" @@ -53,6 +53,8 @@ SourceFiles namespace Foam { +namespace incompressible +{ /*---------------------------------------------------------------------------*\ Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration @@ -159,6 +161,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace incompressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //