From a6e735e5ce1d0691778b5a41a3a6d5e199592656 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 18 Jul 2018 19:41:32 +0200 Subject: [PATCH 1/3] TUT: samplingDebug was left enabled in tutorial (and missing a file) --- .../squareBend/constant/triSurface/angledPlane.obj | 11 +++++++++++ .../simpleFoam/squareBend/system/controlDict | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tutorials/incompressible/simpleFoam/squareBend/constant/triSurface/angledPlane.obj diff --git a/tutorials/incompressible/simpleFoam/squareBend/constant/triSurface/angledPlane.obj b/tutorials/incompressible/simpleFoam/squareBend/constant/triSurface/angledPlane.obj new file mode 100644 index 0000000000..2a92675594 --- /dev/null +++ b/tutorials/incompressible/simpleFoam/squareBend/constant/triSurface/angledPlane.obj @@ -0,0 +1,11 @@ +# An angled plane that extends beyond the geometry +o angledPlane + +v -0.03 -0.08 -0.03 +v -0.03 -0.08 0.03 +v -0.07 -0.02 0.03 +v -0.07 -0.02 -0.03 + +f 1 2 4 +f 2 3 4 +# EOF diff --git a/tutorials/incompressible/simpleFoam/squareBend/system/controlDict b/tutorials/incompressible/simpleFoam/squareBend/system/controlDict index 6d2125f4ee..8e00bf274e 100644 --- a/tutorials/incompressible/simpleFoam/squareBend/system/controlDict +++ b/tutorials/incompressible/simpleFoam/squareBend/system/controlDict @@ -52,7 +52,7 @@ runTimeModifiable true; functions { #include "sampling" - #include "samplingDebug" + // #include "samplingDebug" } From e190ff8dcacc7b563f7f80ac0ab81149f551f530 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 20 Jul 2018 08:14:58 +0200 Subject: [PATCH 2/3] BUG: incorrect swirlFan tangential velocity calculation (closes #945) - missing indexing caused the real radius to be largely ignored when useRealRadius = true --- .../swirlFanVelocityFvPatchField.C | 16 +++++++----- .../swirlFanVelocityFvPatchField.H | 26 ++++++++++--------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C index acd85ee22e..2f95522a5c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C @@ -70,14 +70,17 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump() if (useRealRadius_) { - const scalarField rMag(mag(patch().Cf() - origin_)); - forAll (rMag, i) + const vectorField& pCf = patch().Cf(); + + forAll(pCf, i) { - if (rMag[i] > rInner_ && rMag[i] < rOuter_) + const scalar rMag = mag(pCf[i] - origin_); + + if (rMag > rInner_ && rMag < rOuter_) { - magTangU = - deltaP - /rMag[i] + magTangU[i] = + deltaP[i] + /rMag /fanEff_ /(rpm_*constant::mathematical::pi/30.0); } @@ -95,6 +98,7 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump() magTangU = deltaP/rEff_/fanEff_/(rpm_*constant::mathematical::pi/30.0); } + // Calculate the tangential velocity const vectorField tangentialVelocity(magTangU*tanDir); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H index ed8cc6f52b..a9f6933258 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.H @@ -32,36 +32,39 @@ Description cyclic pressure jump condition and applies a transformation to U. The U-jump is specified with a swirl component as follows: - + \verbatim Utan = deltaP/rEff/fanEff/(rpm*pi/30.0); - where: + where deltaP : pressure drop across the cyclic. rEff : effective radius fanEff : fan efficiency coefficient - rmp : RPM of the fan + rpm : RPM of the fan + \endverbatim Alternatively an inner and outer radii can be used instead of rEff. The Utan is as follow for r > rInner and r < rOuter - + \verbatim Utan = deltaP/r/fanEff/(rpm/pi/30.0); - where: + where r : p - origin, p is the face center + \endverbatim Outside rInner and rOuter, Utan = 0. The input for this mode is: - + \verbatim useRealRadius true; rInner 0.005; rOuter 0.01; + \endverbatim The radial velocity is zero in the present model. Usage \table - Property | Description | Required | Default value + Property | Description | Required | Default patchType | underlying patch type should be \c cyclic| yes | phi | flux field name | no | phi rho | density field name | no | rho @@ -79,7 +82,7 @@ Usage \verbatim { - cyclicFaces_master + cyclicFaces_master { type swirlFanVelocity; patchType cyclic; @@ -91,7 +94,6 @@ Usage } \endverbatim - SourceFiles swirlFanVelocityFvPatchField.C @@ -117,7 +119,6 @@ class swirlFanVelocityFvPatchField { // Private data - //- Name of the flux field const word phiName_; @@ -178,7 +179,8 @@ public: const dictionary& ); - //- Construct by mapping given swirlFanVelocityFvPatchField onto a new patch + //- Construct by mapping given swirlFanVelocityFvPatchField + //- onto a new patch swirlFanVelocityFvPatchField ( const swirlFanVelocityFvPatchField&, @@ -228,7 +230,7 @@ public: virtual void updateCoeffs(); //- Write - virtual void write(Ostream&) const; + virtual void write(Ostream& os) const; }; From 76dcf39eab73ac903ce9810c24eb7ba79982ef9f Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 23 Jul 2018 20:19:07 +0200 Subject: [PATCH 3/3] BUG: incorrect lookup name for lumpedMotion scaling parameter (fixes #949) --- src/lumpedPointMotion/lumpedPointMovement.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lumpedPointMotion/lumpedPointMovement.C b/src/lumpedPointMotion/lumpedPointMovement.C index 00c34c7209..c96e9f53fb 100644 --- a/src/lumpedPointMotion/lumpedPointMovement.C +++ b/src/lumpedPointMotion/lumpedPointMovement.C @@ -54,7 +54,7 @@ const Foam::Enum > Foam::lumpedPointMovement::scalingNames { - { scalingType::LENGTH, "plain" }, + { scalingType::LENGTH, "length" }, { scalingType::FORCE, "force" }, { scalingType::MOMENT, "moment" } };