Skip to content

Commit

Permalink
functionObjects::cylindrical: Corrected normalisation of axes
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Bainbridge committed Feb 28, 2024
1 parent c7c47ff commit bc5adc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -49,13 +49,12 @@ namespace functionObjects

Foam::tensor Foam::functionObjects::cylindrical::R(const vector& p) const
{
vector dir = p - origin_;
dir /= mag(dir) + vSmall;
const vector dir = normalised(p - origin_);

const vector axis = axis_/mag(axis_);
const vector axis = normalised(axis_);
const vector r = dir - (dir & axis)*axis;

return tensor(r, axis^r, axis);
return tensor(normalised(r), normalised(axis^r), axis);
}


Expand Down
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -53,12 +53,8 @@ Foam::tensor Foam::cylindrical::R(const vector& p) const
// If the point is on the axis choose any radial direction
return axesRotation(axis, perpendicular(axis)).R();
}
else
{
return axesRotation(axis, dir).R();
}

return tensor(r, axis^r, axis);
return axesRotation(axis, dir).R();
}


Expand Down

0 comments on commit bc5adc2

Please sign in to comment.