diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 1194f97099..227c075fa2 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -49,6 +49,8 @@ { phi = phiHbyA - p_rghEqn.flux(); + p_rgh.relax(); + U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf); U.correctBoundaryConditions(); fvOptions.correct(U); diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index 60e1d7d0ee..3962e633bc 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -303,7 +303,9 @@ surfaces // Sampling on triSurface type sampledTriSurfaceMesh; surface integrationPlane.stl; - source boundaryFaces; // sample cells or boundaryFaces + source boundaryFaces; // What to sample: cells (nearest cell) + // insideCells (only triangles inside cell) + // boundaryFaces (nearest boundary face) interpolate true; } ); diff --git a/applications/utilities/preProcessing/mapFieldsNew/mapFieldsDict b/applications/utilities/preProcessing/mapFieldsNew/mapFieldsDict index 00a190cc77..65e33997d9 100644 --- a/applications/utilities/preProcessing/mapFieldsNew/mapFieldsDict +++ b/applications/utilities/preProcessing/mapFieldsNew/mapFieldsDict @@ -14,7 +14,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// List of pairs of source/target patches for mapping +// Specify how to map patches. There are three different options: +// - patch exists in the source case: specify mapping (patchMap) +// - patch should be interpolated from internal values in source case +// (cuttingPatches) +// - patch should not be mapped. Default if not in patchMap or cuttingPatches + +// List of pairs of target/source patches for mapping patchMap ( lid movingWall diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 6fca790005..4d2062b421 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -387,6 +387,7 @@ $(cellShape)/cellShapeIO.C $(cellShape)/cellShapeIOList.C meshes/Identifiers/patch/patchIdentifier.C +meshes/Identifiers/patch/coupleGroupIdentifier.C meshes/MeshObject/meshObject.C diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifier.C b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C similarity index 100% rename from src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifier.C rename to src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifier.H b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.H similarity index 100% rename from src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifier.H rename to src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.H diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifierI.H b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifierI.H similarity index 100% rename from src/meshTools/mappedPatches/mappedPolyPatch/coupleGroupIdentifierI.H rename to src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifierI.H diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 54a49523f7..9f451bd772 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -171,7 +171,7 @@ void Foam::cyclicPolyPatch::calcTransforms "cyclicPolyPatch::calcTransforms()" ) << "Patch " << name() << " has transform type " << transformTypeNames[transform()] - << ", neighbour patch " << neighbPatchName_ + << ", neighbour patch " << neighbPatchName() << " has transform type " << neighbPatch().transformTypeNames[neighbPatch().transform()] << exit(FatalError); @@ -350,7 +350,7 @@ void Foam::cyclicPolyPatch::calcTransforms << neighbPatch().separationVector_ << " by more than tolerance " << avgTol << endl << "patch:" << name() - << " neighbour:" << neighbPatchName_ + << " neighbour:" << neighbPatchName() << endl; } @@ -374,7 +374,7 @@ void Foam::cyclicPolyPatch::calcTransforms << "Continuing with specified separation vector " << separationVector_ << endl << "patch:" << name() - << " neighbour:" << neighbPatchName_ + << " neighbour:" << neighbPatchName() << endl; } @@ -658,6 +658,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch : coupledPolyPatch(name, dict, index, bm, patchType), neighbPatchName_(dict.lookupOrDefault("neighbourPatch", word::null)), + coupleGroup_(dict), neighbPatchID_(-1), rotationAxis_(vector::zero), rotationCentre_(point::zero), @@ -665,7 +666,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch coupledPointsPtr_(NULL), coupledEdgesPtr_(NULL) { - if (neighbPatchName_ == word::null) + if (neighbPatchName_ == word::null && !coupleGroup_.valid()) { FatalIOErrorIn ( @@ -733,7 +734,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch ) : coupledPolyPatch(pp, bm), - neighbPatchName_(pp.neighbPatchName()), + neighbPatchName_(pp.neighbPatchName_), + coupleGroup_(pp.coupleGroup_), neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -753,11 +755,12 @@ Foam::cyclicPolyPatch::cyclicPolyPatch const label index, const label newSize, const label newStart, - const word& neighbPatchName + const word& neighbName ) : coupledPolyPatch(pp, bm, index, newSize, newStart), - neighbPatchName_(neighbPatchName), + neighbPatchName_(neighbName), + coupleGroup_(pp.coupleGroup_), neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -765,10 +768,10 @@ Foam::cyclicPolyPatch::cyclicPolyPatch coupledPointsPtr_(NULL), coupledEdgesPtr_(NULL) { - if (neighbPatchName_ == name()) + if (neighbName == name()) { FatalErrorIn("cyclicPolyPatch::cyclicPolyPatch(..)") - << "Neighbour patch name " << neighbPatchName_ + << "Neighbour patch name " << neighbName << " cannot be the same as this patch " << name() << exit(FatalError); } @@ -789,6 +792,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch : coupledPolyPatch(pp, bm, index, mapAddressing, newStart), neighbPatchName_(pp.neighbPatchName_), + coupleGroup_(pp.coupleGroup_), neighbPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -809,16 +813,29 @@ Foam::cyclicPolyPatch::~cyclicPolyPatch() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::word& Foam::cyclicPolyPatch::neighbPatchName() const +{ + if (neighbPatchName_.empty()) + { + // Try and use patchGroup to find samplePatch and sampleRegion + label patchID = coupleGroup_.findOtherPatchID(*this); + + neighbPatchName_ = boundaryMesh()[patchID].name(); + } + return neighbPatchName_; +} + + Foam::label Foam::cyclicPolyPatch::neighbPatchID() const { if (neighbPatchID_ == -1) { - neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName_); + neighbPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName()); if (neighbPatchID_ == -1) { FatalErrorIn("cyclicPolyPatch::neighbPatchID() const") - << "Illegal neighbourPatch name " << neighbPatchName_ + << "Illegal neighbourPatch name " << neighbPatchName() << endl << "Valid patch names are " << this->boundaryMesh().names() << exit(FatalError); @@ -1256,7 +1273,7 @@ bool Foam::cyclicPolyPatch::order { Pout<< "order : of " << pp.size() << " faces of patch:" << name() - << " neighbour:" << neighbPatchName_ + << " neighbour:" << neighbPatchName() << endl; } faceMap.setSize(pp.size()); @@ -1444,8 +1461,12 @@ bool Foam::cyclicPolyPatch::order void Foam::cyclicPolyPatch::write(Ostream& os) const { coupledPolyPatch::write(os); - os.writeKeyword("neighbourPatch") << neighbPatchName_ - << token::END_STATEMENT << nl; + if (!neighbPatchName_.empty()) + { + os.writeKeyword("neighbourPatch") << neighbPatchName_ + << token::END_STATEMENT << nl; + } + coupleGroup_.write(os); switch (transform()) { case ROTATIONAL: diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H index 8f094da8cf..90474015ce 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.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 @@ -50,6 +50,7 @@ SourceFiles #include "edgeList.H" #include "polyBoundaryMesh.H" #include "diagTensorField.H" +#include "coupleGroupIdentifier.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -67,7 +68,10 @@ class cyclicPolyPatch // Private data //- Name of other half - const word neighbPatchName_; + mutable word neighbPatchName_; + + //- Optional patchGroup to find neighbPatch + const coupleGroupIdentifier coupleGroup_; //- Index of other half mutable label neighbPatchID_; @@ -306,12 +310,10 @@ public: // Member Functions - const word& neighbPatchName() const - { - return neighbPatchName_; - } + //- Neighbour patch name + const word& neighbPatchName() const; - //- Neighbour patchID. + //- Neighbour patchID virtual label neighbPatchID() const; virtual bool owner() const diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 4714ec09ed..666a6fca7c 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -46,7 +46,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("phi"), kName_("k") { this->refValue() = 0.0; @@ -66,7 +65,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -81,9 +79,10 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -100,7 +99,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -114,7 +112,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -147,7 +144,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_; this->valueFraction() = 1.0 - pos(phip); @@ -164,7 +161,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index d9b5e481c0..75032e2068 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -98,9 +98,6 @@ class turbulentMixingLengthDissipationRateInletFvPatchScalarField //- turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 0ce1cd6763..7db0599d11 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -46,7 +46,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("undefined-phi"), kName_("undefined-k") { this->refValue() = 0.0; @@ -65,7 +64,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -79,9 +77,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -97,7 +96,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -110,7 +108,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -143,7 +140,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); this->valueFraction() = 1.0 - pos(phip); @@ -160,7 +157,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index f16d5a4648..9276bc93ec 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -99,9 +99,6 @@ class turbulentMixingLengthFrequencyInletFvPatchScalarField //- Turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C index c44d237123..b463e79d80 100644 --- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C @@ -73,6 +73,8 @@ SRFFreestreamVelocityFvPatchVectorField relative_(dict.lookupOrDefault("relative", false)), UInf_(dict.lookup("UInf")) { + this->phiName_ = dict.lookupOrDefault("phi","phi"); + fvPatchVectorField::operator=(vectorField("value", dict, p.size())); } @@ -158,6 +160,7 @@ void Foam::SRFFreestreamVelocityFvPatchVectorField::write(Ostream& os) const fvPatchVectorField::write(os); os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C index 6472260192..00396a7090 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestream/freestreamFvPatchField.C @@ -66,6 +66,8 @@ freestreamFvPatchField::freestreamFvPatchField : inletOutletFvPatchField(p, iF) { + this->phiName_ = dict.lookupOrDefault("phi","phi"); + freestreamValue() = Field("freestreamValue", dict, p.size()); if (dict.found("value")) @@ -79,8 +81,6 @@ freestreamFvPatchField::freestreamFvPatchField { fvPatchField::operator=(freestreamValue()); } - - dict.readIfPresent("phi", this->phiName_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 8b0b842f38..a1c7e2ad2e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -40,7 +40,6 @@ inletOutletTotalTemperatureFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), UName_("U"), - phiName_("phi"), psiName_("psi"), gamma_(0.0), T0_(p.size(), 0.0) @@ -62,7 +61,6 @@ inletOutletTotalTemperatureFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), UName_(ptf.UName_), - phiName_(ptf.phiName_), psiName_(ptf.psiName_), gamma_(ptf.gamma_), T0_(ptf.T0_, mapper) @@ -79,11 +77,12 @@ inletOutletTotalTemperatureFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), UName_(dict.lookupOrDefault("U", "U")), - phiName_(dict.lookupOrDefault("phi", "phi")), psiName_(dict.lookupOrDefault("psi", "psi")), gamma_(readScalar(dict.lookup("gamma"))), T0_("T0", dict, p.size()) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + this->refValue() = pTraits::zero; if (dict.found("value")) { @@ -110,7 +109,6 @@ inletOutletTotalTemperatureFvPatchScalarField : inletOutletFvPatchScalarField(tppsf), UName_(tppsf.UName_), - phiName_(tppsf.phiName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), T0_(tppsf.T0_) @@ -126,7 +124,6 @@ inletOutletTotalTemperatureFvPatchScalarField : inletOutletFvPatchScalarField(tppsf, iF), UName_(tppsf.UName_), - phiName_(tppsf.phiName_), psiName_(tppsf.psiName_), gamma_(tppsf.gamma_), T0_(tppsf.T0_) @@ -171,7 +168,7 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs() patch().lookupPatchField(UName_); const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); const fvPatchField& psip = patch().lookupPatchField(psiName_); @@ -191,7 +188,7 @@ const { fvPatchScalarField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); - writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "phi", "phi", this->phiName_); writeEntryIfDifferent(os, "psi", "psi", psiName_); os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; T0_.writeEntry("T0", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H index 430ee1e51f..39b87eb1d7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.H @@ -90,9 +90,6 @@ class inletOutletTotalTemperatureFvPatchScalarField //- Name of the velocity field word UName_; - //- Name of the flux transporting the field - word phiName_; - //- Name of the compressibility field used to calculate the wave speed word psiName_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 7689d3d763..a506694147 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -40,8 +40,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), intensity_(0.0), - UName_("U"), - phiName_("phi") + UName_("U") { this->refValue() = 0.0; this->refGrad() = 0.0; @@ -59,8 +58,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), intensity_(ptf.intensity_), - UName_(ptf.UName_), - phiName_(ptf.phiName_) + UName_(ptf.UName_) {} Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField:: @@ -73,9 +71,10 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), intensity_(readScalar(dict.lookup("intensity"))), - UName_(dict.lookupOrDefault("U", "U")), - phiName_(dict.lookupOrDefault("phi", "phi")) + UName_(dict.lookupOrDefault("U", "U")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + if (intensity_ < 0 || intensity_ > 1) { FatalErrorIn @@ -111,8 +110,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), intensity_(ptf.intensity_), - UName_(ptf.UName_), - phiName_(ptf.phiName_) + UName_(ptf.UName_) {} @@ -125,8 +123,7 @@ turbulentIntensityKineticEnergyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), intensity_(ptf.intensity_), - UName_(ptf.UName_), - phiName_(ptf.phiName_) + UName_(ptf.UName_) {} @@ -144,7 +141,7 @@ updateCoeffs() patch().lookupPatchField(UName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = 1.5*sqr(intensity_)*magSqr(Up); this->valueFraction() = 1.0 - pos(phip); @@ -161,7 +158,7 @@ void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("intensity") << intensity_ << token::END_STATEMENT << nl; writeEntryIfDifferent(os, "U", "U", UName_); - writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "phi", "phi", this->phiName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H index 3534d888a3..b6aec0caad 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.H @@ -99,9 +99,6 @@ class turbulentIntensityKineticEnergyInletFvPatchScalarField //- Name of the velocity field word UName_; - //- Name of the flux field - word phiName_; - public: diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C index 14e1c7ddf4..e906689415 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.C @@ -125,7 +125,7 @@ void Foam::cyclicAMIPolyPatch::calcTransforms FatalErrorIn("cyclicAMIPolyPatch::calcTransforms()") << "Patch " << name() << " has transform type " << transformTypeNames[transform()] - << ", neighbour patch " << nbrPatchName_ + << ", neighbour patch " << neighbPatchName() << " has transform type " << neighbPatch().transformTypeNames[neighbPatch().transform()] << exit(FatalError); @@ -416,7 +416,8 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch ) : coupledPolyPatch(name, dict, index, bm, patchType), - nbrPatchName_(dict.lookup("neighbourPatch")), + nbrPatchName_(dict.lookupOrDefault("neighbourPatch", "")), + coupleGroup_(dict), nbrPatchID_(-1), rotationAxis_(vector::zero), rotationCentre_(point::zero), @@ -426,6 +427,22 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch surfPtr_(NULL), surfDict_(dict.subOrEmptyDict("surface")) { + if (nbrPatchName_ == word::null && !coupleGroup_.valid()) + { + FatalIOErrorIn + ( + "cyclicAMIPolyPatch::cyclicAMIPolyPatch" + "(" + "const word&, " + "const dictionary&, " + "const label, " + "const polyBoundaryMesh&" + ")", + dict + ) << "No \"neighbourPatch\" or \"coupleGroup\" provided." + << exit(FatalIOError); + } + if (nbrPatchName_ == name) { FatalIOErrorIn @@ -495,6 +512,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch : coupledPolyPatch(pp, bm), nbrPatchName_(pp.nbrPatchName_), + coupleGroup_(pp.coupleGroup_), nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -521,6 +539,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch : coupledPolyPatch(pp, bm, index, newSize, newStart), nbrPatchName_(nbrPatchName), + coupleGroup_(pp.coupleGroup_), nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -561,6 +580,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch : coupledPolyPatch(pp, bm, index, mapAddressing, newStart), nbrPatchName_(pp.nbrPatchName_), + coupleGroup_(pp.coupleGroup_), nbrPatchID_(-1), rotationAxis_(pp.rotationAxis_), rotationCentre_(pp.rotationCentre_), @@ -584,12 +604,12 @@ Foam::label Foam::cyclicAMIPolyPatch::neighbPatchID() const { if (nbrPatchID_ == -1) { - nbrPatchID_ = this->boundaryMesh().findPatchID(nbrPatchName_); + nbrPatchID_ = this->boundaryMesh().findPatchID(neighbPatchName()); if (nbrPatchID_ == -1) { FatalErrorIn("cyclicPolyAMIPatch::neighbPatchID() const") - << "Illegal neighbourPatch name " << nbrPatchName_ + << "Illegal neighbourPatch name " << neighbPatchName() << nl << "Valid patch names are " << this->boundaryMesh().names() << exit(FatalError); @@ -832,8 +852,12 @@ Foam::label Foam::cyclicAMIPolyPatch::pointFace void Foam::cyclicAMIPolyPatch::write(Ostream& os) const { coupledPolyPatch::write(os); - os.writeKeyword("neighbourPatch") << nbrPatchName_ - << token::END_STATEMENT << nl; + if (!nbrPatchName_.empty()) + { + os.writeKeyword("neighbourPatch") << nbrPatchName_ + << token::END_STATEMENT << nl; + } + coupleGroup_.write(os); switch (transform()) { diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H index 28b0e5e17c..9c0f5fc316 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatch.H @@ -38,6 +38,7 @@ SourceFiles #include "coupledPolyPatch.H" #include "AMIPatchToPatchInterpolation.H" #include "polyBoundaryMesh.H" +#include "coupleGroupIdentifier.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,7 +59,10 @@ private: // Private data //- Name of other half - const word nbrPatchName_; + mutable word nbrPatchName_; + + //- Optional patchGroup to find neighbPatch + const coupleGroupIdentifier coupleGroup_; //- Index of other half mutable label nbrPatchID_; diff --git a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H index 66a273e0c7..217d189ae3 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H +++ b/src/meshTools/AMIInterpolation/patches/cyclicAMI/cyclicAMIPolyPatch/cyclicAMIPolyPatchI.H @@ -27,6 +27,13 @@ License inline const Foam::word& Foam::cyclicAMIPolyPatch::neighbPatchName() const { + if (nbrPatchName_.empty()) + { + // Try and use patchGroup to find samplePatch and sampleRegion + label patchID = coupleGroup_.findOtherPatchID(*this); + + nbrPatchName_ = boundaryMesh()[patchID].name(); + } return nbrPatchName_; } diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 2adea5c4e1..6b52b27068 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -199,7 +199,6 @@ mappedPatches/mappedPolyPatch/mappedPatchBase.C mappedPatches/mappedPolyPatch/mappedPolyPatch.C mappedPatches/mappedPolyPatch/mappedWallPolyPatch.C mappedPatches/mappedPolyPatch/mappedVariableThicknessWallPolyPatch.C -mappedPatches/mappedPolyPatch/coupleGroupIdentifier.C mappedPatches/mappedPointPatch/mappedPointPatch.C mappedPatches/mappedPointPatch/mappedWallPointPatch.C diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C index 30edacf93c..93c05785bb 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C @@ -1402,10 +1402,16 @@ void Foam::mappedPatchBase::write(Ostream& os) const { os.writeKeyword("sampleMode") << sampleModeNames_[mode_] << token::END_STATEMENT << nl; - os.writeKeyword("sampleRegion") << sampleRegion() - << token::END_STATEMENT << nl; - os.writeKeyword("samplePatch") << samplePatch() - << token::END_STATEMENT << nl; + if (!sampleRegion_.empty()) + { + os.writeKeyword("sampleRegion") << sampleRegion_ + << token::END_STATEMENT << nl; + } + if (!samplePatch_.empty()) + { + os.writeKeyword("samplePatch") << samplePatch_ + << token::END_STATEMENT << nl; + } coupleGroup_.write(os); if diff --git a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C index d171b432a0..3d66eb6b8b 100644 --- a/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.C +++ b/src/meshTools/triSurface/booleanOps/booleanSurface/booleanSurface.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 @@ -326,7 +326,7 @@ void Foam::booleanSurface::propagateSide { side[faceI] = prevState; - const labelledTri& tri = surf[faceI]; + const labelledTri& tri = surf.localFaces()[faceI]; // Get copy of face labels label a = tri[0]; diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index 20b57d80b3..5ae942673a 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -46,13 +46,14 @@ namespace Foam ); template<> - const char* NamedEnum::names[] = + const char* NamedEnum::names[] = { "cells", + "insideCells", "boundaryFaces" }; - const NamedEnum + const NamedEnum sampledTriSurfaceMesh::samplingSourceNames_; @@ -147,7 +148,7 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) // elements globalIndex globalCells ( - sampleSource_ == cells + (sampleSource_ == cells || sampleSource_ == insideCells) ? mesh().nCells() : mesh().nFaces() ); @@ -178,6 +179,25 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) } } } + else if (sampleSource_ == insideCells) + { + // Search for cell containing point + + const indexedOctree& cellTree = meshSearcher.cellTree(); + + forAll(fc, triI) + { + if (cellTree.bb().contains(fc[triI])) + { + label index = cellTree.findInside(fc[triI]); + if (index != -1) + { + nearest[triI].first() = 0.0; + nearest[triI].second() = globalCells.toGlobal(index); + } + } + } + } else { // Search for nearest boundaryFace @@ -364,6 +384,19 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) } } } + else if (sampleSource_ == insideCells) + { + // samplePoints_ : per surface point a location inside the cell + // sampleElements_ : per surface point the cell + + forAll(points(), pointI) + { + const point& pt = points()[pointI]; + label cellI = cellOrFaceLabels[pointToFace[pointI]]; + sampleElements_[pointI] = cellI; + samplePoints_[pointI] = pt; + } + } else { // samplePoints_ : per surface point a location on the boundary @@ -388,6 +421,9 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) // if sampleSource_ == cells: // samplePoints_ : n/a // sampleElements_ : per surface triangle the cell + // if sampleSource_ == insideCells: + // samplePoints_ : n/a + // sampleElements_ : -1 or per surface triangle the cell // else: // samplePoints_ : n/a // sampleElements_ : per surface triangle the boundary face @@ -406,7 +442,7 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) if (sampledSurface::interpolate()) { - if (sampleSource_ == cells) + if (sampleSource_ == cells || sampleSource_ == insideCells) { forAll(samplePoints_, pointI) { @@ -443,7 +479,7 @@ bool Foam::sampledTriSurfaceMesh::update(const meshSearch& meshSearcher) } else { - if (sampleSource_ == cells) + if (sampleSource_ == cells || sampleSource_ == insideCells) { forAll(sampleElements_, triI) { diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H index 7ef68570c4..1e7cd4e6ed 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.H @@ -30,7 +30,7 @@ Description - it either samples cells or (non-coupled) boundary faces - - 4 different modes: + - 6 different modes: - source=cells, interpolate=false: finds per triangle centre the nearest cell centre and uses its value - source=cells, interpolate=true @@ -40,6 +40,12 @@ Description the boundary of the cell (to make sure interpolateCellPoint gets a valid location) + - source=insideCells, interpolate=false: + finds per triangle centre the cell containing it and uses its value. + Trims triangles outside mesh. + - source=insideCells, interpolate=true + Per surface point interpolate cell containing it. + - source=boundaryFaces, interpolate=false: finds per triangle centre the nearest point on the boundary (uncoupled faces only) and uses the value (or 0 if the nearest @@ -88,7 +94,8 @@ public: enum samplingSource { cells, - boundaryFaces + insideCells, + boundaryFaces, }; private: @@ -99,7 +106,7 @@ private: // Private data - static const NamedEnum samplingSourceNames_; + static const NamedEnum samplingSourceNames_; //- Surface to sample on const triSurfaceMesh surface_; diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C index ca6931ef87..d251431a55 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMeshTemplates.C @@ -38,7 +38,7 @@ Foam::sampledTriSurfaceMesh::sampleField tmp > tvalues(new Field(sampleElements_.size())); Field& values = tvalues(); - if (sampleSource_ == cells) + if (sampleSource_ == cells || sampleSource_ == insideCells) { // Sample cells @@ -94,7 +94,7 @@ Foam::sampledTriSurfaceMesh::interpolateField tmp > tvalues(new Field(sampleElements_.size())); Field& values = tvalues(); - if (sampleSource_ == cells) + if (sampleSource_ == cells || sampleSource_ == insideCells) { // Sample cells. diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index e7003426be..0d6694fa3b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -48,7 +48,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("phi"), kName_("k") { this->refValue() = 0.0; @@ -68,7 +67,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -83,9 +81,9 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -102,7 +100,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -116,7 +113,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -143,7 +139,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_; this->valueFraction() = 1.0 - pos(phip); @@ -160,7 +156,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 2031e2a808..63aa24b8eb 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -101,9 +101,6 @@ class turbulentMixingLengthDissipationRateInletFvPatchScalarField //- turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index de7c947a9f..70017d5250 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -48,7 +48,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("phi"), kName_("k") { this->refValue() = 0.0; @@ -68,7 +67,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -83,9 +81,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -102,7 +101,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -116,7 +114,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -143,7 +140,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); this->valueFraction() = 1.0 - pos(phip); @@ -160,7 +157,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index 9aaeb71db0..cafd2d9d10 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -100,9 +100,6 @@ class turbulentMixingLengthFrequencyInletFvPatchScalarField //- Turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index b429c62447..8cd35c5166 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -74,11 +74,11 @@ thermalBaffle1DFvPatchScalarField mixedFvPatchScalarField(ptf, p, iF, mapper), TName_(ptf.TName_), baffleActivated_(ptf.baffleActivated_), - thickness_(ptf.thickness_), - Qs_(ptf.Qs_), + thickness_(ptf.thickness_, mapper), + Qs_(ptf.Qs_, mapper), solidDict_(ptf.solidDict_), solidPtr_(ptf.solidPtr_), - QrPrevious_(ptf.QrPrevious_), + QrPrevious_(ptf.QrPrevious_, mapper), QrRelaxation_(ptf.QrRelaxation_), QrName_(ptf.QrName_) {} @@ -98,7 +98,7 @@ thermalBaffle1DFvPatchScalarField TName_("T"), baffleActivated_(dict.lookupOrDefault("baffleActivated", true)), thickness_(), - Qs_(), + Qs_(p.size(), 0), solidDict_(dict), solidPtr_(), QrPrevious_(p.size(), 0.0), @@ -107,6 +107,21 @@ thermalBaffle1DFvPatchScalarField { fvPatchScalarField::operator=(scalarField("value", dict, p.size())); + if (dict.found("thickness")) + { + thickness_ = scalarField("thickness", dict, p.size()); + } + + if (dict.found("Qs")) + { + Qs_ = scalarField("Qs", dict, p.size()); + } + + if (dict.found("QrPrevious")) + { + QrPrevious_ = scalarField("QrPrevious", dict, p.size()); + } + if (dict.found("refValue") && baffleActivated_) { // Full restart @@ -209,23 +224,30 @@ const solidType& thermalBaffle1DFvPatchScalarField::solid() const template -const scalarField& thermalBaffle1DFvPatchScalarField:: +tmp thermalBaffle1DFvPatchScalarField:: baffleThickness() const { if (this->owner()) { - if (thickness_.size() > 0) + if (thickness_.size() != patch().size()) { - return thickness_; - } - else - { - thickness_ = scalarField("thickness", solidDict_, patch().size()); - return thickness_; + FatalErrorIn + ( + " template" + " tmp thermalBaffle1DFvPatchScalarField + " baffleThickness() const" + )<< " Field thickness has not been specified " + << " for patch " << this->patch().name() + << " in dictionary " << solidDict_ + << abort(FatalError); } + + return thickness_; } else { + const mapDistribute& mapDist = this->mappedPatchBase::map(); + const fvPatch& nbrPatch = patch().boundaryMesh()[samplePolyPatch().index()]; const thermalBaffle1DFvPatchScalarField& nbrField = @@ -234,28 +256,28 @@ baffleThickness() const nbrPatch.template lookupPatchField(TName_) ); - return nbrField.thickness_; + tmp tthickness + ( + new scalarField(nbrField.baffleThickness()) + ); + scalarField& thickness = tthickness(); + mapDist.distribute(thickness); + return tthickness; } } template -const scalarField& thermalBaffle1DFvPatchScalarField::Qs() const +tmp thermalBaffle1DFvPatchScalarField::Qs() const { if (this->owner()) { - if (Qs_.size() > 0) - { - return Qs_; - } - else - { - Qs_ = scalarField("Qs", solidDict_, patch().size()); - return Qs_; - } + return Qs_; } else { + const mapDistribute& mapDist = this->mappedPatchBase::map(); + const fvPatch& nbrPatch = patch().boundaryMesh()[samplePolyPatch().index()]; @@ -265,7 +287,10 @@ const scalarField& thermalBaffle1DFvPatchScalarField::Qs() const nbrPatch.template lookupPatchField(TName_) ); - return nbrField.Qs_; + tmp tQs(new scalarField(nbrField.Qs())); + scalarField& Qs = tQs(); + mapDist.distribute(Qs); + return tQs; } } @@ -293,8 +318,11 @@ void thermalBaffle1DFvPatchScalarField::rmap const thermalBaffle1DFvPatchScalarField& tiptf = refCast(ptf); - thickness_.rmap(tiptf.thickness_, addr); - Qs_.rmap(tiptf.Qs_, addr); + if (this->owner()) + { + thickness_.rmap(tiptf.thickness_, addr); + Qs_.rmap(tiptf.Qs_, addr); + } } @@ -310,6 +338,8 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag+1; + const mapDistribute& mapDist = this->mappedPatchBase::map(); + const label patchi = patch().index(); const label nbrPatchi = samplePolyPatch().index(); @@ -347,8 +377,9 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() scalarField myKDelta(patch().deltaCoeffs()*kappaw); // nrb properties - const fvPatchScalarField& nbrTp = + scalarField nbrTp = turbModel.thermo().T().boundaryField()[nbrPatchi]; + mapDist.distribute(nbrTp); // solid properties scalarField kappas(patch().size(), 0.0); @@ -396,11 +427,12 @@ void thermalBaffle1DFvPatchScalarField::write(Ostream& os) const if (this->owner()) { - baffleThickness().writeEntry("thickness", os); - Qs().writeEntry("Qs", os); + baffleThickness()().writeEntry("thickness", os); + Qs()().writeEntry("Qs", os); solid().write(os); } + QrPrevious_.writeEntry("QrPrevious", os); os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; os.writeKeyword("QrRelaxation")<< QrRelaxation_ << token::END_STATEMENT << nl; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H index d2ab8bc2d5..7a9f0f1d7e 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H @@ -152,10 +152,10 @@ class thermalBaffle1DFvPatchScalarField const solidType& solid() const; //- Return Qs from master - const scalarField& Qs() const; + tmp Qs() const; //- Return thickness from master - const scalarField& baffleThickness() const; + tmp baffleThickness() const; //- Is Owner bool owner() const; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index a756341744..e0d6c9a8e9 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -48,7 +48,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("phi"), kName_("k") { this->refValue() = 0.0; @@ -68,7 +67,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -83,9 +81,9 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -102,7 +100,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -116,7 +113,6 @@ turbulentMixingLengthDissipationRateInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -143,7 +139,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = Cmu75*kp*sqrt(kp)/mixingLength_; this->valueFraction() = 1.0 - pos(phip); @@ -160,7 +156,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H index 7a74a83849..13496315d7 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.H @@ -101,9 +101,6 @@ class turbulentMixingLengthDissipationRateInletFvPatchScalarField //- turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index bf9f904f7a..95bdac20f4 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -48,7 +48,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(0.0), - phiName_("undefined-phi"), kName_("undefined-k") { this->refValue() = 0.0; @@ -67,7 +66,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, p, iF, mapper), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -81,9 +79,10 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(p, iF), mixingLength_(readScalar(dict.lookup("mixingLength"))), - phiName_(dict.lookupOrDefault("phi", "phi")), kName_(dict.lookupOrDefault("k", "k")) { + this->phiName_ = dict.lookupOrDefault("phi", "phi"); + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); this->refValue() = 0.0; @@ -99,7 +98,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -112,7 +110,6 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField : inletOutletFvPatchScalarField(ptf, iF), mixingLength_(ptf.mixingLength_), - phiName_(ptf.phiName_), kName_(ptf.kName_) {} @@ -139,7 +136,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() patch().lookupPatchField(kName_); const fvsPatchScalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(this->phiName_); this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); this->valueFraction() = 1.0 - pos(phip); @@ -156,7 +153,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write fvPatchScalarField::write(os); os.writeKeyword("mixingLength") << mixingLength_ << token::END_STATEMENT << nl; - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; + os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H index e39e13845f..9fdff8d950 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -101,9 +101,6 @@ class turbulentMixingLengthFrequencyInletFvPatchScalarField //- Turbulent length scale scalar mixingLength_; - //- Name of the flux field - word phiName_; - //- Name of the turbulent kinetic energy field word kName_; diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allclean b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allclean new file mode 100755 index 0000000000..3c02c94655 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0 + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun index 932dded90b..628bd511a9 100755 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun @@ -11,6 +11,8 @@ runApplication blockMesh # Create faceZones for baffles and fan runApplication topoSet +cp -r 0.org 0 + # Create wall and cyclic baffles and the fields on them runApplication createBaffles -overwrite diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict index f70ad3e89b..19ea37dfdb 100644 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/system/createBafflesDict @@ -29,60 +29,46 @@ baffles type faceZone; zoneName baffleFaces; - - //- Optional flip - //flip false; - - patches + patchPairs { - master - { - //- Master side patch - name baffles; - type wall; + type wall; - patchFields - { - epsilon - { - type epsilonWallFunction; - Cmu 0.09; - kappa 0.41; - E 9.8; - value uniform 0; - } - k - { - type kqRWallFunction; - value uniform 0; - } - nut - { - type nutkWallFunction; - Cmu 0.09; - kappa 0.41; - E 9.8; - value uniform 0; - } - nuTilda - { - type zeroGradient; - } - p - { - type zeroGradient; - } - U - { - type fixedValue; - value uniform (0 0 0); - } - } - } - slave + patchFields { - // Reuse master data - ${..master} + epsilon + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + k + { + type kqRWallFunction; + value uniform 0; + } + nut + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + nuTilda + { + type zeroGradient; + } + p + { + type zeroGradient; + } + U + { + type fixedValue; + value uniform (0 0 0); + } } } } @@ -97,46 +83,21 @@ baffles origin (0.099 -0.006 0.004); span (0 0.012 0.012); - patches + patchPairs { - master + type cyclic; + + //- Optional override of added patchfields. If not specified + // any added patchfields are of type calculated. + patchFields { - //- Master side patch - - name fan_half0; - type cyclic; - neighbourPatch fan_half1; - - //- Optional override of added patchfields. If not specified - // any added patchfields are of type calculated. - patchFields + p { - p - { - type fan; - patchType cyclic; - jump uniform 0; - value uniform 0; - jumpTable polynomial 1((100 0)); - } - } - } - slave - { - //- Slave side patch - - name fan_half1; - type cyclic; - neighbourPatch fan_half0; - - patchFields - { - p - { - type fan; - patchType cyclic; - value uniform 0; - } + type fan; + patchType cyclic; + jump uniform 0; + value uniform 0; + jumpTable polynomial 1((100 0)); } } }