diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index f2a52c2e5b0abfb494eed576e019f185e2c45471..4e5b20e4ab081cc54904c5b6e7015a3f19c0ea85 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -222,6 +222,11 @@ castellatedMeshControls // are only on the boundary of corresponding cellZones or also allow // free-standing zone faces. Not used if there are no faceZones. allowFreeStandingZoneFaces true; + + + // Optional: whether all baffles get eroded away. WIP. Used for + // surface simplification. + //allowFreeStandingBaffles false; } // Settings for the snapping. diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index cf503b057483308a9901df7500dce05572a5d308..5e142f9d857dc756bb5d81246e7a4907d64416dd 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -852,7 +852,7 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry) if (allGeometry) { faceSet faces(mesh, "lowVolRatioFaces", mesh.nFaces()/100); - if (mesh.checkVolRatio(true, 0.05, &faces)) + if (mesh.checkVolRatio(true, 0.01, &faces)) { noFailedChecks++; diff --git a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C index ce40f502e187ffecf35cc9b45fc1cb0b7329fbb6..6e4f009be2acf66110eee9df211aee24a18a51f6 100644 --- a/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C +++ b/applications/utilities/postProcessing/miscellaneous/writeCellCentres/writeCellCentres.C @@ -97,6 +97,23 @@ int main(int argc, char *argv[]) cci.write(); } + + volScalarField V + ( + IOobject + ( + "V", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE, + false + ), + mesh, + + ); + mesh.V().setInstance(runTime.timeName()); + mesh.V().write(); } Info<< "\nEnd\n" << endl; diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H index 2c945fae5450a1b67e859a6481b4e9ed6407ff98..1f4465637f679f82618741c0b3facf5775526e54 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H @@ -715,7 +715,7 @@ inline Foam::pointHit Foam::triangle<Point, PointRef>::nearestPoint point nearestEdgePoint; point nearestLinePoint; - label minEdgeIndex = 0; + //label minEdgeIndex = 0; scalar minDist = ln.nearestDist ( linePointRef(a_, b_), @@ -737,7 +737,7 @@ inline Foam::pointHit Foam::triangle<Point, PointRef>::nearestPoint minDist = dist; nearestEdgePoint = triEdgePoint; nearestLinePoint = linePoint; - minEdgeIndex = 1; + //minEdgeIndex = 1; } } @@ -755,7 +755,7 @@ inline Foam::pointHit Foam::triangle<Point, PointRef>::nearestPoint minDist = dist; nearestEdgePoint = triEdgePoint; nearestLinePoint = linePoint; - minEdgeIndex = 2; + //minEdgeIndex = 2; } } diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index 054d87575e233f582dca293d42a4b8f05205ae87..c2e768ccebc65daf8e4827a997afdad57ec823dd 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C @@ -363,7 +363,7 @@ Type Foam::TableBase<Type>::value(const scalar x) const } // Use interpolator - interpolator().valueWeights(x, currentIndices_, currentWeights_); + interpolator().valueWeights(xDash, currentIndices_, currentWeights_); Type t = currentWeights_[0]*table_[currentIndices_[0]].second(); for (label i = 1; i < currentIndices_.size(); i++) diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C index 4894fae3c414e5b2389ffe6a6cea09a1b9f5cc84..7db661b48ed3551aabe9e59fdfe464c4a4717de4 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.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 @@ -81,7 +81,7 @@ bool Foam::SRF::SRFModel::read() if (regIOobject::read()) { // Re-read axis - SRFModelCoeffs_.lookup("axis") >> axis_; + lookup("axis") >> axis_; axis_ /= mag(axis_); // Re-read sub-model coeffs diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H index 8476e63dffc0f34ecae8c23cf016655a83b9e2fb..e18ef462eab6df881717561c60a127fc2ff16f3b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::fixedFluxPressureFvPatchScalarField Group - grpOutletBoundaryConditions + grpInletBoundaryConditions grpWallBoundaryConditions Description This boundary condition adjusts the pressure gradient such that the flux diff --git a/src/fvMotionSolver/motionDiffusivity/inverseVolume/inverseVolumeDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseVolume/inverseVolumeDiffusivity.C index 3e0b5442d71717cb5ce25eebdce8687308e9be68..b768e5726ea3aaf976af9e073cf65f287d223667 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseVolume/inverseVolumeDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseVolume/inverseVolumeDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,7 +75,10 @@ void Foam::inverseVolumeDiffusivity::correct() ( "V", mesh().time().timeName(), - mesh() + mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false ), mesh(), dimless, diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C index 03f6355870b2b89e37940ad64b89bb0f48d1e1d7..920c78228682b85f6bcfbf1143e77eb5a85667b2 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C @@ -26,6 +26,7 @@ License #include "AMIMethod.H" #include "meshTools.H" #include "mapDistribute.H" +#include "unitConversion.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -262,6 +263,7 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::appendNbrFaces ) const { const labelList& nbrFaces = patch.faceFaces()[faceI]; + const pointField& tgtPoints = patch.points(); // filter out faces already visited from src face neighbours forAll(nbrFaces, i) @@ -291,7 +293,17 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::appendNbrFaces if (valid) { - faceIDs.append(nbrFaceI); + const face& myn = patch[faceI]; + const face& nbrn = patch[nbrFaceI]; + const vector& nbrNormal = nbrn.normal(tgtPoints); + const vector& mynNormal = myn.normal(tgtPoints); + + scalar cosI = nbrNormal & mynNormal; + + if (cosI > Foam::cos(degToRad(89.0))) + { + faceIDs.append(nbrFaceI); + } } } } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C index 6aea34e945827dbce24cc272e9dba3c811cac77f..820d3f22fcbf69142e69732d49503bdf75a2b854 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C @@ -68,7 +68,7 @@ bool Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::processSourceFace scalar area = interArea(srcFaceI, tgtFaceI); // store when intersection area > 0 - if (area > 0) + if (area/this->srcMagSf_[srcFaceI] > faceAreaIntersect::tolerance()) { srcAddr[srcFaceI].append(tgtFaceI); srcWght[srcFaceI].append(area); @@ -228,10 +228,10 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea // quick reject if either face has zero area // Note: do not used stored face areas for target patch + const scalar tgtMag = tgt.mag(tgtPoints); if ( - (this->srcMagSf_[srcFaceI] < ROOTVSMALL) - || (tgt.mag(tgtPoints) < ROOTVSMALL) + (this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL) ) { return 0.0; @@ -242,13 +242,14 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea // crude resultant norm vector n(-src.normal(srcPoints)); + n /= mag(n); if (this->reverseTarget_) { - n -= tgt.normal(tgtPoints); + n -= tgt.normal(tgtPoints)/tgtMag; } else { - n += tgt.normal(tgtPoints); + n += tgt.normal(tgtPoints)/tgtMag; } n *= 0.5; diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C index dde6c52c4e43e48e316d9a6fa0959860c170c720..2f29a302162b5396b718da9a17b002aa4da34e7d 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -133,7 +133,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const scalar maxComp = -GREAT; label maxCells = 0; - scalar maxVol = 0; + //scalar maxVol = 0; scalar minComp = GREAT; { const boundBox& bb = mesh_.bounds(); @@ -158,7 +158,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const PackedBoolList maxSelected(mesh_.nCells()); maxCells = selectCells(maxComp, maskSet, maxSelected); - maxVol = volumeOfSet(maxSelected); + //maxVol = volumeOfSet(maxSelected); // Check that maxPoint indeed selects all cells if (maxCells != nTotCells) diff --git a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C index d09ec8ee554b90a6bd55c857b28ef7776a0c70ef..56a476f97d2250fdc05adf85d8d5d715949f9708 100644 --- a/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C +++ b/src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C @@ -271,11 +271,6 @@ energyRegionCoupledFvPatchScalarField << " in file " << dimensionedInternalField().objectPath() << exit(FatalError); } - - if (dict.found("value")) - { - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - } } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index 5ee38ffba1adbfcd21583e99300897678fbeb7aa..0b8ef68cf08e2aa8ef791d8bdfdc04ba75162570 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -114,8 +114,17 @@ turbulentHeatFluxTemperatureFvPatchScalarField q_("q", dict, p.size()), QrName_(dict.lookupOrDefault<word>("Qr", "none")) { - fvPatchField<scalar>::operator=(patchInternalField()); - gradient() = 0.0; + if (dict.found("value") && dict.found("gradient")) + { + fvPatchField<scalar>::operator=(Field<scalar>("value", dict, p.size())); + gradient() = Field<scalar>("gradient", dict, p.size()); + } + else + { + // Still reading so cannot yet evaluate. Make up a value. + fvPatchField<scalar>::operator=(patchInternalField()); + gradient() = 0.0; + } } diff --git a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution index 8dabfdac0a8192e197f0550d41b1691f1c3b68e6..26948af5b6a361ba0e03a32f814bacd42896d467 100644 --- a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution +++ b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution @@ -34,7 +34,7 @@ stressAnalysis { nCorrectors 1; D 1e-10; - accelerationFactor 2; + accelerationFactor 2; // lower for other Poisson ratio (e.g. 0.1 for 0.3) }