I want to collect the cell information and the pressure at nearby cells with their x and y co-ordinates as follows:
Co- ordnates(X Y) ... Cell Value (Pressure)(P).... neighboring cells(Pressure)(p1,p1,p3,p4)
Please tell me how to extract these information?
Thanks & Regards,
You can use the cellCells() member function in fvMesh, which returns the indices for the neighbouring cells.
Thanks for your reply..
Suppose I have to put a condition on the cell eg.
For all the cells
if X != 0
How to do this??
east and north cell values
Is there any way (any function) to get the value of a parameter at the east and north of a specific cell?
I would be thankful if you could help me. I want to add a loop right after solving the pressure equation to calculate a new pressure field based on:
newP(cell)=(30*P(cell) + p(neighbours) )/(30+No.neighbours)
Does the following work for it?
const vectorField& cCentre = mesh.C();
const labelListList& neighbour = mesh.cellCells();
labelList nCellID = neighbour[celli];
Thank you in advance...
Yes, it does look like it would produce the thing you are after; sort of!
First of all you are putting the computed value back into the field, which you are using as a source, so the final weighting cannot be predicted.
Secondly, this will only work for serial computations, as the weighting does not take the neighbouring cells on other processors into account.
Thirdly, the cellCells are only returning the cells, which have a face in common with the cell of interest. If you want all of the cells connected to the cell, i.e. also connected through a common point, then you would need to use pointCells and make a unique list of connected cells. Unique, because the pointCells information will give you multiple occurrences of the connected cell labels.
Fourthly. Are you really sure that this is what you want? Changing the pressure after its solution will essential/potentially ruin the pressure-velocity coupling.
thank you for your complete answer.
I am going to simulate cavitation in a complex geometry, and I just want to create a smoother pressure field in first few iterations.
PS: thanks for your hint about parallel issue...
|All times are GMT -4. The time now is 09:59.|