About the bug in cylindricalCS (compiled in OpenFOAM 4.0)
Quote:
I changed it to forAll (ccCyl.internalField(), i) { ccCyl.ref()[i]=cyl.localVector(cc.internalField()[i]); } Now it can compile successfully, but any better way to modify it? Thanks. Best regards, Enzu |
convertToCylindrical for OF4.0
1 Attachment(s)
Hello Enzu
please find my adaption to OF4.0 in the attachment. sitajeje |
Thanks, Sitajeje. This helps.
Enzu |
has anyone found a fix for this code to work in OF5 ?
I get this error when i wmake convertToCylindrical.C: In function ‘int main(int, char**)’: convertToCylindrical.C:118:21: error: ‘class Foam::IOobject’ has no member named ‘headerOk’ if (Uheader.headerOk()) ^ /opt/openfoam5/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/convertToCylindrical.o' failed make: *** [Make/linux64GccDPInt32Opt/convertToCylindrical.o] Error 1 |
I got the same error message. Any idea how to fix it?
Best regards, Mark |
Quote:
The way I worked around it was to use paraview for postProcessing, and I just used formulas In the calculator to convert the values that I needed from XYZ to cylindrical. I think the script was written for an older version of openfoam and doesn't work with newer versions |
Thank you Tom. This is also a solution but I would prefere the script solution due to automatize the process.
So no one who updated the script to newer versions of OF? |
Changing from Cartesian to cylindrical coordinates using a different origin
This is a quick comment for anyone who is trying to use the OpenFOAM library to change from a Cartesian coordinate system to a cylindrical coordinate system with a different origin. The conversion will not work using the code posted in this forum as the library assumes that the origin is still at [0 0 0].
A quick fix will be to translate the Cartesian coordinate system using the origin of the new cylindrical coordinates then doing the coordinate system conversion. For instance // Creating cylindrical coordinates cylindricalCS ccs ( "ccs", point(5.0, 0.0, 1.58), // centre point of ccs vector(0, -1, 0), // axis of ccs vector(0, 0, -1), // base axis for cylindrical angle false ); // The cartersian coordinates used by the simulation volVectorField cco = mesh.C(); dimensionedVector origin("origin", dimLength, vector(5.0, 0.0, 1.58)); volVectorField cc = cco - origin; polarCoord.primitiveFieldRef() = ccs.localVector(cc.internalField()); forAll(polarCoord.boundaryField(), patchI) { polarCoord.boundaryFieldRef()[patchI] = ccs.localVector(cc.boundaryField()[patchI]); } polarCoord.write(); This should work Quote:
|
Hi Ehimen, thank you for your help.
honestly I do not understand which file I have to modify according to your enries, is it the cylindricalCS.C file? Than I do not know where? Sorry for my unknowledge. |
Quote:
|
Sorry for my late reply. Thank you gu1, now it works.
But now I got Ucyl and Ualpha both with x,y, z option. Even if I take a look into the "convertTocylindric" file it is not quite clear to me what I see. (e.g. if I select Ucyl (x) looks quite different from Ucyl (y). Can you please explain me what I got if I choose Ualpha/Ucyl (x,y,z)? Thank you |
I would like to add, Ualpha (y,z) is zero.
My aim is to export U radial data, but I need an allocation to theta and range. |
All times are GMT -4. The time now is 20:57. |