diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 6b514dfdf5..15b2bd4859 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -734,7 +734,8 @@ private: //- edge conformation location bool nearFeatureEdgeLocation ( - pointIndexHit& pHit + const pointIndexHit& pHit, + pointIndexHit& nearestEdgeHit ) const; //- Build or rebuild the edge location tree diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index e33ce7c6c7..07d93d9f87 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -1897,87 +1897,87 @@ void Foam::conformalVoronoiMesh::indexDualVertices } } - { - // Snapping points far outside - if (cit->boundaryDualVertex() && !cit->parallelDualVertex()) - { - pointFromPoint dual = cit->dual(); - - pointIndexHit hitInfo; - label surfHit; - - // Find nearest surface point - geometryToConformTo_.findSurfaceNearest - ( - dual, - sqr(targetCellSize(dual)), - hitInfo, - surfHit - ); - - if (!hitInfo.hit()) - { - // Project dual to nearest point on tet - - tetPointRef tet - ( - topoint(cit->vertex(0)->point()), - topoint(cit->vertex(1)->point()), - topoint(cit->vertex(2)->point()), - topoint(cit->vertex(3)->point()) - ); - - pointFromPoint nearestPointOnTet = - tet.nearestPoint(dual).rawPoint(); - - // Get nearest point on surface from tet. - geometryToConformTo_.findSurfaceNearest - ( - nearestPointOnTet, - sqr(targetCellSize(nearestPointOnTet)), - hitInfo, - surfHit - ); - - vector snapDir = nearestPointOnTet - dual; - snapDir /= mag(snapDir) + SMALL; - - drawDelaunayCell(tetToSnapTo, cit, offset); - offset += 1; - - vectorField norm(1); - allGeometry_[surfHit].getNormal - ( - List(1, hitInfo), - norm - ); - norm[0] /= mag(norm[0]) + SMALL; - - if - ( - hitInfo.hit() - && (mag(snapDir & norm[0]) > 0.5) - ) - { - snapping1.write - ( - linePointRef(dual, nearestPointOnTet) - ); - - snapping2.write - ( - linePointRef - ( - nearestPointOnTet, - hitInfo.hitPoint() - ) - ); - - pts[cit->cellIndex()] = hitInfo.hitPoint(); - } - } - } - } +// { +// // Snapping points far outside +// if (cit->boundaryDualVertex() && !cit->parallelDualVertex()) +// { +// pointFromPoint dual = cit->dual(); +// +// pointIndexHit hitInfo; +// label surfHit; +// +// // Find nearest surface point +// geometryToConformTo_.findSurfaceNearest +// ( +// dual, +// sqr(targetCellSize(dual)), +// hitInfo, +// surfHit +// ); +// +// if (!hitInfo.hit()) +// { +// // Project dual to nearest point on tet +// +// tetPointRef tet +// ( +// topoint(cit->vertex(0)->point()), +// topoint(cit->vertex(1)->point()), +// topoint(cit->vertex(2)->point()), +// topoint(cit->vertex(3)->point()) +// ); +// +// pointFromPoint nearestPointOnTet = +// tet.nearestPoint(dual).rawPoint(); +// +// // Get nearest point on surface from tet. +// geometryToConformTo_.findSurfaceNearest +// ( +// nearestPointOnTet, +// sqr(targetCellSize(nearestPointOnTet)), +// hitInfo, +// surfHit +// ); +// +// vector snapDir = nearestPointOnTet - dual; +// snapDir /= mag(snapDir) + SMALL; +// +// drawDelaunayCell(tetToSnapTo, cit, offset); +// offset += 1; +// +// vectorField norm(1); +// allGeometry_[surfHit].getNormal +// ( +// List(1, hitInfo), +// norm +// ); +// norm[0] /= mag(norm[0]) + SMALL; +// +// if +// ( +// hitInfo.hit() +// && (mag(snapDir & norm[0]) > 0.5) +// ) +// { +// snapping1.write +// ( +// linePointRef(dual, nearestPointOnTet) +// ); +// +// snapping2.write +// ( +// linePointRef +// ( +// nearestPointOnTet, +// hitInfo.hitPoint() +// ) +// ); +// +// pts[cit->cellIndex()] = hitInfo.hitPoint(); +// } +// } +// } +// } if (cit->boundaryDualVertex()) { diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C index 7f3487f7bf..cb60543a6b 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C @@ -1928,14 +1928,16 @@ bool Foam::conformalVoronoiMesh::pointIsNearSurfaceLocation bool Foam::conformalVoronoiMesh::nearFeatureEdgeLocation ( - pointIndexHit& pHit + const pointIndexHit& pHit, + pointIndexHit& nearestEdgeHit ) const { - Foam::point pt = pHit.hitPoint(); + const Foam::point& pt = pHit.hitPoint(); const scalar exclusionRangeSqr = featureEdgeExclusionDistanceSqr(pt); - bool closeToFeatureEdge = pointIsNearFeatureEdgeLocation(pt); + bool closeToFeatureEdge = + pointIsNearFeatureEdgeLocation(pt, nearestEdgeHit); if (closeToFeatureEdge) { @@ -1978,15 +1980,11 @@ bool Foam::conformalVoronoiMesh::nearFeatureEdgeLocation if ( mag(cosAngle) < searchConeAngle - && ( - mag(lineBetweenPoints) - > foamyHexMeshControls().pointPairDistanceCoeff() - *targetCellSize(pt) - ) + && (mag(lineBetweenPoints) > pointPairDistance(pt)) ) { - pt = edgeHit.hitPoint(); - pHit.setPoint(pt); + //pt = edgeHit.hitPoint(); + //pHit.setPoint(pt); closeToFeatureEdge = false; } else @@ -2183,12 +2181,12 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits if ( - !pointIsNearFeatureEdgeLocation - ( - edPt, - nearestEdgeHit - ) -// !nearFeatureEdgeLocation(edHit) +// !pointIsNearFeatureEdgeLocation +// ( +// edPt, +// nearestEdgeHit +// ) + !nearFeatureEdgeLocation(edHit, nearestEdgeHit) ) { appendToEdgeLocationTree(edPt); diff --git a/src/regionModels/regionModel/regionModel1D/regionModel1D.C b/src/regionModels/regionModel/regionModel1D/regionModel1D.C index 60243b55cd..86c640a3f2 100644 --- a/src/regionModels/regionModel/regionModel1D/regionModel1D.C +++ b/src/regionModels/regionModel/regionModel1D/regionModel1D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -122,6 +122,7 @@ void Foam::regionModels::regionModel1D::initialise() surfaceScalarField& nMagSf = nMagSfPtr_(); + localPyrolysisFaceI = 0; forAll(intCoupledPatchIDs_, i) { const label patchI = intCoupledPatchIDs_[i]; @@ -132,7 +133,7 @@ void Foam::regionModels::regionModel1D::initialise() forAll(pNormals, localFaceI) { const vector& n = pNormals[localFaceI]; - const labelList& faces = boundaryFaceFaces_[localFaceI]; + const labelList& faces = boundaryFaceFaces_[localPyrolysisFaceI++]; forAll (faces, faceI) { const label faceID = faces[faceI]; diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H index 734d510831..3f24e11e4a 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistrySolver/makeSolidChemistrySolverType.H @@ -47,8 +47,8 @@ namespace Foam defineTemplateTypeNameAndDebugWithName \ ( \ SS##Schem##Comp##SThermo##GThermo, \ - (#SS"<" + word(Schem::typeName_()) +"<"#Comp"," + SThermo::typeName() \ - + "," + GThermo::typeName() + ">>").c_str(), \ + (#SS"<"#Schem"<"#Comp"," + SThermo::typeName() + "," \ + + GThermo::typeName() + ">>").c_str(), \ 0 \ ); \ \