From 77918e9b9eb63ece4614e741249afcae4f95e812 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 6 Mar 2012 16:50:26 +0000 Subject: [PATCH 001/317] ENH: edgeMesh: swap out code to use invertManyToMany --- src/edgeMesh/edgeMesh.C | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/src/edgeMesh/edgeMesh.C b/src/edgeMesh/edgeMesh.C index 4e5d50ed45..113112fa28 100644 --- a/src/edgeMesh/edgeMesh.C +++ b/src/edgeMesh/edgeMesh.C @@ -27,6 +27,7 @@ License #include "mergePoints.H" #include "addToRunTimeSelectionTable.H" #include "addToMemberFunctionSelectionTable.H" +#include "ListOps.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -112,35 +113,7 @@ void Foam::edgeMesh::calcPointEdges() const pointEdgesPtr_.reset(new labelListList(points_.size())); labelListList& pointEdges = pointEdgesPtr_(); - // Count - labelList nEdgesPerPoint(points_.size(), 0); - - forAll(edges_, edgeI) - { - const edge& e = edges_[edgeI]; - - nEdgesPerPoint[e[0]]++; - nEdgesPerPoint[e[1]]++; - } - - // Size - forAll(pointEdges, pointI) - { - pointEdges[pointI].setSize(nEdgesPerPoint[pointI]); - } - - // Fill - nEdgesPerPoint = 0; - - forAll(edges_, edgeI) - { - const edge& e = edges_[edgeI]; - const label p0 = e[0]; - const label p1 = e[1]; - - pointEdges[p0][nEdgesPerPoint[p0]++] = edgeI; - pointEdges[p1][nEdgesPerPoint[p1]++] = edgeI; - } + invertManyToMany(pointEdges.size(), edges_, pointEdges); } From 16660a95b03f06685398a06181db4f373f008c1f Mon Sep 17 00:00:00 2001 From: laurence Date: Fri, 9 Mar 2012 16:13:07 +0000 Subject: [PATCH 002/317] ENH: PrimitivePatchInterpolation: Change faceList to List --- .../PrimitivePatchInterpolation.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C index 190ddd07d4..6f09c755d0 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C @@ -60,7 +60,7 @@ void PrimitivePatchInterpolation::makeFaceToPointWeights() const } const pointField& points = patch_.localPoints(); - const faceList& faces = patch_.localFaces(); + const List& faces = patch_.localFaces(); faceToPointWeightsPtr_ = new scalarListList(points.size()); scalarListList& weights = *faceToPointWeightsPtr_; @@ -118,7 +118,7 @@ void PrimitivePatchInterpolation::makeFaceToEdgeWeights() const } const pointField& points = patch_.localPoints(); - const faceList& faces = patch_.localFaces(); + const List& faces = patch_.localFaces(); const edgeList& edges = patch_.edges(); const labelListList& edgeFaces = patch_.edgeFaces(); @@ -261,7 +261,7 @@ tmp > PrimitivePatchInterpolation::pointToFaceInterpolate Field& result = tresult(); - const faceList& localFaces = patch_.localFaces(); + const List& localFaces = patch_.localFaces(); forAll(result, facei) { From 6a177418a0a2dc1d9c1edbd9a69353c0ebf675b6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Mar 2012 12:27:50 +0000 Subject: [PATCH 003/317] ENH: Added output of front/rear lift coeffs to forceCoeffs function object --- .../functionObjects/forces/forceCoeffs/forceCoeffs.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index 3ce1fd2f11..d01d17e986 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -137,9 +137,11 @@ void Foam::forceCoeffs::write() if (log_) { Info<< "forceCoeffs output:" << nl - << " Cd = " << Cd << nl - << " Cl = " << Cl << nl - << " Cm = " << Cm << nl + << " Cm = " << Cm << nl + << " Cd = " << Cd << nl + << " Cl = " << Cl << nl + << " Cl(f) = " << Cl/2.0 - Cm << nl + << " Cl(r) = " << Cl/2.0 + Cm << nl << endl; } } From 3fd792b2aee39e79d426691f700b16a44be0f7e6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Mar 2012 15:12:42 +0000 Subject: [PATCH 004/317] ENH: Removed unnecessary #include --- src/combustionModels/psiCombustionModel/psiCombustionModels.C | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModels.C b/src/combustionModels/psiCombustionModel/psiCombustionModels.C index 925dd612cd..e8d96e9b63 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModels.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,9 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "makeCombustionTypes.H" - #include "psiCombustionModel.H" -#include "PaSR.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From c24b218f8e75ce2a3093d0ff4da758284011029d Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Mar 2012 17:29:44 +0000 Subject: [PATCH 005/317] BUG: Removed non-existent massInjected() function --- src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H | 3 --- .../clouds/Templates/KinematicCloud/KinematicCloud.H | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index 7526271e45..5f0730b299 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -424,9 +424,6 @@ public: // Check - //- Total mass injected - inline scalar massInjected() const; - //- Total mass in system inline scalar massInSystem() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index fd32ff790c..798bccd97d 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -456,9 +456,6 @@ public: // Check - //- Total mass injected - inline scalar massInjected() const; - //- Total mass in system inline scalar massInSystem() const; From b23142935fd0442d2641eee58e481678ac8cac00 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Mar 2012 17:41:31 +0000 Subject: [PATCH 006/317] STYLE: Updated copyright year --- src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H | 2 +- .../clouds/Templates/KinematicCloud/KinematicCloud.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index 5f0730b299..423bd87160 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 798bccd97d..8ac910e301 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From 657d7d6d85061f8c999a4f1a22fc61cb01642610 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 14 Mar 2012 17:47:41 +0000 Subject: [PATCH 007/317] ENH: Added virtual functions to base kinematicCloud API --- .../kinematicCloud/kinematicCloud.H | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H index 3f5bd469d1..7f72eae98f 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,6 +68,50 @@ public: kinematicCloud(); + // Member functions + + // Check + + //- Number of parcels + virtual label nParcels() const = 0; + + //- Total mass in system + virtual scalar massInSystem() const = 0; + + //- Total linear momentum of the system + virtual vector linearMomentumOfSystem() const = 0; + + //- Total linear kinetic energy in the system + virtual scalar linearKineticEnergyOfSystem() const = 0; + + //- Total rotational kinetic energy in the system + virtual scalar rotationalKineticEnergyOfSystem() const = 0; + + //- Penetration for percentage of the current total mass +// virtual scalar penetration(const scalar& prc) const = 0; + + //- Mean diameter Dij + virtual scalar Dij(const label i, const label j) const = 0; + + //- Max diameter + virtual scalar Dmax() const = 0; + + + // Fields + + //- Return the particle volume fraction field + // Note: for particles belonging to this cloud only + virtual const tmp theta() const = 0; + + //- Return the particle mass fraction field + // Note: for particles belonging to this cloud only + virtual const tmp alpha() const = 0; + + //- Return the particle effective density field + // Note: for particles belonging to this cloud only + virtual const tmp rhoEff() const = 0; + + //- Destructor virtual ~kinematicCloud(); }; From f3fac5bbffd61c75431cba372da029ac776685d1 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 14 Mar 2012 18:18:48 +0000 Subject: [PATCH 008/317] multiphaseEulerFoam: Improved consistency between implicit and explicit parts of the virtual mass --- .../solvers/multiphase/multiphaseEulerFoam/UEqns.H | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H index bce95f7d5a..b612e6b5d9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -15,12 +15,17 @@ forAllIter(PtrDictionary, fluid.phases(), iter) phasei, new fvVectorMatrix ( - (scalar(1) + fluid.Cvm(phase)/phase.rho())* + fvm::ddt(alpha, U) + + fvm::div(phase.phiAlpha(), U) + - fvm::Sp(fvc::ddt(alpha) + fvc::div(phase.phiAlpha()), U) + + + (alpha/phase.rho())*fluid.Cvm(phase)* ( - fvm::ddt(alpha, U) - + fvm::div(phase.phiAlpha(), U) - - fvm::Sp(fvc::ddt(alpha) + fvc::div(phase.phiAlpha()), U) + fvm::ddt(U) + + fvm::div(phase.phi(), U) + - fvm::Sp(fvc::div(phase.phi()), U) ) + - fvm::laplacian(alpha*nuEff, U) - fvc::div ( From 0d0dfbafe3b9e2fa7acfefa3e2127a66c2e72777 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 14 Mar 2012 18:19:18 +0000 Subject: [PATCH 009/317] multiphaseEulerFoam: Corrected the handling of drag for more than 2 phases --- .../solvers/multiphase/multiphaseEulerFoam/pEqn.H | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 4a817a1001..822e60d19a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -76,6 +76,7 @@ + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) + rAlphaAUfs[phasei]*(g & mesh.Sf()) ); + mrfZones.relativeFlux(phiHbyAs[phasei]); multiphaseSystem::dragModelTable::const_iterator dmIter = @@ -89,11 +90,20 @@ ++dmIter, ++dcIter ) { - const phaseModel *phase2Ptr = &dmIter()->phase2(); - if (phase2Ptr == &phase) + const phaseModel *phase2Ptr = NULL; + + if (&phase == &dmIter()->phase1()) + { + phase2Ptr = &dmIter()->phase2(); + } + else if (&phase == &dmIter()->phase2()) { phase2Ptr = &dmIter()->phase1(); } + else + { + continue; + } phiHbyAs[phasei] += fvc::interpolate From 346ad0eba8a402a47228d797a3badf8119499da2 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Mar 2012 09:20:42 +0000 Subject: [PATCH 010/317] ENH: Used writeEntryIfDifferent in write function for advective BC --- .../derived/advective/advectiveFvPatchField.C | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 5a81174d84..8de92629c1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -304,21 +304,13 @@ void Foam::advectiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - if (phiName_ != "phi") - { - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; - } - if (rhoName_ != "rho") - { - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; - } + this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); + this->template writeEntryIfDifferent(os, "rho", "rho", rhoName_); if (lInf_ > SMALL) { - os.writeKeyword("fieldInf") << fieldInf_ - << token::END_STATEMENT << nl; - os.writeKeyword("lInf") << lInf_ - << token::END_STATEMENT << nl; + os.writeKeyword("fieldInf") << fieldInf_ << token::END_STATEMENT << nl; + os.writeKeyword("lInf") << lInf_ << token::END_STATEMENT << nl; } this->writeEntry("value", os); From e887b572e92ad2b5fd22209baca132c0755b150d Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Mar 2012 10:03:46 +0000 Subject: [PATCH 011/317] ENH: better treatment of lInf in advective BC --- .../derived/advective/advectiveFvPatchField.C | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 8de92629c1..5764676b2a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -45,7 +45,7 @@ Foam::advectiveFvPatchField::advectiveFvPatchField phiName_("phi"), rhoName_("rho"), fieldInf_(pTraits::zero), - lInf_(0.0) + lInf_(-GREAT) { this->refValue() = pTraits::zero; this->refGrad() = pTraits::zero; @@ -82,7 +82,7 @@ Foam::advectiveFvPatchField::advectiveFvPatchField phiName_(dict.lookupOrDefault("phi", "phi")), rhoName_(dict.lookupOrDefault("rho", "rho")), fieldInf_(pTraits::zero), - lInf_(0.0) + lInf_(-GREAT) { if (dict.found("value")) { @@ -110,9 +110,13 @@ Foam::advectiveFvPatchField::advectiveFvPatchField ( "advectiveFvPatchField::" "advectiveFvPatchField" - "(const fvPatch&, const Field&, const dictionary&)", + "(" + "const fvPatch&, " + "const DimensionedField&, " + "const dictionary&" + ")", dict - ) << "unphysical lInf specified (lInf < 0)\n" + ) << "unphysical lInf specified (lInf < 0)" << nl << " on patch " << this->patch().name() << " of field " << this->dimensionedInternalField().name() << " in file " << this->dimensionedInternalField().objectPath() @@ -217,7 +221,7 @@ void Foam::advectiveFvPatchField::updateCoeffs() // Non-reflecting outflow boundary // If lInf_ defined setup relaxation to the value fieldInf_. - if (lInf_ > SMALL) + if (lInf_ > 0) { // Calculate the field relaxation coefficient k (See notes) const scalarField k(w*deltaT/lInf_); @@ -248,12 +252,10 @@ void Foam::advectiveFvPatchField::updateCoeffs() } else { - FatalErrorIn - ( - "advectiveFvPatchField::updateCoeffs()" - ) << " Unsupported temporal differencing scheme : " - << ddtScheme - << "\n on patch " << this->patch().name() + FatalErrorIn("advectiveFvPatchField::updateCoeffs()") + << " Unsupported temporal differencing scheme : " + << ddtScheme << nl + << " on patch " << this->patch().name() << " of field " << this->dimensionedInternalField().name() << " in file " << this->dimensionedInternalField().objectPath() << exit(FatalError); @@ -307,7 +309,7 @@ void Foam::advectiveFvPatchField::write(Ostream& os) const this->template writeEntryIfDifferent(os, "phi", "phi", phiName_); this->template writeEntryIfDifferent(os, "rho", "rho", rhoName_); - if (lInf_ > SMALL) + if (lInf_ > 0) { os.writeKeyword("fieldInf") << fieldInf_ << token::END_STATEMENT << nl; os.writeKeyword("lInf") << lInf_ << token::END_STATEMENT << nl; From 4c6d6a5731021d502faf510e70bea44a2cfc8272 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Mar 2012 10:05:41 +0000 Subject: [PATCH 012/317] ENH: Updates to the kinematic cloud API --- .../clouds/Templates/KinematicCloud/KinematicCloud.H | 3 +++ .../clouds/Templates/KinematicCloud/KinematicCloudI.H | 9 ++++++++- .../clouds/baseClasses/kinematicCloud/kinematicCloud.H | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 8ac910e301..7225347e60 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -456,6 +456,9 @@ public: // Check + //- Total number of parcels + inline label nParcels() const; + //- Total mass in system inline scalar massInSystem() const; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 94b95168a5..ab0e7ed940 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -227,6 +227,13 @@ Foam::KinematicCloud::UIntegrator() const } +template +inline Foam::label Foam::KinematicCloud::nParcels() const +{ + return this->size(); +} + + template inline Foam::scalar Foam::KinematicCloud::massInSystem() const { diff --git a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H index 7f72eae98f..01c80c16e2 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H @@ -36,6 +36,7 @@ SourceFiles #define kinematicCloud_H #include "typeInfo.H" +#include "volFieldsFwd.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From db3e9c00d294c070c92eb2d402afa82851b6c04d Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 Mar 2012 11:55:03 +0000 Subject: [PATCH 013/317] compressibleTwoPhaseEulerFoam: Updated virtual-mass formulation --- .../compressibleTwoPhaseEulerFoam/UEqns.H | 26 +++++++++++++------ .../compressibleTwoPhaseEulerFoam/pEqn.H | 7 +++-- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H index ed150abb88..ca2a5bf265 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/UEqns.H @@ -28,12 +28,17 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); U1Eqn = ( - (scalar(1) + Cvm*rho2*alpha2/rho1)* + fvm::ddt(alpha1, U1) + + fvm::div(alphaPhi1, U1) + - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) + + + Cvm*rho2*alpha1*alpha2/rho1* ( - fvm::ddt(alpha1, U1) - + fvm::div(alphaPhi1, U1) - - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) + fvm::ddt(U1) + + fvm::div(phi1, U1) + - fvm::Sp(fvc::div(phi1), U1) ) + - fvm::laplacian(alpha1*nuEff1, U1) + fvc::div(alpha1*Rc1) == @@ -54,12 +59,17 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); U2Eqn = ( - (scalar(1) + Cvm*rho2*alpha1/rho2)* + fvm::ddt(alpha2, U2) + + fvm::div(alphaPhi2, U2) + - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2) + + + Cvm*rho2*alpha1*alpha2/rho2* ( - fvm::ddt(alpha2, U2) - + fvm::div(alphaPhi2, U2) - - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2) + fvm::ddt(U2) + + fvm::div(phi2, U2) + - fvm::Sp(fvc::div(phi2), U2) ) + - fvm::laplacian(alpha2*nuEff2, U2) + fvc::div(alpha2*Rc2) == diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H index d2ef15776d..6c0d1e50f2 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H @@ -37,6 +37,9 @@ surfaceScalarField phiHbyA("phiHbyA", alpha1f*phiHbyA1 + alpha2f*phiHbyA2); + HbyA1 += (1.0/rho1)*rAU1*dragCoeff*U2; + HbyA2 += (1.0/rho2)*rAU2*dragCoeff*U1; + surfaceScalarField Dp ( "Dp", @@ -110,10 +113,7 @@ p.relax(); mSfGradp = pEqnIncomp.flux()/Dp; - volVectorField U10 = U1; - U1 = HbyA1 - + (1.0/rho1)*rAU1*dragCoeff*U2 + fvc::reconstruct ( rAlphaAU1f*(g & mesh.Sf()) @@ -122,7 +122,6 @@ U1.correctBoundaryConditions(); U2 = HbyA2 - + (1.0/rho2)*rAU2*dragCoeff*U10 + fvc::reconstruct ( rAlphaAU2f*(g & mesh.Sf()) From 2a81bbca22ffa5ab519569dc94e69656e9c27462 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 Mar 2012 11:55:37 +0000 Subject: [PATCH 014/317] multiphaseEulerFoam: Added comment about drag formulations --- applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 822e60d19a..f31717d379 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -115,6 +115,8 @@ (1.0/phase.rho())*rAUs[phasei]*(*dcIter()) *phase2Ptr->U(); + // Alternative flux-pressure consistent drag but not momentum conservative + // // HbyAs[phasei] += fvc::reconstruct // ( // fvc::interpolate From b8c9a087333d90c67c68df217367d307fe65c0a9 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 Mar 2012 11:56:21 +0000 Subject: [PATCH 015/317] compressibleTwoPhaseEulerFoam/bubbleColumn tutorial: changed liquid height to be consistent --- .../bubbleColumn/0/alpha1 | 752 +++++++++--------- .../bubbleColumn/system/setFieldsDict | 2 +- 2 files changed, 377 insertions(+), 377 deletions(-) diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 index 4d25044844..eda1e32100 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 @@ -17,7 +17,7 @@ FoamFile dimensions [0 0 0 0 0 0 0]; -internalField nonuniform List +internalField nonuniform List 1875 ( 0 @@ -970,381 +970,381 @@ internalField nonuniform List 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 1 1 1 diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict index 84545091c6..5b6d65bbec 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/system/setFieldsDict @@ -24,7 +24,7 @@ regions ( boxToCell { - box (0 0 -0.1) (0.15 0.501 0.1); + box (0 0 -0.1) (0.15 0.701 0.1); fieldValues ( volScalarFieldValue alpha1 0 From 1fdd95d1b451b0ddd91363f66fdc9d98b64a26f7 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 Mar 2012 11:56:47 +0000 Subject: [PATCH 016/317] compressibleTwoPhaseEulerFoam/bubbleColumn: changed liquid height --- .../compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 index eda1e32100..9a514b7807 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/alpha1 @@ -17,7 +17,7 @@ FoamFile dimensions [0 0 0 0 0 0 0]; -internalField nonuniform List +internalField nonuniform List 1875 ( 0 From a70398ae2c6ed31eff8cdc4a53e89b66e071a993 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 Mar 2012 11:57:55 +0000 Subject: [PATCH 017/317] Corrected line length --- applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index f31717d379..1c42c7b91a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -115,7 +115,8 @@ (1.0/phase.rho())*rAUs[phasei]*(*dcIter()) *phase2Ptr->U(); - // Alternative flux-pressure consistent drag but not momentum conservative + // Alternative flux-pressure consistent drag + // but not momentum conservative // // HbyAs[phasei] += fvc::reconstruct // ( From 0a21d025309ca7a4e95936f95de773fa6edc8156 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 15 Mar 2012 13:15:55 +0000 Subject: [PATCH 018/317] ENH: Added new cloudInfo function object --- src/postProcessing/functionObjects/Allwmake | 3 +- .../functionObjects/cloud/Make/files | 4 + .../functionObjects/cloud/Make/options | 9 + .../cloud/cloudInfo/IOcloudInfo.H | 49 +++++ .../cloud/cloudInfo/cloudInfo.C | 183 ++++++++++++++++++ .../cloud/cloudInfo/cloudInfo.H | 157 +++++++++++++++ .../cloud/cloudInfo/cloudInfoFunctionObject.C | 42 ++++ .../cloud/cloudInfo/cloudInfoFunctionObject.H | 54 ++++++ .../cloud/cloudInfo/postProcessingDict | 31 +++ 9 files changed, 531 insertions(+), 1 deletion(-) create mode 100644 src/postProcessing/functionObjects/cloud/Make/files create mode 100644 src/postProcessing/functionObjects/cloud/Make/options create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/IOcloudInfo.H create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.H create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfoFunctionObject.C create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfoFunctionObject.H create mode 100644 src/postProcessing/functionObjects/cloud/cloudInfo/postProcessingDict diff --git a/src/postProcessing/functionObjects/Allwmake b/src/postProcessing/functionObjects/Allwmake index e62cdf86c7..343d2bafc4 100755 --- a/src/postProcessing/functionObjects/Allwmake +++ b/src/postProcessing/functionObjects/Allwmake @@ -3,11 +3,12 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} set -x +wmake $makeType cloud wmake $makeType field wmake $makeType forces wmake $makeType IO -wmake $makeType utilities wmake $makeType jobControl wmake $makeType systemCall +wmake $makeType utilities # ----------------------------------------------------------------- end-of-file diff --git a/src/postProcessing/functionObjects/cloud/Make/files b/src/postProcessing/functionObjects/cloud/Make/files new file mode 100644 index 0000000000..e8515a0937 --- /dev/null +++ b/src/postProcessing/functionObjects/cloud/Make/files @@ -0,0 +1,4 @@ +cloudInfo/cloudInfo.C +cloudInfo/cloudInfoFunctionObject.C + +LIB = $(FOAM_LIBBIN)/libcloudFunctionObjects diff --git a/src/postProcessing/functionObjects/cloud/Make/options b/src/postProcessing/functionObjects/cloud/Make/options new file mode 100644 index 0000000000..7699961acc --- /dev/null +++ b/src/postProcessing/functionObjects/cloud/Make/options @@ -0,0 +1,9 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -llagrangian \ + -llagrangianIntermediate diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/IOcloudInfo.H b/src/postProcessing/functionObjects/cloud/cloudInfo/IOcloudInfo.H new file mode 100644 index 0000000000..6e0eda072a --- /dev/null +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/IOcloudInfo.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 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 . + +Typedef + Foam::IOcloudInfo + +Description + Instance of the generic IOOutputFilter for cloudInfo. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOcloudInfo_H +#define IOcloudInfo_H + +#include "cloudInfo.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOcloudInfo; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C new file mode 100644 index 0000000000..6c5c6c5af4 --- /dev/null +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C @@ -0,0 +1,183 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 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 "cloudInfo.H" +#include "dictionary.H" +#include "kinematicCloud.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::cloudInfo, 0); + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +void Foam::cloudInfo::makeFiles() +{ + if (debug) + { + Info<< "Creating cloudInfo output files." << endl; + } + + outputFilePtr_.clear(); + outputFilePtr_.setSize(cloudSet_.size()); + + if (Pstream::master()) + { + label i = 0; + forAllConstIter(wordHashSet, cloudSet_, iter) + { + const word& cloudName = iter.key(); + fileName cloudInfoDir(obr_.time().path()); + word timeName = Foam::name(obr_.time().startTime().value()); + + if (Pstream::parRun()) + { + // Put in undecomposed case (Note: gives problems for + // distributed data running) + cloudInfoDir = cloudInfoDir/".."/name_/timeName; + } + else + { + cloudInfoDir = cloudInfoDir/name_/timeName; + } + + // Create directory if does not exist + mkDir(cloudInfoDir); + + // Open new files at start up + outputFilePtr_.set + ( + i, + new OFstream(cloudInfoDir/(cloudName + ".dat")) + ); + + // Add headers + outputFilePtr_[i] + << "# Time" << tab << "nParcels" << tab << "mass" << endl; + + i++; + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::cloudInfo::cloudInfo +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + cloudSet_(), + outputFilePtr_() +{ + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::cloudInfo::~cloudInfo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::cloudInfo::read(const dictionary& dict) +{ + if (active_) + { + cloudSet_.insert(wordList(dict.lookup("clouds"))); + + Info<< type() << ": "; + if (cloudSet_.size()) + { + Info<< "applying to clouds:" << nl; + forAllConstIter(wordHashSet, cloudSet_, iter) + { + Info<< " " << iter.key() << nl; + } + Info<< endl; + + makeFiles(); + } + else + { + Info<< "no clouds to be processed" << nl << endl; + } + } +} + + +void Foam::cloudInfo::execute() +{ + // Do nothing +} + + +void Foam::cloudInfo::end() +{ + // Do nothing +} + + +void Foam::cloudInfo::write() +{ + if (active_) + { + label i = 0; + forAllConstIter(wordHashSet, cloudSet_, iter) + { + const word& cloudName = iter.key(); + + const kinematicCloud& cloud = + obr_.lookupObject(cloudName); + + label nParcels = returnReduce(cloud.nParcels(), sumOp