|
[Sponsors] |
December 12, 2010, 00:02 |
|
#21 | |
Senior Member
|
Quote:
#include"OFstream.H" //declare a object and out the variable you want. file.dat is the name of the //file you need. OFstream os("file.dat"); forAll(mesh.C(), i) { os<<mesh.C()[i] <<" " <<u[i]<<endl; } |
||
January 17, 2011, 06:10 |
|
#22 |
Member
|
Hi SU
thank you very much for all of your helps. I would appreciate if you could answer my question. I have calculated Umean by introducing a function at system/controlDict of my case and I can see its contour with paraFoam. how I could export it (UMean) to a .dat file, similar to my last question about U ? |
|
January 17, 2011, 06:56 |
|
#23 | |
Senior Member
|
Quote:
|
||
January 17, 2011, 08:02 |
|
#24 | |
Member
|
Quote:
I would appreciate if you could help me. |
||
January 17, 2011, 08:55 |
|
#25 | |
Senior Member
|
Quote:
If you want to do it using a program, Just write a small tool for post processing. Read the file and write the internalField to a file OFstream os("file.dat"); forAll(UMean.C(), i) { os<<mesh.C()[i] <<" " <<UMean[i]<<endl; } |
||
January 17, 2011, 09:35 |
|
#26 | |
Member
|
Quote:
I wrote the code that you sent for me in applications/solvers/incompressible/pisoFoam/pisoFoam.C but when I compiled it, an error would be reported: write.H:55: error: ‘UMean’ was not declared in this scope I cant understand what is the problem, plz give me help! Last edited by yashar.afarin; January 17, 2011 at 10:41. |
||
January 17, 2011, 11:43 |
|
#27 |
Member
|
I am sorry. that was my silly reply. I know what you mean now. thanks for your reply.
|
|
February 22, 2011, 15:53 |
problems with mesh.cellCells()
|
#28 | |
New Member
Rudi T.
Join Date: Feb 2011
Location: Munich, Bavaria
Posts: 3
Rep Power: 15 |
Quote:
I'm just working on a possibility to refine locally on a selection of the mesh (blockMesh with refinementIterator). Since I have higher refinement levels I need to lay some buffer-layers around the selection. For this purpose I use the cellCells() function in multiple iterations. My problem is that cellCells() does not recognize all neighbours of already refined cells (The refinement history I have implemented works fine and has no bugs) . I'll give a little example: - 8 cells (= refinement level 3) on the west side of a simple refined cell (= 2 cells f.e. cell A and B). - this should give cell A as eastern neighbour for four of the tripple refined cells and cell B for the other four cells - instead of this cellCells returns only cell A as eastern neighbour for all eight cells!! And now the really big problem: This bug is not reproduceable, since the correct recognition of all neighbours works fine in the mesh of forwardStep (tutorials/compressible/rhoCentralFo...), but not in the mesh of counterFlow2D (tutorials/combustion/reactingFoam...) |
||
May 22, 2011, 21:22 |
|
#29 | |
Senior Member
|
Quote:
Is it possible describe it more for me? Where should be written this code and how should it be compiled? |
||
May 22, 2011, 23:38 |
|
#30 |
Senior Member
|
just write it in the time cycle. os declaration can be written in creatFields. H
You can write it like the following code if(runTime.outputTime()) //only write at outputTime point { forAll(mesh.C(), i) { os<<mesh.C()[i] <<" " <<u[i]<<endl; } } |
|
January 7, 2012, 19:24 |
|
#31 | |
Member
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16 |
Quote:
I am getting the following error when I use this: Code:
transientSimpleFoam.C: In function ‘int main(int, char**)’: transientSimpleFoam.C:123: error: expected initializer before ‘mesh’ transientSimpleFoam.C:124: error: ‘labelOfClosestCell’ was not declared in this scope Thank you. |
||
January 8, 2012, 13:08 |
|
#32 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
I think something is wrong with my formatting:
const point& location = (x,y,z); //your coordinates label labelOfClosestCell=mesh.findCell(location); Can you post your code? Thanks! Kathrin |
|
January 8, 2012, 16:52 |
|
#33 |
Member
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16 |
Kathrin,
Thanks for your reply. It was indeed the problem with the way I specified my location. I got it working. Thank you. |
|
May 23, 2012, 08:18 |
|
#34 |
Member
Kim Yusik
Join Date: Dec 2009
Posts: 39
Rep Power: 17 |
Hi, Junwei
I am trying to access the neighbour cells with parallel computing but it seems the cell which is placed adjacent to the interface between sub-domains does not recognize all neighbour cells. I followed the same as you mentioned which is briefly (I am using OF-2.1.x), mesh.cellCells()[cellI] So I am wondering that you have a similar experience and is there any possible solution on this? I also posted the question on this issue but I haven't got respose so far. http://www.cfd-online.com/Forums/ope...computing.html Thanks in advance. Yusik |
|
August 14, 2012, 11:56 |
|
#35 | |
New Member
Wei Liu
Join Date: Apr 2011
Location: West Lafayette, IN
Posts: 29
Rep Power: 15 |
Quote:
Could the p be a face in the internal field. If it could be, how can I define it? Many thanks! Wei |
||
October 2, 2012, 13:39 |
X, Y and Z of each cell
|
#36 |
Member
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14 |
hey, does anyone know how can I get the x, y and z of each cell?
|
|
September 23, 2013, 21:44 |
|
#37 |
New Member
Wei Liu
Join Date: Apr 2011
Location: West Lafayette, IN
Posts: 29
Rep Power: 15 |
||
September 25, 2013, 03:31 |
|
#38 |
Senior Member
|
The return value is a list of index of neighbor cells. cells can be distinguished from another from cell index, cell center, etc.
|
|
May 5, 2014, 16:38 |
|
#39 |
Member
CHARLES
Join Date: May 2013
Posts: 46
Rep Power: 13 |
I'm confused about how to access a specific cell using cellCells. For example, how can I use cellCells to access the NORTH cell of each cell in my domain?
Here's an example of what I would like to do... I know that the code may not compile, I'm just trying to explain what I'm doing. Code:
V=value; //V is a boundary field ('value' is calculated and varies across the domain) forAll(U, celli) { U[celli]=V[celli]; U[NORTH of celli] = U[celli]; } |
|
December 19, 2014, 02:58 |
|
#40 | |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
Quote:
Greeting Su Is it possible to detail your hint more clearly? I guess that the meshSearch.H should be added to the main code for instance reactingFoam.C . But what about Code:
meshSearch ms(mesh); label nearestCellIndex = ms.findNearestCell(p); Thanks for your hints. Best, Bobi |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
Determining cell neighbours on unstructured grid | orxan.shibli | Main CFD Forum | 4 | September 25, 2011 06:29 |
Help Me, what's the Cell Above any given cell in 3D. | gomane8 | Main CFD Forum | 3 | September 11, 2011 22:29 |
neighbours of a cell | Asghari | FLUENT | 17 | October 7, 2010 18:41 |
neighbours of a cell | Asghari | FLUENT | 0 | July 9, 2006 14:28 |