CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

capturing cell centers

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2022, 00:31
Default capturing cell center to center distances
  #1
Member
 
hari charan
Join Date: Sep 2021
Location: India,hyderabad
Posts: 96
Rep Power: 4
saicharan662000@gmail.com is on a distinguished road
Hi guys,
I added a code for getting cell center to center distance. And I want only the center to center distances on x direction. But i am not getting the expected result. I am attaching the code

Code:
const unallocLabelList& neighbour = mesh.neighbour();
const unallocLabelList& owner = mesh.owner();
 const volVectorField& C = mesh.C();
forAll(owner, facei)
 {
  vector delta = C[neighbour[facei]] - C[owner[facei]];

  const dimensionedScalar len("len",dimLength,delta.component(vector::X));
 
  Info << "len: " << len.value() << " m" <<endl;
  
}
as my cell size is (0.01,0.0025,0.05) and uniform mesh I should get len = 0.01 all over the timesteps,
But i am getting worng result. I am attaching the result
Code:
len: 0.01 m
len: -8.67362e-19 m
len: 0.01 m
len: 1.73472e-18 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 6.93889e-18 m
len: 0.01 m
len: 2.08167e-17 m
len: 0.01 m
len: 6.93889e-18 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: -1.38778e-17 m
len: 0.01 m
len: 1.38778e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 2.77556e-17 m
len: 0.01 m
len: -1.38778e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: -2.77556e-17 m
len: 0.01 m
len: -2.77556e-17 m
len: 0.01 m
len: -2.77556e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: -2.77556e-17 m
len: 0.01 m
len: 2.77556e-17 m
len: 0.01 m
len: -2.77556e-17 m
len: 0.01 m
len: -5.55112e-17 m
len: 0.01 m
len: -8.32667e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 5.55112e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: -5.55112e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: -5.55112e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 5.55112e-17 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 0 m
len: 0.01 m
len: 5.55112e-17 m
len: 0.01 m
len: -5.55112e-17 m
Can anyone tell me whats wrong ? open to accept any advice.

Thanks in advance

Last edited by saicharan662000@gmail.com; May 27, 2022 at 04:48.
saicharan662000@gmail.com is offline   Reply With Quote

Reply

Tags
openfoam, openfoam8

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
How can I define the cell centers without using writeCellCenters? Taylorreihe OpenFOAM Post-Processing 4 February 19, 2016 12:46
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
Using a custom algorithm for cell center calculations Zvex OpenFOAM Programming & Development 7 June 30, 2013 05:01
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 23:55.