diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index f2a52c2e5b..4e5b20e4ab 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 cf503b0574..5e142f9d85 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 ce40f502e1..6e4f009be2 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 2c945fae54..1f4465637f 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::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::nearestPoint minDist = dist; nearestEdgePoint = triEdgePoint; nearestLinePoint = linePoint; - minEdgeIndex = 1; + //minEdgeIndex = 1; } } @@ -755,7 +755,7 @@ inline Foam::pointHit Foam::triangle::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 054d87575e..c2e768cceb 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::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 4894fae3c4..7db661b48e 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 8476e63dff..e18ef462ea 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 3e0b5442d7..b768e5726e 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 03f6355870..920c782286 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::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::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 6aea34e945..820d3f22fc 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::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::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::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 dde6c52c4e..2f29a30216 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 d09ec8ee55..56a476f97d 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 5ee38ffba1..0b8ef68cf0 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("Qr", "none")) { - fvPatchField::operator=(patchInternalField()); - gradient() = 0.0; + if (dict.found("value") && dict.found("gradient")) + { + fvPatchField::operator=(Field("value", dict, p.size())); + gradient() = Field("gradient", dict, p.size()); + } + else + { + // Still reading so cannot yet evaluate. Make up a value. + fvPatchField::operator=(patchInternalField()); + gradient() = 0.0; + } } diff --git a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/fvSolution index 8dabfdac0a..26948af5b6 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) }