From 95af8817dfac348c7e59fd3b1cce21474cc1b320 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 13 Sep 2011 17:59:29 +0100 Subject: [PATCH 01/48] ENH: starcd mesh reader: convert cyclics --- src/conversion/meshReader/starcd/STARCDMeshReader.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conversion/meshReader/starcd/STARCDMeshReader.C b/src/conversion/meshReader/starcd/STARCDMeshReader.C index 6162da0f9b..a7aca36d7f 100644 --- a/src/conversion/meshReader/starcd/STARCDMeshReader.C +++ b/src/conversion/meshReader/starcd/STARCDMeshReader.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "STARCDMeshReader.H" -#include "cyclicPolyPatch.H" +#include "oldCyclicPolyPatch.H" #include "emptyPolyPatch.H" #include "wallPolyPatch.H" #include "symmetryPolyPatch.H" @@ -950,7 +950,7 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName) { // incorrect. should be cyclicPatch but this // requires info on connected faces. - patchTypes_[patchI] = cyclicPolyPatch::typeName; + patchTypes_[patchI] = oldCyclicPolyPatch::typeName; patchPhysicalTypes_[patchI] = patchTypes_[patchI]; } else if (origType == "baffle") From e8a288fc003a7f632adf034d27f8347ffc984c76 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Sep 2011 10:38:28 +0100 Subject: [PATCH 02/48] ENH: Improved AMI message output --- .../AMIInterpolation/AMIInterpolation.C | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index e5abcf818f..aa638ebd38 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -97,9 +97,10 @@ void Foam::AMIInterpolation::checkPatches boundBox bbSrc(srcPatch.points(), srcPatch.meshPoints()); boundBox bbTgt(tgtPatch.points(), tgtPatch.meshPoints()); - bbTgt.inflate(maxBoundsError); + boundBox bbTgtInf(bbTgt); + bbTgtInf.inflate(maxBoundsError); - if (!bbTgt.contains(bbSrc)) + if (!bbTgtInf.contains(bbSrc)) { WarningIn ( @@ -109,10 +110,11 @@ void Foam::AMIInterpolation::checkPatches "const primitivePatch&" ")" ) << "Source and target patch bounding boxes are not similar" << nl - << " src span : " << bbSrc.span() << nl - << " tgt span : " << bbTgt.span() << nl - << " source: " << bbSrc << nl - << " target: " << bbTgt << endl; + << " source box span : " << bbSrc.span() << nl + << " target box span : " << bbTgt.span() << nl + << " source box : " << bbSrc << nl + << " target box : " << bbTgt << nl + << " inflated target box : " << bbTgtInf << endl; } } From 71c5c0fdb8b4abdfb845bc4ea89cc0ce51de76b6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Sep 2011 10:39:21 +0100 Subject: [PATCH 03/48] ENH: Added time bounds to function objects --- .../OutputFilterFunctionObject.C | 20 ++++++++++-- .../OutputFilterFunctionObject.H | 31 +++++++++++++------ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index effd031a19..86a2867777 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -37,6 +37,18 @@ void Foam::OutputFilterFunctionObject::readDict() dict_.readIfPresent("dictionary", dictName_); dict_.readIfPresent("enabled", enabled_); dict_.readIfPresent("storeFilter", storeFilter_); + dict_.readIfPresent("timeStart", timeStart_); + dict_.readIfPresent("timeEnd", timeEnd_); +} + + +template +bool Foam::OutputFilterFunctionObject::active() const +{ + return + enabled_ + && time_.value() >= timeStart_ + && time_.value() <= timeEnd_; } @@ -94,6 +106,8 @@ Foam::OutputFilterFunctionObject::OutputFilterFunctionObject dictName_(), enabled_(true), storeFilter_(true), + timeStart_(-VGREAT), + timeEnd_(VGREAT), outputControl_(t, dict) { readDict(); @@ -121,7 +135,7 @@ bool Foam::OutputFilterFunctionObject::start() { readDict(); - if (enabled_&&storeFilter_) + if (enabled_ && storeFilter_) { allocateFilter(); } @@ -136,7 +150,7 @@ bool Foam::OutputFilterFunctionObject::execute const bool forceWrite ) { - if (enabled_) + if (active()) { if (!storeFilter_) { @@ -163,7 +177,7 @@ bool Foam::OutputFilterFunctionObject::execute template bool Foam::OutputFilterFunctionObject::end() { - if (enabled_) + if (active()) { if (!storeFilter_) { diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 35347f86d4..0b264cb806 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -68,18 +68,28 @@ class OutputFilterFunctionObject //- Input dictionary dictionary dict_; - //- Name of region - word regionName_; - //- Optional dictionary name to supply required inputs - word dictName_; + // Optional user inputs - //- Switch for the execution of the functionObject - bool enabled_; + //- Name of region - defaults to name of polyMesh::defaultRegion + word regionName_; + + //- Dictionary name to supply required inputs + word dictName_; + + //- Switch for the execution - defaults to 'yes/on' + bool enabled_; + + //- Switch to store filter in between writes or use on-the-fly + // construction - defaults to true + bool storeFilter_; + + //- Activation time - defaults to -VGREAT + scalar timeStart_; + + //- De-activation time - defaults to VGREAT + scalar timeEnd_; - //- Switch to store filter in between writes or use on-the-fly - // construction - bool storeFilter_; //- Output controls outputFilterOutputControl outputControl_; @@ -99,6 +109,9 @@ class OutputFilterFunctionObject //- Destroys most of the data associated with this object. void destroyFilter(); + //- Returns true if active (enabled and within time bounds) + bool active() const; + //- Disallow default bitwise copy construct OutputFilterFunctionObject(const OutputFilterFunctionObject&); From 5deeeda0076ab9be302714cb2805859a2e7dce29 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Sep 2011 11:32:58 +0100 Subject: [PATCH 04/48] STYLE: Corrected comment spelling --- .../temperatureThermoBaffle1DFvPatchScalarField.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H index e3c785fb4d..8ee1b01b9c 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarField.H @@ -25,7 +25,7 @@ Class Foam::temperatureThermoBaffle1DFvPatchScalarField Description - Bounday which solves the 1D steady state heat transfer equation + Boundary which solves the 1D steady state heat transfer equation through a baffle. SourceFiles From 4c70e9837e188fe5d66c70ce27870bcf2e7446d7 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Sep 2011 14:18:44 +0100 Subject: [PATCH 05/48] ENH: Updated mapped boundary types --- .../mappedField/mappedFieldFvPatchField.C | 38 ++----------------- .../mappedFixedInternalValueFvPatchField.C | 26 +------------ .../mappedFixedValueFvPatchField.C | 28 +------------- .../mappedFlowRateFvPatchVectorField.C | 3 +- ...mappedVelocityFluxFixedValueFvPatchField.C | 27 ++++++------- ...elfContainedMappedFixedValueFvPatchField.C | 15 ++++---- 6 files changed, 27 insertions(+), 110 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C index e02fa12ef2..19aeaa4a5a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedFieldFvPatchField.C @@ -204,14 +204,13 @@ void mappedFieldFvPatchField::updateCoeffs() { case NEARESTCELL: { - const mapDistribute& distMap = mappedPatchBase::map(); newValues = sampleField(); - distMap.distribute(newValues); + this->distribute(newValues); break; } - case NEARESTPATCHFACE: + case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI: { const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID(samplePatch()); @@ -230,34 +229,7 @@ void mappedFieldFvPatchField::updateCoeffs() const mapDistribute& distMap = mappedPatchBase::map(); newValues = nbrField.boundaryField()[nbrPatchID]; - distMap.distribute(newValues); - - break; - } - case mappedPatchBase::NEARESTPATCHFACEAMI: - { - const label nbrPatchID = - nbrMesh.boundaryMesh().findPatchID(samplePatch()); - - if (nbrPatchID < 0) - { - FatalErrorIn - ( - "void mappedFixedValueFvPatchField::updateCoeffs()" - )<< "Unable to find sample patch " << samplePatch() - << " in region " << sampleRegion() - << " for patch " << this->patch().name() << nl - << abort(FatalError); - } - -// const fieldType& nbrField = sampleField(); -// newValues = mpp.AMI().interpolateToSource(nbrField); - - notImplemented - ( - "void mappedFieldFvPatchField::updateCoeffs() " - "with mappedPatchBase::NEARESTPATCHFACEAMI" - ); + this->distribute(newValues); break; } @@ -279,9 +251,7 @@ void mappedFieldFvPatchField::updateCoeffs() } } - const mapDistribute& distMap = mappedPatchBase::map(); - distMap.distribute(allValues); - + this->distribute(allValues); newValues.transfer(allValues); break; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.C index 8920d39502..326adefd74 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedInternalValue/mappedFixedInternalValueFvPatchField.C @@ -127,31 +127,7 @@ void Foam::mappedFixedInternalValueFvPatchField::updateCoeffs() // Retrieve the neighbour patch internal field Field nbrIntFld(nbrField.patchInternalField()); - - switch (mpp.mode()) - { - case (mappedPatchBase::NEARESTPATCHFACEAMI): - { - // Retrieve the neighbour patch internal field - nbrIntFld = mpp.AMI().interpolateToSource(nbrIntFld); - break; - } - default: - { - const mapDistribute& distMap = mpp.map(); - - mapDistribute::distribute - ( - Pstream::defaultCommsType, - distMap.schedule(), - distMap.constructSize(), - distMap.subMap(), // what to send - distMap.constructMap(), // what to receive - nbrIntFld - ); - break; - } - } + mpp.distribute(nbrIntFld); // Restore tag UPstream::msgType() = oldTag; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C index ffe8960fa7..930a931206 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFixedValue/mappedFixedValueFvPatchField.C @@ -283,30 +283,6 @@ void mappedFixedValueFvPatchField::updateCoeffs() break; } case mappedPatchBase::NEARESTPATCHFACE: - { - const mapDistribute& distMap = mpp.map(); - - const label nbrPatchID = - nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch()); - - if (nbrPatchID < 0) - { - FatalErrorIn - ( - "void mappedFixedValueFvPatchField::updateCoeffs()" - )<< "Unable to find sample patch " << mpp.samplePatch() - << " in region " << mpp.sampleRegion() - << " for patch " << this->patch().name() << nl - << abort(FatalError); - } - - const fieldType& nbrField = sampleField(); - - newValues = nbrField.boundaryField()[nbrPatchID]; - distMap.distribute(newValues); - - break; - } case mappedPatchBase::NEARESTPATCHFACEAMI: { const label nbrPatchID = @@ -324,9 +300,9 @@ void mappedFixedValueFvPatchField::updateCoeffs() } const fieldType& nbrField = sampleField(); - newValues = nbrField.boundaryField()[nbrPatchID]; - newValues = mpp.AMI().interpolateToSource(newValues); + newValues = nbrField.boundaryField()[nbrPatchID]; + mpp.distribute(newValues); break; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C index 9584f2b96c..63aadec6a1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C @@ -28,7 +28,6 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "mappedPatchBase.H" -#include "mapDistribute.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -128,7 +127,7 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs() scalarList phi = nbrPatch.lookupPatchField(nbrPhiName_); - mpp.map().distribute(phi); + mpp.distribute(phi); const surfaceScalarField& phiName = diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C index 29f6afa027..00be69fc85 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C @@ -176,13 +176,10 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs() ( mappedVelocityFluxFixedValueFvPatchField::patch().patch() ); - const mapDistribute& distMap = mpp.map(); const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); const word& fieldName = dimensionedInternalField().name(); - const volVectorField& UField = nbrMesh.lookupObject - ( - fieldName - ); + const volVectorField& UField = + nbrMesh.lookupObject(fieldName); surfaceScalarField& phiField = const_cast ( @@ -213,26 +210,25 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs() } } - distMap.distribute(allUValues); + mpp.distribute(allUValues); newUValues.transfer(allUValues); - distMap.distribute(allPhiValues); + mpp.distribute(allPhiValues); newPhiValues.transfer(allPhiValues); break; } case mappedPolyPatch::NEARESTPATCHFACE: + case mappedPolyPatch::NEARESTPATCHFACEAMI: { - const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID - ( - mpp.samplePatch() - ); + const label nbrPatchID = + nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch()); newUValues = UField.boundaryField()[nbrPatchID]; - distMap.distribute(newUValues); + mpp.distribute(newUValues); newPhiValues = phiField.boundaryField()[nbrPatchID]; - distMap.distribute(newPhiValues); + mpp.distribute(newPhiValues); break; } @@ -242,8 +238,9 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs() ( "mappedVelocityFluxFixedValueFvPatchField::" "updateCoeffs()" - ) << "patch can only be used in NEARESTPATCHFACE or NEARESTFACE " - << "mode" << nl << abort(FatalError); + ) << "patch can only be used in NEARESTPATCHFACE, " + << "NEARESTPATCHFACEAMI or NEARESTFACE mode" << nl + << abort(FatalError); } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C index 1a3334c927..e13eacc4bf 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/selfContainedMapped/selfContainedMappedFixedValueFvPatchField.C @@ -229,7 +229,6 @@ void selfContainedMappedFixedValueFvPatchField::updateCoeffs() const fvMesh& thisMesh = this->patch().boundaryMesh().mesh(); const fvMesh& nbrMesh = refCast(sampleMesh()); - const mapDistribute& distMap = mappedPatchBase::map(); // Result of obtaining remote values Field newValues; @@ -238,6 +237,8 @@ void selfContainedMappedFixedValueFvPatchField::updateCoeffs() { case NEARESTCELL: { + const mapDistribute& distMap = mappedPatchBase::map(); + if (interpolationScheme_ != interpolationCell::typeName) { // Need to do interpolation so need cells to sample. @@ -275,12 +276,10 @@ void selfContainedMappedFixedValueFvPatchField::updateCoeffs() break; } - case NEARESTPATCHFACE: + case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI: { - const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID - ( - samplePatch() - ); + const label nbrPatchID = + nbrMesh.boundaryMesh().findPatchID(samplePatch()); if (nbrPatchID < 0) { FatalErrorIn @@ -297,7 +296,7 @@ void selfContainedMappedFixedValueFvPatchField::updateCoeffs() const fieldType& nbrField = sampleField(); newValues = nbrField.boundaryField()[nbrPatchID]; - distMap.distribute(newValues); + this->distribute(newValues); break; } @@ -319,7 +318,7 @@ void selfContainedMappedFixedValueFvPatchField::updateCoeffs() } } - distMap.distribute(allValues); + this->distribute(allValues); newValues.transfer(allValues); From 484cd6c221eecceb0feb9ec5f5a194517250ba24 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Sep 2011 15:46:21 +0100 Subject: [PATCH 06/48] ENH: Added -dict option to extrudeToRegionMesh --- .../extrude/extrudeToRegionMesh/extrudeToRegionMesh.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 3549dc9560..f6214c8e62 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -924,6 +924,7 @@ int main(int argc, char *argv[]) #include "addRegionOption.H" #include "addOverwriteOption.H" + argList::addOption("dict", "name", "specify alternative dictionary"); argList::addBoolOption("AMI", "apply mapped AMI boundary type"); #include "setRootCase.H" @@ -932,6 +933,8 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); bool overwrite = args.optionFound("overwrite"); + const word dictName + (args.optionLookupOrDefault("dict", "extrudeToRegionMeshDict")); mappedPatchBase::sampleMode sampleMode = mappedPatchBase::NEARESTPATCHFACE; if (args.optionFound("AMI")) @@ -943,7 +946,7 @@ int main(int argc, char *argv[]) ( IOobject ( - "extrudeToRegionMeshDict", + dictName, runTime.system(), runTime, IOobject::MUST_READ_IF_MODIFIED From 36ee6e82627f76fdf5f4c0d0278431878ab2f495 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Sep 2011 12:49:03 +0100 Subject: [PATCH 07/48] BUG: Added missing exit() on fatal error --- .../general/solutionControl/solutionControl/solutionControl.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C index e1ea4007d5..1e4eadce04 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C @@ -76,7 +76,8 @@ void Foam::solutionControl::read(const bool absTolOnly) { FatalErrorIn("bool Foam::solutionControl::read()") << "Residual data for " << iter().keyword() - << " must be specified as a dictionary"; + << " must be specified as a dictionary" + << exit(FatalError); } } From b1045257208b98acb47b38ad5b141cedcff8b697 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Sep 2011 16:04:25 +0100 Subject: [PATCH 08/48] ENH: execFlowFunctionObjects: added -region option. Added -noFlow option. --- .../postProcessing/foamCalc/foamCalcApp.C | 3 +- .../execFlowFunctionObjects.C | 418 ++++++++++-------- src/postProcessing/postCalc/postCalc.C | 8 +- 3 files changed, 253 insertions(+), 176 deletions(-) diff --git a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C index e9fb697570..39d0a581d5 100644 --- a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C +++ b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C @@ -43,6 +43,7 @@ Description int main(int argc, char *argv[]) { Foam::timeSelector::addOptions(); +# include "addRegionOption.H" Foam::argList::addBoolOption ( "noWrite", @@ -74,7 +75,7 @@ int main(int argc, char *argv[]) # include "setRootCase.H" # include "createTime.H" Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args); -# include "createMesh.H" +# include "createNamedMesh.H" utility().tryPreCalc(args, runTime, mesh); diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C index fe84a1daa0..f0487ac2a2 100644 --- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C +++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C @@ -37,6 +37,11 @@ Description #include "calc.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "pointFields.H" +#include "ReadFields.H" + #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "incompressible/RAS/RASModel/RASModel.H" @@ -84,203 +89,268 @@ namespace Foam void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { - Info<< " Reading phi" << endl; - surfaceScalarField phi - ( - IOobject - ( - "phi", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ), - mesh - ); - - Info<< " Reading U" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ), - mesh - ); - - Info<< " Reading p" << endl; - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ), - mesh - ); - - if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0)) + if (args.optionFound("noFlow")) { - IOobject RASPropertiesHeader - ( - "RASProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ); + Info<< " Operating in no-flow mode; no models will be loaded." + << " All vol, surface and point fields will be loaded." << endl; - IOobject LESPropertiesHeader - ( - "LESProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ); + // Read objects in time directory + IOobjectList objects(mesh, runTime.timeName()); - if (RASPropertiesHeader.headerOk()) - { - IOdictionary RASProperties(RASPropertiesHeader); + // Read vol fields. - singlePhaseTransportModel laminarTransport(U, phi); + PtrList vsFlds; + ReadFields(mesh, objects, vsFlds); - autoPtr RASModel - ( - incompressible::RASModel::New - ( - U, - phi, - laminarTransport - ) - ); - execFlowFunctionObjects(args, runTime); - } - else if (LESPropertiesHeader.headerOk()) - { - IOdictionary LESProperties(LESPropertiesHeader); + PtrList vvFlds; + ReadFields(mesh, objects, vvFlds); - singlePhaseTransportModel laminarTransport(U, phi); + PtrList vstFlds; + ReadFields(mesh, objects, vstFlds); - autoPtr sgsModel - ( - incompressible::LESModel::New(U, phi, laminarTransport) - ); + PtrList vsymtFlds; + ReadFields(mesh, objects, vsymtFlds); - execFlowFunctionObjects(args, runTime); - } - else - { - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); + PtrList vtFlds; + ReadFields(mesh, objects, vtFlds); - dimensionedScalar nu(transportProperties.lookup("nu")); + // Read surface fields. - execFlowFunctionObjects(args, runTime); - } - } - else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0)) - { - autoPtr thermo(basicPsiThermo::New(mesh)); + PtrList ssFlds; + ReadFields(mesh, objects, ssFlds); - volScalarField rho - ( - IOobject - ( - "rho", - runTime.timeName(), - mesh - ), - thermo->rho() - ); + PtrList svFlds; + ReadFields(mesh, objects, svFlds); - IOobject RASPropertiesHeader - ( - "RASProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ); + PtrList sstFlds; + ReadFields(mesh, objects, sstFlds); - IOobject LESPropertiesHeader - ( - "LESProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ); + PtrList ssymtFlds; + ReadFields(mesh, objects, ssymtFlds); - if (RASPropertiesHeader.headerOk()) - { - IOdictionary RASProperties(RASPropertiesHeader); + PtrList stFlds; + ReadFields(mesh, objects, stFlds); - autoPtr RASModel - ( - compressible::RASModel::New - ( - rho, - U, - phi, - thermo() - ) - ); + // Read point fields. + const pointMesh& pMesh = pointMesh::New(mesh); - execFlowFunctionObjects(args, runTime); - } - else if (LESPropertiesHeader.headerOk()) - { - IOdictionary LESProperties(LESPropertiesHeader); + PtrList psFlds; + ReadFields(pMesh, objects, psFlds); - autoPtr sgsModel - ( - compressible::LESModel::New(rho, U, phi, thermo()) - ); + PtrList pvFlds; + ReadFields(pMesh, objects, pvFlds); - execFlowFunctionObjects(args, runTime); - } - else - { - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); + PtrList pstFlds; + ReadFields(pMesh, objects, pstFlds); - dimensionedScalar mu(transportProperties.lookup("mu")); + PtrList psymtFlds; + ReadFields(pMesh, objects, psymtFlds); - execFlowFunctionObjects(args, runTime); - } + PtrList ptFlds; + ReadFields(pMesh, objects, ptFlds); + + execFlowFunctionObjects(args, runTime); } else { - FatalErrorIn(args.executable()) - << "Incorrect dimensions of phi: " << phi.dimensions() - << nl << exit(FatalError); + Info<< " Reading phi" << endl; + surfaceScalarField phi + ( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::MUST_READ + ), + mesh + ); + + Info<< " Reading U" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ + ), + mesh + ); + + Info<< " Reading p" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ + ), + mesh + ); + + if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0)) + { + IOobject RASPropertiesHeader + ( + "RASProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ); + + IOobject LESPropertiesHeader + ( + "LESProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ); + + if (RASPropertiesHeader.headerOk()) + { + IOdictionary RASProperties(RASPropertiesHeader); + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr RASModel + ( + incompressible::RASModel::New + ( + U, + phi, + laminarTransport + ) + ); + execFlowFunctionObjects(args, runTime); + } + else if (LESPropertiesHeader.headerOk()) + { + IOdictionary LESProperties(LESPropertiesHeader); + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr sgsModel + ( + incompressible::LESModel::New(U, phi, laminarTransport) + ); + + execFlowFunctionObjects(args, runTime); + } + else + { + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar nu(transportProperties.lookup("nu")); + + execFlowFunctionObjects(args, runTime); + } + } + else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0)) + { + autoPtr thermo(basicPsiThermo::New(mesh)); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh + ), + thermo->rho() + ); + + IOobject RASPropertiesHeader + ( + "RASProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ); + + IOobject LESPropertiesHeader + ( + "LESProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ); + + if (RASPropertiesHeader.headerOk()) + { + IOdictionary RASProperties(RASPropertiesHeader); + + autoPtr RASModel + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + execFlowFunctionObjects(args, runTime); + } + else if (LESPropertiesHeader.headerOk()) + { + IOdictionary LESProperties(LESPropertiesHeader); + + autoPtr sgsModel + ( + compressible::LESModel::New(rho, U, phi, thermo()) + ); + + execFlowFunctionObjects(args, runTime); + } + else + { + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar mu(transportProperties.lookup("mu")); + + execFlowFunctionObjects(args, runTime); + } + } + else + { + FatalErrorIn(args.executable()) + << "Incorrect dimensions of phi: " << phi.dimensions() + << nl << exit(FatalError); + } } } diff --git a/src/postProcessing/postCalc/postCalc.C b/src/postProcessing/postCalc/postCalc.C index f477818a4c..ff2dd174e0 100644 --- a/src/postProcessing/postCalc/postCalc.C +++ b/src/postProcessing/postCalc/postCalc.C @@ -57,11 +57,17 @@ namespace Foam int main(int argc, char *argv[]) { Foam::timeSelector::addOptions(); +# include "addRegionOption.H" Foam::argList::addBoolOption ( "noWrite", "suppress writing results" ); + Foam::argList::addBoolOption + ( + "noFlow", + "suppress creating flow models (execFlowFunctionObjects only)" + ); Foam::argList::addOption ( "dict", @@ -72,7 +78,7 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args); - #include "createMesh.H" + #include "createNamedMesh.H" forAll(timeDirs, timeI) { From 9f8fb69105b2d642c2f973dad070ad337b60944c Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 15 Sep 2011 16:45:08 +0100 Subject: [PATCH 09/48] ENH: streamFunction: added -region option --- .../velocityField/streamFunction/streamFunction.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C index 850b8cbb5c..c5c024b3ef 100644 --- a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C +++ b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C @@ -42,13 +42,14 @@ Description int main(int argc, char *argv[]) { timeSelector::addOptions(); +# include "addRegionOption.H" # include "setRootCase.H" # include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMeshNoClear.H" +# include "createNamedMesh.H" pointMesh pMesh(mesh); From 67d17dcb128ec4996fd0ad6e8bad7bd2919c6cf8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Sep 2011 14:43:43 +0100 Subject: [PATCH 10/48] STYLE: maxerVesselAMI2D: remove unused file --- .../constant/polyMesh/boundary | 78 ------------------- 1 file changed, 78 deletions(-) delete mode 100644 tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/polyMesh/boundary diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/polyMesh/boundary deleted file mode 100644 index 34ba2b59dd..0000000000 --- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/constant/polyMesh/boundary +++ /dev/null @@ -1,78 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - rotor - { - type wall; - nFaces 192; - startFace 5856; - } - stator - { - type wall; - nFaces 192; - startFace 6048; - } - AMI1 - { - type cyclicAMI; - nFaces 96; - startFace 6240; - matchTolerance 0.0001; - neighbourPatch AMI2; - transform noOrdering; - surface - { - type searchableCylinder; - point1 ( 0 0 -1 ); - point2 ( 0 0 1 ); - radius 0.5; - } - } - AMI2 - { - type cyclicAMI; - nFaces 96; - startFace 6336; - matchTolerance 0.0001; - neighbourPatch AMI1; - transform noOrdering; - surface - { - type searchableCylinder; - point1 ( 0 0 -1 ); - point2 ( 0 0 1 ); - radius 0.5; - } - } - front - { - type empty; - nFaces 3072; - startFace 6432; - } - back - { - type empty; - nFaces 3072; - startFace 9504; - } -) - -// ************************************************************************* // From 6ac8d99e925a6653cbff4b53bb011d4142f71fca Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Sep 2011 14:44:38 +0100 Subject: [PATCH 11/48] BUG: radialActuactionDiskSource: corrected maxR calculation. --- .../radialActuationDiskSourceTemplates.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C index 2fea641d30..6c8469fda8 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C @@ -59,7 +59,7 @@ addRadialActuationDiskAxialInertialResistance const Field zoneCellVolumes(mesh().cellVolumes(), cells); const vector avgCentre = gSum(zoneCellVolumes*zoneCellCentres)/V(); - const scalar maxR = mag(max(zoneCellCentres - avgCentre)); + const scalar maxR = gMax(mag(zoneCellCentres - avgCentre)); scalar intCoeffs = coeffs_[0] From 01e3850eda568f36ad46b03483f3e2c41cc64c63 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 16 Sep 2011 18:23:47 +0100 Subject: [PATCH 12/48] STYLE: snappyHexMeshDict: adapted comment on maxLocalCells. --- .../mesh/generation/snappyHexMesh/snappyHexMeshDict | 2 +- .../iglooWithFridges/system/snappyHexMeshDict | 2 +- .../snappyMultiRegionHeater/system/snappyHexMeshDict | 8 ++++---- .../wingMotion_snappyHexMesh/system/snappyHexMeshDict | 2 +- .../simpleFoam/motorBike/system/snappyHexMeshDict | 2 +- .../windSimpleFoam/turbineSiting/system/snappyHexMeshDict | 2 +- .../mesh/snappyHexMesh/flange/system/snappyHexMeshDict | 8 ++++---- .../LTSInterFoam/wigleyHull/system/snappyHexMeshDict | 8 ++++---- .../cavitatingBullet/system/snappyHexMeshDict | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 0d88051ced..34500268ce 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -70,7 +70,7 @@ castellatedMeshControls // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. - maxLocalCells 1000000; + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index 69f7412ef5..0bbb485782 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -119,7 +119,7 @@ castellatedMeshControls // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. - maxLocalCells 1000000; + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict index e43a518fb3..82b6381b1b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict @@ -76,10 +76,10 @@ castellatedMeshControls // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ - // While refining maximum number of cells per processor. This is basically - // the number of cells that fit on a processor. If you choose this too small - // it will do just more refinement iterations to obtain a similar mesh. - maxLocalCells 1000000; + // If local number of cells is >= maxLocalCells on any processor + // switches from from refinement followed by balancing + // (current method) to (weighted) balancing before refinement. + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict index 21553bc0d1..b4c3ed8f64 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict @@ -53,7 +53,7 @@ castellatedMeshControls // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. - maxLocalCells 1000000; + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict index ffc577007b..153726a3ac 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict @@ -54,7 +54,7 @@ castellatedMeshControls // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. - maxLocalCells 1000000; + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict b/tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict index d0e899232d..1e6f477fc4 100644 --- a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict +++ b/tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict @@ -86,7 +86,7 @@ castellatedMeshControls // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. - maxLocalCells 1000000; + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict index d412e27721..feb4f2f871 100644 --- a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict @@ -53,10 +53,10 @@ castellatedMeshControls // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ - // While refining maximum number of cells per processor. This is basically - // the number of cells that fit on a processor. If you choose this too small - // it will do just more refinement iterations to obtain a similar mesh. - maxLocalCells 1000000; + // If local number of cells is >= maxLocalCells on any processor + // switches from from refinement followed by balancing + // (current method) to (weighted) balancing before refinement. + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict index b63d2709ec..01badbd1ec 100644 --- a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict +++ b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict @@ -71,10 +71,10 @@ castellatedMeshControls // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ - // While refining maximum number of cells per processor. This is basically - // the number of cells that fit on a processor. If you choose this too small - // it will do just more refinement iterations to obtain a similar mesh. - maxLocalCells 1000000; + // If local number of cells is >= maxLocalCells on any processor + // switches from from refinement followed by balancing + // (current method) to (weighted) balancing before refinement. + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict index 8c38433da7..5150850030 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict @@ -68,10 +68,10 @@ castellatedMeshControls // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ - // While refining maximum number of cells per processor. This is basically - // the number of cells that fit on a processor. If you choose this too small - // it will do just more refinement iterations to obtain a similar mesh. - maxLocalCells 1000000; + // If local number of cells is >= maxLocalCells on any processor + // switches from from refinement followed by balancing + // (current method) to (weighted) balancing before refinement. + maxLocalCells 100000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. From 72a2f9b45cb466635e83c76a9f217a53fa4087e8 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 16 Sep 2011 19:18:19 +0100 Subject: [PATCH 13/48] multiphaseEulerFoam: further updates to the MRF functionality --- .../multiphase/multiphaseEulerFoam/Make/files | 1 + .../multiphaseEulerFoam/Make/options | 1 + .../multiphaseEulerFoam/createMRFZones.H | 6 + .../multiphase/multiphaseEulerFoam/pEqn.H | 3 +- src/finiteVolume/Make/files | 1 - ...phaseFixedFluxPressureFvPatchScalarField.C | 177 ------------------ ...phaseFixedFluxPressureFvPatchScalarField.H | 154 --------------- .../bubbleColumn/system/fvSolution | 18 +- .../damBreak4phase/system/fvSolution | 8 +- 9 files changed, 16 insertions(+), 353 deletions(-) delete mode 100644 src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C delete mode 100644 src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files index f71c44324a..b5b45045f1 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/files +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files @@ -1,3 +1,4 @@ multiphaseEulerFoam.C +multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C EXE = $(FOAM_APPBIN)/multiphaseEulerFoam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options index 8fc20e8623..06ffdda61c 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -IphaseModel/lnInclude \ -ImultiphaseSystem/lnInclude \ + -ImultiphaseFixedFluxPressure \ /*-IkineticTheoryModels/lnInclude*/ \ -IinterfacialModels/lnInclude \ -I$(LIB_SRC)/transportModels \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H index 161446a8e6..326c934eaf 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H @@ -1,2 +1,8 @@ MRFZones mrfZones(mesh); + + forAllIter(PtrDictionary, fluid.phases(), iter) + { + mrfZones.correctBoundaryVelocity(iter().U()); + } + mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 5f7c38ebf0..6cbfbf2d16 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -53,12 +53,12 @@ phase.U() = rAUs[phasei]*UEqns[phasei].H(); + mrfZones.absoluteFlux(phase.phi()); phase.phi() = ( (fvc::interpolate(phase.U()) & mesh.Sf()) + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) ); - mrfZones.relativeFlux(phase.phi()); phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf()); @@ -241,7 +241,6 @@ } } - phase.U() = fvc::reconstruct(phase.phi()); phase.U().correctBoundaryConditions(); U += alpha*phase.U(); diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index e81819706f..337a971fb1 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -127,7 +127,6 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C -$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C deleted file mode 100644 index be534fb8fa..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C +++ /dev/null @@ -1,177 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "multiphaseFixedFluxPressureFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_("U"), - phiName_("phi"), - rhoName_("rho") -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - UName_(ptf.UName_), - phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_(dict.lookupOrDefault("U", "U")), - phiName_(dict.lookupOrDefault("phi", "phi")), - rhoName_(dict.lookupOrDefault("rho", "rho")) -{ - if (dict.found("gradient")) - { - gradient() = scalarField("gradient", dict, p.size()); - fixedGradientFvPatchScalarField::updateCoeffs(); - fixedGradientFvPatchScalarField::evaluate(); - } - else - { - fvPatchField::operator=(patchInternalField()); - gradient() = 0.0; - } -} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField& Up = - patch().lookupPatchField(UName_); - - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - fvsPatchField phip = - patch().patchField(phi); - - if (phi.dimensions() == dimDensity*dimVelocity*dimArea) - { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); - - phip /= rhop; - } - - const fvsPatchField& Dpp = - patch().lookupPatchField("Dp"); - - gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchScalarField::write(os); - writeEntryIfDifferent(os, "U", "U", UName_); - writeEntryIfDifferent(os, "phi", "phi", phiName_); - writeEntryIfDifferent(os, "rho", "rho", rhoName_); - gradient().writeEntry("gradient", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - multiphaseFixedFluxPressureFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H deleted file mode 100644 index b97001a5c0..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H +++ /dev/null @@ -1,154 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -Description - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -SourceFiles - multiphaseFixedFluxPressureFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H -#define multiphaseFixedFluxPressureFvPatchScalarFields_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" -#include "Switch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class multiphaseFixedFluxPressureFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class multiphaseFixedFluxPressureFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Name of the velocity field - word UName_; - - //- Name of the flux transporting the field - word phiName_; - - //- Name of the density field used to normalise the mass flux - // if neccessary - word rhoName_; - - -public: - - //- Runtime type information - TypeName("multiphaseFixedFluxPressure"); - - - // Constructors - - //- Construct from patch and internal field - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // multiphaseFixedFluxPressureFvPatchScalarField onto a new patch - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution index 9379d3029f..cf4ce79ecf 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution @@ -97,18 +97,12 @@ PIMPLE relaxationFactors { - fields - { - } - equations - { - "U.*" 1; - "T.*" 1; - "alpha.*" 1; - "Theta.*" 1; - "k.*" 1; - "epsilon.*" 1; - } + "U.*" 1; + "T.*" 1; + "alpha.*" 1; + "Theta.*" 1; + "k.*" 1; + "epsilon.*" 1; } diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution index 39c47f6efc..296b0cd488 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution @@ -88,13 +88,7 @@ PIMPLE relaxationFactors { - fields - { - } - equations - { - "U.*" 1; - } + "U.*" 1; } // ************************************************************************* // From a47a04b55c85adabe30ddd5fa0f7b4e9b45bbb6f Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 19 Sep 2011 15:06:11 +0100 Subject: [PATCH 14/48] Added support for building on SGI machines --- etc/config/settings.csh | 8 ++++++++ etc/config/settings.sh | 8 ++++++++ wmake/rules/General/mplibSGIMPI | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 wmake/rules/General/mplibSGIMPI diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 457c1fd8ad..93f3e506ab 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -486,6 +486,14 @@ case QSMPI: _foamAddLib $MPI_ARCH_PATH/lib breaksw +case SGIMPI: + setenv FOAM_MPI ${MPI_ROOT##*/} + setenv MPI_ARCH_PATH $MPI_ROOT + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + breaksw + default: setenv FOAM_MPI dummy breaksw diff --git a/etc/config/settings.sh b/etc/config/settings.sh index 8297f43dea..5111ef405a 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -510,6 +510,14 @@ QSMPI) _foamAddLib $MPI_ARCH_PATH/lib ;; +SGIMPI) + export FOAM_MPI=${MPI_ROOT##*/} + export MPI_ARCH_PATH=$MPI_ROOT + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + ;; + *) export FOAM_MPI=dummy ;; diff --git a/wmake/rules/General/mplibSGIMPI b/wmake/rules/General/mplibSGIMPI new file mode 100644 index 0000000000..8595264660 --- /dev/null +++ b/wmake/rules/General/mplibSGIMPI @@ -0,0 +1,3 @@ +PFLAGS = -DSGIMPI -DMPI_NO_CPPBIND +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi From 295c6176f2af51d06dab5a4f12b14fb36e683a49 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Sep 2011 17:56:42 +0100 Subject: [PATCH 15/48] ENH: Only output local forces/moments when needed --- .../functionObjects/forces/forces/forces.C | 73 ++++++++++++------- .../functionObjects/forces/forces/forces.H | 3 + 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index d585569649..b23a6d2328 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -190,6 +190,7 @@ Foam::forces::forces rhoRef_(VGREAT), pRef_(0), coordSys_(), + localSystem_(false), forcesFilePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -239,6 +240,7 @@ Foam::forces::forces rhoRef_(rhoInf), pRef_(pRef), coordSys_(coordSys), + localSystem_(false), forcesFilePtr_(NULL) {} @@ -330,6 +332,7 @@ void Foam::forces::read(const dictionary& dict) if (!dict.readIfPresent("CofR", coordSys_.origin())) { coordSys_ = coordinateSystem(dict, obr_); + localSystem_ = true; } } } @@ -382,10 +385,17 @@ void Foam::forces::writeFileHeader() { forcesFilePtr_() << "# Time" << tab - << "forces(pressure, viscous) moment(pressure, viscous)" - << tab - << "local forces(pressure, viscous) local moment(pressure, viscous)" - << endl; + << "forces(pressure, viscous) moment(pressure, viscous)"; + + if (localSystem_) + { + forcesFilePtr_() + << tab + << "local forces(pressure, viscous) " + << "local moment(pressure, viscous)"; + } + + forcesFilePtr_()<< endl; } } @@ -413,33 +423,42 @@ void Foam::forces::write() if (Pstream::master()) { - forcesMoments fmLocal; - - fmLocal.first().first() = - coordSys_.localVector(fm.first().first()); - - fmLocal.first().second() = - coordSys_.localVector(fm.first().second()); - - fmLocal.second().first() = - coordSys_.localVector(fm.second().first()); - - fmLocal.second().second() = - coordSys_.localVector(fm.second().second()); - - forcesFilePtr_() << obr_.time().value() - << tab << fm - << tab << fmLocal << endl; - if (log_) { Info<< "forces output:" << nl << " forces(pressure, viscous)" << fm.first() << nl - << " moment(pressure, viscous)" << fm.second() << nl - << " local:" << nl - << " forces(pressure, viscous)" << fmLocal.first() << nl - << " moment(pressure, viscous)" << fmLocal.second() << nl - << endl; + << " moment(pressure, viscous)" << fm.second() << nl; + + forcesFilePtr_() << obr_.time().value() << tab << fm; + + if (localSystem_) + { + forcesMoments fmLocal; + + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); + + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); + + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); + + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); + + forcesFilePtr_() << tab << fmLocal; + + + Info<< " local:" << nl + << " forces(pressure, viscous)" << fmLocal.first() + << nl + << " moment(pressure, viscous)" << fmLocal.second() + << nl; + } + + forcesFilePtr_() << endl; + Info<< endl; } } } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index eb46c057d5..3d14768b2b 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -165,6 +165,9 @@ protected: //- Coordinate system used when evaluting forces/moments coordinateSystem coordSys_; + //- Flag to indicate whether we are using a local co-ordinate sys + bool localSystem_; + //- Forces/moment file ptr autoPtr forcesFilePtr_; From 46616b54ec87c8c22c45b638125acadc2c7a5919 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Sep 2011 13:44:39 +0100 Subject: [PATCH 16/48] STYLE: topoSetDict: adapted comment --- .../mesh/manipulation/topoSet/topoSetDict | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index 93194848c2..7dd6cf4e93 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -33,24 +33,28 @@ FoamFile // // // Select by explicitly providing cell labels // source labelToCell; +// sourceInfo // { // value (12 13 56); // labels of cells // } // // // Copy elements from cellSet // source cellToCell; +// sourceInfo // { // set c1; // } // // // Cells in cell zone // source zoneToCell; +// sourceInfo // { // name ".*Zone"; // Name of cellZone, regular expressions allowed // } // // // Cells on master or slave side of faceZone // source faceZoneToCell; +// sourceInfo // { // name ".*Zone"; // Name of faceZone, regular expressions allowed // option master; // master/slave @@ -58,6 +62,7 @@ FoamFile // // // Select based on faceSet // source faceToCell; +// sourceInfo // { // set f0; // Name of faceSet // @@ -69,6 +74,7 @@ FoamFile // // // Select based on pointSet // source pointToCell; +// sourceInfo // { // set p0; // option any; // cell with any point in pointSet @@ -77,12 +83,14 @@ FoamFile // // // Select based on cellShape // source shapeToCell; +// sourceInfo // { // type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex // } // // // Cells with cell centre within box // source boxToCell; +// sourceInfo // { // box (0 0 0) (1 1 1); // } @@ -90,6 +98,7 @@ FoamFile // // Cells with cell centre within box // // Is skewed, rotated box. Given as origin and three spanning vectors. // source rotatedBoxToCell; +// sourceInfo // { // origin (0.2 0.2 -10); // i (0.2 0.2 0); @@ -99,6 +108,7 @@ FoamFile // // // Cells with centre within cylinder // source cylinderToCell; +// sourceInfo // { // p1 (0.2 0.2 -10); // start point on cylinder axis // p2 (0.2 0.2 0); // end point on cylinder axis @@ -107,6 +117,7 @@ FoamFile // // // Cells with centre within sphere // source sphereToCell; +// sourceInfo // { // centre (0.2 0.2 -10); // radius 5.0; @@ -114,12 +125,14 @@ FoamFile // // // Cells with cellCentre nearest to coordinates // source nearestToCell; +// sourceInfo // { // points ((0 0 0) (1 1 1)(2 2 2)); // } // // // Select based on surface // source surfaceToCell; +// sourceInfo // { // file "www.avl.com-geometry.stl"; // outsidePoints ((-99 -99 -59)); // definition of outside @@ -135,6 +148,7 @@ FoamFile // // // values of field within certain range // source fieldToCell; +// sourceInfo // { // fieldName U; // Note: uses mag(U) since volVectorField // min 0.1; @@ -143,6 +157,7 @@ FoamFile // // // Mesh region (non-face connected part of (subset of)mesh) // source regionToCell; +// sourceInfo // { // set c0; // name of cellSet giving mesh subset // insidePoint (1 2 3); // point inside region to select @@ -155,12 +170,14 @@ FoamFile // // // Copy elements from faceSet // source faceToFace; +// sourceInfo // { // set f1; // } // // // Select based on cellSet // source cellToFace; +// sourceInfo // { // set c0; // option all; // All faces of cells @@ -169,6 +186,7 @@ FoamFile // // // Select based on pointSet // source pointToFace; +// sourceInfo // { // set p0; // option any; // Faces using any point in pointSet @@ -177,30 +195,35 @@ FoamFile // // // Select by explicitly providing face labels // source labelToFace; +// sourceInfo // { // value (12 13 56); // labels of faces // } // // // All faces of patch // source patchToFace; +// sourceInfo // { // name ".*Wall"; // Name of patch, regular expressions allowed // } // // // All faces of faceZone // source zoneToFace; +// sourceInfo // { // name ".*Zone1"; // Name of faceZone, regular expressions allowed // } // // // Faces with face centre within box // source boxToFace; +// sourceInfo // { // box (0 0 0) (1 1 1); // } // // // Faces with normal to within certain angle aligned with vector. // source normalToFace; +// sourceInfo // { // normal (0 0 1); // Vector // cos 0.01; // Tolerance (max cos of angle) @@ -213,12 +236,14 @@ FoamFile // // // Copy elements from pointSet // source pointToPoint; +// sourceInfo // { // set p1; // } // // // Select based on cellSet // source cellToPoint; +// sourceInfo // { // set c0; // option all; // all points of cell @@ -226,6 +251,7 @@ FoamFile // // // Select based on faceSet // source faceToPoint; +// sourceInfo // { // set f0; // name of faceSet // option all; // all points of face @@ -233,30 +259,35 @@ FoamFile // // // Select by explicitly providing point labels // source labelToPoint; +// sourceInfo // { // value (12 13 56); // labels of points // } // // // All points in pointzone // source zoneToPoint; +// sourceInfo // { // name ".*Zone"; // name of pointZone, regular expressions allowed // } // // // Points nearest to coordinates // source nearestToPoint; +// sourceInfo // { // points ((0 0 0) (1 1 1)); // } // // // Points with coordinate within box // source boxToPoint; +// sourceInfo // { // box (0 0 0) (1 1 1); // } // // // Select based on surface // source surfaceToPoint; +// sourceInfo // { // file "www.avl.com-geometry.stl"; // nearDistance 0.1; // points near to surface @@ -275,6 +306,7 @@ FoamFile // // // Select based on cellSet // source setToCellZone; +// sourceInfo // { // set c0; // name of cellSet // } @@ -285,12 +317,14 @@ FoamFile // ~~~~~~~~~~~ // // Select based on faceSet without orientation // source setToFaceZone; +// sourceInfo // { // set f0; // name of faceSet // } // // // Select based on faceSet, using cellSet to determine orientation // source setsToFaceZone; +// sourceInfo // { // faceSet f0; // name of faceSet // cellSet c0; // name of cellSet of slave side From 6084361ca3ebd846782173a10f0e4622dd88ff00 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 20 Sep 2011 13:45:25 +0100 Subject: [PATCH 17/48] ENH: autoLayerDriver: additional printing in checkAndUnmark --- .../autoHexMeshDriver/autoLayerDriver.C | 57 +++++- .../autoHexMeshDriver/autoLayerDriver.H | 1 + .../layerParameters/layerParameters.C | 187 +++++++++--------- .../layerParameters/layerParameters.H | 25 ++- 4 files changed, 167 insertions(+), 103 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 10d6499905..c494366f40 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -46,6 +46,7 @@ Description #include "combineFaces.H" #include "IOmanip.H" #include "globalIndex.H" +#include "DynamicField.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -1990,6 +1991,7 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark ( const addPatchCellLayer& addLayer, const dictionary& meshQualityDict, + const bool additionalReporting, const List& baffles, const indirectPrimitivePatch& pp, const fvMesh& newMesh, @@ -2032,6 +2034,12 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark ); // Check if any of the faces in error uses any face of an added cell + // - if additionalReporting print the few remaining areas for ease of + // finding out where the problems are. + + const label nReportMax = 10; + DynamicField disabledFaceCentres(nReportMax); + forAll(addedCells, oldPatchFaceI) { // Get the cells (in newMesh labels) per old patch face (in mesh @@ -2052,12 +2060,58 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark ) ) { + if (additionalReporting && (nChanged < nReportMax)) + { + disabledFaceCentres.append + ( + pp.faceCentres()[oldPatchFaceI] + ); + } + nChanged++; } } } - return returnReduce(nChanged, sumOp