From 6a98180e166559b68751e46553e1ccb0bbd6f239 Mon Sep 17 00:00:00 2001 From: william Date: Wed, 19 Feb 2014 14:15:05 +0000 Subject: [PATCH 01/17] BUG: fixed tutorial Allrun trying to test non-existent logs --- tutorials/Allrun | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tutorials/Allrun b/tutorials/Allrun index d4bdfb3d..ddae828f 100755 --- a/tutorials/Allrun +++ b/tutorials/Allrun @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -80,7 +80,10 @@ do ( [ -d $appDir ] && cd $appDir || exit - for log in `find . -name "log.*" | xargs ls -rt` + logs=`find . -name "log.*"` + [ -n "$logs" ] || exit + + for log in `echo $logs | xargs ls -rt` do logReport $log >> ../testLoopReport done From f54ea84f6dd2dc0caa7cd7ee5ab92fe2b9201fbf Mon Sep 17 00:00:00 2001 From: william Date: Wed, 19 Feb 2014 14:16:29 +0000 Subject: [PATCH 02/17] BUG: making patchifyObstacles script POSIX compliant --- .../reactingParcelFilmFoam/hotBoxes/patchifyObstacles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles index 70385966..9bce9ef1 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/patchifyObstacles @@ -135,7 +135,7 @@ for xi in $(seq 1 1 $nx); do z2=`echo $z $l $tol | awk '{print $1 + $2 + $3}'` addToFaceSet cube${pad}${n}_side${side} $x1 $x2 $y1 $y2 $z1 $z2 - let n+=1 + n=$((n+1)) z=`echo $z $offset | awk '{print $1 + $2}'` done From 1fdafa42d6764529222e5d8fdfeded7717db747c Mon Sep 17 00:00:00 2001 From: william Date: Wed, 19 Feb 2014 14:19:46 +0000 Subject: [PATCH 03/17] ENH: twoPhaseEulerFoam: modified noBlending to handle cases where only the segregated model is used --- .../blendingMethods/noBlending/noBlending.C | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C index 37c543a8..f83cdd55 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C @@ -88,7 +88,7 @@ Foam::tmp Foam::blendingMethods::noBlending::f1 ( "f", dimless, - phase1.name() == continuousPhase_ + phase2.name() != continuousPhase_ ) ) ); @@ -101,7 +101,28 @@ Foam::tmp Foam::blendingMethods::noBlending::f2 const phaseModel& phase2 ) const { - return f1(phase1, phase2); + const fvMesh& mesh(phase1.mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "f", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar + ( + "f", + dimless, + phase1.name() == continuousPhase_ + ) + ) + ); } From 798e5efb13c7344e5a37454fb509b4c5845bd87e Mon Sep 17 00:00:00 2001 From: william Date: Wed, 19 Feb 2014 14:21:49 +0000 Subject: [PATCH 04/17] BUG: patchInjectionBase: fixed triangle indexing and processor fraction calculation --- .../PatchFlowRateInjection/PatchFlowRateInjection.C | 6 +++--- .../InjectionModel/PatchInjection/PatchInjection.C | 9 ++++----- .../PatchInjection/patchInjectionBase.C | 12 +++++------- .../PatchInjection/patchInjectionBase.H | 5 +---- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C index 84995897..da721e70 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,7 +160,7 @@ Foam::label Foam::PatchFlowRateInjection::parcelsToInject scalar c = concentration_.value(0.5*(time0 + time1)); - scalar nParcels = fraction_*parcelConcentration_*c*flowRate()*dt; + scalar nParcels = parcelConcentration_*c*flowRate()*dt; label nParcelsToInject = floor(nParcels); // Inject an additional parcel with a probability based on the @@ -205,7 +205,7 @@ Foam::scalar Foam::PatchFlowRateInjection::volumeToInject this->volumeTotal_ = volume; this->massTotal_ = volume*this->owner().constProps().rho0(); - return fraction_*volume; + return volume; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C index 184c026b..05cce028 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/PatchInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,8 +68,7 @@ Foam::PatchInjection::PatchInjection patchInjectionBase::updateMesh(owner.mesh()); // Set total volume/mass to inject - this->volumeTotal_ = fraction_*flowRateProfile_.integrate(0.0, duration_); - this->massTotal_ *= fraction_; + this->volumeTotal_ = flowRateProfile_.integrate(0.0, duration_); } @@ -121,7 +120,7 @@ Foam::label Foam::PatchInjection::parcelsToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - scalar nParcels = this->fraction_*(time1 - time0)*parcelsPerSecond_; + scalar nParcels = (time1 - time0)*parcelsPerSecond_; cachedRandom& rnd = this->owner().rndGen(); @@ -159,7 +158,7 @@ Foam::scalar Foam::PatchInjection::volumeToInject { if ((time0 >= 0.0) && (time0 < duration_)) { - return this->fraction_*flowRateProfile_.integrate(time0, time1); + return flowRateProfile_.integrate(time0, time1); } else { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C index 15543f18..0d1700b5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,6 @@ Foam::patchInjectionBase::patchInjectionBase patchArea_(0.0), patchNormal_(), cellOwners_(), - fraction_(1.0), triFace_(), triToFace_(), triCumulativeMagSf_(), @@ -73,7 +72,6 @@ Foam::patchInjectionBase::patchInjectionBase(const patchInjectionBase& pib) patchArea_(pib.patchArea_), patchNormal_(pib.patchNormal_), cellOwners_(pib.cellOwners_), - fraction_(pib.fraction_), triFace_(pib.triFace_), triToFace_(pib.triToFace_), triCumulativeMagSf_(pib.triCumulativeMagSf_), @@ -103,6 +101,9 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh) DynamicList triFace(2*patch.size()); DynamicList tris(5); + // set zero value at the start of the tri area list + triMagSf.append(0.0); + forAll(patch, faceI) { const face& f = patch[faceI]; @@ -138,13 +139,10 @@ void Foam::patchInjectionBase::updateMesh(const polyMesh& mesh) triToFace_.transfer(triToFace); triCumulativeMagSf_.transfer(triMagSf); - // fraction of injection volume to be injected by this patch - fraction_ = sumTriMagSf_[Pstream::myProcNo() + 1]/sum(sumTriMagSf_); - // convert sumTriMagSf_ into cumulative sum of areas per proc for (label i = 1; i < sumTriMagSf_.size(); i++) { - sumTriMagSf_[i] += sumTriMagSf_[i - 1]; + sumTriMagSf_[i] += sumTriMagSf_[i-1]; } const scalarField magSf(mag(patch.faceAreas())); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H index f3185316..b11f2790 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,9 +80,6 @@ protected: //- List of cell labels corresponding to injector positions labelList cellOwners_; - //- Fraction of injection controlled by this processor - scalar fraction_; - //- Decomposed patch faces as a list of triangles faceList triFace_; From 177514e6e475a2f9a621317f470aff2c88f29354 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 20 Feb 2014 09:08:12 +0000 Subject: [PATCH 05/17] ENH: thermo - added instantiation of adiabaticPerfectFluid to rhoThermos --- .../basic/rhoThermo/rhoThermos.C | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C index beaa43b7..35d49cca 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermos.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ License #include "incompressiblePerfectGas.H" #include "rhoConst.H" #include "perfectFluid.H" +#include "adiabaticPerfectFluid.H" #include "hConstThermo.H" #include "janafThermo.H" #include "sensibleEnthalpy.H" @@ -114,6 +115,18 @@ makeThermo specie ); +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + adiabaticPerfectFluid, + specie +); + makeThermo ( rhoThermo, @@ -225,6 +238,18 @@ makeThermo specie ); +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + hConstThermo, + adiabaticPerfectFluid, + specie +); + makeThermo ( rhoThermo, From c71c6e9020448cc3b3ab058daac9a7f82e5f8d84 Mon Sep 17 00:00:00 2001 From: william Date: Thu, 20 Feb 2014 10:46:23 +0000 Subject: [PATCH 06/17] STYLE: oscillatingFixedValueFvPatchField: typo in function description --- .../oscillatingFixedValue/oscillatingFixedValueFvPatchField.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H index 949d481c..d16fb964 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ Description amplitude and frequency. \f[ - x_p = (1 + a sin(\pi f t))x_{ref} + x_o + x_p = (1 + a sin(2 \pi f t))x_{ref} + x_o \f] where From b44c09fec65fd8a3c95e8975ab776b9d020df6f7 Mon Sep 17 00:00:00 2001 From: william Date: Thu, 20 Feb 2014 11:45:31 +0000 Subject: [PATCH 07/17] BUG: MPPICParcel: removed increments to a parcel's age in correction steps --- .../parcels/Templates/MPPICParcel/MPPICParcel.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcel.C b/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcel.C index 0bac21bf..2af95e4a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/MPPICParcel/MPPICParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,12 +95,16 @@ bool Foam::MPPICParcel::move scalar f = p.stepFraction(); + scalar a = p.age(); + p.U() = (1.0 - f)*p.UCorrect(); ParcelType::move(td, trackTime); p.U() = U + (p.stepFraction() - f)*p.UCorrect(); + p.age() = a; + break; } } From c90486054799e2c5cd03a60e127b0dde8e824def Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 20 Feb 2014 13:39:56 +0000 Subject: [PATCH 08/17] BUG: foamToEnsight: handle empty patches --- .../foamToEnsight/ensightMesh.C | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 267b8dc8..bae7d395 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -195,41 +195,44 @@ void Foam::ensightMesh::correct() { forAll(mesh_.boundary(), patchi) { - const polyPatch& p = mesh_.boundaryMesh()[patchi]; - - labelList& tris = boundaryFaceSets_[patchi].tris; - labelList& quads = boundaryFaceSets_[patchi].quads; - labelList& polys = boundaryFaceSets_[patchi].polys; - - tris.setSize(p.size()); - quads.setSize(p.size()); - polys.setSize(p.size()); - - label nTris = 0; - label nQuads = 0; - label nPolys = 0; - - forAll(p, faceI) + if (mesh_.boundary()[patchi].size()) { - const face& f = p[faceI]; + const polyPatch& p = mesh_.boundaryMesh()[patchi]; - if (f.size() == 3) + labelList& tris = boundaryFaceSets_[patchi].tris; + labelList& quads = boundaryFaceSets_[patchi].quads; + labelList& polys = boundaryFaceSets_[patchi].polys; + + tris.setSize(p.size()); + quads.setSize(p.size()); + polys.setSize(p.size()); + + label nTris = 0; + label nQuads = 0; + label nPolys = 0; + + forAll(p, faceI) { - tris[nTris++] = faceI; - } - else if (f.size() == 4) - { - quads[nQuads++] = faceI; - } - else - { - polys[nPolys++] = faceI; + const face& f = p[faceI]; + + if (f.size() == 3) + { + tris[nTris++] = faceI; + } + else if (f.size() == 4) + { + quads[nQuads++] = faceI; + } + else + { + polys[nPolys++] = faceI; + } } + + tris.setSize(nTris); + quads.setSize(nQuads); + polys.setSize(nPolys); } - - tris.setSize(nTris); - quads.setSize(nQuads); - polys.setSize(nPolys); } } @@ -240,9 +243,12 @@ void Foam::ensightMesh::correct() if (patchNames_.empty() || patchNames_.found(patchName)) { - nfp.nTris = boundaryFaceSets_[patchi].tris.size(); - nfp.nQuads = boundaryFaceSets_[patchi].quads.size(); - nfp.nPolys = boundaryFaceSets_[patchi].polys.size(); + if (mesh_.boundary()[patchi].size()) + { + nfp.nTris = boundaryFaceSets_[patchi].tris.size(); + nfp.nQuads = boundaryFaceSets_[patchi].quads.size(); + nfp.nPolys = boundaryFaceSets_[patchi].polys.size(); + } } reduce(nfp.nTris, sumOp