diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatchDict b/applications/utilities/mesh/manipulation/createPatch/createPatchDict index b8676f134d3798461fd5d0a7b8bed1af21151d4b..2d4046d4568b99d5b4947c3747f1ce4171472754 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatchDict +++ b/applications/utilities/mesh/manipulation/createPatch/createPatchDict @@ -43,6 +43,8 @@ FoamFile matchTolerance 1E-3; // Do a synchronisation of coupled points after creation of any patches. +// Note: this does not work with points that are on multiple coupled patches +// with transformations. pointSync true; // Patches to create. diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 9f378cbfe3f0440b85ab820a72bae1cf72a4073e..a584789167936e2ced0cc9f8d925d34a49ea6ce3 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -64,6 +64,7 @@ Description #include "syncTools.H" #include "ReadFields.H" #include "directMappedWallPolyPatch.H" +#include "zeroGradientFvPatchFields.H" using namespace Foam; @@ -164,25 +165,24 @@ void reorderPatchFields(fvMesh& mesh, const labelList& oldToNew) // Adds patch if not yet there. Returns patchID. -template<class PatchType> -label addPatch(fvMesh& mesh, const word& patchName) +label addPatch(fvMesh& mesh, const polyPatch& patch) { polyBoundaryMesh& polyPatches = const_cast<polyBoundaryMesh&>(mesh.boundaryMesh()); - label patchI = polyPatches.findPatchID(patchName); + label patchI = polyPatches.findPatchID(patch.name()); if (patchI != -1) { - if (isA<PatchType>(polyPatches[patchI])) + if (polyPatches[patchI].type() == patch.type()) { // Already there return patchI; } else { - FatalErrorIn("addPatch<PatchType>(fvMesh&, const word&)") - << "Already have patch " << patchName - << " but of type " << PatchType::typeName + FatalErrorIn("addPatch(fvMesh&, const polyPatch*)") + << "Already have patch " << patch.name() + << " but of type " << patch.type() << exit(FatalError); } } @@ -219,14 +219,12 @@ label addPatch(fvMesh& mesh, const word& patchName) polyPatches.set ( sz, - polyPatch::New + patch.clone ( - PatchType::typeName, - patchName, - 0, // size - startFaceI, - insertPatchI, - polyPatches + polyPatches, + insertPatchI, //index + 0, //size + startFaceI //start ) ); fvPatches.setSize(sz+1); @@ -1086,16 +1084,37 @@ EdgeMap<label> addRegionPatches if (interfaceSizes[e] > 0) { - label patchI = addPatch<directMappedWallPolyPatch> + const word inter1 = regionNames[e[0]] + "_to_" + regionNames[e[1]]; + const word inter2 = regionNames[e[1]] + "_to_" + regionNames[e[0]]; + + directMappedWallPolyPatch patch1 ( - mesh, - regionNames[e[0]] + "_to_" + regionNames[e[1]] + inter1, + 0, // overridden + 0, // overridden + 0, // overridden + regionNames[e[1]], // sampleRegion + directMappedPatchBase::NEARESTPATCHFACE, + inter2, // samplePatch + point::zero, // offset + mesh.boundaryMesh() ); - addPatch<directMappedWallPolyPatch> + + label patchI = addPatch(mesh, patch1); + + directMappedWallPolyPatch patch2 ( - mesh, - regionNames[e[1]] + "_to_" + regionNames[e[0]] + inter2, + 0, + 0, + 0, + regionNames[e[0]], // sampleRegion + directMappedPatchBase::NEARESTPATCHFACE, + inter1, + point::zero, // offset + mesh.boundaryMesh() ); + addPatch(mesh, patch2); Info<< "For interface between region " << e[0] << " and " << e[1] << " added patch " << patchI @@ -1495,7 +1514,8 @@ int main(int argc, char *argv[]) false ), mesh, - dimensionedScalar("zero", dimless, 0) + dimensionedScalar("zero", dimless, 0), + zeroGradientFvPatchScalarField::typeName ); forAll(cellRegion, cellI) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriterTemplates.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriterTemplates.C index f9a01d57a4ba31bd3aef10148a75ac0efb8554f9..90ccaf71f692c62165309e8f95523e07900c0612 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriterTemplates.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecplotWriterTemplates.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "tecplotWriter.H" - //extern "C" //{ #include "MASTER.h" #include "GLOBAL.h" //} +#include "tecplotWriter.H" + #include "fvc.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index 518a75ab5a461c7f9c34da055db15eea30222d94..cb8d07babc398f7946f6d1fb86669c5a0f2756c9 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -83,9 +83,9 @@ sets type uniform; axis distance; - //- cavity - start (0.02 0.051 0.005); - end (0.06 0.051 0.005); + //- cavity. Slightly perturbed so not to align with face or edge. + start (0.0201 0.05101 0.00501); + end (0.0601 0.05101 0.00501); nPoints 10; } @@ -103,8 +103,8 @@ sets //end ( 1 0.05 0.005); //- cavity - start (0.0 0.51 0.005); - end (2 0.51 0.005); + start (0.001 0.5101 0.00501); + end (2.01 0.5101 0.00501); nPoints 10; } @@ -112,7 +112,7 @@ sets { type cloud; axis xyz; - points ((0.049 0.049 0.005)(0.051 0.049 0.005)); + points ((0.049 0.049 0.00501)(0.051 0.049 0.00501)); } ); diff --git a/bin/mpirunDebug b/bin/mpirunDebug index 2376d22601c0e1c6f7f58cc1f95a70e9bef9476a..a62aa938765b33dc8fba0813406ceb30fa2baf00 100755 --- a/bin/mpirunDebug +++ b/bin/mpirunDebug @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #------------------------------------------------------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 33c863215ecca5118d4eb1b249264731919bc623..fdd1e819cf4eca530cf694c839f94a686637a034 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -44,8 +44,8 @@ foreach cmake ( cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 ) endif end -set paraviewMajor=paraview-3.6 -setenv ParaView_VERSION 3.6.1 +if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR paraview-3.6 +if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.6.1 setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER @@ -54,9 +54,9 @@ setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping if ( -r $paraviewPython ) then if ($?PYTHONPATH) then - setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/${paraviewMajor} + setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/${ParaView_MAJOR} else - setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/${paraviewMajor} + setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/${ParaView_MAJOR} endif endif @@ -65,5 +65,5 @@ if ( -r $ParaView_INST_DIR ) then setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview endif -unset cmake paraviewMajor paraviewPython +unset cmake paraviewPython # ----------------------------------------------------------------------------- diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H index 59a2ba8ddd75fad08ef0ccedf66c0a25a0970169..905db6a24c3e3ed5cdd2a1723e79c7cd26e89636 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H @@ -224,7 +224,7 @@ inline Foam::UList<T> Foam::CompactListList<T, Container>::operator[] ) { label start = offsets_[i]; - return UList<T>(&m_[start], offsets_[i+1] - start); + return UList<T>((m_.size() ? &m_[start] : NULL), offsets_[i+1] - start); } @@ -238,7 +238,7 @@ Foam::CompactListList<T, Container>::operator[] label start = offsets_[i]; return UList<T> ( - const_cast<T*>(&m_[start]), + (m_.size() ? const_cast<T*>(&m_[start]) : NULL), offsets_[i+1] - start ); } diff --git a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C index 848ec35d2150a250a65a4cca302de6878bb06036..99d3a85bddd17af6e24ac2be620398a5e712aa9f 100644 --- a/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C +++ b/src/dynamicMesh/fvMeshDistribute/fvMeshDistribute.C @@ -1138,7 +1138,7 @@ void Foam::fvMeshDistribute::sendMesh { const cellZoneMesh& cellZones = mesh.cellZones(); - labelList rowSizes(pointZoneNames.size(), 0); + labelList rowSizes(cellZoneNames.size(), 0); forAll(cellZoneNames, nameI) { diff --git a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H index f81595ad5903169c00e1d0a7b61fee09f7f4914f..242d029fc8e42e7909f5d6e03820cc74740c91de 100644 --- a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H +++ b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H @@ -27,7 +27,6 @@ License #ifndef createCoalParcelTypes_H #define createCoalParcelTypes_H -#include "makeParcelIOList.H" #include "thermoPhysicsTypes.H" #include "CoalCloud.H" @@ -56,8 +55,6 @@ License \ typedef ParcelType<ThermoType> ParcelType##ThermoType; \ \ - makeParcelIOList(ParcelType##ThermoType); \ - \ defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \ defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \ diff --git a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C index 0f81dff2f5e477815eda5188a35852163057cc9e..a23c1ef56c03c679e2b4ccfde353ffe3f71cc54d 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementSurfaces/refinementSurfaces.C @@ -670,7 +670,6 @@ void Foam::refinementSurfaces::findHigherIntersection haveLevelField = true; } - if (haveLevelField) { forAll(intersectionInfo, i) @@ -741,8 +740,8 @@ void Foam::refinementSurfaces::findHigherIntersection } else { - p0[missI] = p0[pointI]; - p1[missI] = p1[pointI]; + p0[missI] = start[pointI]; + p1[missI] = end[pointI]; intersectionToPoint[missI] = pointI; missI++; } diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C index 899203b54055f35dfe3bd9305f44df82cd0ae453..5539dcc2fb50cd62ae96ff42962f0e9b4eea10ab 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C @@ -623,6 +623,27 @@ Foam::directMappedPatchBase::directMappedPatchBase {} +Foam::directMappedPatchBase::directMappedPatchBase +( + const polyPatch& pp, + const word& sampleRegion, + const sampleMode mode, + const word& samplePatch, + const vector& offset +) +: + patch_(pp), + sampleRegion_(sampleRegion), + mode_(mode), + samplePatch_(samplePatch), + uniformOffset_(true), + offset_(offset), + offsets_(0), + sameRegion_(sampleRegion_ == patch_.boundaryMesh().mesh().name()), + mapPtr_(NULL) +{} + + Foam::directMappedPatchBase::directMappedPatchBase ( const polyPatch& pp, diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H index 3d6c0724290180d58ffca64d5fc8552ac2b6e727..e5702a7b430947c497856bef3fec19965cb443ce 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.H @@ -157,6 +157,16 @@ public: const vectorField& offset ); + //- Construct from components + directMappedPatchBase + ( + const polyPatch& pp, + const word& sampleRegion, + const sampleMode sampleMode, + const word& samplePatch, + const vector& offset + ); + //- Construct from dictionary directMappedPatchBase(const polyPatch&, const dictionary&); diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C index 0da60686813aa8a54acdeed7eb12a11553562ad8..5296d277d2c56d063a6ff6234b68a858fd7a4430 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.C @@ -82,6 +82,31 @@ Foam::directMappedPolyPatch::directMappedPolyPatch {} +Foam::directMappedPolyPatch::directMappedPolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm +) +: + polyPatch(name, size, start, index, bm), + directMappedPatchBase + ( + static_cast<const polyPatch&>(*this), + sampleRegion, + mode, + samplePatch, + offset + ) +{} + + Foam::directMappedPolyPatch::directMappedPolyPatch ( const word& name, diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H index 654c3470a481d97343027883a86333ea509898b3..2472a6e35c919d1ec37fcc03912b7527b58bdf41 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPolyPatch.H @@ -115,6 +115,20 @@ public: const polyBoundaryMesh& bm ); + //- Construct from components. Uniform offset. + directMappedPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm + ); + //- Construct from dictionary directMappedPolyPatch ( diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C index c4295a31a433550ddb49796cc4af29172073ddcc..4813e0b86fa74581b3820b64f61ae3ae3a059f88 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C @@ -87,6 +87,31 @@ Foam::directMappedWallPolyPatch::directMappedWallPolyPatch {} +Foam::directMappedWallPolyPatch::directMappedWallPolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm +) +: + wallPolyPatch(name, size, start, index, bm), + directMappedPatchBase + ( + static_cast<const polyPatch&>(*this), + sampleRegion, + mode, + samplePatch, + offset + ) +{} + + Foam::directMappedWallPolyPatch::directMappedWallPolyPatch ( const word& name, diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H index b0657164da9304bc6db68d48c05dd74c63253745..6a7234f137af111ee27cbe61de676584c256fc48 100644 --- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedWallPolyPatch.H @@ -115,6 +115,20 @@ public: const polyBoundaryMesh& bm ); + //- Construct from components. Uniform offset. + directMappedWallPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm + ); + //- Construct from dictionary directMappedWallPolyPatch ( diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C index f599c447f64ef24e47ab82b12c9243a981a58b7c..2eac477a0802a754652d7653225c3763fde2361c 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C @@ -76,21 +76,24 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField TName_(dict.lookup("T")), emissivity_(readScalar(dict.lookup("emissivity"))) { - const scalarField& Tp = - patch().lookupPatchField<volScalarField, scalar>(TName_); - - refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp); - refGrad() = 0.0; - if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", dict, p.size()) ); + refValue() = scalarField("refValue", dict, p.size()); + refGrad() = scalarField("refGradient", dict, p.size()); + valueFraction() = scalarField("valueFraction", dict, p.size()); } else { + const scalarField& Tp = + patch().lookupPatchField<volScalarField, scalar>(TName_); + + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp); + refGrad() = 0.0; + fvPatchScalarField::operator=(refValue()); } } @@ -169,10 +172,9 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs() void Foam::MarshakRadiationFvPatchScalarField::write(Ostream& os) const { - fvPatchScalarField::write(os); + mixedFvPatchScalarField::write(os); os.writeKeyword("T") << TName_ << token::END_STATEMENT << nl; os.writeKeyword("emissivity") << emissivity_ << token::END_STATEMENT << nl; - writeEntry("value", os); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C index 2620d111cba736293c376a37238fc4ca15e7affc..1e7836352cd30dc1f17f0a30873f032e4766f1f1 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C @@ -79,18 +79,22 @@ MarshakRadiationFixedTMixedFvPatchScalarField Trad_("Trad", dict, p.size()), emissivity_(readScalar(dict.lookup("emissivity"))) { - refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_); - refGrad() = 0.0; - if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", dict, p.size()) ); + refValue() = scalarField("refValue", dict, p.size()); + refGrad() = scalarField("refGradient", dict, p.size()); + valueFraction() = scalarField("valueFraction", dict, p.size()); } else { + refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_); + refGrad() = 0.0; + valueFraction() = 1.0; + fvPatchScalarField::operator=(refValue()); } } @@ -128,7 +132,7 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::autoMap const fvPatchFieldMapper& m ) { - scalarField::autoMap(m); + mixedFvPatchScalarField::autoMap(m); Trad_.autoMap(m); } @@ -173,10 +177,9 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::updateCoeffs() void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::write(Ostream& os) const { - fvPatchScalarField::write(os); + mixedFvPatchScalarField::write(os); Trad_.writeEntry("Trad", os); os.writeKeyword("emissivity") << emissivity_ << token::END_STATEMENT << nl; - writeEntry("value", os); } diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index a0a83e9e843d37a36a83f01dc6f6b4d3164e19d2..8cb1820191009ae776ed6d4cf0031d11794ab223 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -82,22 +82,25 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField TName_(dict.lookup("T")), emissivity_(readScalar(dict.lookup("emissivity"))) { - const scalarField& Tp = - patch().lookupPatchField<volScalarField, scalar>(TName_); - - refValue() = - emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/pi; - refGrad() = 0.0; - if (dict.found("value")) { fvPatchScalarField::operator= ( scalarField("value", dict, p.size()) ); + refValue() = scalarField("refValue", dict, p.size()); + refGrad() = scalarField("refGradient", dict, p.size()); + valueFraction() = scalarField("valueFraction", dict, p.size()); } else { + const scalarField& Tp = + patch().lookupPatchField<volScalarField, scalar>(TName_); + + refValue() = + emissivity_*4.0*physicoChemical::sigma.value()*pow4(Tp)/pi; + refGrad() = 0.0; + fvPatchScalarField::operator=(refValue()); } } @@ -218,10 +221,9 @@ void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::write Ostream& os ) const { - fvPatchScalarField::write(os); + mixedFvPatchScalarField::write(os); os.writeKeyword("T") << TName_ << token::END_STATEMENT << nl; os.writeKeyword("emissivity") << emissivity_ << token::END_STATEMENT << nl; - writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index c44ec7656c15571ac5e23b0d07cb5578c19c6a5e..494a1e3257342bcca3647b3256b636ed8468e236 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -391,13 +391,15 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() if (normalGradient()[i] < 0.0) { this->refValue()[i] = operator[](i); - this->refGrad()[i] = 0.0; // not used + this->refGrad()[i] = 0.0; // not used by me this->valueFraction()[i] = 1.0; nFixed++; } else { - this->refValue()[i] = 0.0; // not used + // Fixed gradient. Make sure to have valid refValue (even though + // I am not using it - other boundary conditions might) + this->refValue()[i] = operator[](i); this->refGrad()[i] = normalGradient()[i]; this->valueFraction()[i] = 0.0; } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict index dbca8b9f3a78fb6ec56fd4cfad50d9b6d3e558ad..b9a8773586c82ac5d800e20139fde5154662b03a 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict @@ -18,30 +18,13 @@ dictionaryReplacement { boundary { - ".*" + minX { type wall; } - bottomAir_to_leftSolid + maxX { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_bottomAir; - } - bottomAir_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_bottomAir; - } - bottomAir_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_bottomAir; + type wall; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict index aed0c335cf7fd171159ef5e42055ad03260e5c9c..774f8c210bcd33ff3a3748289c70b710df5b9cd0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -18,37 +18,17 @@ dictionaryReplacement { boundary { - ".*" + minY { type patch; } - heater_to_bottomAir + minZ { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_heater; - } - heater_to_leftSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_heater; - } - heater_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_heater; + type patch; } - heater_to_topAir + maxZ { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_heater; + type patch; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict index edb0132b0aa1a1ededcc6a782e6b7ea4228ed20c..ae08c060b320432037e4e51e2a5d3b2aa8ab268c 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -18,30 +18,13 @@ dictionaryReplacement { boundary { - ".*" + minZ { type patch; } - leftSolid_to_bottomAir + maxZ { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_leftSolid; - } - leftSolid_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_leftSolid;; - } - leftSolid_to_topAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_leftSolid;; + type patch; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict index acaa826db76c4bf983ff793b66be38750657e780..2dbe19caa0d5fa8f5f6fc2520b2fb4c340540007 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -18,30 +18,13 @@ dictionaryReplacement { boundary { - ".*" + minZ { type patch; } - rightSolid_to_heater + maxZ { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_rightSolid; - } - rightSolid_to_bottomAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_rightSolid; - } - rightSolid_to_topAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_rightSolid; + type patch; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict index f2c982a6929d71a4299aa5064421dae8d5feb6b7..6e9192301de24ef41cc000f14ef9ab40bc7a659f 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict @@ -16,43 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - ".*" - { - type wall; - } - minX - { - type patch; - } - maxX - { - type patch; - } - topAir_to_leftSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_topAir; - } - topAir_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_topAir; - } - topAir_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_topAir; - } - } - U { internalField uniform (0.01 0 0); diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict index b00a478194fa9fb3077bb2f637cef6a13b9822d6..60db2d7cffa8ef5379a0048f8c126ee9c1f050a3 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/bottomAir/changeDictionaryDict @@ -16,31 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - bottomAir_to_leftSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_bottomAir; - } - bottomAir_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_bottomAir; - } - bottomAir_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_bottomAir; - } - } - U { internalField uniform (0 0 0); diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict index ab50e9946cb7db34c92bcb59fe35d9ede97f7285..8e65b465fb3aacc9db508d048e3448c483be0ba0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict @@ -16,38 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - heater_to_bottomAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_heater; - } - heater_to_leftSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_heater; - } - heater_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_heater; - } - heater_to_topAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_heater; - } - } - T { internalField uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict index 6e31fefd3edde5988d4d2aec8821c9b267d19cd4..0ff29fa63a47d2af0ddc95852e0bcc10e95ea88f 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict @@ -16,31 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - leftSolid_to_bottomAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_leftSolid; - } - leftSolid_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_leftSolid;; - } - leftSolid_to_topAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_leftSolid;; - } - } - T { internalField uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict index 01590a2df909bc074c0e2d79e6fb742cb519bb8e..18df13896bb7b7d0382b903b7d268ef5851403e0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict @@ -16,31 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - rightSolid_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_rightSolid; - } - rightSolid_to_bottomAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion bottomAir; - samplePatch bottomAir_to_rightSolid; - } - rightSolid_to_topAir - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion topAir; - samplePatch topAir_to_rightSolid; - } - } - T { internalField uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict index 0fb37c441020c85e25d70d233c986beaf709c5f9..943461dcb55883c9b321452ac558f9aef30d23f7 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/topAir/changeDictionaryDict @@ -16,31 +16,6 @@ FoamFile dictionaryReplacement { - boundary - { - topAir_to_leftSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion leftSolid; - samplePatch leftSolid_to_topAir; - } - topAir_to_heater - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion heater; - samplePatch heater_to_topAir; - } - topAir_to_rightSolid - { - offset ( 0 0 0 ); - sampleMode nearestPatchFace; - sampleRegion rightSolid; - samplePatch rightSolid_to_topAir; - } - } - U { internalField uniform ( 0.01 0 0 );