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

View File

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

View File

@ -59,7 +59,7 @@ void Foam::fv::rotorDiskSource::calculate
const scalar radius = x_[i].x();
// 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
Uc = R_[i] & Uc;
@ -132,7 +132,7 @@ void Foam::fv::rotorDiskSource::calculate
localForce = invR_[i] & localForce;
// Transform force into global Cartesian co-ordinate system
force[cellI] = localAxesRotation_->transform(localForce, i);
force[cellI] = cylindrical_->transform(localForce, i);
if (divideVolume)
{

View File

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

View File

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

View File

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

View File

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

View File

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