From dcc1dc1383cc82d03caa49b8b2be2a4303dce885 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 24 Sep 2018 11:31:04 +0200 Subject: [PATCH 01/43] ENH: cylindricalCS is now in radians only (issue #863) - this provides internal consistency and allows direct use of the coordinate angle with sin(), cos() functions. It eliminates potential issues that could otherwise arise from alternative user input. Eg, in mixerFvMesh it would have previously been possible to specify the coordinate system to use degrees or radians, but these units were not checked when determining the tangential sweep positions. NOTE: this may represent a breaking change if user coding has been relying on cylindrical coordinate system in degrees. --- .../derived/rotorDiskSource/rotorDiskSource.C | 4 +- .../derived/rotorDiskSource/rotorDiskSource.H | 4 +- .../ParticleCollector/ParticleCollector.C | 4 +- .../blockMesh/blockEdges/arcEdge/arcEdge.C | 9 +- .../blockMesh/blockEdges/arcEdge/arcEdge.H | 2 +- .../coordinate/systems/cylindricalCS.C | 180 ++++++++---------- .../coordinate/systems/cylindricalCS.H | 35 +--- .../mixerFvMesh/mixerFvMesh.C | 18 +- 8 files changed, 113 insertions(+), 143 deletions(-) diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C index 851cc93315..106d52aaf4 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.C @@ -381,7 +381,7 @@ void Foam::fv::rotorDiskSource::createCoordinateSystem() } } - coordSys_ = cylindricalCS("rotorCoordSys", origin, axis, refDir, false); + coordSys_ = cylindricalCS("rotorCS", origin, axis, refDir); const scalar sumArea = gSum(area_); const scalar diameter = Foam::sqrt(4.0*sumArea/mathematical::pi); @@ -483,7 +483,7 @@ Foam::fv::rotorDiskSource::rotorDiskSource R_(cells_.size(), I), invR_(cells_.size(), I), area_(cells_.size(), 0.0), - coordSys_(false), + coordSys_(), cylindrical_(), rMax_(0.0), trim_(trimModel::New(*this, coeffs_)), diff --git a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H index 611a26b775..f63916bf22 100644 --- a/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H +++ b/src/fvOptions/sources/derived/rotorDiskSource/rotorDiskSource.H @@ -196,7 +196,7 @@ protected: //- Area [m2] List area_; - //- Rotor local cylindrical coordinate system (r, theta, z) + //- Rotor local cylindrical coordinate system (r-theta-z) cylindricalCS coordSys_; //- Rotor transformation coordinate system @@ -279,7 +279,7 @@ public: // (Cylindrical r, theta, z) inline const List& x() const; - //- Return the rotor coordinate system (r, theta, z) + //- Return the rotor coordinate system (r-theta-z) inline const cylindricalCS& coordSys() const; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C index 988eca02c4..42613d5e8b 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleCollector/ParticleCollector.C @@ -207,7 +207,7 @@ void Foam::ParticleCollector::initConcentricCircles() faces_.setSize(nFace); area_.setSize(nFace); - coordSys_ = cylindricalCS("coordSys", origin, normal_[0], refDir, false); + coordSys_ = cylindricalCS("collector", origin, normal_[0], refDir); List