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

Accessing velocity at inverse position

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2017, 08:13
Default Accessing velocity at inverse position
  #1
New Member
 
Join Date: Jun 2017
Posts: 3
Rep Power: 7
fusionfire21 is on a distinguished road
Hi guys,

I am trying to implement the following formula into my code:
\vec{v}_a = \frac{1}{2}(\vec{v}(\vec{r})+\vec{v}(-\vec{r}))

That is, I aim at calculating this "antisymmetric" velocity for every time step.
How can I implement especially the \vec{v}(-\vec{r}) part, i.e. the access to the velocity at the inverse position?
Of course, \vec{v}(\vec{r}) is simply implemented as
Code:
volVectorField U
Thank you very much in advance!

Regards
fusionfire
fusionfire21 is offline   Reply With Quote

Old   June 30, 2017, 23:41
Default
  #2
Senior Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 8
usv001 is on a distinguished road
Hi there,

What is your domain and mesh like? On the top of my head, I cannot think of a way to access velocity at the inverse location unless the mesh is a uniform structured Cartesian or cylindrical one.

USV
usv001 is offline   Reply With Quote

Old   July 1, 2017, 03:11
Default
  #3
New Member
 
Join Date: Jun 2017
Posts: 3
Rep Power: 7
fusionfire21 is on a distinguished road
Hi,
the domain is an ellipsoid with its center at the origin, generated with a rather complicated snappyHexMesh file. The coordinate system is cartesian though.
Regards
fusionfire21 is offline   Reply With Quote

Old   July 1, 2017, 03:24
Default
  #4
Senior Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 8
usv001 is on a distinguished road
Hi,

If your mesh is symmetrical about the origin, then perhaps you could build a volScalarField whose internalField consists of the indices of the cells centered at the corresponding inverse locations. Then, you could simply loop over the internalField to get your \vec{v_a}. If you do it carefully, you only need to loop over half the internalField since the values should be symmetric. But you must first build the volScalarField somehow.

Can you attach an image of your mesh? That could give others some ideas.

USV
usv001 is offline   Reply With Quote

Old   July 1, 2017, 03:28
Default
  #5
Senior Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 8
usv001 is on a distinguished road
Actually, if you mesh only the first octant and then mirror mesh to get the full mesh, you would get a symmetrical mesh about the origin. Then, the cell index at the inverse location could probably be obtained by adding a constant number to the cell index in the first four octants where z (or x or y) is positive.

USV
usv001 is offline   Reply With Quote

Reply

Tags
coordinates, position, velocity, volvectorfield

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
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 14 February 20, 2019 09:08
Results of CFX Simulations Sof_70_Usthb CFX 3 July 9, 2011 06:15
Accessing Velocity Components anfho OpenFOAM Programming & Development 1 June 30, 2011 19:21
accessing another velocity field in bc daviderzen OpenFOAM 0 April 20, 2011 06:24
Plot velocity profile at different position AirS Main CFD Forum 2 December 3, 2010 06:03


All times are GMT -4. The time now is 04:20.