|
[Sponsors] |
![]() |
![]() |
#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. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
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. |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 ![]() |
Quote:
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. |
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
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 |
|
![]() |
![]() |
![]() |
![]() |
#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 |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
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 |
|
![]() |
![]() |
![]() |
![]() |
#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?
|
|
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20 ![]() |
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!" |
|
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
farahidayu
Join Date: Aug 2010
Posts: 20
Rep Power: 16 ![]() |
[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. |
|
![]() |
![]() |
![]() |
![]() |
#12 | |
Senior Member
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 18 ![]() |
Quote:
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! |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |
u,v,w in local Coordinate System | martin weghaus | CFX | 4 | March 12, 2004 11:06 |