Rename localAxesRotation -> cylindrical

This class does not simply rotate the coordinate system is also changes
it from Cartesian to cylindrical which is not clear from the original name.

We plan to rewrite the coordinateRotation classes to be
coordinateTransformation classes and massively simplify the interface
from the currently unintelligible mess.
This commit is contained in:
Henry Weller
2015-08-13 09:25:28 +01:00
parent fbb330414b
commit 573e8a891f
8 changed files with 70 additions and 70 deletions

View File

@ -334,9 +334,9 @@ void Foam::fv::rotorDiskSource::createCoordinateSystem()
coeffs_.lookup("refDirection") >> refDir; coeffs_.lookup("refDirection") >> refDir;
localAxesRotation_.reset cylindrical_.reset
( (
new localAxesRotation new cylindrical
( (
mesh_, mesh_,
axis, axis,
@ -357,9 +357,9 @@ void Foam::fv::rotorDiskSource::createCoordinateSystem()
coeffs_.lookup("axis") >> axis; coeffs_.lookup("axis") >> axis;
coeffs_.lookup("refDirection") >> refDir; coeffs_.lookup("refDirection") >> refDir;
localAxesRotation_.reset cylindrical_.reset
( (
new localAxesRotation new cylindrical
( (
mesh_, mesh_,
axis, axis,
@ -491,7 +491,7 @@ Foam::fv::rotorDiskSource::rotorDiskSource
invR_(cells_.size(), I), invR_(cells_.size(), I),
area_(cells_.size(), 0.0), area_(cells_.size(), 0.0),
coordSys_(false), coordSys_(false),
localAxesRotation_(), cylindrical_(),
rMax_(0.0), rMax_(0.0),
trim_(trimModel::New(*this, coeffs_)), trim_(trimModel::New(*this, coeffs_)),
blade_(coeffs_.subDict("blade")), blade_(coeffs_.subDict("blade")),

View File

@ -103,7 +103,7 @@ SourceFiles
#include "cellSetOption.H" #include "cellSetOption.H"
#include "cylindricalCS.H" #include "cylindricalCS.H"
#include "localAxesRotation.H" #include "cylindrical.H"
#include "NamedEnum.H" #include "NamedEnum.H"
#include "bladeModel.H" #include "bladeModel.H"
#include "profileModelList.H" #include "profileModelList.H"
@ -201,7 +201,7 @@ protected:
cylindricalCS coordSys_; cylindricalCS coordSys_;
//- Rotor transformation co-ordinate system //- Rotor transformation co-ordinate system
autoPtr<localAxesRotation> localAxesRotation_; autoPtr<cylindrical> cylindrical_;
//- Maximum radius //- Maximum radius
scalar rMax_; scalar rMax_;

View File

@ -59,7 +59,7 @@ void Foam::fv::rotorDiskSource::calculate
const scalar radius = x_[i].x(); const scalar radius = x_[i].x();
// Transform velocity into local cylindrical reference frame // Transform velocity into local cylindrical reference frame
vector Uc = localAxesRotation_->invTransform(U[cellI], i); vector Uc = cylindrical_->invTransform(U[cellI], i);
// Transform velocity into local coning system // Transform velocity into local coning system
Uc = R_[i] & Uc; Uc = R_[i] & Uc;
@ -132,7 +132,7 @@ void Foam::fv::rotorDiskSource::calculate
localForce = invR_[i] & localForce; localForce = invR_[i] & localForce;
// Transform force into global Cartesian co-ordinate system // Transform force into global Cartesian co-ordinate system
force[cellI] = localAxesRotation_->transform(localForce, i); force[cellI] = cylindrical_->transform(localForce, i);
if (divideVolume) if (divideVolume)
{ {

View File

@ -20,7 +20,7 @@ $(csys)/coordinateRotation/coordinateRotation.C
$(csys)/coordinateRotation/coordinateRotationNew.C $(csys)/coordinateRotation/coordinateRotationNew.C
$(csys)/coordinateRotation/EulerCoordinateRotation.C $(csys)/coordinateRotation/EulerCoordinateRotation.C
$(csys)/coordinateRotation/STARCDCoordinateRotation.C $(csys)/coordinateRotation/STARCDCoordinateRotation.C
$(csys)/coordinateRotation/localAxesRotation.C $(csys)/coordinateRotation/cylindrical.C
edgeFaceCirculator/edgeFaceCirculator.C edgeFaceCirculator/edgeFaceCirculator.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ Description
Types of coordinateRotation: Types of coordinateRotation:
1) axesRotation 1) axesRotation
2) STARCDRotation 2) STARCDRotation
3) localAxesRotation 3) cylindrical
4) EulerCoordinateRotation 4) EulerCoordinateRotation

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "localAxesRotation.H" #include "cylindrical.H"
#include "axesRotation.H" #include "axesRotation.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "polyMesh.H" #include "polyMesh.H"
@ -33,17 +33,17 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(localAxesRotation, 0); defineTypeNameAndDebug(cylindrical, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
coordinateRotation, coordinateRotation,
localAxesRotation, cylindrical,
dictionary dictionary
); );
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
coordinateRotation, coordinateRotation,
localAxesRotation, cylindrical,
objectRegistry objectRegistry
); );
} }
@ -51,7 +51,7 @@ namespace Foam
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void Foam::localAxesRotation::init void Foam::cylindrical::init
( (
const objectRegistry& obr, const objectRegistry& obr,
const List<label>& cells const List<label>& cells
@ -92,7 +92,7 @@ void Foam::localAxesRotation::init
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::localAxesRotation::localAxesRotation Foam::cylindrical::cylindrical
( (
const dictionary& dict, const dictionary& dict,
const objectRegistry& obr const objectRegistry& obr
@ -115,7 +115,7 @@ Foam::localAxesRotation::localAxesRotation
} }
Foam::localAxesRotation::localAxesRotation Foam::cylindrical::cylindrical
( (
const objectRegistry& obr, const objectRegistry& obr,
const vector& axis, const vector& axis,
@ -130,7 +130,7 @@ Foam::localAxesRotation::localAxesRotation
} }
Foam::localAxesRotation::localAxesRotation Foam::cylindrical::cylindrical
( (
const objectRegistry& obr, const objectRegistry& obr,
const vector& axis, const vector& axis,
@ -146,14 +146,14 @@ Foam::localAxesRotation::localAxesRotation
} }
Foam::localAxesRotation::localAxesRotation(const dictionary& dict) Foam::cylindrical::cylindrical(const dictionary& dict)
: :
Rptr_(), Rptr_(),
origin_(), origin_(),
e3_() e3_()
{ {
FatalErrorIn("localAxesRotation(const dictionary&)") FatalErrorIn("cylindrical(const dictionary&)")
<< " localAxesRotation can not be constructed from dictionary " << " cylindrical can not be constructed from dictionary "
<< " use the construtctor : " << " use the construtctor : "
"(" "("
" const dictionary&, const objectRegistry&" " const dictionary&, const objectRegistry&"
@ -162,7 +162,7 @@ Foam::localAxesRotation::localAxesRotation(const dictionary& dict)
} }
Foam::localAxesRotation::localAxesRotation(const tensorField& R) Foam::cylindrical::cylindrical(const tensorField& R)
: :
Rptr_(), Rptr_(),
origin_(vector::zero), origin_(vector::zero),
@ -174,7 +174,7 @@ Foam::localAxesRotation::localAxesRotation(const tensorField& R)
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::localAxesRotation::clear() void Foam::cylindrical::clear()
{ {
if (!Rptr_.empty()) if (!Rptr_.empty())
{ {
@ -183,7 +183,7 @@ void Foam::localAxesRotation::clear()
} }
void Foam::localAxesRotation::updateCells void Foam::cylindrical::updateCells
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& cells const labelList& cells
@ -203,7 +203,7 @@ void Foam::localAxesRotation::updateCells
} }
Foam::tmp<Foam::vectorField> Foam::localAxesRotation::transform Foam::tmp<Foam::vectorField> Foam::cylindrical::transform
( (
const vectorField& vf const vectorField& vf
) const ) const
@ -212,7 +212,7 @@ Foam::tmp<Foam::vectorField> Foam::localAxesRotation::transform
{ {
FatalErrorIn FatalErrorIn
( (
"tmp<vectorField> localAxesRotation::transform(const vectorField&)" "tmp<vectorField> cylindrical::transform(const vectorField&)"
) )
<< "vectorField st has different size to tensorField " << "vectorField st has different size to tensorField "
<< abort(FatalError); << abort(FatalError);
@ -222,17 +222,17 @@ Foam::tmp<Foam::vectorField> Foam::localAxesRotation::transform
} }
Foam::vector Foam::localAxesRotation::transform(const vector& v) const Foam::vector Foam::cylindrical::transform(const vector& v) const
{ {
notImplemented notImplemented
( (
"vector localAxesRotation::transform(const vector&) const" "vector cylindrical::transform(const vector&) const"
); );
return vector::zero; return vector::zero;
} }
Foam::vector Foam::localAxesRotation::transform Foam::vector Foam::cylindrical::transform
( (
const vector& v, const vector& v,
const label cmptI const label cmptI
@ -242,7 +242,7 @@ Foam::vector Foam::localAxesRotation::transform
} }
Foam::tmp<Foam::vectorField> Foam::localAxesRotation::invTransform Foam::tmp<Foam::vectorField> Foam::cylindrical::invTransform
( (
const vectorField& vf const vectorField& vf
) const ) const
@ -251,17 +251,17 @@ Foam::tmp<Foam::vectorField> Foam::localAxesRotation::invTransform
} }
Foam::vector Foam::localAxesRotation::invTransform(const vector& v) const Foam::vector Foam::cylindrical::invTransform(const vector& v) const
{ {
notImplemented notImplemented
( (
"vector localAxesRotation::invTransform(const vector&) const" "vector cylindrical::invTransform(const vector&) const"
); );
return vector::zero; return vector::zero;
} }
Foam::vector Foam::localAxesRotation::invTransform Foam::vector Foam::cylindrical::invTransform
( (
const vector& v, const vector& v,
const label cmptI const label cmptI
@ -271,7 +271,7 @@ Foam::vector Foam::localAxesRotation::invTransform
} }
Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor Foam::tmp<Foam::tensorField> Foam::cylindrical::transformTensor
( (
const tensorField& tf const tensorField& tf
) const ) const
@ -280,7 +280,7 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
{ {
FatalErrorIn FatalErrorIn
( (
"tmp<tensorField> localAxesRotation::transformTensor" "tmp<tensorField> cylindrical::transformTensor"
"(" "("
"const tensorField&" "const tensorField&"
")" ")"
@ -292,21 +292,21 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
} }
Foam::tensor Foam::localAxesRotation::transformTensor Foam::tensor Foam::cylindrical::transformTensor
( (
const tensor& t const tensor& t
) const ) const
{ {
notImplemented notImplemented
( (
"tensor localAxesRotation::transformTensor(const tensor&) const" "tensor cylindrical::transformTensor(const tensor&) const"
); );
return tensor::zero; return tensor::zero;
} }
Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor Foam::tmp<Foam::tensorField> Foam::cylindrical::transformTensor
( (
const tensorField& tf, const tensorField& tf,
const labelList& cellMap const labelList& cellMap
@ -316,7 +316,7 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
{ {
FatalErrorIn FatalErrorIn
( (
"tmp<tensorField> localAxesRotation::transformTensor" "tmp<tensorField> cylindrical::transformTensor"
"(" "("
"const tensorField&, " "const tensorField&, "
"const labelList&" "const labelList&"
@ -340,14 +340,14 @@ Foam::tmp<Foam::tensorField> Foam::localAxesRotation::transformTensor
} }
Foam::tmp<Foam::symmTensorField> Foam::localAxesRotation::transformVector Foam::tmp<Foam::symmTensorField> Foam::cylindrical::transformVector
( (
const vectorField& vf const vectorField& vf
) const ) const
{ {
if (Rptr_->size() != vf.size()) if (Rptr_->size() != vf.size())
{ {
FatalErrorIn("localAxesRotation::transformVector(const vectorField&)") FatalErrorIn("cylindrical::transformVector(const vectorField&)")
<< "tensorField vf has different size to tensorField Tr" << "tensorField vf has different size to tensorField Tr"
<< abort(FatalError); << abort(FatalError);
} }
@ -364,20 +364,20 @@ Foam::tmp<Foam::symmTensorField> Foam::localAxesRotation::transformVector
} }
Foam::symmTensor Foam::localAxesRotation::transformVector Foam::symmTensor Foam::cylindrical::transformVector
( (
const vector& v const vector& v
) const ) const
{ {
notImplemented notImplemented
( (
"tensor localAxesRotation::transformVector(const vector&) const" "tensor cylindrical::transformVector(const vector&) const"
); );
return symmTensor::zero; return symmTensor::zero;
} }
void Foam::localAxesRotation::write(Ostream& os) const void Foam::cylindrical::write(Ostream& os) const
{ {
os.writeKeyword("e3") << e3() << token::END_STATEMENT << nl; os.writeKeyword("e3") << e3() << token::END_STATEMENT << nl;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::localAxesRotation Foam::cylindrical
Description Description
A local coordinate rotation. A local coordinate rotation.
@ -34,7 +34,7 @@ Description
(cylindrical coordinates) (cylindrical coordinates)
\verbatim \verbatim
localAxesRotation cylindrical
{ {
type localAxes; type localAxes;
e3 (0 0 1); e3 (0 0 1);
@ -45,8 +45,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef localAxesRotation_H #ifndef cylindrical_H
#define localAxesRotation_H #define cylindrical_H
#include "point.H" #include "point.H"
#include "vector.H" #include "vector.H"
@ -58,10 +58,10 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class localAxesRotation Declaration Class cylindrical Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class localAxesRotation class cylindrical
: :
public coordinateRotation public coordinateRotation
{ {
@ -90,15 +90,15 @@ class localAxesRotation
public: public:
//- Runtime type information //- Runtime type information
TypeName("localAxesRotation"); TypeName("cylindrical");
// Constructors // Constructors
//- Construct from dictionary and objectRegistry //- Construct from dictionary and objectRegistry
localAxesRotation(const dictionary&, const objectRegistry&); cylindrical(const dictionary&, const objectRegistry&);
//- Construct from components for all cells //- Construct from components for all cells
localAxesRotation cylindrical
( (
const objectRegistry&, const objectRegistry&,
const vector& axis, const vector& axis,
@ -106,7 +106,7 @@ public:
); );
//- Construct from components for list of cells //- Construct from components for list of cells
localAxesRotation cylindrical
( (
const objectRegistry&, const objectRegistry&,
const vector& axis, const vector& axis,
@ -115,20 +115,20 @@ public:
); );
//- Construct from dictionary //- Construct from dictionary
localAxesRotation(const dictionary&); cylindrical(const dictionary&);
//- Construct from tensor Field //- Construct from tensor Field
localAxesRotation(const tensorField&); cylindrical(const tensorField&);
//- Return clone //- Return clone
autoPtr<localAxesRotation> clone() const autoPtr<cylindrical> clone() const
{ {
return autoPtr<localAxesRotation>(new localAxesRotation(*this)); return autoPtr<cylindrical>(new cylindrical(*this));
} }
//- Destructor //- Destructor
virtual ~localAxesRotation() virtual ~cylindrical()
{} {}
@ -143,28 +143,28 @@ public:
//- Return local-to-global transformation tensor //- Return local-to-global transformation tensor
virtual const tensor& R() const virtual const tensor& R() const
{ {
notImplemented("const tensor& localAxesRotation::R() const"); notImplemented("const tensor& cylindrical::R() const");
return tensor::zero; return tensor::zero;
} }
//- Return global-to-local transformation tensor //- Return global-to-local transformation tensor
virtual const tensor& Rtr() const virtual const tensor& Rtr() const
{ {
notImplemented("const tensor& localAxesRotation::Rtr() const"); notImplemented("const tensor& cylindrical::Rtr() const");
return tensor::zero; return tensor::zero;
} }
//- Return local Cartesian x-axis //- Return local Cartesian x-axis
virtual const vector e1() const virtual const vector e1() const
{ {
notImplemented("const tensor& localAxesRotation::e1() const"); notImplemented("const tensor& cylindrical::e1() const");
return vector::zero; return vector::zero;
} }
//- Return local Cartesian y-axis //- Return local Cartesian y-axis
virtual const vector e2() const virtual const vector e2() const
{ {
notImplemented("const tensor& localAxesRotation::e2() const"); notImplemented("const tensor& cylindrical::e2() const");
return vector::zero; return vector::zero;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ Description
origin (0 0 0); origin (0 0 0);
coordinateRotation coordinateRotation
{ {
type localAxesRotation; type cylindrical;
e3 (0 0 1); e3 (0 0 1);
} }
} }
@ -45,7 +45,7 @@ Description
Types of coordinateRotation: Types of coordinateRotation:
1) axesRotation 1) axesRotation
2) STARCDRotation 2) STARCDRotation
3) localAxesRotation 3) cylindrical
4) EulerCoordinateRotation 4) EulerCoordinateRotation
Type of co-ordinates: Type of co-ordinates: