# Defining local coordinate system

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 14, 2009, 18:22 Defining local coordinate system #1 Senior Member   BastiL Join Date: Mar 2009 Posts: 530 Rep Power: 20 Hi, I want to define the directions for porosities based on their position in the mesh. Therefore I need a way to automatically define a local coordinate system that has a axis normal to a boundary patch (I know its name). How could this be realised? Looking forward for some advise. Thanks.

 April 15, 2009, 03:43 #2 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,900 Rep Power: 37 Hi Bastil First of all, the following assumes that the boundary patch is plane, thus the "x"-axis will be known as "mesh.Sf()[faceNo_1] / mag(mesh.Sf()[faceNo_1])", and as the patch is assumed to be plane, then a vector defined as vector yaxis(mesh.Cf()[faceNo_2] - mesh.Cf()[faceNo_1]); yaxis /= mag(yaxis) will be perpendicular to the face normal. The final axis, i.e. z-axis, is defined by the cross product of the two above. Here I assume that you know the face indices of two of the boundary faces on the patch. Best regards, Niels P.S. I use mag(mesh.Sf()[faceNo]) in stead of mesh.magSf() as I have had problems with it returning 0. Unfortunately I have not found where the bug is.

April 15, 2009, 05:21
#3
Senior Member

BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
Quote:
 Originally Posted by ngj Hi Bastil vector yaxis(mesh.Cf()[faceNo_2] - mesh.Cf()[faceNo_1]); yaxis /= mag(yaxis) will be perpendicular to the face normal. The final axis, i.e. z-axis, is defined by the cross product of the two above. Here I assume that you know the face indices of two of the boundary faces on the patch.
Thanks Niels,

I am not really sure how to use this? Can I write this code into a ControlDict? What about dependencies? Might be very helpful to have a little example.
I know the name of the patch but not the indices of two faces - how can I get this?

Thanks once more.

 April 15, 2009, 05:58 #4 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,900 Rep Power: 37 Hi Bastil Now you are talking about controlDict, I thought you simply wanted to make some addition to your solver. You need to elaborate a bit on what it is you actually want to achieve and especially how. Further I do not have any examples, as I have never been coding any such thing Best regards, Niels

 April 15, 2009, 07:57 #5 Senior Member   BastiL Join Date: Mar 2009 Posts: 530 Rep Power: 20 Well I have a mesh where I want to set some porosites. I know the name of the patches surrounding these porous zones and the cell zones of the porous media itself. I want to have a way to set the local coordinate system for each porosity so that one vector is normal to porous block. In generall this could be done in a program (maybe write a small preprocessing application?) or maybe another way? I have never done this before so I do not really know what is best. Regards BastiL

 April 15, 2009, 08:35 #6 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,900 Rep Power: 37 Hi Bastil Well, it does entirely depend on what you need this local coordinate system for?!? As you say preprocessing, then a small utility is probably the way forward, and I assume you might get some inspiration from e.g. setFields. Best regards, Niels

April 15, 2009, 09:01
#7
Senior Member

BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
Quote:
 Originally Posted by ngj Hi Bastil Well, it does entirely depend on what you need this local coordinate system for?!?

Sor setting my porosity values. So it is only for preprocessing.

Regards.

 April 15, 2009, 11:56 #8 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Copenhagen, Denmark Posts: 1,900 Rep Power: 37 Well, then you need to get the patch properties. The following might suffice: const label patchID = mesh.boundaryMesh().findPatchID("patchName"); // Get the patch ID const vectorField & cc = mesh.boundary()[patchID].Cf(); // Get the centroid of the individual boundary faces on the given patch const vectorField & NN = mesh.boundary()[patchID].Sf(); // Get the normal vector of the individual boundary faces on the given patch This information should be sufficient to generate the local coordinate system as the one you have requested. Best regards, Niels

February 12, 2010, 11:16
Coordinate System Components (v, w, x) ?
#9
New Member

Mdz
Join Date: Feb 2010
Posts: 6
Rep Power: 16
Hi, I have been using the version of ansys 12.1, and the coordinate system appears with these component (v, w, x) , I have not found the form to change it a (x, y, z), since I can do it?
Attached Images
 coordinates system.png (2.9 KB, 30 views)

February 13, 2010, 06:36
#10
Senior Member

Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
Quote:
 Originally Posted by Marcus081 Hi, I have been using the version of ansys 12.1, and the coordinate system appears with these component (v, w, x) , I have not found the form to change it a (x, y, z), since I can do it?
If you refer to the new FLUENT version I suggest you put into the FLUENT-Forum. This is OpenFOAM ... :-)
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"

 February 17, 2011, 19:40 to define a new axis/coordinate system for porous media #11 New Member   farahidayu Join Date: Aug 2010 Posts: 20 Rep Power: 15 [QUOTE=ngj;213029]Well, then you need to get the patch properties. The following might suffice: const label patchID = mesh.boundaryMesh().findPatchID("patchName"); // Get the patch ID const vectorField & cc = mesh.boundary()[patchID].Cf(); // Get the centroid of the individual boundary faces on the given patch const vectorField & NN = mesh.boundary()[patchID].Sf(); // Get the normal vector of the individual boundary faces on the given patch This information should be sufficient to generate the local coordinate system as the one you have requested. Hi, regarding the information given above, may I know where is it applicable? Where should I put the coding as above? In which file? I have same problem where I need to define the porosity of my intercooler but the intercooler does not follow the same axis as the default one. So, I need to define a new axis for the intercooler. Can anyone help? Thank you! Best regards.

August 8, 2011, 08:26
#12
Senior Member

mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 17
Quote:
 Originally Posted by bastil Hi, I want to define the directions for porosities based on their position in the mesh. Therefore I need a way to automatically define a local coordinate system that has a axis normal to a boundary patch (I know its name). How could this be realised? Looking forward for some advise. Thanks.
Hello every1!

kinda ressurecting the topic but i got the same issue.. i need to create a local coordinate system, but it is a cylindrical one so that i can indicate it in the porouszone dict and set the resistences??

thx a lot!