View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000708||OpenFOAM||Bug||public||2012-12-21 08:33||2014-05-09 15:29|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Summary||0000708: Cylindrical coordinate transformation|
|Description||I belive there is an error in the file src/meshTools/coordinateSystems/cylindricalCS.C . The functions for transforming vector fields does not make sense to me. It seems as if the coordinate transformation for a single vector:|
x=r*cos(theta), y=r*sin(theta), z=z
r=sqrt(sq(x)+sq(y)), theta=atan2(y,x), z=z
are used also for the transformation of vector fields. The correct basis vector relationships to be used when transforming vector fields are:
I have not checked, but I think this bug could be present also in CS-transformations e.g. the one for spherical coords.
|Tags||No tags attached.|
|I think that transformation only make sense when dealing with points, but it is not correct for vector or vector fields. For vector and vector fields I think that the transformation is the same.|
The transformation is defined by the rotation tensor (R), which is build
at the constructor of the coordinate system using the axes provided to the
constructor. cylindricalCS only changes from cartesian (x,y,z) to cylindrical (theta, phi, z) or the inverse. R is applied to the cartesian vector.
I don't think I understand what you mean. But from what I can see in the code cylindricalCS cannot be used to convert e.g. a cartesian velocity field (U V W) to a cylindrical velocity field (U_theta U_r U_z). What the code can is converting one or many position vectors (x y z) to (theta r z).
This is perhaps intentional but it is a bit confusing for me. And functionality in OF for transforming vector fields (to e.g. cyl-coords) would be quite useful.
For example: New functionality rotorDiskSource uses cylindricalCS with the intention to transform a vector field U from cartesian coordinate system to cylindrical coordinates system.
I am playing with this new functionality known in Fluent as Virtual Blade Model and if using the original code the forces perpendicular to the rotor plane are not axisymmetric because tangential component of the vector ( velocity vector or localForce vector) is taken as if it is an angle (phi).
Any news about this "bug"?
Sergio, referring to the rotorDiskSource, the code says:
// velocity in local cylindrical reference frame
vector Uc = coordSys_.localVector(U[cellI]);
// transform from rotor cylindrical into local coning system
Uc = R_[i] & Uc;
// set radial component of velocity to zero
Uc.x() = 0.0;
// set blade normal component of velocity
Uc.y() = radius*omega_ - Uc.y();
rotation tensor R_[i] is not applied to the cartesian vector but it is applied to the cylindrical vector. The way in which R_[i] is constructed, it changes from planar( cylindrical) to local coning system.
const vectorField& global,
const vectorField lc
tmp<vectorField> tresult(new vectorField(lc.size()));
vectorField& result = tresult();
sqrt(sqr(lc.component(vector::X)) + sqr(lc.component(vector::Y)))
)*(inDegrees_ ? 180.0/constant::mathematical::pi : 1.0)
Excuse me but I think that this is valid for points, not for vector fields
This is fixed on commit fe8de9c92bc929e515c17baaea55c95fc6300297
Thanks for the report
|2012-12-21 08:33||olle||New Issue|
||Note Added: 0002272|
||Note Added: 0002274|
|2013-06-12 13:38||olle||Note Added: 0002275|
||Note Added: 0002277|
||Note Added: 0003049|
||Note Added: 0003050|
||Status||new => resolved|
||Resolution||open => fixed|
||Assigned To||=> user21|