|
[Sponsors] |
February 9, 2007, 19:35 |
Is this the right way to compa
|
#1 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Is this the right way to compare two strings?
if(cPatch.name() == patchName) I've just checked doxygen online and I did not see any defined operator "==" for word or string class. If that's the case, then you compare two pointers, and I am surprised that it enters through that branch at all. Dragos |
|
February 10, 2007, 04:41 |
Mmm, I dont know if this is al
|
#2 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
Mmm, I dont know if this is allowed. It works though :-S Off course, this should be improved if necessary.
What really bothers me is the following: 1) p, Ux, Uy, Uz are not the values in the points. 2) 'strange' point ordering Regards, Frank
__________________
Frank Bos |
|
February 10, 2007, 06:37 |
Hi Frank,
I was looking thr
|
#3 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hi Frank,
I was looking through your code, and I think I might know what might be wrong... anyway... before going into that... In your case... you have a list of patch names... in the particular example.. only one patch "inlet". Instead of iterating over all the patches in the mesh trying to find the one you need, you can use: label patchIndex = mesh.boundaryMesh().findPatchID(patchName); That directly gives you the index to the patch you want. A general case where there is more than one patch in the list, you can do something similar to: const wordList patchNames(patchDict.lookup("patchNames")) forAll(patchNames,patchI) { label patchIndex = mesh.boundaryMesh().findPatchID(patchNames[patchI]); .. .. .. .. } Now for the anomaly you are noticing in the "U" and "p" values for the points on the patch.... I dont think you can directly obtain the values of these variables on points, because pressure "p" is solved on a per cell basis, which means, the value of "p" is calculated at the centre of each cell. The "U" variable is solved on a per face basis... so the velocity is calculated at the centre of each face. If I am not mistaken, if you want the exact value of these variables on node points, you will have to interpolate from the cell centre and face centre values. The other option is to say that the mesh is fine enough to enable you to assume that the pressure value for the point is the same as the pressure value at the centre of the cell the point belongs to, and velocity at the node is the same as that at the centre of the face it belongs to. I would be interested to know how you solve the problem, because I write small postprocessing routines in which I access pressure and face areas to calculate forces, etc... Have a nice weekend! Philippose |
|
February 12, 2007, 14:48 |
Hi Frank,
A Good day to you
|
#4 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hi Frank,
A Good day to you! I dont think the connectivity problem has anything to do with the code you have written. OpenFOAM uses a very clear method for handling the mesh as such. You can find detailed information regarding this in: UserGuide.pdf in your "OpenFOAM-1.3/doc/Guides-A4/" directory in chapter 6 section 1. In theory... the labels of points in the mesh, and the connectivity order are dependent on the mesh itself and the utility used to convert your original mesh to the openFOAM mesh format. If the geometry is simple, maybe you can try creating the mesh entirely yourself using "blockMesh". If the geometry is complicated, I dont think there is any method to dictate the mesh labeling you want to openFOAM. Anyway.... if I find something, shall let you know. Have a nice day! Philippose |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Monitor Point Values | Tristan | CFX | 2 | October 28, 2008 15:01 |
[OpenFOAM] How to calculate Values for veriables for point | vishal | ParaView | 1 | September 26, 2008 12:07 |
hw to plot the values at each grid point | rashmi | FLUENT | 0 | April 13, 2006 08:38 |
CFD VALUES AT EXPERIMENTAL POINT | J | FLUENT | 1 | September 25, 2005 17:55 |
output point values in CFX4 | Dougal McQueen | CFX | 1 | February 14, 2004 00:55 |