diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C index 7db661b48e..07cd9cb307 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,6 +59,7 @@ Foam::SRF::SRFModel::SRFModel ), Urel_(Urel), mesh_(Urel_.mesh()), + origin_("origin", dimLength, lookup("origin")), axis_(lookup("axis")), SRFModelCoeffs_(subDict(type + "Coeffs")), omega_(dimensionedVector("omega", dimless/dimTime, vector::zero)) @@ -80,6 +81,9 @@ bool Foam::SRF::SRFModel::read() { if (regIOobject::read()) { + // Re-read origin + lookup("origin") >> origin_; + // Re-read axis lookup("axis") >> axis_; axis_ /= mag(axis_); @@ -96,6 +100,12 @@ bool Foam::SRF::SRFModel::read() } +const Foam::dimensionedVector& Foam::SRF::SRFModel::origin() const +{ + return origin_; +} + + const Foam::vector& Foam::SRF::SRFModel::axis() const { return axis_; @@ -144,7 +154,7 @@ Foam::SRF::SRFModel::Fcentrifugal() const IOobject::NO_READ, IOobject::NO_WRITE ), - omega_ ^ (omega_ ^ mesh_.C()) + omega_ ^ (omega_ ^ (mesh_.C() - origin_)) ) ); } @@ -163,7 +173,11 @@ Foam::vectorField Foam::SRF::SRFModel::velocity ) const { tmp tfld = - omega_.value() ^ (positions - axis_*(axis_ & positions)); + omega_.value() + ^ ( + (positions - origin_.value()) + - axis_*(axis_ & (positions - origin_.value())) + ); return tfld(); } @@ -183,7 +197,8 @@ Foam::tmp Foam::SRF::SRFModel::U() const IOobject::NO_READ, IOobject::NO_WRITE ), - omega_ ^ (mesh_.C() - axis_*(axis_ & mesh_.C())) + omega_ + ^ ((mesh_.C() - origin_) - axis_*(axis_ & (mesh_.C() - origin_))) ) ); } diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H index 1349658725..35c0a0dea4 100644 --- a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.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-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -75,6 +75,9 @@ protected: //- Reference to the mesh const fvMesh& mesh_; + //- Origin of the axis + dimensionedVector origin_; + //- Axis of rotation, a direction vector which passes through the origin vector axis_; @@ -149,6 +152,9 @@ public: // Access + //- Return the origin of rotation + const dimensionedVector& origin() const; + //- Return the axis of rotation const vector& axis() const; diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties index 82b1b527e8..b79bfdaaa1 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/constant/SRFProperties @@ -17,6 +17,7 @@ FoamFile SRFModel rpm; +origin (0 0 0); axis (0 0 1); rpmCoeffs diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/constant/SRFProperties b/tutorials/incompressible/SRFSimpleFoam/mixer/constant/SRFProperties index f1c75ba0e8..b62212066e 100644 --- a/tutorials/incompressible/SRFSimpleFoam/mixer/constant/SRFProperties +++ b/tutorials/incompressible/SRFSimpleFoam/mixer/constant/SRFProperties @@ -17,7 +17,8 @@ FoamFile SRFModel rpm; -axis ( 0 0 1 ); +origin (0 0 0); +axis (0 0 1); rpmCoeffs {